00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012 #include "TClonesArray.h"
00013 #include "TParticle.h"
00014
00015 #include "CalDetPID/CalDetParticleType.h"
00016 #include "MinosObjectMap/MomNavigator.h"
00017 #include "DataUtil/Truthifier.h"
00018
00019 #include "CalDetTracker/CDPIDInfo.h"
00020 #include "CalDetTracker/CDTruthifier.h"
00021 #include "CalDetTracker/CDTruthHitInfo.h"
00022 #include "MessageService/MsgService.h"
00023
00024 using namespace std;
00025
00026 ClassImp(CDTruthifier)
00027
00028 CVSID("$Id: CDTruthifier.cxx,v 1.18 2005/02/02 12:15:14 tagg Exp $");
00029
00030
00031
00032 CDTruthifier::CDTruthifier()
00033 {
00034 this->InitialiseVariables();
00035 }
00036
00037
00038
00039 CDTruthifier::~CDTruthifier()
00040 {
00041
00042 }
00043
00044
00045
00046 void CDTruthifier::InitialiseVariables()
00047 {
00048
00049 }
00050
00051
00052
00053 void CDTruthifier::GetTruthHitInfo(const MomNavigator *mom,
00054 TClonesArray* tca)
00055 {
00056 TClonesArray &truthInfo=*tca;
00057 Int_t caCounter=0;
00058
00059
00060 Truthifier truth=Truthifier::Instance(mom);
00061
00062
00063 this->MakeCompleteStripList(mom);
00064
00065 if (fCompleteStripList.empty()){
00066 MSG("CDTruthifier",Msg::kWarning)
00067 <<"No strips in the CompleteStripList, can't get TruthHitInfo"
00068 <<endl;
00069 return;
00070 }
00071
00072
00073
00074 Int_t muon=13;
00075
00076
00077 for (map<Int_t,Int_t>::iterator sl=fCompleteStripList.begin();
00078 sl!=fCompleteStripList.end();++sl){
00079
00080
00081 Int_t key=sl->first;
00082
00083 Int_t bitsPlexIdStrip=8;
00084 Int_t mask=static_cast<Int_t>(pow(2.,bitsPlexIdStrip)-1);
00085 Int_t strip=mask & key;
00086 Int_t plane=key>>bitsPlexIdStrip;
00087
00088
00089 new(truthInfo[caCounter]) CDTruthHitInfo(plane,strip);
00090
00091 MSG("CDTruthifier",Msg::kVerbose)
00092 <<"pl="<<plane<<", st="<<strip<<endl;
00093
00094 Double_t totalEnergyDep=0;
00095 Int_t mainParticle=0;
00096 Double_t mainPathLength=0;
00097 Double_t mainParticleEnergy=-1;
00098 Int_t digiScintHitCounter=0;
00099 Double_t mainT1=0;
00100 Double_t mainX1=0;
00101 Double_t mainY1=0;
00102 Double_t mainZ1=0;
00103 Double_t mainT2=0;
00104 Double_t mainX2=0;
00105 Double_t mainY2=0;
00106 Double_t mainZ2=0;
00107 Double_t initialEarliestT1=1e50;
00108 Double_t earliestT1=initialEarliestT1;
00109 Double_t latestT2=-1e-9;
00110 Bool_t foundFirstMainParticle=false;
00111 Bool_t foundFirstParticle=false;
00112
00113
00114 for (multimap<Int_t,DigiScintHit*>::iterator hitIter=
00115 fAllDigiScintHits.equal_range(key).first;
00116 hitIter!=fAllDigiScintHits.equal_range(key).second;
00117 ++hitIter){
00118
00119
00120 digiScintHitCounter++;
00121
00122
00123 DigiScintHit* dsh=hitIter->second;
00124
00125
00126
00127 if (!(plane==dsh->Plane() &&
00128 strip==dsh->Strip())) {
00129 MSG("CDTruthifier",Msg::kWarning)
00130 <<"Ahhhhhhhh, wrong plane and strip"<<endl;
00131 }
00132
00133
00134 const Double_t energyDep=dsh->DE();
00135 const Double_t pathLength=dsh->DS();
00136 const Double_t energyParticle=dsh->ParticleEnergy();
00137 const Int_t particleId=dsh->ParticleId();
00138 const Int_t trackId=dsh->TrackId();
00139 const Double_t T1=dsh->T1();
00140 const Double_t T2=dsh->T2();
00141
00142
00143
00144 totalEnergyDep+=energyDep;
00145
00146
00147 if (particleId!=11 && particleId!=-11 &&
00148 particleId!=13 && particleId!=-13 &&
00149 particleId!=211 && particleId!=-211 &&
00150 particleId!=2212 && particleId!=-2212 &&
00151 particleId!=1002001000 &&
00152 particleId!=1003001000 &&
00153 particleId!=1004001000 &&
00154 particleId!=1004002000){
00155 MSG("CDTruthifier",Msg::kInfo)
00156 <<endl<<endl
00157 <<"Found particles other than expected"<<endl
00158 <<digiScintHitCounter
00159 <<" DE="<<energyDep*1000
00160 <<", DS="<<pathLength*100
00161 <<", pId="<<particleId
00162 <<", pEn="<<energyParticle*1000
00163 <<", tEn="<<totalEnergyDep*1000
00164 <<", tId="<<trackId
00165 <<", mP="<<mainParticle
00166 <<", mPL="<<mainPathLength*100<<endl<<endl;
00167 }
00168
00169
00170
00171 if (T1<earliestT1) earliestT1=T1;
00172 if (T2>latestT2) latestT2=T2;
00173
00174
00175
00176
00177 if (!foundFirstParticle){
00178 foundFirstParticle=true;
00179
00180
00181 mainParticle=particleId;
00182 mainParticleEnergy=energyParticle;
00183
00184
00185 mainT1=dsh->T1();
00186 mainX1=dsh->X1();
00187 mainY1=dsh->Y1();
00188 mainZ1=dsh->Z1();
00189
00190
00191 mainPathLength=pathLength;
00192
00193 mainT2=dsh->T2();
00194 mainX2=dsh->X2();
00195 mainY2=dsh->Y2();
00196 mainZ2=dsh->Z2();
00197 }
00198
00199
00200
00201 if (abs(particleId)==muon){
00202
00203 static Int_t firstPlane=-1;
00204 static Int_t firstStrip=-1;
00205
00206
00207
00208 if (!foundFirstMainParticle){
00209 foundFirstMainParticle=true;
00210
00211
00212 mainParticle=particleId;
00213 mainParticleEnergy=energyParticle;
00214
00215
00216 mainT1=dsh->T1();
00217 mainX1=dsh->X1();
00218 mainY1=dsh->Y1();
00219 mainZ1=dsh->Z1();
00220
00221
00222
00223 mainPathLength=pathLength;
00224
00225 mainT2=dsh->T2();
00226 mainX2=dsh->X2();
00227 mainY2=dsh->Y2();
00228 mainZ2=dsh->Z2();
00229
00230
00231 firstPlane=plane;
00232 firstStrip=strip;
00233 }
00234 else{
00235
00236
00237 Msg::LogLevel_t msgLevel=Msg::kDebug;
00238
00239
00240
00241 if (!(plane==firstPlane && strip==firstStrip)){
00242
00243 msgLevel=Msg::kWarning;
00244 MSG("CDTruthifier",Msg::kWarning)
00245 <<endl
00246 <<"Plane and strip are not the same as the first main"
00247 <<"particle, First (pl,st)=("<<firstPlane<<","<<firstStrip
00248 <<") New=("<<plane<<","<<strip<<")"
00249 <<endl;
00250 }
00251
00252 MSG("CDTruthifier",msgLevel)
00253 <<"Values already set:"<<endl
00254 <<"DigiScintHit="<<digiScintHitCounter
00255 <<endl
00256 <<" Current:"
00257 <<" (pl,st)=("<<plane<<","<<strip<<")"
00258 <<" PL="<<mainPathLength*100
00259 <<", PE="<<mainParticleEnergy*1000
00260 <<endl
00261 <<" T1="<<mainT1*1e9
00262 <<", X1="<<mainX1*100
00263 <<", Y1="<<mainY1*100
00264 <<", Z1="<<mainZ1*100
00265 <<endl
00266 <<" T2="<<mainT2*1e9
00267 <<", X2="<<mainX2*100
00268 <<", Y2="<<mainY2*100
00269 <<", Z2="<<mainZ2*100
00270 <<endl
00271 <<" New:"
00272 <<" (pl,st)=("<<dsh->Plane()<<","<<dsh->Strip()<<")"
00273 <<" PL="<<pathLength*100
00274 <<", PE="<<energyParticle*1000
00275 <<", tEnDep="<<totalEnergyDep*1000<<"("<<energyDep*1000<<")"
00276 <<", partId="<<particleId
00277 <<", trkId="<<trackId
00278 <<endl
00279 <<" T1="<<dsh->T1()*1e9
00280 <<" X1="<<dsh->X1()*100
00281 <<", Y1="<<dsh->Y1()*100
00282 <<", Z1="<<dsh->Z1()*100
00283 <<endl
00284 <<" T2="<<dsh->T2()*1e9
00285 <<" X2="<<dsh->X2()*100
00286 <<", Y2="<<dsh->Y2()*100
00287 <<", Z2="<<dsh->Z2()*100
00288 <<endl;
00289
00290
00291
00292 if (plane==firstPlane && strip==firstStrip){
00293
00294
00295
00296 MSG("CDTruthifier",Msg::kDebug)
00297 <<"Comparing path length for multiple DigiScintHits"<<endl
00298 <<" for a single particle in a single strip:"<<endl
00299 <<"DigiScintHit="<<digiScintHitCounter
00300 <<endl
00301 <<" Current:"
00302 <<" (pl,st)=("<<plane<<","<<strip<<")"
00303 <<" PL="<<mainPathLength*100
00304 <<endl
00305 <<" New:"
00306 <<" (pl,st)=("<<dsh->Plane()<<","<<dsh->Strip()<<")"
00307 <<" PL="<<(mainPathLength+pathLength)*100
00308 <<"("<<pathLength*100<<")"
00309 <<endl;
00310
00311
00312
00313 mainPathLength+=pathLength;
00314
00315
00316
00317 if (mainT2<=dsh->T2()){
00318 mainT2=dsh->T2();
00319 mainX2=dsh->X2();
00320 mainY2=dsh->Y2();
00321 mainZ2=dsh->Z2();
00322 }
00323 else{
00324 MSG("CDTruthifier",Msg::kWarning)
00325 <<endl
00326 <<"(pl,st)=("<<dsh->Plane()<<","<<dsh->Strip()<<")"
00327 <<" Multiple dsh for particle in given strip"<<endl
00328 <<" are not time ordered, this may give false"
00329 <<" reconstruction. Beware!"<<endl;
00330 }
00331 }
00332 }
00333 }
00334
00335
00336 MSG("CDTruthifier",Msg::kVerbose)
00337 <<digiScintHitCounter
00338 <<" DE="<<energyDep*1000
00339 <<", DS="<<pathLength*100
00340 <<", pId="<<particleId
00341 <<", pEn="<<energyParticle*1000
00342 <<", tEn="<<totalEnergyDep*1000
00343 <<", tId="<<trackId
00344 <<", mP="<<mainParticle
00345 <<", mPL="<<mainPathLength*100<<endl;
00346 }
00347
00348 Int_t finalPmtTruth1=DigiSignal::kUnknown;
00349 Int_t finalPmtTruth2=DigiSignal::kUnknown;
00350 Int_t vaChip1=-1;
00351 Int_t vaChip2=-1;
00352
00353
00354 CandStripHandle* csh=0;
00355
00356
00357 if ((csh=fAllCandStripHandles[key])){
00358
00359
00360 TIter cshItr(csh->GetDaughterIterator());
00361
00362
00363 Int_t digitCounter=0;
00364
00365
00366 while(CandDigitHandle* cdh=dynamic_cast<CandDigitHandle*>
00367 (cshItr.Next())){
00368
00369 digitCounter++;
00370
00371 DigiSignal::DigiPmtTruth_t pmtTruth=truth.
00372 GetSignalTruthFlags(*cdh);
00373
00374
00375
00376
00377
00378
00379
00380 if (cdh->GetPlexSEIdAltL().GetEnd()==StripEnd::kEast){
00381 finalPmtTruth1|=pmtTruth;
00382 vaChip1=cdh->GetChannelId().GetVaChip();
00383 }
00384 else if (cdh->GetPlexSEIdAltL().GetEnd()==StripEnd::kWest){
00385 finalPmtTruth2|=pmtTruth;
00386 vaChip2=cdh->GetChannelId().GetVaChip();
00387 }
00388
00389
00390 if (vaChip2>2) vaChip2=-2;
00391 if (vaChip1>2) vaChip1=-2;
00392
00393 MSG("CDTruthifier",Msg::kVerbose)
00394 <<"Dig="<<digitCounter
00395 <<", va1="<<vaChip1
00396 <<", va2="<<vaChip2
00397 <<", pmtTr="<<pmtTruth
00398 <<", T="<<cdh->GetTime()*1e9
00399 <<", el="<<ElecType::AsString(cdh->GetChannelId().
00400 GetElecType())
00401 <<endl;
00402 }
00403
00404
00405
00406
00407
00408
00409
00410 if (!(((finalPmtTruth1 | finalPmtTruth2) &
00411 DigiSignal::kGenuine)==DigiSignal::kGenuine)){
00412 mainParticle=0;
00413 mainParticleEnergy=-1;
00414 mainPathLength=0;
00415 mainT1=0;
00416 mainX1=0;
00417 mainY1=0;
00418 mainZ1=0;
00419 mainT2=0;
00420 mainX2=0;
00421 mainY2=0;
00422 mainZ2=0;
00423 totalEnergyDep=0;
00424 }
00425
00426 }
00427 else{
00428
00429 finalPmtTruth1=DigiSignal::kGenuine;
00430 finalPmtTruth2=DigiSignal::kGenuine;
00431
00432
00433
00434
00435 }
00436
00437 MSG("CDTruthifier",Msg::kVerbose)
00438 <<"Final:"
00439 <<", part="<<mainParticle
00440 <<", pmtTr1="<<finalPmtTruth1
00441 <<", pmtTr2="<<finalPmtTruth2
00442 <<", mainPartEn="<<mainParticleEnergy*1000
00443 <<", totEn="<<totalEnergyDep*1000
00444 <<endl;
00445
00446
00447 if (earliestT1==initialEarliestT1) earliestT1=-1e-9;
00448
00449
00450 CDTruthHitInfo* thi=(CDTruthHitInfo*)(truthInfo.At(caCounter));
00451
00452
00453 thi->SetPmtTruth1(finalPmtTruth1);
00454 thi->SetPmtTruth2(finalPmtTruth2);
00455 thi->SetMainParticle(mainParticle);
00456 thi->SetTotalEnDep(totalEnergyDep);
00457 thi->SetMainPartEn(mainParticleEnergy);
00458 thi->SetMainPathLength(mainPathLength);
00459 thi->SetVaChip1(vaChip1);
00460 thi->SetVaChip2(vaChip2);
00461 thi->SetMainT1(mainT1);
00462 thi->SetMainX1(mainX1);
00463 thi->SetMainY1(mainY1);
00464 thi->SetMainZ1(mainZ1);
00465 thi->SetMainT2(mainT2);
00466 thi->SetMainX2(mainX2);
00467 thi->SetMainY2(mainY2);
00468 thi->SetMainZ2(mainZ2);
00469 thi->SetEarliestT1(earliestT1);
00470 thi->SetLatestT2(latestT2);
00471 thi->SetNumDigiScintHits(digiScintHitCounter);
00472
00473
00474 caCounter++;
00475 }
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485 }
00486
00487
00488
00489
00490 void CDTruthifier::RecoStdHep(const MomNavigator* mom,
00491 CDPIDInfo* pidInfo) const
00492 {
00493
00494 SimSnarlRecord *ssr=
00495 dynamic_cast<SimSnarlRecord*>(mom->GetFragment("SimSnarlRecord"));
00496 if (ssr){
00497 const TClonesArray* ctca=dynamic_cast<const TClonesArray*>
00498 (ssr->FindComponent("TClonesArray","StdHep"));
00499
00500 Int_t num=ctca->GetEntries();
00501 MSG("CDTruthifier",Msg::kVerbose)
00502 <<"StdHep Entries="<<num<<endl;
00503
00504 Int_t pdgCode=0;
00505 Float_t particleMomentum=0;
00506
00507 for(Int_t i=0;i<num;i++){
00508 TParticle* part=dynamic_cast<TParticle*>((*ctca)[i]);
00509
00510 MSG("CDTruthifier",Msg::kVerbose)
00511 <<"i="<<i<<", status code="<<part->GetStatusCode()
00512 <<", pdg code="<<part->GetPdgCode()
00513 <<", en="<<part->Energy()<<", P="<<part->P()<<endl;
00514
00515
00516 pdgCode=part->GetPdgCode();
00517 particleMomentum=part->P();
00518
00519 if (i==1){
00520 MSG("CDTruthifier",Msg::kWarning)
00521 <<"More than one particle in simsnarlrecord"<<endl
00522 <<"i="<<i<<", status code="<<part->GetStatusCode()
00523 <<", pdg code="<<part->GetPdgCode()
00524 <<", en="<<part->Energy()<<", P="<<part->P()<<endl;
00525 }
00526 }
00527
00528
00529 if (pidInfo){
00530 pidInfo->SetTrueParticleMomentum(particleMomentum);
00531 pidInfo->SetPIDType(this->PdgCode2CalDetParticleType(pdgCode));
00532 }
00533 else{
00534 MSG("CDTruthifier",Msg::kWarning)
00535 <<"CDPIDInfo pointer="<<pidInfo<<", can't set truth info"<<endl;
00536 }
00537 }
00538 else{
00539 MSG("CDTruthifier",Msg::kWarning)
00540 <<"CDTruthifier::RecoStdHep:: No simsnarl record found"<<endl;
00541 }
00542 }
00543
00544
00545
00546 Float_t CDTruthifier::ParticleMomentum(const MomNavigator* mom) const
00547 {
00548
00549 SimSnarlRecord *ssr=
00550 dynamic_cast<SimSnarlRecord*>(mom->GetFragment("SimSnarlRecord"));
00551
00552 Float_t particleMomentum=0;
00553
00554 if (ssr){
00555 const TClonesArray* ctca=dynamic_cast<const TClonesArray*>
00556 (ssr->FindComponent("TClonesArray","StdHep"));
00557
00558 Int_t num=ctca->GetEntries();
00559 MSG("CDTruthifier",Msg::kVerbose)
00560 <<"StdHep Entries="<<num<<endl;
00561
00562 for(Int_t i=0;i<num;i++){
00563 TParticle* part=dynamic_cast<TParticle*>((*ctca)[i]);
00564
00565 MSG("CDTruthifier",Msg::kVerbose)
00566 <<"i="<<i<<", status code="<<part->GetStatusCode()
00567 <<", pdg code="<<part->GetPdgCode()
00568 <<", en="<<part->Energy()<<", P="<<part->P()<<endl;
00569
00570
00571 particleMomentum=part->P();
00572
00573 if (i==1){
00574 MSG("CDTruthifier",Msg::kWarning)
00575 <<"More than one particle in simsnarlrecord"<<endl
00576 <<"i="<<i<<", status code="<<part->GetStatusCode()
00577 <<", pdg code="<<part->GetPdgCode()
00578 <<", en="<<part->Energy()<<", P="<<part->P()<<endl;
00579 }
00580 }
00581 }
00582 else{
00583 MSG("CDTruthifier",Msg::kWarning)
00584 <<"No simsnarl record found"<<endl;
00585 }
00586
00587 return particleMomentum;
00588 }
00589
00590
00591
00592 Int_t CDTruthifier::PdgCode2CalDetParticleType(Int_t pdgCode) const
00593 {
00594 Int_t cdParticleType=CalDetParticleType::kUnknown;
00595
00596 if (abs(pdgCode)==13){
00597 cdParticleType=CalDetParticleType::kMuon;
00598 }
00599 else if (abs(pdgCode)==211){
00600 cdParticleType=CalDetParticleType::kPion;
00601 }
00602 else if (abs(pdgCode)==11){
00603 cdParticleType=CalDetParticleType::kElectron;
00604 }
00605 else if (abs(pdgCode)==2211){
00606 cdParticleType=CalDetParticleType::kProton;
00607 }
00608 else if (abs(pdgCode)==321){
00609 cdParticleType=CalDetParticleType::kKaon;
00610 }
00611 else{
00612 cdParticleType=CalDetParticleType::kUnknown;
00613 MSG("CDTruthifier",Msg::kWarning)
00614 <<"Particle PDG code not recognised="<<pdgCode<<endl;
00615 }
00616
00617 return cdParticleType;
00618 }
00619
00620
00621
00622 void CDTruthifier::ExtractAllDigiScintHits(const MomNavigator *mom)
00623 {
00624
00625 fAllDigiScintHits.clear();
00626
00627 SimSnarlRecord* simsnarl=0;
00628 TObject* tobj=0;
00629 TIter fragiter=mom->FragmentIter();
00630
00631
00632 while( ( tobj = fragiter.Next() ) ) {
00633 simsnarl = dynamic_cast<SimSnarlRecord*>(tobj);
00634 if(simsnarl) break;
00635 }
00636
00637
00638 if(!simsnarl) {
00639 MSG("CDTruthifier",Msg::kError)<<"No SimSnarl found"<<endl;
00640 return;
00641 }
00642
00643
00644 const TObjArray* hitList=dynamic_cast<const TObjArray*>
00645 (simsnarl->FindComponent(0,"DigiScintHits"));
00646 if(hitList==0) {
00647 MSG("CDTruthifier",Msg::kError) << "Can't find scint hit array.\n";
00648 }
00649
00650 MSG("CDTruthifier",Msg::kVerbose)
00651 <<"Found digiScintHits, size="<<hitList->GetSize()<<endl;
00652
00653 for (Int_t i=0;i<hitList->GetSize();i++){
00654 DigiScintHit* hit=0;
00655 if ((hit=dynamic_cast<DigiScintHit*>(hitList->At(i)))){
00656
00657 MSG("CDTruthifier",Msg::kVerbose)
00658 <<"i="<<i<<", plane="<<hit->Plane()<<endl;
00659
00660
00661 Int_t key=hit->StripEndId().Build18BitPlnStripKey();
00662
00663 fAllDigiScintHits.insert(pair<Int_t,DigiScintHit*>(key,hit));
00664 }
00665 }
00666
00667 MSG("CDTruthifier",Msg::kVerbose)
00668 <<"mm size="<<fAllDigiScintHits.size()<<endl;
00669
00670 Int_t counter=0;
00671 for (multimap<Int_t,DigiScintHit*>::iterator digiScintHit=
00672 fAllDigiScintHits.equal_range(40).first;
00673 digiScintHit!=fAllDigiScintHits.equal_range(40).second;
00674 ++digiScintHit){
00675 counter++;
00676 MSG("CDTruthifier",Msg::kInfo)
00677 <<"i="<<counter<<", plane="<<digiScintHit->second->Plane()
00678 <<", DE="<<digiScintHit->second->DE()
00679 <<", PID="<<digiScintHit->second->ParticleId()<<endl;
00680 }
00681 }
00682
00683
00684
00685 void CDTruthifier::ExtractAllCandStripHandles(const MomNavigator *mom)
00686 {
00687
00688 fAllCandStripHandles.clear();
00689
00690 CandRecord* candRecord=0;
00691 TObject* tobj=0;
00692 TIter fragiter=mom->FragmentIter();
00693
00694
00695 while( ( tobj = fragiter.Next() ) ) {
00696 candRecord = dynamic_cast<CandRecord*>(tobj);
00697 if(candRecord) break;
00698 }
00699
00700
00701 if(!candRecord) {
00702 MSG("CDTruthifier",Msg::kError)<<"No CandRecord found"<<endl;
00703 return;
00704 }
00705
00706
00707 CandStripListHandle *cslh = dynamic_cast<CandStripListHandle*>
00708 (candRecord->FindCandHandle("CandStripListHandle"));
00709
00710
00711 if(cslh==0) {
00712 MSG("CDTruthifier", Msg::kFatal)
00713 << "No CandStripListHandle in MOM" << endl;
00714 return;
00715 }
00716
00717
00718 TIter stripItr(cslh->GetDaughterIterator());
00719
00720 while(CandStripHandle* csh=dynamic_cast<CandStripHandle*>
00721 (stripItr.Next())){
00722
00723 Int_t key=csh->GetStripEndId().Build18BitPlnStripKey();
00724
00725
00726 fAllCandStripHandles.insert(pair<Int_t,CandStripHandle*>(key,csh));
00727 }
00728
00729 MSG("CDTruthifier",Msg::kVerbose)
00730 <<"cshs size="<<fAllCandStripHandles.size()<<endl;
00731
00732 }
00733
00734
00735
00736 void CDTruthifier::MakeCompleteStripList(const MomNavigator *mom)
00737 {
00738
00739 fCompleteStripList.clear();
00740
00741
00742 this->ExtractAllDigiScintHits(mom);
00743 this->ExtractAllCandStripHandles(mom);
00744
00745
00746
00747
00748 Int_t lastKey=-1;
00749 for (multimap<Int_t,DigiScintHit*>::iterator digiScintHit=
00750 fAllDigiScintHits.begin();
00751 digiScintHit!=fAllDigiScintHits.end();
00752 ++digiScintHit){
00753
00754
00755 Int_t key=digiScintHit->first;
00756
00757
00758
00759
00760 if (static_cast<Int_t>(key)==lastKey) continue;
00761 lastKey=static_cast<Int_t>(key);
00762
00763
00764
00765 fCompleteStripList[key]++;
00766 }
00767
00768
00769 for (map<Int_t,CandStripHandle*>::iterator cshIter=
00770 fAllCandStripHandles.begin();
00771 cshIter!=fAllCandStripHandles.end();
00772 ++cshIter){
00773
00774
00775 Int_t key=cshIter->first;
00776
00777
00778
00779 fCompleteStripList[key]++;
00780 }
00781
00782 MSG("CDTruthifier",Msg::kDebug)
00783 <<"Complete list size="<<fCompleteStripList.size()
00784 <<", all csh size="<<fAllCandStripHandles.size()
00785 <<", all dsh size="<<fAllDigiScintHits.size()<<endl;
00786 }
00787
00788