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