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"
8#include "GaudiKernel/INTupleSvc.h"
9#include "GaudiKernel/NTuple.h"
10#include "GaudiKernel/Bootstrap.h"
11#include "GaudiKernel/IHistogramSvc.h"
33#include "CLHEP/Vector/ThreeVector.h"
34#include "CLHEP/Vector/LorentzVector.h"
35#include "CLHEP/Vector/TwoVector.h"
38using CLHEP::Hep3Vector;
39using CLHEP::Hep2Vector;
40using CLHEP::HepLorentzVector;
41#include "CLHEP/Geometry/Point3D.h"
42#ifndef ENABLE_BACKWARDS_COMPATIBILITY
47const double mpi0 = 0.134977;
48const double mks0 = 0.497648;
49const double xmass[5] = {0.000511, 0.105658, 0.139570, 0.493677, 0.938272};
51const double velc = 299.792458;
52typedef std::vector<int>
Vint;
53typedef std::vector<HepLorentzVector>
Vp4;
56const HepLorentzVector
p_cms(0.034067, 0.0, 0.0, 3.097);
60static int counter[10]={0,0,0,0,0,0,0,0,0,0};
64 Algorithm(name, pSvcLocator) {
67 declareProperty(
"Vr0cut", m_vr0cut=5.0);
68 declareProperty(
"Vz0cut", m_vz0cut=20.0);
69 declareProperty(
"Coscut", m_coscut=0.93);
71 declareProperty(
"EnergyThreshold", m_energyThreshold=0.04);
72 declareProperty(
"GammaPhiCut", m_gammaPhiCut=20.0);
73 declareProperty(
"GammaThetaCut", m_gammaThetaCut=20.0);
74 declareProperty(
"Test4C", m_test4C = 1);
75 declareProperty(
"Test5C", m_test5C = 1);
76 declareProperty(
"CheckDedx", m_checkDedx = 1);
77 declareProperty(
"CheckTof", m_checkTof = 1);
79 declareProperty(
"tagKsKpi", m_tagKsKpi =
false);
85 MsgStream log(
msgSvc(), name());
87 log << MSG::INFO <<
"in initialize()" << endmsg;
92 status = service(
"THistSvc", m_thistsvc);
93 if(status.isFailure() ){
94 log << MSG::INFO <<
"Unable to retrieve pointer to THistSvc" << endreq;
100 m_kskpi_vx_pi1 =
new TH1F(
"kskpi_vx_pi1",
"kskpi_vx_pi1", 100,-5.0, 5.0);
101 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vx_pi1", m_kskpi_vx_pi1);
102 m_kskpi_vy_pi1 =
new TH1F(
"kskpi_vy_pi1",
"kskpi_vy_pi1", 100,-5.0, 5.0);
103 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vy_pi1", m_kskpi_vy_pi1);
104 m_kskpi_vz_pi1 =
new TH1F(
"kskpi_vz_pi1",
"kskpi_vz_pi1", 100, -20.0, 20.0);
105 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vz_pi1", m_kskpi_vz_pi1);
106 m_kskpi_vr_pi1 =
new TH1F(
"kskpi_vr_pi1",
"kskpi_vr_pi1", 100,0.0, 5.0 );
107 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vr_pi1", m_kskpi_vr_pi1);
108 m_kskpi_px_pi1 =
new TH1F(
"kskpi_px_pi1",
"kskpi_px_pi1", 100, -1.5, 1.5);
109 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_px_pi1", m_kskpi_px_pi1);
110 m_kskpi_py_pi1 =
new TH1F(
"kskpi_py_pi1",
"kskpi_py_pi1", 100, -1.5, 1.5);
111 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_py_pi1", m_kskpi_py_pi1);
112 m_kskpi_pz_pi1 =
new TH1F(
"kskpi_pz_pi1",
"kskpi_pz_pi1", 100, -1.5, 1.5);
113 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pz_pi1", m_kskpi_pz_pi1);
114 m_kskpi_pp_pi1 =
new TH1F(
"kskpi_pp_pi1",
"kskpi_pp_pi1", 100, 0.0, 1.5);
115 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pp_pi1", m_kskpi_pp_pi1);
116 m_kskpi_cos_pi1 =
new TH1F(
"kskpi_cos_pi1",
"kskpi_cos_pi1", 100, -1.0, 1.0);
117 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_cos_pi1", m_kskpi_cos_pi1);
118 m_kskpi_emc_pi1 =
new TH1F(
"kskpi_emc_pi1",
"kskpi_emc_pi1", 100, 0.0, 1.5);
119 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_emc_pi1", m_kskpi_emc_pi1);
121 m_kskpi_vx_pi2 =
new TH1F(
"kskpi_vx_pi2",
"kskpi_vx_pi2", 100,-5.0, 5.0);
122 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vx_pi2", m_kskpi_vx_pi2);
123 m_kskpi_vy_pi2 =
new TH1F(
"kskpi_vy_pi2",
"kskpi_vy_pi2", 100,-5.0, 5.0);
124 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vy_pi2", m_kskpi_vy_pi2);
125 m_kskpi_vz_pi2 =
new TH1F(
"kskpi_vz_pi2",
"kskpi_vz_pi2", 100, -20.0, 20.0);
126 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vz_pi2", m_kskpi_vz_pi2);
127 m_kskpi_vr_pi2 =
new TH1F(
"kskpi_vr_pi2",
"kskpi_vr_pi2", 100,0.0, 5.0 );
128 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vr_pi2", m_kskpi_vr_pi2);
129 m_kskpi_px_pi2 =
new TH1F(
"kskpi_px_pi2",
"kskpi_px_pi2", 100, -1.5, 1.5);
130 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_px_pi2", m_kskpi_px_pi2);
131 m_kskpi_py_pi2 =
new TH1F(
"kskpi_py_pi2",
"kskpi_py_pi2", 100, -1.5, 1.5);
132 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_py_pi2", m_kskpi_py_pi2);
133 m_kskpi_pz_pi2 =
new TH1F(
"kskpi_pz_pi2",
"kskpi_pz_pi2", 100, -1.5, 1.5);
134 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pz_pi2", m_kskpi_pz_pi2);
135 m_kskpi_pp_pi2 =
new TH1F(
"kskpi_pp_pi2",
"kskpi_pp_pi2", 100, 0.0, 1.5);
136 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pp_pi2", m_kskpi_pp_pi2);
137 m_kskpi_cos_pi2 =
new TH1F(
"kskpi_cos_pi2",
"kskpi_cos_pi2", 100, -1.0, 1.0);
138 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_cos_pi2", m_kskpi_cos_pi2);
139 m_kskpi_emc_pi2 =
new TH1F(
"kskpi_emc_pi2",
"kskpi_emc_pi2", 100, 0.0, 1.5);
140 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_emc_pi2", m_kskpi_emc_pi2);
142 m_kskpi_vx_pi =
new TH1F(
"kskpi_vx_pi",
"kskpi_vx_pi", 100,-1.0, 1.0);
143 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vx_pi", m_kskpi_vx_pi);
144 m_kskpi_vy_pi =
new TH1F(
"kskpi_vy_pi",
"kskpi_vy_pi", 100,-1.0, 1.0);
145 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vy_pi", m_kskpi_vy_pi);
146 m_kskpi_vz_pi =
new TH1F(
"kskpi_vz_pi",
"kskpi_vz_pi", 100, -10.0, 10.0);
147 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vz_pi", m_kskpi_vz_pi);
148 m_kskpi_vr_pi =
new TH1F(
"kskpi_vr_pi",
"kskpi_vr_pi", 100,0.0, 1.0 );
149 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vr_pi", m_kskpi_vr_pi);
150 m_kskpi_px_pi =
new TH1F(
"kskpi_px_pi",
"kskpi_px_pi", 100, -1.5, 1.5);
151 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_px_pi", m_kskpi_px_pi);
152 m_kskpi_py_pi =
new TH1F(
"kskpi_py_pi",
"kskpi_py_pi", 100, -1.5, 1.5);
153 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_py_pi", m_kskpi_py_pi);
154 m_kskpi_pz_pi =
new TH1F(
"kskpi_pz_pi",
"kskpi_pz_pi", 100, -1.5, 1.5);
155 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pz_pi", m_kskpi_pz_pi);
156 m_kskpi_pp_pi =
new TH1F(
"kskpi_pp_pi",
"kskpi_pp_pi", 100, 0.0, 1.5);
157 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pp_pi", m_kskpi_pp_pi);
158 m_kskpi_cos_pi =
new TH1F(
"kskpi_cos_pi",
"kskpi_cos_pi", 100, -1.0, 1.0);
159 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_cos_pi", m_kskpi_cos_pi);
160 m_kskpi_emc_pi =
new TH1F(
"kskpi_emc_pi",
"kskpi_emc_pi", 100, 0.0, 1.5);
161 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_emc_pi", m_kskpi_emc_pi);
163 m_kskpi_vx_k =
new TH1F(
"kskpi_vx_k",
"kskpi_vx_k", 100,-1.0, 1.0);
164 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vx_k", m_kskpi_vx_k);
165 m_kskpi_vy_k =
new TH1F(
"kskpi_vy_k",
"kskpi_vy_k", 100,-1.0, 1.0);
166 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vy_k", m_kskpi_vy_k);
167 m_kskpi_vz_k =
new TH1F(
"kskpi_vz_k",
"kskpi_vz_k", 100, -10.0, 10.0);
168 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vz_k", m_kskpi_vz_k);
169 m_kskpi_vr_k =
new TH1F(
"kskpi_vr_k",
"kskpi_vr_k", 100,0.0, 1.0 );
170 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vr_k", m_kskpi_vr_k);
171 m_kskpi_px_k =
new TH1F(
"kskpi_px_k",
"kskpi_px_k", 100, -1.5, 1.5);
172 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_px_k", m_kskpi_px_k);
173 m_kskpi_py_k =
new TH1F(
"kskpi_py_k",
"kskpi_py_k", 100, -1.5, 1.5);
174 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_py_k", m_kskpi_py_k);
175 m_kskpi_pz_k =
new TH1F(
"kskpi_pz_k",
"kskpi_pz_k", 100, -1.5, 1.5);
176 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pz_k", m_kskpi_pz_k);
177 m_kskpi_pp_k =
new TH1F(
"kskpi_pp_k",
"kskpi_pp_k", 100, 0.0, 1.5);
178 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pp_k", m_kskpi_pp_k);
179 m_kskpi_cos_k =
new TH1F(
"kskpi_cos_k",
"kskpi_cos_k", 100, -1.0, 1.0);
180 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_cos_k", m_kskpi_cos_k);
181 m_kskpi_emc_k =
new TH1F(
"kskpi_emc_k",
"kskpi_emc_k", 100, 0.0, 1.5);
182 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_emc_k", m_kskpi_emc_k);
184 m_kskpi_pidchidedx_1 =
new TH1F(
"kskpi_pidchidedx_1",
"kskpi_pidchidedx_1", 100, -10.0, 10.0);
185 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pidchidedx_1", m_kskpi_pidchidedx_1);
186 m_kskpi_pidchitof1_1 =
new TH1F(
"kskpi_pidchitof1_1",
"kskpi_pidchitof1_1", 100, -10.0, 10.0);
187 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pidchitof1_1", m_kskpi_pidchitof1_1);
188 m_kskpi_pidchitof2_1 =
new TH1F(
"kskpi_pidchitof2_1",
"kskpi_pidchitof2_1", 100, -10.0, 10.0);
189 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pidchitof2_1", m_kskpi_pidchitof2_1);
191 m_kskpi_pidchidedx_2 =
new TH1F(
"kskpi_pidchidedx_2",
"kskpi_pidchidedx_2", 100, -10.0, 10.0);
192 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pidchidedx_2", m_kskpi_pidchidedx_2);
193 m_kskpi_pidchitof1_2 =
new TH1F(
"kskpi_pidchitof1_2",
"kskpi_pidchitof1_2", 100, -10.0, 10.0);
194 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pidchitof1_2", m_kskpi_pidchitof1_2);
195 m_kskpi_pidchitof2_2 =
new TH1F(
"kskpi_pidchitof2_2",
"kskpi_pidchitof2_2", 100, -10.0, 10.0);
196 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pidchitof2_2", m_kskpi_pidchitof2_2);
198 m_kskpi_pidchidedx_3 =
new TH1F(
"kskpi_pidchidedx_3",
"kskpi_pidchidedx_3", 100, -10.0, 10.0);
199 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pidchidedx_3", m_kskpi_pidchidedx_3);
200 m_kskpi_pidchitof1_3 =
new TH1F(
"kskpi_pidchitof1_3",
"kskpi_pidchitof1_3", 100, -10.0, 10.0);
201 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pidchitof1_3", m_kskpi_pidchitof1_3);
202 m_kskpi_pidchitof2_3 =
new TH1F(
"kskpi_pidchitof2_3",
"kskpi_pidchitof2_3", 100, -10.0, 10.0);
203 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pidchitof2_3", m_kskpi_pidchitof2_3);
205 m_kskpi_pidchidedx_4 =
new TH1F(
"kskpi_pidchidedx_4",
"kskpi_pidchidedx_4", 100, -10.0, 10.0);
206 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pidchidedx_4", m_kskpi_pidchidedx_4);
207 m_kskpi_pidchitof1_4 =
new TH1F(
"kskpi_pidchitof1_4",
"kskpi_pidchitof1_4", 100, -10.0, 10.0);
208 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pidchitof1_4", m_kskpi_pidchitof1_4);
209 m_kskpi_pidchitof2_4 =
new TH1F(
"kskpi_pidchitof2_4",
"kskpi_pidchitof2_4", 100, -10.0, 10.0);
210 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_pidchitof2_4", m_kskpi_pidchitof2_4);
212 m_kskpi_vfits_chi =
new TH1F(
"kskpi_vfits_chi",
"kskpi_vfits_chi", 100,0.0, 20.0);
213 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vfits_chi", m_kskpi_vfits_chi);
214 m_kskpi_vfits_vx =
new TH1F(
"kskpi_vfits_vx",
"kskpi_vfits_vx", 100,-20.0, 20.0);
215 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vfits_vx", m_kskpi_vfits_vx);
216 m_kskpi_vfits_vy =
new TH1F(
"kskpi_vfits_vy",
"kskpi_vfits_vy", 100,-20.0, 20.0);
217 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vfits_vy", m_kskpi_vfits_vy);
218 m_kskpi_vfits_vz =
new TH1F(
"kskpi_vfits_vz",
"kskpi_vfits_vz", 100,-20.0, 20.0);
219 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vfits_vz", m_kskpi_vfits_vz);
220 m_kskpi_vfits_vr =
new TH1F(
"kskpi_vfits_vr",
"kskpi_vfits_vr", 100,0.0, 20.0);
221 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vfits_vr", m_kskpi_vfits_vr);
223 m_kskpi_vfitp_chi =
new TH1F(
"kskpi_vfitp_chi",
"kskpi_vfitp_chi", 100,0.0, 50.0);
224 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vfitp_chi", m_kskpi_vfitp_chi);
225 m_kskpi_vfitp_vx =
new TH1F(
"kskpi_vfitp_vx",
"kskpi_vfitp_vx", 100,-1.0, 1.0);
226 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vfitp_vx", m_kskpi_vfitp_vx);
227 m_kskpi_vfitp_vy =
new TH1F(
"kskpi_vfitp_vy",
"kskpi_vfitp_vy", 100,-1.0, 1.0);
228 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vfitp_vy", m_kskpi_vfitp_vy);
229 m_kskpi_vfitp_vz =
new TH1F(
"kskpi_vfitp_vz",
"kskpi_vfitp_vz", 100,-5.0, 5.0);
230 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vfitp_vz", m_kskpi_vfitp_vz);
231 m_kskpi_vfitp_vr =
new TH1F(
"kskpi_vfitp_vr",
"kskpi_vfitp_vr", 100,0.0, 1.0);
232 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vfitp_vr", m_kskpi_vfitp_vr);
234 m_kskpi_vfit2_chi =
new TH1F(
"kskpi_vfit2_chi",
"kskpi_vfit2_chi", 100,0.0, 20.0);
235 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vfit2_chi", m_kskpi_vfit2_chi);
236 m_kskpi_vfit2_mks =
new TH1F(
"kskpi_vfit2_mks",
"kskpi_vfit2_mks", 100,0.4, 0.6);
237 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vfit2_mks", m_kskpi_vfit2_mks);
238 m_kskpi_vfit2_ct =
new TH1F(
"kskpi_vfit2_ct",
"kskpi_vfit2_ct", 100,-3.0, 13.0);
239 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vfit2_ct", m_kskpi_vfit2_ct);
240 m_kskpi_vfit2_dl =
new TH1F(
"kskpi_vfit2_dl",
"kskpi_vfit2_dl", 100,-5.0, 25.0);
241 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vfit2_dl", m_kskpi_vfit2_dl);
242 m_kskpi_vfit2_dle =
new TH1F(
"kskpi_vfit2_dle",
"kskpi_vfit2_dle", 100,0.0, 1.0);
243 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_vfit2_dle", m_kskpi_vfit2_dle);
245 m_kskpi_4c_chi =
new TH1F(
"kskpi_4c_chi",
"kskpi_4c_chi", 100,0.0, 50);
246 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_4c_chi", m_kskpi_4c_chi);
247 m_kskpi_4c_mks =
new TH1F(
"kskpi_4c_mks",
"kskpi_4c_mks", 100,0.4, 0.6);
248 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_4c_mks", m_kskpi_4c_mks);
249 m_kskpi_4c_mksk =
new TH1F(
"kskpi_4c_mksk",
"kskpi_4c_mksk", 100,1.0, 3.0);
250 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_4c_mksk", m_kskpi_4c_mksk);
251 m_kskpi_4c_mkspi =
new TH1F(
"kskpi_4c_mkspi",
"kskpi_4c_mkspi", 100,0.6, 2.6);
252 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_4c_mkspi", m_kskpi_4c_mkspi);
253 m_kskpi_4c_mkpi =
new TH1F(
"kskpi_4c_mkpi",
"kskpi_4c_mkpi", 100,1.0, 3.0);
254 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_4c_mkpi", m_kskpi_4c_mkpi);
255 m_kskpi_4c_ks_px =
new TH1F(
"kskpi_4c_ks_px",
"kskpi_4c_ks_px", 100,-1.5, 1.5);
256 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_4c_ks_px", m_kskpi_4c_ks_px);
257 m_kskpi_4c_ks_py =
new TH1F(
"kskpi_4c_ks_py",
"kskpi_4c_ks_py", 100,-1.5, 1.5);
258 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_4c_ks_py", m_kskpi_4c_ks_py);
259 m_kskpi_4c_ks_pz =
new TH1F(
"kskpi_4c_ks_pz",
"kskpi_4c_ks_pz", 100,-1.5, 1.5);
260 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_4c_ks_pz", m_kskpi_4c_ks_pz);
261 m_kskpi_4c_ks_p =
new TH1F(
"kskpi_4c_ks_p",
"kskpi_4c_ks_p", 100,0.0, 1.5);
262 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_4c_ks_p", m_kskpi_4c_ks_p);
263 m_kskpi_4c_ks_cos =
new TH1F(
"kskpi_4c_ks_cos",
"kskpi_4c_ks_cos", 100,-1.0, 1.0);
264 status = m_thistsvc->regHist(
"/VAL/PHY/kskpi_4c_ks_cos", m_kskpi_4c_ks_cos);
268 NTuplePtr nt1(
ntupleSvc(),
"FILE1/signal");
269 if ( nt1 ) m_tuple1 = nt1;
271 m_tuple1 =
ntupleSvc()->book (
"FILE1/signal", CLID_ColumnWiseTuple,
"N-Tuple");
273 status = m_tuple1->addItem (
"irun", m_run);
274 status = m_tuple1->addItem (
"ievent", m_event);
275 status = m_tuple1->addItem (
"Nchrg", m_nchrg);
276 status = m_tuple1->addItem (
"Nneu", m_nneu);
277 status = m_tuple1->addItem (
"NGch", m_ngch, 0, 10);
279 status = m_tuple1->addIndexedItem (
"pidcode" , m_ngch, m_pidcode);
280 status = m_tuple1->addIndexedItem (
"pidprob" , m_ngch, m_pidprob);
281 status = m_tuple1->addIndexedItem (
"pidchiDedx" , m_ngch, m_pidchiDedx);
282 status = m_tuple1->addIndexedItem (
"pidchiTof1" , m_ngch, m_pidchiTof1);
283 status = m_tuple1->addIndexedItem (
"pidchiTof2" , m_ngch, m_pidchiTof2);
285 status = m_tuple1->addItem (
"npip", m_npip );
286 status = m_tuple1->addItem (
"npim", m_npim );
287 status = m_tuple1->addItem (
"nkp", m_nkp );
288 status = m_tuple1->addItem (
"nkm", m_nkm );
289 status = m_tuple1->addItem (
"np", m_np );
290 status = m_tuple1->addItem (
"npb", m_npb );
292 status = m_tuple1->addItem (
"vfits_chi" , m_vfits_chi );
293 status = m_tuple1->addItem (
"vfits_vx" , m_vfits_vx );
294 status = m_tuple1->addItem (
"vfits_vy" , m_vfits_vy );
295 status = m_tuple1->addItem (
"vfits_vz" , m_vfits_vz );
296 status = m_tuple1->addItem (
"vfits_vr" , m_vfits_vr );
298 status = m_tuple1->addItem (
"vfitp_chi" , m_vfitp_chi );
299 status = m_tuple1->addItem (
"vfitp_vx" , m_vfitp_vx );
300 status = m_tuple1->addItem (
"vfitp_vy" , m_vfitp_vy );
301 status = m_tuple1->addItem (
"vfitp_vz" , m_vfitp_vz );
302 status = m_tuple1->addItem (
"vfitp_vr" , m_vfitp_vr );
304 status = m_tuple1->addItem (
"vfit2_chi" , m_vfit2_chi );
305 status = m_tuple1->addItem (
"vfit2_mks" , m_vfit2_mks );
306 status = m_tuple1->addItem (
"vfit2_ct" , m_vfit2_ct );
307 status = m_tuple1->addItem (
"vfit2_dl" , m_vfit2_dl );
308 status = m_tuple1->addItem (
"vfit2_dle" , m_vfit2_dle );
310 status = m_tuple1->addIndexedItem(
"charge", m_ngch, m_charge);
311 status = m_tuple1->addIndexedItem (
"vx0", m_ngch, m_vx0);
312 status = m_tuple1->addIndexedItem (
"vy0", m_ngch, m_vy0);
313 status = m_tuple1->addIndexedItem (
"vz0", m_ngch, m_vz0);
314 status = m_tuple1->addIndexedItem (
"vr0", m_ngch, m_vr0);
316 status = m_tuple1->addIndexedItem (
"vx", m_ngch, m_vx);
317 status = m_tuple1->addIndexedItem (
"vy", m_ngch, m_vy);
318 status = m_tuple1->addIndexedItem (
"vz", m_ngch, m_vz);
319 status = m_tuple1->addIndexedItem (
"vr", m_ngch, m_vr);
321 status = m_tuple1->addIndexedItem (
"px", m_ngch, m_px) ;
322 status = m_tuple1->addIndexedItem (
"py", m_ngch, m_py) ;
323 status = m_tuple1->addIndexedItem (
"pz", m_ngch, m_pz) ;
324 status = m_tuple1->addIndexedItem (
"p", m_ngch, m_p) ;
325 status = m_tuple1->addIndexedItem (
"cost", m_ngch, m_cost);
327 status = m_tuple1->addIndexedItem (
"probPH" , m_ngch, m_probPH) ;
328 status = m_tuple1->addIndexedItem (
"normPH" , m_ngch, m_normPH) ;
329 status = m_tuple1->addIndexedItem (
"chie" , m_ngch, m_chie) ;
330 status = m_tuple1->addIndexedItem (
"chimu" , m_ngch, m_chimu) ;
331 status = m_tuple1->addIndexedItem (
"chipi" , m_ngch, m_chipi) ;
332 status = m_tuple1->addIndexedItem (
"chik" , m_ngch, m_chik) ;
333 status = m_tuple1->addIndexedItem (
"chip" , m_ngch, m_chip) ;
334 status = m_tuple1->addIndexedItem (
"ghit" , m_ngch, m_ghit) ;
335 status = m_tuple1->addIndexedItem (
"thit" , m_ngch, m_thit) ;
337 status = m_tuple1->addIndexedItem (
"e_emc" , m_ngch, m_e_emc) ;
339 status = m_tuple1->addIndexedItem (
"qual_etof" , m_ngch, m_qual_etof );
340 status = m_tuple1->addIndexedItem (
"tof_etof" , m_ngch, m_tof_etof );
341 status = m_tuple1->addIndexedItem (
"te_etof" , m_ngch, m_te_etof );
342 status = m_tuple1->addIndexedItem (
"tmu_etof" , m_ngch, m_tmu_etof );
343 status = m_tuple1->addIndexedItem (
"tpi_etof" , m_ngch, m_tpi_etof );
344 status = m_tuple1->addIndexedItem (
"tk_etof" , m_ngch, m_tk_etof );
345 status = m_tuple1->addIndexedItem (
"tp_etof" , m_ngch, m_tp_etof );
347 status = m_tuple1->addIndexedItem (
"qual_btof1", m_ngch, m_qual_btof1 );
348 status = m_tuple1->addIndexedItem (
"tof_btof1" , m_ngch, m_tof_btof1 );
349 status = m_tuple1->addIndexedItem (
"te_btof1" , m_ngch, m_te_btof1 );
350 status = m_tuple1->addIndexedItem (
"tmu_btof1" , m_ngch, m_tmu_btof1 );
351 status = m_tuple1->addIndexedItem (
"tpi_btof1" , m_ngch, m_tpi_btof1 );
352 status = m_tuple1->addIndexedItem (
"tk_btof1" , m_ngch, m_tk_btof1 );
353 status = m_tuple1->addIndexedItem (
"tp_btof1" , m_ngch, m_tp_btof1 );
355 status = m_tuple1->addIndexedItem (
"qual_btof2", m_ngch, m_qual_btof2 );
356 status = m_tuple1->addIndexedItem (
"tof_btof2" , m_ngch, m_tof_btof2 );
357 status = m_tuple1->addIndexedItem (
"te_btof2" , m_ngch, m_te_btof2 );
358 status = m_tuple1->addIndexedItem (
"tmu_btof2" , m_ngch, m_tmu_btof2 );
359 status = m_tuple1->addIndexedItem (
"tpi_btof2" , m_ngch, m_tpi_btof2 );
360 status = m_tuple1->addIndexedItem (
"tk_btof2" , m_ngch, m_tk_btof2 );
361 status = m_tuple1->addIndexedItem (
"tp_btof2" , m_ngch, m_tp_btof2 );
364 status = m_tuple1->addItem (
"chi2_fs4c", m_chi2_fs4c);
365 status = m_tuple1->addItem (
"mks_fs4c", m_mks_fs4c);
366 status = m_tuple1->addItem (
"mkspi_fs4c",m_mkspi_fs4c);
367 status = m_tuple1->addItem (
"mksk_fs4c", m_mksk_fs4c);
368 status = m_tuple1->addItem (
"mkpi_fs4c", m_mkpi_fs4c);
370 status = m_tuple1->addItem (
"4c_chi2", m_4c_chi2);
371 status = m_tuple1->addItem (
"4c_mks", m_4c_mks);
372 status = m_tuple1->addItem (
"4c_mkspi", m_4c_mkspi);
373 status = m_tuple1->addItem (
"4c_mksk", m_4c_mksk);
374 status = m_tuple1->addItem (
"4c_mkpi", m_4c_mkpi);
375 status = m_tuple1->addItem (
"4c_ks_px", m_4c_ks_px);
376 status = m_tuple1->addItem (
"4c_ks_py", m_4c_ks_py);
377 status = m_tuple1->addItem (
"4c_ks_pz", m_4c_ks_pz);
378 status = m_tuple1->addItem (
"4c_ks_p", m_4c_ks_p);
379 status = m_tuple1->addItem (
"4c_ks_cos", m_4c_ks_cos);
384 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple1) << endmsg;
385 return StatusCode::FAILURE;
393 log << MSG::INFO <<
"successfully return from initialize()" <<endmsg;
394 return StatusCode::SUCCESS;
402 MsgStream log(
msgSvc(), name());
403 log << MSG::INFO <<
"in execute()" << endreq;
405 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
409 m_run = eventHeader->runNumber();
410 m_event = eventHeader->eventNumber();
411 m_nchrg = evtRecEvent->totalCharged();
412 m_nneu = evtRecEvent->totalNeutral();
414 log << MSG::INFO <<
"get event tag OK" << endreq;
429 Hep3Vector xorigin(0,0,0);
433 Gaudi::svcLocator()->service(
"VertexDbSvc", vtxsvc);
439 xorigin.setX(dbv[0]);
440 xorigin.setY(dbv[1]);
441 xorigin.setZ(dbv[2]);
444 for (
int i = 0; i < evtRecEvent->totalCharged(); i++){
446 if(!(*itTrk)->isMdcTrackValid())
continue;
447 if(!(*itTrk)->isMdcKalTrackValid())
continue;
449 double x0=mdcTrk->
x();
450 double y0=mdcTrk->
y();
451 double z0=mdcTrk->
z();
452 double phi0=mdcTrk->
helix(1);
453 double xv=xorigin.x();
454 double yv=xorigin.y();
455 double zv=xorigin.z();
456 double rv=(x0-xv)*
cos(phi0)+(y0-yv)*
sin(phi0);
458 if(fabs(z0-zv) >= m_vz0cut)
continue;
459 if(fabs(rv) >= m_vr0cut)
continue;
460 if(fabs(cost) >= m_coscut )
continue;
462 iGood.push_back((*itTrk)->trackId());
463 nCharge += mdcTrk->
charge();
469 m_ngch = iGood.size();
470 if((m_ngch != 4) || (nCharge != 0) ) {
return StatusCode::SUCCESS; }
478 Vint ipip, ipim, ikp, ikm, ipp, ipm;
486 Vp4 p_pip, p_pim, p_kp, p_km, p_pp, p_pm ;
495 for(
int i = 0; i < m_ngch; i++) {
513 if((*itTrk)->isMdcKalTrackValid()) mdcKalTrk = (*itTrk)->mdcKalTrack();
519 HepLorentzVector
ptrk;
520 ptrk.setPx(mdcTrk->
px()) ;
521 ptrk.setPy(mdcTrk->
py()) ;
522 ptrk.setPz(mdcTrk->
pz()) ;
525 if (prob_pi > prob_K && prob_pi > prob_p) {
527 m_pidprob[i]=pid->
prob(2);
528 m_pidchiDedx[i]=pid->
chiDedx(2);
529 m_pidchiTof1[i]=pid->
chiTof1(2);
530 m_pidchiTof2[i]=pid->
chiTof2(2);
532 if(mdcTrk->
charge() > 0) {
533 ipip.push_back(iGood[i]);
534 p_pip.push_back(
ptrk);
536 if (mdcTrk->
charge() < 0) {
537 ipim.push_back(iGood[i]);
538 p_pim.push_back(
ptrk);
542 if (prob_K > prob_pi && prob_K > prob_p) {
544 m_pidprob[i]=pid->
prob(3);
545 m_pidchiDedx[i]=pid->
chiDedx(3);
546 m_pidchiTof1[i]=pid->
chiTof1(3);
547 m_pidchiTof2[i]=pid->
chiTof2(3);
549 if(mdcTrk->
charge() > 0) {
550 ikp.push_back(iGood[i]);
551 p_kp.push_back(
ptrk);
553 if (mdcTrk->
charge() < 0) {
554 ikm.push_back(iGood[i]);
555 p_km.push_back(
ptrk);
559 if (prob_p > prob_pi && prob_p > prob_K) {
561 m_pidprob[i]=pid->
prob(4);
562 m_pidchiDedx[i]=pid->
chiDedx(4);
563 m_pidchiTof1[i]=pid->
chiTof1(4);
564 m_pidchiTof2[i]=pid->
chiTof2(4);
566 if(mdcTrk->
charge() > 0) {
567 ipp.push_back(iGood[i]);
568 p_pp.push_back(
ptrk);
570 if (mdcTrk->
charge() < 0) {
571 ipm.push_back(iGood[i]);
572 p_pm.push_back(
ptrk);
576 m_npip= ipip.size() ;
577 m_npim= ipim.size() ;
583 if ( m_npip*m_npim != 2 ) {
return StatusCode::SUCCESS; }
584 if ( m_nkp+m_nkm != 1 ) {
return StatusCode::SUCCESS; }
593 HepSymMatrix Evx(3, 0);
622 double chi_temp = 999.0;
623 double mks_temp = 10.0 ;
625 for(
unsigned int i1 = 0; i1 < m_npip; i1++) {
626 RecMdcKalTrack *pi1KalTrk = (*(evtRecTrkCol->begin()+ipip[i1]))-> mdcKalTrack();
630 for(
unsigned int i2 = 0; i2 < m_npim; i2++) {
631 RecMdcKalTrack *pi2KalTrk = (*(evtRecTrkCol->begin()+ipim[i2]))-> mdcKalTrack();
640 if(!(vtxfit_s->
Fit(0)))
continue;
642 m_vfits_chi = vtxfit_s->
chisq(0);
646 m_vfits_vx = (vparks.
Vx())[0];
647 m_vfits_vy = (vparks.
Vx())[1];
648 m_vfits_vz = (vparks.
Vx())[2];
649 m_vfits_vr = sqrt(m_vfits_vx*m_vfits_vx + m_vfits_vy*m_vfits_vy) ;
653 int jj = ( i1 == 1 ) ? 0 : 1;
654 pi3KalTrk = (*(evtRecTrkCol->begin()+ipip[jj]))->mdcKalTrack();
655 k1KalTrk = (*(evtRecTrkCol->begin()+ikm[0]))->mdcKalTrack();
659 int jj = ( i2 == 1 ) ? 0 : 1;
660 pi3KalTrk = (*(evtRecTrkCol->begin()+ipim[jj]))->mdcKalTrack();
661 k1KalTrk = (*(evtRecTrkCol->begin()+ikp[0]))->mdcKalTrack();
674 if(!(vtxfit_p->
Fit(0)))
continue;
676 m_vfitp_chi = vtxfit_p->
chisq(0) ;
679 m_vfitp_vx = (primaryVpar.
Vx())[0];
680 m_vfitp_vy = (primaryVpar.
Vx())[1];
681 m_vfitp_vz = (primaryVpar.
Vx())[2];
682 m_vfitp_vr = sqrt(m_vfitp_vx*m_vfitp_vx + m_vfitp_vy*m_vfitp_vy);
688 if(!vtxfit2->
Fit())
continue;
690 if ( fabs(((vtxfit2->
wpar()).p()).m()-
mks0) < mks_temp ) {
691 mks_temp = fabs(((vtxfit2->
wpar()).p()).m()-
mks0) ;
695 wks = vtxfit2->
wpar();
696 m_vfit2_mks = (wks.
p()).m();
697 m_vfit2_chi = vtxfit2->
chisq();
698 m_vfit2_ct = vtxfit2->
ctau();
702 pipKalTrk = pi1KalTrk ;
703 pimKalTrk = pi2KalTrk ;
704 piKalTrk = pi3KalTrk ;
711 if (! okloop ) {
return StatusCode::SUCCESS; }
730 for(
int i = 0; i < m_ngch; i++ ){
733 if(!(*itTrk)->isMdcTrackValid())
continue;
737 if ( mdcKalTrk == pipKalTrk ) {
741 if ( mdcKalTrk == pimKalTrk ) {
745 if ( mdcKalTrk == piKalTrk ) {
749 if ( mdcKalTrk == kKalTrk ) {
754 m_charge[ii] = mdcTrk->
charge();
755 double x0=mdcTrk->
x();
756 double y0=mdcTrk->
y();
757 double z0=mdcTrk->
z();
758 double phi0=mdcTrk->
helix(1);
759 double xv=xorigin.x();
760 double yv=xorigin.y();
761 double zv=xorigin.z();
762 double rv=(x0-xv)*
cos(phi0)+(y0-yv)*
sin(phi0);
772 rv=(x0-xv)*
cos(phi0)+(y0-yv)*
sin(phi0);
779 m_px[ii] = mdcKalTrk->
px();
780 m_py[ii] = mdcKalTrk->
py();
781 m_pz[ii] = mdcKalTrk->
pz();
782 m_p[ii] = mdcKalTrk->
p();
783 m_cost[ii] = mdcKalTrk->
pz()/mdcKalTrk->
p();
785 double ptrk = mdcKalTrk->
p() ;
786 if((*itTrk)->isMdcDedxValid()) {
788 m_probPH[ii]= dedxTrk->
probPH();
789 m_normPH[ii]= dedxTrk->
normPH();
791 m_chie[ii] = dedxTrk->
chiE();
792 m_chimu[ii] = dedxTrk->
chiMu();
793 m_chipi[ii] = dedxTrk->
chiPi();
794 m_chik[ii] = dedxTrk->
chiK();
795 m_chip[ii] = dedxTrk->
chiP();
800 if((*itTrk)->isEmcShowerValid()) {
802 m_e_emc[ii] = emcTrk->
energy();
805 if((*itTrk)->isTofTrackValid()) {
806 SmartRefVector<RecTofTrack> tofTrkCol = (*itTrk)->tofTrack();
808 SmartRefVector<RecTofTrack>::iterator iter_tof = tofTrkCol.begin();
810 for(;iter_tof != tofTrkCol.end(); iter_tof++ ) {
812 status->
setStatus((*iter_tof)->status());
816 if( status->
layer()!=0 )
continue;
817 double path=(*iter_tof)->path();
818 double tof = (*iter_tof)->tof();
819 double ph = (*iter_tof)->ph();
820 double rhit = (*iter_tof)->zrhit();
821 double qual = 0.0 + (*iter_tof)->quality();
822 double cntr = 0.0 + (*iter_tof)->tofID();
824 for(
int j = 0; j < 5; j++) {
826 double beta = gb/sqrt(1+gb*gb);
827 texp[j] = path /beta/
velc;
830 m_qual_etof[ii] = qual;
831 m_tof_etof[ii] = tof ;
835 if(status->
layer()==1){
836 double path=(*iter_tof)->path();
837 double tof = (*iter_tof)->tof();
838 double ph = (*iter_tof)->ph();
839 double rhit = (*iter_tof)->zrhit();
840 double qual = 0.0 + (*iter_tof)->quality();
841 double cntr = 0.0 + (*iter_tof)->tofID();
843 for(
int j = 0; j < 5; j++) {
845 double beta = gb/sqrt(1+gb*gb);
846 texp[j] = path /beta/
velc;
849 m_qual_btof1[ii] = qual;
850 m_tof_btof1[ii] = tof ;
853 if(status->
layer()==2){
854 double path=(*iter_tof)->path();
855 double tof = (*iter_tof)->tof();
856 double ph = (*iter_tof)->ph();
857 double rhit = (*iter_tof)->zrhit();
858 double qual = 0.0 + (*iter_tof)->quality();
859 double cntr = 0.0 + (*iter_tof)->tofID();
861 for(
int j = 0; j < 5; j++) {
863 double beta = gb/sqrt(1+gb*gb);
864 texp[j] = path /beta/
velc;
867 m_qual_btof2[ii] = qual;
868 m_tof_btof2[ii] = tof ;
886 double chisq = 9999.;
903 bool oksq = kmfit->
Fit();
905 chisq = kmfit->
chisq();
907 HepLorentzVector pks = kmfit->
pfit(2);
908 HepLorentzVector pkspi = kmfit->
pfit(0) + kmfit->
pfit(2);
909 HepLorentzVector pksk = kmfit->
pfit(1) + kmfit->
pfit(2);
910 HepLorentzVector pkpi = kmfit->
pfit(0) + kmfit->
pfit(1);
919 m_4c_mkspi = pkspi.m();
920 m_4c_mksk = pksk.m();
921 m_4c_mkpi = pkpi.m();
923 m_4c_ks_px = pks.px() ;
924 m_4c_ks_py = pks.py() ;
925 m_4c_ks_pz = pks.pz() ;
926 m_4c_ks_p = (pks.vect()).mag() ;
927 m_4c_ks_cos = m_4c_ks_pz/m_4c_ks_p ;
946 chisq = kmfit->
chisq();
948 HepLorentzVector pks = kmfit->
pfit(0) + kmfit->
pfit(1);
949 HepLorentzVector pkspi = pks + kmfit->
pfit(2);
950 HepLorentzVector pksk = pks + kmfit->
pfit(3);
951 HepLorentzVector pkpi = kmfit->
pfit(2) + kmfit->
pfit(3);
958 m_chi2_fs4c = chisq ;
959 m_mks_fs4c = pks.m();
960 m_mkspi_fs4c = pkspi.m();
961 m_mksk_fs4c = pksk.m();
962 m_mkpi_fs4c = pkpi.m();
970 m_kskpi_vx_pi1->Fill(m_vx[0]) ;
971 m_kskpi_vy_pi1->Fill(m_vy[0]) ;
972 m_kskpi_vz_pi1->Fill(m_vz[0]) ;
973 m_kskpi_vr_pi1->Fill(m_vr[0]) ;
974 m_kskpi_px_pi1->Fill(m_px[0]) ;
975 m_kskpi_py_pi1->Fill(m_py[0]) ;
976 m_kskpi_pz_pi1->Fill(m_pz[0]) ;
977 m_kskpi_pp_pi1->Fill(m_p[0]) ;
978 m_kskpi_cos_pi1->Fill(m_cost[0]) ;
979 m_kskpi_emc_pi1->Fill(m_e_emc[0]) ;
981 m_kskpi_vx_pi2->Fill(m_vx[1]) ;
982 m_kskpi_vy_pi2->Fill(m_vy[1]) ;
983 m_kskpi_vz_pi2->Fill(m_vz[1]) ;
984 m_kskpi_vr_pi2->Fill(m_vr[1]) ;
985 m_kskpi_px_pi2->Fill(m_px[1]) ;
986 m_kskpi_py_pi2->Fill(m_py[1]) ;
987 m_kskpi_pz_pi2->Fill(m_pz[1]) ;
988 m_kskpi_pp_pi2->Fill(m_p[1]) ;
989 m_kskpi_cos_pi2->Fill(m_cost[1]) ;
990 m_kskpi_emc_pi2->Fill(m_e_emc[1]) ;
992 m_kskpi_vx_pi->Fill(m_vx[2]) ;
993 m_kskpi_vy_pi->Fill(m_vy[2]) ;
994 m_kskpi_vz_pi->Fill(m_vz[2]) ;
995 m_kskpi_vr_pi->Fill(m_vr[2]) ;
996 m_kskpi_px_pi->Fill(m_px[2]) ;
997 m_kskpi_py_pi->Fill(m_py[2]) ;
998 m_kskpi_pz_pi->Fill(m_pz[2]) ;
999 m_kskpi_pp_pi->Fill(m_p[2]) ;
1000 m_kskpi_cos_pi->Fill(m_cost[2]) ;
1001 m_kskpi_emc_pi->Fill(m_e_emc[2]) ;
1003 m_kskpi_vx_k->Fill(m_vx[3]) ;
1004 m_kskpi_vy_k->Fill(m_vy[3]) ;
1005 m_kskpi_vz_k->Fill(m_vz[3]) ;
1006 m_kskpi_vr_k->Fill(m_vr[3]) ;
1007 m_kskpi_px_k->Fill(m_px[3]) ;
1008 m_kskpi_py_k->Fill(m_py[3]) ;
1009 m_kskpi_pz_k->Fill(m_pz[3]) ;
1010 m_kskpi_pp_k->Fill(m_p[3]) ;
1011 m_kskpi_cos_k->Fill(m_cost[3]) ;
1012 m_kskpi_emc_k->Fill(m_e_emc[3]) ;
1015 m_kskpi_pidchidedx_1->Fill(m_pidchiDedx[0]);
1016 m_kskpi_pidchitof1_1->Fill(m_pidchiTof1[0]);
1017 m_kskpi_pidchitof2_1->Fill(m_pidchiTof2[0]);
1018 m_kskpi_pidchidedx_2->Fill(m_pidchiDedx[1]);
1019 m_kskpi_pidchitof1_2->Fill(m_pidchiTof1[1]);
1020 m_kskpi_pidchitof2_2->Fill(m_pidchiTof2[1]);
1021 m_kskpi_pidchidedx_3->Fill(m_pidchiDedx[2]);
1022 m_kskpi_pidchitof1_3->Fill(m_pidchiTof1[2]);
1023 m_kskpi_pidchitof2_3->Fill(m_pidchiTof2[2]);
1024 m_kskpi_pidchidedx_4->Fill(m_pidchiDedx[3]);
1025 m_kskpi_pidchitof1_4->Fill(m_pidchiTof1[3]);
1026 m_kskpi_pidchitof2_4->Fill(m_pidchiTof2[3]);
1029 m_kskpi_vfits_chi->Fill(m_vfits_chi) ;
1030 m_kskpi_vfits_vx->Fill(m_vfits_vx) ;
1031 m_kskpi_vfits_vy->Fill(m_vfits_vy) ;
1032 m_kskpi_vfits_vz->Fill(m_vfits_vz) ;
1033 m_kskpi_vfits_vr->Fill(m_vfits_vr) ;
1035 m_kskpi_vfitp_chi->Fill(m_vfitp_chi) ;
1036 m_kskpi_vfitp_vx->Fill(m_vfitp_vx) ;
1037 m_kskpi_vfitp_vy->Fill(m_vfitp_vy) ;
1038 m_kskpi_vfitp_vz->Fill(m_vfitp_vz) ;
1039 m_kskpi_vfitp_vr->Fill(m_vfitp_vr) ;
1041 m_kskpi_vfit2_chi->Fill(m_vfit2_chi) ;
1042 m_kskpi_vfit2_mks->Fill(m_vfit2_mks) ;
1043 m_kskpi_vfit2_ct->Fill(m_vfit2_ct) ;
1044 m_kskpi_vfit2_dl->Fill(m_vfit2_dl) ;
1045 m_kskpi_vfit2_dle->Fill(m_vfit2_dle) ;
1047 m_kskpi_4c_ks_px->Fill(m_4c_ks_px) ;
1048 m_kskpi_4c_ks_py->Fill(m_4c_ks_py) ;
1049 m_kskpi_4c_ks_pz->Fill(m_4c_ks_pz) ;
1050 m_kskpi_4c_ks_p->Fill(m_4c_ks_p) ;
1051 m_kskpi_4c_ks_cos->Fill(m_4c_ks_cos);
1053 m_kskpi_4c_chi->Fill(m_4c_chi2);
1054 m_kskpi_4c_mks->Fill(m_4c_mks);
1055 m_kskpi_4c_mksk->Fill(m_4c_mksk);
1056 m_kskpi_4c_mkspi->Fill(m_4c_mkspi);
1057 m_kskpi_4c_mkpi->Fill(m_4c_mkpi);
1061 m_tuple1 -> write();
1063 return StatusCode::SUCCESS;
1071 MsgStream log(
msgSvc(), name());
1072 log << MSG::INFO <<
"in finalize()" << endmsg;
1074 std::cout <<
"************ for Signal *******************" << std::endl;
1075 std::cout <<
"*******************************************" << std::endl;
1076 std::cout <<
"the total events is " << counter[0] << std::endl;
1077 std::cout <<
"Good charged tracks " << counter[1] << std::endl;
1078 std::cout <<
"particle ID " << counter[2] << std::endl;
1079 std::cout <<
"resort tracks considering Ks " << counter[3] << std::endl;
1080 std::cout <<
"info. for good charged track " << counter[4] << std::endl;
1081 std::cout <<
"kinematic fit 4C " << counter[5] << std::endl;
1082 std::cout <<
"kinematic fit 5C " << counter[6] << std::endl;
1083 std::cout <<
"*******************************************" << std::endl;
1085 return StatusCode::SUCCESS;
double sin(const BesAngle a)
double cos(const BesAngle a)
const HepLorentzVector p_cms(0.034067, 0.0, 0.0, 3.097)
EvtRecTrackCol::iterator EvtRecTrackIterator
std::vector< HepLorentzVector > Vp4
HepGeom::Point3D< double > HepPoint3D
std::vector< HepLorentzVector > Vp4
const HepLorentzVector p_cms(0.034067, 0.0, 0.0, 3.097)
static void setPidType(PidType pidType)
const double theta() const
const HepVector helix() const
......
virtual bool isVertexValid()=0
virtual double * SigmaPrimaryVertex()=0
virtual double * PrimaryVertex()=0
static KinematicFit * instance()
void AddFourMomentum(int number, HepLorentzVector p4)
HepLorentzVector pfit(int n) const
int methodProbability() const
int onlyPionKaonProton() const
void setChiMinCut(const double chi=4)
void setRecTrack(EvtRecTrack *trk)
void setMethod(const int method)
double chiTof2(int n) const
void identify(const int pidcase)
void usePidSys(const int pidsys)
static ParticleID * instance()
bool IsPidInfoValid() const
double chiTof1(int n) const
double probProton() const
double chiDedx(int n) const
const HepVector & getZHelix() const
const HepSymMatrix & getZError() const
HepSymMatrix & getZErrorK()
void setPrimaryVertex(const VertexParameter vpar)
double decayLength() const
double decayLengthError() const
static SecondVertexFit * instance()
void setVpar(const VertexParameter vpar)
WTrackParameter wpar() const
unsigned int layer() const
void setStatus(unsigned int status)
void AddTrack(const int number, const double mass, const RecMdcTrack *trk)
WTrackParameter wVirtualTrack(int n) const
void AddVertex(int number, VertexParameter vpar, std::vector< int > lis)
static VertexFit * instance()
VertexParameter vpar(int n) const
void BuildVirtualParticle(int number)
void setEvx(const HepSymMatrix &eVx)
void setVx(const HepPoint3D &vx)
HepLorentzVector p() const
_EXTERN_ std::string EvtRecEvent
_EXTERN_ std::string EvtRecTrackCol