BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
DQADtagAlg.cxx
Go to the documentation of this file.
1#include "GaudiKernel/MsgStream.h"
2#include "GaudiKernel/AlgFactory.h"
3#include "GaudiKernel/ISvcLocator.h"
4#include "GaudiKernel/SmartDataPtr.h"
5#include "GaudiKernel/IDataProviderSvc.h"
6#include "GaudiKernel/PropertyMgr.h"
7
9#include "EventModel/Event.h"
10
16
17#include "McTruth/McParticle.h"
18
19#include "TH1F.h"
20#include "TMath.h"
21#include "GaudiKernel/INTupleSvc.h"
22#include "GaudiKernel/NTuple.h"
23#include "GaudiKernel/ITHistSvc.h"
24#include "GaudiKernel/Bootstrap.h"
25#include "GaudiKernel/IHistogramSvc.h"
26
27#include "CLHEP/Vector/ThreeVector.h"
28#include "CLHEP/Vector/LorentzVector.h"
29#include "CLHEP/Vector/TwoVector.h"
30#include "CLHEP/Geometry/Point3D.h"
31
32using CLHEP::Hep3Vector;
33using CLHEP::Hep2Vector;
34using CLHEP::HepLorentzVector;
35#ifndef ENABLE_BACKWARDS_COMPATIBILITY
37#endif
38
41#include "VertexFit/VertexFit.h"
42#include "VertexFit/Helix.h"
44#include <vector>
45
46#include "DQADtagAlg/DQADtag.h"
49
50using namespace Event;
51//const double mpi = 0.13957;
52//const double mk = 0.493677;
53//const double mD0 = 1.86484;
54//const double xmass[5] = {0.000511, 0.105658, 0.139570,0.493677, 0.938272};
55////const double velc = 29.9792458; tof_path unit in cm.
56//const double velc = 299.792458; // tof path unit in mm
57//typedef std::vector<int> Vint;
58//typedef std::vector<HepLorentzVector> Vp4;
59const double mpsipp = 3.770;
60//double beamE = mpsipp/2;
61const HepLorentzVector ecms(0.011*mpsipp,0,0,mpsipp);
62const Hep3Vector u_cms = -ecms.boostVector();
63
65
66/////////////////////////////////////////////////////////////////////////////
67DECLARE_COMPONENT(DQADtag)
68DQADtag::DQADtag(const std::string& name, ISvcLocator* pSvcLocator) :
69 Algorithm(name, pSvcLocator) {
70
71 //Declare the properties
72 declareProperty("Vr0cut", m_vr0cut=1.0);
73 declareProperty("Vz0cut", m_vz0cut=10.0);
74 declareProperty("Vctcut", m_cthcut=0.93);
75 declareProperty("mpi0Max", m_mpi0Min =0.1);
76 declareProperty("mpi0Min", m_mpi0Max =0.16);
77 declareProperty("EnergyThreshold", m_energyThreshold=0.04);
78 declareProperty("BarrelEmc_th", m_Barrel_th = 0.82);
79 declareProperty("EndcapEmc_th_1", m_Endcap_th_1 = 0.85);
80 declareProperty("EndcapEmc_th_2", m_Endcap_th_2 = 0.93);
81 declareProperty("EnergyThreshold_b", m_energyThreshold_b=0.025);
82 declareProperty("EnergyThreshold_e", m_energyThreshold_e=0.05);
83 declareProperty("GammaAngCut", m_gammaAngCut=25.0);
84 declareProperty("ReadBeamEFromDB", m_ReadBeamEFromDB = false );
85 declareProperty("BeamE", m_beamE = 1.885 );
86 declareProperty("CheckDedx", m_checkDedx = 0);
87 declareProperty("CheckTof", m_checkTof = 0);
88 declareProperty("CheckVtx", m_checkVtx= 0);
89 declareProperty("CheckEvt", m_checkEvt= 0);
90 declareProperty("WriteTuple", m_writeTuple = 1);
91 declareProperty("Debug", m_debug = 0);
92 declareProperty("deltECut", m_deltECut = 0.03);
93 declareProperty("mpi0MaxCut", m_mpi0MinCut =0.117);
94 declareProperty("mpi0MinCut", m_mpi0MaxCut =0.145);
95 declareProperty("mKsMaxCut", m_mKsMaxCut = 0.505);
96 declareProperty("mKsMinCut", m_mKsMinCut = 0.49);
97 declareProperty("KsDLengthCut", m_KsDLengthCut = 12.0);
98 declareProperty("CheckDecayMode", m_checkDecayMode = 2);
99 declareProperty("ReadVertex", m_readVertex = true);
100 declareProperty("RegHist", m_regHist = 1);
101 m_vtxFit = VertexFit::instance();
102 m_2ndVtxFit = SecondVertexFit::instance();
103 HepPoint3D vx(0., 0., 0.);
104 HepSymMatrix Evx(3, 0);
105 double bx = 1E+6;
106 double by = 1E+6;
107 double bz = 1E+6;
108 Evx[0][0] = bx*bx;
109 Evx[1][1] = by*by;
110 Evx[2][2] = bz*bz;
111 m_vxpar.setVx(vx);
112 m_vxpar.setEvx(Evx);
113 m_privxpar.setVx(vx);
114 m_privxpar.setEvx(Evx);
115 //log = MsgStream(msgSvc(), name());
116 TString strDecayModeName[6] = {"mBC","deltE","p","charm","mass","e"};
117 m_decayModeHistName[0] = "mBC";
118 m_decayModeHistName[1] = "deltE";
119 m_decayModeHistName[2] = "mass";
120 for (int i=0;i!=6;i++)
121 {
122 m_DecayModeItemName[i] = strDecayModeName[i];
123 }
124 //for (int i=0;i!=6;i++)
125 //{
126 //cout<<"m_DecayModeItemName: "<<m_DecayModeItemName[i]<<endl;
127 //}
128 TString strTrkName[10] = {"px","py","pz","pp","vx","vy","vz","vr0","cos","E"};
129 m_TrackItemName[10] = "Id";
130 for (int i=0;i!=10;i++)
131 {
132 m_trackHistName[i] = strTrkName[i];
133 m_TrackItemName[i] = strTrkName[i];
134 }
135 TString strPhotonName[5] = {"numHits","secondmoment","x","y","z"};
136 m_PhotonItemName[5] = "Id_Emc";
137 for (int i=0;i!=5;i++)
138 {
139 m_photonHistName[i] = strPhotonName[i];
140 m_PhotonItemName[i] = strPhotonName[i];
141 }
142 TString strTrkDedxName[6] = {"chik","chipi","ghit","thit","probPH","normPH"};
143 for (int i=0;i!=6;i++)
144 {
145 m_trackDedxHistName[i] = strTrkDedxName[i];
146 m_TrackDedxItemName[i] = strTrkDedxName[i];
147 }
148 m_TrackDedxItemName[6] = "Id_Dedx";
149 TString strTrkTofName[6] = {"br_toff_mu","br_toff_pi","br_toff_k","ec_toff_mu","ec_toff_pi","ec_toff_k" };
150 for (int i=0;i!=6;i++)
151 {
152 m_trackTofHistName[i] = strTrkTofName[i];
153 m_TrackTofItemName[i] = strTrkTofName[i];
154 }
155 m_TrackTofItemName[6] = "Id_tof";
156 m_TrackTofItemName[7] = "ec_toff_isEast";
157 TString strKsName[4] = {"vfitmass","mass","dLength","dLengthErrorRatio"};
158 for (int i=0;i!=4;i++)
159 {
160 m_KsHistName[i] = strKsName[i];
161 m_KsItemName[i] = strKsName[i];
162 }
163 m_KsItemName[4] = "pvchi2";
164 m_KsItemName[5] = "svchi2";
165 TString strPi0Name[7] = {"pi0mass","photon1_E","photon1_cos","photon2_E","photon2_cos","photon1_Id","photon2_Id"};
166 for (int i=0;i!=5;i++)
167 {
168 m_Pi0HistName[i] = strPi0Name[i];
169 m_Pi0ItemName[i] = strPi0Name[i];
170 }
171 m_Pi0ItemName[5] = "photon1_Id";
172 m_Pi0ItemName[6] = "photon2_Id";
173
174 }
175
176// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
178 MsgStream log(msgSvc(), name());
179
180 log << MSG::INFO << "in initialize()" << endmsg;
181
182 m_irun=-100;
183
184 StatusCode status;
185
186 NTuplePtr nt2(ntupleSvc(), "DQAFILE/CheckVtx");
187 if ( nt2 ) m_tuple2 = nt2;
188 else {
189 m_tuple2 = ntupleSvc()->book ("DQAFILE/CheckVtx", CLID_ColumnWiseTuple, "ks N-Tuple example");
190 if ( m_tuple2 ) {
191 status = m_tuple2->addItem ("vtxTrkId",m_vtxTrkId);
192 status = m_tuple2->addItem ("vx0", m_vx0);
193 status = m_tuple2->addItem ("vy0", m_vy0);
194 status = m_tuple2->addItem ("vz0", m_vz0);
195 status = m_tuple2->addItem ("vr0", m_vr0);
196 status = m_tuple2->addItem ("vct", m_Vct);
197 }
198 else {
199 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple2) << endmsg;
200 return StatusCode::FAILURE;
201 }
202 }
203
204 NTuplePtr nt4(ntupleSvc(), "DQAFILE/Dtag");
205 if ( nt4 ) m_tuple4 = nt4;
206 else {
207 m_tuple4 = ntupleSvc()->book ("DQAFILE/Dtag", CLID_ColumnWiseTuple, "ks N-Tuple example");
208 if ( m_tuple4 ) {
209 status = m_tuple4->addItem ("run", m_run);
210 status = m_tuple4->addItem ("rec", m_rec);
211 status = m_tuple4->addItem ("nch", m_nch);
212 status = m_tuple4->addItem ("nneu", m_nneu);
213 status = m_tuple4->addItem ("numD0Mode", m_numD0Mode);
214 status = m_tuple4->addItem ("D0_mBC", m_D0_mBC);
215 status = m_tuple4->addItem ("D0_deltE", m_D0_deltE);
216 status = m_tuple4->addItem ("D0_mass", m_D0_mass);
217 status = m_tuple4->addItem ("numDCMode", m_numDCMode);
218 status = m_tuple4->addItem ("DC_mBC", m_DC_mBC);
219 status = m_tuple4->addItem ("DC_deltE", m_DC_deltE);
220 status = m_tuple4->addItem ("DC_mass", m_DC_mass);
221 status = m_tuple4->addItem ("numAllMode", m_numAllMode);
222 status = m_tuple4->addItem ("DtagbeamE", m_dtagbeamE);
223 status = m_tuple4->addItem ("mode", m_mode);
224 status = m_tuple4->addItem ("charge", m_charge);
225 status = m_tuple4->addItem ("charm", m_charm);
226 status = m_tuple4->addItem ("numchildren", m_numofchildren);
227 status = m_tuple4->addItem ("mass", m_mass);
228 status = m_tuple4->addItem ("mBC", m_mBC);
229 status = m_tuple4->addItem ("rflag", m_rflag);
230 status = m_tuple4->addItem ("deltaE", m_deltae);
231 status = m_tuple4->addItem ("E", m_e);
232 status = m_tuple4->addItem ("p", m_p);
233 status = m_tuple4->addItem ("p_CMS", m_p_CMS);
234 status = m_tuple4->addItem ("p4_CMS", 4, m_p4_CMS);
235 status = m_tuple4->addItem ("notherTrk", m_nothertrk);
236 status = m_tuple4->addItem ("nTrk", m_ntrk);
237 status = m_tuple4->addItem ("nothershower", m_nothershower);
238 status = m_tuple4->addItem ("nshower", m_nshower);
239 status = m_tuple4->addItem ( "recNumD02KPi", m_recNumD02KPi);
240 status = m_tuple4->addItem ("D02KPi_e", m_D02KPi_e);
241 status = m_tuple4->addItem ("D02KPi_p", m_D02KPi_p);
242 status = m_tuple4->addItem ("D02KPi_mBC", m_D02KPi_mBC);
243 status = m_tuple4->addItem ("D02KPi_mass", m_D02KPi_mass);
244 status = m_tuple4->addItem ("D02KPi_deltE", m_D02KPi_deltE);
245 status = m_tuple4->addItem ("D02KPi_charm", m_D02KPi_charm);
246 status = m_tuple4->addItem ("D02KPi_kaon_pp", m_D02KPi_kaon_pp);
247 status = m_tuple4->addItem ("D02KPi_pion_pp", m_D02KPi_pion_pp);
248 status = m_tuple4->addItem ("D02KPi_kaon_vx", m_D02KPi_kaon_vx);
249 status = m_tuple4->addItem ("D02KPi_kaon_vy", m_D02KPi_kaon_vy);
250 status = m_tuple4->addItem ("D02KPi_kaon_vz", m_D02KPi_kaon_vz);
251 status = m_tuple4->addItem ("D02KPi_kaon_vr0", m_D02KPi_kaon_vr0);
252 status = m_tuple4->addItem ("D02KPi_kaon_px", m_D02KPi_kaon_px);
253 status = m_tuple4->addItem ("D02KPi_kaon_py", m_D02KPi_kaon_py);
254 status = m_tuple4->addItem ("D02KPi_kaon_pz", m_D02KPi_kaon_pz);
255 status = m_tuple4->addItem ("D02KPi_kaon_E", m_D02KPi_kaon_E);
256 status = m_tuple4->addItem ("D02KPi_kaon_cos", m_D02KPi_kaon_cos);
257 status = m_tuple4->addItem ("D02KPi_pion_vx", m_D02KPi_pion_vx);
258 status = m_tuple4->addItem ("D02KPi_pion_vy", m_D02KPi_pion_vy);
259 status = m_tuple4->addItem ("D02KPi_pion_vz", m_D02KPi_pion_vz);
260 status = m_tuple4->addItem ("D02KPi_pion_vr0", m_D02KPi_pion_vr0);
261 status = m_tuple4->addItem ("D02KPi_pion_px", m_D02KPi_pion_px);
262 status = m_tuple4->addItem ("D02KPi_pion_py", m_D02KPi_pion_py);
263 status = m_tuple4->addItem ("D02KPi_pion_pz", m_D02KPi_pion_pz);
264 status = m_tuple4->addItem ("D02KPi_pion_E", m_D02KPi_pion_E);
265 status = m_tuple4->addItem ("D02KPi_pion_cos", m_D02KPi_pion_cos);
266 status = m_tuple4->addItem ("D02KPi_kaon_Id", m_D02KPi_kaon_Id);
267 status = m_tuple4->addItem ("D02KPi_pion_Id", m_D02KPi_pion_Id);
268 status = m_tuple4->addItem ( "recNumD02KPiPi0", m_recNumD02KPiPi0);
269 status = m_tuple4->addItem ("D02KPiPi0_e", m_D02KPiPi0_e);
270 status = m_tuple4->addItem ("D02KPiPi0_p", m_D02KPiPi0_p);
271 status = m_tuple4->addItem ("D02KPiPi0_mBC", m_D02KPiPi0_mBC);
272 status = m_tuple4->addItem ("D02KPiPi0_mass", m_D02KPiPi0_mass);
273 status = m_tuple4->addItem ("D02KPiPi0_deltE", m_D02KPiPi0_deltE);
274 status = m_tuple4->addItem ("D02KPiPi0_charm", m_D02KPiPi0_charm);
275 status = m_tuple4->addItem ("D02KPiPi0_kaon_pp", m_D02KPiPi0_kaon_pp);
276 status = m_tuple4->addItem ("D02KPiPi0_pion_pp", m_D02KPiPi0_pion_pp);
277 status = m_tuple4->addItem ("D02KPiPi0_kaon_Id", m_D02KPiPi0_kaon_Id);
278 status = m_tuple4->addItem ("D02KPiPi0_pion_Id", m_D02KPiPi0_pion_Id);
279 status = m_tuple4->addItem ("D02KPiPi0_kaon_vx", m_D02KPiPi0_kaon_vx);
280 status = m_tuple4->addItem ("D02KPiPi0_kaon_vy", m_D02KPiPi0_kaon_vy);
281 status = m_tuple4->addItem ("D02KPiPi0_kaon_vz", m_D02KPiPi0_kaon_vz);
282 status = m_tuple4->addItem ("D02KPiPi0_kaon_vr0", m_D02KPiPi0_kaon_vr0);
283 status = m_tuple4->addItem ("D02KPiPi0_kaon_px", m_D02KPiPi0_kaon_px);
284 status = m_tuple4->addItem ("D02KPiPi0_kaon_py", m_D02KPiPi0_kaon_py);
285 status = m_tuple4->addItem ("D02KPiPi0_kaon_pz", m_D02KPiPi0_kaon_pz);
286 status = m_tuple4->addItem ("D02KPiPi0_kaon_E", m_D02KPiPi0_kaon_E);
287 status = m_tuple4->addItem ("D02KPiPi0_kaon_cos", m_D02KPiPi0_kaon_cos);
288 status = m_tuple4->addItem ("D02KPiPi0_pion_vx", m_D02KPiPi0_pion_vx);
289 status = m_tuple4->addItem ("D02KPiPi0_pion_vy", m_D02KPiPi0_pion_vy);
290 status = m_tuple4->addItem ("D02KPiPi0_pion_vz", m_D02KPiPi0_pion_vz);
291 status = m_tuple4->addItem ("D02KPiPi0_pion_vr0", m_D02KPiPi0_pion_vr0);
292 status = m_tuple4->addItem ("D02KPiPi0_pion_px", m_D02KPiPi0_pion_px);
293 status = m_tuple4->addItem ("D02KPiPi0_pion_py", m_D02KPiPi0_pion_py);
294 status = m_tuple4->addItem ("D02KPiPi0_pion_pz", m_D02KPiPi0_pion_pz);
295 status = m_tuple4->addItem ("D02KPiPi0_pion_E", m_D02KPiPi0_pion_E);
296 status = m_tuple4->addItem ("D02KPiPi0_pion_cos", m_D02KPiPi0_pion_cos);
297 status = m_tuple4->addItem ("D02KPiPi0_pi0mass", m_D02KPiPi0_pi0mass);
298 status = m_tuple4->addItem ("D02KPiPi0_photon1_Id", m_D02KPiPi0_photon1_Id);
299 status = m_tuple4->addItem ("D02KPiPi0_photon2_Id", m_D02KPiPi0_photon2_Id);
300 status = m_tuple4->addItem ("D02KPiPi0_photon1_E", m_D02KPiPi0_photon1_E);
301 status = m_tuple4->addItem ("D02KPiPi0_photon2_E", m_D02KPiPi0_photon2_E);
302 status = m_tuple4->addItem ("D02KPiPi0_photon1_cos", m_D02KPiPi0_photon1_cos);
303 status = m_tuple4->addItem ("D02KPiPi0_photon2_cos", m_D02KPiPi0_photon2_cos);
304 status = m_tuple4->addItem ( "recNumD02KPiPiPi", m_recNumD02KPiPiPi);
305 status = m_tuple4->addItem ("D02KPiPiPi_e", m_D02KPiPiPi_e);
306 status = m_tuple4->addItem ("D02KPiPiPi_p", m_D02KPiPiPi_p);
307 status = m_tuple4->addItem ("D02KPiPiPi_mBC", m_D02KPiPiPi_mBC);
308 status = m_tuple4->addItem ("D02KPiPiPi_mass", m_D02KPiPiPi_mass);
309 status = m_tuple4->addItem ("D02KPiPiPi_deltE", m_D02KPiPiPi_deltE);
310 status = m_tuple4->addItem ("D02KPiPiPi_charm", m_D02KPiPiPi_charm);
311 status = m_tuple4->addItem ("D02KPiPiPi_kaon_pp", m_D02KPiPiPi_kaon_pp);
312 status = m_tuple4->addItem ("D02KPiPiPi_pion1_pp", m_D02KPiPiPi_pion1_pp);
313 status = m_tuple4->addItem ("D02KPiPiPi_pion2_pp", m_D02KPiPiPi_pion2_pp);
314 status = m_tuple4->addItem ("D02KPiPiPi_pion3_pp", m_D02KPiPiPi_pion3_pp);
315 status = m_tuple4->addItem ("D02KPiPiPi_kaon_Id", m_D02KPiPiPi_kaon_Id);
316 status = m_tuple4->addItem ("D02KPiPiPi_pion1_Id", m_D02KPiPiPi_pion1_Id);
317 status = m_tuple4->addItem ("D02KPiPiPi_pion2_Id", m_D02KPiPiPi_pion2_Id);
318 status = m_tuple4->addItem ("D02KPiPiPi_pion3_Id", m_D02KPiPiPi_pion3_Id);
319 status = m_tuple4->addItem ( "recNumD02KPiPiPiPi0", m_recNumD02KPiPiPiPi0);
320 status = m_tuple4->addItem ("D02KPiPiPiPi0_e", m_D02KPiPiPiPi0_e);
321 status = m_tuple4->addItem ("D02KPiPiPiPi0_p", m_D02KPiPiPiPi0_p);
322 status = m_tuple4->addItem ("D02KPiPiPiPi0_mBC", m_D02KPiPiPiPi0_mBC);
323 status = m_tuple4->addItem ("D02KPiPiPiPi0_mass", m_D02KPiPiPiPi0_mass);
324 status = m_tuple4->addItem ("D02KPiPiPiPi0_deltE", m_D02KPiPiPiPi0_deltE);
325 status = m_tuple4->addItem ("D02KPiPiPiPi0_charm", m_D02KPiPiPiPi0_charm);
326 status = m_tuple4->addItem ("D02KPiPiPiPi0_kaon_pp", m_D02KPiPiPiPi0_kaon_pp);
327 status = m_tuple4->addItem ("D02KPiPiPiPi0_pion1_pp", m_D02KPiPiPiPi0_pion1_pp);
328 status = m_tuple4->addItem ("D02KPiPiPiPi0_pion2_pp", m_D02KPiPiPiPi0_pion2_pp);
329 status = m_tuple4->addItem ("D02KPiPiPiPi0_pion3_pp", m_D02KPiPiPiPi0_pion3_pp);
330 status = m_tuple4->addItem ("D02KPiPiPiPi0_kaon_Id", m_D02KPiPiPiPi0_kaon_Id);
331 status = m_tuple4->addItem ("D02KPiPiPiPi0_pion1_Id", m_D02KPiPiPiPi0_pion1_Id);
332 status = m_tuple4->addItem ("D02KPiPiPiPi0_pion2_Id", m_D02KPiPiPiPi0_pion2_Id);
333 status = m_tuple4->addItem ("D02KPiPiPiPi0_pion3_Id", m_D02KPiPiPiPi0_pion3_Id);
334 status = m_tuple4->addItem ("D02KPiPiPiPi0_pi0mass", m_D02KPiPiPiPi0_pi0mass);
335 status = m_tuple4->addItem ("D02KPiPiPiPi0_photon1_Id", m_D02KPiPiPiPi0_photon1_Id);
336 status = m_tuple4->addItem ("D02KPiPiPiPi0_photon2_Id", m_D02KPiPiPiPi0_photon2_Id);
337 status = m_tuple4->addItem ("D02KPiPiPiPi0_photon1_E", m_D02KPiPiPiPi0_photon1_E);
338 status = m_tuple4->addItem ("D02KPiPiPiPi0_photon2_E", m_D02KPiPiPiPi0_photon2_E);
339 status = m_tuple4->addItem ("D02KPiPiPiPi0_photon1_cos", m_D02KPiPiPiPi0_photon1_cos);
340 status = m_tuple4->addItem ("D02KPiPiPiPi0_photon2_cos", m_D02KPiPiPiPi0_photon2_cos);
341 status = m_tuple4->addItem ( "recNumD02KsPiPi", m_recNumD02KsPiPi);
342 status = m_tuple4->addItem ("D02KsPiPi_e", m_D02KsPiPi_e);
343 status = m_tuple4->addItem ("D02KsPiPi_p", m_D02KsPiPi_p);
344 status = m_tuple4->addItem ("D02KsPiPi_mBC", m_D02KsPiPi_mBC);
345 status = m_tuple4->addItem ("D02KsPiPi_mass", m_D02KsPiPi_mass);
346 status = m_tuple4->addItem ("D02KsPiPi_deltE", m_D02KsPiPi_deltE);
347 status = m_tuple4->addItem ("D02KsPiPi_charm", m_D02KsPiPi_charm);
348 status = m_tuple4->addItem ("D02KsPiPi_pion1_pp", m_D02KsPiPi_pion1_pp);
349 status = m_tuple4->addItem ("D02KsPiPi_pion2_pp", m_D02KsPiPi_pion2_pp);
350 status = m_tuple4->addItem ("D02KsPiPi_pion3_pp", m_D02KsPiPi_pion3_pp);
351 status = m_tuple4->addItem ("D02KsPiPi_pion4_pp", m_D02KsPiPi_pion4_pp);
352 status = m_tuple4->addItem ("D02KsPiPi_pion1_Id", m_D02KsPiPi_pion1_Id);
353 status = m_tuple4->addItem ("D02KsPiPi_pion2_Id", m_D02KsPiPi_pion2_Id);
354 status = m_tuple4->addItem ("D02KsPiPi_pion3_Id", m_D02KsPiPi_pion3_Id);
355 status = m_tuple4->addItem ("D02KsPiPi_pion4_Id", m_D02KsPiPi_pion4_Id);
356 status = m_tuple4->addItem ("D02KsPiPi_pion1_vx", m_D02KsPiPi_pion1_vx);
357 status = m_tuple4->addItem ("D02KsPiPi_pion1_vy", m_D02KsPiPi_pion1_vy);
358 status = m_tuple4->addItem ("D02KsPiPi_pion1_vz", m_D02KsPiPi_pion1_vz);
359 status = m_tuple4->addItem ("D02KsPiPi_pion1_vr0", m_D02KsPiPi_pion1_vr0);
360 status = m_tuple4->addItem ("D02KsPiPi_pion1_px", m_D02KsPiPi_pion1_px);
361 status = m_tuple4->addItem ("D02KsPiPi_pion1_py", m_D02KsPiPi_pion1_py);
362 status = m_tuple4->addItem ("D02KsPiPi_pion1_pz", m_D02KsPiPi_pion1_pz);
363 status = m_tuple4->addItem ("D02KsPiPi_pion1_pp", m_D02KsPiPi_pion1_pp);
364 status = m_tuple4->addItem ("D02KsPiPi_pion1_E", m_D02KsPiPi_pion1_E);
365 status = m_tuple4->addItem ("D02KsPiPi_pion1_cos", m_D02KsPiPi_pion1_cos);
366 status = m_tuple4->addItem ("D02KsPiPi_pion2_vx", m_D02KsPiPi_pion2_vx);
367 status = m_tuple4->addItem ("D02KsPiPi_pion2_vy", m_D02KsPiPi_pion2_vy);
368 status = m_tuple4->addItem ("D02KsPiPi_pion2_vz", m_D02KsPiPi_pion2_vz);
369 status = m_tuple4->addItem ("D02KsPiPi_pion2_vr0", m_D02KsPiPi_pion2_vr0);
370 status = m_tuple4->addItem ("D02KsPiPi_pion2_px", m_D02KsPiPi_pion2_px);
371 status = m_tuple4->addItem ("D02KsPiPi_pion2_py", m_D02KsPiPi_pion2_py);
372 status = m_tuple4->addItem ("D02KsPiPi_pion2_pz", m_D02KsPiPi_pion2_pz);
373 status = m_tuple4->addItem ("D02KsPiPi_pion2_pp", m_D02KsPiPi_pion2_pp);
374 status = m_tuple4->addItem ("D02KsPiPi_pion2_E", m_D02KsPiPi_pion2_E);
375 status = m_tuple4->addItem ("D02KsPiPi_pion2_cos", m_D02KsPiPi_pion2_cos);
376 status = m_tuple4->addItem ("D02KsPiPi_pion3_vx", m_D02KsPiPi_pion3_vx);
377 status = m_tuple4->addItem ("D02KsPiPi_pion3_vy", m_D02KsPiPi_pion3_vy);
378 status = m_tuple4->addItem ("D02KsPiPi_pion3_vz", m_D02KsPiPi_pion3_vz);
379 status = m_tuple4->addItem ("D02KsPiPi_pion3_vr0", m_D02KsPiPi_pion3_vr0);
380 status = m_tuple4->addItem ("D02KsPiPi_pion3_px", m_D02KsPiPi_pion3_px);
381 status = m_tuple4->addItem ("D02KsPiPi_pion3_py", m_D02KsPiPi_pion3_py);
382 status = m_tuple4->addItem ("D02KsPiPi_pion3_pz", m_D02KsPiPi_pion3_pz);
383 status = m_tuple4->addItem ("D02KsPiPi_pion3_pp", m_D02KsPiPi_pion3_pp);
384 status = m_tuple4->addItem ("D02KsPiPi_pion3_E", m_D02KsPiPi_pion3_E);
385 status = m_tuple4->addItem ("D02KsPiPi_pion3_cos", m_D02KsPiPi_pion3_cos);
386 status = m_tuple4->addItem ("D02KsPiPi_pion4_vx", m_D02KsPiPi_pion4_vx);
387 status = m_tuple4->addItem ("D02KsPiPi_pion4_vy", m_D02KsPiPi_pion4_vy);
388 status = m_tuple4->addItem ("D02KsPiPi_pion4_vz", m_D02KsPiPi_pion4_vz);
389 status = m_tuple4->addItem ("D02KsPiPi_pion4_vr0", m_D02KsPiPi_pion4_vr0);
390 status = m_tuple4->addItem ("D02KsPiPi_pion4_px", m_D02KsPiPi_pion4_px);
391 status = m_tuple4->addItem ("D02KsPiPi_pion4_py", m_D02KsPiPi_pion4_py);
392 status = m_tuple4->addItem ("D02KsPiPi_pion4_pz", m_D02KsPiPi_pion4_pz);
393 status = m_tuple4->addItem ("D02KsPiPi_pion4_pp", m_D02KsPiPi_pion4_pp);
394 status = m_tuple4->addItem ("D02KsPiPi_pion4_E", m_D02KsPiPi_pion4_E);
395 status = m_tuple4->addItem ("D02KsPiPi_pion4_cos", m_D02KsPiPi_pion4_cos);
396 status = m_tuple4->addItem ("D02KsPiPi_ks_mass", m_D02KsPiPi_ks_mass);
397 status = m_tuple4->addItem ("D02KsPiPi_ks_vfitmass", m_D02KsPiPi_ks_vfitmass);
398 status = m_tuple4->addItem ("D02KsPiPi_ks_pvchi2", m_D02KsPiPi_ks_pvchi2);
399 status = m_tuple4->addItem ("D02KsPiPi_ks_svchi2", m_D02KsPiPi_ks_svchi2);
400 status = m_tuple4->addItem ("D02KsPiPi_ks_dLength", m_D02KsPiPi_ks_dLength);
401 status = m_tuple4->addItem ("D02KsPiPi_ks_dLengthErrorRatio", m_D02KsPiPi_ks_dLengthErrorRatio);
402 status = m_tuple4->addItem ( "recNumD02KsPiPiPi0", m_recNumD02KsPiPiPi0);
403 status = m_tuple4->addItem ("D02KsPiPiPi0_e", m_D02KsPiPiPi0_e);
404 status = m_tuple4->addItem ("D02KsPiPiPi0_p", m_D02KsPiPiPi0_p);
405 status = m_tuple4->addItem ("D02KsPiPiPi0_mBC", m_D02KsPiPiPi0_mBC);
406 status = m_tuple4->addItem ("D02KsPiPiPi0_mass", m_D02KsPiPiPi0_mass);
407 status = m_tuple4->addItem ("D02KsPiPiPi0_deltE", m_D02KsPiPiPi0_deltE);
408 status = m_tuple4->addItem ("D02KsPiPiPi0_charm", m_D02KsPiPiPi0_charm);
409 status = m_tuple4->addItem ("D02KsPiPiPi0_pion1_pp", m_D02KsPiPiPi0_pion1_pp);
410 status = m_tuple4->addItem ("D02KsPiPiPi0_pion2_pp", m_D02KsPiPiPi0_pion2_pp);
411 status = m_tuple4->addItem ("D02KsPiPiPi0_pion3_pp", m_D02KsPiPiPi0_pion3_pp);
412 status = m_tuple4->addItem ("D02KsPiPiPi0_pion4_pp", m_D02KsPiPiPi0_pion4_pp);
413 status = m_tuple4->addItem ("D02KsPiPiPi0_pion1_Id", m_D02KsPiPiPi0_pion1_Id);
414 status = m_tuple4->addItem ("D02KsPiPiPi0_pion2_Id", m_D02KsPiPiPi0_pion2_Id);
415 status = m_tuple4->addItem ("D02KsPiPiPi0_pion3_Id", m_D02KsPiPiPi0_pion3_Id);
416 status = m_tuple4->addItem ("D02KsPiPiPi0_pion4_Id", m_D02KsPiPiPi0_pion4_Id);
417 status = m_tuple4->addItem ("D02KsPiPiPi0_pi0mass", m_D02KsPiPiPi0_pi0mass);
418 status = m_tuple4->addItem ("D02KsPiPiPi0_photon1_Id", m_D02KsPiPiPi0_photon1_Id);
419 status = m_tuple4->addItem ("D02KsPiPiPi0_photon2_Id", m_D02KsPiPiPi0_photon2_Id);
420 status = m_tuple4->addItem ("D02KsPiPiPi0_photon1_E", m_D02KsPiPiPi0_photon1_E);
421 status = m_tuple4->addItem ("D02KsPiPiPi0_photon2_E", m_D02KsPiPiPi0_photon2_E);
422 status = m_tuple4->addItem ("D02KsPiPiPi0_photon1_cos", m_D02KsPiPiPi0_photon1_cos);
423 status = m_tuple4->addItem ("D02KsPiPiPi0_photon2_cos", m_D02KsPiPiPi0_photon2_cos);
424 status = m_tuple4->addItem ("D02KsPiPiPi0_ks_mass", m_D02KsPiPiPi0_ks_mass);
425 status = m_tuple4->addItem ("D02KsPiPiPi0_ks_vfitmass", m_D02KsPiPiPi0_ks_vfitmass);
426 status = m_tuple4->addItem ("D02KsPiPiPi0_ks_pvchi2", m_D02KsPiPiPi0_ks_pvchi2);
427 status = m_tuple4->addItem ("D02KsPiPiPi0_ks_svchi2", m_D02KsPiPiPi0_ks_svchi2);
428 status = m_tuple4->addItem ("D02KsPiPiPi0_ks_dLength", m_D02KsPiPiPi0_ks_dLength);
429 status = m_tuple4->addItem ("D02KsPiPiPi0_ks_dLengthErrorRatio", m_D02KsPiPiPi0_ks_dLengthErrorRatio);
430 status = m_tuple4->addItem ( "recNumDC2KPiPi", m_recNumDC2KPiPi);
431 status = m_tuple4->addItem ("DC2KPiPi_e", m_DC2KPiPi_e);
432 status = m_tuple4->addItem ("DC2KPiPi_p", m_DC2KPiPi_p);
433 status = m_tuple4->addItem ("DC2KPiPi_mBC", m_DC2KPiPi_mBC);
434 status = m_tuple4->addItem ("DC2KPiPi_mass", m_DC2KPiPi_mass);
435 status = m_tuple4->addItem ("DC2KPiPi_deltE", m_DC2KPiPi_deltE);
436 status = m_tuple4->addItem ("DC2KPiPi_charge", m_DC2KPiPi_charge);
437 status = m_tuple4->addItem ("DC2KPiPi_charm", m_DC2KPiPi_charm);
438 status = m_tuple4->addItem ("DC2KPiPi_kaon_pp", m_DC2KPiPi_kaon_pp);
439 status = m_tuple4->addItem ("DC2KPiPi_pion1_pp", m_DC2KPiPi_pion1_pp);
440 status = m_tuple4->addItem ("DC2KPiPi_pion2_pp", m_DC2KPiPi_pion2_pp);
441 status = m_tuple4->addItem ("DC2KPiPi_kaon_Id", m_DC2KPiPi_kaon_Id);
442 status = m_tuple4->addItem ("DC2KPiPi_pion1_Id", m_DC2KPiPi_pion1_Id);
443 status = m_tuple4->addItem ("DC2KPiPi_pion2_Id", m_DC2KPiPi_pion2_Id);
444 status = m_tuple4->addItem ("DC2KPiPi_kaon_vx", m_DC2KPiPi_kaon_vx);
445 status = m_tuple4->addItem ("DC2KPiPi_kaon_vy", m_DC2KPiPi_kaon_vy);
446 status = m_tuple4->addItem ("DC2KPiPi_kaon_vz", m_DC2KPiPi_kaon_vz);
447 status = m_tuple4->addItem ("DC2KPiPi_kaon_vr0", m_DC2KPiPi_kaon_vr0);
448 status = m_tuple4->addItem ("DC2KPiPi_kaon_px", m_DC2KPiPi_kaon_px);
449 status = m_tuple4->addItem ("DC2KPiPi_kaon_py", m_DC2KPiPi_kaon_py);
450 status = m_tuple4->addItem ("DC2KPiPi_kaon_pz", m_DC2KPiPi_kaon_pz);
451 status = m_tuple4->addItem ("DC2KPiPi_kaon_E", m_DC2KPiPi_kaon_E);
452 status = m_tuple4->addItem ("DC2KPiPi_kaon_cos", m_DC2KPiPi_kaon_cos);
453 status = m_tuple4->addItem ("DC2KPiPi_pion1_vx", m_DC2KPiPi_pion1_vx);
454 status = m_tuple4->addItem ("DC2KPiPi_pion1_vy", m_DC2KPiPi_pion1_vy);
455 status = m_tuple4->addItem ("DC2KPiPi_pion1_vz", m_DC2KPiPi_pion1_vz);
456 status = m_tuple4->addItem ("DC2KPiPi_pion1_vr0", m_DC2KPiPi_pion1_vr0);
457 status = m_tuple4->addItem ("DC2KPiPi_pion1_px", m_DC2KPiPi_pion1_px);
458 status = m_tuple4->addItem ("DC2KPiPi_pion1_py", m_DC2KPiPi_pion1_py);
459 status = m_tuple4->addItem ("DC2KPiPi_pion1_pz", m_DC2KPiPi_pion1_pz);
460 status = m_tuple4->addItem ("DC2KPiPi_pion1_E", m_DC2KPiPi_pion1_E);
461 status = m_tuple4->addItem ("DC2KPiPi_pion1_cos", m_DC2KPiPi_pion1_cos);
462 status = m_tuple4->addItem ("DC2KPiPi_pion2_vx", m_DC2KPiPi_pion2_vx);
463 status = m_tuple4->addItem ("DC2KPiPi_pion2_vy", m_DC2KPiPi_pion2_vy);
464 status = m_tuple4->addItem ("DC2KPiPi_pion2_vz", m_DC2KPiPi_pion2_vz);
465 status = m_tuple4->addItem ("DC2KPiPi_pion2_vr0", m_DC2KPiPi_pion2_vr0);
466 status = m_tuple4->addItem ("DC2KPiPi_pion2_px", m_DC2KPiPi_pion2_px);
467 status = m_tuple4->addItem ("DC2KPiPi_pion2_py", m_DC2KPiPi_pion2_py);
468 status = m_tuple4->addItem ("DC2KPiPi_pion2_pz", m_DC2KPiPi_pion2_pz);
469 status = m_tuple4->addItem ("DC2KPiPi_pion2_E", m_DC2KPiPi_pion2_E);
470 status = m_tuple4->addItem ("DC2KPiPi_pion2_cos", m_DC2KPiPi_pion2_cos);
471 status = m_tuple4->addItem ( "recNumDC2KPiPiPi0", m_recNumDC2KPiPiPi0);
472 status = m_tuple4->addItem ("DC2KPiPiPi0_e", m_DC2KPiPiPi0_e);
473 status = m_tuple4->addItem ("DC2KPiPiPi0_p", m_DC2KPiPiPi0_p);
474 status = m_tuple4->addItem ("DC2KPiPiPi0_mBC", m_DC2KPiPiPi0_mBC);
475 status = m_tuple4->addItem ("DC2KPiPiPi0_mass", m_DC2KPiPiPi0_mass);
476 status = m_tuple4->addItem ("DC2KPiPiPi0_deltE", m_DC2KPiPiPi0_deltE);
477 status = m_tuple4->addItem ("DC2KPiPiPi0_charge", m_DC2KPiPiPi0_charge);
478 status = m_tuple4->addItem ("DC2KPiPiPi0_charm", m_DC2KPiPiPi0_charm);
479 status = m_tuple4->addItem ("DC2KPiPiPi0_kaon_pp", m_DC2KPiPiPi0_kaon_pp);
480 status = m_tuple4->addItem ("DC2KPiPiPi0_pion1_pp", m_DC2KPiPiPi0_pion1_pp);
481 status = m_tuple4->addItem ("DC2KPiPiPi0_pion2_pp", m_DC2KPiPiPi0_pion2_pp);
482 status = m_tuple4->addItem ("DC2KPiPiPi0_kaon_Id", m_DC2KPiPiPi0_kaon_Id);
483 status = m_tuple4->addItem ("DC2KPiPiPi0_pion1_Id", m_DC2KPiPiPi0_pion1_Id);
484 status = m_tuple4->addItem ("DC2KPiPiPi0_pion2_Id", m_DC2KPiPiPi0_pion2_Id);
485 status = m_tuple4->addItem ("DC2KPiPiPi0_kaon_vx", m_DC2KPiPiPi0_kaon_vx);
486 status = m_tuple4->addItem ("DC2KPiPiPi0_kaon_vy", m_DC2KPiPiPi0_kaon_vy);
487 status = m_tuple4->addItem ("DC2KPiPiPi0_kaon_vz", m_DC2KPiPiPi0_kaon_vz);
488 status = m_tuple4->addItem ("DC2KPiPiPi0_kaon_vr0", m_DC2KPiPiPi0_kaon_vr0);
489 status = m_tuple4->addItem ("DC2KPiPiPi0_kaon_px", m_DC2KPiPiPi0_kaon_px);
490 status = m_tuple4->addItem ("DC2KPiPiPi0_kaon_py", m_DC2KPiPiPi0_kaon_py);
491 status = m_tuple4->addItem ("DC2KPiPiPi0_kaon_pz", m_DC2KPiPiPi0_kaon_pz);
492 status = m_tuple4->addItem ("DC2KPiPiPi0_kaon_E", m_DC2KPiPiPi0_kaon_E);
493 status = m_tuple4->addItem ("DC2KPiPiPi0_kaon_cos", m_DC2KPiPiPi0_kaon_cos);
494 status = m_tuple4->addItem ("DC2KPiPiPi0_pion1_vx", m_DC2KPiPiPi0_pion1_vx);
495 status = m_tuple4->addItem ("DC2KPiPiPi0_pion1_vy", m_DC2KPiPiPi0_pion1_vy);
496 status = m_tuple4->addItem ("DC2KPiPiPi0_pion1_vz", m_DC2KPiPiPi0_pion1_vz);
497 status = m_tuple4->addItem ("DC2KPiPiPi0_pion1_vr0", m_DC2KPiPiPi0_pion1_vr0);
498 status = m_tuple4->addItem ("DC2KPiPiPi0_pion1_px", m_DC2KPiPiPi0_pion1_px);
499 status = m_tuple4->addItem ("DC2KPiPiPi0_pion1_py", m_DC2KPiPiPi0_pion1_py);
500 status = m_tuple4->addItem ("DC2KPiPiPi0_pion1_pz", m_DC2KPiPiPi0_pion1_pz);
501 status = m_tuple4->addItem ("DC2KPiPiPi0_pion1_E", m_DC2KPiPiPi0_pion1_E);
502 status = m_tuple4->addItem ("DC2KPiPiPi0_pion1_cos", m_DC2KPiPiPi0_pion1_cos);
503 status = m_tuple4->addItem ("DC2KPiPiPi0_pion2_vx", m_DC2KPiPiPi0_pion2_vx);
504 status = m_tuple4->addItem ("DC2KPiPiPi0_pion2_vy", m_DC2KPiPiPi0_pion2_vy);
505 status = m_tuple4->addItem ("DC2KPiPiPi0_pion2_vz", m_DC2KPiPiPi0_pion2_vz);
506 status = m_tuple4->addItem ("DC2KPiPiPi0_pion2_vr0", m_DC2KPiPiPi0_pion2_vr0);
507 status = m_tuple4->addItem ("DC2KPiPiPi0_pion2_px", m_DC2KPiPiPi0_pion2_px);
508 status = m_tuple4->addItem ("DC2KPiPiPi0_pion2_py", m_DC2KPiPiPi0_pion2_py);
509 status = m_tuple4->addItem ("DC2KPiPiPi0_pion2_pz", m_DC2KPiPiPi0_pion2_pz);
510 status = m_tuple4->addItem ("DC2KPiPiPi0_pion2_E", m_DC2KPiPiPi0_pion2_E);
511 status = m_tuple4->addItem ("DC2KPiPiPi0_pion2_cos", m_DC2KPiPiPi0_pion2_cos);
512 status = m_tuple4->addItem ("DC2KPiPiPi0_pi0mass", m_DC2KPiPiPi0_pi0mass);
513 status = m_tuple4->addItem ("DC2KPiPiPi0_photon1_Id", m_DC2KPiPiPi0_photon1_Id);
514 status = m_tuple4->addItem ("DC2KPiPiPi0_photon2_Id", m_DC2KPiPiPi0_photon2_Id);
515 status = m_tuple4->addItem ("DC2KPiPiPi0_photon1_E", m_DC2KPiPiPi0_photon1_E);
516 status = m_tuple4->addItem ("DC2KPiPiPi0_photon2_E", m_DC2KPiPiPi0_photon2_E);
517 status = m_tuple4->addItem ("DC2KPiPiPi0_photon1_cos", m_DC2KPiPiPi0_photon1_cos);
518 status = m_tuple4->addItem ("DC2KPiPiPi0_photon2_cos", m_DC2KPiPiPi0_photon2_cos);
519 status = m_tuple4->addItem ( "recNumDC2KsPiPi0", m_recNumDC2KsPiPi0);
520 status = m_tuple4->addItem ("DC2KsPiPi0_e", m_DC2KsPiPi0_e);
521 status = m_tuple4->addItem ("DC2KsPiPi0_p", m_DC2KsPiPi0_p);
522 status = m_tuple4->addItem ("DC2KsPiPi0_mBC", m_DC2KsPiPi0_mBC);
523 status = m_tuple4->addItem ("DC2KsPiPi0_mass", m_DC2KsPiPi0_mass);
524 status = m_tuple4->addItem ("DC2KsPiPi0_deltE", m_DC2KsPiPi0_deltE);
525 status = m_tuple4->addItem ("DC2KsPiPi0_charge", m_DC2KsPiPi0_charge);
526 status = m_tuple4->addItem ("DC2KsPiPi0_charm", m_DC2KsPiPi0_charm);
527 status = m_tuple4->addItem ("DC2KsPiPi0_pion1_pp", m_DC2KsPiPi0_pion1_pp);
528 status = m_tuple4->addItem ("DC2KsPiPi0_pion2_pp", m_DC2KsPiPi0_pion2_pp);
529 status = m_tuple4->addItem ("DC2KsPiPi0_pion3_pp", m_DC2KsPiPi0_pion3_pp);
530 status = m_tuple4->addItem ("DC2KsPiPi0_pion1_Id", m_DC2KsPiPi0_pion1_Id);
531 status = m_tuple4->addItem ("DC2KsPiPi0_pion2_Id", m_DC2KsPiPi0_pion2_Id);
532 status = m_tuple4->addItem ("DC2KsPiPi0_pion3_Id", m_DC2KsPiPi0_pion3_Id);
533 status = m_tuple4->addItem ("DC2KsPiPi0_pion1_vx", m_DC2KsPiPi0_pion1_vx);
534 status = m_tuple4->addItem ("DC2KsPiPi0_pion1_vy", m_DC2KsPiPi0_pion1_vy);
535 status = m_tuple4->addItem ("DC2KsPiPi0_pion1_vz", m_DC2KsPiPi0_pion1_vz);
536 status = m_tuple4->addItem ("DC2KsPiPi0_pion1_vr0", m_DC2KsPiPi0_pion1_vr0);
537 status = m_tuple4->addItem ("DC2KsPiPi0_pion1_px", m_DC2KsPiPi0_pion1_px);
538 status = m_tuple4->addItem ("DC2KsPiPi0_pion1_py", m_DC2KsPiPi0_pion1_py);
539 status = m_tuple4->addItem ("DC2KsPiPi0_pion1_pz", m_DC2KsPiPi0_pion1_pz);
540 status = m_tuple4->addItem ("DC2KsPiPi0_pion1_E", m_DC2KsPiPi0_pion1_E);
541 status = m_tuple4->addItem ("DC2KsPiPi0_pion1_cos", m_DC2KsPiPi0_pion1_cos);
542 status = m_tuple4->addItem ("DC2KsPiPi0_pion2_vx", m_DC2KsPiPi0_pion2_vx);
543 status = m_tuple4->addItem ("DC2KsPiPi0_pion2_vy", m_DC2KsPiPi0_pion2_vy);
544 status = m_tuple4->addItem ("DC2KsPiPi0_pion2_vz", m_DC2KsPiPi0_pion2_vz);
545 status = m_tuple4->addItem ("DC2KsPiPi0_pion2_vr0", m_DC2KsPiPi0_pion2_vr0);
546 status = m_tuple4->addItem ("DC2KsPiPi0_pion2_px", m_DC2KsPiPi0_pion2_px);
547 status = m_tuple4->addItem ("DC2KsPiPi0_pion2_py", m_DC2KsPiPi0_pion2_py);
548 status = m_tuple4->addItem ("DC2KsPiPi0_pion2_pz", m_DC2KsPiPi0_pion2_pz);
549 status = m_tuple4->addItem ("DC2KsPiPi0_pion2_E", m_DC2KsPiPi0_pion2_E);
550 status = m_tuple4->addItem ("DC2KsPiPi0_pion2_cos", m_DC2KsPiPi0_pion2_cos);
551 status = m_tuple4->addItem ("DC2KsPiPi0_pion3_vx", m_DC2KsPiPi0_pion3_vx);
552 status = m_tuple4->addItem ("DC2KsPiPi0_pion3_vy", m_DC2KsPiPi0_pion3_vy);
553 status = m_tuple4->addItem ("DC2KsPiPi0_pion3_vz", m_DC2KsPiPi0_pion3_vz);
554 status = m_tuple4->addItem ("DC2KsPiPi0_pion3_vr0", m_DC2KsPiPi0_pion3_vr0);
555 status = m_tuple4->addItem ("DC2KsPiPi0_pion3_px", m_DC2KsPiPi0_pion3_px);
556 status = m_tuple4->addItem ("DC2KsPiPi0_pion3_py", m_DC2KsPiPi0_pion3_py);
557 status = m_tuple4->addItem ("DC2KsPiPi0_pion3_pz", m_DC2KsPiPi0_pion3_pz);
558 status = m_tuple4->addItem ("DC2KsPiPi0_pion3_E", m_DC2KsPiPi0_pion3_E);
559 status = m_tuple4->addItem ("DC2KsPiPi0_pion3_cos", m_DC2KsPiPi0_pion3_cos);
560 status = m_tuple4->addItem ("DC2KsPiPi0_pi0mass", m_DC2KsPiPi0_pi0mass);
561 status = m_tuple4->addItem ("DC2KsPiPi0_photon1_Id", m_DC2KsPiPi0_photon1_Id);
562 status = m_tuple4->addItem ("DC2KsPiPi0_photon2_Id", m_DC2KsPiPi0_photon2_Id);
563 status = m_tuple4->addItem ("DC2KsPiPi0_photon1_E", m_DC2KsPiPi0_photon1_E);
564 status = m_tuple4->addItem ("DC2KsPiPi0_photon2_E", m_DC2KsPiPi0_photon2_E);
565 status = m_tuple4->addItem ("DC2KsPiPi0_photon1_cos", m_DC2KsPiPi0_photon1_cos);
566 status = m_tuple4->addItem ("DC2KsPiPi0_photon2_cos", m_DC2KsPiPi0_photon2_cos);
567 status = m_tuple4->addItem ("DC2KsPiPi0_ks_mass", m_DC2KsPiPi0_ks_mass);
568 status = m_tuple4->addItem ("DC2KsPiPi0_ks_vfitmass", m_DC2KsPiPi0_ks_vfitmass);
569 status = m_tuple4->addItem ("DC2KsPiPi0_ks_pvchi2", m_DC2KsPiPi0_ks_pvchi2);
570 status = m_tuple4->addItem ("DC2KsPiPi0_ks_svchi2", m_DC2KsPiPi0_ks_svchi2);
571 status = m_tuple4->addItem ("DC2KsPiPi0_ks_dLength", m_DC2KsPiPi0_ks_dLength);
572 status = m_tuple4->addItem ("DC2KsPiPi0_ks_dLengthErrorRatio", m_DC2KsPiPi0_ks_dLengthErrorRatio);
573 status = m_tuple4->addItem ( "recNumDC2KsPiPiPi", m_recNumDC2KsPiPiPi);
574 status = m_tuple4->addItem ("DC2KsPiPiPi_e", m_DC2KsPiPiPi_e);
575 status = m_tuple4->addItem ("DC2KsPiPiPi_p", m_DC2KsPiPiPi_p);
576 status = m_tuple4->addItem ("DC2KsPiPiPi_mBC", m_DC2KsPiPiPi_mBC);
577 status = m_tuple4->addItem ("DC2KsPiPiPi_mass", m_DC2KsPiPiPi_mass);
578 status = m_tuple4->addItem ("DC2KsPiPiPi_deltE", m_DC2KsPiPiPi_deltE);
579 status = m_tuple4->addItem ("DC2KsPiPiPi_charge", m_DC2KsPiPiPi_charge);
580 status = m_tuple4->addItem ("DC2KsPiPiPi_charm", m_DC2KsPiPiPi_charm);
581 status = m_tuple4->addItem ("DC2KsPiPiPi_pion1_pp", m_DC2KsPiPiPi_pion1_pp);
582 status = m_tuple4->addItem ("DC2KsPiPiPi_pion2_pp", m_DC2KsPiPiPi_pion2_pp);
583 status = m_tuple4->addItem ("DC2KsPiPiPi_pion3_pp", m_DC2KsPiPiPi_pion3_pp);
584 status = m_tuple4->addItem ("DC2KsPiPiPi_pion4_pp", m_DC2KsPiPiPi_pion4_pp);
585 status = m_tuple4->addItem ("DC2KsPiPiPi_pion5_pp", m_DC2KsPiPiPi_pion5_pp);
586 status = m_tuple4->addItem ("DC2KsPiPiPi_pion1_Id", m_DC2KsPiPiPi_pion1_Id);
587 status = m_tuple4->addItem ("DC2KsPiPiPi_pion2_Id", m_DC2KsPiPiPi_pion2_Id);
588 status = m_tuple4->addItem ("DC2KsPiPiPi_pion3_Id", m_DC2KsPiPiPi_pion3_Id);
589 status = m_tuple4->addItem ("DC2KsPiPiPi_pion4_Id", m_DC2KsPiPiPi_pion4_Id);
590 status = m_tuple4->addItem ("DC2KsPiPiPi_pion5_Id", m_DC2KsPiPiPi_pion5_Id);
591 status = m_tuple4->addItem ("DC2KsPiPiPi_ks_mass", m_DC2KsPiPiPi_ks_mass);
592 status = m_tuple4->addItem ("DC2KsPiPiPi_ks_vfitmass", m_DC2KsPiPiPi_ks_vfitmass);
593 status = m_tuple4->addItem ("DC2KsPiPiPi_ks_pvchi2", m_DC2KsPiPiPi_ks_pvchi2);
594 status = m_tuple4->addItem ("DC2KsPiPiPi_ks_svchi2", m_DC2KsPiPiPi_ks_svchi2);
595 status = m_tuple4->addItem ("DC2KsPiPiPi_ks_dLength", m_DC2KsPiPiPi_ks_dLength);
596 status = m_tuple4->addItem ("DC2KsPiPiPi_ks_dLengthErrorRatio", m_DC2KsPiPiPi_ks_dLengthErrorRatio);
597 status = m_tuple4->addItem ( "recNumDC2KKPi", m_recNumDC2KKPi);
598 status = m_tuple4->addItem ("DC2KKPi_e", m_DC2KKPi_e);
599 status = m_tuple4->addItem ("DC2KKPi_p", m_DC2KKPi_p);
600 status = m_tuple4->addItem ("DC2KKPi_mBC", m_DC2KKPi_mBC);
601 status = m_tuple4->addItem ("DC2KKPi_mass", m_DC2KKPi_mass);
602 status = m_tuple4->addItem ("DC2KKPi_deltE", m_DC2KKPi_deltE);
603 status = m_tuple4->addItem ("DC2KKPi_charge", m_DC2KKPi_charge);
604 status = m_tuple4->addItem ("DC2KKPi_charm", m_DC2KKPi_charm);
605 status = m_tuple4->addItem ("DC2KKPi_kaon1_pp", m_DC2KKPi_kaon1_pp);
606 status = m_tuple4->addItem ("DC2KKPi_kaon2_pp", m_DC2KKPi_kaon2_pp);
607 status = m_tuple4->addItem ("DC2KKPi_pion_pp", m_DC2KKPi_pion_pp);
608 status = m_tuple4->addItem ("DC2KKPi_kaon1_Id", m_DC2KKPi_kaon1_Id);
609 status = m_tuple4->addItem ("DC2KKPi_kaon2_Id", m_DC2KKPi_kaon2_Id);
610 status = m_tuple4->addItem ("DC2KKPi_pion_Id", m_DC2KKPi_pion_Id);
611 status = m_tuple4->addItem ("D02KPi_kaon_Id_Dedx", m_D02KPi_kaon_Id_Dedx);
612 status = m_tuple4->addItem ("D02KPi_pion_Id_Dedx", m_D02KPi_pion_Id_Dedx);
613 status = m_tuple4->addItem ("D02KPi_kaon_chipi", m_D02KPi_kaon_chipi);
614 status = m_tuple4->addItem ("D02KPi_kaon_chik", m_D02KPi_kaon_chik);
615 status = m_tuple4->addItem ("D02KPi_kaon_ghit", m_D02KPi_kaon_ghit);
616 status = m_tuple4->addItem ("D02KPi_kaon_thit", m_D02KPi_kaon_thit);
617 status = m_tuple4->addItem ("D02KPi_kaon_probPH", m_D02KPi_kaon_probPH);
618 status = m_tuple4->addItem ("D02KPi_kaon_normPH", m_D02KPi_kaon_normPH);
619 status = m_tuple4->addItem ("D02KPi_pion_chipi", m_D02KPi_pion_chipi);
620 status = m_tuple4->addItem ("D02KPi_pion_chik", m_D02KPi_pion_chik);
621 status = m_tuple4->addItem ("D02KPi_pion_ghit", m_D02KPi_pion_ghit);
622 status = m_tuple4->addItem ("D02KPi_pion_thit", m_D02KPi_pion_thit);
623 status = m_tuple4->addItem ("D02KPi_pion_probPH", m_D02KPi_pion_probPH);
624 status = m_tuple4->addItem ("D02KPi_pion_normPH", m_D02KPi_pion_normPH);
625 status = m_tuple4->addItem ("D02KPiPi0_kaon_Id_Dedx", m_D02KPiPi0_kaon_Id_Dedx);
626 status = m_tuple4->addItem ("D02KPiPi0_pion_Id_Dedx", m_D02KPiPi0_pion_Id_Dedx);
627 status = m_tuple4->addItem ("D02KPiPi0_kaon_chipi", m_D02KPiPi0_kaon_chipi);
628 status = m_tuple4->addItem ("D02KPiPi0_kaon_chik", m_D02KPiPi0_kaon_chik);
629 status = m_tuple4->addItem ("D02KPiPi0_kaon_ghit", m_D02KPiPi0_kaon_ghit);
630 status = m_tuple4->addItem ("D02KPiPi0_kaon_thit", m_D02KPiPi0_kaon_thit);
631 status = m_tuple4->addItem ("D02KPiPi0_kaon_probPH", m_D02KPiPi0_kaon_probPH);
632 status = m_tuple4->addItem ("D02KPiPi0_kaon_normPH", m_D02KPiPi0_kaon_normPH);
633 status = m_tuple4->addItem ("D02KPiPi0_pion_chipi", m_D02KPiPi0_pion_chipi);
634 status = m_tuple4->addItem ("D02KPiPi0_pion_chik", m_D02KPiPi0_pion_chik);
635 status = m_tuple4->addItem ("D02KPiPi0_pion_ghit", m_D02KPiPi0_pion_ghit);
636 status = m_tuple4->addItem ("D02KPiPi0_pion_thit", m_D02KPiPi0_pion_thit);
637 status = m_tuple4->addItem ("D02KPiPi0_pion_probPH", m_D02KPiPi0_pion_probPH);
638 status = m_tuple4->addItem ("D02KPiPi0_pion_normPH", m_D02KPiPi0_pion_normPH);
639 status = m_tuple4->addItem ("D02KPi_kaon_Id_tof", m_D02KPi_kaon_Id_tof);
640 status = m_tuple4->addItem ("D02KPi_pion_Id_tof", m_D02KPi_pion_Id_tof);
641 status = m_tuple4->addItem ("D02KPi_kaon_ec_toff_mu", m_D02KPi_kaon_ec_toff_mu);
642 status = m_tuple4->addItem ("D02KPi_kaon_ec_toff_pi", m_D02KPi_kaon_ec_toff_pi);
643 status = m_tuple4->addItem ("D02KPi_kaon_ec_toff_k", m_D02KPi_kaon_ec_toff_k);
644 status = m_tuple4->addItem ("D02KPi_kaon_ec_toff_isEast", m_D02KPi_kaon_ec_toff_isEast);
645 status = m_tuple4->addItem ("D02KPi_kaon_br_toff_mu", 7,m_D02KPi_kaon_br_toff_mu);
646 status = m_tuple4->addItem ("D02KPi_kaon_br_toff_pi", 7,m_D02KPi_kaon_br_toff_pi);
647 status = m_tuple4->addItem ("D02KPi_kaon_br_toff_k", 7,m_D02KPi_kaon_br_toff_k);
648 status = m_tuple4->addItem ("D02KPi_pion_ec_toff_pi", m_D02KPi_pion_ec_toff_mu);
649 status = m_tuple4->addItem ("D02KPi_pion_ec_toff_mu", m_D02KPi_pion_ec_toff_pi);
650 status = m_tuple4->addItem ("D02KPi_pion_ec_toff_k", m_D02KPi_pion_ec_toff_k);
651 status = m_tuple4->addItem ("D02KPi_pion_ec_toff_isEast", m_D02KPi_pion_ec_toff_isEast);
652 status = m_tuple4->addItem ("D02KPi_pion_br_toff_mu", 7,m_D02KPi_pion_br_toff_mu);
653 status = m_tuple4->addItem ("D02KPi_pion_br_toff_pi", 7,m_D02KPi_pion_br_toff_pi);
654 status = m_tuple4->addItem ("D02KPi_pion_br_toff_k", 7,m_D02KPi_pion_br_toff_k);
655 status = m_tuple4->addItem ("D02KPiPi0_kaon_Id_tof", m_D02KPiPi0_kaon_Id_tof);
656 status = m_tuple4->addItem ("D02KPiPi0_pion_Id_tof", m_D02KPiPi0_pion_Id_tof);
657 status = m_tuple4->addItem ("D02KPiPi0_kaon_ec_toff_mu", m_D02KPiPi0_kaon_ec_toff_mu);
658 status = m_tuple4->addItem ("D02KPiPi0_kaon_ec_toff_pi", m_D02KPiPi0_kaon_ec_toff_pi);
659 status = m_tuple4->addItem ("D02KPiPi0_kaon_ec_toff_k", m_D02KPiPi0_kaon_ec_toff_k);
660 status = m_tuple4->addItem ("D02KPiPi0_kaon_ec_toff_isEast", m_D02KPiPi0_kaon_ec_toff_isEast);
661 status = m_tuple4->addItem ("D02KPiPi0_kaon_br_toff_mu", 7,m_D02KPiPi0_kaon_br_toff_mu);
662 status = m_tuple4->addItem ("D02KPiPi0_kaon_br_toff_pi", 7,m_D02KPiPi0_kaon_br_toff_pi);
663 status = m_tuple4->addItem ("D02KPiPi0_kaon_br_toff_k", 7,m_D02KPiPi0_kaon_br_toff_k);
664 status = m_tuple4->addItem ("D02KPiPi0_pion_ec_toff_mu", m_D02KPiPi0_pion_ec_toff_mu);
665 status = m_tuple4->addItem ("D02KPiPi0_pion_ec_toff_pi", m_D02KPiPi0_pion_ec_toff_pi);
666 status = m_tuple4->addItem ("D02KPiPi0_pion_ec_toff_k", m_D02KPiPi0_pion_ec_toff_k);
667 status = m_tuple4->addItem ("D02KPiPi0_pion_ec_toff_isEast", m_D02KPiPi0_pion_ec_toff_isEast);
668 status = m_tuple4->addItem ("D02KPiPi0_pion_br_toff_mu", 7,m_D02KPiPi0_pion_br_toff_mu);
669 status = m_tuple4->addItem ("D02KPiPi0_pion_br_toff_pi", 7,m_D02KPiPi0_pion_br_toff_pi);
670 status = m_tuple4->addItem ("D02KPiPi0_pion_br_toff_k", 7,m_D02KPiPi0_pion_br_toff_k);
671 status = m_tuple4->addItem ("DC2KPiPi_kaon_Id_tof", m_DC2KPiPi_kaon_Id_tof);
672 status = m_tuple4->addItem ("DC2KPiPi_pion1_Id_tof", m_DC2KPiPi_pion1_Id_tof);
673 status = m_tuple4->addItem ("DC2KPiPi_pion2_Id_tof", m_DC2KPiPi_pion2_Id_tof);
674 status = m_tuple4->addItem ("DC2KPiPi_kaon_ec_toff_mu", m_DC2KPiPi_kaon_ec_toff_mu);
675 status = m_tuple4->addItem ("DC2KPiPi_kaon_ec_toff_pi", m_DC2KPiPi_kaon_ec_toff_pi);
676 status = m_tuple4->addItem ("DC2KPiPi_kaon_ec_toff_k", m_DC2KPiPi_kaon_ec_toff_k);
677 status = m_tuple4->addItem ("DC2KPiPi_kaon_ec_toff_isEast", m_DC2KPiPi_kaon_ec_toff_isEast);
678 status = m_tuple4->addItem ("DC2KPiPi_kaon_br_toff_mu", 7, m_DC2KPiPi_kaon_br_toff_mu);
679 status = m_tuple4->addItem ("DC2KPiPi_kaon_br_toff_pi", 7, m_DC2KPiPi_kaon_br_toff_pi);
680 status = m_tuple4->addItem ("DC2KPiPi_kaon_br_toff_k", 7, m_DC2KPiPi_kaon_br_toff_k);
681 status = m_tuple4->addItem ("DC2KPiPi_pion1_ec_toff_mu", m_DC2KPiPi_pion1_ec_toff_mu);
682 status = m_tuple4->addItem ("DC2KPiPi_pion1_ec_toff_pi", m_DC2KPiPi_pion1_ec_toff_pi);
683 status = m_tuple4->addItem ("DC2KPiPi_pion1_ec_toff_k", m_DC2KPiPi_pion1_ec_toff_k);
684 status = m_tuple4->addItem ("DC2KPiPi_pion1_ec_toff_isEast", m_DC2KPiPi_pion1_ec_toff_isEast);
685 status = m_tuple4->addItem ("DC2KPiPi_pion1_br_toff_mu", 7, m_DC2KPiPi_pion1_br_toff_mu);
686 status = m_tuple4->addItem ("DC2KPiPi_pion1_br_toff_pi", 7, m_DC2KPiPi_pion1_br_toff_pi);
687 status = m_tuple4->addItem ("DC2KPiPi_pion1_br_toff_k", 7, m_DC2KPiPi_pion1_br_toff_k);
688 status = m_tuple4->addItem ("DC2KPiPi_pion2_ec_toff_mu", m_DC2KPiPi_pion2_ec_toff_mu);
689 status = m_tuple4->addItem ("DC2KPiPi_pion2_ec_toff_pi", m_DC2KPiPi_pion2_ec_toff_pi);
690 status = m_tuple4->addItem ("DC2KPiPi_pion2_ec_toff_k", m_DC2KPiPi_pion2_ec_toff_k);
691 status = m_tuple4->addItem ("DC2KPiPi_pion2_ec_toff_isEast", m_DC2KPiPi_pion2_ec_toff_isEast);
692 status = m_tuple4->addItem ("DC2KPiPi_pion2_br_toff_mu", 7, m_DC2KPiPi_pion2_br_toff_mu);
693 status = m_tuple4->addItem ("DC2KPiPi_pion2_br_toff_pi", 7, m_DC2KPiPi_pion2_br_toff_pi);
694 status = m_tuple4->addItem ("DC2KPiPi_pion2_br_toff_k", 7, m_DC2KPiPi_pion2_br_toff_k);
695 status = m_tuple4->addItem ("D02KPiPi0_photon1_Id_Emc", m_D02KPiPi0_photon1_Id_Emc);
696 status = m_tuple4->addItem ("D02KPiPi0_photon1_numHits", m_D02KPiPi0_photon1_numHits);
697 status = m_tuple4->addItem ("D02KPiPi0_photon1_secondmoment", m_D02KPiPi0_photon1_secondmoment);
698 status = m_tuple4->addItem ("D02KPiPi0_photon1_x", m_D02KPiPi0_photon1_x);
699 status = m_tuple4->addItem ("D02KPiPi0_photon1_y", m_D02KPiPi0_photon1_y);
700 status = m_tuple4->addItem ("D02KPiPi0_photon1_z", m_D02KPiPi0_photon1_z);
701 status = m_tuple4->addItem ("D02KPiPi0_photon2_Id_Emc", m_D02KPiPi0_photon2_Id_Emc);
702 status = m_tuple4->addItem ("D02KPiPi0_photon2_numHits", m_D02KPiPi0_photon2_numHits);
703 status = m_tuple4->addItem ("D02KPiPi0_photon2_secondmoment", m_D02KPiPi0_photon2_secondmoment);
704 status = m_tuple4->addItem ("D02KPiPi0_photon2_x", m_D02KPiPi0_photon2_x);
705 status = m_tuple4->addItem ("D02KPiPi0_photon2_y", m_D02KPiPi0_photon2_y);
706 status = m_tuple4->addItem ("D02KPiPi0_photon2_z", m_D02KPiPi0_photon2_z);
707 status = m_tuple4->addItem ("DC2KPiPi_kaon_chipi", m_DC2KPiPi_kaon_chipi);
708 status = m_tuple4->addItem ("DC2KPiPi_kaon_chik", m_DC2KPiPi_kaon_chik);
709 status = m_tuple4->addItem ("DC2KPiPi_kaon_ghit", m_DC2KPiPi_kaon_ghit);
710 status = m_tuple4->addItem ("DC2KPiPi_kaon_thit", m_DC2KPiPi_kaon_thit);
711 status = m_tuple4->addItem ("DC2KPiPi_kaon_probPH", m_DC2KPiPi_kaon_probPH);
712 status = m_tuple4->addItem ("DC2KPiPi_kaon_normPH", m_DC2KPiPi_kaon_normPH);
713 status = m_tuple4->addItem ("DC2KPiPi_pion1_chipi", m_DC2KPiPi_pion1_chipi);
714 status = m_tuple4->addItem ("DC2KPiPi_pion1_chik", m_DC2KPiPi_pion1_chik);
715 status = m_tuple4->addItem ("DC2KPiPi_pion1_ghit", m_DC2KPiPi_pion1_ghit);
716 status = m_tuple4->addItem ("DC2KPiPi_pion1_thit", m_DC2KPiPi_pion1_thit);
717 status = m_tuple4->addItem ("DC2KPiPi_pion1_probPH", m_DC2KPiPi_pion1_probPH);
718 status = m_tuple4->addItem ("DC2KPiPi_pion1_normPH", m_DC2KPiPi_pion1_normPH);
719 status = m_tuple4->addItem ("DC2KPiPi_pion2_chipi", m_DC2KPiPi_pion2_chipi);
720 status = m_tuple4->addItem ("DC2KPiPi_pion2_chik", m_DC2KPiPi_pion2_chik);
721 status = m_tuple4->addItem ("DC2KPiPi_pion2_ghit", m_DC2KPiPi_pion2_ghit);
722 status = m_tuple4->addItem ("DC2KPiPi_pion2_thit", m_DC2KPiPi_pion2_thit);
723 status = m_tuple4->addItem ("DC2KPiPi_pion2_probPH", m_DC2KPiPi_pion2_probPH);
724 status = m_tuple4->addItem ("DC2KPiPi_pion2_normPH", m_DC2KPiPi_pion2_normPH);
725 status = m_tuple4->addItem ("DC2KPiPi_kaon_Id_Dedx", m_DC2KPiPi_kaon_Id_Dedx);
726 status = m_tuple4->addItem ("DC2KPiPi_pion1_Id_Dedx", m_DC2KPiPi_pion1_Id_Dedx);
727 status = m_tuple4->addItem ("DC2KPiPi_pion2_Id_Dedx", m_DC2KPiPi_pion2_Id_Dedx);
728 }
729 else {
730 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple4) << endmsg;
731 return StatusCode::FAILURE;
732 }
733 }
734
735 NTuplePtr nt5(ntupleSvc(), "DQAFILE/Events");
736 if ( nt5 ) m_tuple5 = nt5;
737 else {
738 m_tuple5 = ntupleSvc()->book ("DQAFILE/Events", CLID_ColumnWiseTuple, "ks N-Tuple example");
739 if ( m_tuple5 ) {
740 status = m_tuple5->addItem ("evtrun", m_evtrun);
741 status = m_tuple5->addItem ("evtrec", m_evtrec);
742 status = m_tuple5->addItem ("evtnch", m_evtnch);
743 status = m_tuple5->addItem ("evtnneu", m_evtnneu);
744 status = m_tuple5->addItem ("evtbeamE", m_evtbeamE);
745 }
746 else {
747 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple5) << endmsg;
748 return StatusCode::FAILURE;
749 }
750 }
751 NTuplePtr nt11(ntupleSvc(), "DQAFILE/CheckDedxAll");
752 if ( nt11 ) m_tuple11 = nt11;
753 else {
754 m_tuple11 = ntupleSvc()->book ("DQAFILE/CheckDedxAll", CLID_ColumnWiseTuple, "ks N-Tuple example");
755 if ( m_tuple11 ) {
756 status = m_tuple11->addItem ("ngch", m_ngch, 0, 10000);
757 status = m_tuple11->addIndexedItem ("trkiddedx", m_ngch, m_trkiddedx);
758 status = m_tuple11->addIndexedItem ("mptrk", m_ngch, m_ptrk);
759 status = m_tuple11->addIndexedItem ("chie", m_ngch, m_chie);
760 status = m_tuple11->addIndexedItem ("chimu", m_ngch,m_chimu);
761 status = m_tuple11->addIndexedItem ("chipi", m_ngch,m_chipi);
762 status = m_tuple11->addIndexedItem ("chik", m_ngch,m_chik);
763 status = m_tuple11->addIndexedItem ("chip", m_ngch,m_chip);
764 status = m_tuple11->addIndexedItem ("probPH", m_ngch,m_probPH);
765 status = m_tuple11->addIndexedItem ("normPH", m_ngch,m_normPH);
766 status = m_tuple11->addIndexedItem ("ghit", m_ngch,m_ghit);
767 status = m_tuple11->addIndexedItem ("thit", m_ngch,m_thit);
768 }
769 else {
770 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple11) << endmsg;
771 return StatusCode::FAILURE;
772 }
773 }
774
775 NTuplePtr nt12(ntupleSvc(), "DQAFILE/CheckTofChAll");
776 if ( nt12 ) m_tuple12 = nt12;
777 else {
778 m_tuple12 = ntupleSvc()->book ("DQAFILE/CheckTofChAll", CLID_ColumnWiseTuple, "ks N-Tuple example");
779 if ( m_tuple12 ) {
780 status = m_tuple12->addItem ("ngch2", m_ngch2, 0, 10000);
781 status = m_tuple12->addIndexedItem ("trkidtof", m_ngch2,m_trkidtof);
782 status = m_tuple12->addIndexedItem ("ptot_etof", m_ngch2,m_ptot_etof);
783 status = m_tuple12->addIndexedItem ("cntr_etof", m_ngch2,m_cntr_etof);
784 status = m_tuple12->addIndexedItem ("te_etof", m_ngch2,m_te_etof);
785 status = m_tuple12->addIndexedItem ("tmu_etof", m_ngch2,m_tmu_etof);
786 status = m_tuple12->addIndexedItem ("tpi_etof", m_ngch2,m_tpi_etof);
787 status = m_tuple12->addIndexedItem ("tk_etof", m_ngch2,m_tk_etof);
788 status = m_tuple12->addIndexedItem ("tp_etof", m_ngch2,m_tp_etof);
789 status = m_tuple12->addIndexedItem ("ph_etof", m_ngch2,m_ph_etof);
790 status = m_tuple12->addIndexedItem ("rhit_etof", m_ngch2,m_rhit_etof);
791 status = m_tuple12->addIndexedItem ("qual_etof", m_ngch2,m_qual_etof);
792 status = m_tuple12->addIndexedItem ("ec_toff_e", m_ngch2,m_ec_toff_e);
793 status = m_tuple12->addIndexedItem ("ec_toff_mu",m_ngch2,m_ec_toff_mu);
794 status = m_tuple12->addIndexedItem ("ec_toff_pi",m_ngch2,m_ec_toff_pi);
795 status = m_tuple12->addIndexedItem ("ec_toff_k", m_ngch2,m_ec_toff_k);
796 status = m_tuple12->addIndexedItem ("ec_toff_p", m_ngch2,m_ec_toff_p);
797 status = m_tuple12->addIndexedItem ("ec_tsig_e", m_ngch2,m_ec_tsig_e);
798 status = m_tuple12->addIndexedItem ("ec_tsig_mu",m_ngch2,m_ec_tsig_mu);
799 status = m_tuple12->addIndexedItem ("ec_tsig_pi",m_ngch2,m_ec_tsig_pi);
800 status = m_tuple12->addIndexedItem ("ec_tsig_k", m_ngch2,m_ec_tsig_k);
801 status = m_tuple12->addIndexedItem ("ec_tsig_p", m_ngch2,m_ec_tsig_p);
802 status = m_tuple12->addIndexedItem ("ec_tof", m_ngch2,m_ec_tof);
803 status = m_tuple12->addIndexedItem ("ptot_btof1",m_ngch2,m_ptot_btof1);
804 status = m_tuple12->addIndexedItem ("cntr_btof1",m_ngch2,m_cntr_btof1);
805 status = m_tuple12->addIndexedItem ("te_btof1", m_ngch2,m_te_btof1);
806 status = m_tuple12->addIndexedItem ("tmu_btof1", m_ngch2,m_tmu_btof1);
807 status = m_tuple12->addIndexedItem ("tpi_btof1", m_ngch2,m_tpi_btof1);
808 status = m_tuple12->addIndexedItem ("tk_btof1", m_ngch2,m_tk_btof1);
809 status = m_tuple12->addIndexedItem ("tp_btof1", m_ngch2,m_tp_btof1);
810 status = m_tuple12->addIndexedItem ("ph_btof1", m_ngch2,m_ph_btof1);
811 status = m_tuple12->addIndexedItem ("zhit_btof1",m_ngch2,m_zhit_btof1);
812 status = m_tuple12->addIndexedItem ("qual_btof1",m_ngch2,m_qual_btof1);
813 status = m_tuple12->addIndexedItem ("b1_toff_e", m_ngch2,m_b1_toff_e);
814 status = m_tuple12->addIndexedItem ("b1_toff_mu",m_ngch2,m_b1_toff_mu);
815 status = m_tuple12->addIndexedItem ("b1_toff_pi",m_ngch2,m_b1_toff_pi);
816 status = m_tuple12->addIndexedItem ("b1_toff_k", m_ngch2,m_b1_toff_k);
817 status = m_tuple12->addIndexedItem ("b1_toff_p", m_ngch2,m_b1_toff_p);
818 status = m_tuple12->addIndexedItem ("b1_tsig_e", m_ngch2,m_b1_tsig_e);
819 status = m_tuple12->addIndexedItem ("b1_tsig_mu",m_ngch2,m_b1_tsig_mu);
820 status = m_tuple12->addIndexedItem ("b1_tsig_pi",m_ngch2,m_b1_tsig_pi);
821 status = m_tuple12->addIndexedItem ("b1_tsig_k", m_ngch2,m_b1_tsig_k);
822 status = m_tuple12->addIndexedItem ("b1_tsig_p", m_ngch2,m_b1_tsig_p);
823 status = m_tuple12->addIndexedItem ("b1_tof", m_ngch2,m_b1_tof);
824
825 status = m_tuple12->addIndexedItem ("mdedx_pid", m_ngch2,m_dedx_pid);
826 status = m_tuple12->addIndexedItem ("mtof1_pid", m_ngch2,m_tof1_pid);
827 status = m_tuple12->addIndexedItem ("mtof2_pid", m_ngch2,m_tof2_pid);
828 status = m_tuple12->addIndexedItem ("mprob_pid", m_ngch2,m_prob_pid);
829 status = m_tuple12->addIndexedItem ("mptrk_pid", m_ngch2,m_ptrk_pid);
830 status = m_tuple12->addIndexedItem ("mcost_pid", m_ngch2,m_cost_pid);
831 }
832 else {
833 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple12) << endmsg;
834 return StatusCode::FAILURE;
835 }
836 }
837
838 NTuplePtr nt13(ntupleSvc(), "DQAFILE/CheckTofNeAll");
839 if ( nt13 ) m_tuple13 = nt13;
840 else {
841 m_tuple13 = ntupleSvc()->book ("DQAFILE/CheckTofNeAll", CLID_ColumnWiseTuple, "ks N-Tuple example");
842 if ( m_tuple13 ) {
843 status = m_tuple13->addItem ("ngneu", m_nggneu, 0, 10000);
844 status = m_tuple13->addIndexedItem ("shwidtof", m_nggneu,m_shwidtof);
845 status = m_tuple13->addIndexedItem ("numHits", m_nggneu,m_numHits); // Total number of hits
846 status = m_tuple13->addIndexedItem ("secondmoment", m_nggneu,m_secondmoment);
847 status = m_tuple13->addIndexedItem ("mx", m_nggneu,m_x); // Shower coordinates and errors
848 status = m_tuple13->addIndexedItem ("my", m_nggneu,m_y);
849 status = m_tuple13->addIndexedItem ("mz", m_nggneu,m_z);
850 status = m_tuple13->addIndexedItem ("cosemc", m_nggneu,m_cosemc); // Shower Counter angles and errors
851 status = m_tuple13->addIndexedItem ("phiemc", m_nggneu,m_phiemc);
852 status = m_tuple13->addIndexedItem ("energy", m_nggneu,m_energy); // Total energy observed in Emc
853 status = m_tuple13->addIndexedItem ("eseed", m_nggneu,m_eSeed);
854 status = m_tuple13->addIndexedItem ("me9", m_nggneu,m_e3x3);
855 status = m_tuple13->addIndexedItem ("me25", m_nggneu,m_e5x5);
856 status = m_tuple13->addIndexedItem ("mlat", m_nggneu,m_lat);
857 status = m_tuple13->addIndexedItem ("ma20", m_nggneu,m_a20);
858 status = m_tuple13->addIndexedItem ("ma42", m_nggneu,m_a42);
859 }
860 else {
861 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple13) << endmsg;
862 return StatusCode::FAILURE;
863 }
864 }
865
866 if(service("THistSvc", m_thsvc).isFailure()) {
867 log << MSG::ERROR << "Couldn't get THistSvc" << endreq;
868 return StatusCode::FAILURE;
869 }
870
871 string strdecaymode[11] = {"D02KPi","D02KPiPi0","D02KPiPiPi","D02KPiPiPiPi0","D02KsPiPi","D02KsPiPiPi0",\
872 "DC2KPiPi","DC2KPiPiPi0","DC2KsPiPi0","DC2KsPiPiPi","DC2KKPi"};
873 for (int i=0;i!=11;i++)
874 {
875 regDecayModeHistogram(m_thsvc,strdecaymode[i]);
876 }
877 string strDdecaymode[2] = {"D0","DC"};
878 regDecayModeHistogram(m_thsvc,strDdecaymode[0]);
879 regDecayModeHistogram(m_thsvc,strDdecaymode[1]);
880 string strtrack[14] = {"D02KPi_kaon","D02KPi_pion","D02KPiPi0_kaon","D02KPiPi0_pion","D02KsPiPi_pion1",\
881 "D02KsPiPi_pion2","D02KsPiPi_pion3","D02KsPiPi_pion4","DC2KPiPi_kaon","DC2KPiPi_pion1","DC2KPiPi_pion2",\
882 "DC2KsPiPi0_pion1","DC2KsPiPi0_pion2","DC2KsPiPi0_pion3" };
883 for (int i=0;i!=14;i++)
884 {
885 regTrackHistogram(m_thsvc,strtrack[i]);
886 }
887 string strphoton[2] = {"D02KPiPi0_photon1","D02KPiPi0_photon2"};
888 regPhotonHistogram(m_thsvc,strphoton[0]);
889 regPhotonHistogram(m_thsvc,strphoton[1]);
890 string strtrackdedx[7] = {"D02KPi_kaon","D02KPi_pion","D02KPiPi0_kaon","D02KPiPi0_pion","DC2KPiPi_kaon","DC2KPiPi_pion1","DC2KPiPi_pion2"};
891 for (int i=0;i!=7;i++)
892 {
893 regTrackDedxHistogram(m_thsvc,strtrackdedx[i]);
894 }
895 string strtracktof[7] = {"D02KPi_kaon","D02KPi_pion","D02KPiPi0_kaon","D02KPiPi0_pion", "DC2KPiPi_kaon", "DC2KPiPi_pion1", "DC2KPiPi_pion2"};
896 for (int i=0;i!=7;i++)
897 {
898 regTrackTofHistogram(m_thsvc,strtracktof[i]);
899 }
900 string strpi0[2] = {"D02KPiPi0","DC2KsPiPi0"};
901 for (int i=0;i!=2;i++)
902 {
903 regPi0Histogram(m_thsvc,strpi0[i]);
904 }
905 string strks[2] = {"D02KsPiPi","DC2KsPiPi0"};
906 for (int i=0;i!=2;i++)
907 {
908 regKsHistogram(m_thsvc,strks[i]);
909 }
910
911 StatusCode sc = service("BestDTagSvc", m_bestDSvc);
912 if ( sc.isFailure() ){
913 log << MSG::FATAL << "Could not load BestDTagSvc!" << endreq;
914 return sc;
915 }
916 //
917 //--------end of book--------
918 //
919
920 log << MSG::INFO << "successfully return from initialize()" <<endmsg;
921 return StatusCode::SUCCESS;
922
923}
924
925// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
926StatusCode DQADtag::execute() {
927
928 // std::cout << "execute()" << std::endl;
929
930 MsgStream log(msgSvc(), name());
931 log << MSG::INFO << "in execute()" << endreq;
932
933 setFilterPassed(false);
934
935 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
936 int run=eventHeader->runNumber();
937 int event=eventHeader->eventNumber();
938 log << MSG::DEBUG <<"run, evtnum = "
939 << run << " , "
940 << event <<endreq;
941
942 m_run = eventHeader->runNumber();
943 m_rec = eventHeader->eventNumber();
944 m_evtrun = eventHeader->runNumber();
945 m_evtrec = eventHeader->eventNumber();
946
947 //////////////////
948 // get beam energy
949 //////////////////
950 if(m_ReadBeamEFromDB&&m_irun!=run){
951 m_irun=run;
952 if(m_readDb.isRunValid(m_irun))
953 m_beamE=m_readDb.getbeamE(m_irun);
954 }
955
956 double beamE=m_beamE;
957 m_evtbeamE = m_beamE;
958
959 if (m_debug)
960 cout<<"event "<<event<<endl;
961 Ncut_DQADTagAlg[0]++;
962 if (Ncut_DQADTagAlg[0]%10000 == 0)
963 {
964 cout<<"Ncut_DQADTagAlg[0]: "<<Ncut_DQADTagAlg[0]<<endl;
965 }
966 //if (Ncut_DQADTagAlg[0]<120000)
967 //return StatusCode::SUCCESS;
968 SmartDataPtr<EvtRecEvent> evtRecEvent(eventSvc(), EventModel::EvtRec::EvtRecEvent);
969 log << MSG::INFO << "get event tag OK" << endreq;
970 log << MSG::DEBUG <<"ncharg, nneu, tottks = "
971 << evtRecEvent->totalCharged() << " , "
972 << evtRecEvent->totalNeutral() << " , "
973 << evtRecEvent->totalTracks() <<endreq;
974
975 m_nch = evtRecEvent->totalCharged();
976 m_nneu = evtRecEvent->totalNeutral();
977 m_evtnch = evtRecEvent->totalCharged();
978 m_evtnneu = evtRecEvent->totalNeutral();
979
980 SmartDataPtr<EvtRecTrackCol> evtRecTrkCol(eventSvc(), EventModel::EvtRec::EvtRecTrackCol);
981
982 //get primay vetex from db
983 Hep3Vector xorigin(0,0,0);
984 IVertexDbSvc* vtxsvc;
985 HepPoint3D vx(0., 0., 0.);
986 HepSymMatrix Evx(3, 0);
987 Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
988 if (vtxsvc->isVertexValid()) {
989 double* vertex = vtxsvc->PrimaryVertex(); //vertex[0] = vx; vertex[1]= vy; vertex[2] = vz;
990 double* vertexsigma = vtxsvc->SigmaPrimaryVertex();
991 xorigin.setX(vertex[0]);
992 xorigin.setY(vertex[1]);
993 xorigin.setZ(vertex[2]);
994 vx[0] = vertex[0];
995 vx[1] = vertex[1];
996 vx[2] = vertex[2];
997 Evx[0][0] = vertexsigma[0]*vertexsigma[0];
998 Evx[1][1] = vertexsigma[1]*vertexsigma[1];
999 Evx[2][2] = vertexsigma[2]*vertexsigma[2];
1000 m_privxpar.setVx(vx);
1001 m_privxpar.setEvx(Evx);
1002 }
1003
1004 // Vp4 pDtagCand_cms;
1005 // pDtagCand_cms.clear();
1006 // int numDtagCand = 0;
1007 // vector<double> vmBC_D0, vmDCand_D0, vdeltE_D0, vpDCand_D0, vmpi0, vvmks, vmksp4,\
1008 // vvlks, vmBC_DC, vmDCand_DC, vdeltE_DC, vpDCand_DC;
1009 // vmBC_D0.clear();
1010 // vmDCand_D0.clear();
1011 // vdeltE_D0.clear();
1012 // vpDCand_D0.clear();
1013 // vmBC_DC.clear();
1014 // vmDCand_DC.clear();
1015 // vdeltE_DC.clear();
1016 // vpDCand_DC.clear();
1017 // vmpi0.clear();
1018 // vvmks.clear();
1019 // vmksp4.clear();
1020 // vvlks.clear();
1021
1022 SmartDataPtr<EvtRecDTagCol> evtRecDTagCol(eventSvc(), EventModel::EvtRec::EvtRecDTagCol);
1023 if ( ! evtRecDTagCol ) {
1024 cout << "Could not find EvtRecDTagCol" << endl;
1025 return StatusCode::SUCCESS;
1026 }
1027
1028 EvtRecDTag* bestDTag = NULL;
1029 bestDTag = m_bestDSvc->getSingleTag(-1);
1030 if (bestDTag == NULL )
1031 return StatusCode::SUCCESS;
1032 Ncut_DQADTagAlg[1]++;
1033
1034 m_rflag = m_bestDSvc->isCosmicOrLepton();
1035 SmartRefVector<EvtRecTrack> tracks=(bestDTag)->tracks();
1036 SmartRefVector<EvtRecTrack> othertracks=(bestDTag)->otherTracks();
1037 SmartRefVector<EvtRecTrack> othershowers=(bestDTag)->otherShowers();
1038 SmartRefVector<EvtRecTrack> showers=(bestDTag)->showers();
1039 // m_bestD_mode=(bestDTag)->decayMode();
1040 // m_bestD_p=(bestDTag)->p4().rho();
1041 // m_bestD_charm=(bestDTag)->charm();
1042 // m_bestD_mass=(bestDTag)->mass();
1043 double g_mBC=(bestDTag)->mBC();
1044 double g_deltE=(bestDTag)->deltaE();
1045 // int DMode =(int)(bestDTag)->decayMode();
1046
1047 //use util tool to get dtaglist
1048
1049 int nCharge = 0;
1050
1051 const int numMode = 11;
1052 int indexD[numMode], indexTof[numMode], indexDedx[numMode],numDCand[numMode];
1053 for (int i=0;i!=numMode;i++)
1054 {
1055 indexD[i] = 0;
1056 indexTof[i] = 0;
1057 indexDedx[i] = 0;
1058 numDCand[i] = 0;
1059 }
1060 int indexDAll = 0;
1061 int indexD0All = 0;
1062 int indexDCAll = 0;
1063
1064 // for (DTagToolIterator bestDTag=iter_begin; bestDTag != iter_end; bestDTag++)
1065 {
1066 bool iswritten = 1;
1067 //decay mode name
1068
1069 // ***********************************************************************
1070 // m_checkDecayMode == 0 : allDecayMode donot check pi0 Ks
1071 // m_checkDecayMode == 1 : singleDecayMode D0 to KPi
1072 // m_checkDecayMode == 2 : fewDecayMode 10 decay modes check pi0 Ks
1073 // ***********************************************************************
1074 if (m_checkDecayMode < 3)
1075 {
1076 // general variables
1077 //HepLorentzVector p4=(bestDTag)->p4();
1078 //p4.boost(-0.011,0,0);
1079
1080 //Hep3Vector p3=p4.v();
1081 //double deltaEDCand = (bestDTag)->deltaE();
1082 //double mBCDCand =(bestDTag)->mBC();
1083 //if(fabs(deltaEDCand)>=0.1) continue;
1084 //if(mBCDCand<=1.8 || mBCDCand>=2.0) continue;
1085 m_dtagbeamE = m_beamE;
1086 m_mode =(bestDTag)->decayMode();
1087 m_charge =(bestDTag)->charge();
1088 m_charm =(bestDTag)->charm();
1089 m_numofchildren =(bestDTag)->numOfChildren();
1090 m_mass =(bestDTag)->mass();
1091 m_mBC =(bestDTag)->mBC();
1092 m_e =(bestDTag)->beamE();
1093 HepLorentzVector p4D =(bestDTag)->p4();
1094 m_p = p4D.rho();
1095 p4D.boost(-0.011,0,0);
1096 m_p_CMS = p4D.rho();
1097 fill(m_p4_CMS, p4D);
1098 m_deltae =(bestDTag)->deltaE();
1099 // pDtagCand_cms.push_back((bestDTag)->p4());
1100 SmartRefVector<EvtRecTrack> tracks=(bestDTag)->tracks();
1101 SmartRefVector<EvtRecTrack> othertracks=(bestDTag)->otherTracks();
1102 SmartRefVector<EvtRecTrack> othershowers=(bestDTag)->otherShowers();
1103 SmartRefVector<EvtRecTrack> showers=(bestDTag)->showers();
1104 //HepLorentzVector p4=(bestDTag)->p4();
1105 //p4.boost(-0.011,0,0);
1106 m_nshower = showers.size();
1107 m_ntrk =tracks.size();
1108 m_nothertrk =othertracks.size();
1109 m_nothershower = othershowers.size();
1110
1111 // if (m_checkDecayMode == 0 ) continue;
1112 // end general variables
1113 indexDAll++;
1114 if((bestDTag)->decayMode()==EvtRecDTag::kD0toKPi) {
1115 const int MODE = 0;
1116 fillDecayModeItem(bestDTag,"D02KPi" );
1117 fillTrackItem(tracks[0],"D02KPi_kaon",3 ,xorigin);
1118 fillTrackItem(tracks[1],"D02KPi_pion",2 ,xorigin);
1119 indexD[MODE]++;
1120 if (m_checkDedx)
1121 {
1122 //if (!tracks[0]->isMdcDedxValid()) continue;
1123 //if (!tracks[1]->isMdcDedxValid()) continue;
1124 fillTrackDedxItem(tracks[0],"D02KPi_kaon",3 );
1125 fillTrackDedxItem(tracks[1],"D02KPi_pion",2 );
1126 }
1127 if (m_checkTof)
1128 {
1129 //if(!tracks[0]->isTofTrackValid()) continue;
1130 //if(!tracks[1]->isTofTrackValid()) continue;
1131 fillTrackTofItem(tracks[0],"D02KPi_kaon",3 );
1132 fillTrackTofItem(tracks[1],"D02KPi_pion",2 );
1133 }
1134 } //end of D0 to K Pi mode
1135 // if (m_checkDecayMode == 1 ) continue;
1136 if((bestDTag)->decayMode()==EvtRecDTag::kD0toKPiPi0) {
1137 const int MODE = 1;
1138 //pi0 mass
1139 DQAPi0Info pi0info;
1140 pi0info.setchilds(showers[0],showers[1]);
1141 if (pi0info.calculate())
1142 {
1143 if (pi0info.m() >m_mpi0Max || pi0info.m() < m_mpi0Min)
1144 iswritten = 0;
1145 // vmpi0.push_back(pi0info.m());
1146 fillPi0Item(showers,"D02KPiPi0" ,&pi0info );
1147 fillDecayModeItem(bestDTag,"D02KPiPi0" );
1148 fillTrackItem(tracks[0],"D02KPiPi0_kaon",3 ,xorigin);
1149 fillTrackItem(tracks[1],"D02KPiPi0_pion",2 ,xorigin);
1150 fillPhotonItem(showers[0],"D02KPiPi0_photon1" );
1151 fillPhotonItem(showers[1],"D02KPiPi0_photon2" );
1152 indexD[MODE]++;
1153 if (m_checkDedx)
1154 {
1155 //if (!tracks[0]->isMdcDedxValid()) continue;
1156 //if (!tracks[1]->isMdcDedxValid()) continue;
1157 fillTrackDedxItem(tracks[0],"D02KPiPi0_kaon",3 );
1158 fillTrackDedxItem(tracks[1],"D02KPiPi0_pion",2 );
1159 }
1160 if (m_checkTof)
1161 {
1162 //if(!tracks[0]->isTofTrackValid()) continue;
1163 //if(!tracks[1]->isTofTrackValid()) continue;
1164 fillTrackTofItem(tracks[0],"D02KPiPi0_kaon",3 );
1165 fillTrackTofItem(tracks[1],"D02KPiPi0_pion",2 );
1166 }
1167 }
1168 }// end of D0 to KPiPi0
1169
1170 //****************************************************
1171 //mode D0 to KPiPiPi only
1172 //****************************************************
1173 if((bestDTag)->decayMode()==EvtRecDTag::kD0toKPiPiPi) {
1174 const int MODE = 2;
1175 fillDecayModeItem(bestDTag,"D02KPiPiPi" );
1176
1177 RecMdcKalTrack* mdcKalTrk1 = tracks[0]->mdcKalTrack();
1178 RecMdcKalTrack* mdcKalTrk2 = tracks[1]->mdcKalTrack();
1179 RecMdcKalTrack* mdcKalTrk3 = tracks[2]->mdcKalTrack();
1180 RecMdcKalTrack* mdcKalTrk4 = tracks[3]->mdcKalTrack();
1182 HepLorentzVector p4kaon = mdcKalTrk1->p4(xmass[3]);
1184 HepLorentzVector p4pion1 = mdcKalTrk2->p4(xmass[2]);
1185 HepLorentzVector p4pion2 = mdcKalTrk3->p4(xmass[2]);
1186 HepLorentzVector p4pion3 = mdcKalTrk4->p4(xmass[2]);
1187 m_D02KPiPiPi_kaon_pp = p4kaon.rho();
1188 m_D02KPiPiPi_pion1_pp = p4pion1.rho();
1189 m_D02KPiPiPi_pion2_pp = p4pion2.rho();
1190 m_D02KPiPiPi_pion3_pp = p4pion3.rho();
1191 m_D02KPiPiPi_kaon_Id = tracks[0]->trackId();
1192 m_D02KPiPiPi_pion1_Id = tracks[1]->trackId();
1193 m_D02KPiPiPi_pion2_Id = tracks[2]->trackId();
1194 m_D02KPiPiPi_pion3_Id = tracks[3]->trackId();
1195 indexD[MODE]++;
1196 }
1197 //****************************************************
1198 //mode D0 to KPiPiPiPi0 only
1199 //****************************************************
1200 if((bestDTag)->decayMode()==EvtRecDTag::kD0toKPiPiPiPi0) {
1201 const int MODE = 3;
1202 DQAPi0Info pi0info;
1203 pi0info.setchilds(showers[0],showers[1]);
1204 if (pi0info.calculate()) {
1205 if (pi0info.m() >m_mpi0Max || pi0info.m() < m_mpi0Min)
1206 iswritten = 0;
1207 fillPi0Item(showers,"D02KPiPiPiPi0" ,&pi0info );
1208 // vmpi0.push_back(pi0info.m());
1209
1210 fillDecayModeItem(bestDTag,"D02KPiPiPiPi0" );
1211
1212 RecMdcKalTrack* mdcKalTrk1 = tracks[0]->mdcKalTrack();
1213 RecMdcKalTrack* mdcKalTrk2 = tracks[1]->mdcKalTrack();
1214 RecMdcKalTrack* mdcKalTrk3 = tracks[2]->mdcKalTrack();
1215 RecMdcKalTrack* mdcKalTrk4 = tracks[3]->mdcKalTrack();
1217 HepLorentzVector p4kaon = mdcKalTrk1->p4(xmass[3]);
1219 HepLorentzVector p4pion1 = mdcKalTrk2->p4(xmass[2]);
1220 HepLorentzVector p4pion2 = mdcKalTrk3->p4(xmass[2]);
1221 HepLorentzVector p4pion3 = mdcKalTrk4->p4(xmass[2]);
1222 m_D02KPiPiPiPi0_kaon_pp = p4kaon.rho();
1223 m_D02KPiPiPiPi0_pion1_pp = p4pion1.rho();
1224 m_D02KPiPiPiPi0_pion2_pp = p4pion2.rho();
1225 m_D02KPiPiPiPi0_pion3_pp = p4pion3.rho();
1226 m_D02KPiPiPiPi0_kaon_Id = tracks[0]->trackId();
1227 m_D02KPiPiPiPi0_pion1_Id = tracks[1]->trackId();
1228 m_D02KPiPiPiPi0_pion2_Id = tracks[2]->trackId();
1229 m_D02KPiPiPiPi0_pion3_Id = tracks[3]->trackId();
1230 indexD[MODE]++;
1231 }
1232 }
1233 //****************************************************
1234 //mode D0 to KsPiPi only
1235 //****************************************************
1236 if((bestDTag)->decayMode()==EvtRecDTag::kD0toKsPiPi) {
1237 const int MODE = 4;
1238 DQAKsInfo ksinfo;
1239 ksinfo.setchilds(tracks[0],tracks[1]);
1240 ksinfo.setVtxPar(m_vxpar);
1241 ksinfo.setPrimaryVtxPar(m_privxpar);
1242 if (ksinfo.calculate()) {
1243
1244 fillDecayModeItem(bestDTag,"D02KsPiPi" );
1245 fillTrackItem(tracks[0],"D02KsPiPi_pion1",2 ,xorigin);
1246 fillTrackItem(tracks[1],"D02KsPiPi_pion2",2 ,xorigin);
1247 fillTrackItem(tracks[2],"D02KsPiPi_pion3",2 ,xorigin);
1248 fillTrackItem(tracks[3],"D02KsPiPi_pion4",2 ,xorigin);
1249 fillKsItem(tracks,"D02KsPiPi" ,&ksinfo);
1250 indexD[MODE]++;
1251
1252 // if (iswritten) vvmks.push_back(ksinfo.m());
1253 // if (iswritten) vmksp4.push_back(ksinfo.mksp4());
1254 // if (iswritten) vvlks.push_back(ksinfo.decayLengthRatio());
1255 }
1256 }// end of D0 to KsPiPi
1257 //****************************************************
1258 //mode D0 to KsPiPiPi0 only
1259 //****************************************************
1260 if((bestDTag)->decayMode()==EvtRecDTag::kD0toKsPiPiPi0) {
1261 const int MODE = 5;
1262 DQAKsInfo ksinfo;
1263 ksinfo.setchilds(tracks[0],tracks[1]);
1264 ksinfo.setVtxPar(m_vxpar);
1265 ksinfo.setPrimaryVtxPar(m_privxpar);
1266 if (ksinfo.calculate()) {
1267 DQAPi0Info pi0info;
1268 pi0info.setchilds(showers[0],showers[1]);
1269 if (pi0info.calculate()) {
1270 if (pi0info.m() >m_mpi0Max || pi0info.m() < m_mpi0Min)
1271 iswritten = 0;
1272 fillPi0Item(showers,"D02KsPiPiPi0" ,&pi0info );
1273 // vmpi0.push_back(pi0info.m());
1274 fillKsItem(tracks,"D02KsPiPiPi0" ,&ksinfo);
1275 // if (iswritten) vvmks.push_back(ksinfo.m());
1276 // if (iswritten) vmksp4.push_back(ksinfo.mksp4());
1277 // if (iswritten) vvlks.push_back(ksinfo.decayLengthRatio());
1278 fillDecayModeItem(bestDTag,"D02KsPiPiPi0" );
1279
1280 RecMdcKalTrack* mdcKalTrk1 = tracks[0]->mdcKalTrack();
1281 RecMdcKalTrack* mdcKalTrk2 = tracks[1]->mdcKalTrack();
1282 RecMdcKalTrack* mdcKalTrk3 = tracks[2]->mdcKalTrack();
1283 RecMdcKalTrack* mdcKalTrk4 = tracks[3]->mdcKalTrack();
1285 HepLorentzVector p4pion1 = mdcKalTrk1->p4(xmass[2]);
1286 HepLorentzVector p4pion2 = mdcKalTrk2->p4(xmass[2]);
1287 HepLorentzVector p4pion3 = mdcKalTrk3->p4(xmass[2]);
1288 HepLorentzVector p4pion4 = mdcKalTrk4->p4(xmass[2]);
1289 m_D02KsPiPiPi0_pion1_pp = p4pion1.rho();
1290 m_D02KsPiPiPi0_pion2_pp = p4pion2.rho();
1291 m_D02KsPiPiPi0_pion3_pp = p4pion3.rho();
1292 m_D02KsPiPiPi0_pion4_pp = p4pion4.rho();
1293 m_D02KsPiPiPi0_pion1_Id = tracks[0]->trackId();
1294 m_D02KsPiPiPi0_pion2_Id = tracks[1]->trackId();
1295 m_D02KsPiPiPi0_pion3_Id = tracks[2]->trackId();
1296 m_D02KsPiPiPi0_pion4_Id = tracks[3]->trackId();
1297 indexD[MODE]++;
1298 }
1299 }
1300 }// end of D0 to KsPiPiPi0
1301 //****************************************************
1302 //mode Dp to KPiPi only
1303 //****************************************************
1304 if((bestDTag)->decayMode()==EvtRecDTag::kDptoKPiPi) {
1305 const int MODE = 6;
1306 fillDecayModeItem(bestDTag,"DC2KPiPi" );
1307 fillTrackItem(tracks[0],"DC2KPiPi_kaon",3 ,xorigin);
1308 fillTrackItem(tracks[1],"DC2KPiPi_pion1",2 ,xorigin);
1309 fillTrackItem(tracks[2],"DC2KPiPi_pion2",2 ,xorigin);
1310 if (m_checkTof)
1311 {
1312 //if(!tracks[0]->isTofTrackValid()) continue;
1313 //if(!tracks[1]->isTofTrackValid()) continue;
1314 fillTrackTofItem(tracks[0],"DC2KPiPi_kaon",3 );
1315 fillTrackTofItem(tracks[1],"DC2KPiPi_pion1",2 );
1316 fillTrackTofItem(tracks[2],"DC2KPiPi_pion2",2 );
1317 }
1318 if (m_checkDedx)
1319 {
1320 fillTrackDedxItem(tracks[0],"DC2KPiPi_kaon",3 );
1321 fillTrackDedxItem(tracks[1],"DC2KPiPi_pion1",2 );
1322 fillTrackDedxItem(tracks[2],"DC2KPiPi_pion2",2 );
1323 }
1324 indexD[MODE]++;
1325 }
1326
1327 //****************************************************
1328 //mode Dp to KPiPiPi0 only
1329 //****************************************************
1330 if((bestDTag)->decayMode()==EvtRecDTag::kDptoKPiPiPi0) {
1331 const int MODE = 7;
1332 DQAPi0Info pi0info;
1333 pi0info.setchilds(showers[0],showers[1]);
1334 if (pi0info.calculate()) {
1335 if (pi0info.m() >m_mpi0Max || pi0info.m() < m_mpi0Min)
1336 iswritten = 0;
1337 fillPi0Item(showers,"DC2KPiPiPi0" ,&pi0info );
1338 // vmpi0.push_back(pi0info.m());
1339 fillDecayModeItem(bestDTag,"DC2KPiPiPi0" );
1340
1341 fillTrackItem(tracks[0],"DC2KPiPiPi0_kaon",3 ,xorigin);
1342 fillTrackItem(tracks[1],"DC2KPiPiPi0_pion1",2 ,xorigin);
1343 fillTrackItem(tracks[2],"DC2KPiPiPi0_pion2",2 ,xorigin);
1344 indexD[MODE]++;
1345 }
1346 }
1347 //****************************************************
1348 //mode Dp to KsPiPi0 only
1349 //****************************************************
1350 if((bestDTag)->decayMode()==EvtRecDTag::kDptoKsPiPi0) {
1351 const int MODE = 8;
1352 DQAPi0Info pi0info;
1353 pi0info.setchilds(showers[0],showers[1]);
1354 if (pi0info.calculate()) {
1355 DQAKsInfo ksinfo;
1356 ksinfo.setchilds(tracks[0],tracks[1]);
1357 ksinfo.setVtxPar(m_vxpar);
1358 ksinfo.setPrimaryVtxPar(m_privxpar);
1359 if (ksinfo.calculate()) {
1360 if (pi0info.m() >m_mpi0Max || pi0info.m() < m_mpi0Min)
1361 iswritten = 0;
1362 fillPi0Item(showers,"DC2KsPiPi0" ,&pi0info );
1363 fillDecayModeItem(bestDTag,"DC2KsPiPi0" );
1364 fillTrackItem(tracks[0],"DC2KsPiPi0_pion1",2 ,xorigin);
1365 fillTrackItem(tracks[1],"DC2KsPiPi0_pion2",2 ,xorigin);
1366 fillTrackItem(tracks[2],"DC2KsPiPi0_pion3",2 ,xorigin);
1367 fillKsItem(tracks,"DC2KsPiPi0" ,&ksinfo);
1368 // if (iswritten) vvmks.push_back(ksinfo.m());
1369 // if (iswritten) vmksp4.push_back(ksinfo.mksp4());
1370 // if (iswritten) vvlks.push_back(ksinfo.decayLengthRatio());
1371 indexD[MODE]++;
1372 }
1373 }
1374 }// end of Dp to Kspipi0
1375 //****************************************************
1376 //mode Dp to KKPi only
1377 //****************************************************
1378 if((bestDTag)->decayMode()==EvtRecDTag::kDptoKsPiPiPi) {
1379 const int MODE = 9;
1380 DQAKsInfo ksinfo;
1381 ksinfo.setchilds(tracks[0],tracks[1]);
1382 ksinfo.setVtxPar(m_vxpar);
1383 ksinfo.setPrimaryVtxPar(m_privxpar);
1384 if (ksinfo.calculate()) {
1385
1386 fillKsItem(tracks,"DC2KsPiPiPi" ,&ksinfo);
1387 // if (iswritten) vvmks.push_back(ksinfo.m());
1388 // if (iswritten) vmksp4.push_back(ksinfo.mksp4());
1389 // if (iswritten) vvlks.push_back(ksinfo.decayLengthRatio());
1390 fillDecayModeItem(bestDTag,"DC2KsPiPiPi" );
1391
1392 RecMdcKalTrack* mdcKalTrk1 = tracks[0]->mdcKalTrack();
1393 RecMdcKalTrack* mdcKalTrk2 = tracks[1]->mdcKalTrack();
1394 RecMdcKalTrack* mdcKalTrk3 = tracks[2]->mdcKalTrack();
1395 RecMdcKalTrack* mdcKalTrk4 = tracks[3]->mdcKalTrack();
1396 RecMdcKalTrack* mdcKalTrk5 = tracks[4]->mdcKalTrack();
1398 HepLorentzVector p4pion1 = mdcKalTrk1->p4(xmass[2]);
1399 HepLorentzVector p4pion2 = mdcKalTrk2->p4(xmass[2]);
1400 HepLorentzVector p4pion3 = mdcKalTrk3->p4(xmass[2]);
1401 HepLorentzVector p4pion4 = mdcKalTrk4->p4(xmass[2]);
1402 HepLorentzVector p4pion5 = mdcKalTrk5->p4(xmass[2]);
1403 m_DC2KsPiPiPi_pion1_pp = p4pion1.rho();
1404 m_DC2KsPiPiPi_pion2_pp = p4pion2.rho();
1405 m_DC2KsPiPiPi_pion3_pp = p4pion3.rho();
1406 m_DC2KsPiPiPi_pion4_pp = p4pion4.rho();
1407 m_DC2KsPiPiPi_pion5_pp = p4pion5.rho();
1408 m_DC2KsPiPiPi_pion1_Id = tracks[0]->trackId();
1409 m_DC2KsPiPiPi_pion2_Id = tracks[1]->trackId();
1410 m_DC2KsPiPiPi_pion3_Id = tracks[2]->trackId();
1411 m_DC2KsPiPiPi_pion4_Id = tracks[3]->trackId();
1412 m_DC2KsPiPiPi_pion5_Id = tracks[4]->trackId();
1413 indexD[MODE]++;
1414 }
1415 }// end of kDptoKsPiPiPi
1416 if((bestDTag)->decayMode()==EvtRecDTag::kDptoKKPi) {
1417 const int MODE = 10;
1418 fillDecayModeItem(bestDTag,"DC2KKPi" );
1419
1420 RecMdcKalTrack* mdcKalTrk1 = tracks[0]->mdcKalTrack();
1421 RecMdcKalTrack* mdcKalTrk2 = tracks[1]->mdcKalTrack();
1422 RecMdcKalTrack* mdcKalTrk3 = tracks[2]->mdcKalTrack();
1424 HepLorentzVector p4kaon1 = mdcKalTrk1->p4(xmass[3]);
1425 HepLorentzVector p4kaon2 = mdcKalTrk2->p4(xmass[3]);
1427 HepLorentzVector p4pion = mdcKalTrk3->p4(xmass[2]);
1428 m_DC2KKPi_kaon1_pp = p4kaon1.rho();
1429 m_DC2KKPi_kaon2_pp = p4kaon2.rho();
1430 m_DC2KKPi_pion_pp = p4pion.rho();
1431 m_DC2KKPi_kaon1_Id = tracks[0]->trackId();
1432 m_DC2KKPi_kaon2_Id = tracks[1]->trackId();
1433 m_DC2KKPi_pion_Id = tracks[2]->trackId();
1434 indexD[MODE]++;
1435 }// end of kDptoKKPi
1436 if ((bestDTag)->charge() == 0)
1437 {
1438 m_D0_mBC = (bestDTag)->mBC();
1439 m_D0_deltE = (bestDTag)->deltaE();
1440 m_D0_mass = (bestDTag)->mass();
1441 indexD0All++;
1442 }
1443 if ((bestDTag)->charge() != 0)
1444 {
1445 m_DC_mBC = (bestDTag)->mBC();
1446 m_DC_deltE = (bestDTag)->deltaE();
1447 m_DC_mass = (bestDTag)->mass();
1448 indexDCAll++;
1449 }
1450 }
1451 }
1452 m_numAllMode = indexDAll;
1453 m_numD0Mode = indexD0All;
1454 m_numDCMode = indexDCAll;
1455 m_recNumD02KPi = indexD[0];
1456 m_recNumD02KPiPi0 = indexD[1];
1457 m_recNumD02KPiPiPi = indexD[2];
1458 m_recNumD02KPiPiPiPi0 = indexD[3];
1459 m_recNumD02KsPiPi = indexD[4];
1460 m_recNumD02KsPiPiPi0 = indexD[5];
1461 m_recNumDC2KPiPi = indexD[6];
1462 m_recNumDC2KPiPiPi0 = indexD[7];
1463 m_recNumDC2KsPiPi0 = indexD[8];
1464 m_recNumDC2KsPiPiPi = indexD[9];
1465 m_recNumDC2KKPi = indexD[10];
1466 int taggedMode = -1; // 0 ~ 10
1467 for (int i=0; i!=11; i++)
1468 {
1469 if (indexD[i] == 1 )
1470 {
1471 taggedMode = i;
1472 }
1473 }
1474
1475 Vint iGood;
1476 // int nCharge = 0;
1477 for(int i = 0; i < evtRecEvent->totalCharged(); i++){
1478 EvtRecTrackIterator itTrk=evtRecTrkCol->begin() + i;
1479 if(!(*itTrk)->isMdcTrackValid()) continue;
1480 if (!(*itTrk)->isMdcKalTrackValid()) continue;
1481 RecMdcTrack *mdcTrk = (*itTrk)->mdcTrack();
1482 RecMdcKalTrack *mdcKalTrk = (*itTrk)->mdcKalTrack();
1483
1484 double pch =mdcTrk->p();
1485 double x0 =mdcTrk->x();
1486 double y0 =mdcTrk->y();
1487 double z0 =mdcTrk->z();
1488 double phi0=mdcTrk->helix(1);
1489 double xv=xorigin.x();
1490 double yv=xorigin.y();
1491 double Rxy=fabs((x0-xv)*cos(phi0)+(y0-yv)*sin(phi0));
1492 m_vtxTrkId = (*itTrk)->trackId();
1493 m_vx0 = x0;
1494 m_vy0 = y0;
1495 m_vz0 = z0-xorigin.z();
1496 m_vr0 = Rxy;
1497 m_Vct=cos(mdcTrk->theta());
1498 if (m_writeTuple && m_checkVtx)
1499 // m_tuple2->write();
1500 if(fabs(m_vz0) >= m_vz0cut) continue;
1501 if(m_vr0 >= m_vr0cut) continue;
1502 if(fabs(m_Vct)>=m_cthcut) continue;
1503
1504 iGood.push_back((*itTrk)->trackId());
1505 nCharge += mdcTrk->charge();
1506 }
1507 int nGood = iGood.size();
1508
1509 ////
1510 //// Finish Good Charged Track Selection
1511 ////
1512
1513 if ( m_writeTuple && (m_checkDedx || m_checkTof))
1514 {
1515 Vint iGam;
1516 iGam.clear();
1517 for(int i = evtRecEvent->totalCharged(); i< evtRecEvent->totalTracks(); i++) {
1518 EvtRecTrackIterator itTrk=evtRecTrkCol->begin() + i;
1519 if(!(*itTrk)->isEmcShowerValid()) continue;
1520 RecEmcShower *emcTrk = (*itTrk)->emcShower();
1521 Hep3Vector emcpos(emcTrk->x(), emcTrk->y(), emcTrk->z());
1522 // find the nearest charged track
1523 double dthe = 200.;
1524 double dphi = 200.;
1525 double dang = 200.;
1526 for(int j = 0; j < evtRecEvent->totalCharged(); j++) {
1527 EvtRecTrackIterator jtTrk = evtRecTrkCol->begin() + j;
1528 if(!(*jtTrk)->isExtTrackValid()) continue;
1529 RecExtTrack *extTrk = (*jtTrk)->extTrack();
1530 if(extTrk->emcVolumeNumber() == -1) continue;
1531 Hep3Vector extpos = extTrk->emcPosition();
1532 // double ctht = extpos.cosTheta(emcpos);
1533 double angd = extpos.angle(emcpos);
1534 double thed = extpos.theta() - emcpos.theta();
1535 double phid = extpos.deltaPhi(emcpos);
1536 thed = fmod(thed+CLHEP::twopi+CLHEP::twopi+pi, CLHEP::twopi) - CLHEP::pi;
1537 phid = fmod(phid+CLHEP::twopi+CLHEP::twopi+pi, CLHEP::twopi) - CLHEP::pi;
1538
1539 if(fabs(thed) < fabs(dthe)) dthe = thed;
1540 if(fabs(phid) < fabs(dphi)) dphi = phid;
1541 if(angd < dang) dang = angd;
1542 }
1543 if(dang>=200) continue;
1544 double eraw = emcTrk->energy();
1545 dthe = dthe * 180 / (CLHEP::pi);
1546 dphi = dphi * 180 / (CLHEP::pi);
1547 dang = dang * 180 / (CLHEP::pi);
1548 double m_dthe = dthe;
1549 double m_dphi = dphi;
1550 double m_dang = dang;
1551 double m_eraw = eraw;
1552 double theta=cos(emcpos.theta());
1553 if ((fabs(theta) > m_Barrel_th && fabs(theta) < m_Endcap_th_1) || fabs(theta) > m_Endcap_th_2 ) continue;
1554 //put different cut on barrel and endcap!
1555 if((emcTrk->module()==0 || emcTrk->module()==2)&&eraw < m_energyThreshold_e) continue;
1556 else if( emcTrk->module()==1 && eraw < m_energyThreshold_b) continue;
1557 //if(eraw < m_energyThreshold) continue;
1558 if(dang < m_gammaAngCut) continue;
1559 //
1560 // good photon cut will be set here
1561 //
1562 iGam.push_back((*itTrk)->trackId());
1563 }
1564
1565 //
1566 // Finish Good Photon Selection
1567 //
1568 int nGam = iGam.size();
1569
1570 //
1571 // Assign 4-momentum to each photon
1572 //
1573
1574 Vp4 pGam;
1575 pGam.clear();
1576 for(int i = 0; i < nGam; i++) {
1577 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + iGam[i];
1578 RecEmcShower* emcTrk = (*itTrk)->emcShower();
1579 double eraw = emcTrk->energy();
1580 double phi = emcTrk->phi();
1581 double the = emcTrk->theta();
1582 HepLorentzVector ptrk;
1583 ptrk.setPx(eraw*sin(the)*cos(phi));
1584 ptrk.setPy(eraw*sin(the)*sin(phi));
1585 ptrk.setPz(eraw*cos(the));
1586 ptrk.setE(eraw);
1587 // ptrk = ptrk.boost(-0.011,0,0);// boost to cms
1588 pGam.push_back(ptrk);
1589 }
1590
1591 //
1592 // check dedx infomation
1593 //
1594 if (m_checkDedx)
1595 {
1596 m_ngch = nGood;
1597 for(int ii = 0; ii < nGood; ii++) {
1598 // dedx
1599 m_ptrk[ii] = 999.0;
1600 m_chie[ii] = 999.0;
1601 m_chimu[ii] = 999.0;
1602 m_chipi[ii] = 999.0;
1603 m_chik[ii] = 999.0;
1604 m_chip[ii] = 999.0;
1605 m_ghit[ii] = 999.0;
1606 m_thit[ii] = 999.0;
1607 m_probPH[ii] = 1999.0;
1608 m_normPH[ii] = 999.0;
1609 }
1610 int indx0=0;
1611 for(int i = 0; i < nGood; i++) {
1612 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + iGood[i];
1613 if(!(*itTrk)->isMdcTrackValid()) continue;
1614 if(!(*itTrk)->isMdcDedxValid())continue;
1615 RecMdcTrack* mdcTrk = (*itTrk)->mdcTrack();
1616 RecMdcDedx* dedxTrk = (*itTrk)->mdcDedx();
1617 m_trkiddedx[indx0] = (*itTrk)->trackId();
1618 m_ptrk[indx0] = mdcTrk->p();
1619 m_chie[indx0] = dedxTrk->chiE();
1620 m_chimu[indx0] = dedxTrk->chiMu();
1621 m_chipi[indx0] = dedxTrk->chiPi();
1622 m_chik[indx0] = dedxTrk->chiK();
1623 m_chip[indx0] = dedxTrk->chiP();
1624 m_ghit[indx0] = dedxTrk->numGoodHits();
1625 m_thit[indx0] = dedxTrk->numTotalHits();
1626 m_probPH[indx0] = dedxTrk->probPH();
1627 m_normPH[indx0] = dedxTrk->normPH();
1628 indx0++;
1629 }
1630 // m_tuple11->write();
1631 } // end chechDedx
1632 //
1633 // check TOF infomation
1634 //
1635 if (m_checkTof)
1636 {
1637 m_ngch2 = nGood;
1638 for(int ii = 0; ii < nGood; ii++) {
1639 //endtof
1640 m_cntr_etof[ii] = 999.0;
1641 m_ptot_etof[ii] = 999.0;
1642 m_ph_etof[ii] = 999.0;
1643 m_rhit_etof[ii] = 999.0;
1644 m_qual_etof[ii] = 999.0;
1645 m_te_etof[ii] = 999.0;
1646 m_tmu_etof[ii] = 999.0;
1647 m_tpi_etof[ii] = 999.0;
1648 m_tk_etof[ii] = 999.0;
1649 m_tp_etof[ii] = 999.0;
1650 m_ec_tof[ii] = 999.0;
1651 m_ec_toff_e[ii] = 999.0;
1652 m_ec_toff_mu[ii] = 999.0;
1653 m_ec_toff_pi[ii] = 999.0;
1654 m_ec_toff_k[ii] = 999.0;
1655 m_ec_toff_p[ii] = 999.0;
1656 m_ec_tsig_e[ii] = 999.0;
1657 m_ec_tsig_mu[ii] = 999.0;
1658 m_ec_tsig_pi[ii] = 999.0;
1659 m_ec_tsig_k[ii] = 999.0;
1660 m_ec_tsig_p[ii] = 999.0;
1661
1662 // barrel tof
1663 m_cntr_btof1[ii] = 999.0;
1664 m_ptot_btof1[ii] = 999.0;
1665 m_ph_btof1[ii] = 999.0;
1666 m_zhit_btof1[ii] = 999.0;
1667 m_qual_btof1[ii] = 999.0;
1668 m_te_btof1[ii] = 999.0;
1669 m_tmu_btof1[ii] = 999.0;
1670 m_tpi_btof1[ii] = 999.0;
1671 m_tk_btof1[ii] = 999.0;
1672 m_tp_btof1[ii] = 999.0;
1673 m_b1_tof[ii] = 999.0;
1674 m_b1_toff_e[ii] = 999.0;
1675 m_b1_toff_mu[ii] = 999.0;
1676 m_b1_toff_pi[ii] = 999.0;
1677 m_b1_toff_k[ii] = 999.0;
1678 m_b1_toff_p[ii] = 999.0;
1679 m_b1_tsig_e[ii] = 999.0;
1680 m_b1_tsig_mu[ii] = 999.0;
1681 m_b1_tsig_pi[ii] = 999.0;
1682 m_b1_tsig_k[ii] = 999.0;
1683 m_b1_tsig_p[ii] = 999.0;
1684 //pid
1685 //m_dedx_pid[ii] = 999.0;
1686 //m_tof1_pid[ii] = 999.0;
1687 //m_tof2_pid[ii] = 999.0;
1688 //m_prob_pid[ii] = 999.0;
1689 //m_ptrk_pid[ii] = 999.0;
1690 //m_cost_pid[ii] = 999.0;
1691 }
1692 int indx1=0;
1693 for(int i = 0; i < nGood; i++) {
1694 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + iGood[i];
1695 if(!(*itTrk)->isMdcTrackValid()) continue;
1696 if(!(*itTrk)->isTofTrackValid()) continue;
1697
1698 RecMdcTrack * mdcTrk = (*itTrk)->mdcTrack();
1699 SmartRefVector<RecTofTrack> tofTrkCol = (*itTrk)->tofTrack();
1700
1701 double ptrk = mdcTrk->p();
1702 SmartRefVector<RecTofTrack>::iterator iter_tof = tofTrkCol.begin();
1703 for(;iter_tof != tofTrkCol.end(); iter_tof++ ) {
1704 TofHitStatus *status = new TofHitStatus;
1705 status->setStatus((*iter_tof)->status());
1706 if(!(status->is_barrel())){//endcap
1707 if( !(status->is_counter()) ) continue; // ?
1708 if( status->layer()!=1 ) continue;//layer1
1709 double path=(*iter_tof)->path(); // ?
1710 double tof = (*iter_tof)->tof();
1711 double ph = (*iter_tof)->ph();
1712 double rhit = (*iter_tof)->zrhit();
1713 double qual = 0.0 + (*iter_tof)->quality();
1714 double cntr = 0.0 + (*iter_tof)->tofID();
1715 double texp[5];
1716 double tsig[5];
1717 for(int j = 0; j < 5; j++) {//0 e, 1 mu, 2 pi, 3 K, 4 p
1718 texp[j] = (*iter_tof)->texp(j);
1719 // tsig[j] = (*iter_tof)->sigma(j);
1720 // toffset[j] = (*iter_tof)->offset(j);
1721 }
1722 m_trkidtof[indx1] = (*itTrk)->trackId();
1723 m_cntr_etof[indx1] = cntr;
1724 m_ptot_etof[indx1] = ptrk;
1725 m_ph_etof[indx1] = ph;
1726 m_rhit_etof[indx1] = rhit;
1727 m_qual_etof[indx1] = qual;
1728 m_te_etof[indx1] = tof - texp[0];
1729 m_tmu_etof[indx1] = tof - texp[1];
1730 m_tpi_etof[indx1] = tof - texp[2];
1731 m_tk_etof[indx1] = tof - texp[3];
1732 m_tp_etof[indx1] = tof - texp[4];
1733
1734 m_ec_tof[indx1] = tof;
1735
1736 m_ec_toff_e[indx1] = (*iter_tof)->toffset(0);
1737 m_ec_toff_mu[indx1] = (*iter_tof)->toffset(1);
1738 m_ec_toff_pi[indx1] = (*iter_tof)->toffset(2);
1739 m_ec_toff_k[indx1] = (*iter_tof)->toffset(3);
1740 m_ec_toff_p[indx1] = (*iter_tof)->toffset(4);
1741
1742 m_ec_tsig_e[indx1] = (*iter_tof)->sigma(0);
1743 m_ec_tsig_mu[indx1] = (*iter_tof)->sigma(1);
1744 m_ec_tsig_pi[indx1] = (*iter_tof)->sigma(2);
1745 m_ec_tsig_k[indx1] = (*iter_tof)->sigma(3);
1746 m_ec_tsig_p[indx1] = (*iter_tof)->sigma(4);
1747
1748 }
1749 else {//barrel
1750 if( !(status->is_cluster()) ) continue; // ?
1751 double path=(*iter_tof)->path(); // ?
1752 double tof = (*iter_tof)->tof();
1753 double ph = (*iter_tof)->ph();
1754 double rhit = (*iter_tof)->zrhit();
1755 double qual = 0.0 + (*iter_tof)->quality();
1756 double cntr = 0.0 + (*iter_tof)->tofID();
1757 double texp[5];
1758 for(int j = 0; j < 5; j++) {
1759 texp[j] = (*iter_tof)->texp(j);
1760 }
1761 m_cntr_btof1[indx1] = cntr;
1762 m_ptot_btof1[indx1] = ptrk;
1763 m_ph_btof1[indx1] = ph;
1764 m_zhit_btof1[indx1] = rhit;
1765 m_qual_btof1[indx1] = qual;
1766 m_te_btof1[indx1] = tof - texp[0];
1767 m_tmu_btof1[indx1] = tof - texp[1];
1768 m_tpi_btof1[indx1] = tof - texp[2];
1769 m_tk_btof1[indx1] = tof - texp[3];
1770 m_tp_btof1[indx1] = tof - texp[4];
1771
1772 m_b1_tof[indx1] = tof;
1773
1774 m_b1_toff_e[indx1] = (*iter_tof)->toffset(0);
1775 m_b1_toff_mu[indx1] = (*iter_tof)->toffset(1);
1776 m_b1_toff_pi[indx1] = (*iter_tof)->toffset(2);
1777 m_b1_toff_k[indx1] = (*iter_tof)->toffset(3);
1778 m_b1_toff_p[indx1] = (*iter_tof)->toffset(4);
1779
1780 m_b1_tsig_e[indx1] = (*iter_tof)->sigma(0);
1781 m_b1_tsig_mu[indx1] = (*iter_tof)->sigma(1);
1782 m_b1_tsig_pi[indx1] = (*iter_tof)->sigma(2);
1783 m_b1_tsig_k[indx1] = (*iter_tof)->sigma(3);
1784 m_b1_tsig_p[indx1] = (*iter_tof)->sigma(4);
1785
1786 }
1787 delete status;
1788 }
1789 indx1++;
1790 } // loop all charged track
1791
1792 // m_tuple12->write();
1793 m_nggneu = nGam;
1794 int iphoton = 0;
1795 for (int i=0; i<nGam; i++)
1796 {
1797 EvtRecTrackIterator itTrk=evtRecTrkCol->begin() + iGam[i];
1798 if (!(*itTrk)->isEmcShowerValid()) continue;
1799 RecEmcShower *emcTrk = (*itTrk)->emcShower();
1800 m_shwidtof[iphoton] = (*itTrk)->trackId();
1801 m_numHits[iphoton] = emcTrk->numHits();
1802 m_secondmoment[iphoton] = emcTrk->secondMoment();
1803 m_x[iphoton] = emcTrk->x();
1804 m_y[iphoton]= emcTrk->y();
1805 m_z[iphoton]= emcTrk->z();
1806 m_cosemc[iphoton] = cos(emcTrk->theta());
1807 m_phiemc[iphoton] = emcTrk->phi();
1808 m_energy[iphoton] = emcTrk->energy();
1809 m_eSeed[iphoton] = emcTrk->eSeed();
1810 m_e3x3[iphoton] = emcTrk->e3x3();
1811 m_e5x5[iphoton] = emcTrk->e5x5();
1812 m_lat[iphoton] = emcTrk->latMoment();
1813 m_a20[iphoton] = emcTrk->a20Moment();
1814 m_a42[iphoton] = emcTrk->a42Moment();
1815 iphoton++;
1816 }
1817 // m_tuple13->write();
1818 } //end checkTof
1819 }
1820
1821 // DQAHist
1822 if (m_regHist)
1823 {
1824 if (taggedMode != -1 )
1825 {
1826 string strdecaymode[11] = {"D02KPi","D02KPiPi0","D02KPiPiPi","D02KPiPiPiPi0","D02KsPiPi","D02KsPiPiPi0",\
1827 "DC2KPiPi","DC2KPiPiPi0","DC2KsPiPi0","DC2KsPiPiPi","DC2KKPi"};
1828 int pi0cut[11] = {0,1,0,1,0,1,0,1,1,0,0};
1829 int kscut[11] = {0,0,0,0,1,1,0,0,1,1,0};
1830 string strtrack[14] = {"D02KPi_kaon","D02KPi_pion","D02KPiPi0_kaon","D02KPiPi0_pion","D02KsPiPi_pion1",\
1831 "D02KsPiPi_pion2","D02KsPiPi_pion3","D02KsPiPi_pion4","DC2KPiPi_kaon","DC2KPiPi_pion1","DC2KPiPi_pion2",\
1832 "DC2KsPiPi0_pion1","DC2KsPiPi0_pion2","DC2KsPiPi0_pion3" };
1833 // for (int i=0;i!=11;i++)
1834 // {
1835 // fillHistogram(m_thsvc,strdecaymode[i],3,m_decayModeHistName,m_tuple4,pi0cut[i],kscut[i]);
1836 // }
1837 fillHistogram(m_thsvc,strdecaymode[taggedMode],3,m_decayModeHistName,m_tuple4,pi0cut[taggedMode],kscut[taggedMode]);
1838 string strDdecaymode[2] = {"D0","DC"};
1839 // fillHistogram(m_thsvc,strDdecaymode[0],3,m_decayModeHistName,m_tuple4);
1840 // fillHistogram(m_thsvc,strDdecaymode[1],3,m_decayModeHistName,m_tuple4);
1841 if (taggedMode < 6)
1842 fillHistogram(m_thsvc,strDdecaymode[0],3,m_decayModeHistName,m_tuple4);
1843 else
1844 fillHistogram(m_thsvc,strDdecaymode[1],3,m_decayModeHistName,m_tuple4);
1845
1846 string strtrackdedx[7] = {"D02KPi_kaon","D02KPi_pion","D02KPiPi0_kaon","D02KPiPi0_pion","DC2KPiPi_kaon","DC2KPiPi_pion1","DC2KPiPi_pion2"};
1847 string strtracktof[7] = {"D02KPi_kaon","D02KPi_pion","D02KPiPi0_kaon","D02KPiPi0_pion", "DC2KPiPi_kaon", "DC2KPiPi_pion1", "DC2KPiPi_pion2"};
1848 string strphoton[2] = {"D02KPiPi0_photon1","D02KPiPi0_photon2"};
1849 string strpi0[2] = {"D02KPiPi0","DC2KsPiPi0"};
1850 string strks[2] = {"D02KsPiPi_ks","DC2KsPiPi0_ks"};
1851 if (taggedMode == 0)
1852 {
1853 if (g_mBC > 1.86 && g_mBC < 1.87 && fabs(g_deltE) < 0.03)
1854 {
1855 fillHistogram(m_thsvc,strtrack[0],10,m_trackHistName,m_tuple4);
1856 fillHistogram(m_thsvc,strtrack[1],10,m_trackHistName,m_tuple4);
1857 fillHistogram(m_thsvc,strtrackdedx[0],6,m_trackDedxHistName,m_tuple4);
1858 fillHistogram(m_thsvc,strtrackdedx[1],6,m_trackDedxHistName,m_tuple4);
1859 fillTofHistogram(m_thsvc,strtracktof[0]);
1860 fillTofHistogram(m_thsvc,strtracktof[1]);
1861 }
1862 }
1863 if (taggedMode == 1)
1864 {
1865 if (g_mBC > 1.86 && g_mBC < 1.87 && g_deltE > -0.0583 && g_deltE < 0.035 )
1866 {
1867 fillHistogram(m_thsvc,strtrack[2],10,m_trackHistName,m_tuple4);
1868 fillHistogram(m_thsvc,strtrack[3],10,m_trackHistName,m_tuple4);
1869
1870 fillHistogram(m_thsvc,strtrackdedx[2],6,m_trackDedxHistName,m_tuple4);
1871 fillHistogram(m_thsvc,strtrackdedx[3],6,m_trackDedxHistName,m_tuple4);
1872 fillTofHistogram(m_thsvc,strtracktof[2]);
1873 fillTofHistogram(m_thsvc,strtracktof[3]);
1874 fillHistogram(m_thsvc,strphoton[0],5,m_photonHistName,m_tuple4);
1875 fillHistogram(m_thsvc,strphoton[1],5,m_photonHistName,m_tuple4);
1876
1877 fillHistogram(m_thsvc,strpi0[0],5,m_Pi0HistName,m_tuple4);
1878 }
1879 }
1880 if (taggedMode == 4)
1881 {
1882 if (g_mBC > 1.86 && g_mBC < 1.87 && fabs(g_deltE) < 0.03 )
1883 {
1884 fillHistogram(m_thsvc,strtrack[4],10,m_trackHistName,m_tuple4);
1885 fillHistogram(m_thsvc,strtrack[5],10,m_trackHistName,m_tuple4);
1886 fillHistogram(m_thsvc,strtrack[6],10,m_trackHistName,m_tuple4);
1887 fillHistogram(m_thsvc,strtrack[7],10,m_trackHistName,m_tuple4);
1888
1889 fillHistogram(m_thsvc,strks[0],4,m_KsHistName,m_tuple4);
1890 }
1891 }
1892 if (taggedMode == 6)
1893 {
1894 if (g_mBC > 1.86 && g_mBC < 1.87 && fabs(g_deltE) < 0.0218 )
1895 {
1896 fillHistogram(m_thsvc,strtrack[8],10,m_trackHistName,m_tuple4);
1897 fillHistogram(m_thsvc,strtrack[9],10,m_trackHistName,m_tuple4);
1898 fillHistogram(m_thsvc,strtrack[10],10,m_trackHistName,m_tuple4);
1899 fillTofHistogram(m_thsvc,strtracktof[4]);
1900 fillTofHistogram(m_thsvc,strtracktof[5]);
1901 fillTofHistogram(m_thsvc,strtracktof[6]);
1902 fillHistogram(m_thsvc,strtrackdedx[4],6,m_trackDedxHistName,m_tuple4);
1903 fillHistogram(m_thsvc,strtrackdedx[5],6,m_trackDedxHistName,m_tuple4);
1904 fillHistogram(m_thsvc,strtrackdedx[6],6,m_trackDedxHistName,m_tuple4);
1905 }
1906 }
1907 if (taggedMode == 8)
1908 {
1909 if (g_mBC > 1.86 && g_mBC < 1.87 && g_deltE < 0.0423 && g_deltE > -0.0455 )
1910 {
1911 fillHistogram(m_thsvc,strtrack[11],10,m_trackHistName,m_tuple4);
1912 fillHistogram(m_thsvc,strtrack[12],10,m_trackHistName,m_tuple4);
1913 fillHistogram(m_thsvc,strtrack[13],10,m_trackHistName,m_tuple4);
1914
1915 fillHistogram(m_thsvc,strpi0[1],5,m_Pi0HistName,m_tuple4);
1916 fillHistogram(m_thsvc,strks[1],4,m_KsHistName,m_tuple4);
1917 }
1918 }
1919 }
1920 }
1921 if (m_writeTuple)
1922 {
1923 m_tuple4->write();
1924 }
1925 if (m_writeTuple && m_checkEvt)
1926 {
1927 // m_tuple5->write();
1928 }
1929 //if (m_checkDedx)
1930 //m_tuple16->write();
1931 //if (m_checkTof)
1932 //m_tuple17->write();
1933
1934 setFilterPassed(true);
1935
1936 return StatusCode::SUCCESS;
1937}
1938
1939
1940void DQADtag::regTrackHistogram(ITHistSvc*& , string &str)
1941{
1942 MsgStream log(msgSvc(), name());
1943 const int NUM = 10;
1944 TString hisname[NUM];
1945 TString strHisReg[NUM];
1946 TString strHisLog[NUM];
1947 for (int i=0;i!=NUM;i++)
1948 {
1949 hisname[i] = str + "_" + m_trackHistName[i]; // D02KPi_k_px ...
1950 strHisLog[i] = "Couldn't register " + hisname[i];
1951 strHisReg[i] = "/DQAHist/Dtag/" + hisname[i];
1952 if (m_debug) cout<<"hisname: "<<hisname[i]<<endl;
1953 if (m_debug) cout<<"strHisReg: "<<strHisReg[i]<<endl;
1954 }
1955 TH1F* hist[10];
1956 hist[0] = new TH1F(hisname[0] , hisname[0], 100,-1.1,1.1);
1957 hist[1] = new TH1F(hisname[1] , hisname[1], 100,-1.1,1.1);
1958 hist[2] = new TH1F(hisname[2] , hisname[2], 100,-1.1,1.1);
1959 hist[3] = new TH1F(hisname[3] , hisname[3], 200,0.,1.2);
1960 hist[4] = new TH1F(hisname[4] , hisname[4], 100,-1.,1.);
1961 hist[5] = new TH1F(hisname[5] , hisname[5], 100,-1.,1.);
1962 hist[6] = new TH1F(hisname[6] , hisname[6], 100,-10.,10.);
1963 hist[7] = new TH1F(hisname[7] , hisname[7], 100,-1.,1.);
1964 hist[8] = new TH1F(hisname[8] , hisname[8], 100,-1.,1.);
1965 hist[9] = new TH1F(hisname[9] , hisname[9], 200,0.,1.4);
1966 for (int i=0;i!=NUM;i++)
1967 {
1968 if(m_thsvc->regHist((string)strHisReg[i], hist[i]).isFailure()) {
1969 log << MSG::ERROR << strHisLog[i] << endreq;
1970 }
1971 }
1972}
1973void DQADtag::regPhotonHistogram(ITHistSvc*& , string &str)
1974{
1975 MsgStream log(msgSvc(), name());
1976 const int NUM = 5;
1977 TString hisname[NUM];
1978 TString strHisReg[NUM];
1979 TString strHisLog[NUM];
1980 for (int i=0;i!=NUM;i++)
1981 {
1982 hisname[i] = str + "_" + m_photonHistName[i]; // D02KPi_k_px ...
1983 strHisLog[i] = "Couldn't register " + hisname[i];
1984 strHisReg[i] = "/DQAHist/Dtag/" + hisname[i];
1985 if (m_debug) cout<<"hisname: "<<hisname[i]<<endl;
1986 if (m_debug) cout<<"strHisReg: "<<strHisReg[i]<<endl;
1987 }
1988 TH1F* hist[5];
1989 hist[0] = new TH1F(hisname[0] , hisname[0], 80,0,40);
1990 hist[1] = new TH1F(hisname[1] , hisname[1], 160,0,80);
1991 hist[2] = new TH1F(hisname[2] , hisname[2], 100,-100.,100.);
1992 hist[3] = new TH1F(hisname[3] , hisname[3], 100,-100.,100.);
1993 hist[4] = new TH1F(hisname[4] , hisname[4], 100,-150.,150.);
1994 for (int i=0;i!=NUM;i++)
1995 {
1996 if(m_thsvc->regHist((string)strHisReg[i], hist[i]).isFailure()) {
1997 log << MSG::ERROR << strHisLog[i] << endreq;
1998 }
1999 }
2000}
2001
2002void DQADtag::regTrackDedxHistogram(ITHistSvc*& , string& str)
2003{
2004 MsgStream log(msgSvc(), name());
2005 const int NUM = 6;
2006 TString hisname[NUM];
2007 TString strHisReg[NUM];
2008 TString strHisLog[NUM];
2009 for (int i=0;i!=NUM;i++)
2010 {
2011 hisname[i] = str + "_" + m_trackDedxHistName[i]; // D02KPi_dedx_chik
2012 strHisLog[i] = "Couldn't register " + hisname[i];
2013 strHisReg[i] = "/DQAHist/Dtag/" + hisname[i];
2014 if (m_debug) cout<<"hisname: "<<hisname[i]<<endl;
2015 if (m_debug) cout<<"strHisReg: "<<strHisReg[i]<<endl;
2016 }
2017 TH1F* hist[6];
2018 hist[0] = new TH1F(hisname[0] , hisname[0], 200,-3.,5.);
2019 hist[1] = new TH1F(hisname[1] , hisname[1], 200,-2.,15.);
2020 hist[2] = new TH1F(hisname[2] , hisname[2], 80,0,40);
2021 hist[3] = new TH1F(hisname[3] , hisname[3], 120,0,60);
2022 hist[4] = new TH1F(hisname[4] , hisname[4], 100,200,1400);
2023 hist[5] = new TH1F(hisname[5] , hisname[5], 100,0.6,1.5);
2024 for (int i=0;i!=NUM;i++)
2025 {
2026 if(m_thsvc->regHist((string)strHisReg[i], hist[i]).isFailure()) {
2027 log << MSG::ERROR << strHisLog[i] << endreq;
2028 }
2029 }
2030}
2031void DQADtag::regTrackTofHistogram(ITHistSvc*& , string& str)
2032{
2033 MsgStream log(msgSvc(), name());
2034 const int NUM = 24;
2035 TString hisname[NUM];
2036 TString strHisReg[NUM];
2037 TString strHisLog[NUM];
2038 string tofReadOutID[7] = {"1","2","3","4","12","34","1234"};
2039 int num(0);
2040 for (int i=0;i!=3;i++)
2041 {
2042 for (int j=0;j!=7;j++)
2043 {
2044 num = i*7+j;
2045 hisname[num] = str + "_" + m_trackTofHistName[i] + "_" + tofReadOutID[j]; // D02KPi_dedx_chik
2046 strHisLog[num] = "Couldn't register " + hisname[num];
2047 strHisReg[num] = "/DQAHist/Dtag/" + hisname[num];
2048 //strHisLog[num] = "Couldn't register " + hisname[num] + "_" + sprintf("%d",j);
2049 //strHisReg[num] = "/DQAHist/Dtag/" + hisname[num] + "_" + sprintf("%d",j);
2050 if (m_debug) cout<<"hisname: "<<hisname[num]<<endl;
2051 if (m_debug) cout<<"strHisReg: "<<strHisReg[num]<<endl;
2052 }
2053 }
2054 for (int i=3;i!=6;i++)
2055 {
2056 num = 3*6+i;
2057 hisname[num] = str + "_" + m_trackTofHistName[i]; // D02KPi_dedx_chik
2058 strHisLog[num] = "Couldn't register " + hisname[num];
2059 strHisReg[num] = "/DQAHist/Dtag/" + hisname[num];
2060 }
2061 TH1F* hist[24];
2062 for (int i=0;i!=24;i++)
2063 {
2064 hist[i] = new TH1F(hisname[i] , hisname[i], 100,-4.0,4.);
2065 }
2066 for (int i=0;i!=NUM;i++)
2067 {
2068 if(m_thsvc->regHist((string)strHisReg[i], hist[i]).isFailure()) {
2069 log << MSG::ERROR << strHisLog[i] << endreq;
2070 }
2071 }
2072}
2073void DQADtag::regDecayModeHistogram(ITHistSvc*& , string& str)
2074{
2075 MsgStream log(msgSvc(), name());
2076 const int NUM = 3;
2077 TString hisname[NUM];
2078 TString strHisReg[NUM];
2079 TString strHisLog[NUM];
2080 for (int i=0;i!=NUM;i++)
2081 {
2082 hisname[i] = str + "_" + m_decayModeHistName[i]; // D02KPi_dedx_chik
2083 strHisLog[i] = "Couldn't register " + hisname[i];
2084 strHisReg[i] = "/DQAHist/Dtag/" + hisname[i];
2085 if (m_debug) cout<<"hisname: "<<hisname[i]<<endl;
2086 if (m_debug) cout<<"strHisReg: "<<strHisReg[i]<<endl;
2087 }
2088 TH1F* hist[3];
2089 hist[0] = new TH1F(hisname[0] , hisname[0], 100,1.83,1.89);
2090 hist[1] = new TH1F(hisname[1] , hisname[1], 100,-0.1,0.1);
2091 hist[2] = new TH1F(hisname[2] , hisname[2], 100,1.83,1.89);
2092 for (int i=0;i!=NUM;i++)
2093 {
2094 if(m_thsvc->regHist((string)strHisReg[i], hist[i]).isFailure()) {
2095 log << MSG::ERROR << strHisLog[i] << endreq;
2096 }
2097 }
2098}
2099void DQADtag::regKsHistogram(ITHistSvc*& , string& str)
2100{
2101 MsgStream log(msgSvc(), name());
2102 const int NUM = 4;
2103 TString hisname[NUM];
2104 TString strHisReg[NUM];
2105 TString strHisLog[NUM];
2106 TH1F* hist[4];
2107 for (int i=0;i!=NUM;i++)
2108 {
2109 hisname[i] = str + "_ks_" + m_KsHistName[i]; // D02KPi_dedx_chik
2110 strHisLog[i] = "Couldn't register " + hisname[i];
2111 strHisReg[i] = "/DQAHist/Dtag/" + hisname[i];
2112 if (m_debug) cout<<"hisname: "<<hisname[i]<<endl;
2113 if (m_debug) cout<<"strHisReg: "<<strHisReg[i]<<endl;
2114 }
2115 hist[0] = new TH1F(hisname[0] , hisname[0], 100,0.46,0.54);
2116 hist[1] = new TH1F(hisname[1] , hisname[1], 100,0.46,0.54);
2117 hist[2] = new TH1F(hisname[2] , hisname[2], 100,0,30);
2118 hist[3] = new TH1F(hisname[3] , hisname[3], 100,0,30);
2119 for (int i=0;i!=NUM;i++)
2120 {
2121 if(m_thsvc->regHist((string)strHisReg[i], hist[i]).isFailure()) {
2122 log << MSG::ERROR << strHisLog[i] << endreq;
2123 }
2124 }
2125}
2126void DQADtag::regPi0Histogram(ITHistSvc*& , string& str)
2127{
2128 MsgStream log(msgSvc(), name());
2129 const int NUM = 5;
2130 TString hisname[NUM];
2131 TString strHisReg[NUM];
2132 TString strHisLog[NUM];
2133 TH1F* hist[5];
2134 for (int i=0;i!=NUM;i++)
2135 {
2136 hisname[i] = str + "_" + m_Pi0HistName[i]; // D02KPi_dedx_chik
2137 strHisLog[i] = "Couldn't register " + hisname[i];
2138 strHisReg[i] = "/DQAHist/Dtag/" + hisname[i];
2139 if (m_debug) cout<<"hisname: "<<hisname[i]<<endl;
2140 if (m_debug) cout<<"strHisReg: "<<strHisReg[i]<<endl;
2141 }
2142 hist[0] = new TH1F(hisname[0] , hisname[0], 100,0.08,0.18);
2143 hist[1] = new TH1F(hisname[1] , hisname[1], 100,0.0,1.0);
2144 hist[2] = new TH1F(hisname[2] , hisname[2], 100,-1.0,1.0);
2145 hist[3] = new TH1F(hisname[3] , hisname[3], 100,0.0,1.0);
2146 hist[4] = new TH1F(hisname[4] , hisname[4], 100,-1.0,1.0);
2147 for (int i=0;i!=NUM;i++)
2148 {
2149 if(m_thsvc->regHist((string)strHisReg[i], hist[i]).isFailure()) {
2150 log << MSG::ERROR << strHisLog[i] << endreq;
2151 }
2152 }
2153}
2154void DQADtag::fillHistogram(ITHistSvc*& , string str, int NUM, string* fillHistName, NTuple::Tuple*& m_tuple)
2155{
2156 MsgStream log(msgSvc(), name());
2157 string* strVarName = new string[NUM];
2158 string* strHisGet = new string[NUM];
2159 string* strHisLog = new string[NUM];
2160 TH1* hist;
2161 for (int i=0;i!=NUM;i++)
2162 {
2163 strVarName[i] = str + "_" + fillHistName[i]; //
2164 strHisLog[i] = "Couldn't retrieve " + strVarName[i];
2165 strHisGet[i] = "/DQAHist/Dtag/" + strVarName[i];
2166 //cout<<"strVarName: "<<strVarName[i]<<endl;
2167 //cout<<"strHisGet: "<<strHisGet[i]<<endl;
2168 NTuple::Item<double> m_Variable;
2169 m_tuple->item(strVarName[i],m_Variable);
2170 if (m_thsvc->getHist(strHisGet[i], hist).isSuccess()) {
2171 hist->Fill(m_Variable);
2172 }
2173 else {
2174 log << MSG::ERROR << strHisLog[i] << endreq;
2175 }
2176 }
2177 //delete [] hist;
2178 delete [] strVarName;
2179 delete [] strHisGet;
2180 delete [] strHisLog;
2181}
2182void DQADtag::fillHistogram(ITHistSvc*& , string str, int NUM, string* fillHistName, NTuple::Tuple*& m_tuple, int pi0cut, int kscut)
2183{
2184 MsgStream log(msgSvc(), name());
2185 string* strVarName = new string[NUM];
2186 string* strHisGet = new string[NUM];
2187 string* strHisLog = new string[NUM];
2188 TH1* hist;
2189 NTuple::Item<double> m_Variable0;
2190 NTuple::Item<double> m_Variable1;
2191 NTuple::Item<double> m_Variable2;
2192 NTuple::Item<double> m_Variable3;
2193 if (pi0cut)
2194 m_tuple->item(str+"_pi0mass",m_Variable0);
2195 if (kscut)
2196 m_tuple->item(str+"_ks_vfitmass",m_Variable1);
2197 m_tuple->item(str+"_deltE",m_Variable2);
2198 m_tuple->item(str+"_mBC",m_Variable3);
2199 for (int i=0;i!=NUM;i++)
2200 {
2201 strVarName[i] = str + "_" + fillHistName[i]; // D02KPi_kaon_px ...
2202 strHisLog[i] = "Couldn't retrieve " + strVarName[i];
2203 strHisGet[i] = "/DQAHist/Dtag/" + strVarName[i];
2204 //cout<<"strVarName: "<<strVarName[i]<<endl;
2205 //cout<<"strHisGet: "<<strHisGet[i]<<endl;
2206 NTuple::Item<double> m_Variable;
2207 m_tuple->item(strVarName[i],m_Variable);
2208 if (m_thsvc->getHist(strHisGet[i], hist).isSuccess()) {
2209 bool isfill = 1;
2210 if (pi0cut)
2211 {
2212 if (m_Variable0>m_mpi0MaxCut||m_Variable0<m_mpi0MinCut) isfill = 0;
2213 }
2214 if (kscut)
2215 {
2216 if (m_Variable1>m_mKsMaxCut||m_Variable1<m_mKsMinCut) isfill = 0;
2217 }
2218 if (i==0)
2219 {
2220 if (fabs(m_Variable2)>0.03) isfill = 0;
2221 }
2222 if (i==1)
2223 {
2224 if (m_Variable3 > 1.87 || m_Variable3 < 1.86 ) isfill = 0;
2225 }
2226 if (i==2)
2227 {
2228 if (m_Variable3 > 1.87 || m_Variable3 < 1.86 || fabs(m_Variable2)>0.03 ) isfill = 0;
2229 }
2230 if (isfill == 1)
2231 {
2232 hist->Fill(m_Variable);
2233 }
2234 }
2235 else {
2236 log << MSG::ERROR << strHisLog[i] << endreq;
2237 }
2238 }
2239 //delete [] hist;
2240 delete [] strVarName;
2241 delete [] strHisGet;
2242 delete [] strHisLog;
2243}
2244void DQADtag::fillTofHistogram(ITHistSvc*& , string str )
2245{
2246 MsgStream log(msgSvc(), name());
2247 string strVarName[6];
2248 string strHisGet[24];
2249 string strHisLog[24];
2250 TH1* hist;
2251 string tofReadOutID[7] = {"1","2","3","4","12","34","1234"};
2252 for (int i=0;i!=3;i++)
2253 {
2254 strVarName[i] = str + "_" + m_trackTofHistName[i]; // D02KPi_kaon_px ...
2255 //cout<<"strVarName: "<<strVarName[i]<<endl;
2256 //cout<<"strHisGet: "<<strHisGet[i]<<endl;
2257 NTuple::Array<double> m_Variable;
2258 m_tuple4->item(strVarName[i],m_Variable);
2259 for (int j=0;j!=7;j++)
2260 {
2261 int num = i*7+j;
2262 strHisLog[num] = "Couldn't retrieve " + strVarName[i] + "_" + tofReadOutID[j];
2263 strHisGet[num] = "/DQAHist/Dtag/" + strVarName[i] + "_" + tofReadOutID[j];
2264 if (m_thsvc->getHist(strHisGet[num], hist).isSuccess()) {
2265 hist->Fill(m_Variable[j]);
2266 }
2267 else {
2268 log << MSG::ERROR << strHisLog[num] << endreq;
2269 }
2270 }
2271 }
2272 for (int i=3;i!=6;i++)
2273 {
2274 int num = 3*6+ i;
2275 strVarName[i] = str + "_" + m_trackTofHistName[i]; // D02KPi_kaon_px ...
2276 strHisLog[num] = "Couldn't retrieve " + strVarName[i];
2277 strHisGet[num] = "/DQAHist/Dtag/" + strVarName[i];
2278 //cout<<"strVarName: "<<strVarName[i]<<endl;
2279 //cout<<"strHisGet: "<<strHisGet[num]<<endl;
2280 NTuple::Item<double> m_Variable;
2281 m_tuple4->item(strVarName[i],m_Variable);
2282 if (m_thsvc->getHist(strHisGet[num], hist).isSuccess()) {
2283 hist->Fill(m_Variable);
2284 }
2285 else {
2286 log << MSG::ERROR << strHisLog[num] << endreq;
2287 }
2288 }
2289 //delete [] hist;
2290}
2291void DQADtag::fillHistogram(ITHistSvc*& , string str, int NUM, string* fillHistName, int tuplenum, bool cut)
2292{
2293 MsgStream log(msgSvc(), name());
2294 string* strVarName = new string[NUM];
2295 string* strHisGet = new string[NUM];
2296 string* strHisLog = new string[NUM];
2297 TH1* hist;
2298 string pi0VarName = str + "_pi0mass";
2299 NTuple::Item<double> m_pi0Variable;
2300 m_tuple4->item(pi0VarName,m_pi0Variable);
2301 for (int i=0;i!=NUM;i++)
2302 {
2303 strVarName[i] = str + "_" + fillHistName[i]; // D02KPi_k_px ...
2304 strHisLog[i] = "Couldn't retrieve " + strVarName[i];
2305 strHisGet[i] = "/DQAHist/Dtag/" + strVarName[i];
2306 //cout<<"strVarName: "<<strVarName[i]<<endl;
2307 //cout<<"strHisGet: "<<strHisGet[i]<<endl;
2308 NTuple::Item<double> m_Variable;
2309 m_tuple4->item(strVarName[i],m_Variable);
2310 if (m_thsvc->getHist(strHisGet[i], hist).isSuccess()) {
2311 if(! (m_pi0Variable >m_mpi0Max || m_pi0Variable < m_mpi0Min))
2312 {
2313 hist->Fill(m_Variable);
2314 }
2315 }
2316 else {
2317 log << MSG::ERROR << strHisLog[i] << endreq;
2318 }
2319 }
2320 delete [] strVarName;
2321 delete [] strHisGet;
2322 delete [] strHisLog;
2323}
2324void DQADtag::fillDecayModeItem(EvtRecDTag* bestDTag, string str)
2325{
2326 string strVarName[6];
2327 //for (int i=0;i!=6;i++)
2328 //{
2329 ////cout<<"m_DecayModeItemName: "<<m_DecayModeItemName[i]<<endl;
2330 //}
2331 for (int i=0;i!=6;i++ )
2332 {
2333 strVarName[i] = str + "_" + m_DecayModeItemName[i];
2334 //cout<<" "<<strVarName[i]<<endl;
2335 }
2336 NTuple::Item<double> m_Variable0;
2337 NTuple::Item<double> m_Variable1;
2338 NTuple::Item<double> m_Variable2;
2339 NTuple::Item<double> m_Variable3;
2340 NTuple::Item<double> m_Variable4;
2341 NTuple::Item<double> m_Variable5;
2342 m_tuple4->item(strVarName[0],m_Variable0);
2343 m_tuple4->item(strVarName[1],m_Variable1);
2344 m_tuple4->item(strVarName[2],m_Variable2);
2345 m_tuple4->item(strVarName[3],m_Variable3);
2346 m_tuple4->item(strVarName[4],m_Variable4);
2347 m_tuple4->item(strVarName[5],m_Variable5);
2348 m_Variable0=(bestDTag)->mBC();
2349 m_Variable1=(bestDTag)->deltaE();
2350 m_Variable2=(bestDTag)->p4().rho();
2351 m_Variable3=(bestDTag)->charm();
2352 m_Variable4=(bestDTag)->mass();
2353 m_Variable5=(bestDTag)->beamE();
2354}
2355void DQADtag::fillTrackItem(EvtRecTrack* track, string str, int type, Hep3Vector& xorigin)
2356{
2357 string strVarName[11];
2358 for (int i=0;i!=11;i++ )
2359 {
2360 strVarName[i] = str + "_" + m_TrackItemName[i];
2361 //cout<<"strVarName: "<<strVarName[i]<<endl;
2362 }
2363 NTuple::Item<double> m_Variable0;
2364 NTuple::Item<double> m_Variable1;
2365 NTuple::Item<double> m_Variable2;
2366 NTuple::Item<double> m_Variable3;
2367 NTuple::Item<double> m_Variable4;
2368 NTuple::Item<double> m_Variable5;
2369 NTuple::Item<double> m_Variable6;
2370 NTuple::Item<double> m_Variable7;
2371 NTuple::Item<double> m_Variable8;
2372 NTuple::Item<double> m_Variable9;
2373 NTuple::Item<long> m_Variable10;
2374 m_tuple4->item(strVarName[0],m_Variable0);
2375 m_tuple4->item(strVarName[1],m_Variable1);
2376 m_tuple4->item(strVarName[2],m_Variable2);
2377 m_tuple4->item(strVarName[3],m_Variable3);
2378 m_tuple4->item(strVarName[4],m_Variable4);
2379 m_tuple4->item(strVarName[5],m_Variable5);
2380 m_tuple4->item(strVarName[6],m_Variable6);
2381 m_tuple4->item(strVarName[7],m_Variable7);
2382 m_tuple4->item(strVarName[8],m_Variable8);
2383 m_tuple4->item(strVarName[9],m_Variable9);
2384 m_tuple4->item(strVarName[10],m_Variable10);
2385 RecMdcKalTrack* mdcKalTrk = track->mdcKalTrack();
2386 if (type==2)
2388 else if (type==3)
2390 HepLorentzVector p4trk = mdcKalTrk->p4(xmass[type]);
2391
2392 HepVector a = mdcKalTrk->helix();
2393 HepSymMatrix Ea = mdcKalTrk->err();
2394 HepPoint3D point0(0., 0., 0.); // the initial point for MDC recosntruction
2395 HepPoint3D IP(xorigin[0], xorigin[1], xorigin[2]);
2396 VFHelix helixip(point0, a, Ea);
2397 helixip.pivot(IP);
2398 HepVector vecipa = helixip.a();
2399
2400 m_Variable0 = p4trk.px();
2401 m_Variable1 = p4trk.py();
2402 m_Variable2 = p4trk.pz();
2403 m_Variable3 = p4trk.rho();
2404 m_Variable4 = mdcKalTrk->dr() * cos(mdcKalTrk->fi0());
2405 m_Variable5 = mdcKalTrk->dr() * sin(mdcKalTrk->fi0());
2406 m_Variable6 = mdcKalTrk->dz();
2407 m_Variable7 = fabs(vecipa[0]); //the nearest distance to IP in xy plane
2408 m_Variable8 = p4trk.cosTheta();
2409 m_Variable9 = p4trk.e();
2410 m_Variable10 = track->trackId();
2411}
2412void DQADtag::fillPhotonItem(EvtRecTrack* shower, string str)
2413{
2414 string strVarName[6];
2415 for (int i=0;i!=6;i++ )
2416 {
2417 strVarName[i] = str + "_" + m_PhotonItemName[i];
2418 //cout<<"strVarName: "<<strVarName[i]<<endl;
2419 }
2420 NTuple::Item<double> m_Variable0;
2421 NTuple::Item<double> m_Variable1;
2422 NTuple::Item<double> m_Variable2;
2423 NTuple::Item<double> m_Variable3;
2424 NTuple::Item<double> m_Variable4;
2425 NTuple::Item<long> m_Variable5;
2426 m_tuple4->item(strVarName[0],m_Variable0);
2427 m_tuple4->item(strVarName[1],m_Variable1);
2428 m_tuple4->item(strVarName[2],m_Variable2);
2429 m_tuple4->item(strVarName[3],m_Variable3);
2430 m_tuple4->item(strVarName[4],m_Variable4);
2431 m_tuple4->item(strVarName[5],m_Variable5);
2432 RecEmcShower* emcTrk = shower->emcShower();
2433 m_Variable0 = emcTrk->numHits();
2434 m_Variable1 = emcTrk->secondMoment();
2435 m_Variable2 = emcTrk->x();
2436 m_Variable3 = emcTrk->y();
2437 m_Variable4 = emcTrk->z();
2438 m_Variable5 = shower->trackId();
2439}
2440void DQADtag::fillPi0Item(SmartRefVector<EvtRecTrack> showers, string str, DQAPi0Info* pi0info)
2441{
2442 string strVarName[7];
2443 for (int i=0;i!=7;i++ )
2444 {
2445 strVarName[i] = str + "_" + m_Pi0ItemName[i];
2446 //cout<<"strVarName: "<<strVarName[i]<<endl;
2447 }
2448 //DQAPi0Info pi0info;
2449 //pi0info.setchilds(showers[0],showers[1]);
2450 //if (!pi0info.calculate()) return false;
2451 //if (pi0info.m() >m_mpi0Max || pi0info.m() < m_mpi0Min)
2452 //iswritten = 0;
2453 NTuple::Item<double> m_Variable0;
2454 NTuple::Item<double> m_Variable1;
2455 NTuple::Item<double> m_Variable2;
2456 NTuple::Item<double> m_Variable3;
2457 NTuple::Item<double> m_Variable4;
2458 NTuple::Item<long> m_Variable5;
2459 NTuple::Item<long> m_Variable6;
2460 m_tuple4->item(strVarName[0],m_Variable0);
2461 m_tuple4->item(strVarName[1],m_Variable1);
2462 m_tuple4->item(strVarName[2],m_Variable2);
2463 m_tuple4->item(strVarName[3],m_Variable3);
2464 m_tuple4->item(strVarName[4],m_Variable4);
2465 m_tuple4->item(strVarName[5],m_Variable5);
2466 m_tuple4->item(strVarName[6],m_Variable6);
2467 m_Variable0 = pi0info->m();
2468 m_Variable1 = showers[0]->emcShower()->energy();
2469 m_Variable2 = cos(showers[0]->emcShower()->theta());
2470 m_Variable3 = showers[1]->emcShower()->energy();
2471 m_Variable4 = cos(showers[1]->emcShower()->theta());
2472 m_Variable5 = showers[0]->trackId();
2473 m_Variable6 = showers[1]->trackId();
2474}
2475void DQADtag::fillKsItem(SmartRefVector<EvtRecTrack> tracks, string str, DQAKsInfo* ksinfo)
2476{
2477 string strVarName[6];
2478 for (int i=0;i!=6;i++ )
2479 {
2480 strVarName[i] = str + "_ks_" + m_KsItemName[i];
2481 //cout<<"strVarName: "<<strVarName[i]<<endl;
2482 }
2483 //DQAKsInfo ksinfo;
2484 //ksinfo.setchilds(tracks[0],tracks[1]);
2485 //ksinfo.setVtxPar(m_vxpar);
2486 //ksinfo.setPrimaryVtxPar(m_privxpar);
2487 //if (!ksinfo.calculate()) return false;
2488 NTuple::Item<double> m_Variable0;
2489 NTuple::Item<double> m_Variable1;
2490 NTuple::Item<double> m_Variable2;
2491 NTuple::Item<double> m_Variable3;
2492 NTuple::Item<double> m_Variable4;
2493 NTuple::Item<double> m_Variable5;
2494 m_tuple4->item(strVarName[0],m_Variable0);
2495 m_tuple4->item(strVarName[1],m_Variable1);
2496 m_tuple4->item(strVarName[2],m_Variable2);
2497 m_tuple4->item(strVarName[3],m_Variable3);
2498 m_tuple4->item(strVarName[4],m_Variable4);
2499 m_tuple4->item(strVarName[5],m_Variable5);
2500 m_Variable0 = ksinfo->m();
2501 m_Variable1 = ksinfo->mksp4();
2502 m_Variable2 = ksinfo->vtxChi2();
2503 m_Variable3 = ksinfo->chi2();
2504 m_Variable4 = ksinfo->decayLength();
2505 m_Variable5 = ksinfo->decayLengthRatio();
2506}
2507int DQADtag::fillTrackTofItem(EvtRecTrack* track, string str, int type)
2508{
2509 string strVarName[8];
2510 int numtag(0);
2511 for (int i=0;i!=8;i++ )
2512 {
2513 strVarName[i] = str + "_" + m_TrackTofItemName[i];
2514 //cout<<"strVarName: "<<strVarName[i]<<endl;
2515 }
2516 NTuple::Array<double> m_Variable0;
2517 NTuple::Array<double> m_Variable1;
2518 NTuple::Array<double> m_Variable2;
2519 NTuple::Item<double> m_Variable3;
2520 NTuple::Item<double> m_Variable4;
2521 NTuple::Item<double> m_Variable5;
2522 NTuple::Item<long> m_Variable6;
2523 NTuple::Item<long> m_Variable7;
2524 m_tuple4->item(strVarName[0],m_Variable0);
2525 m_tuple4->item(strVarName[1],m_Variable1);
2526 m_tuple4->item(strVarName[2],m_Variable2);
2527 m_tuple4->item(strVarName[3],m_Variable3);
2528 m_tuple4->item(strVarName[4],m_Variable4);
2529 m_tuple4->item(strVarName[5],m_Variable5);
2530 m_tuple4->item(strVarName[6],m_Variable6);
2531 m_tuple4->item(strVarName[7],m_Variable7);
2532 m_Variable6 = track->trackId();
2533 m_Variable7 = 10;
2534 for (int i=0;i!=7;i++)
2535 {
2536 m_Variable0[i] = 999.9;
2537 m_Variable1[i] = 999.9;
2538 m_Variable2[i] = 999.9;
2539 }
2540 m_Variable3 = 999.9;
2541 m_Variable4 = 999.9;
2542 m_Variable5 = 999.9;
2543 if(!track->isTofTrackValid()) return 0;
2544 SmartRefVector<RecTofTrack> tofTrkCol = track->tofTrack();
2545 SmartRefVector<RecTofTrack>::iterator iter_tof = tofTrkCol.begin();
2546 for(;iter_tof != tofTrkCol.end(); iter_tof++ ) {
2547 TofHitStatus *status = new TofHitStatus;
2548 status->setStatus((*iter_tof)->status());
2549 if(!(status->is_barrel())){//endcap
2550 if( !(status->is_counter()) ) continue; // ?
2551 if( status->layer()!=1 ) continue;//layer1
2552 m_Variable3 = (*iter_tof)->tof() - (*iter_tof)->texp(1);
2553 m_Variable4 = (*iter_tof)->tof() - (*iter_tof)->texp(2);
2554 m_Variable5 = (*iter_tof)->tof() - (*iter_tof)->texp(3);
2555 m_Variable7 = (status->is_east() + 1);
2556 }
2557 else {//barrel
2558 if (status->is_cluster()) numtag = 6;
2559 else if (status->is_counter() && status->layer()!=1) numtag = 5;
2560 else if (status->is_counter() && status->layer()==1) numtag = 4;
2561 else if (status->is_readout() && status->layer()==1 && status->is_east()==1) numtag = 0;
2562 else if (status->is_readout() && status->layer()==1 && status->is_east()!=1) numtag = 1;
2563 else if (status->is_readout() && status->layer()!=1 && status->is_east()==1) numtag = 2;
2564 else if (status->is_readout() && status->layer()!=1 && status->is_east()!=1) numtag = 3;
2565 m_Variable0[numtag] = (*iter_tof)->tof() - (*iter_tof)->texp(1);
2566 m_Variable1[numtag] = (*iter_tof)->tof() - (*iter_tof)->texp(2);
2567 m_Variable2[numtag] = (*iter_tof)->tof() - (*iter_tof)->texp(3);
2568 }
2569 delete status;
2570 }
2571}
2572int DQADtag::fillTrackDedxItem(EvtRecTrack* track, string str, int type)
2573{
2574 string strVarName[7];
2575 for (int i=0;i!=7;i++ )
2576 {
2577 strVarName[i] = str + "_" + m_TrackDedxItemName[i];
2578 //cout<<"strVarName: "<<strVarName[i]<<endl;
2579 }
2580 NTuple::Item<double> m_Variable0;
2581 NTuple::Item<double> m_Variable1;
2582 NTuple::Item<double> m_Variable2;
2583 NTuple::Item<double> m_Variable3;
2584 NTuple::Item<double> m_Variable4;
2585 NTuple::Item<double> m_Variable5;
2586 NTuple::Item<long> m_Variable6;
2587 m_tuple4->item(strVarName[0],m_Variable0);
2588 m_tuple4->item(strVarName[1],m_Variable1);
2589 m_tuple4->item(strVarName[2],m_Variable2);
2590 m_tuple4->item(strVarName[3],m_Variable3);
2591 m_tuple4->item(strVarName[4],m_Variable4);
2592 m_tuple4->item(strVarName[5],m_Variable5);
2593 m_tuple4->item(strVarName[6],m_Variable6);
2594 m_Variable0 = 999.9;
2595 m_Variable1 = 999.9;
2596 m_Variable2 = 1000;
2597 m_Variable3 = 1000;
2598 m_Variable4 = 9999.9;
2599 m_Variable5 = 999.9;
2600 m_Variable6 = 999.9;
2601 if (!track->isMdcDedxValid()) return 0;
2602 RecMdcDedx* dedxTrk = track->mdcDedx();
2603 m_Variable0 = dedxTrk->chiK();
2604 m_Variable1 = dedxTrk->chiPi();
2605 m_Variable2 = dedxTrk->numGoodHits();
2606 m_Variable3 = dedxTrk->numTotalHits();
2607 m_Variable4 = dedxTrk->probPH();
2608 m_Variable5 = dedxTrk->normPH();
2609 m_Variable6 = track->trackId();
2610}
2611
2612// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2613StatusCode DQADtag::finalize() {
2614 cout<<"* * * * * * * Begin DQADTag * * * * * * * *"<<endl;
2615 cout<<"total number: "<<Ncut_DQADTagAlg[0]<<endl;
2616 cout<<"Has DTag: "<<Ncut_DQADTagAlg[1]<<endl;
2617 cout<<"* * * * * * * End DQADTag * * * * * * * *"<<endl;
2618 MsgStream log(msgSvc(), name());
2619 log << MSG::INFO << "in finalize()" << endmsg;
2620 return StatusCode::SUCCESS;
2621}
2622
double sin(const BesAngle a)
Definition BesAngle.h:210
double cos(const BesAngle a)
Definition BesAngle.h:213
double mass
HepGeom::Point3D< double > HepPoint3D
int Ncut_DQADTagAlg[10]
const double mpsipp
const Hep3Vector u_cms
EvtRecTrackCol::iterator EvtRecTrackIterator
std::vector< HepLorentzVector > Vp4
Definition Gam4pikp.cxx:53
const double xmass[5]
Definition Gam4pikp.cxx:50
std::vector< int > Vint
Definition Gam4pikp.cxx:52
void fill(NTuple::Array< double > &nt_p4, const HepLorentzVector &p4)
Definition MyUtil.cxx:3
INTupleSvc * ntupleSvc()
IMessageSvc * msgSvc()
#define NULL
StatusCode initialize()
StatusCode execute()
StatusCode finalize()
double vtxChi2()
Definition DQAKsInfo.h:53
double chi2()
Definition DQAKsInfo.h:57
void setVtxPar(VertexParameter vtxpar)
Definition DQAKsInfo.h:73
bool calculate()
Definition DQAKsInfo.cxx:25
double decayLengthRatio()
Definition DQAKsInfo.h:65
double decayLength()
Definition DQAKsInfo.h:61
double m()
Definition DQAKsInfo.h:45
double mksp4()
Definition DQAKsInfo.h:49
void setPrimaryVtxPar(VertexParameter privtxpar)
Definition DQAKsInfo.h:77
void setchilds(EvtRecTrack *track0, EvtRecTrack *track1)
Definition DQAKsInfo.h:33
void setchilds(EvtRecTrack *shower0, EvtRecTrack *shower1)
Definition DQAPi0Info.h:30
bool calculate()
Definition DQAPi0Info.h:61
double m()
Definition DQAPi0Info.h:42
double latMoment() const
double a42Moment() const
double eSeed() const
double theta() const
int module() const
double e3x3() const
double phi() const
double secondMoment() const
double x() const
double e5x5() const
double z() const
int numHits() const
double a20Moment() const
double energy() const
double y() const
const Hep3Vector emcPosition() const
const int emcVolumeNumber() const
double probPH() const
Definition DstMdcDedx.h:66
double chiE() const
Definition DstMdcDedx.h:59
int numTotalHits() const
Definition DstMdcDedx.h:65
int numGoodHits() const
Definition DstMdcDedx.h:64
double normPH() const
Definition DstMdcDedx.h:67
double chiPi() const
Definition DstMdcDedx.h:61
double chiK() const
Definition DstMdcDedx.h:62
double chiMu() const
Definition DstMdcDedx.h:60
double chiP() const
Definition DstMdcDedx.h:63
const HepVector & helix() const
const double dz(void) const
const double dr(void) const
static void setPidType(PidType pidType)
const HepSymMatrix & err() const
const HepLorentzVector p4() const
const double fi0(void) const
const double theta() const
Definition DstMdcTrack.h:59
const int charge() const
Definition DstMdcTrack.h:53
const HepVector helix() const
......
const double z() const
Definition DstMdcTrack.h:63
const double p() const
Definition DstMdcTrack.h:58
const double y() const
Definition DstMdcTrack.h:62
const double x() const
Definition DstMdcTrack.h:61
@ kD0toKPiPiPiPi0
Definition EvtRecDTag.h:57
bool isMdcDedxValid()
Definition EvtRecTrack.h:45
int trackId() const
Definition EvtRecTrack.h:32
RecMdcDedx * mdcDedx()
Definition EvtRecTrack.h:55
SmartRefVector< RecTofTrack > tofTrack()
Definition EvtRecTrack.h:57
bool isTofTrackValid()
Definition EvtRecTrack.h:46
RecEmcShower * emcShower()
Definition EvtRecTrack.h:58
RecMdcKalTrack * mdcKalTrack()
Definition EvtRecTrack.h:54
virtual EvtRecDTag * getSingleTag(int modeid=-1, int charm=0)=0
virtual bool isCosmicOrLepton()=0
virtual bool isVertexValid()=0
virtual double * SigmaPrimaryVertex()=0
virtual double * PrimaryVertex()=0
static SecondVertexFit * instance()
bool is_barrel() const
unsigned int layer() const
bool is_cluster() const
void setStatus(unsigned int status)
bool is_counter() const
bool is_east() const
bool is_readout() const
static VertexFit * instance()
Definition VertexFit.cxx:15
void setEvx(const HepSymMatrix &eVx)
void setVx(const HepPoint3D &vx)
const double ecms
Definition inclkstar.cxx:42
_EXTERN_ std::string EvtRecEvent
Definition EventModel.h:116
_EXTERN_ std::string EvtRecDTagCol
Definition EventModel.h:122
_EXTERN_ std::string EvtRecTrackCol
Definition EventModel.h:117
Definition Event.h:21
float charge
float ptrk
double double double * p4
Definition qcdloop1.h:77
const float pi
Definition vector3.h:133