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