76 {
77 MsgStream log(
msgSvc(), name());
78
79 log << MSG::INFO << "in initialize()" << endmsg;
80
81 StatusCode status;
83 if ( nt1 ) m_tuple1 = nt1;
84 else {
85 m_tuple1 =
ntupleSvc()->book (
"FILE1/vxyz", CLID_ColumnWiseTuple,
"ks N-Tuple example");
86 if ( m_tuple1 ) {
87 status = m_tuple1->addItem ("vx0", m_vx0);
88 status = m_tuple1->addItem ("vy0", m_vy0);
89 status = m_tuple1->addItem ("vz0", m_vz0);
90 status = m_tuple1->addItem ("vr0", m_vr0);
91 status = m_tuple1->addItem ("rvxy0", m_rvxy0);
92 status = m_tuple1->addItem ("rvz0", m_rvz0);
93 status = m_tuple1->addItem ("rvphi0", m_rvphi0);
94 }
95 else {
96 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple1) << endmsg;
97 return StatusCode::FAILURE;
98 }
99 }
100
101 NTuplePtr nt2(
ntupleSvc(),
"FILE1/photon");
102 if ( nt2 ) m_tuple2 = nt2;
103 else {
104 m_tuple2 =
ntupleSvc()->book (
"FILE1/photon", CLID_ColumnWiseTuple,
"ks N-Tuple example");
105 if ( m_tuple2 ) {
106 status = m_tuple2->addItem ("dthe", m_dthe);
107 status = m_tuple2->addItem ("dphi", m_dphi);
108 status = m_tuple2->addItem ("dang", m_dang);
109 status = m_tuple2->addItem ("eraw", m_eraw);
110 }
111 else {
112 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple2) << endmsg;
113 return StatusCode::FAILURE;
114 }
115 }
116
117
118 NTuplePtr nt3(
ntupleSvc(),
"FILE1/etot");
119 if ( nt3 ) m_tuple3 = nt3;
120 else {
121 m_tuple3 =
ntupleSvc()->book (
"FILE1/etot", CLID_ColumnWiseTuple,
"ks N-Tuple example");
122 if ( m_tuple3 ) {
123 status = m_tuple3->addItem ("m2gg", m_m2gg);
124 status = m_tuple3->addItem ("etot", m_etot);
125 }
126 else {
127 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple3) << endmsg;
128 return StatusCode::FAILURE;
129 }
130 }
131 if(m_test4C==1) {
132 NTuplePtr nt4(
ntupleSvc(),
"FILE1/fit4c");
133 if ( nt4 ) m_tuple4 = nt4;
134 else {
135 m_tuple4 =
ntupleSvc()->book (
"FILE1/fit4c", CLID_ColumnWiseTuple,
"ks N-Tuple example");
136 if ( m_tuple4 ) {
137 status = m_tuple4->addItem ("chi2", m_chi1);
138 status = m_tuple4->addItem ("mpi0", m_mpi0);
139 }
140 else {
141 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple4) << endmsg;
142 return StatusCode::FAILURE;
143 }
144 }
145 }
146
147
148 if(m_test5C==1) {
149 NTuplePtr nt5(
ntupleSvc(),
"FILE1/fit5c");
150 if ( nt5 ) m_tuple5 = nt5;
151 else {
152 m_tuple5 =
ntupleSvc()->book (
"FILE1/fit5c", CLID_ColumnWiseTuple,
"ks N-Tuple example");
153 if ( m_tuple5 ) {
154 status = m_tuple5->addItem ("chi2", m_chi2);
155 status = m_tuple5->addItem ("mrh0", m_mrh0);
156 status = m_tuple5->addItem ("mrhp", m_mrhp);
157 status = m_tuple5->addItem ("mrhm", m_mrhm);
158 }
159 else {
160 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple5) << endmsg;
161 return StatusCode::FAILURE;
162 }
163 }
164
165 NTuplePtr nt6(
ntupleSvc(),
"FILE1/geff");
166 if ( nt6 ) m_tuple6 = nt6;
167 else {
168 m_tuple6 =
ntupleSvc()->book (
"FILE1/geff", CLID_ColumnWiseTuple,
"ks N-Tuple example");
169 if ( m_tuple6 ) {
170 status = m_tuple6->addItem ("fcos", m_fcos);
171 status = m_tuple6->addItem ("elow", m_elow);
172 }
173 else {
174 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple6) << endmsg;
175 return StatusCode::FAILURE;
176 }
177 }
178 }
179
180 if(m_checkDedx == 1) {
181 NTuplePtr nt7(
ntupleSvc(),
"FILE1/dedx");
182 if ( nt7 ) m_tuple7 = nt7;
183 else {
184 m_tuple7 =
ntupleSvc()->book (
"FILE1/dedx", CLID_ColumnWiseTuple,
"ks N-Tuple example");
185 if ( m_tuple7 ) {
186 status = m_tuple7->addItem ("ptrk", m_ptrk);
187 status = m_tuple7->addItem ("chie", m_chie);
188 status = m_tuple7->addItem ("chimu", m_chimu);
189 status = m_tuple7->addItem ("chipi", m_chipi);
190 status = m_tuple7->addItem ("chik", m_chik);
191 status = m_tuple7->addItem ("chip", m_chip);
192 status = m_tuple7->addItem ("probPH", m_probPH);
193 status = m_tuple7->addItem ("normPH", m_normPH);
194 status = m_tuple7->addItem ("ghit", m_ghit);
195 status = m_tuple7->addItem ("thit", m_thit);
196 }
197 else {
198 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple7) << endmsg;
199 return StatusCode::FAILURE;
200 }
201 }
202 }
203
204 if(m_checkTof == 1) {
205 NTuplePtr nt8(
ntupleSvc(),
"FILE1/tofe");
206 if ( nt8 ) m_tuple8 = nt8;
207 else {
208 m_tuple8 =
ntupleSvc()->book (
"FILE1/tofe",CLID_ColumnWiseTuple,
"ks N-Tuple example");
209 if ( m_tuple8 ) {
210 status = m_tuple8->addItem ("ptrk", m_ptot_etof);
211 status = m_tuple8->addItem ("cntr", m_cntr_etof);
212 status = m_tuple8->addItem ("ph", m_ph_etof);
213 status = m_tuple8->addItem ("rhit", m_rhit_etof);
214 status = m_tuple8->addItem ("qual", m_qual_etof);
215 status = m_tuple8->addItem ("te", m_te_etof);
216 status = m_tuple8->addItem ("tmu", m_tmu_etof);
217 status = m_tuple8->addItem ("tpi", m_tpi_etof);
218 status = m_tuple8->addItem ("tk", m_tk_etof);
219 status = m_tuple8->addItem ("tp", m_tp_etof);
220 }
221 else {
222 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple8) << endmsg;
223 return StatusCode::FAILURE;
224 }
225 }
226 }
227
228
229
230 if(m_checkTof == 1) {
231 NTuplePtr nt9(
ntupleSvc(),
"FILE1/tof1");
232 if ( nt9 ) m_tuple9 = nt9;
233 else {
234 m_tuple9 =
ntupleSvc()->book (
"FILE1/tof1", CLID_ColumnWiseTuple,
"ks N-Tuple example");
235 if ( m_tuple9 ) {
236 status = m_tuple9->addItem ("ptrk", m_ptot_btof1);
237 status = m_tuple9->addItem ("cntr", m_cntr_btof1);
238 status = m_tuple9->addItem ("ph", m_ph_btof1);
239 status = m_tuple9->addItem ("zhit", m_zhit_btof1);
240 status = m_tuple9->addItem ("qual", m_qual_btof1);
241 status = m_tuple9->addItem ("te", m_te_btof1);
242 status = m_tuple9->addItem ("tmu", m_tmu_btof1);
243 status = m_tuple9->addItem ("tpi", m_tpi_btof1);
244 status = m_tuple9->addItem ("tk", m_tk_btof1);
245 status = m_tuple9->addItem ("tp", m_tp_btof1);
246 }
247 else {
248 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple9) << endmsg;
249 return StatusCode::FAILURE;
250 }
251 }
252 }
253
254
255 if(m_checkTof == 1) {
256 NTuplePtr nt10(
ntupleSvc(),
"FILE1/tof2");
257 if ( nt10 ) m_tuple10 = nt10;
258 else {
259 m_tuple10 =
ntupleSvc()->book (
"FILE1/tof2", CLID_ColumnWiseTuple,
"ks N-Tuple example");
260 if ( m_tuple10 ) {
261 status = m_tuple10->addItem ("ptrk", m_ptot_btof2);
262 status = m_tuple10->addItem ("cntr", m_cntr_btof2);
263 status = m_tuple10->addItem ("ph", m_ph_btof2);
264 status = m_tuple10->addItem ("zhit", m_zhit_btof2);
265 status = m_tuple10->addItem ("qual", m_qual_btof2);
266 status = m_tuple10->addItem ("te", m_te_btof2);
267 status = m_tuple10->addItem ("tmu", m_tmu_btof2);
268 status = m_tuple10->addItem ("tpi", m_tpi_btof2);
269 status = m_tuple10->addItem ("tk", m_tk_btof2);
270 status = m_tuple10->addItem ("tp", m_tp_btof2);
271 }
272 else {
273 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple10) << endmsg;
274 return StatusCode::FAILURE;
275 }
276 }
277 }
278
279
280 NTuplePtr nt11(
ntupleSvc(),
"FILE1/pid");
281 if ( nt11 ) m_tuple11 = nt11;
282 else {
283 m_tuple11 =
ntupleSvc()->book (
"FILE1/pid", CLID_ColumnWiseTuple,
"ks N-Tuple example");
284 if ( m_tuple11 ) {
285 status = m_tuple11->addItem ("ptrk", m_ptrk_pid);
286 status = m_tuple11->addItem ("cost", m_cost_pid);
287 status = m_tuple11->addItem ("dedx", m_dedx_pid);
288 status = m_tuple11->addItem ("tof1", m_tof1_pid);
289 status = m_tuple11->addItem ("tof2", m_tof2_pid);
290 status = m_tuple11->addItem ("prob", m_prob_pid);
291 }
292 else {
293 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple11) << endmsg;
294 return StatusCode::FAILURE;
295 }
296 }
297
298
299
300
301
302
303 log << MSG::INFO << "successfully return from initialize()" <<endmsg;
304 return StatusCode::SUCCESS;
305
306}