117 {
118 std::string
names[162] = {
"eta",
"pt",
"phi",
"pos_x",
"pos_y",
"pos_z",
119 "emb0_cell", "emb1_cell", "emb2_cell", "emb3_cell", "emec0_cell", "emec1_cell", "emec2_cell", "emec3_cell",
120 "hec0_cell", "hec1_cell", "hec2_cell", "hec3_cell", "fc1_cell", "fc2_cell", "fc3_cell",
121 "emb0_hits", "emb1_hits", "emb2_hits", "emb3_hits", "emec0_hits", "emec1_hits", "emec2_hits", "emec3_hits",
122 "hec0_hits", "hec1_hits", "hec2_hits", "hec3_hits", "fc1_hits", "fc2_hits", "fc3_hits",
123 "emb0_sumE", "emb1_sumE", "emb2_sumE", "emb3_sumE", "emec0_sumE", "emec1_sumE", "emec2_sumE", "emec3_sumE",
124 "hec0_sumE", "hec1_sumE", "hec2_sumE", "hec3_sumE", "fc1_sumE", "fc2_sumE", "fc3_sumE",
125 "emb0_dPhi", "emb1_dPhi", "emb2_dPhi", "emb3_dPhi", "emec0_dPhi", "emec1_dPhi", "emec2_dPhi", "emec3_dPhi",
126 "hec0_dPhi", "hec1_dPhi", "hec2_dPhi", "hec3_dPhi", "fc1_dX", "fc2_dX", "fc3_dX",
127 "emb0_sPhi", "emb1_sPhi", "emb2_sPhi", "emb3_sPhi", "emec0_sPhi", "emec1_sPhi", "emec2_sPhi", "emec3_sPhi",
128 "hec0_sPhi", "hec1_sPhi", "hec2_sPhi", "hec3_sPhi", "fc1_sX", "fc2_sX", "fc3_sX",
129 "emb0_dEta", "emb1_dEta", "emb2_dEta", "emb3_dEta", "emec0_dEta", "emec1_dEta", "emec2_dEta", "emec3_dEta",
130 "hec0_dEta", "hec1_dEta", "hec2_dEta", "hec3_dEta", "fc1_dY", "fc2_dY", "fc3_dY",
131 "emb0_sEta", "emb1_sEta", "emb2_sEta", "emb3_sEta", "emec0_sEta", "emec1_sEta", "emec2_sEta", "emec3_sEta",
132 "hec0_sEta", "hec1_sEta", "hec2_sEta", "hec3_sEta", "fc1_sY", "fc2_sY", "fc3_sY",
133 "emb0_time", "emb1_time", "emb2_time", "emb3_time", "emec0_time", "emec1_time", "emec2_time", "emec3_time",
134 "hec0_time", "hec1_time", "hec2_time", "hec3_time", "fc1_time", "fc2_time", "fc3_time",
135 "emb0_widthX", "emb1_widthX", "emb2_widthX", "emb3_widthX", "emec0_widthX", "emec1_widthX", "emec2_widthX", "emec3_widthX",
136 "hec0_widthX", "hec1_widthX", "hec2_widthX", "hec3_widthX", "fc1_widthX", "fc2_widthX", "fc3_widthX",
137 "emb0_widthY", "emb1_widthY", "emb2_widthY", "emb3_widthY", "emec0_widthY", "emec1_widthY", "emec2_widthY", "emec3_widthY",
138 "hec0_widthY", "hec1_widthY", "hec2_widthY", "hec3_widthY", "fc1_widthY", "fc2_widthY", "fc3_widthY",
139 "cpuTime", "Energy", "PDG_ID", "RunNo", "EventNo", "E_Dep" };
140
141 double lim[162][2] = { {0,5}, {0,100}, {-4,4}, {-1600,1600}, {-1600,1600}, {-4000,4000},
142 {0,0.25}, {0,3}, {0,6}, {0,0.1}, {0,0.25}, {0,2}, {0,3}, {0,0.1}, {0,1}, {0,10}, {0,10}, {0,10}, {0,0.1}, {0,0.1}, {0,0.1},
143 {0,100}, {0,600}, {0,600}, {0,50}, {0,50}, {0,400}, {0,500}, {0,200}, {0,100}, {0,1000}, {0,1000}, {0,100}, {0,150}, {0,50}, {0,10},
144 {0,0.4}, {0,5}, {0,10}, {0,0.2}, {0,0.1}, {0,3}, {0,5}, {0,0.2}, {0,1}, {0,10}, {0,10}, {0,0.1}, {0,1}, {0,0.1}, {0,0.1},
145 {-500,500}, {-100,100}, {-15,15}, {-200,200}, {-3000,3000}, {-60,60}, {-25,25}, {-200,200}, {-50,50}, {-50,50}, {-50,50}, {-50,50}, {-60,60}, {-500,500}, {-200,200},
146 {0,1000}, {0,500}, {0,200}, {0,500}, {0,2000}, {0,250}, {0,300}, {0,500}, {0,200}, {0,200}, {0,200}, {0,200}, {0,100}, {0,100}, {0,50},
147 {-150,150}, {-15,15}, {-20,20}, {-200,200}, {-0,2500}, {-50,20}, {-15,15}, {-150,150}, {-50,50}, {-50,50}, {-50,50}, {-50,50}, {-60,60}, {-500,500}, {-200,200},
148 {0,500}, {0,100}, {0,100}, {0,400}, {0,1000}, {0,150}, {0,100}, {0,400}, {0,200}, {0,200}, {0,200}, {0,200}, {0,60}, {0,100}, {0,50},
149 {0,750}, {0,25}, {0,20}, {0,1000}, {0,10000}, {0,40}, {0,30}, {0,1000}, {0,1000}, {0,100}, {0,100}, {0,200}, {0,10}, {0,500}, {0,100},
150 {-150,150}, {-15,15}, {-20,20}, {-200,200}, {-0,2500}, {-50,20}, {-15,15}, {-150,150}, {-50,50}, {-50,50}, {-50,50}, {-50,50}, {-60,60}, {-500,500}, {-200,200},
151 {-150,150}, {-15,15}, {-20,20}, {-200,200}, {-0,2500}, {-50,20}, {-15,15}, {-150,150}, {-50,50}, {-50,50}, {-50,50}, {-50,50}, {-60,60}, {-500,500}, {-200,200},
152 {0,50}, {0,100}, {-25,25}, {0,10}, {0,1000}, {0,10}};
153
154
155
156
157
158
159
166
167
168
169
171 for (
int i=0;
i<162;
i++){
176 ATH_MSG_WARNING(
"Failed to register historam " << names[i] <<
". Not sure what will happen now..." );
177 }
178 }
179
180
182 if (!
file)
throw std::runtime_error (
"Ntuple MGR not open");
183 NTuple::Directory *col=
ntupleSvc()->createDirectory(
"/NTUPLES/FILE/COL");
184 NTuplePtr
nt(
ntupleSvc(),
"/NTUPLES/FILE/COL/SingleTrackValidation");
185 if (!nt)
nt=
ntupleSvc()->book(col, 1, CLID_ColumnWiseTuple,
"SingleTrackValidation");
186
187 if (
nt->addItem(
"Eta",
m_c->eta ).isFailure() ||
188 nt->addItem(
"Pt",
m_c->pt ).isFailure() ||
189 nt->addItem(
"BarrelX",
m_c->x ).isFailure() ||
190 nt->addItem(
"BarrelY",
m_c->y ).isFailure() ||
191 nt->addItem(
"BarrelZ",
m_c->z ).isFailure() ||
192 nt->addItem(
"Phi",
m_c->phi ).isFailure() ){
193 ATH_MSG_WARNING(
"Registration of some of the ntuple branches failed. No idea what will happen next..." );
194 }
195
196
198
199
200
201
202 for (
int i=0;
i<15;
i++){
203 if (i<12) sprintf(title,"S%i_C00",i);
204 else sprintf(title,"FC%i_C00",i-11);
205 if (
nt->addItem(title,
m_c->s_c00[i]).isFailure())
ATH_MSG_INFO(
"Registration of a branch failed in the ntupler..." );
206 if (i<12) sprintf(title,"S%i_SumE",i);
207 else sprintf(title,"FC%i_SumE",i-11);
208 if (
nt->addItem(title,
m_c->s_sumE[i]).isFailure())
ATH_MSG_INFO(
"Registration of a branch failed in the ntupler..." );
209 if (i<12) sprintf(title,"S%i_Hits",i);
210 else sprintf(title,"FC%i_Hits",i-11);
211 if (
nt->addItem(title,
m_c->s_hits[i]).isFailure())
ATH_MSG_INFO(
"Registration of a branch failed in the ntupler..." );
212 if (i<12) sprintf(title,"S%i_DeltaPhi",i);
213 else sprintf(title,"FC%i_DeltaX",i-11);
214 if (
nt->addItem(title,
m_c->s_deltaPhi[i]).isFailure())
ATH_MSG_INFO(
"Registration of a branch failed in the ntupler..." );
215 if (i<12) sprintf(title,"S%i_SigmaPhi",i);
216 else sprintf(title,"FC%i_SigmaX",i-11);
217 if (
nt->addItem(title,
m_c->s_sigmaPhi[i]).isFailure())
ATH_MSG_INFO(
"Registration of a branch failed in the ntupler..." );
218 if (i<12) sprintf(title,"S%i_DeltaEta",i);
219 else sprintf(title,"FC%i_DeltaY",i-11);
220 if (
nt->addItem(title,
m_c->s_deltaEta[i]).isFailure())
ATH_MSG_INFO(
"Registration of a branch failed in the ntupler..." );
221 if (i<12) sprintf(title,"S%i_SigmaEta",i);
222 else sprintf(title,"FC%i_SigmaY",i-11);
223 if (
nt->addItem(title,
m_c->s_sigmaEta[i]).isFailure())
ATH_MSG_INFO(
"Registration of a branch failed in the ntupler..." );
224 if (i<12) sprintf(title,"S%i_Time",i);
225 else sprintf(title,"FC%i_Time",i-11);
226 if (
nt->addItem(title,
m_c->s_t00[i]).isFailure())
ATH_MSG_INFO(
"Registration of a branch failed in the ntupler..." );
227 if (i<12) sprintf(title,"S%i_WidthX",i);
228 else sprintf(title,"FC%i_WidthX",i-11);
229 if (
nt->addItem(title,
m_c->s_widthX[i]).isFailure())
ATH_MSG_INFO(
"Registration of a branch failed in the ntupler..." );
230 if (i<12) sprintf(title,"S%i_WidthY",i);
231 else sprintf(title,"FC%i_WidthY",i-11);
232 if (
nt->addItem(title,
m_c->s_widthY[i]).isFailure())
ATH_MSG_INFO(
"Registration of a branch failed in the ntupler..." );
233 }
234
235 if (
nt->addItem(
"CPU" ,
m_c->cpuTime ).isFailure() ||
236 nt->addItem(
"TrackEnergy" ,
m_c->Energy ).isFailure() ||
237 nt->addItem(
"ParticleID" ,
m_c->PDG ).isFailure() ||
238 nt->addItem(
"Run#" ,
m_c->RunNo ).isFailure() ||
239 nt->addItem(
"Event#" ,
m_c->EventNo ).isFailure() ||
240 nt->addItem(
"DepositedEnergy",
m_c->E_Deposit ).isFailure() ){
241 ATH_MSG_WARNING(
"Registration of some of the ntuple branches failed. No idea what will happen next..." );
242 }
243
246
247
248
249
250
251 return StatusCode::SUCCESS;
252}
#define ATH_MSG_WARNING(x)
const ServiceHandle< StoreGateSvc > & detStore() const
ServiceHandle< ITHistSvc > m_histSvc
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)