-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathreadPicoDst.C
60 lines (40 loc) · 1.69 KB
/
readPicoDst.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <TSystem>
class StMaker;
class StChain;
class StPicoDstMaker;
StChain *chain;
void readPicoDst(Int_t nEvents= 10, const Char_t *inputFile="test.list", const Char_t *outputFile="test.root")
{
//Load all the System libraries
gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
loadSharedLibraries();
gSystem->Load("StPicoEvent"); //order matters?!
gSystem->Load("StPicoDstMaker");
gSystem->Load("StMyAnalysisMaker");
gSystem->Load("StRefMultCorr");
gSystem->Load("StPicoPrescales");
chain = new StChain();
StPicoDstMaker *picoMaker = new StPicoDstMaker(2,inputFile,"picoDst");
StMyAnalysisMaker *anaMaker = new StMyAnalysisMaker("ana",picoMaker,outputFile);
chain->Init();
cout<<"chain->Init();"<<endl;
int total = picoMaker->chain()->GetEntries();
cout << " Total entries = " << total << endl;
if(nEvents>total) nEvents = total;
for (Int_t i=0; i<nEvents; i++){
if(i%1000==0)
cout << "Working on eventNumber " << i << endl;
chain->Clear();
int iret = chain->Make(i);
if (iret) { cout << "Bad return code!" << iret << endl; break;}
total++;
}
cout << "****************************************** " << endl;
cout << "Work done... now its time to close up shop!"<< endl;
cout << "****************************************** " << endl;
chain->Finish();
cout << "****************************************** " << endl;
cout << "total number of events " << nEvents << endl;
cout << "****************************************** " << endl;
delete chain;
}