StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtMuDst2TTreeDstMaker.C
1 enum dataFormat {dst, evt, tree};
2 
3 // NOTE - chain needs to be declared global so for StHbtEventReader
4 class StChain;
5 StChain *chain=0;
6 
7 // File-scope stuff needed by setFiles, nextFile. Someone ambitious
8 // can clean this up by putting it all into a nice clean class.
9 Int_t usePath = 0;
10 Int_t nFile = 0;
11 TString thePath;
12 TString theFileName;
13 TString originalPath;
14 //class StChain;
15 //StChain *chain=0;
16 
17 TBrowser *b=0;
18 const char *venusFile ="set*geant.root";
19 const char *venusPath ="/disk00001/star/auau200/venus412/default/b0_3/year_1b/hadronic_on/tfs_4/";
20 const char *dstFile ="/disk00001/star/auau200/two_photon/starlight/twogam/year_1b/hadronic_on/tfs/ric0022_01_14552evts.dst.root";
21 const char *xdfFile ="/afs/rhic.bnl.gov/star/data/samples/psc0054_07_40evts_dst.xdf";
22 const char *mdcFile ="/disk00001/star/auau200/venus412/default/b0_3/year_1b/hadronic_on/tss/psc0081_07_40evts.root";
23 const char *geantFile ="/disk00000/star/auau200/hijing135/jetq_off/b0_3/year_1b/hadronic_on/tfsr/set0041_01_53evts.geant.root";
24 const char *fileList[] = {dstFile,xdfFile,mdcFile,0};
25 
26 //==========================================================================================
27 void StHbtMuDst2TTreeDstMaker(
28  const Int_t nevents=999999, int maxFiles=2,
29  const Char_t *path="",
30  const Char_t *fileName="AuAu200.lis",
31  const Char_t *filter="st_physics_2302016:MuDst.root",
32  const Char_t *outFile="MuDst2TTree.root")
33 
34 {
35 
36 // Dynamically link needed shared libs
37  gSystem->Load("St_base");
38  gSystem->Load("StChain");
39  gSystem->Load("St_Tables");
40  gSystem->Load("StMagF");
41  gSystem->Load("StUtilities"); // new addition 22jul99
42  gSystem->Load("StTreeMaker");
43  gSystem->Load("StIOMaker");
44  gSystem->Load("StarClassLibrary");
45  gSystem->Load("StTpcDb");
46  gSystem->Load("StDbUtilities");
47  gSystem->Load("StEvent");
48  gSystem->Load("StEventMaker");
49  gSystem->Load("StEventUtilities");
50  gSystem->Load("StEmcUtil");
51  gSystem->Load("St_emc_Maker");
52  gSystem->Load("StMcEvent");
53  gSystem->Load("StMcEventMaker");
54  gSystem->Load("StAssociationMaker");
55  gSystem->Load("StMcAnalysisMaker");
56  gSystem->Load("StFlowMaker");
57  gSystem->Load("StFlowTagMaker");
58  gSystem->Load("StFlowAnalysisMaker");
59  gSystem->Load("StStrangeMuDstMaker");
60  gSystem->Load("StMuDSTMaker");
61  gSystem->Load("StHbtMaker");
62 
63 
64 cout << " loading done " << endl;
65 
66 chain = new StChain("StChain");
67 chain->SetDebug();
68 
69 
70 // **********
71 // MuDstMaker
72 // **********
74 StMuDbReader* dbReader = StMuDbReader::instance();
75 dbReader->addDb("P02g.db");
76 StMuDstMaker* muDstMaker = new StMuDstMaker(0,0,path,fileName,filter,maxFiles);
77 
78 // ***************
79 // read from MuDst
80 // ***************
81 
82 
83 
84 // *********
85 // Hbt Maker
86 // *********
87 StHbtMaker* hbtMaker = new StHbtMaker("HBT","title");
88 cout << "StHbtMaker instantiated"<<endl;
89 cout << "StHbtMaker::Init - setting up Reader and Analyses..." << endl;
90 StHbtManager* TheManager = hbtMaker->HbtManager();
91 
92 // ******
93 // Reader
94 // ******
95 StHbtMuDstMakerReader* Reader = new StHbtMuDstMakerReader(muDstMaker);
96 Reader->setTrackType(1);
97 TheManager->SetEventReader(Reader);
98 
99 
100 // ***** set up event cut *****
101  mikesEventCut* EventCut = new mikesEventCut;
102  EventCut->SetEventMult(0,100000); // selected multiplicity range
103  EventCut->SetVertZPos(-75.0,75.0); // selected range of vertex z-position
104 // ***** set up all track cut *****
105  franksTrackCut* AllTrackCut = new franksTrackCut;
106  AllTrackCut->SetNSigmaElectron(-1000.0,1000.0);
107  AllTrackCut->SetNSigmaPion(-1000.0,1000.0);
108  AllTrackCut->SetNSigmaKaon(-1000.0,1000.0);
109  AllTrackCut->SetNSigmaProton(-1000.0,1000.0);
110  AllTrackCut->SetNHits(10,1000); // range on number of TPC hits on the track
111  AllTrackCut->SetP(0.0,50.0); // range in P
112  AllTrackCut->SetPt(0.0,50.0); // range in Pt
113  AllTrackCut->SetRapidity(-15,15); // range in rapidity
114  AllTrackCut->SetDCA(0.0,200.); // range in Distance of Closest Approach to primary vertex
115  AllTrackCut->SetCharge(0); // no cut on charge
116  AllTrackCut->SetMass(0.139); // pion mass
117 // ***** set up lambda cut *****
118  helensV0Cut* V0Cut = new helensV0Cut; // use V0 particle cut object
119  V0Cut->SetdcaV0daughters(0.,1.0); // DCA between 2 tracks
120  V0Cut->SetdcaV0ToPrimVertex(0.,1.); // DCA between V0 and event vertex
121  V0Cut->SetdecayLengthV0(3.0,5000.); // Decay length from prim. vertex
122  V0Cut->SettpcHitsPos(15,50); // Number of TPC hits on + track
123  V0Cut->SettpcHitsNeg(15,50); // Number of TPC hits on - track
124  V0Cut->SetdcaPosToPrimVertex(1.8,50.); // Min. value + track at intersect
125  V0Cut->SetdcaNegToPrimVertex(3.5,50.); // Min. value - track at intersect
126  V0Cut->SetPt(0.,10.0); // range in Pt
127 // ***** set up xi cut *****
128  franksXiCut* XiCut = new franksXiCut;
129  XiCut->SetdcaXidaughters(0.,1.0); // DCA between 2 tracks
130  XiCut->SetdcaXiToPrimVertex(0.,1.); // DCA between V0 and event vertex
131  XiCut->SetdecayLengthXi(3.0,5000.); // Decay length from prim. vertex
132  XiCut->SetPt(0.,10.0); // range in Pt
133 cout << "READER SET UP.... " << endl;
134 
135 
136  // set up a microDstWriter
137  StHbtTTreeReader* allWriter = new StHbtTTreeReader(1,0,"./",outFile,".hbtTTreeMuDst","");
138  // StHbtBinaryReader* allWriter = new StHbtBinaryReader(ioMaker,dirName,"dummy",".microDst");
139  TheManager->AddEventWriter(allWriter);
140  allWriter->SetEventCut(EventCut);
141  allWriter->SetTrackCut(AllTrackCut);
142  allWriter->SetV0Cut(V0Cut);
143  allWriter->SetXiCut(XiCut);
144  cout << "WRITER SET UP.... " << endl;
145 
146  // ------------------ end of setting up hbt stuff ------------------ //
147 
148  chain->Init(); // This should call the Init() method in ALL makers
149  chain->PrintInfo();
150  for (Int_t iev=0;iev<nevents; iev++) {
151  cout << "StHbtExample -- Working on eventNumber " << iev << endl;
152  chain->Clear();
153  int iret = chain->Make(iev); // This should call the Make() method in ALL makers
154  if (iret) {
155  cout << "Bad return code!" << endl;
156  break;
157  }
158  } // Event Loop
159  chain->Finish(); // This should call the Finish() method in ALL makers
160 
161  cout << " End of Analysis " << endl;
162 }
163 
164 
165 
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
int addDb(const char *dbFile)
add entries in dbFile to internal data base ( mDb ), will call sortDb(), returns number of entries in...
static void setLevel(unsigned int level)
sets the debug level
Definition: StMuDebug.h:74
virtual Int_t Finish()
Definition: StChain.cxx:85
virtual Int_t Make()
Definition: StChain.cxx:110