85 {
86 MsgStream log(
msgSvc(), name());
87
88 log << MSG::INFO << "in initialize()" << endmsg;
89
90 StatusCode status;
91
92 status = service("THistSvc", m_thistsvc);
93 if(status.isFailure() ){
94 log << MSG::INFO << "Unable to retrieve pointer to THistSvc" << endreq;
95 return status;
96 }
97
98 if(m_tagPPbar){
99
100 m_pp_mass = new TH1F( "pp_mass", "pp_mass", 100,3.0,3.2 );
101 status = m_thistsvc->regHist("/VAL/PHY/pp_mass", m_pp_mass);
102 m_pp_angle = new TH1F( "pp_angle", "pp_angle", 100, 170, 180 );
103 status = m_thistsvc->regHist("/VAL/PHY/pp_angle", m_pp_angle);
104 m_pp_deltatof = new TH1F( "pp_deltatof", "pp_deltatof", 100, 0, 10 );
105 status = m_thistsvc->regHist("/VAL/PHY/pp_deltatof", m_pp_deltatof);
106
107 m_pp_x_pp = new TH1F( "pp_x_pp", "pp_x_pp", 100, -0.5, 0.5);
108 status = m_thistsvc->regHist("/VAL/PHY/pp_x_pp", m_pp_x_pp);
109 m_pp_y_pp = new TH1F( "pp_y_pp", "pp_y_pp", 100, -0.5, 0.5);
110 status = m_thistsvc->regHist("/VAL/PHY/pp_y_pp", m_pp_y_pp);
111 m_pp_z_pp = new TH1F( "pp_z_pp", "pp_z_pp", 100, -10.0, 10.);
112 status = m_thistsvc->regHist("/VAL/PHY/pp_z_pp", m_pp_z_pp);
113 m_pp_r_pp = new TH1F( "pp_r_pp", "pp_r_pp", 100, 0.0, 0.5);
114 status = m_thistsvc->regHist("/VAL/PHY/pp_r_pp", m_pp_r_pp);
115 m_pp_px_pp = new TH1F( "pp_px_pp", "pp_px_pp", 100, -1.5, 1.5);
116 status = m_thistsvc->regHist("/VAL/PHY/pp_px_pp", m_pp_px_pp);
117 m_pp_py_pp = new TH1F( "pp_py_pp", "pp_py_pp", 100, -1.5, 1.5);
118 status = m_thistsvc->regHist("/VAL/PHY/pp_py_pp", m_pp_py_pp);
119 m_pp_pz_pp = new TH1F( "pp_pz_pp", "pp_pz_pp", 100, -1.5, 1.5);
120 status = m_thistsvc->regHist("/VAL/PHY/pp_pz_pp", m_pp_pz_pp);
121 m_pp_p_pp = new TH1F( "pp_p_pp", "pp_p_pp", 100, 1.15, 1.35);
122 status = m_thistsvc->regHist("/VAL/PHY/pp_p_pp", m_pp_p_pp);
123 m_pp_cos_pp = new TH1F( "pp_cos_pp", "pp_cos_pp", 100, -1.0,1.0);
124 status = m_thistsvc->regHist("/VAL/PHY/pp_cos_pp", m_pp_cos_pp);
125 m_pp_emc_pp = new TH1F( "pp_emc_pp", "pp_emc_pp", 100, 0.0, 2.0);
126 status = m_thistsvc->regHist("/VAL/PHY/pp_emc_pp", m_pp_emc_pp);
127 m_pp_pidchidedx_pp = new TH1F( "pp_pidchidedx_pp", "pp_pidchidedx_pp", 100, -10.0, 10.0);
128 status = m_thistsvc->regHist("/VAL/PHY/pp_pidchidedx_pp", m_pp_pidchidedx_pp);
129 m_pp_pidchitof1_pp = new TH1F( "pp_pidchitof1_pp", "pp_pidchitof1_pp", 100, -10.0, 10.0);
130 status = m_thistsvc->regHist("/VAL/PHY/pp_pidchitof1_pp", m_pp_pidchitof1_pp);
131 m_pp_pidchitof2_pp = new TH1F( "pp_pidchitof2_pp", "pp_pidchitof2_pp", 100, -10.0, 10.0);
132 status = m_thistsvc->regHist("/VAL/PHY/pp_pidchitof2_pp", m_pp_pidchitof2_pp);
133
134 m_pp_x_pb = new TH1F( "pp_x_pb", "pp_x_pb", 100, -0.5, 0.5);
135 status = m_thistsvc->regHist("/VAL/PHY/pp_x_pb", m_pp_x_pb);
136 m_pp_y_pb = new TH1F( "pp_y_pb", "pp_y_pb", 100, -0.5, 0.5);
137 status = m_thistsvc->regHist("/VAL/PHY/pp_y_pb", m_pp_y_pb);
138 m_pp_z_pb = new TH1F( "pp_z_pb", "pp_z_pb", 100, -10.0, 10.);
139 status = m_thistsvc->regHist("/VAL/PHY/pp_z_pb", m_pp_z_pb);
140 m_pp_r_pb = new TH1F( "pp_r_pb", "pp_r_pb", 100, 0.0, 0.5);
141 status = m_thistsvc->regHist("/VAL/PHY/pp_r_pb", m_pp_r_pb);
142 m_pp_px_pb = new TH1F( "pp_px_pb", "pp_px_pb", 100, -1.5, 1.5);
143 status = m_thistsvc->regHist("/VAL/PHY/pp_px_pb", m_pp_px_pb);
144 m_pp_py_pb = new TH1F( "pp_py_pb", "pp_py_pb", 100, -1.5, 1.5);
145 status = m_thistsvc->regHist("/VAL/PHY/pp_py_pb", m_pp_py_pb);
146 m_pp_pz_pb = new TH1F( "pp_pz_pb", "pp_pz_pb", 100, -1.5, 1.5);
147 status = m_thistsvc->regHist("/VAL/PHY/pp_pz_pb", m_pp_pz_pb);
148 m_pp_p_pb = new TH1F( "pp_p_pb", "pp_p_pb", 100, 1.15, 1.35);
149 status = m_thistsvc->regHist("/VAL/PHY/pp_p_pb", m_pp_p_pb);
150 m_pp_cos_pb = new TH1F( "pp_cos_pb", "pp_cos_pb", 100, -1.0,1.0);
151 status = m_thistsvc->regHist("/VAL/PHY/pp_cos_pb", m_pp_cos_pb);
152 m_pp_emc_pb = new TH1F( "pp_emc_pb", "pp_emc_pb", 100, 0.0, 2.0);
153 status = m_thistsvc->regHist("/VAL/PHY/pp_emc_pb", m_pp_emc_pb);
154 m_pp_pidchidedx_pb = new TH1F( "pp_pidchidedx_pb", "pp_pidchidedx_pb", 100, -10.0, 10.0);
155 status = m_thistsvc->regHist("/VAL/PHY/pp_pidchidedx_pb", m_pp_pidchidedx_pb);
156 m_pp_pidchitof1_pb = new TH1F( "pp_pidchitof1_pb", "pp_pidchitof1_pb", 100, -10.0, 10.0);
157 status = m_thistsvc->regHist("/VAL/PHY/pp_pidchitof1_pb", m_pp_pidchitof1_pb);
158 m_pp_pidchitof2_pb = new TH1F( "pp_pidchitof2_pb", "pp_pidchitof2_pb", 100, -10.0, 10.0);
159 status = m_thistsvc->regHist("/VAL/PHY/pp_pidchitof2_pb", m_pp_pidchitof2_pb);
160 }
161
162
163 NTuplePtr nt1(
ntupleSvc(),
"FILE1/testv");
164 if ( nt1 ) m_tuple1 = nt1;
165 else {
166 m_tuple1 =
ntupleSvc()->book (
"FILE1/testv", CLID_ColumnWiseTuple,
"N-Tuple");
167 if ( m_tuple1 ) {
168 status = m_tuple1->addItem ("irun", m_run);
169 status = m_tuple1->addItem ("ievent", m_event);
170 status = m_tuple1->addItem ("Nchrg", m_nchrg);
171 status = m_tuple1->addItem ("Nneu", m_nneu);
172 status = m_tuple1->addItem ("NGch", m_ngch, 0, 10);
173
174 status = m_tuple1->addIndexedItem ("charge",m_ngch, m_charge);
175 status = m_tuple1->addIndexedItem ("vx", m_ngch, m_vx0);
176 status = m_tuple1->addIndexedItem ("vy", m_ngch, m_vy0);
177 status = m_tuple1->addIndexedItem ("vz", m_ngch, m_vz0);
178 status = m_tuple1->addIndexedItem ("vr", m_ngch, m_vr0);
179 status = m_tuple1->addIndexedItem ("px", m_ngch, m_px) ;
180 status = m_tuple1->addIndexedItem ("py", m_ngch, m_py) ;
181 status = m_tuple1->addIndexedItem ("pz", m_ngch, m_pz) ;
182 status = m_tuple1->addIndexedItem ("p", m_ngch, m_p) ;
183 status = m_tuple1->addIndexedItem ("cos", m_ngch, m_cos);
184
185 status = m_tuple1->addIndexedItem ("bst_px", m_ngch, m_bst_px) ;
186 status = m_tuple1->addIndexedItem ("bst_py", m_ngch, m_bst_py) ;
187 status = m_tuple1->addIndexedItem ("bst_pz", m_ngch, m_bst_pz) ;
188 status = m_tuple1->addIndexedItem ("bst_p", m_ngch, m_bst_p) ;
189 status = m_tuple1->addIndexedItem ("bst_cos", m_ngch, m_bst_cos);
190
191 status = m_tuple1->addIndexedItem ("kal_vx", m_ngch, m_kal_vx0);
192 status = m_tuple1->addIndexedItem ("kal_vy", m_ngch, m_kal_vy0);
193 status = m_tuple1->addIndexedItem ("kal_vz", m_ngch, m_kal_vz0);
194 status = m_tuple1->addIndexedItem ("kal_vr", m_ngch, m_kal_vr0);
195
196 status = m_tuple1->addIndexedItem ("kal_px", m_ngch, m_kal_px) ;
197 status = m_tuple1->addIndexedItem ("kal_py", m_ngch, m_kal_py) ;
198 status = m_tuple1->addIndexedItem ("kal_pz", m_ngch, m_kal_pz) ;
199 status = m_tuple1->addIndexedItem ("kal_p", m_ngch, m_kal_p) ;
200 status = m_tuple1->addIndexedItem ("kal_cos", m_ngch, m_kal_cos);
201
202 status = m_tuple1->addIndexedItem ("bst_kal_px", m_ngch, m_bst_kal_px) ;
203 status = m_tuple1->addIndexedItem ("bst_kal_py", m_ngch, m_bst_kal_py) ;
204 status = m_tuple1->addIndexedItem ("bst_kal_pz", m_ngch, m_bst_kal_pz) ;
205 status = m_tuple1->addIndexedItem ("bst_kal_p", m_ngch, m_bst_kal_p) ;
206 status = m_tuple1->addIndexedItem ("bst_kal_cos", m_ngch, m_bst_kal_cos);
207
208 status = m_tuple1->addIndexedItem ("vtx_px", m_ngch, m_vtx_px) ;
209 status = m_tuple1->addIndexedItem ("vtx_py", m_ngch, m_vtx_py) ;
210 status = m_tuple1->addIndexedItem ("vtx_pz", m_ngch, m_vtx_pz) ;
211 status = m_tuple1->addIndexedItem ("vtx_p", m_ngch, m_vtx_p) ;
212 status = m_tuple1->addIndexedItem ("vtx_cos", m_ngch, m_vtx_cos);
213
214 status = m_tuple1->addIndexedItem ("chie" , m_ngch, m_chie) ;
215 status = m_tuple1->addIndexedItem ("chimu" , m_ngch, m_chimu) ;
216 status = m_tuple1->addIndexedItem ("chipi" , m_ngch, m_chipi) ;
217 status = m_tuple1->addIndexedItem ("chik" , m_ngch, m_chik) ;
218 status = m_tuple1->addIndexedItem ("chip" , m_ngch, m_chip) ;
219 status = m_tuple1->addIndexedItem ("ghit" , m_ngch, m_ghit) ;
220 status = m_tuple1->addIndexedItem ("thit" , m_ngch, m_thit) ;
221 status = m_tuple1->addIndexedItem ("probPH" , m_ngch, m_probPH) ;
222 status = m_tuple1->addIndexedItem ("normPH" , m_ngch, m_normPH) ;
223
224 status = m_tuple1->addIndexedItem ("e_emc" , m_ngch, m_e_emc) ;
225
226
227 status = m_tuple1->addIndexedItem ("clus_tof" , m_ngch, m_clus_tof );
228 status = m_tuple1->addIndexedItem ("clus_texp_e" , m_ngch, m_clus_texp_e );
229 status = m_tuple1->addIndexedItem ("clus_texp_mu", m_ngch, m_clus_texp_mu );
230 status = m_tuple1->addIndexedItem ("clus_texp_pi", m_ngch, m_clus_texp_pi );
231 status = m_tuple1->addIndexedItem ("clus_texp_k" , m_ngch, m_clus_texp_k );
232 status = m_tuple1->addIndexedItem ("clus_texp_p" , m_ngch, m_clus_texp_p );
233 status = m_tuple1->addIndexedItem ("clus_toff_e" , m_ngch, m_clus_toff_e );
234 status = m_tuple1->addIndexedItem ("clus_toff_mu", m_ngch, m_clus_toff_mu );
235 status = m_tuple1->addIndexedItem ("clus_toff_pi", m_ngch, m_clus_toff_pi );
236 status = m_tuple1->addIndexedItem ("clus_toff_k" , m_ngch, m_clus_toff_k );
237 status = m_tuple1->addIndexedItem ("clus_toff_p" , m_ngch, m_clus_toff_p );
238 status = m_tuple1->addIndexedItem ("clus_tsig_e" , m_ngch, m_clus_tsig_e );
239 status = m_tuple1->addIndexedItem ("clus_tsig_mu", m_ngch, m_clus_tsig_mu );
240 status = m_tuple1->addIndexedItem ("clus_tsig_pi", m_ngch, m_clus_tsig_pi );
241 status = m_tuple1->addIndexedItem ("clus_tsig_k" , m_ngch, m_clus_tsig_k );
242 status = m_tuple1->addIndexedItem ("clus_tsig_p" , m_ngch, m_clus_tsig_p );
243 status = m_tuple1->addIndexedItem ("clus_path" , m_ngch, m_clus_path );
244 status = m_tuple1->addIndexedItem ("clus_zrhit" , m_ngch, m_clus_zrhit );
245 status = m_tuple1->addIndexedItem ("clus_ph" , m_ngch, m_clus_ph );
246 status = m_tuple1->addIndexedItem ("clus_beta" , m_ngch, m_clus_beta );
247 status = m_tuple1->addIndexedItem ("clus_qual" , m_ngch, m_clus_qual );
248 status = m_tuple1->addIndexedItem ("clus_t0" , m_ngch, m_clus_t0 );
249
250 status = m_tuple1->addIndexedItem ("cntr_etof" , m_ngch, m_cntr_etof );
251 status = m_tuple1->addIndexedItem ("ptot_etof" , m_ngch, m_ptot_etof );
252 status = m_tuple1->addIndexedItem ("ph_etof" , m_ngch, m_ph_etof );
253 status = m_tuple1->addIndexedItem ("rhit_etof" , m_ngch, m_rhit_etof );
254 status = m_tuple1->addIndexedItem ("qual_etof" , m_ngch, m_qual_etof );
255 status = m_tuple1->addIndexedItem ("tof_etof" , m_ngch, m_tof_etof );
256 status = m_tuple1->addIndexedItem ("te_etof" , m_ngch, m_te_etof );
257 status = m_tuple1->addIndexedItem ("tmu_etof" , m_ngch, m_tmu_etof );
258 status = m_tuple1->addIndexedItem ("tpi_etof" , m_ngch, m_tpi_etof );
259 status = m_tuple1->addIndexedItem ("tk_etof" , m_ngch, m_tk_etof );
260 status = m_tuple1->addIndexedItem ("tp_etof" , m_ngch, m_tp_etof );
261
262 status = m_tuple1->addIndexedItem ("cntr_btof1", m_ngch, m_cntr_btof1 );
263 status = m_tuple1->addIndexedItem ("ptot_btof1", m_ngch, m_ptot_btof1 );
264 status = m_tuple1->addIndexedItem ("ph_btof1" , m_ngch, m_ph_btof1 );
265 status = m_tuple1->addIndexedItem ("zhit_btof1", m_ngch, m_zhit_btof1 );
266 status = m_tuple1->addIndexedItem ("qual_btof1", m_ngch, m_qual_btof1 );
267 status = m_tuple1->addIndexedItem ("tof_btof1" , m_ngch, m_tof_btof1 );
268 status = m_tuple1->addIndexedItem ("te_btof1" , m_ngch, m_te_btof1 );
269 status = m_tuple1->addIndexedItem ("tmu_btof1" , m_ngch, m_tmu_btof1 );
270 status = m_tuple1->addIndexedItem ("tpi_btof1" , m_ngch, m_tpi_btof1 );
271 status = m_tuple1->addIndexedItem ("tk_btof1" , m_ngch, m_tk_btof1 );
272 status = m_tuple1->addIndexedItem ("tp_btof1" , m_ngch, m_tp_btof1 );
273
274 status = m_tuple1->addIndexedItem ("cntr_btof2", m_ngch, m_cntr_btof2 );
275 status = m_tuple1->addIndexedItem ("ptot_btof2", m_ngch, m_ptot_btof2 );
276 status = m_tuple1->addIndexedItem ("ph_btof2" , m_ngch, m_ph_btof2 );
277 status = m_tuple1->addIndexedItem ("zhit_btof2", m_ngch, m_zhit_btof2 );
278 status = m_tuple1->addIndexedItem ("qual_btof2", m_ngch, m_qual_btof2 );
279 status = m_tuple1->addIndexedItem ("tof_btof2" , m_ngch, m_tof_btof2 );
280 status = m_tuple1->addIndexedItem ("te_btof2" , m_ngch, m_te_btof2 );
281 status = m_tuple1->addIndexedItem ("tmu_btof2" , m_ngch, m_tmu_btof2 );
282 status = m_tuple1->addIndexedItem ("tpi_btof2" , m_ngch, m_tpi_btof2 );
283 status = m_tuple1->addIndexedItem ("tk_btof2" , m_ngch, m_tk_btof2 );
284 status = m_tuple1->addIndexedItem ("tp_btof2" , m_ngch, m_tp_btof2 );
285
286 status = m_tuple1->addIndexedItem ("m_ptrk_pid", m_ngch, m_ptrk_pid);
287 status = m_tuple1->addIndexedItem ("m_cost_pid", m_ngch, m_cost_pid);
288 status = m_tuple1->addIndexedItem ("m_dedx_pid", m_ngch, m_dedx_pid);
289 status = m_tuple1->addIndexedItem ("m_tof1_pid", m_ngch, m_tof1_pid);
290 status = m_tuple1->addIndexedItem ("m_tof2_pid", m_ngch, m_tof2_pid);
291 status = m_tuple1->addIndexedItem ("m_prob_pi", m_ngch, m_prob_pi );
292 status = m_tuple1->addIndexedItem ("m_prob_k", m_ngch, m_prob_k );
293 status = m_tuple1->addIndexedItem ("m_prob_p", m_ngch, m_prob_p );
294
295
296 status = m_tuple1->addItem ( "np", m_np );
297 status = m_tuple1->addItem ( "npb", m_npb );
298
299
300 status = m_tuple1->addItem ( "m2p", m_m2p );
301 status = m_tuple1->addItem ( "angle", m_angle );
302 status = m_tuple1->addItem ( "deltatof", m_deltatof );
303
304 status = m_tuple1->addItem ( "kal_m2p", m_kal_m2p );
305 status = m_tuple1->addItem ( "kal_angle", m_kal_angle );
306
307 status = m_tuple1->addItem ( "vtx_m2p", m_vtx_m2p );
308 status = m_tuple1->addItem ( "vtx_angle", m_vtx_angle );
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332 }
333 else {
334 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple1) << endmsg;
335 return StatusCode::FAILURE;
336 }
337 }
338
339
340
341
342
343 log << MSG::INFO << "successfully return from initialize()" <<endmsg;
344 return StatusCode::SUCCESS;
345
346}