24 #include "StMessMgr.h"
25 #include "PhysicalConstants.h"
26 #include "StPhysicalHelix.hh"
27 #include "SystemOfUnits.h"
28 #include "StIOMaker/StIOMaker.h"
29 #include "StParticleDefinition.hh"
30 #include "StMatrixF.hh"
31 #include "StChainOpt.h"
44 #include "StEventTypes.h"
45 #include "StMcEventTypes.hh"
46 #include "StMcEvent.hh"
47 #include "StuRefMult.hh"
48 #include "StTpcDedxPidAlgorithm.h"
49 #include "StuProbabilityPidAlgorithm.h"
51 #include "StEmcUtil/geometry/StEmcGeom.h"
52 #include "StEmcUtil/projection/StEmcPosition.h"
54 #include "StMiniMcHelper.h"
59 #include "StGlobalTrack.h"
60 #include "StDcaGeometry.h"
61 #include "StContainers.h"
62 #include "StTrackDetectorInfo.h"
65 #include "THelixTrack.h"
67 static int StMiniMcMakerErrorCount=0;
71 void dominatrackInfo(
const StTrack*,
int& dominatrackKey,
short&,
float&);
77 return (p1->position().perp()<p2->position().perp());
82 return (lhs->dE() > rhs->dE());
87 return (lhs->energy() > rhs->energy());
91 float scaleFactor(
double Eta,
int hitType=0) {
96 float P0[]={14.69,559.7,0.1185e6,0.1260e6};
97 float P1[]={-0.1022,-109.9,-0.3292e5,-0.1395e5};
98 float P2[]={0.7484,-97.81,0.3113e5,0.1971e5};
101 return P0[hitType]+P1[hitType]*x+P2[hitType]*x*x;
120 mParameterFileName(),
132 mMinPt(0),mMaxPt(99999),
133 mNSplit(0),mNRc(0),mNGhost(0),mNContam(0),
134 mNMatched(0),mNMatGlob(0), mMainVtx(-1)
144 StMiniMcMaker::~StMiniMcMaker()
168 cout <<
"###StMiniMcMaker::Finish()" << endl;
172 cout <<
"\treconstr. = " << mNRc << endl
173 <<
"\tmatched = " << mNMatched << endl
174 <<
"\tsplit = " << mNSplit << endl
175 <<
"\tcontam. = " << mNContam << endl
176 <<
"\tghost = " << mNGhost << endl
177 <<
"\tmat global = " << mNMatGlob << endl;
179 if (Debug()) cout <<
"deleting mMiniMcEvent" << endl;
180 delete mMiniMcEvent; mMiniMcEvent = 0;
185 if (Debug()) cout <<
"deleting mMiniMcDST" << endl;
196 Int_t StMiniMcMaker::InitRun(
int runID)
198 cout <<
"###StMiniMcMaker::InitRun()" << endl;
200 cout <<
"\tpt cut : " << mMinPt <<
" , " << mMaxPt << endl;
207 if(Debug()) cout <<
"\tStMiniMcMaker::InitRun Creating StMiniMcEvent..." << endl;
211 if (Debug()) cout <<
"\tStMiniMcMaker::InitRun StMiniMcEvent Already created" << endl;
214 cout <<
"\tGhost loop is turned on." << endl;
228 return stat + StMaker::InitRun(runID);
233 Int_t StMiniMcMaker::Init()
236 cout <<
"###StMiniMcMaker::Init()" << endl;
238 cout <<
"\tpt cut : " << mMinPt <<
" , " << mMaxPt << endl;
240 if (mInFileName ==
"") {
243 mInFileName = chain->GetFileOut();
245 return StMaker::Init();
255 if(Debug()) cout <<
"###StMiniMcMaker::Make()" << endl;
261 mRcEvent = (
StEvent*) GetDataSet(
"StEvent");
262 if(!mRcEvent)
return kStOk;
263 mMcEvent = (
StMcEvent*) GetDataSet(
"StMcEvent");
264 if(!mMcEvent)
return kStErr;
269 Bool_t assOk = initAssociation();
271 gMessMgr->Warning() <<
"Association problems " << endm;
277 Bool_t vtxOk = initVertex();
279 cout <<
"\t\t----No primary vertex---- " << endl;
285 buildEmcIndexArray();
289 if (
m_Mode == 1) trackLoopIdT();
292 if (Debug()) mMiniMcEvent->Print();
294 AppendMCDaughterTrack();
299 if (Debug()) mMiniMcEvent->Print();
301 mMiniMcEvent->Clear();
311 Bool_t StMiniMcMaker::initAssociation()
320 mRcTrackMap = assoc->rcTrackMap();
321 mMcTrackMap = assoc->mcTrackMap();
323 return (assoc && mRcHitMap && mRcTrackMap && mMcTrackMap);
331 Bool_t StMiniMcMaker::initVertex()
334 if(!mRcEvent->numberOfPrimaryVertices()) {
335 cout <<
"\tno primary vertex from stevent" << endl;
338 if(!mMcEvent->primaryVertex()){
339 cout <<
"\tno primary vertex from stmcevent" << endl;
344 for (
int i=0;i<(int)mRcEvent->numberOfPrimaryVertices();i++) {
345 int numTks = mRcEvent->primaryVertex(i)->numberOfDaughters();
346 if (maxTks > numTks)
continue;
347 maxTks = numTks;mMainVtx = i;
350 cout <<
"\tEmpty primary vertex from stevent" << endl;
356 mRcVertexPos = &mRcEvent->primaryVertex(mMainVtx)->position();
357 mMcVertexPos = &mMcEvent->primaryVertex()->position();
361 <<
"----------vertex info---------------------\n"
362 <<
"Position of primary vertex from StEvent: \n"
363 << *mRcVertexPos << endl;
365 <<
"Position of primary vertex from StMcEvent: "<<endl
366 << *mMcVertexPos << endl;
367 cout <<
"N daughters, StEvent : " << mRcEvent->primaryVertex(mMainVtx)->daughters().size() << endl;
368 cout <<
"N daughters, StMcEvent : " << mMcEvent->primaryVertex()->daughters().size() << endl;
374 return !((std::isnan(mRcVertexPos->x()) || std::isnan(mRcVertexPos->y())));
381 void StMiniMcMaker::trackLoop()
383 if(Debug()) cout <<
"##StMiniMcMaker::trackLoop()" << endl;
385 Int_t nMatched(0), nAcceptedRaw(0),nAccepted(0),
386 nMerged(0), nSplit(0), nContam(0), nGhost(0), nMatGlob(0), nContamNew(0),
387 nRcGoodGlobal20(0), nRcGlobal(0), nMcGoodGlobal20(0),
388 nMcNch(0), nMcHminus(0), nMcFtpcWNch(0), nMcFtpcENch(0);
391 RCFOUNDMAP rcFoundMap;
392 MCFOUNDMAP mcFoundMap;
418 std::vector<int> enteredGlobalTracks;
419 const StPtrVecMcTrack& allmcTracks = mMcEvent->tracks();
420 cout <<
"size of mcEvent->tracks() : " << allmcTracks.size() << endl;
422 StMcTrackConstIterator allMcTrkIter = allmcTracks.begin();
423 for ( ; allMcTrkIter != allmcTracks.end(); ++allMcTrkIter) {
424 const StMcTrack* mcGlobTrack = *allMcTrkIter;
425 if(!acceptRaw(mcGlobTrack))
continue;
426 if(accept(mcGlobTrack) || mcGlobTrack->ftpcHits().size()>=5) {
428 cout <<
"accepted mc global track, key " << mcGlobTrack->key() << endl;
437 const StGlobalTrack* glTrack = candTrackPair->partnerTrack();
440 cout <<
"global match " << endl;
441 cout <<
"mc, rc pt " << mcGlobTrack->pt() <<
", " << glTrack->geometry()->momentum().perp() << endl;
444 if (find(enteredGlobalTracks.begin(),enteredGlobalTracks.end(),glTrack->key())!=enteredGlobalTracks.end())
continue;
447 candTrackPair->commonTpcHits()%100+
448 ((candTrackPair->commonSvtHits()%10)*100)+
449 ((candTrackPair->commonSsdHits()%10)*1000);
450 fillTrackPairInfo(miniMcPair, mcGlobTrack,
452 commonHits, mRcTrackMap->count(glTrack),
453 mMcTrackMap->count(mcGlobTrack), 0,
455 mMiniMcEvent->addTrackPair(miniMcPair,MATGLOB);
457 enteredGlobalTracks.push_back(glTrack->key());
469 const StPtrVecMcTrack& mcTracks = mMcEvent->primaryVertex()->daughters();
471 cout <<
"size of MC primary tracks : " << mcTracks.size() << endl;
473 StMcTrackConstIterator mcTrkIter = mcTracks.begin();
474 for( ; mcTrkIter != mcTracks.end(); mcTrkIter++){
478 if(!mcTrack) { cout <<
"No mc track? " << endl;
continue; }
481 if(!acceptRaw(mcTrack))
continue;
485 if(fabs(mcTrack->pseudoRapidity())<.5 && isPrimaryTrack(mcTrack) && mcTrack->particleDefinition()){
486 if(mcTrack->particleDefinition()->charge()!=0) nMcNch++;
487 if(mcTrack->particleDefinition()->charge()<0) nMcHminus++;
489 if(mcTrack->particleDefinition() && mcTrack->particleDefinition()->charge()!=0 && isPrimaryTrack(mcTrack) ) {
490 if(mcTrack->pseudoRapidity()<-2.8 && mcTrack->pseudoRapidity()>-3.8) nMcFtpcENch++;
491 if(mcTrack->pseudoRapidity()>2.8 && mcTrack->pseudoRapidity()<3.8) nMcFtpcWNch++;
494 if(acceptGood20(mcTrack)) nMcGoodGlobal20++;
496 Int_t nAssocGl = mMcTrackMap->count(mcTrack);
508 if(!mcFoundMap.count(mcTrack->key())){
515 PAIRVEC candPair = findMatchedRc(mcTrack);
516 nAssocPr = candPair.size();
518 if(candPair.size()>0){
522 PAIRVEC::iterator iterBestMatchPair
523 = max_element(candPair.begin(),candPair.end(),pairCmp);
539 const StGlobalTrack* glTrack = (*iterBestMatchPair)->partnerTrack();
555 PAIRVEC mcMergedPair;
557 pair<rcTrackMapIter,rcTrackMapIter> rcBounds
558 = mRcTrackMap->equal_range(glTrack);
559 rcTrackMapIter rcMapIter = rcBounds.first;
563 UInt_t nAssocMc = mRcTrackMap->count(glTrack);
564 std::vector<UInt_t> nAssocGlVec;
565 std::vector<UInt_t> nAssocPrVec;
570 for( ; rcMapIter != rcBounds.second; rcMapIter++){
572 const StMcTrack* mcCandTrack = assocPair->partnerMcTrack();
577 if(!acceptRaw(mcCandTrack) || !accept(mcCandTrack))
continue;
583 PAIRVEC rcCandPair = findMatchedRc(mcCandTrack);
585 PAIRVEC::iterator iterRcBestPair =
586 max_element(rcCandPair.begin(),rcCandPair.end(),pairCmp);
590 if((*iterRcBestPair)->partnerTrack() == glTrack){
592 nAssocGlVec.push_back(mMcTrackMap->count(mcCandTrack));
593 nAssocPrVec.push_back(rcCandPair.size());
595 mcMergedPair.push_back(assocPair);
603 sort(mcMergedPair.begin(),mcMergedPair.end(),sortCmp);
609 if(Debug()==2 && mcMergedPair.size()>1) {
610 cout <<
"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << endl;
611 cout <<
"MERGED" << endl;
614 Bool_t foundBest = kFALSE;
615 Bool_t isBestContam = kFALSE;
617 for(
unsigned int i=0; i<mcMergedPair.size(); i++){
618 const StMcTrack* mergedMcTrack = (mcMergedPair[i])->partnerMcTrack();
619 UInt_t mergedCommonHits = (mcMergedPair[i])->commonTpcHits();
621 if(Debug()==2 && mcMergedPair.size()>1) {
622 TString hello = (foundBest) ?
"yes" :
"no";
623 cout <<
"-----------" <<
" foundBest? " << hello.Data() << endl;
624 checkMerged(mergedMcTrack, mergedCommonHits,prTrack);
628 if(!isPrimaryTrack(mergedMcTrack)){
629 if(i==0) isBestContam = kTRUE;
635 if(acceptPt(glTrack) || acceptPt(prTrack)){
637 Int_t commonHits = mergedCommonHits%100+
638 ((mcMergedPair[i]->commonSvtHits()%10)*100)+
639 ((mcMergedPair[i]->commonSsdHits()%10)*1000);
640 fillTrackPairInfo(miniMcPair, mergedMcTrack,
642 commonHits, nAssocMc,
643 nAssocGlVec[i], nAssocPrVec[i],
645 mMiniMcEvent->addTrackPair(miniMcPair,MATCHED);
648 rcFoundMap[prTrack->key()]=1;
654 if(acceptPt(glTrack) || acceptPt(prTrack)){
658 ((mcMergedPair[i]->commonSvtHits()%10)*100)+
659 ((mcMergedPair[i]->commonSsdHits()%10)*1000);
660 fillTrackPairInfo(miniMcPair,mergedMcTrack,prTrack,glTrack,
661 commonHits, nAssocMc,nAssocGlVec[i],
663 mMiniMcEvent->addTrackPair(miniMcPair,MERGED);
666 if(Debug()==2 && acceptDebug(mergedMcTrack))
667 cout <<
"YES! satisfies cuts" << endl;
676 mcFoundMap[mergedMcTrack->key()]=1;
679 if(Debug()==2 && mcMergedPair.size()>1)
680 cout <<
"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << endl;
691 if(acceptRaw(mcTrack)){
693 fillMcTrackInfo(&tinyMcTrack,mcTrack,nAssocGl,nAssocPr);
694 mMiniMcEvent->addMcTrack(&tinyMcTrack);
706 Int_t nUncorrectedGlobals(0);
707 StSPtrVecTrackNode& trackNode = mRcEvent->trackNodes();
708 int nTracks = trackNode.size();
709 for (
int i=0; i < nTracks; i++) {
712 StTrack *glTrack = node->track(global);
713 if (! glTrack)
continue;
714 if(acceptGlobals(glTrack)) nUncorrectedGlobals++;
717 Int_t nGoodTrackEta(0), nFtpcWUncorrected(0), nFtpcEUncorrected(0);
719 const StSPtrVecPrimaryTrack& prTracks =
720 mRcEvent->primaryVertex(mMainVtx)->daughters();
722 for(UInt_t i=0; i<prTracks.size(); i++){
728 if(!ok(prTrack))
continue;
731 =
static_cast<const StGlobalTrack*
>(prTrack->node()->track(global));
737 if(acceptCentrality(prTrack)) nGoodTrackEta++;
739 if(acceptGood20(glTrack)) nRcGoodGlobal20++;
744 if(acceptFTPC(prTrack) && prTrack->geometry()->momentum().pseudoRapidity() < 0. ) nFtpcEUncorrected++;
745 if(acceptFTPC(prTrack) && prTrack->geometry()->momentum().pseudoRapidity() > 0. ) nFtpcWUncorrected++;
750 if(!acceptPt(glTrack) && !acceptPt(prTrack))
continue;
755 if(!accept(glTrack) || !accept(prTrack))
continue;
760 UInt_t nAssocGl=0, nAssocPr=0;
761 UInt_t nAssocMc = mRcTrackMap->count(glTrack);
767 if(mRcTrackMap->count(glTrack) && !rcFoundMap.count(prTrack->key())){
772 pair<rcTrackMapIter,rcTrackMapIter> rcBounds
773 = mRcTrackMap->equal_range(glTrack);
777 rcTrackMapIter rcMapIter = rcBounds.first;
779 for( ; rcMapIter != rcBounds.second; rcMapIter++){
791 candPair.push_back(assocPair);
798 PAIRVEC::iterator iterBestMatchPair
799 = max_element(candPair.begin(),candPair.end(),pairCmp);
801 const StMcTrack* mcTrack = (*iterBestMatchPair)->partnerMcTrack();
802 UInt_t commonHits = (*iterBestMatchPair)->commonTpcHits();
804 nAssocGl = mMcTrackMap->count(mcTrack);
809 PAIRVEC matchPair = findMatchedRc(mcTrack);
810 nAssocPr = matchPair.size();
816 if(isPrimaryTrack(mcTrack)){
820 (((*iterBestMatchPair)->commonSvtHits()%10)*100)+
821 (((*iterBestMatchPair)->commonSsdHits()%10)*1000);
822 fillTrackPairInfo(miniMcPair,mcTrack,prTrack,glTrack,
823 cHits, nAssocMc, nAssocGl, nAssocPr);
824 mMiniMcEvent->addTrackPair(miniMcPair,SPLIT);
831 if(Debug()==2) checkSplit(mcTrack,glTrack,commonHits);
837 (((*iterBestMatchPair)->commonSvtHits()%10)*100)+
838 (((*iterBestMatchPair)->commonSsdHits()%10)*1000);
839 fillTrackPairInfo(contamPair,mcTrack,
840 prTrack,glTrack,cHits,
841 nAssocMc,nAssocGl,nAssocPr);
842 mMiniMcEvent->addContamPair(contamPair);
844 if(Debug()>=2) checkContam(mcTrack,glTrack,commonHits);
849 cout <<
"ERROR- no match for rc track when determining split/contaminations? " << endl;
857 else if(mGhost && mRcTrackMap->count(glTrack)==0){
859 fillRcTrackInfo(miniMcPair,
860 prTrack,glTrack,nAssocMc);
861 mMiniMcEvent->addTrackPair(miniMcPair,GHOST);
865 cout <<
"#############" << endl;
866 cout <<
"GHOST!" << endl;
867 cout <<
"pr pt: " << prTrack->geometry()->momentum().perp() << endl
868 <<
"TPC fit hits : " << glTrack->fitTraits().numberOfFitPoints(kTpcId)
869 <<
"SVT fit hits : " << glTrack->fitTraits().numberOfFitPoints(kSvtId)
878 fillEventInfo(nGoodTrackEta,nRcGlobal,nRcGoodGlobal20,
880 nMcGoodGlobal20,nMcNch,nMcHminus,
881 nMcFtpcENch, nMcFtpcWNch,nFtpcEUncorrected,nFtpcWUncorrected,
882 nUncorrectedGlobals);
888 cout <<
"\tall rc tracks: " << prTracks.size() << endl;
889 cout <<
"\tn good eta : " << nGoodTrackEta << endl;
890 cout <<
"\tcentrality : " << mMiniMcEvent->centrality() << endl;
891 cout <<
"\tuncorrected : " << mMiniMcEvent->nUncorrectedPrimaries() << endl;
892 cout <<
"\tall mc tracks: " << mcTracks.size() << endl;
893 cout <<
"\taccepted raw : " << nAcceptedRaw << endl;
894 cout <<
"\taccepted mc : " << nAccepted << endl;
895 cout <<
"\tmatched rc gl: " << nMatGlob << endl;
896 cout <<
"\tmatched rc pr: " << nMatched << endl;
897 cout <<
"\tmerged rc : " << nMerged << endl;
898 cout <<
"\tsplit rc : " << nSplit << endl;
900 cout <<
"\tghost rc : " << nGhost << endl;
901 cout <<
"\tcontam rc : " << nContam << endl;
902 cout <<
"\tcontam new : " << nContamNew << endl;
906 mNSplit += nSplit; mNGhost+= nGhost; mNContam += nContam;
907 mNMatched += nMatched;
908 mNMatGlob += nMatGlob;
912 void StMiniMcMaker::trackLoopIdT()
916 typedef std::map< int,StTinyMcTrack*> McTinyMap_t;
917 typedef McTinyMap_t::iterator McTinyMapIter_t;
921 typedef std::multimap< int,MyHolder_t> StTrackMap_t;
922 typedef std::pair<int,MyHolder_t> StTrackPair_t;
923 typedef StTrackMap_t::const_iterator StTrackMapIter_t;
925 Int_t nAcceptedRaw(0),nAccepted(0),
926 nRcGoodGlobal20(0), nRcGlobal(0), nMcGoodGlobal20(0),
927 nMcNch(0), nMcHminus(0), nMcFtpcWNch(0), nMcFtpcENch(0);
928 Int_t nGoodTrackEta(0), nFtpcWUncorrected(0), nFtpcEUncorrected(0);
929 Int_t nUncorrectedGlobals(0);
931 const StVertex *rcVertex = mRcEvent->primaryVertex(mMainVtx);
933 const StPtrVecMcTrack& mcTracks = mMcEvent->tracks();
934 int NMcTracks = mcTracks.size();
935 cout <<
"size of mcEvent->tracks() : " << NMcTracks << endl;
938 StTrackMap_t glMap,prMap;
939 StSPtrVecTrackNode& trackNode = mRcEvent->trackNodes();
940 int nTracks = trackNode.size(),myKey;
941 for (
int i=0; i < nTracks; i++) {
944 StTrack *glTrack = node->track(global);
945 if (! glTrack)
continue;
946 if(acceptGlobals(glTrack)) nUncorrectedGlobals++;
949 if(acceptGood20(glTrack)) nRcGoodGlobal20++;
952 if (prTrack && prTrack->vertex()!=rcVertex) prTrack=0;
954 dominatTkInfo(glTrack,myKey ,h.hits,h.qa);
955 glMap.insert(StTrackPair_t(myKey,h));
956 if (!prTrack)
continue;
957 prMap.insert(StTrackPair_t(myKey,h));
959 if(acceptCentrality(prTrack)) nGoodTrackEta++;
960 if(acceptFTPC(prTrack) && prTrack->geometry()->momentum().pseudoRapidity() < 0. ) nFtpcEUncorrected++;
961 if(acceptFTPC(prTrack) && prTrack->geometry()->momentum().pseudoRapidity() > 0. ) nFtpcWUncorrected++;
965 McTinyMap_t mcTinyMap ;
966 for (
int k = 0; k < NMcTracks; k++) {
968 if (! mcTrack->geantId())
continue;
969 int tkKey = mcTrack->key();
if (!tkKey)
continue;
970 if(!acceptRaw(mcTrack))
continue;
972 if(!accept(mcTrack))
continue;
974 if(acceptGood20(mcTrack)) nMcGoodGlobal20++;
975 if(fabs(mcTrack->pseudoRapidity())<.5 && isPrimaryTrack(mcTrack) && mcTrack->particleDefinition()){
976 if(mcTrack->particleDefinition()->charge()!=0) nMcNch++;
977 if(mcTrack->particleDefinition()->charge() <0) nMcHminus++;
979 if(mcTrack->particleDefinition() && mcTrack->particleDefinition()->charge()!=0 && isPrimaryTrack(mcTrack) ) {
980 if(mcTrack->pseudoRapidity()<-2.8 && mcTrack->pseudoRapidity()>-3.8) nMcFtpcENch++;
981 if(mcTrack->pseudoRapidity()> 2.8 && mcTrack->pseudoRapidity()< 3.8) nMcFtpcWNch++;
983 int nAssocGl = glMap.count(tkKey);
984 int nAssocPr = prMap.count(tkKey);
986 fillMcTrackInfo(tinyMcTrack,mcTrack,nAssocGl,nAssocPr);
987 mcTinyMap[tkKey] = tinyMcTrack;
988 tinyMcTrack->ResetBit(1);
993 for (StTrackMapIter_t it =glMap.begin(); it!= glMap.end();++it) {
994 int tkKey = (*it).first;
996 StMiniMcPair *miniMcPair = mMiniMcEvent->addTrackPair(0,MATCHED);
1000 tinyMcTrack->SetBit(1);
1002 fillRcTrackInfo(miniMcPair,h.pr,h.gl,0);
1003 miniMcPair->setDominatrack(tkKey);
1004 miniMcPair->setDominCommonHit(h.hits);
1005 miniMcPair->setAvgQuality(h.qa);
1006 miniMcPair->setNCommonHit(h.hits);
1011 for( McTinyMapIter_t it =mcTinyMap.begin();it !=mcTinyMap.end();++it)
1014 if (!tinyMcTrack)
continue;
1015 if (tinyMcTrack->TestBit(1))
continue;
1016 StMiniMcPair *miniMcPair = mMiniMcEvent->addTrackPair(0,MATCHED);
1023 fillEventInfo(nGoodTrackEta,nRcGlobal,nRcGoodGlobal20,
1024 nAcceptedRaw,nMcGoodGlobal20,nMcNch ,nMcHminus,
1025 nMcFtpcENch ,nMcFtpcWNch ,nFtpcEUncorrected,nFtpcWUncorrected,
1026 nUncorrectedGlobals);
1029 void StMiniMcMaker::buildEmcIndexArray()
1031 if (Debug()>1) cout <<
"StMiniMcMaker::buildEmcIndexArray" << endl;
1040 for (
int softIdNum=1; softIdNum<4801; ++softIdNum) mEmcIndex[softIdNum]=0;
1042 StEmcGeom* emcGeom = StEmcGeom::getEmcGeom(1);
1043 if (! mRcEvent->emcCollection())
return;
1044 StEmcDetector* bemcDet = mRcEvent->emcCollection()->detector(kBarrelEmcTowerId);
1045 if (! bemcDet)
return;
1047 cout <<
"emcGeom " << emcGeom << endl;
1048 cout <<
"bemcDet " << bemcDet << endl;
1052 for (
size_t iMod=1; iMod<=bemcDet->numberOfModules(); ++iMod) {
1053 StSPtrVecEmcRawHit& modHits = bemcDet->module(iMod)->hits();
1055 cout <<
"Module " << iMod << endl;
1056 cout <<
"Hits in Module " << modHits.size() << endl;
1058 for (
size_t iHit=0; iHit<modHits.size(); ++iHit) {
1060 unsigned int softId = rawHit->softId(1);
1062 cout <<
"iHit " << iHit << endl;
1063 cout <<
"soft Id " << softId << endl;
1064 cout <<
"ene, mod, eta, sub " << rawHit->energy()
1065 <<
", " << rawHit->module()
1066 <<
", " << rawHit->eta()
1067 <<
", " << rawHit->sub()
1073 if (!emcGeom->checkId(softId)) {
1074 mEmcIndex[softId] = rawHit;
1086 Int_t StMiniMcMaker::openFile()
1088 cout <<
"###StMiniMcMaker::openFile()" << endl;
1100 cout <<
"Infilename = " << mInFileName << endl;
1101 if (mInFileName ==
"") {
1102 TFile *tfile = GetTFile();
1106 TString outFileName(mInFileName);
1108 short indx1 = outFileName.First(
'.');
1109 short indx2 = outFileName.Last(
'.');
1110 if (indx1!=indx2) outFileName.Remove(indx1+1,(indx2-indx1));
1111 outFileName.Insert(indx1+1,
"minimc.");
1112 outFileName.Prepend(mOutDir);
1115 cout <<
"Opening File " << outFileName << endl;
1116 mMiniMcDST =
new TFile(outFileName.Data(),
"RECREATE");
1118 if(!mMiniMcDST || !mMiniMcDST->IsOpen()){
1119 gMessMgr->Error() <<
"Cannot create = " << outFileName << endm;
1123 cout <<
"\toutfile = " << outFileName << endl;
1124 mOutFileName = outFileName;
1129 if(Debug()) cout <<
"##Creating the top level tree..." << endl;
1130 mMiniMcTree =
new TTree(
"StMiniMcTree",
"StMiniMcTree");
1131 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,01,05)
1132 mMiniMcTree->SetBranchStyle(0);
1134 Int_t bufSZ = 64000;
1135 mMiniMcTree->Branch(
"StMiniMcEvent",
"StMiniMcEvent",&mMiniMcEvent, bufSZ,1);
1136 mMiniMcTree->SetAutoSave(10000000);
1138 cout <<
"##...done" << endl;
1145 Int_t StMiniMcMaker::closeFile()
1147 cout <<
"###StMiniMcMaker::closeFile()" << endl;
1148 cout <<
"\tWriting " << mOutFileName << endl;
1150 if(mMiniMcDST && mMiniMcDST->IsOpen()){
1152 mMiniMcTree->Write();
1153 mMiniMcDST->Write();
1154 mMiniMcDST->Close();
1155 delete mMiniMcDST; mMiniMcDST=0;
1158 cout <<
"\t...done\n";
1164 void StMiniMcMaker::fillEventInfo(Int_t nGoodTrackEta, Int_t nRcGlobal, Int_t nRcGoodGlobal20,
1165 Int_t nMcGlobal, Int_t nMcGoodGlobal20,
1166 Int_t nMcNch, Int_t nMcHminus, Int_t nMcFtpcENch, Int_t nMcFtpcWNch, Int_t nFtpcEUncorrected,
1167 Int_t nFtpcWUncorrected, Int_t nUncorrectedGlobals)
1169 mMiniMcEvent->setEventId((Int_t) mRcEvent->id());
1170 mMiniMcEvent->setRunId((Int_t) mRcEvent->runId());
1171 mMiniMcEvent->setOriginMult((Int_t)mRcEvent->primaryVertex(mMainVtx)->numberOfDaughters());
1172 mMiniMcEvent->setCentralMult(nGoodTrackEta);
1174 mMiniMcEvent->setImpact (mMcEvent->impactParameter() );
1175 mMiniMcEvent->setImpactPhi (mMcEvent->phiReactionPlane() );
1176 mMiniMcEvent->setTimeOffset (mMcEvent->triggerTimeOffset());
1178 mMiniMcEvent->setNMcNch(nMcNch);
1179 mMiniMcEvent->setNMcFtpcWNch(nMcFtpcWNch);
1180 mMiniMcEvent->setNMcFtpcENch(nMcFtpcENch);
1181 mMiniMcEvent->setNMcHminus(nMcHminus);
1183 mMiniMcEvent->setNMcGlobal(nMcGlobal);
1184 mMiniMcEvent->setNMcGoodGlobal20(nMcGoodGlobal20);
1186 mMiniMcEvent->setNRcGlobal(nRcGlobal);
1187 mMiniMcEvent->setNRcGoodGlobal20(nRcGoodGlobal20);
1189 mMiniMcEvent->setNUncorrectedNegativePrimaries(uncorrectedNumberOfNegativePrimaries(*mRcEvent));
1190 mMiniMcEvent->setNUncorrectedPrimaries(uncorrectedNumberOfPrimaries(*mRcEvent));
1192 mMiniMcEvent->setNUncorrectedGlobals(nUncorrectedGlobals);
1194 mMiniMcEvent->setNFtpcWUncorrectedPrimaries(nFtpcWUncorrected);
1195 mMiniMcEvent->setNFtpcEUncorrectedPrimaries(nFtpcEUncorrected);
1197 mMiniMcEvent->setCentrality(getIndex((
size_t) mMiniMcEvent->nUncorrectedPrimaries()));
1198 mMiniMcEvent->setMcMult(mMcEvent->numberOfPrimaryTracks());
1200 mMiniMcEvent->setVertexX(mRcVertexPos->x());
1201 mMiniMcEvent->setVertexY(mRcVertexPos->y());
1202 mMiniMcEvent->setVertexZ(mRcVertexPos->z());
1203 StMatrixF C(mRcEvent->primaryVertex(mMainVtx)->covariantMatrix());
1204 Float_t cov[6] = {C(1,1),C(2,1),C(2,2),C(3,1),C(3,2),C(3,3)};
1205 mMiniMcEvent->setVertexCovMatrix(cov);
1206 mMiniMcEvent->setMcVertexX(mMcVertexPos->x());
1207 mMiniMcEvent->setMcVertexY(mMcVertexPos->y());
1208 mMiniMcEvent->setMcVertexZ(mMcVertexPos->z());
1210 if (mRcEvent->runInfo()) {
1211 mMiniMcEvent->setMagField(static_cast<Float_t>(mRcEvent->runInfo()->magneticField()));
1212 mMiniMcEvent->setBackgroundRate(mRcEvent->runInfo()->backgroundRate());
1213 mMiniMcEvent->setCenterOfMassEnergy(mRcEvent->runInfo()->centerOfMassEnergy());
1214 mMiniMcEvent->setBeamMassNumberEast(mRcEvent->runInfo()->beamMassNumber(east));
1215 mMiniMcEvent->setBeamMassNumberWest(mRcEvent->runInfo()->beamMassNumber(west));
1218 Float_t ctb = -1., zdce = -1, zdcw = -1;
1221 = mRcEvent->triggerDetectorCollection();
1226 for (UInt_t slat=0; slat<CTB.numberOfSlats(); slat++) {
1227 for (UInt_t tray=0; tray<CTB.numberOfTrays();tray++) {
1228 ctb += CTB.mips(tray,slat,0);
1232 zdce = ZDC.adcSum(east);
1233 zdcw = ZDC.adcSum(west);
1236 mMiniMcEvent->setCtb(ctb);
1237 mMiniMcEvent->setZdcE(zdce);
1238 mMiniMcEvent->setZdcW(zdcw);
1243 void StMiniMcMaker::fillTrackPairInfo(
StMiniMcPair* miniMcPair,
1248 Int_t nAssocMc, Int_t nAssocGl,
1249 Int_t nAssocPr, Bool_t isBestContam)
1252 if(mcTrack) fillMcTrackInfo(miniMcPair,mcTrack,nAssocGl,nAssocPr);
1254 if(prTrack || glTrack) fillRcTrackInfo(miniMcPair,prTrack,glTrack,nAssocMc);
1257 miniMcPair->setNCommonHit(commonHits);
1258 miniMcPair->setIsBestContam(isBestContam);
1261 short aeonFluxHits(0);
1262 float aeonFluxQuality(-999);
1263 if (prTrack) dominatrackInfo(prTrack,aeonFlux,aeonFluxHits,aeonFluxQuality);
1264 else if (glTrack) dominatrackInfo(glTrack,aeonFlux,aeonFluxHits,aeonFluxQuality);
1265 miniMcPair->setDominatrack(aeonFlux);
1266 miniMcPair->setDominCommonHit(aeonFluxHits);
1267 miniMcPair->setAvgQuality(aeonFluxQuality);
1272 const StMcTrack* mcTParent = (mcTrack ? mcTrack->parent() : 0);
1275 contamPair->setParentGeantId(mcTrack->parent()->geantId());
1276 contamPair->setPtMcParent(mcTrack->parent()->momentum().perp());
1277 contamPair->setEtaMcParent(mcTrack->parent()->pseudoRapidity());
1278 contamPair->setGeantProcess(mcTrack->startVertex()->geantProcess());
1280 contamPair->setStartX(mcTrack->startVertex()->position().x());
1281 contamPair->setStartY(mcTrack->startVertex()->position().y());
1282 contamPair->setStartZ(mcTrack->startVertex()->position().z());
1284 Int_t parentParentGeantId=0;
1285 Float_t parentParentPt=0;
1287 if(mcTrack->parent()->parent() &&
1288 mcTrack->parent()->parent()->geantId()>0){
1289 parentParentGeantId = mcTrack->parent()->parent()->geantId();
1290 parentParentPt = mcTrack->parent()->parent()->momentum().perp();
1292 contamPair->setParentParentGeantId(parentParentGeantId);
1293 contamPair->setPtMcParentParent(parentParentPt);
1319 StMiniMcMakerErrorCount++;
1320 if ( StMiniMcMakerErrorCount < 50){
1321 cout <<
"StMiniMcMaker::fillTrackPairInfo: WARNING mcTrack->parent() is NULL !! "
1322 <<
" If this comes from a normal simulation or embeding, please report !!"
1323 <<
" This is known to happen in pilup mode ONLY ... " << endl;
1331 void StMiniMcMaker::fillRcTrackInfo(
StTinyRcTrack* tinyRcTrack,
1337 cout <<
"Error StMiniMcMaker::fillRcTrackInfo, glTrack pointer is zero " << glTrack << endl;
1342 tinyRcTrack->setValidGl();
1343 tinyRcTrack->setRecoKey(glTrack->key());
1344 tinyRcTrack->setDca00(1000.);
1346 tinyRcTrack->setDca00(dcaGeo->impact());
1347 tinyRcTrack->setDca(1);
1354 kPsiImp, kPsiZ, kPsiPsi,
1355 kPtiImp, kPtiZ, kPtiPsi, kPtiPti,
1356 kTanImp, kTanZ, kTanPsi, kTanPti, kTanTan};
1357 const float *dcaErr=dcaGeo->errMatrix();
1365 double pt = glMom.perp();
1366 tinyRcTrack->setPtGl(pt);
1367 tinyRcTrack->setPzGl(glMom.z());
1368 tinyRcTrack->setEtaGl(glMom.pseudoRapidity());
1369 tinyRcTrack->setPhiGl(glMom.phi());
1370 tinyRcTrack->setCurvGl(dcaGeo->curvature());
1371 tinyRcTrack->setTanLGl(dcaGeo->tanDip());
1372 tinyRcTrack->setSeedQuality(glTrack->seedQuality());
1374 {float(dcaErr[kImpImp]) ,
1375 float(dcaErr[kZZ]) ,
1376 float(dcaErr[kPsiPsi]) ,
1377 float(dcaErr[kPtiPti]*pow(pt,4)) ,
1378 float(dcaErr[kTanTan])
1380 for (
int j=0;j<5;j++) {errorGl[j] = sqrt(errorGl[j]);}
1381 tinyRcTrack->setErrGl(errorGl);
1382 double vtx[3]={mRcVertexPos[0][0],mRcVertexPos[0][1],mRcVertexPos[0][2]};
1384 glHelix.
Dca(vtx,dcaXY,dcaZ,0);
1385 tinyRcTrack->setDcaXYGl(dcaXY);
1386 tinyRcTrack->setDcaZGl(dcaZ);
1387 tinyRcTrack->setDcaGl(sqrt(dcaXY*dcaXY+dcaZ*dcaZ));
1388 double mcv[3]={mMcVertexPos[0][0],mMcVertexPos[0][1],mMcVertexPos[0][2]};
1389 glHelix.
Dca(mcv,dcaXY,dcaZ,0);
1390 tinyRcTrack->setDcaXYGlMcV(dcaXY);
1391 tinyRcTrack->setDcaZGlMcV(dcaZ);
1393 tinyRcTrack->setDca(0);
1400 double pt = glMom.perp();
1401 tinyRcTrack->setPtGl(pt);
1402 tinyRcTrack->setPzGl(glMom.z());
1403 tinyRcTrack->setEtaGl(glMom.pseudoRapidity());
1404 tinyRcTrack->setPhiGl(glMom.phi());
1405 tinyRcTrack->setCurvGl(glTrack->geometry()->curvature());
1406 tinyRcTrack->setTanLGl(tan(glTrack->geometry()->dipAngle()));
1407 tinyRcTrack->setSeedQuality(glTrack->seedQuality());
1408 StMatrixF gCM = glTrack->fitTraits().covariantMatrix();
1410 Float_t errorGl[5] = {
1411 Float_t(gCM[0][0]*pow(M_PI/180,2)) ,
1412 Float_t(gCM[1][1]) ,
1413 Float_t(gCM[3][3]*pow(M_PI/180,2)) ,
1414 Float_t(gCM[4][4]*pow(pt,4)) ,
1417 for (
int j=0;j<5;j++) {errorGl[j] = sqrt(errorGl[j]);}
1418 tinyRcTrack->setErrGl(errorGl);
1427 tinyRcTrack->setDcaGl(glTrack->impactParameter());
1428 tinyRcTrack->setDcaXYGl(computeXY(mRcVertexPos,glTrack));
1430 tinyRcTrack->setDcaXYGl(computeXY(mRcVertexPos,glTrack));
1431 tinyRcTrack->setDcaZGlMcV(dcaz(glHelix,*mMcVertexPos,glTrack));
1432 tinyRcTrack->setDcaXYGlMcV(computeXY(mMcVertexPos,glTrack));
1436 float meanDedx = (pid) ? pid->mean() : -999;
1437 tinyRcTrack->setDedx(meanDedx);
1438 short nDedxPts = (pid) ? pid->numberOfPoints() : 0;
1439 tinyRcTrack->setDedxPts(nDedxPts);
1445 PAIRHIT hits = findFirstLastHit(glTrack);
1446 PAIRHIT fitHits = findFirstLastFitHit(glTrack);
1450 tinyRcTrack->setFirstZ(hits.first->position().z());
1451 tinyRcTrack->setLastZ(hits.second->position().z());
1452 tinyRcTrack->setFirstPadrow(hits.first->padrow());
1453 tinyRcTrack->setLastPadrow(hits.second->padrow());
1454 tinyRcTrack->setFirstSector(hits.first->sector());
1455 tinyRcTrack->setLastSector(hits.second->sector());
1457 else if ( glTrack->detectorInfo()->numberOfPoints()==0) {
1459 cout <<
"Error: no hits?" << endl;
1460 cout <<
"Tpc points : " << glTrack->detectorInfo()->numberOfPoints(kTpcId) << endl;
1461 cout <<
"Svt points : " << glTrack->detectorInfo()->numberOfPoints(kTpcId) << endl;
1462 cout <<
"Ftpc points E: " << glTrack->detectorInfo()->numberOfPoints(kFtpcEastId) << endl;
1463 cout <<
"Ftpc points W: " << glTrack->detectorInfo()->numberOfPoints(kFtpcWestId) << endl;
1465 if (fitHits.first) {
1466 tinyRcTrack->setFirstFitPadrow(fitHits.first->padrow());
1467 tinyRcTrack->setLastFitPadrow(fitHits.second->padrow());
1469 else if ( glTrack->fitTraits().numberOfFitPoints()==0) {
1470 cout <<
"Error: no hit with usedInFit()>0" << endl;
1471 cout <<
"Tpc fit pts :" << glTrack->fitTraits().numberOfFitPoints(kTpcId) << endl;
1472 cout <<
"Svt fit pts :" << glTrack->fitTraits().numberOfFitPoints(kSvtId) << endl;
1473 cout <<
"Ftpc fit pts E:" << glTrack->fitTraits().numberOfFitPoints(kFtpcEastId) << endl;
1474 cout <<
"Ftpc fit pts C:" << glTrack->fitTraits().numberOfFitPoints(kFtpcWestId) << endl;
1477 tinyRcTrack->setFitPts(glTrack->fitTraits().numberOfFitPoints(kTpcId));
1478 tinyRcTrack->setFitSvt(glTrack->fitTraits().numberOfFitPoints(kSvtId));
1479 tinyRcTrack->setFitSsd(glTrack->fitTraits().numberOfFitPoints(kSsdId));
1480 size_t ftpcFitPts = 0;
1481 if (tinyRcTrack->etaGl()>1.8)
1482 ftpcFitPts = glTrack->fitTraits().numberOfFitPoints(kFtpcWestId);
1483 if (tinyRcTrack->etaGl()<-1.8)
1484 ftpcFitPts = glTrack->fitTraits().numberOfFitPoints(kFtpcEastId);
1485 tinyRcTrack->setFitFtpc(ftpcFitPts);
1486 tinyRcTrack->setAllPts(glTrack->detectorInfo()->numberOfPoints(kTpcId));
1487 tinyRcTrack->setCharge(glTrack->geometry()->charge());
1489 tinyRcTrack->setNAssocMc(nAssocMc);
1490 tinyRcTrack->setNPossible(glTrack->numberOfPossiblePoints(kTpcId));
1493 tinyRcTrack->setValidPr();
1499 double pt = prMom.perp();
1500 tinyRcTrack->setPtPr(pt);
1501 tinyRcTrack->setPzPr(prMom.z());
1502 tinyRcTrack->setEtaPr(prMom.pseudoRapidity());
1503 tinyRcTrack->setPhiPr(prMom.phi());
1504 tinyRcTrack->setCurvPr(prTrack->geometry()->curvature());
1505 tinyRcTrack->setTanLPr(tan(prTrack->geometry()->dipAngle()));
1506 tinyRcTrack->setChi2Pr(prTrack->fitTraits().chi2());
1507 tinyRcTrack->setFlag(prTrack->flag());
1508 tinyRcTrack->setDcaPr(prTrack->impactParameter());
1509 tinyRcTrack->setDcaXYPr(computeXY(mRcVertexPos,prTrack));
1511 tinyRcTrack->setDcaZPr(dcaz(prHelix,*mRcVertexPos));
1512 tinyRcTrack->setDcaXYPrMcV(computeXY(mMcVertexPos,prTrack));
1513 tinyRcTrack->setDcaZPrMcV(dcaz(prHelix,*mMcVertexPos));
1514 tinyRcTrack->setFitPts(prTrack->fitTraits().numberOfFitPoints(kTpcId));
1515 tinyRcTrack->setFitSvt(prTrack->fitTraits().numberOfFitPoints(kSvtId));
1516 tinyRcTrack->setFitSsd(prTrack->fitTraits().numberOfFitPoints(kSsdId));
1517 StMatrixF pCM = prTrack->fitTraits().covariantMatrix();
1518 Float_t errorPr[5] = {
1519 Float_t(pCM[0][0]*pow(M_PI/180,2)) ,
1520 Float_t(pCM[1][1]) ,
1521 Float_t(pCM[3][3]*pow(M_PI/180,2)) ,
1522 Float_t(pCM[4][4]*pow(pt,4)) ,
1525 for (
int j=0;j<5;j++) {errorPr[j] = sqrt(errorPr[j]);}
1526 tinyRcTrack->setErrPr(errorPr);
1527 size_t ftpcFitPts = 0;
1528 if (tinyRcTrack->etaGl()>1.8)
1529 ftpcFitPts = prTrack->fitTraits().numberOfFitPoints(kFtpcWestId);
1530 if (tinyRcTrack->etaGl()<-1.8)
1531 ftpcFitPts = prTrack->fitTraits().numberOfFitPoints(kFtpcEastId);
1532 tinyRcTrack->setFitFtpc(ftpcFitPts);
1548 double magField = mRcEvent->runInfo()->magneticField();
1551 cout <<
"fillRcTrack, EMC information" << endl;
1552 cout <<
"Extrapolating to BEMC using B Field = " << magField*kilogauss/tesla <<
" tesla" << endl;
1566 projOk = emcPos.
trackOnEmc(&pos,&mom,prTrack,magField*kilogauss/tesla);
1569 projOk = emcPos.
trackOnEmc(&pos,&mom,glTrack,magField*kilogauss/tesla);
1575 std::vector<StEmcRawHit*> towersOfTrack;
1576 StEmcGeom* emcGeom = StEmcGeom::getEmcGeom(
"bemc");
1577 emcGeom->getId(pos.phi(),pos.pseudoRapidity(),softIdProj);
1578 for(
int idEta=-1; idEta<2; ++idEta) {
1579 for (
int idPhi=-1; idPhi<2; ++idPhi) {
1585 if (!emcGeom->checkId(towerId)) {
1592 towersOfTrack.push_back(emcHit);
1598 cout <<
"Outer Helix " << glTrack->outerGeometry()->helix() << endl;
1599 cout <<
"Track Projects to tower " << softIdProj << endl;
1600 cout <<
"Track hits at R= " << pos.perp() <<
" eta,phi: " << pos.pseudoRapidity() <<
", " << pos.phi() << endl;
1601 cout <<
"Track Has " << towersOfTrack.size() <<
" total candidate towers" << endl;
1603 if (towersOfTrack.size()>0) {
1606 sort(towersOfTrack.begin(),towersOfTrack.end(),StEmcRawHitCompEne);
1610 if (towersOfTrack.size()<maxTowers) maxTowers=towersOfTrack.size();
1611 for (
size_t iTow=0; iTow<maxTowers; ++iTow) {
1612 tinyRcTrack->setEmcTowerAdc(towersOfTrack[iTow]->adc(),iTow);
1613 tinyRcTrack->setEmcEnergyRcHit(towersOfTrack[iTow]->energy(),iTow);
1614 tinyRcTrack->setEmcSoftIdHiTowerRc(towersOfTrack[iTow]->softId(1),iTow);
1619 for (
size_t iTow=0; iTow<0; ++iTow) {
1620 tinyRcTrack->setEmcTowerAdc(-9,iTow);
1621 tinyRcTrack->setEmcEnergyRcHit(-9,iTow);
1622 tinyRcTrack->setEmcSoftIdHiTowerRc(-9,iTow);
1627 cout <<
"rc track, key " << tinyRcTrack->recoKey() << endl;
1628 cout <<
"n Tpc Fit Pts " << tinyRcTrack->fitPts() << endl;
1629 cout <<
"3 bemc hit ene " << tinyRcTrack->emcEnergyRcHit(0)
1630 <<
", " << tinyRcTrack->emcEnergyRcHit(1)
1631 <<
", " << tinyRcTrack->emcEnergyRcHit(2) << endl;
1632 cout <<
"3 HiTow SoftId Rc " << tinyRcTrack->emcSoftIdHiTowerRc(0)
1633 <<
", " << tinyRcTrack->emcSoftIdHiTowerRc(1)
1634 <<
", " << tinyRcTrack->emcSoftIdHiTowerRc(2) << endl;
1635 float etaTow, phiTow;
1636 emcGeom->getEtaPhi(tinyRcTrack->emcSoftIdHiTowerRc(0),etaTow,phiTow);
1637 cout <<
"Hi Tow eta, phi Rc " << etaTow <<
", " << phiTow << endl;
1645 void StMiniMcMaker::fillMcTrackInfo(
StTinyMcTrack* tinyMcTrack,
1647 Int_t nAssocGl, Int_t nAssocPr)
1650 tinyMcTrack->setValid();
1653 tinyMcTrack->setKey(mcTrack->key());
1654 tinyMcTrack->setPrimary(mcTrack->IsPrimary());
1655 tinyMcTrack->setPtMc(mcMom.perp());
1656 tinyMcTrack->setPzMc(mcMom.z());
1657 tinyMcTrack->setEtaMc(mcMom.pseudoRapidity());
1658 tinyMcTrack->setPhiMc(mcMom.phi());
1659 tinyMcTrack->setNHitMc(mcTrack->tpcHits().size());
1660 tinyMcTrack->setNSvtHitMc(mcTrack->svtHits().size());
1661 tinyMcTrack->setNSsdHitMc(mcTrack->ssdHits().size());
1662 tinyMcTrack->setNFtpcHitMc(mcTrack->ftpcHits().size());
1663 tinyMcTrack->setGeantId(mcTrack->geantId());
1664 tinyMcTrack->setPdgId(mcTrack->pdgId());
1665 short chargeMc = -9999;
1666 if (mcTrack->particleDefinition()) chargeMc = static_cast<short>(mcTrack->particleDefinition()->charge());
1667 tinyMcTrack->setChargeMc(chargeMc);
1669 tinyMcTrack->setNAssocGl(nAssocGl);
1670 tinyMcTrack->setNAssocPr(nAssocPr);
1672 float stopR=(mcTrack->stopVertex()) ? mcTrack->stopVertex()->position().perp() : 999;
1673 tinyMcTrack->setStopR(stopR);
1676 tinyMcTrack->setKey(mcTrack->key());
1677 if (mcTrack->parent()!=0) {
1678 tinyMcTrack->setParentKey(mcTrack->parent()->key());
1679 tinyMcTrack->setParentGeantId(mcTrack->parent()->geantId());
1681 tinyMcTrack->setPtMc(mcMom.perp());
1682 tinyMcTrack->setPzMc(mcMom.z());
1683 tinyMcTrack->setEtaMc(mcMom.pseudoRapidity());
1684 tinyMcTrack->setPhiMc(mcMom.phi());
1685 tinyMcTrack->setNHitMc(mcTrack->tpcHits().size());
1686 tinyMcTrack->setNSvtHitMc(mcTrack->svtHits().size());
1687 tinyMcTrack->setNFtpcHitMc(mcTrack->ftpcHits().size());
1688 tinyMcTrack->setNBemcHitMc(mcTrack->bemcHits().size());
1689 tinyMcTrack->setNBprsHitMc(mcTrack->bprsHits().size());
1690 tinyMcTrack->setNBsmdeHitMc(mcTrack->bsmdeHits().size());
1691 tinyMcTrack->setNBsmdpHitMc(mcTrack->bsmdpHits().size());
1692 tinyMcTrack->setNEemcHitMc(mcTrack->eemcHits().size());
1693 tinyMcTrack->setNBprsHitMc(mcTrack->bprsHits().size());
1694 tinyMcTrack->setNBsmdeHitMc(mcTrack->bsmdeHits().size());
1695 tinyMcTrack->setNBsmdpHitMc(mcTrack->bsmdpHits().size());
1696 tinyMcTrack->setGeantId(mcTrack->geantId());
1698 tinyMcTrack->setNAssocGl(nAssocGl);
1699 tinyMcTrack->setNAssocPr(nAssocPr);
1708 StPtrVecMcCalorimeterHit bemcHits = mcTrack->bemcHits();
1709 if (bemcHits.size()>0) {
1710 std::vector<StMcCalorimeterHit*> bemcHitsSorted(bemcHits.size());
1711 int hiEnergyHitSoftId(-999);
1712 double sumEnergy(0);
1713 copy(bemcHits.begin(),bemcHits.end(),bemcHitsSorted.begin());
1714 sort(bemcHitsSorted.begin(),bemcHitsSorted.end(),StMcCalorimeterHitCompdE);
1716 cout <<
"fillMcTrackInfo() Check sorting of dE for StMcCalorimeterHits" << endl;
1718 StEmcGeom* emcGeom = StEmcGeom::getEmcGeom(
"bemc");
1719 for (StMcCalorimeterHitIterator bhi=bemcHitsSorted.begin();
1720 bhi!=bemcHitsSorted.end();
1724 emcGeom->getEta(bh->module(),bh->eta(),eta);
1725 sumEnergy += (*bhi)->dE()*scaleFactor(eta);
1726 if (Debug()>2) cout << bh->dE()*scaleFactor(eta) << endl;
1730 if (bemcHitsSorted.size()<maxHits) maxHits=bemcHitsSorted.size();
1731 for (
size_t iCalHit=0; iCalHit<maxHits; ++iCalHit) {
1733 emcGeom->getEta(bemcHitsSorted[iCalHit]->module(),bemcHitsSorted[iCalHit]->eta(),eta);
1734 tinyMcTrack->setEmcEnergyMcHit(bemcHitsSorted[iCalHit]->dE()*scaleFactor(eta),iCalHit);
1735 emcGeom->getId(bemcHitsSorted[iCalHit]->module(),
1736 bemcHitsSorted[iCalHit]->eta(),
1737 bemcHitsSorted[iCalHit]->sub(),hiEnergyHitSoftId);
1738 tinyMcTrack->setEmcSoftIdHiTowerMc(static_cast<Short_t>(hiEnergyHitSoftId),iCalHit);
1741 for (
size_t iCalHit2=maxHits; iCalHit2<3; ++iCalHit2) {
1742 tinyMcTrack->setEmcEnergyMcHit(-9,iCalHit2);
1743 tinyMcTrack->setEmcSoftIdHiTowerMc(-9,iCalHit2);
1746 tinyMcTrack->setEmcEnergyMcSum(sumEnergy);
1749 cout <<
"mc track, geant Id " << tinyMcTrack->geantId() << endl;
1750 cout <<
"parent geantId " << tinyMcTrack->parentGeantId() << endl;
1751 cout <<
"n Tpc Hits " << tinyMcTrack->nHitMc() << endl;
1752 cout <<
"n Bemc Hits " << tinyMcTrack->nBemcHitMc() << endl;
1753 cout <<
"3 bemc hit ene " << tinyMcTrack->emcEnergyMcHit(0)
1754 <<
", " << tinyMcTrack->emcEnergyMcHit(1)
1755 <<
", " << tinyMcTrack->emcEnergyMcHit(2) << endl;
1756 cout <<
"MC 3 Hi SoftIds " << tinyMcTrack->emcSoftIdHiTowerMc(0)
1757 <<
", " << tinyMcTrack->emcSoftIdHiTowerMc(1)
1758 <<
", " << tinyMcTrack->emcSoftIdHiTowerMc(2) << endl;
1759 cout <<
"emc energy sum " << tinyMcTrack->emcEnergyMcSum() << endl;
1760 cout <<
"MC trk momentum " << tinyMcTrack->pMc() << endl;
1761 cout <<
"MC eta, phi " << tinyMcTrack->etaMc() <<
", " << tinyMcTrack->phiMc() << endl;
1762 float etaTow, phiTow;
1763 emcGeom->getEtaPhi(tinyMcTrack->emcSoftIdHiTowerMc(0),etaTow,phiTow);
1764 cout <<
"MC HiTow eta,phi " << etaTow <<
", " << phiTow << endl;
1765 if (mEmcIndex[tinyMcTrack->emcSoftIdHiTowerMc(0)]) {
1766 StEmcRawHit* rawHit = mEmcIndex[tinyMcTrack->emcSoftIdHiTowerMc(0)];
1767 cout <<
"RC Ene for id " << rawHit->energy()
1768 <<
" m= " << rawHit->module()
1769 <<
" e= " << rawHit->eta()
1770 <<
" s= " << rawHit->sub()
1775 cout <<
"Soft Id Mc " << tinyMcTrack->emcSoftIdHiTowerMc(0) <<
" has no StEmcRawHit" << endl;
1790 pair<mcTrackMapIter,mcTrackMapIter> mcBounds = mMcTrackMap->equal_range((
const StMcTrack*)mcTrack);
1793 mcTrackMapIter mcMapIter = mcBounds.first;
1794 for ( ; mcMapIter != mcBounds.second; ++mcMapIter){
1798 cout << * assocPair << endl;
1799 cout <<
"globTrack FitPoints Tpc/FtpcE/W = " << globTrack->fitTraits().numberOfFitPoints(kTpcId)
1800 <<
"/" << globTrack->fitTraits().numberOfFitPoints(kFtpcEastId)
1801 <<
"/" << globTrack->fitTraits().numberOfFitPoints(kFtpcWestId) << endl;
1803 if (!globTrack || globTrack->flag()<=0)
continue;
1804 if (globTrack->fitTraits().numberOfFitPoints(kTpcId)>=10 ||
1805 globTrack->fitTraits().numberOfFitPoints(kFtpcEastId)>=5 ||
1806 globTrack->fitTraits().numberOfFitPoints(kFtpcWestId)>=5) {
1807 if (!candTrackPair) {
1808 candTrackPair = assocPair;
1809 candTrack = globTrack;
1811 else if (globTrack->fitTraits().numberOfFitPoints(kTpcId) > candTrack->fitTraits().numberOfFitPoints(kTpcId)) {
1812 candTrackPair = assocPair;
1813 candTrack = globTrack;
1815 else if (globTrack->fitTraits().numberOfFitPoints(kFtpcEastId) > candTrack->fitTraits().numberOfFitPoints(kFtpcEastId)) {
1816 candTrackPair = assocPair;
1817 candTrack = globTrack;
1819 else if (globTrack->fitTraits().numberOfFitPoints(kFtpcWestId) > candTrack->fitTraits().numberOfFitPoints(kFtpcWestId)) {
1820 candTrackPair = assocPair;
1821 candTrack = globTrack;
1826 return candTrackPair;
1829 PAIRVEC StMiniMcMaker::findMatchedRc(
const StMcTrack* mcTrack)
1834 pair<mcTrackMapIter,mcTrackMapIter> mcBounds = mMcTrackMap->equal_range((
const StMcTrack*)mcTrack);
1838 mcTrackMapIter mcMapIter = mcBounds.first;
1839 for( ; mcMapIter != mcBounds.second; mcMapIter++){
1848 if(!(prTrack = isPrimaryTrack(glTrack)))
continue;
1860 if(!accept(glTrack) || !accept(prTrack))
continue;
1871 candPair.push_back(assocPair);
1879 PAIRHIT StMiniMcMaker::findFirstLastHit(
const StTrack*
track)
1881 const StPtrVecHit& hits = track->detectorInfo()->hits(kTpcId);
1882 std::vector<const StTpcHit*> vec;
1885 for(UInt_t i=0; i<hits.size(); i++){
1890 sort(vec.begin(),vec.end(),hitCmp);
1892 return PAIRHIT(vec[0],vec[vec.size()-1]);
1896 return PAIRHIT(empty,empty);
1901 PAIRHIT StMiniMcMaker::findFirstLastFitHit(
const StTrack* track)
1903 const StPtrVecHit& hits = track->detectorInfo()->hits(kTpcId);
1904 std::vector<const StTpcHit*> vec;
1907 for(UInt_t i=0; i<hits.size(); i++){
1910 if(!hit->usedInFit())
continue;
1913 sort(vec.begin(),vec.end(),hitCmp);
1915 return PAIRHIT(vec[0],vec[vec.size()-1]);
1919 return PAIRHIT(empty,empty);
1927 Bool_t StMiniMcMaker::acceptRaw(
const StMcTrack* mcTrack)
1942 Bool_t StMiniMcMaker::accept(
const StMcTrack* mcTrack)
1944 return (mcTrack && mcTrack->tpcHits().size() >= 10);
1949 Bool_t StMiniMcMaker::accept(
const StTrack* rcTrack)
1951 UInt_t nFitPoint = rcTrack->fitTraits().numberOfFitPoints(kUnknownId);
1952 return ( nFitPoint>=5 && rcTrack->flag()>0 );
1957 Bool_t StMiniMcMaker::isSameSign(
const StTrack* rcTrack,
const StMcTrack* mcTrack)
1959 return (rcTrack->geometry()->charge()*
1960 mcTrack->particleDefinition()->charge()>0);
1965 Bool_t StMiniMcMaker::acceptPt(
const StTrack* track)
1967 return (track->geometry()->momentum().perp()>=mMinPt &&
1968 track->geometry()->momentum().perp()<=mMaxPt);
1973 Bool_t StMiniMcMaker::acceptPt(
const StMcTrack *track)
1975 return (track->momentum().perp()>=mMinPt &&
1976 track->momentum().perp()<=mMaxPt);
1980 Bool_t StMiniMcMaker::acceptDebug(
const StMcTrack* track)
1982 return (track->momentum().pseudoRapidity() <= .1
1983 && track->momentum().pseudoRapidity() >= 0 &&
1984 (track->geantId()==9 || track->geantId()==12 || track->geantId()==15));
1990 Bool_t StMiniMcMaker::acceptCentrality(
const StTrack* track)
1992 return (fabs(track->geometry()->momentum().pseudoRapidity())<.75);
1997 Bool_t StMiniMcMaker::acceptUncorrected(
const StTrack* track)
2000 track->geometry()->charge()<0 &&
2001 track->fitTraits().numberOfFitPoints(kTpcId)>=10 &&
2002 fabs(track->geometry()->momentum().pseudoRapidity())<=0.5 &&
2003 track->geometry()->helix().
distance(*mRcVertexPos)<3
2008 Bool_t StMiniMcMaker::acceptGlobals(
const StTrack* track)
2014 Bool_t StMiniMcMaker::acceptFTPC(
const StTrack* prTrack)
2021 Bool_t StMiniMcMaker::ok(
const StTrack* track)
2023 return (track && track->flag()>0);
2027 Bool_t StMiniMcMaker::acceptGood20(
const StTrack* track)
2029 UInt_t nFitPoint = track->fitTraits().numberOfFitPoints(kTpcId);
2030 return (track && nFitPoint >= 20);
2035 Bool_t StMiniMcMaker::acceptGood20(
const StMcTrack* track)
2037 return (track && track->tpcHits().size() >= 20);
2044 if(!glTrack)
return 0;
2045 return dynamic_cast<const StPrimaryTrack*
>(glTrack->node()->track(primary));
2050 Bool_t StMiniMcMaker::isPrimaryTrack(
const StMcTrack* mcTrack)
2053 return(mcTrack->startVertex() == mMcEvent->primaryVertex());
2066 double xCenter = track->geometry()->helix().
xcenter();
2067 double yCenter = track->geometry()->helix().
ycenter();
2068 double radius = 1.0/track->geometry()->helix().curvature();
2071 = TMath::Sqrt( (pos->x()-xCenter) * (pos->x()-xCenter) +
2072 (pos->y()-yCenter) * (pos->y()-yCenter));
2074 return (Float_t) ( radius - dPosCenter );
2082 pairD path = helix.
pathLength(point->perp());
2089 double dcaZ = (dis1.mag() < dis2.mag()) ? dis1.z() : dis2.z();
2090 if(std::isnan(dcaZ))
return 999;
2097 StPtrVecTrackPidTraits traits = track->pidTraits(kTpcId);
2099 for (UInt_t i = 0; i < traits.size(); i++) {
2101 if (pid && pid->method() == kLikelihoodFitId)
break;
2108 void StMiniMcMaker::checkMerged(
const StMcTrack* mergedMcTrack, Int_t mergedCommonHits,
2112 if(!isPrimaryTrack(mergedMcTrack))
2113 cout <<
"NOT a MC PRIMARY track" << endl;
2115 cout <<
"rc key : " << track->key() << endl;
2116 cout <<
"rc pr pt : "
2117 << track->geometry()->momentum().perp() << endl;
2118 cout <<
"rc pr flag : " << track->flag() << endl;
2119 cout <<
"rc pr dca : "
2120 << track->geometry()->helix().
distance(*mRcVertexPos) << endl;
2121 cout <<
"mc key : " << mergedMcTrack->key() << endl;
2122 cout <<
"mc evt gen : " << mergedMcTrack->eventGenLabel() << endl;
2124 << mergedMcTrack->momentum().perp() << endl;
2125 cout <<
"mc eta: " << mergedMcTrack->momentum().pseudoRapidity() << endl;
2126 cout <<
"mc hits : "
2127 << mergedMcTrack->tpcHits().size() << endl;
2128 cout <<
"geant : " << mergedMcTrack->geantId() << endl;
2129 cout <<
"common hits : "
2130 << mergedCommonHits << endl;
2131 cout <<
"rc all hits : "
2132 << track->detectorInfo()->numberOfPoints(kTpcId) << endl;
2133 cout <<
"rc fit hits : "
2134 << track->fitTraits().numberOfFitPoints(kTpcId) << endl;
2140 void StMiniMcMaker::checkSplit(
const StMcTrack* mcTrack,
const StTrack* glTrack,
2145 PAIRVEC testPair = findMatchedRc(mcTrack);
2146 sort(testPair.begin(), testPair.end(), sortCmp);
2148 cout <<
"#######################################" << endl;
2149 cout <<
"CHECK SPLIT:" << endl;
2151 << mcTrack->momentum().perp() << endl;
2153 << mcTrack->key() << endl;
2154 if (mcTrack->particleDefinition()) {
2155 cout <<
"mc charge: "
2156 << mcTrack->particleDefinition()->charge() << endl;
2159 << mcTrack->momentum().pseudoRapidity() << endl;
2161 << mcTrack->tpcHits().size() << endl;
2163 << glTrack->geometry()->momentum().perp() << endl;
2164 cout <<
"all hits : "
2165 << glTrack->detectorInfo()->numberOfPoints(kTpcId) << endl;
2166 cout <<
"fit pts : "
2167 << glTrack->fitTraits().numberOfFitPoints(kTpcId)<< endl;
2168 cout <<
"common hits : " << commonHits << endl;
2173 if(testPair.size() == 1) {
2174 cout <<
"ERROR in split. not really a split track. "
2175 <<
"maybe due to pt cut?" << endl;
2176 cout <<
"mc start vertex : " << mcTrack->startVertex()->position() << endl;
2179 cout <<
">>Here are the rc tracks" << endl;
2180 for(
unsigned int i=0; i<testPair.size(); i++){
2181 cout <<
"i: " << i << endl;
2182 const StGlobalTrack* testGlTrack = testPair[i]->partnerTrack();
2184 << testGlTrack->geometry()->momentum().perp() << endl;
2185 cout <<
"all hits : "
2186 << testGlTrack-> detectorInfo()->numberOfPoints(kTpcId) << endl;
2187 cout <<
"fit pts : "
2188 << testGlTrack->fitTraits().numberOfFitPoints(kTpcId)<< endl;
2189 cout <<
"common hits : "
2190 << testPair[i]->commonTpcHits() << endl;
2192 cout <<
"#######################################" << endl;
2202 cout <<
"############## " << endl;
2203 cout <<
"CHECK CONTAM " << endl;
2205 if(mcTrack->startVertex() == mMcEvent->primaryVertex()){
2206 cout <<
"\tERROR mc track is a primary!\n" << endl;
2209 cout <<
"common hits : " << commonHits << endl
2210 <<
"rc key : " << prTrack->key() << endl
2211 <<
"mc key : " << mcTrack->key() << endl
2212 <<
"pr pt : " << prTrack->geometry()->momentum().perp() << endl
2213 <<
"mc pt : " << mcTrack->momentum().perp() << endl
2214 <<
"fit pts : " << glTrack->fitTraits().numberOfFitPoints(kTpcId)
2216 <<
"all pts : "<< glTrack->detectorInfo()->numberOfPoints(kTpcId)<< endl
2217 <<
"gl dca xy : " << computeXY(mRcVertexPos,glTrack) << endl;
2218 cout <<
">>Here are all the mc tracks matched to this rc track" << endl;
2220 pair<rcTrackMapIter,rcTrackMapIter> rcBounds
2221 = mRcTrackMap->equal_range(glTrack);
2223 rcTrackMapIter rcMapIter = rcBounds.first;
2225 for( ; rcMapIter != rcBounds.second; rcMapIter++){
2227 const StMcTrack* mcCandTrack = assocPair->partnerMcTrack();
2229 cout <<
"common hits=" << assocPair->commonTpcHits()
2230 <<
", is mc primary=" << (isPrimaryTrack(mcTrack)?
"yes":
"no")
2231 <<
", mc key=" << mcCandTrack->key()
2232 <<
", hits=" << mcCandTrack->tpcHits().size() << endl;
2234 cout <<
">>Here are the rc tracks matched to this mc track" << endl;
2236 PAIRVEC testPair = findMatchedRc(mcTrack);
2237 sort(testPair.begin(), testPair.end(), sortCmp);
2239 for(
unsigned int i=0; i<testPair.size(); i++){
2240 cout <<
"i: " << i << endl;
2241 const StGlobalTrack* testGlTrack = testPair[i]->partnerTrack();
2243 cout <<
"common hits=" << testPair[i]->commonTpcHits()
2244 <<
", rc key=" << testGlTrack->key() << endl;
2250 size_t StMiniMcMaker::getIndex(
size_t mult)
2257 if (mult >= 510)
return 0;
2258 if (mult >= 431)
return 1;
2259 if (mult >= 312)
return 2;
2260 if (mult >= 217)
return 3;
2261 if (mult >= 146)
return 4;
2262 if (mult >= 94 )
return 5;
2263 if (mult >= 56 )
return 6;
2264 if (mult >= 30 )
return 7;
2265 if (mult >= 14 )
return 8;
2270 void StMiniMcMaker::AppendMCDaughterTrack()
2273 cout <<
"##StMiniMcMaker::AppendMCDaughterTrack()"<< endl;
2276 const StPtrVecMcTrack& allmcTracks = mMcEvent->tracks();
2277 cout <<
"size of mcEvent->tracks() : "<< allmcTracks.size() << endl;
2280 StMcTrackConstIterator allMcTrkIter = allmcTracks.begin();
2281 for (; allMcTrkIter != allmcTracks.end(); ++allMcTrkIter) {
2282 const StMcTrack* mcGlobTrack = *allMcTrkIter;
2283 if (isPrimaryTrack(mcGlobTrack))
continue;
2284 if (!acceptRaw(mcGlobTrack))
continue;
2287 cout <<
"accepted mc global track, key "<< mcGlobTrack->key() << endl;
2291 fillMcTrackInfo(&tinyMcTrack, mcGlobTrack, 0, 0);
2292 mMiniMcEvent->addMcTrack(&tinyMcTrack);
2298 cout <<
"\tappended mc tracks: "<< nAppendMC << endl;
2302 void StMiniMcMaker::dominatTkInfo(
const StTrack* recTrack,
int &dominatrackKey ,
int& dominatrackHits,
float& avgQuality) {
2308 int DetectorList[kMaxDetectorId]={0};
2309 typedef std::map< int,float> myMap_t;
2310 typedef myMap_t::const_iterator myIter_t;
2313 const StPtrVecHit &recHits = recTrack->detectorInfo()->hits();
2315 int nHits = recHits.size();
2316 for (
int hi=0;hi<nHits; hi++) {
2317 const StHit* rHit = recHits[hi];
2318 int id = rHit->idTruth();
if (!
id)
continue;
2319 int qa = rHit->qaTruth();
if (!qa) qa = 1;
2322 int tkBest=0;
float qaBest=0,qaSum=0;
2323 for (myIter_t it=idTruths.begin(); it!=idTruths.end();++it) {
2324 qaSum+=(*it).second;
2325 if ((*it).second<qaBest)
continue;
2326 tkBest=(*it).first; qaBest=(*it).second;
2328 dominatrackKey = tkBest; avgQuality = 100*qaBest/(qaSum+1e-10);
2329 for (
int hi=0;hi<nHits; hi++) {
2330 const StHit* rHit = recHits[hi];
2331 if (rHit->idTruth()!=tkBest)
continue;
2332 DetectorList[rHit->detector()]++;
2334 if (DetectorList[kTpcId] > 99) DetectorList[kTpcId] = 99;
2335 if (DetectorList[kSvtId] > 9) DetectorList[kSvtId] = 9;
2336 if (DetectorList[kSsdId] > 9) DetectorList[kSsdId] = 9;
2337 dominatrackHits = DetectorList[kTpcId] + 100*(DetectorList[kSvtId] + 10*DetectorList[kSsdId]);
Bool_t trackOnEmc(StThreeVectorD *position, StThreeVectorD *momentum, const StTrack *const track, Double_t magField, Double_t emcRadius=225.405) const
Track projection utility.
virtual void Clear(Option_t *option="")
User defined functions.
Monte Carlo Track class All information on a simulated track is stored in this class: kinematics...
double distance(const StThreeVector< double > &p, bool scanPeriods=true) const
minimal distance between point and helix
pair< double, double > pathLength(double r) const
path length at given r (cylindrical r)
double ycenter() const
x-center of circle in xy-plane
Int_t getNextTowerId(Float_t eta, Float_t phi, Int_t nTowersdEta, Int_t nTowersdPhi) const
Return neighbor tower id's.
rcTpcHitMapType * rcTpcHitMap()
Diff btw global r and phi coords of FTPC hits.
Filling of StMiniMcEvent classes from StMcEvent, StEvent, StAssociationMaker.
double xcenter() const
aziumth in xy-plane measured from ring center
Event data structure to hold all information from a Monte Carlo simulation. This class is the interfa...
void Clear(Option_t *option="")
User defined functions.
double Dca(const double point[3], double *dcaErr=0) const
DCA to given space point (with error matrix)