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