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