StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ntupleTrack.cxx
1 /***************************************************************************
2  *
3  * 12 July 2000
4  *
5  * Author: Dominik Flierl, flierl@bnl.gov
6  ***************************************************************************
7  *
8  * Description:
9  * fill track information into an ntuple in order to determine the cuts
10  *
11  ***************************************************************************/
12 
13 
14 #include "StHbtMaker/Cut/ntupleTrack.h"
15 
16 #ifdef __ROOT__
17 ClassImp(ntupleTrack)
18 //______________________________
19 ntupleTrack::ntupleTrack()
20 {
21  // create tree
22  mTree = new TTree("TrackTree","A Tree with all tracks in order to set the cuts");
23  // create Branch
24  mTree->Branch("track",&mtrack,"charge/I:nhits/I:dca/F:pt/F:p/F:px/F:py/F:pz/F:prapidity/F");
25 }
26 //_____________________________
27 ntupleTrack::~ntupleTrack()
28 {
29  // clean up
30  delete mTree;
31 }
32 //________________________________
33 bool ntupleTrack::Pass(const StHbtTrack* track)
34 {
35  // extract track info and fill tree
36  mtrack.charge = track->Charge() ;
37  mtrack.nhits = track->NHits() ;
38  mtrack.dca = track->DCAz() ;
39  mtrack.pt = track->P().perp() ;
40  mtrack.p = track->P().magnitude() ;
41  mtrack.px = track->P().x() ;
42  mtrack.py = track->P().y() ;
43  mtrack.pz = track->P().z() ;
44  mtrack.prapidity = track->P().pseudoRapidity() ;
45  mTree->Fill();
46  return true;
47 }
48 //________________________________
49 StHbtString ntupleTrack::Report()
50 {
51  StHbtString t;
52  char Ctemp[100];
53  sprintf(Ctemp,"No actual track cut applied ! This cut class just fills a tree.\n");
54  t+=Ctemp;
55  return t;
56 };
57 
58 #endif // ifdef ROOT
59