forked from star-bnl/star-picoDst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makePicoDst.C
138 lines (114 loc) · 4.09 KB
/
makePicoDst.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#include <TSystem>
class StMaker;
class StChain;
class StPicoDstMaker;
class StMuDstMaker;
StChain* chain;
void makePicoDst(const Char_t *inputFile = "root://xrdstar.rcf.bnl.gov:1095//home/starlib/home/starreco/reco/AuAu_200_production_low_2014/ReversedFullField/P15ic/2014/140/15140004/st_physics_15140004_raw_1000016.MuDst.root")
{
Int_t nEvents = 1e5;
gSystem->Load("libTable");
gSystem->Load("libPhysics");
gSystem->Load("St_base");
gSystem->Load("StChain");
gSystem->Load("St_Tables");
gSystem->Load("StUtilities"); // new addition 22jul99
gSystem->Load("StTreeMaker");
gSystem->Load("StIOMaker");
gSystem->Load("StarClassLibrary");
gSystem->Load("StTriggerDataMaker"); // new starting from April 2003
gSystem->Load("StBichsel");
gSystem->Load("StEvent");
gSystem->Load("StEventUtilities");
gSystem->Load("StDbLib");
gSystem->Load("StEmcUtil");
gSystem->Load("StTofUtil");
gSystem->Load("StPmdUtil");
gSystem->Load("StPreEclMaker");
gSystem->Load("StStrangeMuDstMaker");
gSystem->Load("StMuDSTMaker");
gSystem->Load("StTpcDb");
gSystem->Load("StMcEvent");
gSystem->Load("StMcEventMaker");
gSystem->Load("StDaqLib");
gSystem->Load("libgen_Tables");
gSystem->Load("libsim_Tables");
gSystem->Load("libglobal_Tables");
gSystem->Load("StEmcTriggerMaker");
gSystem->Load("StEmcRawMaker");
gSystem->Load("StEmcADCtoEMaker");
gSystem->Load("StPreEclMaker");
gSystem->Load("StEpcMaker");
gSystem->Load("StEmcSimulatorMaker");
gSystem->Load("StDbBroker");
gSystem->Load("StDetectorDbMaker");
gSystem->Load("StDbUtilities");
gSystem->Load("StEEmcUtil");
gSystem->Load("StEEmcDbMaker");
gSystem->Load("St_db_Maker");
gSystem->Load("StTriggerUtilities");
gSystem->Load("StMagF");
gSystem->Load("StMtdUtil");
gSystem->Load("StMtdMatchMaker");
gSystem->Load("StMtdCalibMaker");
gSystem->Load("StPicoEvent");
gSystem->Load("StPicoDstMaker");
chain = new StChain();
StMuDstMaker* MuDstMaker = new StMuDstMaker(0, 0, "", inputFile, "MuDst", 100);
MuDstMaker->SetStatus("*", 0);
MuDstMaker->SetStatus("MuEvent", 1);
MuDstMaker->SetStatus("PrimaryVertices", 1);
MuDstMaker->SetStatus("PrimaryTracks", 1);
MuDstMaker->SetStatus("GlobalTracks", 1);
MuDstMaker->SetStatus("CovGlobTrack", 1);
MuDstMaker->SetStatus("BTof*", 1);
MuDstMaker->SetStatus("Emc*", 1);
MuDstMaker->SetStatus("MTD*", 1);
St_db_Maker* dbMk = new St_db_Maker("db", "MySQL:StarDb", "$STAR/StarDb", "StarDb");
// Endcap database
StEEmcDbMaker* eemcDb = new StEEmcDbMaker;
StEmcADCtoEMaker* adc2e = new StEmcADCtoEMaker();
adc2e->setPrint(false);
adc2e->saveAllStEvent(true);
StPreEclMaker* pre_ecl = new StPreEclMaker();
pre_ecl->setPrint(kFALSE);
StEpcMaker* epc = new StEpcMaker();
epc->setPrint(kFALSE);
// Trigger simulator
StTriggerSimuMaker* trigSimu = new StTriggerSimuMaker;
trigSimu->setMC(false);
trigSimu->useBemc();
trigSimu->useEemc();
trigSimu->useOnlineDB();
trigSimu->bemc->setConfig(StBemcTriggerSimu::kOffline);
StMagFMaker* magfMk = new StMagFMaker;
StMtdMatchMaker* mtdMatchMaker = new StMtdMatchMaker();
StMtdCalibMaker* mtdCalibMaker = new StMtdCalibMaker("mtdcalib");
StPicoDstMaker* picoMaker = new StPicoDstMaker(StPicoDstMaker::IoWrite, inputFile, "picoDst");
picoMaker->setVtxMode((int)(StPicoDstMaker::PicoVtxMode::AuAu200));
// picoMaker->SetDebug(1);
chain->Init();
cout << "chain->Init();" << endl;
int total = 0;
for (Int_t i = 0; i < nEvents; i++)
{
if (i % 100 == 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 " << total << endl;
cout << "****************************************** " << endl;
delete chain;
}