80 {
81 MsgStream log(
msgSvc(), name());
82
83 log << MSG::INFO << "in initialize()" << endmsg;
84 StatusCode status;
85
86 if(service("THistSvc", m_thsvc).isFailure()) {
87 log << MSG::ERROR << "Couldn't get THistSvc" << endreq;
88 return StatusCode::FAILURE;
89 }
90
91
92
93 TH1F* hks_dl = new TH1F("ks_dl", "ks_dl", 300, -5.0, 25.0);
94 if(m_thsvc->regHist("/DQAHist/DQAKsKpiDEDX/hks_dl", hks_dl).isFailure()) {
95 log << MSG::ERROR << "Couldn't register ks_dl" << endreq;
96 }
97
98 TH1F* hks_m = new TH1F("ks_m", "ks_m", 200,0.4, 0.6);
99 if(m_thsvc->regHist("/DQAHist/DQAKsKpiDEDX/hks_m", hks_m).isFailure()) {
100 log << MSG::ERROR << "Couldn't register ks_m" << endreq;
101 }
102
103 TH1F* hkspi_m = new TH1F("kspi_m", "kspi_m", 200,0.6, 2.6);
104 if(m_thsvc->regHist("/DQAHist/DQAKsKpiDEDX/hkspi_m", hkspi_m).isFailure()) {
105 log << MSG::ERROR << "Couldn't register kspi_m" << endreq;
106 }
107
108 TH1F* hks_p = new TH1F("ks_p", "ks_p", 100,0.0, 1.5);
109 if(m_thsvc->regHist("/DQAHist/DQAKsKpiDEDX/hks_p", hks_p).isFailure()) {
110 log << MSG::ERROR << "Couldn't register ks_p" << endreq;
111 }
112
113 TH1F* hkpi_m = new TH1F("kpi_m", "kpi_m", 200,0.6, 2.6);
114 if(m_thsvc->regHist("/DQAHist/DQAKsKpiDEDX/hkpi_m", hkpi_m).isFailure()) {
115 log << MSG::ERROR << "Couldn't register kpi_m" << endreq;
116 }
117
118
119
120
121 NTuplePtr nt(
ntupleSvc(),
"DQAFILE/KsKpiDEDX");
122 if ( nt ) m_tuple = nt;
123 else {
124 m_tuple =
ntupleSvc()->book(
"DQAFILE/KsKpiDEDX", CLID_ColumnWiseTuple,
"KsKpiDEDX ntuple");
125 if( m_tuple ) {
126 status = m_tuple->addItem("runNo", m_runNo);
127 status = m_tuple->addItem("event", m_event);
128
129
130
131 status = m_tuple->addItem("npip", m_npip);
132 status = m_tuple->addItem("npim", m_npim);
133 status = m_tuple->addItem("nkp", m_nkp);
134 status = m_tuple->addItem("nkm", m_nkm);
135 status = m_tuple->addItem("np", m_np);
136 status = m_tuple->addItem("npb", m_npb);
137
138 status = m_tuple->addItem("vfits_chi", m_vfits_chi);
139 status = m_tuple->addItem("vfits_vx", m_vfits_vx);
140 status = m_tuple->addItem("vfits_vy", m_vfits_vy);
141 status = m_tuple->addItem("vfits_vz", m_vfits_vz);
142 status = m_tuple->addItem("vfits_vr", m_vfits_vr);
143
144 status = m_tuple->addItem("vfitp_chi", m_vfitp_chi);
145 status = m_tuple->addItem("vfitp_vx", m_vfitp_vx);
146 status = m_tuple->addItem("vfitp_vy", m_vfitp_vy);
147 status = m_tuple->addItem("vfitp_vz", m_vfitp_vz);
148 status = m_tuple->addItem("vfitp_vr", m_vfitp_vr);
149
150 status = m_tuple->addItem("vfit2_chi", m_vfit2_chi);
151 status = m_tuple->addItem("vfit2_mks", m_vfit2_mks);
152 status = m_tuple->addItem("vfit2_ct", m_vfit2_ct);
153 status = m_tuple->addItem("vfit2_dl", m_vfit2_dl);
154 status = m_tuple->addItem("vfit2_dle", m_vfit2_dle);
155
156 status = m_tuple->addItem("chi2_fs4c", m_chi2_fs4c);
157 status = m_tuple->addItem("mks_fs4c", m_mks_fs4c);
158 status = m_tuple->addItem("mkspi_fs4c",m_mkspi_fs4c);
159 status = m_tuple->addItem("mksk_fs4c", m_mksk_fs4c);
160 status = m_tuple->addItem("mkpi_fs4c", m_mkpi_fs4c);
161
162 status = m_tuple->addItem("4c_chi2", m_4c_chi2);
163 status = m_tuple->addItem("4c_mks", m_4c_mks);
164 status = m_tuple->addItem("4c_mkspi", m_4c_mkspi);
165 status = m_tuple->addItem("4c_mksk", m_4c_mksk);
166 status = m_tuple->addItem("4c_mkpi", m_4c_mkpi);
167 status = m_tuple->addItem("4c_ks_px", m_4c_ks_px);
168 status = m_tuple->addItem("4c_ks_py", m_4c_ks_py);
169 status = m_tuple->addItem("4c_ks_pz", m_4c_ks_pz);
170 status = m_tuple->addItem("4c_ks_p", m_4c_ks_p);
171 status = m_tuple->addItem("4c_ks_cos", m_4c_ks_cos);
172
173 status = m_tuple->addItem("NGch", m_ngch, 0, 10);
174 status = m_tuple->addIndexedItem("pidcode", m_ngch, m_pidcode);
175 status = m_tuple->addIndexedItem("pidprob", m_ngch, m_pidprob);
176 status = m_tuple->addIndexedItem("pidchiDedx", m_ngch, m_pidchiDedx);
177 status = m_tuple->addIndexedItem("pidchiTof1", m_ngch, m_pidchiTof1);
178 status = m_tuple->addIndexedItem("pidchiTof2", m_ngch, m_pidchiTof2);
179
180 status = m_tuple->addIndexedItem("charge",m_ngch, m_charge);
181 status = m_tuple->addIndexedItem("vx0", m_ngch, m_vx0);
182 status = m_tuple->addIndexedItem("vy0", m_ngch, m_vy0);
183 status = m_tuple->addIndexedItem("vz0", m_ngch, m_vz0);
184 status = m_tuple->addIndexedItem("vr0", m_ngch, m_vr0);
185
186 status = m_tuple->addIndexedItem("vx", m_ngch, m_vx);
187 status = m_tuple->addIndexedItem("vy", m_ngch, m_vy);
188 status = m_tuple->addIndexedItem("vz", m_ngch, m_vz);
189 status = m_tuple->addIndexedItem("vr", m_ngch, m_vr);
190
191 status = m_tuple->addIndexedItem("px", m_ngch, m_px);
192 status = m_tuple->addIndexedItem("py", m_ngch, m_py);
193 status = m_tuple->addIndexedItem("pz", m_ngch, m_pz);
194 status = m_tuple->addIndexedItem("p", m_ngch, m_p);
195 status = m_tuple->addIndexedItem("cost", m_ngch, m_cost);
196
197 status = m_tuple->addIndexedItem("probPH", m_ngch, m_probPH);
198 status = m_tuple->addIndexedItem("normPH", m_ngch, m_normPH);
199 status = m_tuple->addIndexedItem("chie", m_ngch, m_chie);
200 status = m_tuple->addIndexedItem("chimu", m_ngch, m_chimu);
201 status = m_tuple->addIndexedItem("chipi", m_ngch, m_chipi);
202 status = m_tuple->addIndexedItem("chik", m_ngch, m_chik);
203 status = m_tuple->addIndexedItem("chip", m_ngch, m_chip);
204 status = m_tuple->addIndexedItem("ghit", m_ngch, m_ghit);
205 status = m_tuple->addIndexedItem("thit", m_ngch, m_thit);
206
207 status = m_tuple->addIndexedItem("e_emc", m_ngch, m_e_emc);
208
209 status = m_tuple->addIndexedItem("qual_etof", m_ngch, m_qual_etof);
210 status = m_tuple->addIndexedItem("tof_etof", m_ngch, m_tof_etof);
211 status = m_tuple->addIndexedItem("te_etof", m_ngch, m_te_etof);
212 status = m_tuple->addIndexedItem("tmu_etof", m_ngch, m_tmu_etof);
213 status = m_tuple->addIndexedItem("tpi_etof", m_ngch, m_tpi_etof);
214 status = m_tuple->addIndexedItem("tk_etof", m_ngch, m_tk_etof);
215 status = m_tuple->addIndexedItem("tp_etof", m_ngch, m_tp_etof);
216
217 status = m_tuple->addIndexedItem("qual_btof1", m_ngch, m_qual_btof1);
218 status = m_tuple->addIndexedItem("tof_btof1", m_ngch, m_tof_btof1);
219 status = m_tuple->addIndexedItem("te_btof1", m_ngch, m_te_btof1);
220 status = m_tuple->addIndexedItem("tmu_btof1", m_ngch, m_tmu_btof1);
221 status = m_tuple->addIndexedItem("tpi_btof1", m_ngch, m_tpi_btof1);
222 status = m_tuple->addIndexedItem("tk_btof1", m_ngch, m_tk_btof1);
223 status = m_tuple->addIndexedItem("tp_btof1", m_ngch, m_tp_btof1);
224
225 status = m_tuple->addIndexedItem("qual_btof2", m_ngch, m_qual_btof2);
226 status = m_tuple->addIndexedItem("tof_btof2", m_ngch, m_tof_btof2);
227 status = m_tuple->addIndexedItem("te_btof2", m_ngch, m_te_btof2);
228 status = m_tuple->addIndexedItem("tmu_btof2", m_ngch, m_tmu_btof2);
229 status = m_tuple->addIndexedItem("tpi_btof2", m_ngch, m_tpi_btof2);
230 status = m_tuple->addIndexedItem("tk_btof2", m_ngch, m_tk_btof2);
231 status = m_tuple->addIndexedItem("tp_btof2", m_ngch, m_tp_btof2);
232
233 } else {
234 log << MSG::ERROR << "Can not book N-tuple:" << long(m_tuple) << endreq;
235 }
236 }
237
238
239
240 log << MSG::INFO << "successfully return from initialize()" <<endmsg;
241 return StatusCode::SUCCESS;
242
243}