90 {
91 MsgStream log(
msgSvc(), name());
92
93 log << MSG::INFO << "in initialize()" << endmsg;
94
95 StatusCode status;
96
97
98
99 if(service("THistSvc", m_thsvc).isFailure()) {
100 log << MSG::ERROR << "Couldn't get THistSvc" << endreq;
101 return StatusCode::FAILURE;
102 }
103
104
105
106 TH1F* hbst_p = new TH1F("bst_p", "bst_p", 80, 1.15, 1.31);
107 if(m_thsvc->regHist("/DQAHist/DQAJpsi2PPbar/hbst_p", hbst_p).isFailure()) {
108 log << MSG::ERROR << "Couldn't register bst_p" << endreq;
109 }
110
111 TH1F* hbst_cos = new TH1F("bst_cos", "bst_cos", 20, -1.0, 1.0);
112 if(m_thsvc->regHist("/DQAHist/DQAJpsi2PPbar/hbst_cos", hbst_cos).isFailure()) {
113 log << MSG::ERROR << "Couldn't register bst_cos" << endreq;
114 }
115
116 TH1F* hmpp = new TH1F("mpp", "mpp", 100, 3.05, 3.15);
117 if(m_thsvc->regHist("/DQAHist/DQAJpsi2PPbar/hmpp", hmpp).isFailure()) {
118 log << MSG::ERROR << "Couldn't register mpp" << endreq;
119 }
120
121 TH1F* hangle = new TH1F("angle", "angle", 50, 175.0, 180.);
122 if(m_thsvc->regHist("/DQAHist/DQAJpsi2PPbar/hangle", hangle).isFailure()) {
123 log << MSG::ERROR << "Couldn't register angle" << endreq;
124 }
125
126 TH1F* hdeltatof = new TH1F("deltatof", "deltatof", 50, -10., 10.);
127 if(m_thsvc->regHist("/DQAHist/DQAJpsi2PPbar/hdeltatof", hdeltatof).isFailure()) {
128 log << MSG::ERROR << "Couldn't register deltatof" << endreq;
129 }
130
131 TH1F* he_emc1 = new TH1F("e_emc1", "e_emc1", 100, 0.0, 2.0);
132 if(m_thsvc->regHist("/DQAHist/DQAJpsi2PPbar/he_emc1", he_emc1).isFailure()) {
133 log << MSG::ERROR << "Couldn't register e_emc1" << endreq;
134 }
135
136 TH1F* he_emc2 = new TH1F("e_emc2", "e_emc2", 100, 0.0, 2.0);
137 if(m_thsvc->regHist("/DQAHist/DQAJpsi2PPbar/he_emc2", he_emc2).isFailure()) {
138 log << MSG::ERROR << "Couldn't register e_emc2" << endreq;
139 }
140
141
142
143
144
145 NTuplePtr nt1(
ntupleSvc(),
"DQAFILE/DQAJpsi2PPbar");
146 if ( nt1 ) m_tuple = nt1;
147 else {
148 m_tuple =
ntupleSvc()->book (
"DQAFILE/DQAJpsi2PPbar", CLID_ColumnWiseTuple,
"N-Tuple");
149 if ( m_tuple ) {
150 status = m_tuple->addItem ("runNo", m_runNo);
151 status = m_tuple->addItem ("event", m_event);
152 status = m_tuple->addItem ("Nchrg", m_nchrg);
153 status = m_tuple->addItem ("Nneu", m_nneu);
154 status = m_tuple->addItem ("ngch", m_ngch, 0, 10);
155
156 status = m_tuple->addIndexedItem ("charge",m_ngch, m_charge);
157 status = m_tuple->addIndexedItem ("vx0", m_ngch, m_vx0);
158 status = m_tuple->addIndexedItem ("vy0", m_ngch, m_vy0);
159 status = m_tuple->addIndexedItem ("vz0", m_ngch, m_vz0);
160 status = m_tuple->addIndexedItem ("vr0", m_ngch, m_vr0);
161
162 status = m_tuple->addIndexedItem ("vx", m_ngch, m_vx);
163 status = m_tuple->addIndexedItem ("vy", m_ngch, m_vy);
164 status = m_tuple->addIndexedItem ("vz", m_ngch, m_vz);
165 status = m_tuple->addIndexedItem ("vr", m_ngch, m_vr);
166
167 status = m_tuple->addIndexedItem ("px", m_ngch, m_px);
168 status = m_tuple->addIndexedItem ("py", m_ngch, m_py);
169 status = m_tuple->addIndexedItem ("pz", m_ngch, m_pz);
170 status = m_tuple->addIndexedItem ("p", m_ngch, m_p );
171 status = m_tuple->addIndexedItem ("cos", m_ngch, m_cos);
172
173 status = m_tuple->addIndexedItem ("bst_px", m_ngch, m_bst_px) ;
174 status = m_tuple->addIndexedItem ("bst_py", m_ngch, m_bst_py) ;
175 status = m_tuple->addIndexedItem ("bst_pz", m_ngch, m_bst_pz) ;
176 status = m_tuple->addIndexedItem ("bst_p", m_ngch, m_bst_p) ;
177 status = m_tuple->addIndexedItem ("bst_cos", m_ngch, m_bst_cos);
178
179
180 status = m_tuple->addIndexedItem ("chie" , m_ngch, m_chie) ;
181 status = m_tuple->addIndexedItem ("chimu" , m_ngch, m_chimu) ;
182 status = m_tuple->addIndexedItem ("chipi" , m_ngch, m_chipi) ;
183 status = m_tuple->addIndexedItem ("chik" , m_ngch, m_chik) ;
184 status = m_tuple->addIndexedItem ("chip" , m_ngch, m_chip) ;
185 status = m_tuple->addIndexedItem ("ghit" , m_ngch, m_ghit) ;
186 status = m_tuple->addIndexedItem ("thit" , m_ngch, m_thit) ;
187 status = m_tuple->addIndexedItem ("probPH" , m_ngch, m_probPH) ;
188 status = m_tuple->addIndexedItem ("normPH" , m_ngch, m_normPH) ;
189
190 status = m_tuple->addIndexedItem ("e_emc" , m_ngch, m_e_emc) ;
191
192
193 status = m_tuple->addIndexedItem ("qual_etof" , m_ngch, m_qual_etof );
194 status = m_tuple->addIndexedItem ("tof_etof" , m_ngch, m_tof_etof );
195 status = m_tuple->addIndexedItem ("te_etof" , m_ngch, m_te_etof );
196 status = m_tuple->addIndexedItem ("tmu_etof" , m_ngch, m_tmu_etof );
197 status = m_tuple->addIndexedItem ("tpi_etof" , m_ngch, m_tpi_etof );
198 status = m_tuple->addIndexedItem ("tk_etof" , m_ngch, m_tk_etof );
199 status = m_tuple->addIndexedItem ("tp_etof" , m_ngch, m_tp_etof );
200
201 status = m_tuple->addIndexedItem ("qual_btof1", m_ngch, m_qual_btof1 );
202 status = m_tuple->addIndexedItem ("tof_btof1" , m_ngch, m_tof_btof1 );
203 status = m_tuple->addIndexedItem ("te_btof1" , m_ngch, m_te_btof1 );
204 status = m_tuple->addIndexedItem ("tmu_btof1" , m_ngch, m_tmu_btof1 );
205 status = m_tuple->addIndexedItem ("tpi_btof1" , m_ngch, m_tpi_btof1 );
206 status = m_tuple->addIndexedItem ("tk_btof1" , m_ngch, m_tk_btof1 );
207 status = m_tuple->addIndexedItem ("tp_btof1" , m_ngch, m_tp_btof1 );
208
209 status = m_tuple->addIndexedItem ("qual_btof2", m_ngch, m_qual_btof2 );
210 status = m_tuple->addIndexedItem ("tof_btof2" , m_ngch, m_tof_btof2 );
211 status = m_tuple->addIndexedItem ("te_btof2" , m_ngch, m_te_btof2 );
212 status = m_tuple->addIndexedItem ("tmu_btof2" , m_ngch, m_tmu_btof2 );
213 status = m_tuple->addIndexedItem ("tpi_btof2" , m_ngch, m_tpi_btof2 );
214 status = m_tuple->addIndexedItem ("tk_btof2" , m_ngch, m_tk_btof2 );
215 status = m_tuple->addIndexedItem ("tp_btof2" , m_ngch, m_tp_btof2 );
216
217 status = m_tuple->addIndexedItem ("dedx_pid", m_ngch, m_dedx_pid);
218 status = m_tuple->addIndexedItem ("tof1_pid", m_ngch, m_tof1_pid);
219 status = m_tuple->addIndexedItem ("tof2_pid", m_ngch, m_tof2_pid);
220 status = m_tuple->addIndexedItem ("prob_pi", m_ngch, m_prob_pi );
221 status = m_tuple->addIndexedItem ("prob_k", m_ngch, m_prob_k );
222 status = m_tuple->addIndexedItem ("prob_p", m_ngch, m_prob_p );
223
224 status = m_tuple->addItem ( "np", m_np );
225 status = m_tuple->addItem ( "npb", m_npb );
226
227 status = m_tuple->addItem ( "m2p", m_m2p );
228 status = m_tuple->addItem ( "angle", m_angle );
229 status = m_tuple->addItem ( "deltatof", m_deltatof );
230
231 status = m_tuple->addItem ( "vtx_m2p", m_vtx_m2p );
232 status = m_tuple->addItem ( "vtx_angle", m_vtx_angle );
233
234 status = m_tuple->addItem ( "m_chi2_4c", m_chi2_4c );
235 status = m_tuple->addItem ( "m_m2p_4c", m_m2p_4c );
236 status = m_tuple->addItem ( "m_angle_4c", m_angle_4c );
237
238 }
239 else {
240 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple) << endmsg;
241 return StatusCode::FAILURE;
242 }
243 }
244
245
246
247
248
249 log << MSG::INFO << "successfully return from initialize()" <<endmsg;
250 return StatusCode::SUCCESS;
251
252}