125 {
126
127 MsgStream log(
msgSvc(), name());
128
129 log << MSG::INFO << "in initialize()" << endmsg;
130 StatusCode status;
131 status = service("THistSvc", m_thistsvc);
132 if(status.isFailure() ){
133 log << MSG::INFO << "Unable to retrieve pointer to THistSvc" << endreq;
134 return status;
135 }
136
137
138 e_z0 = new TH1F("e_z0","e_z0",100,0,50);
139 status = m_thistsvc->regHist("/DQAHist/Bhabha/e_z0", e_z0);
140 e_r0 = new TH1F("e_r0","e_r0",100,0,10);
141 status = m_thistsvc->regHist("/DQAHist/Bhabha/e_r0", e_r0);
142
143 m_ee_mass = new TH1F( "ee_mass", "ee_mass", 500, m_ecms-0.5, m_ecms+0.5 );
144 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_mass", m_ee_mass);
145 m_ee_acoll = new TH1F( "ee_acoll", "ee_acoll", 60, 0, 6 );
146 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_acoll", m_ee_acoll);
147 m_ee_eop_ep = new TH1F( "ee_eop_ep", "ee_eop_ep", 100,0.4,1.4 );
148 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_eop_ep", m_ee_eop_ep);
149 m_ee_eop_em = new TH1F( "ee_eop_em", "ee_eop_em", 100,0.4,1.4 );
150 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_eop_em", m_ee_eop_em);
151 m_ee_costheta_ep = new TH1F( "ee_costheta_ep", "ee_costheta_ep", 100,-1,1 );
152 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_costheta_ep", m_ee_costheta_ep);
153 m_ee_costheta_em = new TH1F( "ee_costheta_em", "ee_costheta_em", 100,-1,1 );
154 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_costheta_em", m_ee_costheta_em);
155
156 m_ee_phi_ep = new TH1F( "ee_phi_ep", "ee_phi_ep", 120,-3.2,3.2 );
157 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_phi_ep", m_ee_phi_ep);
158 m_ee_phi_em = new TH1F( "ee_phi_em", "ee_phi_em", 120,-3.2,3.2 );
159 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_phi_em", m_ee_phi_em);
160
161 m_ee_nneu = new TH1I( "ee_nneu", "ee_nneu", 5,0,5 );
162 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_nneu", m_ee_nneu);
163
164
165
166 m_ee_eemc_ep=new TH1F("ee_eemc_ep","ee_eemc_ep",100,m_ecms/2.-0.8,m_ecms/2.+0.3);
167 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_eemc_ep", m_ee_eemc_ep);
168 m_ee_eemc_em=new TH1F("ee_eemc_em","ee_eemc_em",100,m_ecms/2.-0.8,m_ecms/2.+0.3);
169 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_eemc_em", m_ee_eemc_em);
170 m_ee_x_ep=new TH1F("ee_x_ep","ee_x_ep",100,-1.0,1.0);
171 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_x_ep", m_ee_x_ep);
172 m_ee_y_ep=new TH1F("ee_y_ep","ee_y_ep",100,-1.0,1.0);
173 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_y_ep", m_ee_y_ep);
174 m_ee_z_ep=new TH1F("ee_z_ep","ee_z_ep",100,-10.0,10.0);
175 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_z_ep", m_ee_z_ep);
176 m_ee_x_em=new TH1F("ee_x_em","ee_x_em",100,-1.0,1.0);
177 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_x_em", m_ee_x_em);
178 m_ee_y_em=new TH1F("ee_y_em","ee_y_em",100,-1.0,1.0);
179 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_y_em", m_ee_y_em);
180 m_ee_z_em=new TH1F("ee_z_em","ee_z_em",100,-10.0,10.0);
181 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_z_em", m_ee_z_em);
182
183 m_ee_px_ep=new TH1F("ee_px_ep","ee_px_ep",200,-2.2,2.2);
184 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_px_ep", m_ee_px_ep);
185 m_ee_py_ep=new TH1F("ee_py_ep","ee_py_ep",200,-2.2,2.2);
186 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_py_ep", m_ee_py_ep);
187 m_ee_pz_ep=new TH1F("ee_pz_ep","ee_pz_ep",200,-2.,2.5);
188 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_pz_ep", m_ee_pz_ep);
189 m_ee_p_ep=new TH1F("ee_p_ep","ee_p_ep",100, m_ecms/2.-0.8 , m_ecms/2.+0.5 );
190 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_p_ep", m_ee_p_ep);
191 m_ee_px_em=new TH1F("ee_px_em","ee_px_em",100,-2.2,2.2);
192 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_px_em", m_ee_px_em);
193 m_ee_py_em=new TH1F("ee_py_em","ee_py_em",100,-2.2,2.2);
194 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_py_em", m_ee_py_em);
195 m_ee_pz_em=new TH1F("ee_pz_em","ee_pz_em",100,-2.5,2.);
196 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_pz_em", m_ee_pz_em);
197 m_ee_p_em=new TH1F("ee_p_em","ee_p_em",100,m_ecms/2.-0.8,m_ecms/2.+0.5);
198 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_p_em", m_ee_p_em);
199 m_ee_deltatof=new TH1F("ee_deltatof","ee_deltatof",50,0.0,10.0);
200 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_deltatof", m_ee_deltatof);
201
202 m_ee_pidchidedx_ep=new TH1F("ee_pidchidedx_ep","ee_pidchidedx_ep",160,-4,4);
203 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_pidchidedx_ep", m_ee_pidchidedx_ep);
204 m_ee_pidchidedx_em=new TH1F("ee_pidchidedx_em","ee_pidchidedx_em",160,-4,4);
205 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_pidchidedx_em", m_ee_pidchidedx_em);
206 m_ee_pidchitof1_ep=new TH1F("ee_pidchitof1_ep","ee_pidchitof1_ep",160,-4,4);
207 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_pidchitof1_ep", m_ee_pidchitof1_ep);
208 m_ee_pidchitof1_em=new TH1F("ee_pidchitof1_em","ee_pidchitof1_em",160,-4,4);
209 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_pidchitof1_em", m_ee_pidchitof1_em);
210 m_ee_pidchitof2_ep=new TH1F("ee_pidchitof2_ep","ee_pidchitof2_ep",160,-4,4);
211 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_pidchitof2_ep", m_ee_pidchitof2_ep);
212 m_ee_pidchitof2_em=new TH1F("ee_pidchitof2_em","ee_pidchitof2_em",160,-4,4);
213 status = m_thistsvc->regHist("/DQAHist/Bhabha/ee_pidchitof2_em", m_ee_pidchitof2_em);
214
215
216
217 NTuplePtr nt1(
ntupleSvc(),
"DQAFILE/Bhabha");
218 if ( nt1 ) m_tuple1 = nt1;
219 else {
220 m_tuple1 =
ntupleSvc()->book (
"DQAFILE/Bhabha", CLID_ColumnWiseTuple,
"N-Tuple");
221 if ( m_tuple1 ) {
222 status = m_tuple1->addItem ("run", m_run);
223 status = m_tuple1->addItem ("rec", m_rec);
224 status = m_tuple1->addItem ("Nchrg", m_ncharg);
225 status = m_tuple1->addItem ("Nneu", m_nneu,0,40);
226 status = m_tuple1->addItem ("NGch", m_ngch, 0, 40);
227 status = m_tuple1->addItem ("NGam", m_nGam);
228
229
230 status = m_tuple1->addItem ("bhabhatag", m_bhabhatag);
231
232 status = m_tuple1->addItem ("acoll", m_acoll);
233 status = m_tuple1->addItem ("acopl", m_acopl);
234 status = m_tuple1->addItem ("deltatof", m_deltatof);
235 status = m_tuple1->addItem ("eop1", m_eop1);
236 status = m_tuple1->addItem ("eop2", m_eop2);
237 status = m_tuple1->addItem ("eoeb1", m_eoeb1);
238 status = m_tuple1->addItem ("eoeb2", m_eoeb2);
239 status = m_tuple1->addItem ("poeb1", m_poeb1);
240 status = m_tuple1->addItem ("poeb2", m_poeb2);
241 status = m_tuple1->addItem ("etoeb1", m_etoeb1);
242 status = m_tuple1->addItem ("etoeb2", m_etoeb2);
243 status = m_tuple1->addItem ("mucinfo1", m_mucinfo1);
244 status = m_tuple1->addItem ("mucinfo2", m_mucinfo2);
245
246
247
248 status = m_tuple1->addIndexedItem ("delang",m_nneu, m_delang);
249 status = m_tuple1->addIndexedItem ("delphi",m_nneu, m_delphi);
250 status = m_tuple1->addIndexedItem ("delthe",m_nneu, m_delthe);
251 status = m_tuple1->addIndexedItem ("npart",m_nneu, m_npart);
252 status = m_tuple1->addIndexedItem ("nemchits",m_nneu, m_nemchits);
253 status = m_tuple1->addIndexedItem ("module",m_nneu, m_module);
254 status = m_tuple1->addIndexedItem ("x",m_nneu, m_x);
255 status = m_tuple1->addIndexedItem ("y",m_nneu, m_y);
256 status = m_tuple1->addIndexedItem ("z",m_nneu, m_z);
257 status = m_tuple1->addIndexedItem ("px",m_nneu, m_px);
258 status = m_tuple1->addIndexedItem ("py",m_nneu, m_py);
259 status = m_tuple1->addIndexedItem ("pz",m_nneu, m_pz);
260 status = m_tuple1->addIndexedItem ("theta",m_nneu, m_theta);
261 status = m_tuple1->addIndexedItem ("phi",m_nneu, m_phi);
262 status = m_tuple1->addIndexedItem ("dx",m_nneu, m_dx);
263 status = m_tuple1->addIndexedItem ("dy",m_nneu, m_dy);
264 status = m_tuple1->addIndexedItem ("dz",m_nneu, m_dz);
265 status = m_tuple1->addIndexedItem ("dtheta",m_nneu, m_dtheta);
266 status = m_tuple1->addIndexedItem ("dphi",m_nneu, m_dphi);
267 status = m_tuple1->addIndexedItem ("energy",m_nneu, m_energy);
268 status = m_tuple1->addIndexedItem ("dE",m_nneu, m_dE);
269 status = m_tuple1->addIndexedItem ("eSeed",m_nneu, m_eSeed);
270 status = m_tuple1->addIndexedItem ("nSeed",m_nneu, m_nSeed);
271 status = m_tuple1->addIndexedItem ("e3x3",m_nneu, m_e3x3);
272 status = m_tuple1->addIndexedItem ("e5x5",m_nneu, m_e5x5);
273 status = m_tuple1->addIndexedItem ("secondMoment",m_nneu, m_secondMoment);
274 status = m_tuple1->addIndexedItem ("latMoment",m_nneu, m_latMoment);
275 status = m_tuple1->addIndexedItem ("a20Moment",m_nneu, m_a20Moment);
276 status = m_tuple1->addIndexedItem ("a42Moment",m_nneu, m_a42Moment);
277 status = m_tuple1->addIndexedItem ("getTime",m_nneu, m_getTime);
278 status = m_tuple1->addIndexedItem ("getEAll",m_nneu, m_getEAll);
279
280
281
282 status = m_tuple1->addIndexedItem("charge", m_ngch, m_charge);
283 status = m_tuple1->addIndexedItem ("vx", m_ngch, m_vx0);
284 status = m_tuple1->addIndexedItem ("vy", m_ngch, m_vy0);
285 status = m_tuple1->addIndexedItem ("vz", m_ngch, m_vz0);
286 status = m_tuple1->addIndexedItem ("r0", m_ngch, m_vr0);
287
288 status = m_tuple1->addIndexedItem ("px", m_ngch, m_px) ;
289 status = m_tuple1->addIndexedItem ("py", m_ngch, m_py) ;
290 status = m_tuple1->addIndexedItem ("pz", m_ngch, m_pz) ;
291 status = m_tuple1->addIndexedItem ("p", m_ngch, m_p) ;
292
293
294
295 status = m_tuple1->addIndexedItem ("kal_vx", m_ngch, m_kal_vx0);
296 status = m_tuple1->addIndexedItem ("kal_vy", m_ngch, m_kal_vy0);
297 status = m_tuple1->addIndexedItem ("kal_vz", m_ngch, m_kal_vz0);
298
299
300 status = m_tuple1->addIndexedItem ("kal_px", m_ngch, m_kal_px) ;
301 status = m_tuple1->addIndexedItem ("kal_py", m_ngch, m_kal_py) ;
302 status = m_tuple1->addIndexedItem ("kal_pz", m_ngch, m_kal_pz) ;
303 status = m_tuple1->addIndexedItem ("kal_p", m_ngch, m_kal_p) ;
304
305
306 status = m_tuple1->addIndexedItem ("probPH" , m_ngch, m_probPH) ;
307 status = m_tuple1->addIndexedItem ("normPH" , m_ngch, m_normPH) ;
308 status = m_tuple1->addIndexedItem ("chie" , m_ngch, m_chie) ;
309 status = m_tuple1->addIndexedItem ("chimu" , m_ngch, m_chimu) ;
310 status = m_tuple1->addIndexedItem ("chipi" , m_ngch, m_chipi) ;
311 status = m_tuple1->addIndexedItem ("chik" , m_ngch, m_chik) ;
312 status = m_tuple1->addIndexedItem ("chip" , m_ngch, m_chip) ;
313 status = m_tuple1->addIndexedItem ("ghit" , m_ngch, m_ghit) ;
314 status = m_tuple1->addIndexedItem ("thit" , m_ngch, m_thit) ;
315
316 status = m_tuple1->addIndexedItem ("e_emc" , m_ngch, m_e_emc) ;
317 status = m_tuple1->addIndexedItem ("phi_emc" , m_ngch, m_phi_emc) ;
318 status = m_tuple1->addIndexedItem ("theta_emc" , m_ngch, m_theta_emc) ;
319
320 status = m_tuple1->addIndexedItem ("nhit_muc" , m_ngch, m_nhit_muc) ;
321 status = m_tuple1->addIndexedItem ("nlay_muc" , m_ngch, m_nlay_muc) ;
322 status = m_tuple1->addIndexedItem ("t_btof" , m_ngch, m_t_btof );
323 status = m_tuple1->addIndexedItem ("t_etof" , m_ngch, m_t_etof );
324 status = m_tuple1->addIndexedItem ("qual_etof" , m_ngch, m_qual_etof );
325 status = m_tuple1->addIndexedItem ("tof_etof" , m_ngch, m_tof_etof );
326 status = m_tuple1->addIndexedItem ("te_etof" , m_ngch, m_te_etof );
327 status = m_tuple1->addIndexedItem ("tmu_etof" , m_ngch, m_tmu_etof );
328 status = m_tuple1->addIndexedItem ("tpi_etof" , m_ngch, m_tpi_etof );
329 status = m_tuple1->addIndexedItem ("tk_etof" , m_ngch, m_tk_etof );
330 status = m_tuple1->addIndexedItem ("tp_etof" , m_ngch, m_tp_etof );
331
332 status = m_tuple1->addIndexedItem ("qual_btof1", m_ngch, m_qual_btof1 );
333 status = m_tuple1->addIndexedItem ("tof_btof1" , m_ngch, m_tof_btof1 );
334 status = m_tuple1->addIndexedItem ("te_btof1" , m_ngch, m_te_btof1 );
335 status = m_tuple1->addIndexedItem ("tmu_btof1" , m_ngch, m_tmu_btof1 );
336 status = m_tuple1->addIndexedItem ("tpi_btof1" , m_ngch, m_tpi_btof1 );
337 status = m_tuple1->addIndexedItem ("tk_btof1" , m_ngch, m_tk_btof1 );
338 status = m_tuple1->addIndexedItem ("tp_btof1" , m_ngch, m_tp_btof1 );
339
340 status = m_tuple1->addIndexedItem ("qual_btof2", m_ngch, m_qual_btof2 );
341 status = m_tuple1->addIndexedItem ("tof_btof2" , m_ngch, m_tof_btof2 );
342 status = m_tuple1->addIndexedItem ("te_btof2" , m_ngch, m_te_btof2 );
343 status = m_tuple1->addIndexedItem ("tmu_btof2" , m_ngch, m_tmu_btof2 );
344 status = m_tuple1->addIndexedItem ("tpi_btof2" , m_ngch, m_tpi_btof2 );
345 status = m_tuple1->addIndexedItem ("tk_btof2" , m_ngch, m_tk_btof2 );
346 status = m_tuple1->addIndexedItem ("tp_btof2" , m_ngch, m_tp_btof2 );
347 status = m_tuple1->addIndexedItem ("pidcode" , m_ngch, m_pidcode);
348 status = m_tuple1->addIndexedItem ("pidprob" , m_ngch, m_pidprob);
349 status = m_tuple1->addIndexedItem ("pidchiDedx" , m_ngch, m_pidchiDedx);
350 status = m_tuple1->addIndexedItem ("pidchiTof1" , m_ngch, m_pidchiTof1);
351 status = m_tuple1->addIndexedItem ("pidchiTof2" , m_ngch, m_pidchiTof2);
352
353
354 status = m_tuple1->addItem ("dedx_GoodHits_ep" , m_dedx_goodhits_ep);
355 status = m_tuple1->addItem ("dedx_chi_ep" , m_dedx_chiep);
356 status = m_tuple1->addItem ("dedx_GoodHits_em" , m_dedx_goodhits_em);
357 status = m_tuple1->addItem ("dedx_chi_em" , m_dedx_chiem);
358
359 status = m_tuple1->addItem ("px_cms_ep", m_px_cms_ep);
360 status = m_tuple1->addItem ("py_cms_ep", m_py_cms_ep);
361 status = m_tuple1->addItem ("pz_cms_ep", m_pz_cms_ep);
362 status = m_tuple1->addItem ("e_cms_ep", m_e_cms_ep);
363 status = m_tuple1->addItem ("p_cms_ep", m_p_cms_ep);
364
365 status = m_tuple1->addItem ("cos_ep", m_cos_ep);
366 status = m_tuple1->addItem ("kal_p_ep", m_kal_p_ep);
367 status = m_tuple1->addItem ("kal_px_ep", m_kal_px_ep);
368 status = m_tuple1->addItem ("kal_py_ep", m_kal_py_ep);
369 status = m_tuple1->addItem ("kal_pz_ep", m_kal_pz_ep);
370
371 status = m_tuple1->addItem ("px_cms_em", m_px_cms_em);
372 status = m_tuple1->addItem ("py_cms_em", m_py_cms_em);
373 status = m_tuple1->addItem ("pz_cms_em", m_pz_cms_em);
374 status = m_tuple1->addItem ("e_cms_em", m_e_cms_em);
375 status = m_tuple1->addItem ("p_cms_em", m_p_cms_em);
376
377 status = m_tuple1->addItem ("cos_em", m_cos_em);
378 status = m_tuple1->addItem ("kal_p_em", m_kal_p_em);
379 status = m_tuple1->addItem ("kal_px_em", m_kal_px_em);
380 status = m_tuple1->addItem ("kal_py_em", m_kal_py_em);
381 status = m_tuple1->addItem ("kal_pz_em", m_kal_pz_em);
382
383 status = m_tuple1->addItem ("mass_ee", m_mass_ee);
384 status = m_tuple1->addItem ("px_ee", m_px_ee);
385 status = m_tuple1->addItem ("py_ee", m_py_ee);
386 status = m_tuple1->addItem ("pz_ee", m_pz_ee);
387 status = m_tuple1->addItem ("e_ee", m_e_ee);
388 status = m_tuple1->addItem ("p_ee", m_p_ee);
389
390 status = m_tuple1->addItem ( "nep", m_nep );
391 status = m_tuple1->addItem ( "nem", m_nem );
392
393
394 }
395 else {
396 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple1) << endmsg;
397 return StatusCode::FAILURE;
398 }
399 }
400
401
402
403
404
405 log << MSG::INFO << "successfully return from initialize()" <<endmsg;
406 return StatusCode::SUCCESS;
407
408}