00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00380 #include <Stiostream.h>
00381 #include <math.h>
00382 #include <string>
00383 #include "TSystem.h"
00384 #include "TTree.h"
00385 #if ROOT_VERSION_CODE < 331013
00386 #include "TCL.h"
00387 #else
00388 #include "TCernLib.h"
00389 #endif
00390 #include "TDataSet.h"
00391 #include "TDataSetIter.h"
00392 #include "StMessMgr.h"
00393 #include "StChainOpt.h"
00394 #include "SystemOfUnits.h"
00395 #include "StMemStat.h"
00396 #include "PhysicalConstants.h"
00397 #include "StDetectorId.h"
00398 #include "StEventTypes.h"
00399 #include "Sti/Base/EditableFilter.h"
00400 #include "Sti/StiKalmanTrackFinder.h"
00401 #include "Sti/StiTrackContainer.h"
00402 #include "Sti/StiDefaultTrackFilter.h"
00403 #include "Sti/StiMasterDetectorBuilder.h"
00404 #include "Sti/Star/StiStarDetectorGroup.h"
00405 #include "StiTpc/StiTpcDetectorGroup.h"
00406 #include "StiTpc/StiTpcHitLoader.h"
00407 #include "StiSvt/StiSvtDetectorGroup.h"
00408 #include "StiSsd/StiSsdDetectorGroup.h"
00409 #include "StiRnD/Hft/StiPixelDetectorGroup.h"
00410
00411 #include "Sti/StiKalmanTrackNode.h"
00412 #include "Sti/StiKalmanTrack.h"
00413 #include "Sti/StiHitLoader.h"
00414 #include "Sti/StiVertexFinder.h"
00415 #include "Sti/StiDetectorContainer.h"
00416 #include "StiMaker/StiStEventFiller.h"
00417 #include "StiDefaultToolkit.h"
00418 #include "StiMaker.h"
00419 #include "TFile.h"
00420 #include "TCanvas.h"
00421 #include "StDetectorDbMaker/StiKalmanTrackFinderParameters.h"
00422 #include "StDetectorDbMaker/StiKalmanTrackFitterParameters.h"
00423 #include "StiTpc/StiTpcDetectorBuilder.h"
00424 #include "StiSvt/StiSvtDetectorBuilder.h"
00425 #include "StDetectorDbMaker/StiHitErrorCalculator.h"
00426 #include "StiRnD/Ist/StiIstDetectorGroup.h"
00427 #include "StiRnD/Ist/StiIstDetectorGroup.h"
00428 #include "StiUtilities/StiDebug.h"
00429 #include "StiUtilities/StiPullEvent.h"
00430 #include "TDataSet.h"
00431 #include "TGeometry.h"
00432 #include "Sti/StiTimer.h"
00433 #include "StiDetectorVolume.h"
00434 #include "StarMagField.h"
00435 #if 0
00436 #include "StG2TrackVertexMap.h"
00437 #endif
00438 #include "StTpcDb/StTpcDb.h"
00439 #include "StSsdDbMaker/StSsdDbMaker.h"
00440 #include "StSvtDbMaker/StSvtDbMaker.h"
00445 static const float MIN_VTX_ERR2 = 1e-4*1e-4;
00446 enum { kHitTimg,kGloTimg,kVtxTimg,kPriTimg,kFilTimg};
00447 ClassImp(StiMaker)
00448
00449
00450 StiMaker::StiMaker(const Char_t *name) :
00451 StMaker(name),
00452 fVolume(0),
00453 _initialized(false),
00454 _toolkit(0),
00455 _hitLoader(0),
00456 _seedFinder(0),
00457 _tracker(0),
00458 _fitter(0),
00459 _eventFiller(0),
00460 _trackContainer(0),
00461 _vertexFinder(0),
00462 _loaderTrackFilter(0),
00463 _loaderHitFilter(0)
00464
00465 {
00466 memset(mTimg,0,sizeof(mTimg));
00467 cout <<"StiMaker::StiMaker() -I- Starting"<<endl;
00468 mPullFile=0; mPullEvent=0;mPullTTree=0;
00469 memset(mPullHits,0,sizeof(mPullHits));
00470 mTotPrimTks[0]=mTotPrimTks[1]=0;
00471 if (!StiToolkit::instance()) new StiDefaultToolkit;
00472 _toolkit = StiToolkit::instance();
00473 SetAttr("useTpc" ,kTRUE);
00474 SetAttr("activeTpc" ,kTRUE);
00475 SetAttr("useSvt" ,kTRUE);
00476
00477 SetAttr("useSsd" ,kTRUE);
00478
00479
00480 SetAttr("useEventFiller" ,kTRUE);
00481 SetAttr("useTracker" ,kTRUE);
00482 SetAttr("useVertexFinder" ,kTRUE);
00483 SetAttr("Alignment" ,kFALSE);
00484 if (strstr(gSystem->Getenv("STAR"),".DEV"))
00485 SetAttr("useAux",kTRUE);
00486 }
00487
00488
00489 StiMaker::~StiMaker()
00490 {
00491 cout <<"StiMaker::~StiMaker() -I- Started/Done"<<endl;
00492 }
00493
00494
00495 void StiMaker::Clear(const char*)
00496 {
00497 if (_tracker ) _tracker->clear();
00498 if (mPullEvent) mPullEvent->Clear();
00499 StMaker::Clear();
00500 }
00501
00502
00503 Int_t StiMaker::Finish()
00504 {
00505 StiDebug::Finish();
00506
00507 if (mPullTTree) {
00508 if (Debug()) mPullTTree->Print();
00509 if (mPullFile) {
00510 TFile *tfile = mPullTTree->GetCurrentFile();
00511 tfile->Write();
00512 tfile->Close();
00513 mPullFile = 0;
00514 mPullTTree = 0;
00515 }
00516 }
00517 StiTimer::Print();
00518 StiTimer::Clear();
00519
00520 static const char *timg[] = {"HitLoa","GlobFnd","VtxFnd","PriFnd","FilFnd",0};
00521 if (mTimg[0]) {
00522 for (int i=0;timg[i];i++) {
00523 Info("Timing","%s(%d) \tCpuTime = %6.2f seconds,\tPerEvent = %g seconds"
00524 ,timg[i],mTimg[i]->Counter(),mTimg[i]->CpuTime()
00525 ,mTimg[i]->CpuTime()/mTimg[i]->Counter());
00526 } }
00527 if (_tracker) _tracker->finish();
00528
00529 return StMaker::Finish();
00530 }
00531
00532
00533 Int_t StiMaker::Init()
00534 {
00535
00536 StiDebug::Init();
00537 StiTimer::Init("StiTrackFinder::find() TIMING"
00538 ,StiTimer::fgFindTimer,StiTimer::fgFindTally);
00539 if (IAttr("Alignment")) SetAttr(".Privilege",kTRUE);
00540 _loaderHitFilter = 0;
00541 mTotPrimTks[1] = IAttr("maxTotPrims");
00542 if (*SAttr("maxRefiter")) StiKalmanTrack::setMaxRefiter(IAttr("maxRefiter"));
00543
00544
00545 if (*SAttr("maxRefiter")) StiKalmanTrack::setMaxRefiter(IAttr("maxRefiter"));
00546 if (IAttr("useTiming")) {
00547 for (int it=0;it<(int)(sizeof(mTimg)/sizeof(mTimg[0]));it++){
00548 mTimg[it]= new TStopwatch(); mTimg[it]->Stop();
00549 } }
00550
00551 return StMaker::Init();
00552 }
00553
00554
00555 Int_t StiMaker::InitDetectors()
00556 {
00557 StiDetectorGroup<StEvent> * group;
00558 cout<<"StiMaker::InitDetectors() -I- Adding detector group:Star"<<endl;
00559 _toolkit->add(new StiStarDetectorGroup(false,"none"));
00560 if (IAttr("useTpc") && gStTpcDb)
00561 {
00562 cout<<"StiMaker::InitDetectors() -I- Adding detector group:TPC"<<endl;
00563 _toolkit->add(group = new StiTpcDetectorGroup(IAttr("activeTpc"),SAttr("tpcInputFile")));
00564 group->setGroupId(kTpcId);
00565 StiTpcHitLoader* hitLoader = (StiTpcHitLoader*) group->hitLoader();
00566 if (IAttr("activeSvt") || IAttr("activeSsd") || IAttr("skip1row")) {
00567 hitLoader->setMinRow(2);
00568 }
00569 if (IAttr("EastOff")) {
00570 hitLoader->setMinSector(1);
00571 hitLoader->setMaxSector(12);
00572 }
00573 if (IAttr("WestOff")) {
00574 hitLoader->setMinSector(13);
00575 hitLoader->setMaxSector(24);
00576 }
00577 cout << "StiMaker::InitDetectors() -I- use hits in sectors["
00578 << hitLoader->minSector() << "," << hitLoader->maxSector() << "] and rows["
00579 << hitLoader->minRow() << "," << hitLoader->maxRow() << "]" << endl;
00580 if (IAttr("laserIT")) {
00581 StiKalmanTrackNode::SetLaser(1);
00582 cout << "StiMaker::InitDetectors() -I- set laser time of flight correction" << endl;
00583 }
00584 }
00585 if (IAttr("useSvt") && gStSvtDbMaker)
00586 {
00587 cout<<"StiMaker::Init() -I- Adding detector group:SVT"<<endl;
00588 _toolkit->add(group = new StiSvtDetectorGroup(IAttr("activeSvt"),SAttr("svtInputFile")));
00589 group->setGroupId(kSvtId);
00590 }
00591 if (IAttr("useSsd") && gStSsdDbMaker)
00592 {
00593 cout<<"StiMaker::Init() -I- Adding detector group:Ssd"<<endl;
00594 _toolkit->add(group = new StiSsdDetectorGroup(IAttr("activeSsd"),SAttr("ssdInputFile")));
00595 group->setGroupId(kSsdId);
00596 }
00597 if (IAttr("usePixel"))
00598 {
00599 cout<<"StiMaker::Init() -I- Adding detector group:PIXEL"<<endl;
00600 _toolkit->add(group = new StiPixelDetectorGroup(IAttr("activePixel"),SAttr("pixelInputFile")));
00601 group->setGroupId(kPxlId);
00602 }
00603 if (IAttr("useIst"))
00604 {
00605 cout<<"StiMaker::Init() -I- Adding detector group:Ist"<<endl;
00606 _toolkit->add(group = new StiIstDetectorGroup(IAttr("activeIst"),SAttr("istInputFile")));
00607 group->setGroupId(kIstId);
00608 }
00609
00610
00611
00612
00613
00614
00615 return kStOk;
00616 }
00617
00618
00619 Int_t StiMaker::InitRun(int run)
00620 {
00621 if (!_initialized) {
00622 cout <<"StiMaker::InitRun() -I- Initialization Segment Started"<<endl;
00623 InitDetectors();
00624
00625 StiMasterDetectorBuilder * masterBuilder = _toolkit->getDetectorBuilder();
00626 masterBuilder->build(*this);
00627 StiDetectorContainer * detectorContainer = _toolkit->getDetectorContainer();
00628 detectorContainer->initialize();
00629 detectorContainer->reset();
00630 _seedFinder = _toolkit->getTrackSeedFinder();
00631 _seedFinder->initialize();
00632 _hitLoader = _toolkit->getHitLoader();
00633 _tracker=0;
00634 if (IAttr("useTracker")) {
00635
00636 _tracker = dynamic_cast<StiKalmanTrackFinder *>(_toolkit->getTrackFinder());
00637 if (*SAttr("useTreeSearch")) _tracker->setComb(IAttr("useTreeSearch"));
00638 if ( IAttr("useTiming" )) _tracker->setTiming();
00639 #if 0
00640 if ( IAttr("Alignment" )) _tracker->DoAlignment(kTRUE);
00641 #endif
00642 _fitter = dynamic_cast<StiKalmanTrackFitter *>(_toolkit->getTrackFitter());
00643
00644
00645 }
00646 _eventFiller=0;
00647 if (IAttr("useEventFiller")) {
00648 _eventFiller = new StiStEventFiller();
00649 _eventFiller->setUseAux(IAttr("useAux"));
00650 InitPulls();
00651 }
00652 _trackContainer = _toolkit->getTrackContainer();
00653 _vertexFinder = 0;
00654 if (GetTopChain()->GetMakerInheritsFrom("StGenericVertexMaker")) {
00655 _vertexFinder = _toolkit->getVertexFinder();
00656 }
00657 if (_tracker) {
00658 _tracker->initialize();
00659 _tracker->clear();
00660 }
00661 _initialized=true;
00662 cout <<"StiMaker::InitRun() -I- Initialization Segment Completed"<<endl;
00663 }
00664
00665 return StMaker::InitRun(run);
00666 }
00667
00668
00669 Int_t StiMaker::Make()
00670 {
00671 cout <<"StiMaker::Make() -I- Starting on new event"<<endl;
00672 Int_t iAns=kStOK,iAnz=0;
00673 if (! _tracker) return kStWarn;
00674 StEvent * event = dynamic_cast<StEvent*>( GetInputDS("StEvent") );
00675 if (!event) return kStWarn;
00676 eventIsFinished = false;
00677 try {
00678
00679 _tracker->clear();
00680
00681 if (mTimg[kHitTimg]) mTimg[kHitTimg]->Start(0);
00682 _hitLoader->loadEvent(event,_loaderTrackFilter,_loaderHitFilter);
00683 if (mTimg[kHitTimg]) mTimg[kHitTimg]->Stop();
00684
00685 _seedFinder->reset();
00686 iAnz = MakeGlobalTracks(event);
00687 if (iAnz) {MyClear(); return iAnz;}
00688 if (_vertexFinder) {
00689 iAnz = MakePrimaryTracks(event);
00690 if (iAnz) {MyClear(); return iAnz;}
00691 } else {
00692 iAnz = StMaker::Make();
00693 }
00694 if (mPullTTree) {iAns = FillPulls();}
00695 cout<< "StiMaker::Make() -I- Done"<<endl;
00696 MyClear();
00697 if (iAnz) return iAnz;
00698 if (mTotPrimTks[1] && mTotPrimTks[0]>mTotPrimTks[1]) return kStStop;
00699 if (IAttr("Alignment") && ! _tracker->getNTracks()) return kStErr;
00700 return kStOK;
00701 }
00702 catch (runtime_error &rte) {
00703 Error("Make","Catch exception %s",rte.what());
00704 if (!strncmp(rte.what(),"FATAL::",6)) return kStFATAL;
00705 MyClear();
00706 return kStErr;
00707 }
00708 }
00709
00710
00711 Int_t StiMaker::MakeGlobalTracks(StEvent * event) {
00712 if (mTimg[kGloTimg]) mTimg[kGloTimg]->Start(0);
00713 _tracker->findTracks();
00714 if (mTimg[kGloTimg]) mTimg[kGloTimg]->Stop();
00715 if (mTimg[kFilTimg]) mTimg[kFilTimg]->Start(0);
00716 if (_eventFiller)
00717 _eventFiller->fillEvent(event, _trackContainer);
00718 if (mTimg[kFilTimg]) mTimg[kFilTimg]->Stop();
00719 return kStOK;
00720 }
00721
00722 Int_t StiMaker::MakePrimaryTracks(StEvent * event) {
00723 if (! _vertexFinder) return kStWarn;
00724 if (mTimg[kVtxTimg]) mTimg[kVtxTimg]->Start(0);
00725 _vertexFinder->fit(event);
00726 const std::vector<StiHit*> *vertexes = _vertexFinder->result();
00727 if (mTimg[kVtxTimg]) mTimg[kVtxTimg]->Stop();
00728 if (vertexes && vertexes->size()) {
00729
00730 for (size_t i=0;i<vertexes->size();i++) {
00731 StiHit *vtx=(*vertexes)[i];
00732 float vtxErr[6];
00733 memcpy(vtxErr,vtx->errMtx(),sizeof(vtxErr));
00734 if (vtxErr[0]>MIN_VTX_ERR2
00735 && vtxErr[2]>MIN_VTX_ERR2
00736 && vtxErr[5]>MIN_VTX_ERR2) continue;
00737 memset(vtxErr,0,sizeof(vtxErr));
00738 vtxErr[0]=MIN_VTX_ERR2;
00739 vtxErr[2]=MIN_VTX_ERR2;
00740 vtxErr[5]=MIN_VTX_ERR2;
00741 vtx->setError(vtxErr);
00742 }
00743 if (mTimg[kPriTimg]) mTimg[kPriTimg]->Start(0);
00744
00745 _tracker->extendTracksToVertices(*vertexes);
00746 mTotPrimTks[0]+=_tracker->getNPrims();
00747 if (mTimg[kPriTimg]) mTimg[kPriTimg]->Stop();
00748
00749
00750 if (mTimg[kFilTimg]) mTimg[kFilTimg]->Start(0);
00751 if (_eventFiller) {_eventFiller->fillEventPrimaries(); }
00752 if (mTimg[kFilTimg]) mTimg[kFilTimg]->Stop();
00753 }
00754 return kStOK;
00755 }
00756
00757 void StiMaker::MyClear()
00758 {
00759
00760
00761 _toolkit->getHitFactory()->clear();
00762 _toolkit->getTrackNodeFactory()->clear();
00763 _toolkit->getTrackNodeExtFactory()->clear();
00764 _toolkit->getTrackNodeInfFactory()->clear();
00765 _toolkit->getTrackFactory()->clear();
00766
00767 }
00768
00769 Int_t StiMaker::InitPulls()
00770 {
00771 if (!IAttr("makePulls")) return 0;
00772
00773 const StChainOpt *bfc = GetChainOpt();
00774 assert(bfc);
00775 TFile *tfile = GetTFile();
00776 if (!tfile) {
00777 TString ts = bfc->GetFileIn();
00778 ts= gSystem->BaseName(ts);
00779 int ext = ts.Index(".");
00780 if (ext>0) ts.Replace(ext,999,"");
00781 ts +=".stipull.root";
00782 tfile = mPullFile = new TFile(ts,"RECREATE","TTree Sti Pulls ROOT file");
00783 }
00784 tfile->cd();
00785 mPullTTree = new TTree("StiPulls","TTree Sti pulls");
00786 mPullTTree->SetAutoSave(100000000);
00787 mPullEvent = new StiPullEvent;
00788 TBranch *branch = mPullTTree->Branch("event", mPullEvent->ClassName(),&mPullEvent, 16000,99);
00789 branch->SetAutoDelete(kFALSE);
00790 _eventFiller->setPullEvent(mPullEvent);
00791 return 0;
00792 }
00793
00794 Int_t StiMaker::FillPulls()
00795 {
00796 StEvtHddr *hddr = GetEvtHddr();
00797 mPullEvent->mRun = hddr->GetRunNumber();
00798 mPullEvent->mEvt = hddr->GetEventNumber();
00799 mPullEvent->mDate = hddr->GetDateTime();
00800 StiHit *vertex = _vertexFinder->getVertex(0);
00801 mPullEvent->mChi2 = 0;
00802
00803 memset(mPullEvent->mVtx,0,sizeof(mPullEvent->mVtx));
00804 memset(mPullEvent->mEtx,0,sizeof(mPullEvent->mEtx));
00805 if (vertex) {
00806 mPullEvent->mVtx[0] = vertex->x_g();
00807 mPullEvent->mVtx[1] = vertex->y_g();
00808 mPullEvent->mVtx[2] = vertex->z_g();
00809 TCL::ucopy(vertex->errMtx(),mPullEvent->mEtx,6);
00810 }
00811 mPullEvent->Finish();
00812 mPullTTree->Fill();
00813 for (int i=0; i<3; i++) {mPullHits[i]+=mPullEvent->mNHits[i];}
00814 if (! IAttr(".Privilege")) return kStOK;
00815
00816 int k;for (k=2; k>=0; k--) {if (mPullHits[k]) break;}
00817 if (k<0) return kStOK;
00818 k = mPullHits[k]<<(k*3);
00819 if (k>1000000) return kStSTOP;
00820 return kStOK;
00821 }
00822
00823 TDataSet *StiMaker::FindDataSet (const char* logInput,const StMaker *uppMk,
00824 const StMaker *dowMk) const
00825 {
00826 TDataSet *ds = StMaker::FindDataSet(logInput,uppMk,dowMk);
00827
00828 if (ds || strcmp(logInput,"STIGEOM")) return ds;
00829
00830
00831 if (!fVolume && _toolkit) ((StiMaker *)this)->fVolume = new StiDetectorVolume(*_toolkit, TString(), 0);
00832
00833 if (fVolume) {
00834 if (gGeometry) {
00835 TList *listOfVolume = gGeometry->GetListOfNodes();
00836
00837
00838 listOfVolume->Remove(fVolume);
00839 listOfVolume->Remove(fVolume);
00840 }
00841
00842 ((StiMaker *)this)->AddConst(fVolume);
00843 if (Debug()) fVolume->ls(3);
00844 }
00845 return fVolume;
00846 }
00847 #if 0
00848
00849 void StiMaker::fillVxFlags() {
00850 StEvent * event = dynamic_cast<StEvent*>( GetInputDS("StEvent") );
00851 if (! event) return;
00852 UInt_t NVx = event->numberOfPrimaryVertices();
00853 if (! NVx) return;
00854 struct vertexPing {
00855 Int_t Id;
00856 Int_t nPings;
00857 };
00858 enum {NVxMax = 200};
00859 for (UInt_t i = 0; i < NVx; i++) {
00860 StPrimaryVertex *vx = event->primaryVertex(i);
00861 if (! vx) continue;
00862 vertexPing candidates[NVxMax]; memset(candidates,0,sizeof(candidates));
00863 UInt_t N = 0;
00864 UInt_t Ntracks = vx->numberOfDaughters();
00865 Int_t IdVx = 0;
00866 for (UInt_t l = 0; l < Ntracks; l++) {
00867 const StTrack *pTrack = vx->daughter(l);
00868 if (! pTrack) continue;
00869 Int_t IdTk = pTrack->idTruth();
00870 if (IdTk <= 0) continue;
00871 IdVx = pTrack->idParentVx();
00872 if (IdVx <= 0) continue;
00873 Int_t J = -1;
00874 for (UInt_t j = 0; j < N; j++) if (candidates[j].Id == IdVx) {J = j; break;}
00875 if (J < 0) {J = N; if (N < NVxMax-1) N++;}
00876 candidates[J].Id = IdVx;
00877 candidates[J].nPings++;
00878 }
00879 Int_t dominant = -1;
00880 Int_t J = -1;
00881 for (UInt_t j = 0; j < N; j++) if (candidates[j].nPings > dominant)
00882 {dominant = candidates[j].nPings; J = j;}
00883 if (J > -1) {
00884 Int_t IdTruth = candidates[J].Id;
00885 Int_t QA = (100*dominant)/Ntracks;
00886 vx->setIdTruth(IdTruth,QA);
00887 Int_t IdParentTk = StG2TrackVertexMap::instance()->IdParentTrack(IdTruth);
00888 vx->setIdParent(IdParentTk);
00889 }
00890 }
00891 }
00892 #endif