NtpMRModule Class Reference

#include <NtpMRModule.h>

Inheritance diagram for NtpMRModule:
JobCModule

List of all members.

Public Member Functions

 NtpMRModule ()
 ~NtpMRModule ()
const RegistryDefaultConfig () const
void Config (const Registry &r)
JobCResult Reco (MomNavigator *mom)

Private Member Functions

void FillNtpSummary (NtpMRRecord *ntprec, const CandRecord *cndrec)
void FillNtpEvent (NtpMRRecord *ntprec, const CandRecord *cndrec)
void FillNtpTruth (NtpMRRecord *ntprec, const CandRecord *cndrec)

Private Attributes

std::map< int, std::vector< int > > fStripMap
std::map< int, std::vector< int > > fMRInfoMap
std::map< int, int > fNStrips
std::map< int, int > fMREventUidMap
std::map< int, float > fBestPur
std::map< int, float > fBestCom
std::map< int, float > fBestPurPHW
std::map< int, float > fBestComPHW
std::map< int, float > fElecCom
std::map< int, float > fElecComPHW
std::map< int, float > fCombCom
std::map< int, float > fCombComPHW
std::map< int, int > fMRElecEventUidMap
std::map< int, int > fMRCombEventUidMap
std::map< int, float > fBestElecCom
std::map< int, float > fBestCombCom
std::map< int, float > fBestElecComPHW
std::map< int, float > fBestCombComPHW

Detailed Description

Definition at line 20 of file NtpMRModule.h.


Constructor & Destructor Documentation

NtpMRModule::NtpMRModule (  )  [inline]

Definition at line 23 of file NtpMRModule.h.

00023 {};

NtpMRModule::~NtpMRModule (  )  [inline]

Definition at line 24 of file NtpMRModule.h.

00024 {};


Member Function Documentation

void NtpMRModule::Config ( const Registry r  )  [virtual]

Return the actual configuration. If your module directly pulls its configuration from the fConfig Registry, you don't need to override this. Override if you have local config variables.

Reimplemented from JobCModule.

Definition at line 70 of file NtpMRModule.cxx.

References Msg::kDebug, and MSG.

00070                                               {
00071   
00072   MSG("NtpMR",Msg::kDebug) << "NtpMRModule::Config" << endl;
00073   
00074 }

const Registry & NtpMRModule::DefaultConfig ( void   )  const [virtual]

Get the default configuration registry. This should normally be overridden. One useful idiom is to implement it like:

