105{
106
107 MsgStream log(
msgSvc(), name());
108 log << MSG::INFO << "in initialize()" << endreq;
109 if(m_prodNT)
110 {
111
113 StatusCode sc = service(
"NTupleSvc",
ntupleSvc);
114 NTuplePtr mt(
ntupleSvc,
"FILE199/CgemMdcComb");
115 if ( mt ) match_ntuple = mt;
116 else{
117 match_ntuple =
ntupleSvc->book(
"FILE199/CgemMdcComb", CLID_ColumnWiseTuple,
"match");
118 StatusCode status;
119 if(match_ntuple){
120 status = match_ntuple->addItem("run", run);
121 status = match_ntuple->addItem("evt", evt);
122 status = match_ntuple->addItem("costhetaMC", costhetaMC);
123 status = match_ntuple->addItem("phiMC", phiMC);
124 status = match_ntuple->addItem("pdgMC", pdgMC);
125 status = match_ntuple->addItem("truth_dr", truth_dr);
126 status = match_ntuple->addItem("truth_dz", truth_dz);
127 status = match_ntuple->addItem("truth_phi0", truth_phi0);
128 status = match_ntuple->addItem("truth_kappa", truth_kappa);
129 status = match_ntuple->addItem("truth_tanl", truth_tanl);
130 status = match_ntuple->addItem("track_size",track_size,0,1000);
131 status = match_ntuple->addIndexedItem("matched", track_size, CgemSegMatched);
132 status = match_ntuple->addIndexedItem("dr_avg", track_size, dr_avg);
133 status = match_ntuple->addIndexedItem("dz_avg", track_size, dz_avg);
134 status = match_ntuple->addIndexedItem("tanL_avg", track_size, tanL_avg);
135 status = match_ntuple->addItem("segment_size",segment_size,0,1000);
136 status = match_ntuple->addIndexedItem("fit_failed", segment_size , match_failed);
137 status = match_ntuple->addItem("nMatch",match_nsegment,0,1000);
138 status = match_ntuple->addIndexedItem("chisq_dr", match_nsegment , match_dr_chisq);
139 status = match_ntuple->addIndexedItem("chisq_phi0", match_nsegment , match_phi0_chisq);
140 status = match_ntuple->addIndexedItem("chisq_kappa", match_nsegment , match_kappa_chisq);
141 status = match_ntuple->addIndexedItem("chisq_tanl", match_nsegment , match_tanl_chisq);
142 status = match_ntuple->addIndexedItem("chisq_dz", match_nsegment , match_dz_chisq);
143 status = match_ntuple->addIndexedItem("IsTruth", match_nsegment , match_IsTruth);
144 status = match_ntuple->addIndexedItem("track_dr", match_nsegment , track_dr);
145 status = match_ntuple->addIndexedItem("track_phi0", match_nsegment , track_phi0);
146 status = match_ntuple->addIndexedItem("track_kappa", match_nsegment , track_kappa);
147 status = match_ntuple->addIndexedItem("track_tanl", match_nsegment , track_tanl);
148 status = match_ntuple->addIndexedItem("track_dz", match_nsegment , track_dz);
149 status = match_ntuple->addIndexedItem("track_dr_err", match_nsegment , track_dr_err);
150 status = match_ntuple->addIndexedItem("track_phi0_err", match_nsegment , track_phi0_err);
151 status = match_ntuple->addIndexedItem("track_kappa_err", match_nsegment , track_kappa_err);
152 status = match_ntuple->addIndexedItem("track_tanl_err", match_nsegment , track_tanl_err);
153 status = match_ntuple->addIndexedItem("track_dz_err", match_nsegment , track_dz_err);
154 status = match_ntuple->addIndexedItem("seg_dr", match_nsegment , seg_dr);
155 status = match_ntuple->addIndexedItem("seg_phi0", match_nsegment , seg_phi0);
156 status = match_ntuple->addIndexedItem("seg_kappa", match_nsegment , seg_kappa);
157 status = match_ntuple->addIndexedItem("seg_tanl", match_nsegment , seg_tanl);
158 status = match_ntuple->addIndexedItem("seg_dz", match_nsegment , seg_dz);
159 status = match_ntuple->addIndexedItem("seg_dr_err", match_nsegment , seg_dr_err);
160 status = match_ntuple->addIndexedItem("seg_phi0_err", match_nsegment , seg_phi0_err);
161 status = match_ntuple->addIndexedItem("seg_kappa_err", match_nsegment , seg_kappa_err);
162 status = match_ntuple->addIndexedItem("seg_tanl_err", match_nsegment , seg_tanl_err);
163 status = match_ntuple->addIndexedItem("seg_dz_err", match_nsegment , seg_dz_err);
164 }
165 }
166 }
167 unSegNum = 0;
168 unTrkNum = 0;
169 EvInWindow = 0;
170 EvOutWindow = 0;
171
172 mg_mean_dr=0;
173 mg_mean_phi0=0;
174 mg_mean_kappa=0;
175 mg_mean_dz=0;
176 mg_mean_tanL=0;
177 mg_sig_dr=0;
178 mg_sig_phi0=0;
179 mg_sig_kappa=0;
180 mg_sig_dz=0;
181 mg_sig_tanL=0;
182
183 m_nPt=0;
184 if(mv_Pt.size()>0) {
185 cout<<"mv_Pt.size="<<mv_Pt.size()<<endl;
186 m_nPt = mv_Pt.size();
187 cout<<"pt[0]="<<mv_Pt[0]<<", pt[npt-1]="<<mv_Pt[m_nPt-1]<<endl;
188 if(mv_mean_dr.size()==m_nPt) mg_mean_dr = new TGraph(m_nPt, &mv_Pt[0], &mv_mean_dr[0]);
189 else cout<<"size of mean_dr != size of PT !"<<endl;
190
191 if(mv_mean_phi0.size()==m_nPt) mg_mean_phi0 = new TGraph(m_nPt, &mv_Pt[0], &mv_mean_phi0[0]);
192 else cout<<"size of mean_phi0 != size of PT !"<<endl;
193
194 if(mv_mean_kappa.size()==m_nPt)mg_mean_kappa= new TGraph(m_nPt, &mv_Pt[0], &mv_mean_kappa[0]);
195 else cout<<"size of mean_kappa != size of PT !"<<endl;
196
197 if(mv_mean_dz.size()==m_nPt) mg_mean_dz = new TGraph(m_nPt, &mv_Pt[0], &mv_mean_dz[0]);
198 else cout<<"size of mean_dz != size of PT !"<<endl;
199
200 if(mv_mean_tanL.size()==m_nPt) mg_mean_tanL = new TGraph(m_nPt, &mv_Pt[0], &mv_mean_tanL[0]);
201 else cout<<"size of mean_tanL != size of PT !"<<endl;
202
203 if(mv_sig_dr.size()==m_nPt) mg_sig_dr = new TGraph(m_nPt, &mv_Pt[0], &mv_sig_dr[0]);
204 else cout<<"size of sig_dr != size of PT !"<<endl;
205
206 if(mv_sig_phi0.size()==m_nPt) mg_sig_phi0 = new TGraph(m_nPt, &mv_Pt[0], &mv_sig_phi0[0]);
207 else cout<<"size of sig_phi0 != size of PT !"<<endl;
208
209 if(mv_sig_kappa.size()==m_nPt) mg_sig_kappa = new TGraph(m_nPt, &mv_Pt[0], &mv_sig_kappa[0]);
210 else cout<<"size of sig_kappa != size of PT !"<<endl;
211
212 if(mv_sig_dz.size()==m_nPt) mg_sig_dz = new TGraph(m_nPt, &mv_Pt[0], &mv_sig_dz[0]);
213 else cout<<"size of sig_dz != size of PT !"<<endl;
214
215 if(mv_sig_tanL.size()==m_nPt) mg_sig_tanL = new TGraph(m_nPt, &mv_Pt[0], &mv_sig_tanL[0]);
216 else cout<<"size of sig_tanL != size of PT !"<<endl;
217 }
218
219 return StatusCode::SUCCESS;
220
221}