82 {
83 MsgStream log(
msgSvc(), name() );
84
85 log << MSG::INFO << "in initialize()" << endmsg;
86
87 StatusCode status;
88
89 status = service( "THistSvc", m_thistsvc );
90 if ( status.isFailure() )
91 {
92 log << MSG::INFO << "Unable to retrieve pointer to THistSvc" << endmsg;
93 return status;
94 }
95
96 if ( m_tagPPbar )
97 {
98
99 m_pp_mass = new TH1F( "pp_mass", "pp_mass", 100, 3.0, 3.2 );
100 status = m_thistsvc->regHist( "/VAL/PHY/pp_mass", m_pp_mass );
101 m_pp_angle = new TH1F( "pp_angle", "pp_angle", 100, 170, 180 );
102 status = m_thistsvc->regHist( "/VAL/PHY/pp_angle", m_pp_angle );
103 m_pp_deltatof = new TH1F( "pp_deltatof", "pp_deltatof", 100, 0, 10 );
104 status = m_thistsvc->regHist( "/VAL/PHY/pp_deltatof", m_pp_deltatof );
105
106 m_pp_x_pp = new TH1F( "pp_x_pp", "pp_x_pp", 100, -0.5, 0.5 );
107 status = m_thistsvc->regHist( "/VAL/PHY/pp_x_pp", m_pp_x_pp );
108 m_pp_y_pp = new TH1F( "pp_y_pp", "pp_y_pp", 100, -0.5, 0.5 );
109 status = m_thistsvc->regHist( "/VAL/PHY/pp_y_pp", m_pp_y_pp );
110 m_pp_z_pp = new TH1F( "pp_z_pp", "pp_z_pp", 100, -10.0, 10. );
111 status = m_thistsvc->regHist( "/VAL/PHY/pp_z_pp", m_pp_z_pp );
112 m_pp_r_pp = new TH1F( "pp_r_pp", "pp_r_pp", 100, 0.0, 0.5 );
113 status = m_thistsvc->regHist( "/VAL/PHY/pp_r_pp", m_pp_r_pp );
114 m_pp_px_pp = new TH1F( "pp_px_pp", "pp_px_pp", 100, -1.5, 1.5 );
115 status = m_thistsvc->regHist( "/VAL/PHY/pp_px_pp", m_pp_px_pp );
116 m_pp_py_pp = new TH1F( "pp_py_pp", "pp_py_pp", 100, -1.5, 1.5 );
117 status = m_thistsvc->regHist( "/VAL/PHY/pp_py_pp", m_pp_py_pp );
118 m_pp_pz_pp = new TH1F( "pp_pz_pp", "pp_pz_pp", 100, -1.5, 1.5 );
119 status = m_thistsvc->regHist( "/VAL/PHY/pp_pz_pp", m_pp_pz_pp );
120 m_pp_p_pp = new TH1F( "pp_p_pp", "pp_p_pp", 100, 1.15, 1.35 );
121 status = m_thistsvc->regHist( "/VAL/PHY/pp_p_pp", m_pp_p_pp );
122 m_pp_cos_pp = new TH1F( "pp_cos_pp", "pp_cos_pp", 100, -1.0, 1.0 );
123 status = m_thistsvc->regHist( "/VAL/PHY/pp_cos_pp", m_pp_cos_pp );
124 m_pp_emc_pp = new TH1F( "pp_emc_pp", "pp_emc_pp", 100, 0.0, 2.0 );
125 status = m_thistsvc->regHist( "/VAL/PHY/pp_emc_pp", m_pp_emc_pp );
126 m_pp_pidchidedx_pp = new TH1F( "pp_pidchidedx_pp", "pp_pidchidedx_pp", 100, -10.0, 10.0 );
127 status = m_thistsvc->regHist( "/VAL/PHY/pp_pidchidedx_pp", m_pp_pidchidedx_pp );
128 m_pp_pidchitof1_pp = new TH1F( "pp_pidchitof1_pp", "pp_pidchitof1_pp", 100, -10.0, 10.0 );
129 status = m_thistsvc->regHist( "/VAL/PHY/pp_pidchitof1_pp", m_pp_pidchitof1_pp );
130 m_pp_pidchitof2_pp = new TH1F( "pp_pidchitof2_pp", "pp_pidchitof2_pp", 100, -10.0, 10.0 );
131 status = m_thistsvc->regHist( "/VAL/PHY/pp_pidchitof2_pp", m_pp_pidchitof2_pp );
132
133 m_pp_x_pb = new TH1F( "pp_x_pb", "pp_x_pb", 100, -0.5, 0.5 );
134 status = m_thistsvc->regHist( "/VAL/PHY/pp_x_pb", m_pp_x_pb );
135 m_pp_y_pb = new TH1F( "pp_y_pb", "pp_y_pb", 100, -0.5, 0.5 );
136 status = m_thistsvc->regHist( "/VAL/PHY/pp_y_pb", m_pp_y_pb );
137 m_pp_z_pb = new TH1F( "pp_z_pb", "pp_z_pb", 100, -10.0, 10. );
138 status = m_thistsvc->regHist( "/VAL/PHY/pp_z_pb", m_pp_z_pb );
139 m_pp_r_pb = new TH1F( "pp_r_pb", "pp_r_pb", 100, 0.0, 0.5 );
140 status = m_thistsvc->regHist( "/VAL/PHY/pp_r_pb", m_pp_r_pb );
141 m_pp_px_pb = new TH1F( "pp_px_pb", "pp_px_pb", 100, -1.5, 1.5 );
142 status = m_thistsvc->regHist( "/VAL/PHY/pp_px_pb", m_pp_px_pb );
143 m_pp_py_pb = new TH1F( "pp_py_pb", "pp_py_pb", 100, -1.5, 1.5 );
144 status = m_thistsvc->regHist( "/VAL/PHY/pp_py_pb", m_pp_py_pb );
145 m_pp_pz_pb = new TH1F( "pp_pz_pb", "pp_pz_pb", 100, -1.5, 1.5 );
146 status = m_thistsvc->regHist( "/VAL/PHY/pp_pz_pb", m_pp_pz_pb );
147 m_pp_p_pb = new TH1F( "pp_p_pb", "pp_p_pb", 100, 1.15, 1.35 );
148 status = m_thistsvc->regHist( "/VAL/PHY/pp_p_pb", m_pp_p_pb );
149 m_pp_cos_pb = new TH1F( "pp_cos_pb", "pp_cos_pb", 100, -1.0, 1.0 );
150 status = m_thistsvc->regHist( "/VAL/PHY/pp_cos_pb", m_pp_cos_pb );
151 m_pp_emc_pb = new TH1F( "pp_emc_pb", "pp_emc_pb", 100, 0.0, 2.0 );
152 status = m_thistsvc->regHist( "/VAL/PHY/pp_emc_pb", m_pp_emc_pb );
153 m_pp_pidchidedx_pb = new TH1F( "pp_pidchidedx_pb", "pp_pidchidedx_pb", 100, -10.0, 10.0 );
154 status = m_thistsvc->regHist( "/VAL/PHY/pp_pidchidedx_pb", m_pp_pidchidedx_pb );
155 m_pp_pidchitof1_pb = new TH1F( "pp_pidchitof1_pb", "pp_pidchitof1_pb", 100, -10.0, 10.0 );
156 status = m_thistsvc->regHist( "/VAL/PHY/pp_pidchitof1_pb", m_pp_pidchitof1_pb );
157 m_pp_pidchitof2_pb = new TH1F( "pp_pidchitof2_pb", "pp_pidchitof2_pb", 100, -10.0, 10.0 );
158 status = m_thistsvc->regHist( "/VAL/PHY/pp_pidchitof2_pb", m_pp_pidchitof2_pb );
159 }
160
161 NTuplePtr nt1(
ntupleSvc(),
"FILE1/testv" );
162 if ( nt1 ) m_tuple1 = nt1;
163 else
164 {
165 m_tuple1 =
ntupleSvc()->book(
"FILE1/testv", CLID_ColumnWiseTuple,
"N-Tuple" );
166 if ( m_tuple1 )
167 {
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 status = m_tuple1->addIndexedItem( "clus_tof", m_ngch, m_clus_tof );
227 status = m_tuple1->addIndexedItem( "clus_texp_e", m_ngch, m_clus_texp_e );
228 status = m_tuple1->addIndexedItem( "clus_texp_mu", m_ngch, m_clus_texp_mu );
229 status = m_tuple1->addIndexedItem( "clus_texp_pi", m_ngch, m_clus_texp_pi );
230 status = m_tuple1->addIndexedItem( "clus_texp_k", m_ngch, m_clus_texp_k );
231 status = m_tuple1->addIndexedItem( "clus_texp_p", m_ngch, m_clus_texp_p );
232 status = m_tuple1->addIndexedItem( "clus_toff_e", m_ngch, m_clus_toff_e );
233 status = m_tuple1->addIndexedItem( "clus_toff_mu", m_ngch, m_clus_toff_mu );
234 status = m_tuple1->addIndexedItem( "clus_toff_pi", m_ngch, m_clus_toff_pi );
235 status = m_tuple1->addIndexedItem( "clus_toff_k", m_ngch, m_clus_toff_k );
236 status = m_tuple1->addIndexedItem( "clus_toff_p", m_ngch, m_clus_toff_p );
237 status = m_tuple1->addIndexedItem( "clus_tsig_e", m_ngch, m_clus_tsig_e );
238 status = m_tuple1->addIndexedItem( "clus_tsig_mu", m_ngch, m_clus_tsig_mu );
239 status = m_tuple1->addIndexedItem( "clus_tsig_pi", m_ngch, m_clus_tsig_pi );
240 status = m_tuple1->addIndexedItem( "clus_tsig_k", m_ngch, m_clus_tsig_k );
241 status = m_tuple1->addIndexedItem( "clus_tsig_p", m_ngch, m_clus_tsig_p );
242 status = m_tuple1->addIndexedItem( "clus_path", m_ngch, m_clus_path );
243 status = m_tuple1->addIndexedItem( "clus_zrhit", m_ngch, m_clus_zrhit );
244 status = m_tuple1->addIndexedItem( "clus_ph", m_ngch, m_clus_ph );
245 status = m_tuple1->addIndexedItem( "clus_beta", m_ngch, m_clus_beta );
246 status = m_tuple1->addIndexedItem( "clus_qual", m_ngch, m_clus_qual );
247 status = m_tuple1->addIndexedItem( "clus_t0", m_ngch, m_clus_t0 );
248
249 status = m_tuple1->addIndexedItem( "cntr_etof", m_ngch, m_cntr_etof );
250 status = m_tuple1->addIndexedItem( "ptot_etof", m_ngch, m_ptot_etof );
251 status = m_tuple1->addIndexedItem( "ph_etof", m_ngch, m_ph_etof );
252 status = m_tuple1->addIndexedItem( "rhit_etof", m_ngch, m_rhit_etof );
253 status = m_tuple1->addIndexedItem( "qual_etof", m_ngch, m_qual_etof );
254 status = m_tuple1->addIndexedItem( "tof_etof", m_ngch, m_tof_etof );
255 status = m_tuple1->addIndexedItem( "te_etof", m_ngch, m_te_etof );
256 status = m_tuple1->addIndexedItem( "tmu_etof", m_ngch, m_tmu_etof );
257 status = m_tuple1->addIndexedItem( "tpi_etof", m_ngch, m_tpi_etof );
258 status = m_tuple1->addIndexedItem( "tk_etof", m_ngch, m_tk_etof );
259 status = m_tuple1->addIndexedItem( "tp_etof", m_ngch, m_tp_etof );
260
261 status = m_tuple1->addIndexedItem( "cntr_btof1", m_ngch, m_cntr_btof1 );
262 status = m_tuple1->addIndexedItem( "ptot_btof1", m_ngch, m_ptot_btof1 );
263 status = m_tuple1->addIndexedItem( "ph_btof1", m_ngch, m_ph_btof1 );
264 status = m_tuple1->addIndexedItem( "zhit_btof1", m_ngch, m_zhit_btof1 );
265 status = m_tuple1->addIndexedItem( "qual_btof1", m_ngch, m_qual_btof1 );
266 status = m_tuple1->addIndexedItem( "tof_btof1", m_ngch, m_tof_btof1 );
267 status = m_tuple1->addIndexedItem( "te_btof1", m_ngch, m_te_btof1 );
268 status = m_tuple1->addIndexedItem( "tmu_btof1", m_ngch, m_tmu_btof1 );
269 status = m_tuple1->addIndexedItem( "tpi_btof1", m_ngch, m_tpi_btof1 );
270 status = m_tuple1->addIndexedItem( "tk_btof1", m_ngch, m_tk_btof1 );
271 status = m_tuple1->addIndexedItem( "tp_btof1", m_ngch, m_tp_btof1 );
272
273 status = m_tuple1->addIndexedItem( "cntr_btof2", m_ngch, m_cntr_btof2 );
274 status = m_tuple1->addIndexedItem( "ptot_btof2", m_ngch, m_ptot_btof2 );
275 status = m_tuple1->addIndexedItem( "ph_btof2", m_ngch, m_ph_btof2 );
276 status = m_tuple1->addIndexedItem( "zhit_btof2", m_ngch, m_zhit_btof2 );
277 status = m_tuple1->addIndexedItem( "qual_btof2", m_ngch, m_qual_btof2 );
278 status = m_tuple1->addIndexedItem( "tof_btof2", m_ngch, m_tof_btof2 );
279 status = m_tuple1->addIndexedItem( "te_btof2", m_ngch, m_te_btof2 );
280 status = m_tuple1->addIndexedItem( "tmu_btof2", m_ngch, m_tmu_btof2 );
281 status = m_tuple1->addIndexedItem( "tpi_btof2", m_ngch, m_tpi_btof2 );
282 status = m_tuple1->addIndexedItem( "tk_btof2", m_ngch, m_tk_btof2 );
283 status = m_tuple1->addIndexedItem( "tp_btof2", m_ngch, m_tp_btof2 );
284
285 status = m_tuple1->addIndexedItem( "m_ptrk_pid", m_ngch, m_ptrk_pid );
286 status = m_tuple1->addIndexedItem( "m_cost_pid", m_ngch, m_cost_pid );
287 status = m_tuple1->addIndexedItem( "m_dedx_pid", m_ngch, m_dedx_pid );
288 status = m_tuple1->addIndexedItem( "m_tof1_pid", m_ngch, m_tof1_pid );
289 status = m_tuple1->addIndexedItem( "m_tof2_pid", m_ngch, m_tof2_pid );
290 status = m_tuple1->addIndexedItem( "m_prob_pi", m_ngch, m_prob_pi );
291 status = m_tuple1->addIndexedItem( "m_prob_k", m_ngch, m_prob_k );
292 status = m_tuple1->addIndexedItem( "m_prob_p", m_ngch, m_prob_p );
293
294 status = m_tuple1->addItem( "np", m_np );
295 status = m_tuple1->addItem( "npb", m_npb );
296
297 status = m_tuple1->addItem( "m2p", m_m2p );
298 status = m_tuple1->addItem( "angle", m_angle );
299 status = m_tuple1->addItem( "deltatof", m_deltatof );
300
301 status = m_tuple1->addItem( "kal_m2p", m_kal_m2p );
302 status = m_tuple1->addItem( "kal_angle", m_kal_angle );
303
304 status = m_tuple1->addItem( "vtx_m2p", m_vtx_m2p );
305 status = m_tuple1->addItem( "vtx_angle", m_vtx_angle );
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328 }
329 else
330 {
331 log << MSG::ERROR << " Cannot book N-tuple:" << long( m_tuple1 ) << endmsg;
332 return StatusCode::FAILURE;
333 }
334 }
335
336
337
338
339
340 log << MSG::INFO << "successfully return from initialize()" << endmsg;
341 return StatusCode::SUCCESS;
342}