89{
90 MsgStream log(
msgSvc(), name());
91 log << MSG::INFO << "in initialize()" << endmsg;
92
93 StatusCode sc=service("THistSvc", m_thsvc);
94 if(sc.isFailure()) {
95 log << MSG::FATAL << "Couldn't get THistSvc" << endreq;
96 exit(1);
97 }
98
99 for(int i = 0; i < 15; i++){
100 m_sel_number[i] = 0;
101 }
102
103
104
105
106 m_vertex_x = new TH1D("x_of_vertex", "x of vertex", 200, -5, 5);
107 m_vertex_y = new TH1D("y_of_vertex", "y of vertex", 200, -5, 5);
108 m_vertex_z = new TH1D("z_of_vertex", "z of vertex", 200, -10, 10);
109 m_vertex_x_kal = new TH1D("x_of_vertex_in_kal", "x of vertex in kal", 200, -5, 5);
110 m_vertex_y_kal = new TH1D("y_of_vertex_in_kal", "y of vertex in kal", 200, -5, 5);
111 m_vertex_z_kal = new TH1D("z_of_vertex_in_kal", "z of vertex in kal", 200, -10, 10);
112 if(m_thsvc->regHist("/DQAHist/zhsVER/x_of_vertex",m_vertex_x).isFailure()){
113 log << MSG::FATAL << "Couldn't register x of vertex " << endreq;
114 exit(1);
115 }
116 if(m_thsvc->regHist("/DQAHist/zhsVER/y_of_vertex",m_vertex_y).isFailure()){
117 log << MSG::FATAL << "Couldn't register y of vertex" << endreq;
118 exit(1);
119 }
120 if(m_thsvc->regHist("/DQAHist/zhsVER/z_of_vertex",m_vertex_z).isFailure()){
121 log << MSG::FATAL << "Couldn't register z of vertex" << endreq;
122 exit(1);
123 }
124 if(m_thsvc->regHist("/DQAHist/zhsVER/x_of_vertex_in_kal",m_vertex_x_kal).isFailure()){
125 log << MSG::FATAL << "Couldn't register x of vertex in kal" << endreq;
126 exit(1);
127 }
128 if(m_thsvc->regHist("/DQAHist/zhsVER/y_of_vertex_in_kal",m_vertex_y_kal).isFailure()){
129 log << MSG::FATAL << "Couldn't register y of vertex in kal" << endreq;
130 exit(1);
131 }
132 if(m_thsvc->regHist("/DQAHist/zhsVER/z_of_vertex_in_kal",m_vertex_z_kal).isFailure()){
133 log << MSG::FATAL << "Couldn't register z of vertex in kal" << endreq;
134 exit(1);
135 }
136
137
138 StatusCode status;
139
140 NTuplePtr nt1(
ntupleSvc(),
"FILE1/minid");
141 if(nt1) m_tuple1 = nt1;
142 else {
143 m_tuple1 =
ntupleSvc()->book (
"FILE1/minid", CLID_ColumnWiseTuple,
"minimal distance");
144 if(m_tuple1) {
145 status = m_tuple1->addItem("xc", m_xc);
146 status = m_tuple1->addItem("yc", m_yc);
147 status = m_tuple1->addItem("zc", m_zc);
148 status = m_tuple1->addItem("mind", m_mind);
149 } else {
150 log << MSG::FATAL << "Cannot book N-tuple:" << long(m_tuple1) << endmsg;
151 return StatusCode::FAILURE;
152 }
153 }
154
155 NTuplePtr nt2(
ntupleSvc(),
"FILE1/chisq");
156 if(nt2) m_tuple2 = nt2;
157 else {
158 m_tuple2 =
ntupleSvc()->book (
"FILE1/chisq", CLID_ColumnWiseTuple,
"chi-square of ");
159 if(m_tuple2) {
160 status = m_tuple2->addItem("chis", m_chis);
161 status = m_tuple2->addItem("probs", m_probs);
162 status = m_tuple2->addItem("chif", m_chif);
163 status = m_tuple2->addItem("probf", m_probf);
164 } else {
165 log << MSG::FATAL << "Cannot book N-tuple:" << long(m_tuple2) << endmsg;
166 return StatusCode::FAILURE;
167 }
168 }
169
170 NTuplePtr nt3(
ntupleSvc(),
"FILE1/kalvtx");
171 if(nt3) m_tuple3 = nt3;
172 else {
173 m_tuple3 =
ntupleSvc()->book (
"FILE1/kalvtx", CLID_ColumnWiseTuple,
"kalman vertex");
174 if(m_tuple3) {
175 status = m_tuple3->addItem("kvx", m_kvx);
176 status = m_tuple3->addItem("kvy", m_kvy);
177 status = m_tuple3->addItem("kvz", m_kvz);
178 status = m_tuple3->addItem("chik", m_chik);
179 status = m_tuple3->addItem("ndofk", m_ndofk);
180 status = m_tuple3->addItem("probk", m_probk);
181 } else {
182 log << MSG::FATAL << "Cannot book N-tuple:" << long(m_tuple3) << endmsg;
183 return StatusCode::FAILURE;
184 }
185 }
186
187 NTuplePtr nt4(
ntupleSvc(),
"FILE1/glbvtx");
188 if(nt4) m_tuple4 = nt4;
189 else {
190 m_tuple4 =
ntupleSvc()->book (
"FILE1/glbvtx", CLID_ColumnWiseTuple,
"global vertex");
191 if(m_tuple4) {
192 status = m_tuple4->addItem("gvx", m_gvx);
193 status = m_tuple4->addItem("gvy", m_gvy);
194 status = m_tuple4->addItem("gvz", m_gvz);
195 status = m_tuple4->addItem("chig", m_chig);
196 status = m_tuple4->addItem("ndofg", m_ndofg);
197 status = m_tuple4->addItem("probg", m_probg);
198 } else {
199 log << MSG::FATAL << "Cannot book N-tuple:" << long(m_tuple4) << endmsg;
200 return StatusCode::FAILURE;
201 }
202 }
203
204 NTuplePtr nt5(
ntupleSvc(),
"FILE1/Pull");
205 if(nt5) m_tuple5 = nt5;
206 else {
207 m_tuple5 =
ntupleSvc()->book (
"FILE1/Pull", CLID_ColumnWiseTuple,
"Pull");
208 if(m_tuple5) {
209 status = m_tuple5->addItem("pull_drho", m_pull_drho);
210 status = m_tuple5->addItem("pull_phi", m_pull_phi);
211 status = m_tuple5->addItem("pull_kapha", m_pull_kapha);
212 status = m_tuple5->addItem("pull_dz", m_pull_dz);
213 status = m_tuple5->addItem("pull_lamb", m_pull_lamb);
214 status = m_tuple5->addItem("pull_momentum", m_pull_momentum);
215 } else {
216 log << MSG::FATAL << "Cannot book N-tuple:" << long(m_tuple5) << endmsg;
217 return StatusCode::FAILURE;
218 }
219 }
220
221 NTuplePtr nt6(
ntupleSvc(),
"FILE1/MdcTrack");
222 if(nt6) m_tuple6 = nt6;
223 else {
224 m_tuple6 =
ntupleSvc()->book (
"FILE1/MdcTrack", CLID_ColumnWiseTuple,
"MdcTrack");
225 if(m_tuple6) {
226 status = m_tuple6->addItem("MdcTrkX", m_mdcTrk_x);
227 status = m_tuple6->addItem("MdcTrkY", m_mdcTrk_y);
228 status = m_tuple6->addItem("MdcTrkZ", m_mdcTrk_z);
229 status = m_tuple6->addItem("MdcTrkR", m_mdcTrk_r);
230 status = m_tuple6->addItem("MdcTrkDrho", m_mdcTrk_dr);
231 status = m_tuple6->addItem("Rxy", m_rxy);
232 status = m_tuple6->addItem("MdcKalTrkZ", m_mdcKalTrk_z);
233 } else {
234 log << MSG::FATAL << "Cannot book N-tuple:" << long(m_tuple6) << endmsg;
235 return StatusCode::FAILURE;
236 }
237 }
238
239 NTuplePtr nt7(
ntupleSvc(),
"FILE1/PullG");
240 if(nt7) m_tuple7 = nt7;
241 else {
242 m_tuple7 =
ntupleSvc()->book (
"FILE1/PullG", CLID_ColumnWiseTuple,
"Pull");
243 if(m_tuple7) {
244 status = m_tuple7->addItem("gpull_drho", m_gpull_drho);
245 status = m_tuple7->addItem("gpull_phi", m_gpull_phi);
246 status = m_tuple7->addItem("gpull_kapha", m_gpull_kapha);
247 status = m_tuple7->addItem("gpull_dz", m_gpull_dz);
248 status = m_tuple7->addItem("gpull_lamb", m_gpull_lamb);
249 } else {
250 log << MSG::FATAL << "Cannot book N-tuple:" << long(m_tuple7) << endmsg;
251 return StatusCode::FAILURE;
252 }
253 }
254
255 log << MSG::INFO << "successfully return from initialize()" <<endmsg;
256 return StatusCode::SUCCESS;
257}