StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
dumpTracks.C
1 {{
2 /* This is a very simple example macro using the StMuDstMaker to open
3  * a MuDst file and print out some event and charged track information
4  */
5  gROOT->Reset();
6  gROOT->Macro("loadMuDst.C");
7 
8  mudst_mk=new StMuDstMaker(0,0,"/star/data15/reco/productionMinBias/ReversedFullField/P05ia/2004/064/","st_physics_5064011_raw_3010002.MuDst.root");
9  mudst_mk->Init();
10 
11  Int_t n_evt=1;
12  for (Int_t i_evt=0; i_evt<n_evt; i_evt++) {
13  mudst_mk->Make();
14  if (mudst_mk->muDst()==0) {
15  cout << "No event" << endl;
16  continue;
17  }
18  StMuEvent *event=mudst_mk->muDst()->event();
19 
20  cout << "Event: " << event->eventId() << endl;
21  StThreeVectorF vtx_pos = event->primaryVertexPosition();
22  cout << "Vertex at " << vtx_pos.x() << " " << vtx_pos.y() << " " << vtx_pos.z() << endl;
23  Int_t n_prim=mudst_mk->muDst()->GetNPrimaryTrack();
24  Int_t n_glob=mudst_mk->muDst()->GetNGlobalTrack();
25  cout << n_prim << "primary tracks and " << n_glob << " global tracks "<< endl;
26  Int_t prim_step=n_prim/100;
27  if (prim_step==0)
28  prim_step=1;
29  Int_t i_prim=0;
30  while (i_prim < n_prim) {
31  StMuTrack *pr_track=mudst_mk->muDst()->primaryTracks(i_prim);
32  cout << "Primary track " << i_prim << " momentum " << pr_track->p() << endl;
33  cout << "\t flag " << pr_track->flag() << " " << pr_track->nHits()
34  << " hits ( " << pr_track->topologyMap()->numberOfHits(kSvtId)
35  << " svt, " << pr_track->topologyMap()->numberOfHits(kTpcId)
36  << " tpc, " << pr_track->topologyMap()->numberOfHits(kFtpcWestId) +
37  pr_track->topologyMap()->numberOfHits(kFtpcEastId)
38  << " ftpc )" << endl;
39  cout << "\t fitted points " << pr_track->nHitsFit() << " ( "
40  << pr_track->nHitsFit(kSvtId) << " svt, "
41  << pr_track->nHitsFit(kSsdId) << " ssd, "
42  << pr_track->nHitsFit(kTpcId) << " tpc, "
43  << pr_track->nHitsFit(kFtpcEastId) << " Ftpc east, "
44  << pr_track->nHitsFit(kFtpcWestId) << " Ftpc west)" << endl;
45  cout << "\t possible points " << pr_track->nHitsPoss() << " ( "
46  << pr_track->nHitsPoss(kSvtId) << " svt, "
47  << pr_track->nHitsPoss(kSsdId) << " ssd, "
48  << pr_track->nHitsPoss(kTpcId) << " tpc, "
49  << pr_track->nHitsPoss(kFtpcEastId) << " Ftpc east, "
50  << pr_track->nHitsPoss(kFtpcWestId) << " Ftpc west)" << endl;
51 
52  cout << "\t first point " << pr_track->firstPoint() << endl;
53  cout << "\t last point " << pr_track->lastPoint() << endl;
54  cout << "\t inner helix origin " << pr_track->helix().origin() << endl;
55  cout << "Pid probabilities ";
56  for (Int_t i=0; i<7; i++)
57  cout << pr_track->probPidTraits()->probability(i) << " ";
58  cout << endl;
59  StMuTrack *gl_track=pr_track->globalTrack();
60  cout << "Global track momentum " << gl_track->p() << endl;
61  cout << "\t first point " << gl_track->firstPoint() << endl;
62  cout << "\t last point " << gl_track->lastPoint() << endl;
63  cout << "\t inner helix origin " << gl_track->helix().origin() << endl;
64  cout << "Pid probabilities ";
65  for (Int_t i=0; i<7; i++)
66  cout << gl_track->probPidTraits()->probability(i) << " ";
67  cout << endl;
68  i_prim+=prim_step;
69  }
70  }
71 
72 }}
StMuDstMaker(const char *name="MuDst")
Default constructor.
double probability(unsigned int i) const
returns the probability of the track being of particle type i
StPhysicalHelixD helix() const
Returns inner helix (first measured point)
Definition: StMuTrack.cxx:407
UShort_t nHitsFit() const
Return total number of hits used in fit.
Definition: StMuTrack.h:239
short flag() const
Returns flag, (see StEvent manual for type information)
Definition: StMuTrack.h:230
const StThreeVectorF & p() const
Returns 3-momentum at dca to primary vertex.
Definition: StMuTrack.h:259
const StThreeVectorF & firstPoint() const
Returns positions of first measured point.
Definition: StMuTrack.h:261
const StMuProbPidTraits & probPidTraits() const
Returns Yuri Fisyak new pid probabilities.
Definition: StMuTrack.h:263
const StThreeVector< double > & origin() const
-sign(q*B);
Definition: StHelix.hh:224
UShort_t nHitsPoss() const
Return number of possible hits on track.
Definition: StMuTrack.cxx:242
UShort_t nHits() const
Bingchu.
Definition: StMuTrack.h:237
const StThreeVectorF & lastPoint() const
Returns positions of last measured point.
Definition: StMuTrack.h:262
const StMuTrack * globalTrack() const
Returns pointer to associated global track. Null pointer if no global track available.
Definition: StMuTrack.h:272
StTrackTopologyMap topologyMap() const
Returns topology map.
Definition: StMuTrack.h:254