-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathmakePicoDst.C
162 lines (131 loc) · 4.55 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
class StMaker;
class StChain;
class StPicoDstMaker;
class StMuDstMaker;
void loadLibs()
{
gSystem->Load("libTable");
gSystem->Load("libPhysics");
gSystem->Load("libSt_base");
gSystem->Load("libStChain");
gSystem->Load("libSt_Tables");
gSystem->Load("libStUtilities"); // new addition 22jul99
gSystem->Load("libStTreeMaker");
gSystem->Load("libStIOMaker");
gSystem->Load("libStarClassLibrary");
gSystem->Load("libStTriggerDataMaker"); // new starting from April 2003
gSystem->Load("libStBichsel");
gSystem->Load("libStEvent");
gSystem->Load("libStEventUtilities");
gSystem->Load("libStDbLib");
gSystem->Load("libStEmcUtil");
gSystem->Load("libStTofUtil");
gSystem->Load("libStPmdUtil");
gSystem->Load("libStPreEclMaker");
gSystem->Load("libStStrangeMuDstMaker");
gSystem->Load("libStMuDSTMaker");
gSystem->Load("libStarAgmlUtil");
gSystem->Load("libStTpcDb");
gSystem->Load("libStMcEvent");
gSystem->Load("libStMcEventMaker");
gSystem->Load("libStDaqLib");
gSystem->Load("libgen_Tables");
gSystem->Load("libsim_Tables");
gSystem->Load("libglobal_Tables");
gSystem->Load("libStEmcTriggerMaker");
gSystem->Load("libStEmcRawMaker");
gSystem->Load("libStEmcADCtoEMaker");
gSystem->Load("libStPreEclMaker"); // XXX: loaded twice !
gSystem->Load("libStEpcMaker");
gSystem->Load("libStEmcSimulatorMaker");
gSystem->Load("libStDbBroker");
gSystem->Load("libStDetectorDbMaker");
gSystem->Load("libStDbUtilities");
gSystem->Load("libStEEmcUtil");
gSystem->Load("libStEEmcDbMaker");
gSystem->Load("libSt_db_Maker");
gSystem->Load("libStTriggerUtilities");
gSystem->Load("libStMagF");
gSystem->Load("libStMtdUtil");
gSystem->Load("libStMtdMatchMaker");
gSystem->Load("libStMtdCalibMaker");
//FMS
gSystem->Load("libStFmsUtil");
gSystem->Load("libStFmsDbMaker");
gSystem->Load("libStPicoEvent");
gSystem->Load("libStPicoDstMaker");
gSystem->ListLibraries();
}
void loadAgML( const char* name=0 )
{
gROOT->LoadMacro("bfc.C");
bfc(0,"agml nodefault mysql");
AgModule::SetStacker( new StarTGeoStacker() );
if (name) StarGeometry::Construct(name);
}
void makePicoDst(const Char_t *inputFile, int nEvents = 100000)
{
loadLibs();
StChain* 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);
MuDstMaker->SetStatus("Fms*", 1);
St_db_Maker* dbMk = new St_db_Maker("db", "MySQL:StarDb", "$STAR/StarDb", "StarDb");
//Makers needed for FMS
//TODO:remove dependence on StEvent(Maker)
StFmsDbMaker* fmsdb = new StFmsDbMaker("fmsDb");
// 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->useOfflineDB();
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::Default));
chain->Init();
cout << "chain->Init();" << endl;
loadAgML("y2017");
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;
}