StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSkimPionMaker.cxx
1 /*******************************************************************************
2  *
3  * Pi0 Maker for 2004 p+p real data
4  *
5  * Author: Frank Simon, MIT, May 2005
6  * based on code from Andre Mischke
7  *******************************************************************************
8  *
9  * Description: StFranksPi0Maker:
10  *
11  * calculates minv(gamma,gamma) tower by tower. The tower is assigned by
12  * the neutral bemc point with the highest energy.
13  * A tree with pi0 information is filled for subsequent analysis
14  *
15  ******************************************************************************/
16 
17 #include <vector>
18 #include <algorithm>
19 
20 #include "TFile.h"
21 #include "TH2F.h"
22 #include "TObjArray.h"
23 
24 // ROOT
25 #include "TROOT.h" // for gROOT variable
26 #include "TNtuple.h"
27 #include "TTree.h"
28 
29 // StEvent
30 #include "StChain.h"
31 #include "StEvent.h"
32 #include "StEventTypes.h"
33 #include "StHit.h"
34 #include "StMeasuredPoint.h"
35 #include "StEvent/StTriggerData.h"
36 #include "StEvent/StL0Trigger.h"
37 
38 //StMuDstMaker
39 #include "StMuDSTMaker/COMMON/StMuDst.h"
40 #include "StMuDSTMaker/COMMON/StMuEvent.h"
41 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
42 #include "StMuDSTMaker/COMMON/StMuEmcCollection.h"
43 #include "StMuDSTMaker/COMMON/StMuDst.h"
44 #include "StMuDSTMaker/COMMON/StMuEmcUtil.h"
45 #include "StMuDSTMaker/COMMON/StMuTrack.h"
46 
47 // EMC related
48 #include "StEmcUtil/geometry/StEmcGeom.h"
49 #include "StEmcUtil/projection/StEmcPosition.h"
50 
51 //StSpinDbMaker
52 #include "StSpinPool/StSpinDbMaker/StSpinDbMaker.h"
53 
54 
55 #include "StPrimaryVertex.h"
56 #include "StPrimaryTrack.h"
57 #include "StDedxPidTraits.h"
58 #include "StTrackFitTraits.h"
59 #include "StTrackDetectorInfo.h"
60 #include "StTrackGeometry.h"
61 #include "StTpcDedxPidAlgorithm.h"
62 #include "StTriggerDetectorCollection.h"
63 #include "StCtbTriggerDetector.h"
64 #include "StZdcTriggerDetector.h"
65 #include "StEventTypes.h"
66 #include "StMemoryInfo.hh"
67 
68 #include "StTrack.h"
69 #include "StVertex.h"
70 #include "StMaker.h"
71 
72 // for trigger prescales
73 #include "StDetectorDbMaker/StDetectorDbTriggerID.h"
74 
75 // for trigger simulation
76 //#include "StJetMaker/StJetSimuUtil/StJetEmcTrigSim.h"
77 
78 // for MuTrack EMC matching
79 //#include "StJetMaker/StFourPMakers/StMuEmcPosition.h"
80 #include "StEmcUtil/projection/StEmcPosition.h"
81 
82 // for Renees Trigger Sim:
83 #include "StTriggerUtilities/StTriggerSimuMaker.h"
84 #include "StTriggerUtilities/Bbc/StBbcTriggerSimu.h"
85 #include "StTriggerUtilities/Bemc/StBemcTriggerSimu.h"
86 #include "StTriggerUtilities/L2Emulator/StL2TriggerSimu.h"
87 
88 // Issams Background maker (private copy)
89 //#include "StEmcPool/BckgFinder/StBemcBeamBckgFinderMaker.h"
90 
91 #include "StThreeVectorF.hh"
92 #include "StSkimPionMaker.h"
93 
94 //for BBC vertex information (needs a modified version of StBbcTriggerDetector.h / cxx
95 #include "StBbcTriggerDetector.h"
96 
97 // for Pi0EventTree
98 #include "TSkimPionEvent.h"
99 
100 ClassImp(StSkimPionMaker);
101 
102 //________________________________________________________________________________________________________
103 StSkimPionMaker::StSkimPionMaker(const char *name, Bool_t doTracks, const char *outfile):StMaker(name)
104 {
105  // constructor
106  mDoTracks = doTracks;
107  mFileName = outfile;
108 
109  mPi = 3.1416;
110  mPi0Mass = 0.13498;
111 
112  debug = false; // debug mode
113  fnummixed = 10; // number of events for event-mixing
114 
115  // initialize counter values
116  ievtot=0;
117  iWrittenEvents = 0;
118  /*
119  ievaccep=0;
120  inochainpt=0;
121  inoevpt=0;
122  ibadrun=0;
123  iemc=0;
124  inoprimvert=0;
125  itrig=0;
126  */
127 }
128 
129 //________________________________________________________________________________________________________
130 StSkimPionMaker::~StSkimPionMaker()
131 {
132  // destructor
133 }
134 
135 //________________________________________________________________________________________________________
136 Int_t StSkimPionMaker::Init()
137 {
138  //initializes histograms and ntuples
139 
140  if (debug) cout << "++++++++++++ StSkimPionMaker::Init()" << endl;
141 
142  mTables = new StBemcTables();
143 
144  mFile = new TFile(mFileName,"RECREATE");
145 
146  // list for photon candidates
147  photonlist = new TObjArray();
148 
149  //creating Pi0Event and Tree
150  pi0Tree = new TTree("pi0Tree", "Pi0 Event Tree");
151  pi0Event = new TSkimPionEvent();
152  pi0Tree->Branch("EventBranch", "TSkimPionEvent", &pi0Event);
153 
154  //#include "/star/u/ahoffman/Emc_calib/c_factors.txt" //taken out for first run
155 
156  if (debug) cout << "StSkimPionMaker: Init done..." << endl;
157 
158  return StMaker::Init();
159 }
160 
161 //_________________________________________________________________________________________________________
162 Int_t StSkimPionMaker::InitRun(int runnumber)
163 {
164  return StMaker::InitRun(runnumber);
165 }
166 
167 //________________________________________________________________________________________________________
169 {
170  //cout << "Entering StSkimPionMaker::Make, processed events: " << ievtot << endl;
171  // the main function, gets called for each event
172 
173  ievtot++;
174  if (debug)
175  cout <<"+++++++++++++++++++++++++++++++++++++++++ event: "<<ievtot<<endl;
176 
177  //if (ievtot%2000==0) pi0Tree->AutoSave(); //saveHistograms(); // save data regularly, always good in case the code crashes (not sure)
178 
179  //cout << "Getting MuDst...\n";
180  mMuDst = (StMuDst*)GetInputDS("MuDst"); //mMuDstMaker->muDst();
181  if (!mMuDst) return 1;
182 
183  // here is the actual analysis code
184 
185  StMuEvent* event = mMuDst->event();
186 
187  if (!event)
188  {
189  if (debug) cout <<"++++++++++++ StSkimPionMaker::Make() Cannot get the event pointer"<<endl;
190  return kStOK;
191  }
192 
193  runN = event->runNumber();
194  eventN = event->eventNumber();
195  fillN = (Int_t)event->runInfo().beamFillNumber(yellow);
196 
197  pi0Event->SetRunNo((Int_t)runN);
198  pi0Event->SetEventNo((Int_t)eventN);
199  pi0Event->SetFillNo((Int_t)fillN);
200 
201  // get the magnetic field
202  mField = event->magneticField()/10.; // bFld in Tesla
203  //if (debug)
204  //cout <<" StEvent::summary()->magneticField() = "<<mField<<" [Tesla]"<< endl;
205 
206  if (fabs(mField)<0.01)
207  {
208  if (debug) cout << "BField read back as 0, setting default." << endl;
209  mField = 0.497952;
210  }
211 
212  // FInd out if we are running simulations:
213  // check for presence of StMcEvent
214 
215  // Get additional trigger information, especially for simulations
216  // BBC Triggers
217 
218  StTriggerSimuMaker* trigSim = dynamic_cast<StTriggerSimuMaker*>(GetMaker("StarTrigSimu"));
219  if (trigSim) {
220  //cout << "Found TriggSim Info for BBC\n";
221  mBBCTrig = (trigSim->bbc)->triggerDecision(137611);
222  //cout << "BBC Trigger: " << mBBCTrig << endl;
223  }
224  else {
225  if (debug) cout << "StFranksPi0Maker::Make() could not find SimuTrig \n";
226  mBBCTrig = 0;
227  }
228 
229  pi0Event->SetBBCTrig(mBBCTrig);
230 
231  // Get Spin info if this is not a simulated event
232 
233  StL0Trigger* trig=&(event->l0Trigger());
234  Int_t mubx48=trig->bunchCrossingId();
235  Int_t mubx7=trig->bunchCrossingId7bit(runN);
236  pi0Event->SetSpinBit(trig->spinBits(runN)); //SpinBit (Yellow,Blue): Up,Up = 5; Down,Up = 6; Up,Down = 9; Down,Down = 10;
237  pi0Event->SetBunchX48(mubx48);
238  pi0Event->SetBunchX7(mubx7);
239 
240  /* StSpinDbMaker */
241  StSpinDbMaker* spDb = (StSpinDbMaker*)GetMaker("spinDb");
242  if (spDb) {
243  Int_t val = 0;
244  if ((spDb->offsetBX48minusBX7(mubx48,mubx7)==0)&&(spDb->isValid())) val = 1;
245  pi0Event->SetValidSpin(val);
246  pi0Event->SetPolLong(spDb->isPolDirLong());
247  pi0Event->SetMaskedXing(spDb->isMaskedUsingBX48(mubx48));
248  pi0Event->SetDbSpinBit(spDb->spin4usingBX48(mubx48));
249  }
250  else {
251  pi0Event->SetValidSpin(0);
252  }
253 
254  int softwaretrigs[2] = {0,0};
255  int mcMB = 0;
256  int mcHTTPL2 = 0;
257  if ((trigSim->bbc)->triggerDecision(137611)) mcMB = 1;
258  if (trigSim) {
259  //cout<<"Found Software Trigger Info...\n";
260  if ((trigSim->isTrigger(137611)) || (trigSim->isTrigger(127611))) mcHTTPL2 = 1;
261  }
262 
263  else {
264  if (debug) cout<<"SkimPionMaker::Make() could not find the trigger emulator"<<endl;
265  mHiTowerAdc6Bit = 0;
266  }
267 
268  softwaretrigs[0] = mcMB;
269  softwaretrigs[1] = mcHTTPL2;
270 
271  pi0Event->SetHiTowerAdc6Bit(mHiTowerAdc6Bit);
272 
273  // also store mc vertex position, so that for simulations this can be used instead of reco vertex
274  StThreeVectorF mcVertexPos;
275 
276  //cout << "Getting Triggers...\n";
277  // check for trigger condidtions
278  int startriggers[4] = {117001, 137611, 5}; //mb, http-l2gamma, http-l2gamma-test 2006
279 
280  int trigs[3] = {0,0,0};
281  int prescales[3] = {0,0,0};
282  //if (debug) cout <<"++++++++++++ StSkimPionMaker::Make() not MinBias or High Tower triggered events"<<endl;
283 
284  //see if we satisfy various triggers
285  for (int i=0; i<3; ++i) {
286  if (event->triggerIdCollection().nominal().isTrigger(startriggers[i])) {
287  trigs[i] = 1;
288  if (debug) cout << "Trigger condition " << i << " satisfied..." << endl;
289  }
290  }
291  if (event->triggerIdCollection().nominal().isTrigger(127611)) trigs[1] = 1;
292 
293  //get trigger prescales:
294  //cout<<"Checking for Prescales..."<<endl;
295  StDetectorDbTriggerID& v = *(StDetectorDbTriggerID::instance());
296  for (int i=0;i<3;++i) {
297  prescales[i]=v.getTotalPrescaleByTrgId(startriggers[i]);
298  }
299  if (event->triggerIdCollection().nominal().isTrigger(127611)) prescales[1]=v.getTotalPrescaleByTrgId(127611);
300 
301  // I also have the global trigger variables that get used for histograms. Fill them here:
302  mb = trigs[0];
303  httpl2 = trigs[1];
304  httpl2_test = trigs[2];
305 
306  pi0Event->SetTriggers(trigs);
307  pi0Event->SetPrescales(prescales);
308  pi0Event->SetSoftTriggers(softwaretrigs);
309 
310  // to save time, lets opt out here if it is not a useful trigger and not simulations
311  //cout << "Accepting all triggers... If you want to change that, check out line 600" << endl;
312 
313  if (!((mb)||(httpl2)||(httpl2_test)||(mcHTTPL2))) {
314  //cout << " No Interesting trigger, opting out..." << endl;
315  pi0Event->Clear();
316  return kStOk;
317  }
318 
319  // now the existence of various pointers is checked to assure a good event
320  StThreeVectorF vPos;
321  vPos = event->primaryVertexPosition();
322 
323  // get BBC vertex
324  // not supported right now, could be later...
325  StBbcTriggerDetector bbc = event->bbcTriggerDetector();
326  //int west=bbc.tdcEarliestWest();
327  //int east=bbc.tdcEarliestEast();
328  //int diff=west-east;
329  mBBCVertexZ = 0; // z is now in cm
330  pi0Event->SetBBCVertexZ(mBBCVertexZ);
331 
332  //for the TAMU relative luminosities, the BBC time bin is needed. This is derived from the time difference:
333  pi0Event->SetBBCTimeBin(bbc.onlineTimeDifference());
334 
335  // so, if the vertex is not found try using the bbc vertex
336  if((vPos.z() == 0)||(TMath::Abs(vPos.z()) > 300)) {
337  if (mBBCVertexZ == 0) mBBCVertexZ = 0.001;
338  vPos.setZ(mBBCVertexZ);
339  vPos.setX(0.);
340  vPos.setY(0.);
341  pi0Event->SetOnlyBBCVertex();
342  }
343 
344  StEvent *stevent = (StEvent*)this->GetInputDS("StEvent");
345  if (!stevent) {
346  if (debug) cout << "++++++++++++ StSkimPionMaker::Make: Can't get StEvent pointer" << endl;
347  return kStOk;
348  }
349 
350  StEmcCollection* emccol = (StEmcCollection*)stevent->emcCollection();
351  if (!emccol) {
352  if (debug) cout <<"++++++++++++ StSkimPionMaker::Make() No EMC Collection"<<endl;
353  //iemc++;
354  if ((mb)||(httpl2)||(httpl2_test)||(mcHTTPL2)) {
355  iWrittenEvents++;
356  pi0Tree->Fill();
357  }
358  pi0Event->Clear();
359  return kStOk;
360  }
361 
362  StEmcDetector* bemc = emccol->detector(kBarrelEmcTowerId);
363  if (!bemc) {
364  if (debug) cout <<"++++++++++++ StSkimPionMaker::Make() No BEMC detector"<<endl;
365  //mEventInfoNtuple->Fill(eventInfo);
366  if ((mb)||(httpl2)||(httpl2_test)||(mcHTTPL2)) {
367  pi0Tree->Fill();
368  iWrittenEvents++;
369  }
370  pi0Event->Clear();
371  return kStOk;
372  }
373 
374  StSPtrVecEmcPoint& bEmcPoints = emccol->barrelPoints();
375 
376  // Fill histos with raw EMC information
377  StEmcGeom* emcGeom = StEmcGeom::getEmcGeom("bemc");
378 
379  // get primary tracks
380  long numberOfPrimaryTracks = mMuDst->primaryTracks()->GetEntries();
381 
382  // reject z_vertex==0 events
383  //cout << "StSkimPionMaker: z_vertex: " << vPos.z() << endl;
384  pi0Event->SetVertex(vPos.x(),vPos.y(),vPos.z());
385 
386  if (vPos.z()==0) {
387  if (debug) cout <<"++++++++++++ StSkimPionMaker::Make() z_vertex==0"<<endl;
388  if ((mb)||(httpl2)||(httpl2_test)||(mcHTTPL2)) {
389  pi0Tree->Fill();
390  iWrittenEvents++;
391  }
392  pi0Event->Clear();
393  return kStOk;
394  }
395 
396  if (!(vPos.z()>-100. && vPos.z()<100.))
397  {
398  if (debug) cout <<"++++++++++++ StSkimPionMaker::Make() z_vertex out of range!"<<endl;
399  if ((mb)||(httpl2)||(httpl2_test)||(mcHTTPL2)) {
400  pi0Tree->Fill();
401  iWrittenEvents++;
402  }
403  pi0Event->Clear();
404  return kStOk;
405  }
406 
407  // calculate pt sum of good global tracks on both sides of TPC
408  StMuTrack* t;
409  Float_t chargedPtSum = 0;
410 
411  for (int i = 0; i < numberOfPrimaryTracks; i++) {
412  t = mMuDst->primaryTracks(i);
413  if ((t->nHits() > 15)&&(t->dca().mag() < 3.0)&&(t->eta() > -1.)&&(t->eta() < 1.)) //using full barrell now.
414  chargedPtSum += t->pt();
415  }
416  //cout << "Charged pt sum: " << chargedPtSum << endl;
417  pi0Event->SetChargedPtSum(chargedPtSum);
418 
419 
420  // for all practical purposes events are accepted here
421  // No EMC points still lead to rejection, but that does not count, since most
422  // MB events have no EMC hits
423 
424  // reject events with no BEMC hits
425  if (bEmcPoints.size()==0)
426  {
427  if (debug) cout <<"++++++++++++ StSkimPionMaker::Make() No BEMC points"<<endl;
428  if ((mb)||(httpl2)||(httpl2_test)||(mcHTTPL2)) {
429  pi0Tree->Fill();
430  iWrittenEvents++;
431  }
432  pi0Event->Clear();
433  return kStOk; // Check this again! In principle the event should be rejected if there are no BEMC points
434  }
435 
436  // event characteristics
437  if (debug) cout <<"--- Number of primary tracks in this event: "<<numberOfPrimaryTracks<<endl;
438  // get reduced run number
439  Int_t runnm = runN-5000000;
440  if (debug) cout <<"--- event accepted... RUN_ID: "<<runN<<" ("<<runnm<<")"<<endl;
441 
442  // read EMC point list
443  if (!readPointList()) // here the photon list gets filled
444  {
445  if (debug) cout <<"+++ ERROR read readPointList()"<<endl;
446  if ((mb)||(httpl2)||(httpl2_test)||(mcHTTPL2)) {
447  pi0Tree->Fill();
448  iWrittenEvents++;
449  }
450  pi0Event->Clear();
451  return kStOk;
452  }
453 
454 
455  // look for track-point (TPC-BEMC) association
456  // this is needed to veto photon candidates that have a charged
457  // track pointing to them (and thus probably are no real photons)
458  // this information is used in getInvMass
459 
460  if (mDoTracks) associateTracksWithEmcPoints(this);
461 
462  // Get total neutral Energy in EMC
463  Float_t neutralEnergy = getNeutralEnergySum(photonlist);
464  //cout << "Total neutral Energy: " << neutralEnergy<< endl;
465  pi0Event->SetNeutralEnergy(neutralEnergy);
466 
467 
468  // some basic quality cuts before we go on:
469  // - There should be photon candidates
470  // - Not to many EMC points (to exclude noisy events)
471 
472  if (photonlist->GetEntries()>0 && bEmcPoints.size()<=100 && vPos.z()>-100 && vPos.z()<100) {
473  if (debug) cout<< "--- new photon " << photonlist->GetEntries() << endl;
474 
475  // get the Pi0s, fill the ntuple
476  getInvMass(0, photonlist, photonlist, vPos.z(), vPos, trigs, prescales);
477  }
478 
479  // write Pi0Event Tree
480  if ((mb)||(httpl2)||(httpl2_test)||(mcHTTPL2)) {
481  pi0Tree->Fill();
482  iWrittenEvents++;
483  }
484 
485  pi0Event->Clear();
486  // clean up
487 
488  photonlist->Clear();
489  if (debug) cout <<"--- reset photon/charged_pion list done"<<endl;
490 
491  return kStOK;
492 }
493 
494 //________________________________________________________________________________________________________
495 
497 {
498  cout << "Events written to tree: " << iWrittenEvents << endl;
499 
500  mFile->Write();
501  mFile->Close();
502  return kStOk;
503 }
504 
505 //________________________________________________________________________________________________________
506 StThreeVectorF StSkimPionMaker::getPoint(StEmcPoint *p, Int_t &id, Float_t &e, Float_t &pt, Int_t &n, Int_t &t, Float_t &eSMDe, Float_t &eSMDp, Float_t &eTower, Float_t &sSMDe, Float_t &sSMDp, Float_t &sTower)
507 {
508  // right now, the point vector is defined as the vector from 0,0,0 and not the vector from the main vertex
509  // might be a problem?
510 
511  StMuEvent* event = mMuDst->event();
512  if(!event)
513  {
514  cout << "++++++++++++ StSkimPionMaker::getPoint: Can't get Event pointer" << endl;
515  // assert ( 0 && " Can't convert kStOk to StThreeVectorF. Please fix me!!!");
516  StThreeVectorF abortVector(-10000.,0.,0.);
517  return abortVector;
518  }
519 
520  // get primary vertex
521  StThreeVectorF MainVertexPosition;
522  MainVertexPosition = event->primaryVertexPosition();
523 
524  const StThreeVectorF& pointVector = p->position();
525 
526  // get tower id // this gives the id of the tower that is closest to the cluster center
527  StEmcGeom* emcGeom = StEmcGeom::getEmcGeom("bemc");
528  Int_t mod, eta, sub;
529  emcGeom->getBin(pointVector.phi(), pointVector.pseudoRapidity(), mod, eta, sub);
530  emcGeom->getId(mod, eta, sub, id);
531 
532  // better way of getting cluster size info
533  StPtrVecEmcCluster& towerClus=p->cluster(kBarrelEmcTowerId);
534  StPtrVecEmcCluster& etaClus=p->cluster(kBarrelSmdEtaStripId);
535  StPtrVecEmcCluster& phiClus=p->cluster(kBarrelSmdPhiStripId);
536  Int_t nEtaHits=0;
537  Int_t nPhiHits=0;
538  Int_t nTowerHits = 0;
539  Float_t towerEnergy = 0;
540  Float_t etaEnergy=0.;
541  Float_t phiEnergy=0.;
542  Float_t etaWidth=0.;
543  Float_t phiWidth=0.;
544  Int_t tId[5];
545  Float_t tEnergy[5];
546  for (int k=0;k<5;k++) {
547  tId[k] = 0;
548  tEnergy[k] = 0;
549  }
550  Float_t fraction = 0;
551 
552  if(towerClus.size() > 0) {
553  StEmcCluster *clT=(StEmcCluster*)towerClus[0];
554  StPtrVecEmcRawHit& hT=clT->hit();
555  nTowerHits=hT.size();
556  if (debug) cout<<"the number of towers is "<<nTowerHits<<endl;
557  for (Int_t j=0; j<nTowerHits; j++) {
558  //cout<<"getting tower cluster info for raw hit "<<j<<endl;
559  StEmcRawHit *rawHit = (StEmcRawHit*)hT[j];
560  tId[j] = rawHit->softId(emcGeom->Detector());
561  //cout<<"t Id for "<<j<<" is "<<tId[j]<<endl;
562  if (tId[j] == 0) continue;
563  tEnergy[j] = rawHit->energy();
564  //cout<<"tEnergy for "<<j<<" is "<<tEnergy[j]<<endl;
565  }
566  id = tId[0];
567  towerEnergy = tEnergy[0];
568  }
569 
570  if(etaClus.size()>0){
571  StEmcCluster *clE=(StEmcCluster*)etaClus[0];
572  StPtrVecEmcRawHit& hE=clE->hit();
573  nEtaHits=hE.size();
574  etaEnergy=clE->energy();
575  etaWidth=clE->sigmaEta();
576  }
577  if(phiClus.size()>0){
578  StEmcCluster *clP=(StEmcCluster*)phiClus[0];
579  StPtrVecEmcRawHit& hP=clP->hit();
580  nPhiHits=hP.size();
581  phiEnergy=clP->energy();
582  phiWidth=clP->sigmaPhi();
583  }
584 
585  // get point energy
586  e = p->energy();
587 
588  // get fraction
589  fraction = e/(tEnergy[0]+tEnergy[1]+tEnergy[2]+tEnergy[3]+tEnergy[4]);
590 
591  // get Alan's corrected energy from correction factors file
592  //e = fraction*(tEnergy[0]*c_factors[tId[0]] + tEnergy[1]*c_factors[tId[1]] + tEnergy[2]*c_factors[tId[2]] + tEnergy[3]*c_factors[tId[3]] + tEnergy[4]*c_factors[tId[4]]);
593 
594  // get photon pT
595  Float_t theta = 0.;
596  emcGeom->getTheta(mod, eta, theta);
597  pt = e * sin(theta);
598 
599  // get point-track association
600  n = p->nTracks();
601 
602  // get point type
603  t=0;
604  if (p->energyInDetector(StDetectorId(kBarrelEmcTowerId+2))) //smde
605  t++;
606  if (p->energyInDetector(StDetectorId(kBarrelEmcTowerId+3))) //smdp
607  t+=2;
608 
609  eSMDe = etaEnergy; //p->energyInDetector(StDetectorId(kBarrelEmcTowerId+2));
610  eSMDp = phiEnergy; //p->energyInDetector(StDetectorId(kBarrelEmcTowerId+3));
611  eTower = towerEnergy; //p->energyInDetector(StDetectorId(kBarrelEmcTowerId));
612  sSMDe = nEtaHits; //p->sizeAtDetector(StDetectorId(kBarrelEmcTowerId+2));
613  sSMDp = nPhiHits; //p->sizeAtDetector(StDetectorId(kBarrelEmcTowerId+3));
614  sTower = nTowerHits; //p->sizeAtDetector(StDetectorId(kBarrelEmcTowerId));
615  if (debug) cout <<"++++++++++++ StSkimPionMaker::getPoint: tower, t, n, e, pt ---> "<<id<<" "<<t<<" "<<n<<" "<<e<<" "<<pt<< endl;
616 
617  return pointVector;
618 }
619 
620 
621 //________________________________________________________________________________________________________
622 
623 Int_t StSkimPionMaker::doTrackPtHist(float eT, float threshold, TObjArray *photonlist)
624 {
625  if (debug) cout <<"++++++++++++ StSkimPionMaker::doTrackPtHist: entered"<<endl;
626 
627  StEvent *event = (StEvent*)this->GetInputDS("StEvent");
628  if (!event)
629  {
630  if (debug) cout << "StSkimPionMaker::doTrackPtHist: Can't get Event pointer" << endl;
631  return kStOk;
632  }
633 
634  // tracks
635  int numberOfPrimaries= mMuDst->primaryTracks()->GetEntries();
636  int numberOfGlobals= mMuDst->globalTracks()->GetEntries();
637 
638  StMuTrack* track;
639  StThreeVectorF trackMomentum;
640 
641  for (int i = 0; i < numberOfGlobals; i++)
642  {
643  track = mMuDst->globalTracks(i);
644  if (track && track->flag()>=0) {
645  trackMomentum = track->p();
646  }
647 
648  }
649 
650  if (debug) cout <<"++++++++++++ StSkimPionMaker::doTrackPtHist: got tracks, try to get points"<<endl;
651 
652  // EMC points
653  for (Int_t i=0; i<photonlist->GetEntries(); i++)
654  {
655  StEmcPoint *p = (StEmcPoint *) photonlist->At(i);
656  const StThreeVectorF& pointVector = p->position();
657 
658  StEmcGeom* emcGeom = StEmcGeom::getEmcGeom("bemc");
659  //emcGeom = StEmcGeom::instance("bemc");
660  Int_t mod, eta, sub;
661  emcGeom->getBin(pointVector.phi(), pointVector.pseudoRapidity(), mod, eta, sub);
662  //emcGeom->getId(mod, eta, sub, id);
663 
664  Float_t e = p->energy();
665 
666  // get photon pT
667  Float_t theta = 0.;
668  emcGeom->getTheta(mod, eta, theta);
669  Float_t pt = e * sin(theta);
670  }
671 
672  return kStOk;
673 }
674 
675 
676 //________________________________________________________________________________________________________
677 Float_t StSkimPionMaker::getHiTowerEt(StEmcCollection* emccol)
678 {
679  // get the Et of the highest tower
680  if (debug) cout <<"++++++++++++ StSkimPionMaker::getHiTowerEt: entered"<<endl;
681 
682  // Energy is converted to Et assuming z(vertex)=0
683  // because this is how it's done in the trigger
684 
685  StEmcDetector* bemc = emccol->detector(kBarrelEmcTowerId);
686  if (!bemc)
687  {
688  if (debug) cout <<"++++++++++ StSkimPionMaker::getHiTowerEt(): No BEMC detector"<<endl;
689  return 0;
690  }
691 
692  StEmcGeom* emcGeom = StEmcGeom::getEmcGeom("bemc");
693  Float_t hiTowerEt = 0;
694  Float_t e, eT, theta;
695 
696  for (UInt_t i=1; i<=bemc->numberOfModules(); i++)
697  {
698  StEmcModule* module = bemc->module(i);
699  StSPtrVecEmcRawHit& hits = module->hits();
700  StSPtrVecEmcRawHitIterator hIter;
701 
702  for (hIter=hits.begin(); hIter!=hits.end(); hIter++)
703  {
704  //YYY
705  e = (*hIter)->energy();
706  emcGeom->getTheta((*hIter)->module(),(*hIter)->eta(), theta);
707  eT = e * sin(theta);
708 
709  if (eT > hiTowerEt) hiTowerEt = eT;
710  }
711  }
712  return hiTowerEt;
713 }
714 
716 
717 //________________________________________________________________________________________________________
718 Int_t StSkimPionMaker::associateTracksWithEmcPoints(StMaker* anyMaker)
719 {
720  // What it does:
721  //
722  // 1. Runs through all "good" global tracks. Each track is projected on BEMC using
723  // StEmcPosition::trackOnEmc(&pos, &mom, track, BFIELD);
724  //
725  // 2. Finds corresponding emc point
726  //
727  // 3. If such point exists, adds pointer to this track to the
728  // vector of tracks StPtrVecTrack (data member of StEmcPoint)
729 
730  if (debug) cout <<"++++++++++++ StSkimPionMaker::associateTracksWithEmcPoints: ENTERED"<<endl;
731 
732  StEvent *event = (StEvent*)anyMaker->GetInputDS("StEvent");
733  if (!event)
734  {
735  if (debug) cout << "++++++++++++ StSkimPionMaker::associateTracksWithEmcPoints: Can't get Event pointer" << endl;
736  return kStOk;
737  }
738  StEmcCollection* emccol = (StEmcCollection*)event->emcCollection();
739  if (!emccol)
740  {
741  if (debug) cout << "++++++++++++ StSkimPionMaker::associateTracksWithEmcPoints: No EMC Collection" << endl;
742  return kStOk;
743  }
744  StSPtrVecEmcPoint& bEmcPoints = emccol->barrelPoints();
745  if (bEmcPoints.size()==0)
746  {
747  //cout << "++++++++++++ StSkimPionMaker::associateTracksWithEmcPoints: No BEMC points found" << endl;
748  return kStOk;
749  }
750 
751  // reset all existing track-to-point associations
752  for (StSPtrVecEmcPointIterator it=bEmcPoints.begin(); it!=bEmcPoints.end(); it++)
753  (*it)->track().clear();
754  // deletes all elements
755  // this is NOT a structural container, so the tracks don't get deleted
756 
757 
758  Double_t bFld = mField;
759 
760  Int_t mod, eta, sub;
761  StEmcPosition* pos = new StEmcPosition();
762  StThreeVectorD position, momentum;
763  StEmcGeom* emcGeom = StEmcGeom::getEmcGeom("bemc");
764  // tracks
765  int numberOfPrimaries= mMuDst->primaryTracks()->GetEntries();
766  int numberOfGlobals= mMuDst->globalTracks()->GetEntries();
767 
768  StMuTrack* track;
769  StTrack* dummyTrack = new StGlobalTrack();
770  StThreeVectorF trackMomentum;
771 
772  for (int i = 0; i < numberOfGlobals; i++)
773  {
774  track = mMuDst->globalTracks(i);
775  if (track && track->flag()>=0) {
776  Bool_t ok = pos->trackOnEmc(&position, &momentum, track, bFld); // bFld in Tesla
777  if (!ok) continue;
778 
779  // get (mod, eta, sub) from track
780  emcGeom->getBin(position.phi(), position.pseudoRapidity(), mod, eta, sub);
781 
782  for (StSPtrVecEmcPointIterator it=bEmcPoints.begin(); it!=bEmcPoints.end(); it++)
783  {
784  StPtrVecEmcCluster bEmcClusters = (*it)->cluster(kBarrelEmcTowerId);
785 
786  for (StPtrVecEmcClusterIterator cIter=bEmcClusters.begin(); cIter!=bEmcClusters.end(); cIter++)
787  {
788  StPtrVecEmcRawHit& bEmcHits = (*cIter)->hit();
789 
790  for (StPtrVecEmcRawHitIterator hIter=bEmcHits.begin(); hIter!=bEmcHits.end(); hIter++)
791  {
792  // compare (mod, eta, sub) with emc hit
793  if (mod == (Int_t)(*hIter)->module() &&
794  eta == (Int_t)(*hIter)->eta() &&
795  sub == (Int_t)(*hIter)->sub())
796  {
797  //cout << "Added Track to association! \n";
798  (*it)->addTrack(dummyTrack);
799  break;
800  }
801  }
802  }
803  }
804 
805  }
806  }
807  delete pos;
808  delete dummyTrack;
809  return kStOk;
810 }
811 
812 //--------------------------------------------------------------------------------------------------------
813 Float_t StSkimPionMaker::getNeutralEnergySum(TObjArray *photonlist)
814 {
815  Float_t eSum = 0;
816  Int_t cntb=0;
817  Int_t id1, n1, t1;
818  Float_t e1, pt1;
819  Float_t eSMDe1, eSMDp1;
820  Float_t eTower1;
821  Float_t sSMDe1, sSMDp1, sTower1;
822 
823  for (Int_t i=0; i<photonlist->GetEntries(); i++)
824  {
825  StEmcPoint *p1 = (StEmcPoint *) photonlist->At(i);
826  StThreeVectorF v1 = getPoint(p1, id1,e1,pt1,n1,t1, eSMDe1, eSMDp1, eTower1,sSMDe1, sSMDp1, sTower1);
827  if ((n1 == 0)&&(id1 < 4801))
828  eSum += e1;
829  if (v1(0) == -10000.)
830  eSum = 0;
831  }
832 
833  return eSum;
834 }
835 
836 //________________________________________________________________________________________________________
837 void StSkimPionMaker::getPhotonSpectra(TObjArray *photonlist, int runnm, float vertex_z, int bemc_hits)
838 {
839  // fill histograms with photon information
840 
841  if (debug) cout <<"++++++++++ StSkimPionMaker::GetPhotonSpectra: entered"<<endl;
842 
843  Int_t cntb=0;
844  Int_t id1, n1, t1;
845  Float_t e1, pt1;
846  Float_t eSMDe1, eSMDp1;
847  Float_t eTower1;
848  Float_t sSMDe1, sSMDp1, sTower1;
849 
850  Float_t pt1_trg=0;
851  Int_t id1_trg=0;
852 
853  for (Int_t i=0; i<photonlist->GetEntries(); i++)
854  {
855  StEmcPoint *p1 = (StEmcPoint *) photonlist->At(i);
856 
857  // get EMC point information
858  StThreeVectorF v1 = getPoint(p1, id1,e1,pt1,n1,t1, eSMDe1, eSMDp1, eTower1,sSMDe1, sSMDp1, sTower1);
859  if (v1(0) == -10000.)
860  return;
861  //cout <<"--------------------> pt1 = " <<pt1<<endl;
862 
863  if (debug) cout << "Photon track association: " << n1 << endl;
864 
865  if (n1==0)
866  {
867  if (pt1>pt1_trg)
868  {
869  pt1_trg = pt1;
870  id1_trg = id1;
871  }
872 
873  // count number of photons
874  cntb++;
875  }
876  }
877  return;
878 }
879 
880 //________________________________________________________________________________________________________
881 void StSkimPionMaker::getInvMass(int mode, TObjArray *photonlist1, TObjArray *photonlist2,
882  float vertex_z, StThreeVectorF primaryVertex, int triggers[3], int prescales[3])
883 {
884  if (debug) cout <<"++++++++++ StSkimPionMaker::getInvMass: list1 "<<photonlist1->GetEntries()<<endl;
885  if (debug) cout <<"++++++++++ StSkimPionMaker::getInvMass: list2 "<<photonlist2->GetEntries()<<endl;
886 
887  Float_t chargedAssociation1 = 0;
888  Float_t chargedAssociation2 = 0;
889 
890  // 1st particle
891  for (Int_t i=0; i<photonlist1->GetEntries(); i++)
892  {
893  if (debug) cout <<"++++++++++ StSkimPionMaker::getInvMass: first loop (mode "<<mode<<")"<<endl;
894  StEmcPoint *p1 = (StEmcPoint *) photonlist1->At(i);
895 
896  Int_t id1, n1, t1;
897  t1 = 0;
898  Float_t e1, pt1;
899  Float_t eSMDe1;
900  Float_t eSMDp1;
901  Float_t eTower1;
902  Float_t sSMDe1, sSMDp1, sTower1;
903 
904  StThreeVectorF v1 = getPoint(p1, id1,e1,pt1,n1,t1, eSMDe1, eSMDp1, eTower1,sSMDe1, sSMDp1, sTower1);
905  if (v1(0) == -10000.)
906  return;
907  chargedAssociation1 = n1;
908 
909  // here I fill the hit container for Pi0Event
910  Float_t hitdat[16];
911  hitdat[0] = v1.x();
912  hitdat[1] = v1.y();
913  hitdat[2] = v1.z();
914  hitdat[3] = id1;
915  hitdat[4] = e1;
916  hitdat[5] = pt1;
917  hitdat[6] = n1;
918  hitdat[7] = t1;
919  hitdat[8] = eSMDe1;
920  hitdat[9] = eSMDp1;
921  hitdat[10] = eTower1;
922  hitdat[11] = sSMDe1;
923  hitdat[12] = sSMDp1;
924  hitdat[13] = sTower1;
925  hitdat[14] = v1.phi();
926  hitdat[15] = v1.pseudoRapidity();
927 
928  THit hitCand;
929  hitCand.SetAll(hitdat);
930  pi0Event->AddHit(hitCand);
931 
932 
933  //cout << "!!!!!!!!!!! HitRadius1: " << v1.perp() << endl;
934  // 2nd particle
935  if (debug) cout <<"++++++++++ StSkimPionMaker::getInvMass: second loop (mode "<<mode<<")"<<endl;
936 
937  Int_t j = 999;
938  if (mode==0) j=i+1;
939  if (mode==1) j=0;
940 
941  for (Int_t k=j; k<photonlist2->GetEntries(); k++)
942  {
943  StEmcPoint *p2 = (StEmcPoint *) photonlist2->At(k);
944 
945  Int_t id2, n2, t2;
946  t2 = 0;
947  Float_t e2, pt2;
948  Float_t eSMDe2;
949  Float_t eSMDp2;
950  Float_t eTower2;
951  Float_t sSMDe2, sSMDp2, sTower2;
952 
953  StThreeVectorF v2 = getPoint(p2, id2,e2,pt2,n2,t2, eSMDe2, eSMDp2, eTower2,sSMDe2, sSMDp2, sTower2);
954  if (v2(0) == -10000)
955  return;
956  chargedAssociation2 = n2;
957  //cout << "!!!!!!!!!!! HitRadius2: " << v2.perp() << endl;
958  // Pi0 CUTS
959  //if (n1==0 && n2==0 && t1>-99 && t2>-99) // the n==0 is the requirement that no charged track leads to the EMC point
960  if (t1>-99 && t2>-99) // the n==0 is the requirement that no charged track leads to the EMC point
961  {
962  if (debug) cout <<"++++++++++ StSkimPionMaker::getInvMass: get invariant mass for photon pair"<<endl;
963 
964 
965  // Up to here, the vectors are in global coordinates (e.g. not wrt the primary vertex)
966  // for the mass calculations, this should change!
967  // define new vector relative to event vertex:
968 
969  StThreeVectorF v1rel;
970  StThreeVectorF v2rel;
971  StThreeVectorF vdist = v1 - v2;
972 
973  if (mode == 0) {
974  v1rel = v1 - primaryVertex;
975  v2rel = v2 - primaryVertex;
976  }
977  else {
978  v1rel = v1;
979  v2rel = v2;
980  }
981 
982  Float_t dist = vdist.mag();
983  double mInvPi0;
984  StThreeVectorF pPi0;
985  Float_t asym;
986  Float_t cosAng;
987  Float_t phi1;
988  Float_t phi2;
989 
990  if (debug) cout << "Pi0 candidate: tower1: " << id1 << " tower2: " << id2 << " triggerTower: " << triggerTower << endl;
991  getMass(v1rel,v2rel,e1,e2, mInvPi0,pPi0,asym,cosAng, phi1,phi2); // use v1 and v2 instead of v1rel and v2rel if you
992  // assume that the photons come from 0,0,0
993 
994  // get Pi0 minv distribution for a certain set of cuts
995 
996  // fill array for Pi0Candidate;
997  Float_t cdat[24];
998  cdat[0]= pPi0.perp();
999  cdat[1] = mInvPi0;
1000  cdat[2] = pPi0.pseudoRapidity();
1001  cdat[3] = pPi0.phi();
1002  cdat[4] = asym;
1003  cdat[5] = cosAng;
1004  cdat[6] = id1;
1005  cdat[7] = id2;
1006  cdat[8] = chargedAssociation1;
1007  cdat[9] = chargedAssociation2;
1008  cdat[10] = t1;
1009  cdat[11] = t2;
1010  cdat[12] = e1;
1011  cdat[13] = e2;
1012  cdat[14] = eTower1;
1013  cdat[15] = eTower2;
1014  cdat[16] = eSMDe1;
1015  cdat[17] = eSMDp1;
1016  cdat[18] = eSMDe2;
1017  cdat[19] = eSMDp2;
1018  cdat[20] = v1.pseudoRapidity(); //v1rel.pseudoRapidity();
1019  cdat[21] = v1.phi(); //v1rel.phi();
1020  cdat[22] = v2.pseudoRapidity(); //v2rel.pseudoRapidity();
1021  cdat[23] = v2.phi(); //v2rel.phi();
1022 
1023  if ((mode==0)&&(cdat[0] > 0.5)) {
1024  TSkimPionCandidate piCand;
1025  piCand.SetAll(cdat);
1026  pi0Event->AddSkimPionCandidate(piCand);
1027  }
1028 
1029  }
1030  }
1031  }
1032  return;
1033 }
1034 
1035 
1036 //________________________________________________________________________________________________________
1037 Bool_t StSkimPionMaker::getMass(StThreeVectorF P1, StThreeVectorF P2, Float_t e1, Float_t e2, double &mInv, StThreeVectorF &pPi0, Float_t &asym, Float_t &cosAng, Float_t &phi1, Float_t &phi2)
1038 {
1039  if (debug) cout << "++++++++++++ StSkimPionMaker::getMass(): enter pi0 minv calcualtion..." << endl;
1040 
1041  Double_t VecProd = P1.x()*P2.x() + P1.y()*P2.y() + P1.z()*P2.z();
1042  cosAng = VecProd/(P1.magnitude()*P2.magnitude());
1043 
1044  double mInv2 = 2*e1*e2*(1-cosAng);
1045  if (mInv2>0)
1046  {
1047  mInv = TMath::Sqrt(mInv2);
1048  }
1049  else
1050  mInv = -999.0;
1051 
1052  asym = fabs(e1-e2)/(e1+e2);
1053 
1054  // for correlation studies
1055  phi1 = P1.phi();
1056  phi2 = P2.phi();
1057 
1058  pPi0 = e1*P1/P1.mag() + e2*P2/P2.mag();
1059 
1060  if (debug) cout <<"++++++++++++ StSkimPionMaker::getMass(): mInv, asym, pPi0: "<<mInv<<" "<<asym<<" "<<pPi0<<endl;
1061 
1062  return kTRUE;
1063 }
1064 
1065 
1066 //________________________________________________________________________________________________________
1067 // Not sure if this is ever called.
1068 void StSkimPionMaker::getTowerHitInfo()
1069 {
1070  StEvent *event = (StEvent*)this->GetInputDS("StEvent");
1071  if (!event)
1072  {
1073  if (debug) cout << "++++++++++++ StSkimPionMaker::getTowerHitInfo(): Can't get Event pointer" << endl;
1074  return;
1075  }
1076  StEmcCollection* emccol = (StEmcCollection*)event->emcCollection();
1077  if (!emccol)
1078  {
1079  if (debug) cout << "++++++++++++ StSkimPionMaker::getTowerHitInfo(): No EMC Collection" << endl;
1080  return;
1081  }
1082  StSPtrVecEmcPoint& bEmcPoints = emccol->barrelPoints();
1083  if (bEmcPoints.size()==0)
1084  {
1085  //cout << "++++++++++++ StSkimPionMaker::getTowerHitInfo(): No BEMC points found" << endl;
1086  return;
1087  }
1088 
1089  StEmcGeom* emcGeom = StEmcGeom::getEmcGeom("bemc");
1090 
1091  // for(Int_t det=0; det<4; det++) det=0
1092  StDetectorId id = static_cast<StDetectorId>(0+kBarrelEmcTowerId);
1093  StEmcDetector* detector = emccol->detector(id);
1094  if (detector)
1095  {
1096  for (UInt_t j=1; j<=120; j++)
1097  {
1098  StEmcModule* module = detector->module(j);
1099  if (module)
1100  {
1101  StSPtrVecEmcRawHit& rawHit = module->hits();
1102  for (Int_t k=0; k<(Int_t)rawHit.size(); k++)
1103  {
1104  int tid;
1105  emcGeom->getId(rawHit[k]->module(),rawHit[k]->eta(),rawHit[k]->sub(),tid);
1106  }
1107  }
1108  }
1109  }
1110  else
1111  if (debug) cout << "++++++++++ StSkimPionMaker::getTowerHitInfo(): no detector" << endl;
1112 
1113  return;
1114 }
1115 
1116 //________________________________________________________________________________________________________
1117 Bool_t StSkimPionMaker::readPointList()
1118 {
1119  // read all EMC points and fill them into the list of photon candidates
1120  // in addition, fill ntuple with point information for QA purposes
1121 
1122  StEvent *event = (StEvent*)this->GetInputDS("StEvent");
1123  if (!event)
1124  {
1125  if (debug) cout << "++++++++++++ StSkimPionMaker::readPointList(): Can't get Event pointer" << endl;
1126  return kStWarn;
1127  }
1128  StEmcCollection* emccol = (StEmcCollection*)event->emcCollection();
1129  if (!emccol)
1130  {
1131  if (debug) cout << "++++++++++++ StSkimPionMaker::readPointList(): No EMC Collection" << endl;
1132  return kStOk;
1133  }
1134  StSPtrVecEmcPoint& bEmcPoints = emccol->barrelPoints();
1135  if (bEmcPoints.size()==0)
1136  {
1137  //cout << "++++++++++++ StSkimPionMaker::readPointList(): No BEMC points found" << endl;
1138  return kStOk;
1139  }
1140  if (debug) cout << "++++++++++++ StSkimPionMaker::readPointList(): Number of BEMC points: " << bEmcPoints.size() << endl;
1141 
1142  // Ok, now we've got valid points, let's go on and do something with it, like filling the photon list and the ntuple
1143 
1144  StEmcPoint* point=0;
1145  for (StSPtrVecEmcPointIterator it=bEmcPoints.begin(); it!=bEmcPoints.end(); it++)
1146  {
1147  point = *it;
1148  photonlist->Add(point);
1149  // fill the EMC point ntuple for each entry
1150  const StThreeVectorF& pointVector = point->position();
1151  }
1152 
1153  if (debug) cout <<"++++++++++++ StSkimPionMaker::readPointList(): StEmcPoint point list: "<< photonlist->GetEntries() << endl;
1154  //cout <<"++++++++++++ StSkimPionMaker::readPointList(): StEmcPoint dummy list: "<< dummylist->GetEntries() << endl;
1155 
1156  if (photonlist->GetEntries()<=0)
1157  {
1158  photonlist->Clear();
1159  return kStOk;
1160  }
1161  return true;
1162 }
1163 
Bool_t trackOnEmc(StThreeVectorD *position, StThreeVectorD *momentum, const StTrack *const track, Double_t magField, Double_t emcRadius=225.405) const
Track projection utility.
static TObjArray * globalTracks()
returns pointer to the global tracks list
Definition: StMuDst.h:303
bool isValid()
dump spinDb content for current time stamp
Definition: StSpinDbMaker.h:53
virtual Int_t Make()
Double_t pt() const
Returns pT at point of dca to primary vertex.
Definition: StMuTrack.h:256
TObjArray * photonlist
used for MC trigger selection and offline trig definition
int spin4usingBX48(int bx48)
8bit spin information
virtual Int_t Finish()
Accessor to the database for trigger id information.
short flag() const
Returns flag, (see StEvent manual for type information)
Definition: StMuTrack.h:230
StMuDst * mMuDst
Pointer to the StMuDst class, which holds all the events information. Will be updated in the event lo...
const StThreeVectorF & p() const
Returns 3-momentum at dca to primary vertex.
Definition: StMuTrack.h:259
Double_t eta() const
Returns pseudo rapidity at point of dca to primary vertex.
Definition: StMuTrack.h:257
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
Definition: StMuDst.h:301
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320
Definition: Stypes.h:42
Definition: Stypes.h:40
UShort_t nHits() const
Bingchu.
Definition: StMuTrack.h:237
StThreeVectorF dca(Int_t vtx_id=-1) const
Returns 3D distance of closest approach to primary vertex.
Definition: StMuTrack.cxx:359
Int_t getBin(const Float_t phi, const Float_t eta, Int_t &m, Int_t &e, Int_t &s) const
Definition: StEmcGeom.h:321
Float_t getTotalPrescaleByTrgId(Int_t trgId)
Definition: Stypes.h:41
bool isPolDirLong()
Returns true if beams are transversely polarized, false otherwise.
Definition: StSpinDbMaker.h:55