const Registry& MyModule::DefaultConfig() const { static Registry cfg; // never is destroyed if (cfg.Size()) return cfg; // already filled it // set defaults: cfg.Set("TheAnswer",42); cfg.Set("Units","unknown"); return cfg; }

Reimplemented from JobCModule.

Definition at line 52 of file NtpMRModule.cxx.

References JobCModule::GetName(), Msg::kDebug, Registry::LockValues(), MSG, and Registry::UnLockValues().

00052                                                  {
00053 
00054   MSG("NtpMR",Msg::kDebug) << 
00055     "NtpMRModule::DefaultConfig" << endl;
00056 
00057   static Registry r; 
00058   std::string name = this->JobCModule::GetName();
00059   name += ".config.default";
00060   r.SetName(name.c_str());
00061 
00062   r.UnLockValues();
00063   r.LockValues();
00064   
00065   return r;
00066 }

void NtpMRModule::FillNtpEvent ( NtpMRRecord ntprec,
const CandRecord cndrec 
) [private]

Definition at line 383 of file NtpMRModule.cxx.

References NtpMREvent::AddStripAt(), NtpMREvent::azimuth, NtpMREvent::best_comb_complete, NtpMREvent::best_comb_complete_phw, NtpMREvent::best_comb_event, NtpMREvent::best_complete, NtpMREvent::best_complete_phw, NtpMREvent::best_elec_complete, NtpMREvent::best_elec_complete_phw, NtpMREvent::best_elec_event, NtpMREvent::best_event, NtpMREvent::best_purity, NtpMREvent::best_purity_phw, NtpMREvent::comb_complete, NtpMREvent::comb_complete_phw, NtpMREvent::elec_complete, NtpMREvent::elec_complete_phw, NtpMREvent::endc, NtpMREvent::enddistance, NtpMREvent::endp, NtpMREvent::endx, NtpMREvent::endy, NtpMREvent::endz, fBestCom, fBestCombCom, fBestCombComPHW, fBestComPHW, fBestElecCom, fBestElecComPHW, fBestPur, fBestPurPHW, fCombCom, fCombComPHW, fElecCom, fElecComPHW, NtpMREvent::fitp, fMRCombEventUidMap, fMRElecEventUidMap, fMREventUidMap, fMRInfoMap, fNStrips, fStripMap, CandHandle::GetDaughterIterator(), NtpMREvent::index, Msg::kVerbose, Msg::kWarning, NtpMRRecord::mrevt, NtpMREvent::mrmEshw, NtpMREvent::mrmpmux, NtpMREvent::mrmpmuy, NtpMREvent::mrmpmuz, NtpMREvent::mrmQ2, MSG, NtpMREvent::mxpl, NtpMREvent::ndigit, NtpMREvent::npln, NtpMREvent::orig_event, NtpMREvent::pass, NtpMREvent::pcrv, NtpMREvent::pmux, NtpMREvent::pmuy, NtpMREvent::pmuz, NtpMREvent::prng, NtpMREvent::pvdx, NtpMREvent::pvdy, NtpMREvent::pvdz, NtpMREvent::shwcharge, NtpMREvent::shwendplane, NtpMREvent::shwendx, NtpMREvent::shwendy, NtpMREvent::shwendz, NtpMREvent::shwnplane, NtpMREvent::shwvtxplane, NtpMREvent::shwvtxx, NtpMREvent::shwvtxy, NtpMREvent::shwvtxz, NtpMREvent::vtxdistance, NtpMREvent::vtxp, NtpMREvent::vtxx, NtpMREvent::vtxy, NtpMREvent::vtxz, and NtpMREvent::zenith.

Referenced by Reco().

00383                                                                            {
00384 
00385   MSG("NtpMR",Msg::kVerbose) << "NtpMRModule::FillNtpEvent" << endl;
00386 
00387   const CandRmMuListHandle *rmmulisthandle 
00388     = dynamic_cast <const CandRmMuListHandle*> 
00389     (cndrec -> FindCandHandle("CandRmMuListHandle"));
00390   if ( !rmmulisthandle ) return; // all done
00391   
00392   Int_t nmrevt = 0;
00393   TIter rmmuItr(rmmulisthandle->GetDaughterIterator());
00394   TClonesArray& rmmuarray = *(ntprec->mrevt);
00395   while (CandRmMuHandle* rmmu = 
00396          dynamic_cast<CandRmMuHandle*> (rmmuItr())) {
00397     
00398     UInt_t uid = rmmu->GetUidInt();
00399     NtpMREvent* ntprmmu = new(rmmuarray[nmrevt++]) NtpMREvent(fNStrips[uid]);
00400     ntprmmu->index             = nmrevt - 1;
00401     ntprmmu->ndigit            = rmmu->GetNDaughters();    
00402     ntprmmu->orig_event        = rmmu->GetOrigEvtIndex();
00403     ntprmmu->best_event        = fMREventUidMap[uid];
00404     ntprmmu->best_purity       = fBestPur[uid];
00405     ntprmmu->best_complete     = fBestCom[uid];
00406     ntprmmu->best_purity_phw   = fBestPurPHW[uid];
00407     ntprmmu->best_complete_phw = fBestComPHW[uid];
00408     ntprmmu->elec_complete     = fElecCom[uid];
00409     ntprmmu->elec_complete_phw = fElecComPHW[uid];
00410 
00411     ntprmmu->comb_complete     = fCombCom[uid];
00412     ntprmmu->comb_complete_phw = fCombComPHW[uid];
00413     ntprmmu->best_elec_complete     = fBestElecCom[uid];
00414     ntprmmu->best_elec_complete_phw = fBestElecComPHW[uid];
00415     ntprmmu->best_comb_complete     = fBestCombCom[uid];
00416     ntprmmu->best_comb_complete_phw = fBestCombComPHW[uid];
00417     ntprmmu->best_elec_event        = fMRElecEventUidMap[uid];
00418     ntprmmu->best_comb_event        = fMRCombEventUidMap[uid];
00419 
00420     
00421     //fill strip array
00422     std::vector<int> stpVec = fStripMap[uid];
00423     std::vector<int> mrinfoVec = fMRInfoMap[uid];
00424     for(unsigned int i = 0;i<(unsigned int)(fNStrips[uid]);i++){
00425       if (mrinfoVec.size() > i) {
00426         ntprmmu->AddStripAt(stpVec[i],mrinfoVec[i],i);
00427       }
00428     else {
00429         ntprmmu->AddStripAt(stpVec[i],0,i);
00430         MSG("NtpMR",Msg::kWarning)
00431            << "Attempt to add Strip to ntprmmu from non-existent "
00432            << "element i = " << i << " of mrinfoVec (=fMRInfoMap[uid])."
00433            << endl << "Use 0 instead of mrinfoVec[" << i  << "]."
00434            << endl;
00435       }
00436     }
00437 
00438     // added by J. Ling
00439  
00440     ntprmmu->shwvtxx = rmmu->GetShwVtxX();
00441     ntprmmu->shwvtxy = rmmu->GetShwVtxY();
00442     ntprmmu->shwvtxz = rmmu->GetShwVtxZ();
00443     ntprmmu->shwendx = rmmu->GetShwEndX();
00444     ntprmmu->shwendy = rmmu->GetShwEndY();
00445     ntprmmu->shwendz = rmmu->GetShwEndZ();
00446     ntprmmu->shwvtxplane = rmmu->GetShwVtxPlane();
00447     ntprmmu->shwendplane = rmmu->GetShwEndPlane();
00448     ntprmmu->shwnplane = rmmu->GetShwNPlane();    
00449     ntprmmu->shwcharge = rmmu->GetShwCharge(); 
00450 
00451     ntprmmu->vtxx = rmmu->GetVtxX();
00452     ntprmmu->vtxy = rmmu->GetVtxY();
00453     ntprmmu->vtxz = rmmu->GetVtxZ();
00454     ntprmmu->vtxdistance = rmmu->GetVtxDistance();
00455     ntprmmu->endx = rmmu->GetEndX();
00456     ntprmmu->endy = rmmu->GetEndY();
00457     ntprmmu->endz = rmmu->GetEndZ();
00458     ntprmmu->enddistance = rmmu->GetEndDistance();
00459     ntprmmu->vtxp = rmmu->GetVtxPlane();
00460     ntprmmu->endp = rmmu->GetEndPlane();
00461     ntprmmu->npln = rmmu->GetNPlane();
00462     ntprmmu->prng = rmmu->GetMomRange();
00463     ntprmmu->pcrv = rmmu->GetMomCurv();
00464     ntprmmu->pvdx = rmmu->GetVtxDCosX();
00465     ntprmmu->pvdy = rmmu->GetVtxDCosY();
00466     ntprmmu->pvdz = rmmu->GetVtxDCosZ();
00467     ntprmmu->zenith = rmmu->GetZenith();
00468     ntprmmu->azimuth = rmmu->GetAzimuth();
00469     ntprmmu->fitp = rmmu->GetFitPass();
00470     ntprmmu->endc = rmmu->GetIsCont();
00471     ntprmmu->pass = rmmu->GetPass();
00472     ntprmmu->pmux = rmmu->GetMomX();
00473     ntprmmu->pmuy = rmmu->GetMomY();
00474     ntprmmu->pmuz = rmmu->GetMomZ();
00475     ntprmmu->mxpl = rmmu->GetMaxTrkPlane();
00476     ntprmmu->mrmpmux = rmmu->GetMRMX();
00477     ntprmmu->mrmpmuy = rmmu->GetMRMY();
00478     ntprmmu->mrmpmuz = rmmu->GetMRMZ();
00479     ntprmmu->mrmQ2   = rmmu->GetMRMQ2();
00480     ntprmmu->mrmEshw = rmmu->GetMRMEshw();
00481   }
00482 
00483   return;
00484 }

void NtpMRModule::FillNtpSummary ( NtpMRRecord ntprec,
const CandRecord cndrec 
) [private]

Definition at line 146 of file NtpMRModule.cxx.

References digit(), fBestCom, fBestCombCom, fBestCombComPHW, fBestComPHW, fBestElecCom, fBestElecComPHW, fBestPur, fBestPurPHW, fCombCom, fCombComPHW, fElecCom, fElecComPHW, fMRCombEventUidMap, fMRElecEventUidMap, fMREventUidMap, fMRInfoMap, fNStrips, fStripMap, CandHandle::GetDaughterIterator(), CalDigitType::kPE, RmMuMask::kRMMU_ISMCELEC_MASK, RmMuMask::kRMMU_ISRETAIN_MASK, Msg::kVerbose, NtpMRRecord::mrhdr, MSG, NtpMRSummary::nmatchevt, NtpMRSummary::nmrevt, and SetCandDigitPlexListInEquivTestState().

Referenced by Reco().

00147                                                           {
00148   
00149   MSG("NtpMR",Msg::kVerbose) << "NtpMRModule::FillNtpSummary" << endl;
00150   
00151   const CandStripListHandle *striplist
00152     = dynamic_cast <const CandStripListHandle*> 
00153     (cndrec -> FindCandHandle("CandStripListHandle"));
00154   if(!striplist) return;
00155 
00156   const CandEventListHandle *eventlist 
00157     = dynamic_cast <const CandEventListHandle*> 
00158     (cndrec -> FindCandHandle("CandEventListHandle"));
00159   if(!eventlist) return;
00160 
00161   const CandRmMuListHandle *rmmulist 
00162     = dynamic_cast<const CandRmMuListHandle*>
00163     (cndrec-> FindCandHandle("CandRmMuListHandle"));
00164   if(!rmmulist) return;
00165 
00166   TIter rmmuItr(rmmulist->GetDaughterIterator());
00167   TIter stripItr(striplist->GetDaughterIterator());
00168 
00169   SetCandDigitPlexListInEquivTestState(0);
00170 
00171   while(CandRmMuHandle* rmmu = 
00172         dynamic_cast<CandRmMuHandle*>(rmmuItr())) {    
00173     Int_t uid = rmmu->GetUidInt();
00174     Int_t nmrstp = 0;
00175     std::vector<int> stpVec;
00176     std::vector<int> mrinfoVec;
00177     Int_t nstrip = 0;
00178     stripItr.Reset();
00179     while (CandStripHandle* strip = 
00180            dynamic_cast<CandStripHandle*> (stripItr())) {
00181       Bool_t gotStrip = false;
00182       Int_t rfk = 0;
00183       TIter digitItr(strip->GetDaughterIterator());
00184       while(CandDigitHandle* digit =
00185             dynamic_cast<CandDigitHandle*>(digitItr())){
00186         TIter mrdigitItr(rmmu->GetDaughterIterator());
00187         while(CandDigitHandle* mrdigit =
00188               dynamic_cast<CandDigitHandle*>(mrdigitItr())){
00189           if(mrdigit->IsEquivalent(digit)) {
00190             Int_t tmp_rfk = rmmu->ReasonForKeeping(mrdigit);
00191             if(rfk==0) rfk = tmp_rfk; //first digit
00192             else if( (tmp_rfk & RmMuMask::kRMMU_ISMCELEC_MASK) && 
00193                      !(rfk & RmMuMask::kRMMU_ISMCELEC_MASK) ) 
00194               rfk |= RmMuMask::kRMMU_ISMCELEC_MASK;
00195             else if( (tmp_rfk & RmMuMask::kRMMU_ISRETAIN_MASK) && 
00196                      !(rfk & RmMuMask::kRMMU_ISRETAIN_MASK) && 
00197                      (rfk & RmMuMask::kRMMU_ISMCELEC_MASK) ) {
00198               rfk = tmp_rfk;
00199               rfk |= RmMuMask::kRMMU_ISMCELEC_MASK;
00200             }
00201             gotStrip = true;
00202             break;
00203           }
00204         }
00205       }
00206       if(gotStrip){
00207         stpVec.push_back(nstrip);
00208         mrinfoVec.push_back(rfk);
00209         nmrstp += 1;
00210       }
00211       nstrip++;
00212     }
00213     fStripMap.insert(std::make_pair(uid,stpVec));
00214     fMRInfoMap.insert(std::make_pair(uid,mrinfoVec));
00215     fNStrips.insert(std::make_pair(uid,nmrstp));
00216   }
00217 
00218   TIter eventItr(eventlist->GetDaughterIterator());
00219 
00220   rmmuItr.Reset();
00221   Int_t rmmuCounter = 0;
00222   Int_t nMatched = 0;
00223   while(CandRmMuHandle* rmmu = 
00224         dynamic_cast<CandRmMuHandle*>(rmmuItr())) {    
00225     Int_t bestMatch = -1;
00226     Float_t bestPur = 0;
00227     Float_t bestCom = 0;
00228     Float_t bestPurPHW = 0;
00229     Float_t bestComPHW = 0;
00230     Float_t elecCom = 0;
00231     Float_t elecComPHW = 0;
00232 
00233     Float_t bestElecCom = 0;
00234     Float_t bestElecComPHW = 0;
00235     Int_t   bestElecMatch = -1;
00236     Float_t combCom = 0;
00237     Float_t combComPHW = 0;     
00238     Float_t bestCombCom = 0;
00239     Float_t bestCombComPHW = 0;
00240     Int_t   bestCombMatch = -1;
00241     
00242 
00243     if(rmmu->GetNDaughters()>0) {
00244       Int_t evtCounter = 0;
00245       eventItr.Reset();
00246       while(CandEventHandle* event = 
00247             dynamic_cast<CandEventHandle*>(eventItr())){        
00248         Int_t nshareddigits = 0;
00249         Float_t shareddigPH = 0;
00250         Int_t nelecshareddigits = 0;
00251         Float_t elecshareddigPH = 0;
00252         Int_t nretshareddigits = 0;
00253         Float_t retshareddigPH = 0;
00254         Int_t nevtdigits = 0;
00255         Float_t evtdigPH = 0;
00256         TIter stripItr(event->GetDaughterIterator());
00257         while(CandStripHandle* strip =
00258               dynamic_cast<CandStripHandle*>(stripItr())){
00259           TIter digitItr(strip->GetDaughterIterator());
00260           while(CandDigitHandle* digit =
00261                 dynamic_cast<CandDigitHandle*>(digitItr())){
00262             nevtdigits+=1;
00263             evtdigPH+=digit->GetCharge(CalDigitType::kPE);
00264             TIter mrdigitItr(rmmu->GetDaughterIterator());
00265             while(CandDigitHandle* mrdigit =
00266                   dynamic_cast<CandDigitHandle*>(mrdigitItr())){              
00267               if(mrdigit->IsEquivalent(digit)) {                
00268                 nshareddigits+=1;
00269                 shareddigPH+=digit->GetCharge(CalDigitType::kPE);
00270                 Int_t rfk = rmmu->ReasonForKeeping(mrdigit);
00271                 if(rfk & RmMuMask::kRMMU_ISRETAIN_MASK) {
00272                   nretshareddigits+=1;
00273                   retshareddigPH+=digit->GetCharge(CalDigitType::kPE);
00274                 }
00275                 if(rfk & RmMuMask::kRMMU_ISMCELEC_MASK) {
00276                   nelecshareddigits+=1;
00277                   elecshareddigPH+=digit->GetCharge(CalDigitType::kPE);
00278                 }
00279                 break;
00280               }
00281             }
00282           }
00283         }
00284 
00285         Int_t totrmmu = 0;
00286         Int_t totelecrmmu = 0;
00287         Int_t totretrmmu = 0;
00288         Float_t totrmmuPE = 0;
00289         Float_t totelecrmmuPE = 0;
00290         Float_t totretrmmuPE = 0;
00291         TIter mrdigiItr(rmmu->GetDaughterIterator());
00292         while(CandDigitHandle* mrdigit =
00293               dynamic_cast<CandDigitHandle*>(mrdigiItr())){
00294           totrmmu += 1;
00295           totrmmuPE += mrdigit->GetCharge(CalDigitType::kPE);
00296           Int_t rfk = rmmu->ReasonForKeeping(mrdigit);
00297           if(rfk & RmMuMask::kRMMU_ISRETAIN_MASK){ //isRetained
00298             totretrmmu += 1;
00299             totretrmmuPE += mrdigit->GetCharge(CalDigitType::kPE);
00300           }
00301           if(rfk & RmMuMask::kRMMU_ISMCELEC_MASK) { //isMCElectron
00302             totelecrmmu += 1;
00303             totelecrmmuPE += mrdigit->GetCharge(CalDigitType::kPE);
00304           }
00305         }
00306 
00307         Float_t com = 0;
00308         Float_t comPH = 0;
00309         Float_t ecom = 0;
00310         Float_t ecomPH = 0;
00311         Float_t ccom = 0;
00312         Float_t ccomPH = 0;
00313 
00314         Float_t totCount = float(nretshareddigits) + float(nelecshareddigits);
00315         Float_t totCountPH = retshareddigPH + elecshareddigPH;
00316 
00317         if(totretrmmu)       com = float(nretshareddigits) / float(totretrmmu);
00318         if(totretrmmuPE)   comPH = retshareddigPH / totretrmmuPE;
00319         if(totelecrmmu)     ecom = float(nelecshareddigits) / float(totelecrmmu);
00320         if(totelecrmmuPE) ecomPH = elecshareddigPH / totelecrmmuPE;
00321         if(totretrmmu + totelecrmmu)  
00322                             ccom = totCount / float(totretrmmu + totelecrmmu); 
00323         if(totretrmmuPE+totelecrmmuPE)
00324                           ccomPH = totCountPH / (totretrmmuPE+totelecrmmuPE);
00325 
00326         if(comPH>bestComPHW) {
00327           bestComPHW = comPH;
00328           bestPurPHW = shareddigPH / evtdigPH;
00329           bestCom = com;
00330           bestPur = float(nshareddigits) / float(nevtdigits);     
00331           elecComPHW = ecomPH;
00332           elecCom = ecom;
00333           combCom = ccom;
00334           combComPHW = ccomPH;
00335           bestMatch = evtCounter;
00336         }
00337         if(ecomPH>bestElecComPHW){
00338           bestElecComPHW = ecomPH;
00339           bestElecCom = ecom;
00340           bestElecMatch = evtCounter;
00341         }
00342         if(ccomPH>bestCombComPHW){
00343           bestCombComPHW = ccomPH;
00344           bestCombCom = ccom;
00345           bestCombMatch = evtCounter;
00346         }
00347         evtCounter+=1;
00348       }
00349     }
00350     Int_t uid = rmmu->GetUidInt();
00351     fMREventUidMap.insert(std::make_pair(uid,bestMatch));
00352     fBestPurPHW.insert(std::make_pair(uid,bestPurPHW));
00353     fBestComPHW.insert(std::make_pair(uid,bestComPHW));
00354     fBestPur.insert(std::make_pair(uid,bestPur));
00355     fBestCom.insert(std::make_pair(uid,bestCom));
00356     fElecComPHW.insert(std::make_pair(uid,elecComPHW));
00357     fElecCom.insert(std::make_pair(uid,elecCom));
00358     fCombCom.insert(std::make_pair(uid,combCom));
00359     fCombComPHW.insert(std::make_pair(uid,combComPHW));
00360 
00361     fMRElecEventUidMap.insert(std::make_pair(uid,bestElecMatch));
00362     fMRCombEventUidMap.insert(std::make_pair(uid,bestCombMatch));
00363 
00364     fBestElecComPHW.insert(std::make_pair(uid,bestElecComPHW));
00365     fBestElecCom.insert(std::make_pair(uid,bestElecCom));
00366     fBestCombCom.insert(std::make_pair(uid,bestCombCom));
00367     fBestCombComPHW.insert(std::make_pair(uid,bestCombComPHW));
00368 
00369     if(bestComPHW>0) nMatched += 1;
00370     rmmuCounter+=1;    
00371   }
00372 
00373   NtpMRSummary& ntpsummary = ntprec->mrhdr;
00374   ntpsummary.nmrevt = rmmuCounter;
00375   ntpsummary.nmatchevt = nMatched;
00376 
00377   SetCandDigitPlexListInEquivTestState(1);
00378   
00379   return;
00380 
00381 }

void NtpMRModule::FillNtpTruth ( NtpMRRecord ntprec,
const CandRecord cndrec 
) [private]

Definition at line 486 of file NtpMRModule.cxx.

References CandHandle::GetDaughterIterator(), Msg::kVerbose, NtpMRRecord::mrtru, MSG, NtpMRTruth::nMuonDig, NtpMRTruth::nMuonDigRetained, NtpMRTruth::nPERetained, NtpMRTruth::nPERetainedBoth, NtpMRTruth::nPERetainedMuon, NtpMRTruth::nPERetainedShw, NtpMRTruth::nRejected, NtpMRTruth::nRejectedBoth, NtpMRTruth::nRejectedMuon, NtpMRTruth::nRejectedShw, NtpMRTruth::nRejShw, NtpMRTruth::nRejShwFakeTrk, NtpMRTruth::nRejShwMaxTrk, NtpMRTruth::nRejShwMix, NtpMRTruth::nRetained, NtpMRTruth::nRetainedBoth, NtpMRTruth::nRetainedMuon, NtpMRTruth::nRetainedShw, NtpMRTruth::nShwDig, NtpMRTruth::nShwDigAtVtx, NtpMRTruth::nShwDigRetained, NtpMRTruth::nShwDigRetainedAtVtx, NtpMRTruth::nShwPE, NtpMRTruth::nShwPEAtVtx, NtpMRTruth::nShwPERetained, and NtpMRTruth::nShwPERetainedAtVtx.

Referenced by Reco().

00486                                                                            {
00487   
00488   MSG("NtpMR",Msg::kVerbose) << "NtpMRModule::FillNtpTruth" << endl;
00489 
00490   const CandRmMuListHandle *rmmulisthandle 
00491     = dynamic_cast <const CandRmMuListHandle*> 
00492     (cndrec -> FindCandHandle("CandRmMuListHandle"));
00493   if ( !rmmulisthandle ) return; // all done
00494   
00495   Int_t nmrevt = 0;
00496   TIter rmmuItr(rmmulisthandle->GetDaughterIterator());
00497   TClonesArray& rmmuarray = *(ntprec->mrtru);
00498   while (CandRmMuHandle* rmmu = 
00499          dynamic_cast<CandRmMuHandle*> (rmmuItr())) {
00500 
00501     NtpMRTruth* ntprmmu = new(rmmuarray[nmrevt++]) NtpMRTruth();    
00502     ntprmmu->nMuonDig               = rmmu->GetNMuonDig();
00503     ntprmmu->nMuonDigRetained       = rmmu->GetNMuonDigRetained();
00504     ntprmmu->nShwDig                = rmmu->GetNShwDig(); 
00505     ntprmmu->nShwDigRetained        = rmmu->GetNShwDigRetained();
00506     ntprmmu->nShwDigAtVtx           = rmmu->GetNShwDigAtVtx();
00507     ntprmmu->nShwDigRetainedAtVtx   = rmmu->GetNShwDigRetainedAtVtx();
00508     ntprmmu->nShwPE                 = rmmu->GetNShwPE();
00509     ntprmmu->nShwPERetained         = rmmu->GetNShwPERetained();
00510     ntprmmu->nShwPEAtVtx            = rmmu->GetNShwPEAtVtx();
00511     ntprmmu->nShwPERetainedAtVtx    = rmmu->GetNShwPERetainedAtVtx();
00512     ntprmmu->nRetained              = rmmu->GetNRetained();
00513     ntprmmu->nRetainedMuon          = rmmu->GetNRetainedMuon();
00514     ntprmmu->nRetainedShw           = rmmu->GetNRetainedShw(); 
00515     ntprmmu->nRetainedBoth          = rmmu->GetNRetainedBoth();
00516     ntprmmu->nPERetained            = rmmu->GetPERetained();  
00517     ntprmmu->nPERetainedMuon        = rmmu->GetPERetainedMuon();
00518     ntprmmu->nPERetainedShw         = rmmu->GetPERetainedShw();
00519     ntprmmu->nPERetainedBoth        = rmmu->GetPERetainedBoth();
00520     ntprmmu->nRejected              = rmmu->GetNRejected();
00521     ntprmmu->nRejectedMuon          = rmmu->GetNRejectedMuon();
00522     ntprmmu->nRejectedShw           = rmmu->GetNRejectedShw();
00523     ntprmmu->nRejectedBoth          = rmmu->GetNRejectedBoth();
00524     ntprmmu->nRejShw                = rmmu->GetNRejShw();
00525     ntprmmu->nRejShwMaxTrk          = rmmu->GetNRejShwMaxTrk();
00526     ntprmmu->nRejShwFakeTrk         = rmmu->GetNRejShwFakeTrk();
00527     ntprmmu->nRejShwMix             = rmmu->GetNRejShwMix();
00528   }
00529 
00530   return;
00531 }

JobCResult NtpMRModule::Reco ( MomNavigator mom  )  [virtual]

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 78 of file NtpMRModule.cxx.

References fBestCom, fBestCombCom, fBestCombComPHW, fBestComPHW, fBestElecComPHW, fBestPur, fBestPurPHW, fCombCom, fCombComPHW, fElecCom, fElecComPHW, FillNtpEvent(), FillNtpSummary(), FillNtpTruth(), fMRCombEventUidMap, fMRElecEventUidMap, fMREventUidMap, fMRInfoMap, fNStrips, fStripMap, DataUtil::GetCandHeader(), RawDaqSnarlHeader::GetErrorCode(), CandHeader::GetEvent(), MomNavigator::GetFragment(), DataUtil::GetRawHeader(), RawDaqSnarlHeader::GetRemoteSpillType(), RawDaqHeader::GetRun(), RawDaqHeader::GetRunType(), VldContext::GetSimFlag(), RawDaqSnarlHeader::GetSnarl(), RawDaqHeader::GetSubRun(), RawDaqHeader::GetTimeFrameNum(), RawDaqSnarlHeader::GetTrigSrc(), RecMinos::GetVldContext(), RecMinosHdr::GetVldContext(), Msg::kDebug, SimFlag::kMC, JobCResult::kPassed, Msg::kWarning, MSG, JobCResult::SetFailed(), and JobCResult::SetWarning().

00078                                               {
00079   
00080   JobCResult result(JobCResult::kPassed);  
00081   MSG("NtpMR",Msg::kDebug) << "NtpMRModule::Reco" << endl;
00082 
00083   // Reset maps used to associate uid of reconstructed object with array index
00084   fStripMap.clear();
00085   fNStrips.clear();
00086   fMREventUidMap.clear();
00087   fBestPur.clear();
00088   fBestCom.clear();
00089   fBestPurPHW.clear();
00090   fBestComPHW.clear();
00091   fElecCom.clear();
00092   fElecComPHW.clear();
00093 
00094 // Sue noticed this was missing.  Added by gmieg 10Dec2009
00095   fMRInfoMap.clear();
00096  
00097   fMRElecEventUidMap.clear();
00098   fMRCombEventUidMap.clear();
00099   fBestElecComPHW.clear();
00100   fCombCom.clear();
00101   fCombComPHW.clear();
00102   fBestElecComPHW.clear();
00103   fBestCombCom.clear();
00104   fBestCombComPHW.clear();
00105 
00106   // Check that mom exists.
00107   assert(mom);
00108   
00109   const RawRecord* rawrec = dynamic_cast<const RawRecord*>
00110     (mom->GetFragment("RawRecord","","DaqSnarl"));
00111   if (!rawrec) {
00112     MSG("NtpMR",Msg::kWarning) << "No DaqSnarl RawRecord in Mom" << endl;
00113     result.SetWarning().SetFailed();
00114     return result;
00115   }
00116 
00117   const CandRecord* cndrec = dynamic_cast<const CandRecord*>
00118     (mom->GetFragment("CandRecord","PrimaryCandidateRecord")); 
00119   if (!cndrec) {
00120     MSG("NtpMR",Msg::kWarning) << "No PrimaryCandidateRecord in Mom" << endl;
00121     result.SetWarning().SetFailed();
00122     return result;
00123   }
00124 
00125   // Extract header from CandRecord and use this to create RecCandHeader
00126   // and NtpMRRecord.
00127   const CandHeader* cndhdr = cndrec -> GetCandHeader();
00128   const RawDaqSnarlHeader* rawhdr = dynamic_cast<const RawDaqSnarlHeader*>
00129     (rawrec -> GetRawHeader());
00130   RecCandHeader ntphdr(rawhdr->GetVldContext(),rawhdr->GetRun(),
00131                        rawhdr->GetSubRun(),rawhdr->GetRunType(),
00132                        rawhdr->GetErrorCode(),rawhdr->GetSnarl(),
00133                        rawhdr->GetTrigSrc(),rawhdr->GetTimeFrameNum(),
00134                        rawhdr->GetRemoteSpillType(),cndhdr->GetEvent());
00135 
00136   NtpMRRecord* ntprec = new NtpMRRecord(ntphdr);
00137   this -> FillNtpSummary(ntprec,cndrec);
00138   this -> FillNtpEvent(ntprec,cndrec);
00139   if(cndrec->GetVldContext()->GetSimFlag()==SimFlag::kMC) 
00140     this -> FillNtpTruth(ntprec,cndrec);
00141   mom -> AdoptFragment(ntprec);  // pass record to mom to own
00142   return result;
00143 
00144 }


Member Data Documentation

std::map<int,float> NtpMRModule::fBestCom [private]

Definition at line 43 of file NtpMRModule.h.

Referenced by FillNtpEvent(), FillNtpSummary(), and Reco().

std::map<int,float> NtpMRModule::fBestCombCom [private]

Definition at line 55 of file NtpMRModule.h.

Referenced by FillNtpEvent(), FillNtpSummary(), and Reco().

std::map<int,float> NtpMRModule::fBestCombComPHW [private]

Definition at line 57 of file NtpMRModule.h.

Referenced by FillNtpEvent(), FillNtpSummary(), and Reco().

std::map<int,float> NtpMRModule::fBestComPHW [private]

Definition at line 45 of file NtpMRModule.h.

Referenced by FillNtpEvent(), FillNtpSummary(), and Reco().

std::map<int,float> NtpMRModule::fBestElecCom [private]

Definition at line 54 of file NtpMRModule.h.

Referenced by FillNtpEvent(), and FillNtpSummary().

std::map<int,float> NtpMRModule::fBestElecComPHW [private]

Definition at line 56 of file NtpMRModule.h.

Referenced by FillNtpEvent(), FillNtpSummary(), and Reco().

std::map<int,float> NtpMRModule::fBestPur [private]

Definition at line 42 of file NtpMRModule.h.

Referenced by FillNtpEvent(), FillNtpSummary(), and Reco().

std::map<int,float> NtpMRModule::fBestPurPHW [private]

Definition at line 44 of file NtpMRModule.h.

Referenced by FillNtpEvent(), FillNtpSummary(), and Reco().

std::map<int,float> NtpMRModule::fCombCom [private]

Definition at line 48 of file NtpMRModule.h.

Referenced by FillNtpEvent(), FillNtpSummary(), and Reco().

std::map<int,float> NtpMRModule::fCombComPHW [private]

Definition at line 49 of file NtpMRModule.h.

Referenced by FillNtpEvent(), FillNtpSummary(), and Reco().

std::map<int,float> NtpMRModule::fElecCom [private]

Definition at line 46 of file NtpMRModule.h.

Referenced by FillNtpEvent(), FillNtpSummary(), and Reco().

std::map<int,float> NtpMRModule::fElecComPHW [private]

Definition at line 47 of file NtpMRModule.h.

Referenced by FillNtpEvent(), FillNtpSummary(), and Reco().

std::map<int,int> NtpMRModule::fMRCombEventUidMap [private]

Definition at line 52 of file NtpMRModule.h.

Referenced by FillNtpEvent(), FillNtpSummary(), and Reco().

std::map<int,int> NtpMRModule::fMRElecEventUidMap [private]

Definition at line 51 of file NtpMRModule.h.

Referenced by FillNtpEvent(), FillNtpSummary(), and Reco().

std::map<int,int> NtpMRModule::fMREventUidMap [private]

Definition at line 41 of file NtpMRModule.h.

Referenced by FillNtpEvent(), FillNtpSummary(), and Reco().

std::map<int,std::vector<int> > NtpMRModule::fMRInfoMap [private]

Definition at line 39 of file NtpMRModule.h.

Referenced by FillNtpEvent(), FillNtpSummary(), and Reco().

std::map<int,int> NtpMRModule::fNStrips [private]

Definition at line 40 of file NtpMRModule.h.

Referenced by FillNtpEvent(), FillNtpSummary(), and Reco().

std::map<int,std::vector<int> > NtpMRModule::fStripMap [private]

Definition at line 38 of file NtpMRModule.h.

Referenced by FillNtpEvent(), FillNtpSummary(), and Reco().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1