StHbtAssociationReader.cxx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. #define DIFF_CUT_OFF 1.
  2. #include "StHbtMaker/Reader/StHbtAssociationReader.h"
  3. #include "StHbtMaker/Infrastructure/StHbtTrackCollection.hh"
  4. #include "StHbtMaker/Infrastructure/StHbtV0Collection.hh"
  5. #include "StEventUtilities/StuRefMult.hh"
  6. #include "StHbtMaker/Infrastructure/StHbtEvent.hh"
  7. #include "StHbtMaker/Base/StHbtEventCut.h"
  8. #include "StHbtMaker/Base/StHbtTrackCut.h"
  9. #include "StHbtMaker/Base/StHbtV0Cut.h"
  10. #include "StHbtMaker/Base/StHbtKinkCut.h"
  11. #include "StChain.h"
  12. #include "TOrdCollection.h"
  13. #include "StEventTypes.h"
  14. #include "StParticleTypes.hh"
  15. #include "SystemOfUnits.h" // has "tesla" in it
  16. #include "StTpcDedxPidAlgorithm.h"
  17. #include <math.h>
  18. // #include "StGlobalTrack.h"
  19. // #include "StTrackNode.h"
  20. // #include "StContainers.h"
  21. // #include "StPrimaryVertex.h"
  22. // #include "StVertex.h"
  23. // #include "StMeasuredPoint.h"
  24. // #include "StDedxPidTraits.h"
  25. // #include "StTrackPidTraits.h"
  26. // #include "StTrackGeometry.h"
  27. // #include "StTrackDetectorInfo.h"
  28. #include "StAssociationMaker/StAssociationMaker.h"
  29. #include "StStrangeMuDstMaker/StStrangeEvMuDst.hh"
  30. #include "StStrangeMuDstMaker/StV0MuDst.hh"
  31. #include "StMcEventTypes.hh"
  32. #include "StMcEvent.hh"
  33. #include "PhysicalConstants.h"
  34. #include "SystemOfUnits.h"
  35. #include "StThreeVector.hh"
  36. #include "StThreeVectorF.hh"
  37. #include "StThreeVectorD.hh"
  38. #include "StChain.h"
  39. #include "St_DataSet.h"
  40. #include "St_DataSetIter.h"
  41. #include "g2t_event.h"
  42. #include "g2t_ftp_hit.h"
  43. #include "g2t_svt_hit.h"
  44. #include "g2t_tpc_hit.h"
  45. #include "g2t_track.h"
  46. #include "g2t_vertex.h"
  47. #include "tables/St_g2t_event_Table.h"
  48. #include "tables/St_g2t_ftp_hit_Table.h"
  49. #include "tables/St_g2t_svt_hit_Table.h"
  50. #include "tables/St_g2t_tpc_hit_Table.h"
  51. #include "tables/St_g2t_track_Table.h"
  52. #include "tables/St_g2t_vertex_Table.h"
  53. // #include "StMcEvent.hh"
  54. // #include "StMcTrack.hh"
  55. // #include "StMcTpcHit.hh"
  56. // #include "StMcFtpcHit.hh"
  57. // #include "StMcSvtHit.hh"
  58. // #include "StMcVertex.hh"
  59. #include "StAssociationMaker/StTrackPairInfo.hh"
  60. #include "StParticleDefinition.hh"
  61. #include "StPhysicalHelix.hh"
  62. #ifndef ST_NO_NAMESPACES
  63. using namespace units;
  64. #endif
  65. struct vertexFlag {
  66. StMcVertex* vtx;
  67. int primaryFlag; };
  68. //__________________
  69. StHbtAssociationReader::StHbtAssociationReader() : mPerfectPID(true) {
  70. mDiffCurrent = new StHbt1DHisto("Diff_current", " (p_real - p_mc ) / p_real ",100,-1.,1.);
  71. mDiff = new StHbt1DHisto("Diff", " (p_real - p_mc ) / p_real ",100,-1.,1.);
  72. mDiffMean = new StHbt1DHisto("Diff_mean", " mean of (p_real - p_mc ) / p_real ",100,-1.,1.);
  73. mDiffRMS = new StHbt1DHisto("Diff_sigma", " sigma of (p_real - p_mc ) / p_real ",100,0.,1.);
  74. eventNumber=0;
  75. mEventCut=0;
  76. mTrackCut=0;
  77. mReaderStatus = 0; // "good"
  78. mV0=0;
  79. }
  80. //__________________
  81. StHbtAssociationReader::~StHbtAssociationReader(){
  82. cout << " StHbtAssociationReader::~StHbtAssociationReader() " << endl;
  83. if (mEventCut) delete mEventCut;
  84. if (mTrackCut) delete mTrackCut;
  85. }
  86. //__________________
  87. StHbtString StHbtAssociationReader::Report(){
  88. StHbtString temp = "\n This is the StHbtAssociationReader\n";
  89. temp += "---> EventCuts in Reader: ";
  90. if (mEventCut) {
  91. temp += mEventCut->Report();
  92. }
  93. else {
  94. temp += "NONE";
  95. }
  96. temp += "\n---> TrackCuts in Reader: ";
  97. if (mTrackCut) {
  98. temp += mTrackCut->Report();
  99. }
  100. else {
  101. temp += "NONE";
  102. }
  103. temp += "\n";
  104. return temp;
  105. }
  106. //__________________
  107. StHbtEvent* StHbtAssociationReader::ReturnHbtEvent(){
  108. cout << " **************************************************************************************" << endl;
  109. cout << " StHbtAssociationReader::ReturnHbtEvent() : Seconds elapsed since last call : " << difftime( time(0), timeStamp ) << endl;
  110. cout << " **************************************************************************************" << endl;
  111. timeStamp = time(0);
  112. // ********************************
  113. // get pointer to eventMaker, event
  114. // ********************************
  115. // the following lines commented out as per S&C request September 2005 - malisa
  116. // StEvent* rEvent = 0;
  117. // StEventMaker* tempMaker = (StEventMaker*) mTheEventMaker;
  118. // rEvent = tempMaker->event();
  119. // and they are replaced by the one following line
  120. StEvent* rEvent = (StEvent*) StMaker::GetChain()->GetDataSet("StEvent");
  121. // end changes malisa sept2005
  122. if (!rEvent){
  123. cout << "StHbtAssociationReader - No StEvent!!! " << endl;
  124. return 0;
  125. }
  126. cout << " StEvent " << endl;
  127. // **************************************
  128. // get pointer to mcEventMaker, Event *
  129. // **************************************
  130. StMcEvent* mEvent = 0; //!
  131. // malisa sept2005 - similar change as above
  132. // StMcEventMaker* mTempMaker = (StMcEventMaker*) mTheMcEventMaker;
  133. // mEvent = mTempMaker->currentMcEvent();
  134. // 28sep2005 - mike lisa replaces the two lines above with the
  135. // following one as per http://www.star.bnl.gov/HyperNews-star/protected/get/starsoft/
  136. mEvent = (StMcEvent*) StMaker::GetChain()->GetDataSet("StMcEvent");
  137. if (!mEvent){
  138. cout << "StHbtAssociationReader - No StMcEvent!!! " << endl;
  139. return 0;
  140. }
  141. cout << " McEvent " << endl;
  142. // ****************************************
  143. // get pointer to associationMaker, mcEvent
  144. // ****************************************
  145. StAssociationMaker* assoc = 0;
  146. assoc = (StAssociationMaker*) mTheAssociationMaker;
  147. //assoc = (StAssociationMaker*) gStChain->Maker("Associations");
  148. if (!assoc){
  149. cout << "StHbtAssociationReader - No StAssociationMaker!!! " << endl;
  150. cout << "StHbtAssociationReader - assoc " << assoc <<endl;
  151. return 0;
  152. }
  153. rcTpcHitMapType* theHitMap = 0;
  154. theHitMap = assoc->rcTpcHitMap();
  155. if (!theHitMap){
  156. cout << "StHbtAssociationReader - No tpcHitMap!!! " << endl;
  157. cout << "StHbtAssociationReader - theHitMap " << theHitMap <<endl;
  158. return 0;
  159. }
  160. rcTrackMapType* theTrackMap = 0;
  161. theTrackMap = assoc->rcTrackMap();
  162. if (!theTrackMap){
  163. cout << "StHbtAssociationReader - No trackMap!!! " << endl;
  164. cout << "StHbtAssociationReader - theTrackMap " << theTrackMap <<endl;
  165. return 0;
  166. }
  167. rcV0MapType* theV0Map = 0;
  168. theV0Map = assoc->rcV0Map();
  169. if (!theV0Map){
  170. cout << "StHbtAssociationReader - No v0Map!!! " << endl;
  171. cout << "StHbtAssociationReader - theV0Map " << theV0Map <<endl;
  172. return 0;
  173. }
  174. if ( !(rEvent->primaryVertex()) || // no pointer to prim vertex
  175. (mEvent->primaryVertex()->position().x() == mEvent->primaryVertex()->position().y() &&
  176. mEvent->primaryVertex()->position().y() == mEvent->primaryVertex()->position().z() ) ||// x==y==z --> mark for bad events from embedding
  177. isnan(rEvent->primaryVertex()->position().x()) // vertex position not a number
  178. ) {
  179. cout << "StHbtAssociationReader - bad vertex !!! " << endl;
  180. return 0;
  181. }
  182. // o.k. we got a StEvent and a McEvent --> create hbtEvent
  183. // ******************
  184. // Event properties
  185. // ******************
  186. // ******************************
  187. // cross check event <--> mcEvent
  188. // ******************************
  189. cout << " **********************" << endl;
  190. cout << " StHbtAssociationReader" << endl;
  191. cout << " **********************" << endl;
  192. unsigned long mRunNumber = mEvent->runNumber();
  193. unsigned long rRunNumber = rEvent->runId();
  194. cout << " DST run: #" << rRunNumber << endl;
  195. cout << " MC run: #" << mRunNumber << endl;
  196. unsigned long rEventNumber = 0;
  197. unsigned long mEventNumber = mEvent->eventNumber();
  198. cout << " DST event: #" << rEventNumber << endl;
  199. cout << " MC event: #" << mEventNumber << endl;
  200. int rMult = rEvent->trackNodes().size();
  201. int mMult = mEvent->tracks().size();
  202. cout << " DST mult: #" << rMult << endl;
  203. cout << " MC mult: #" << mMult << endl;
  204. if ( !rEvent->primaryVertex() ) return 0;
  205. if ( !mEvent->primaryVertex() ) return 0;
  206. StHbtThreeVector rVertexPosition = rEvent->primaryVertex()->position();
  207. StHbtThreeVector mVertexPosition = mEvent->primaryVertex()->position();
  208. cout << " DST primary Vertex #" << rVertexPosition << endl;
  209. cout << " MC primary Vertex #" << mVertexPosition << endl;
  210. cout << "StHbtAssociationReader::ReturnHbtEvent - We have " << rMult << " tracks to store - we skip tracks with nhits==0" << endl;
  211. double pathlength;
  212. StHbtThreeVector p;
  213. StHbtThreeVector mp;
  214. mDiffCurrent->Reset();
  215. float diff=0;
  216. StHbtEvent* hbtEvent = new StHbtEvent;
  217. hbtEvent->SetEventNumber(rEventNumber);
  218. hbtEvent->SetUncorrectedNumberOfPositivePrimaries(uncorrectedNumberOfPositivePrimaries(*rEvent));
  219. hbtEvent->SetUncorrectedNumberOfNegativePrimaries(uncorrectedNumberOfNegativePrimaries(*rEvent));
  220. hbtEvent->SetCtbMult(0);
  221. hbtEvent->SetZdcAdcEast(0);
  222. hbtEvent->SetZdcAdcWest(0);
  223. hbtEvent->SetNumberOfTpcHits(0);
  224. hbtEvent->SetNumberOfTracks(rMult);
  225. hbtEvent->SetReactionPlane(0.);
  226. hbtEvent->SetReactionPlaneSubEventDifference(0.);
  227. hbtEvent->SetPrimVertPos(rVertexPosition);
  228. // By now, all event-wise information has been extracted and stored in hbtEvent
  229. // see if it passes any front-loaded event cut
  230. // if (mEventCut){
  231. // if (!(mEventCut->Pass(hbtEvent))){ // event failed! - return null pointer (but leave Reader status flag as "good")
  232. // delete hbtEvent;
  233. // return 0;
  234. // }
  235. // }
  236. StTpcDedxPidAlgorithm* PidAlgorithm = new StTpcDedxPidAlgorithm();
  237. if (!PidAlgorithm) cout << " StStandardHbtEventReader::ReturnHbtEvent() - Whoa!! No PidAlgorithm!! " << endl;
  238. // the following just point to particle definitions in StEvent
  239. StElectron* Electron = StElectron::instance();
  240. StPionPlus* Pion = StPionPlus::instance();
  241. StKaonPlus* Kaon = StKaonPlus::instance();
  242. StProton* Proton = StProton::instance();
  243. {for (rcTrackMapIter tIter=theTrackMap->begin(); tIter!=theTrackMap->end(); ++tIter){
  244. // cout << "Doing track number " << ++icount << endl;
  245. const StGlobalTrack* rTrack = (*tIter).first;
  246. // do I really got a track
  247. if (!rTrack) {
  248. continue;
  249. }
  250. // check number points in tpc
  251. int nhits = rTrack->detectorInfo()->numberOfPoints(kTpcId);
  252. //cout << "nhits\t" << nhits << endl;
  253. if (nhits==0) {
  254. //cout << "No hits -- skipping track (because it crashes otherwise)" << endl;
  255. continue;
  256. }
  257. // *********************************
  258. // checking for associated mc tracks
  259. // *********************************
  260. int numberOfassociatedTracks = theTrackMap->count(rTrack);
  261. if (numberOfassociatedTracks !=1) {
  262. // cout << " number of associated mc tracks : " << theTrackMap->count(rTrack) << endl;
  263. // cout << " skip this track" << endl;
  264. continue;
  265. }
  266. // while getting the bestGuess, the pidAlgorithm (StTpcDedxPidAlgorithm) is set up.
  267. // pointers to track and pidTraits are set
  268. StParticleDefinition* BestGuess = (StParticleDefinition*)rTrack->pidTraits(*PidAlgorithm);
  269. // if (BestGuess) cout << "best guess for particle is " << BestGuess->name() << endl; //2dec9
  270. if (!BestGuess){
  271. continue;
  272. }
  273. // **********************
  274. // get associated mctrack
  275. // **********************
  276. const StMcTrack* mTrack = (*tIter).second->partnerMcTrack();
  277. // check Pdg Id of the StMcTrack and its mc-mother and mc-daughters
  278. int pdgCode = 0;
  279. int motherPdgCode = 0;
  280. int daughterPdgCode =0;
  281. int motherTrackId =0;
  282. if (CheckPdgIdLists()) {
  283. int check=0;
  284. if (!mTrack->particleDefinition()) {
  285. cout << " track has no particle definiton " << endl;
  286. continue;
  287. }
  288. pdgCode = mTrack->particleDefinition()->pdgEncoding();
  289. // this was just stupid... mal 14nov01 motherPdgCode = mTrack->parent(); // 0 if no start vertex
  290. // if (motherPdgCode) {
  291. if (mTrack->parent()) {
  292. motherPdgCode = mTrack->parent()->pdgId();
  293. motherTrackId = mTrack->parent()->key();
  294. }
  295. if (motherPdgCode) cout << " motherPdgCode :" << motherPdgCode << endl;
  296. else cout << " mother has no pdgId "<< endl;
  297. if ( mTrack->stopVertex() == 0 ) {
  298. check += CheckPdgIdList(pdgCode,motherPdgCode,0);
  299. }
  300. else {
  301. for (unsigned int iDaughter=0; iDaughter < mTrack->stopVertex()->daughters().size()-1; iDaughter++) {
  302. daughterPdgCode = mTrack->stopVertex()->daughters()[iDaughter]->pdgId();
  303. check += CheckPdgIdList(pdgCode,motherPdgCode,daughterPdgCode);
  304. }
  305. }
  306. if ( !(check) ) {
  307. continue; // particle failed, continue with next track
  308. }
  309. }
  310. int geantId = mTrack->geantId();
  311. //cout << " partnerMcTrack geant Id : " << mTrack->geantId() << endl;
  312. //cout << " partnerMcTrack particleDefinition : " << *(mTrack->particleDefinition()) << endl;
  313. // ****************************************
  314. // check momenta of real track and mc track
  315. // ****************************************
  316. pathlength = rTrack->geometry()->helix().pathLength( rVertexPosition );
  317. //cout << "pathlength\t" << pathlength << endl;
  318. p = rTrack->geometry()->momentum();
  319. mp = mTrack->momentum();
  320. //cout << "p: " << p << endl;
  321. //cout << "mp: " << mp << endl;
  322. diff = (p.mag()-mp.mag()) / p.mag();
  323. if ( fabs(diff) > DIFF_CUT_OFF ) {
  324. // cout << "StHbtAssociationReader::ReturnEvent() : momenta diff " << 100 * diff << " % -- track skipped -- " << endl;
  325. continue;
  326. }
  327. mDiff->Fill(diff,1.);
  328. mDiffCurrent->Fill(diff,1.);
  329. // cout << "Getting readty to instantiate new StHbtTrack " << endl;
  330. // o.k., god track found, fill it
  331. StHbtTrack* hbtTrack = new StHbtTrack;
  332. //cout << "StHbtTrack instantiated " << endl;
  333. hbtTrack->SetTrackId((int)(rTrack->key()+motherTrackId*::pow(2,16)));
  334. int charge = ( rTrack->geometry()->charge() );
  335. hbtTrack->SetNHits( charge * nhits);
  336. if (mPerfectPID) {
  337. switch (geantId) {
  338. case 2: // intentional fall-through
  339. case 3: // gid=2,3 is electron
  340. hbtTrack->SetNSigmaElectron(0.);
  341. hbtTrack->SetNSigmaPion(-999.);
  342. hbtTrack->SetNSigmaKaon(-999.);
  343. hbtTrack->SetNSigmaProton(-999.);
  344. break;
  345. case 8: // intentional fall-through
  346. case 9: // gid=8,9 is pion
  347. hbtTrack->SetNSigmaElectron(999.);
  348. hbtTrack->SetNSigmaPion(0.);
  349. hbtTrack->SetNSigmaKaon(-999.);
  350. hbtTrack->SetNSigmaProton(-999.);
  351. break;
  352. case 11: // intentional fall-through
  353. case 12: // gid=11,12 is kaon
  354. hbtTrack->SetNSigmaElectron(999.);
  355. hbtTrack->SetNSigmaPion(999.);
  356. hbtTrack->SetNSigmaKaon(0.);
  357. hbtTrack->SetNSigmaProton(-999.);
  358. break;
  359. case 14: // intentional fall-through
  360. case 15: // gid=14,15 is proton
  361. hbtTrack->SetNSigmaElectron(999.);
  362. hbtTrack->SetNSigmaPion(999.);
  363. hbtTrack->SetNSigmaKaon(999.);
  364. hbtTrack->SetNSigmaProton(0.);
  365. break;
  366. default:
  367. hbtTrack->SetNSigmaElectron(999.);
  368. hbtTrack->SetNSigmaPion(999.);
  369. hbtTrack->SetNSigmaKaon(999.);
  370. hbtTrack->SetNSigmaProton(999.);
  371. break;
  372. }
  373. }
  374. else {
  375. hbtTrack->SetNSigmaElectron(PidAlgorithm->numberOfSigma(Electron));
  376. hbtTrack->SetNSigmaPion(PidAlgorithm->numberOfSigma(Pion));
  377. hbtTrack->SetNSigmaKaon(PidAlgorithm->numberOfSigma(Kaon));
  378. hbtTrack->SetNSigmaProton(PidAlgorithm->numberOfSigma(Proton));
  379. }
  380. //cout << "dEdx\t" << PidAlgorithm->traits()->mean() << endl;
  381. hbtTrack->SetdEdx(PidAlgorithm->traits()->mean());
  382. double pathlength = rTrack->geometry()->helix().pathLength(rVertexPosition);
  383. //cout << "pathlength\t" << pathlength << endl;
  384. StHbtThreeVector p = rTrack->geometry()->momentum();
  385. //cout << "p: " << p << endl;
  386. hbtTrack->SetP(p);
  387. StHbtThreeVector DCAxyz = rTrack->geometry()->helix().at(pathlength)-rVertexPosition;
  388. //cout << "DCA\t\t" << DCAxyz << " " << DCAxyz.perp() << endl;
  389. hbtTrack->SetDCAxyGlobal( DCAxyz.perp() );
  390. hbtTrack->SetDCAzGlobal( DCAxyz.z() );
  391. hbtTrack->SetChi2( rTrack->fitTraits().chi2(0) );
  392. StPhysicalHelixD helix = rTrack->geometry()->helix();
  393. hbtTrack->SetHelix( helix );
  394. float pt = ::sqrt(p[0]*p[0]+p[1]*p[1]);
  395. //cout << "pt\t\t\t" << pt << endl;
  396. //hbtTrack->SetPt(pt);
  397. //hbtTrack->SetPt(pt);
  398. hbtTrack->SetTopologyMap( 0, rTrack->topologyMap().data(0) );
  399. hbtTrack->SetTopologyMap( 1, rTrack->topologyMap().data(1) );
  400. //cout << "pushing..." <<endl;
  401. // By now, all track-wise information has been extracted and stored in hbtTrack
  402. // see if it passes any front-loaded event cut
  403. if (mTrackCut){
  404. if (!(mTrackCut->Pass(hbtTrack))){ // track failed - delete it and skip the push_back
  405. delete hbtTrack;
  406. continue;
  407. }
  408. }
  409. hbtEvent->TrackCollection()->push_back(hbtTrack);
  410. }}
  411. hbtEvent->SetNumberOfGoodTracks(hbtEvent->TrackCollection()->size());
  412. cout << " StHbtAssociationReader::ReturnEvent() : mean of momenta diff (accepted tracks)= " << mDiffCurrent->GetMean() << endl;
  413. cout << " StHbtAssociationReader::ReturnEvent() : rms of momenta diff (accepted tracks)= " << mDiffCurrent->GetRMS() << endl;
  414. mDiffMean->Fill(mDiffCurrent->GetMean(),1.);
  415. mDiffRMS->Fill(mDiffCurrent->GetRMS(),1.);
  416. cout << " StHbtAssociationReader::ReturnEvent() : DiffCurrent (p_real - p_mc ) / p_real " << mDiffCurrent << endl;
  417. cout << " StHbtAssociationReader::ReturnEvent() : Diff (p_real - p_mc ) / p_real " << mDiff << endl;
  418. cout << " StHbtAssociationReader::ReturnEvent() : DiffMean mean of (p_real - p_mc ) / p_real " << mDiffMean << endl;
  419. cout << " StHbtAssociationReader::ReturnEvent() : DiffSigma sigma of (p_real - p_mc ) / p_real " << mDiffRMS << endl;
  420. //the fastes way to fill the StHbtV0 is to create the StStrangeEvMuDst with the StV0MuDst and the copy into StHbtV0
  421. StStrangeEvMuDst strangeEvMuDst(*rEvent);
  422. // loop over all the StV0Vertices
  423. {for (rcV0MapIter tIter=theV0Map->begin(); tIter!=theV0Map->end(); ++tIter){
  424. StV0Vertex* rV0Vertex = (StV0Vertex*) (*tIter).first; // got the V0 from reconstruction
  425. StV0MuDst v0MuDst(rV0Vertex,&strangeEvMuDst); // create the StV0MuDst
  426. cout << " StHbtAssociationEventReader::ReturnHbtEvent() " << theV0Map->count(rV0Vertex) << " associated V0s " << endl;
  427. // loop over associated tracks // maybe later you want to check particle ids
  428. pair<rcV0MapIter, rcV0MapIter> boundsV0 = theV0Map->equal_range(rV0Vertex);
  429. for (rcV0MapIter v0Iter = boundsV0.first; v0Iter!= boundsV0.second; v0Iter++){ // loop over all associated V0s
  430. }
  431. StHbtV0* hbtV0 = new StHbtV0(v0MuDst); // copy into StHbtV0;
  432. if (mV0Cut){ // check whether vo passes cuts
  433. if (!(mV0Cut->Pass(hbtV0))) { // track failed - delete it and skip the push_back
  434. delete hbtV0;
  435. continue;
  436. }
  437. }
  438. hbtEvent->V0Collection()->push_back(hbtV0); // good V0 fill in collection
  439. }}
  440. cout << " StHbtAssociationReader::ReturnHbtEvent() - " << hbtEvent->V0Collection()->size();
  441. cout << " V0s pushed in collection " << endl;
  442. eventNumber++;
  443. return hbtEvent;
  444. }
  445. ClassImp(StHbtAssociationReader)