CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
KalFitAlg.h
Go to the documentation of this file.
1//------------------------------------------------------------------------
2// Description :
3// Main file of the module KalFit in charge of :
4// 1/ Refit of the Mdc tracks using Kalman filter
5// 2/ Backward filter (smoothing)
6// 3/ and also several mass hypothesis, Non unif mag field treatment...
7//
8//------------------------------------------------------------------------
9
10#ifndef _DEFINE_KALFITALG_H_
11#define _DEFINE_KALFITALG_H_
12#ifndef DBL_MAX
13#define DBL_MAX 9999
14#endif
15
16class KalFitTrack;
17class KalFitHitMdc;
18class KalFitHelixSeg;
19class Bfield;
20//class Helix;
21
22#include "GaudiKernel/Algorithm.h"
25#include "GaudiKernel/IMagneticFieldSvc.h"
34#include "MdcTables/MdcTables.h"
35#include "GaudiKernel/NTuple.h"
36#include "AIDA/IHistogram1D.h"
37#include "AIDA/IHistogramFactory.h"
38#include "GaudiKernel/IHistogramSvc.h"
41#include "HepPDT/ParticleDataTable.hh"
42#include <vector>
43//added header files for 6.0.0
44#include "CLHEP/Matrix/Vector.h"
45#include "CLHEP/Matrix/Matrix.h"
46#include "CLHEP/Matrix/SymMatrix.h"
47#include "CLHEP/Vector/ThreeVector.h"
48#include "G4Material.hh"
49#include "G4Tubs.hh"
52
53#ifndef ENABLE_BACKWARDS_COMPATIBILITY
54typedef HepGeom::Point3D <double > HepPoint3D;
55#endif
56
57using namespace std;
58using namespace CLHEP;
59
60
61class KalFitAlg : public Algorithm {
62
63 public:
64 /**@name Main member functions*/
65 //@{
66 /// constructor
67 KalFitAlg(const std::string& name, ISvcLocator* pSvcLocator);
68 /// destructor
69 ~KalFitAlg(void);
70 /// initialize
71 StatusCode initialize();
72 /// event function
73 StatusCode execute();
74 StatusCode finalize();
75 StatusCode beginRun();
76 /// hist definition
77 void hist_def ( void );
78 /// delete C++ objects, necessary to clean before begin_run or inside
79 /// destructor
80 void clean(void);
81 //@}
82 /**@name Set up the description of the Mdc */
83 //@{
84 /// Set up the wires, layers and superlayers...
85 void set_Mdc(void);
86 /// Initialize the material for Mdc
87 void setMaterial_Mdc(void);
88 /// Initialize the cylinders (walls and cathodes) for Mdc
89 void setCylinder_Mdc(void);
90 ///
91 void setDchisqCut(void);
92 /// initialize for the services
93 void setCalibSvc_init(void);
94 void setGeomSvc_init(void);
96 ///
97 void getEventStarTime(void);
98
99 /**@name Kalman filter method related member functions*/
100 //@{
101 /// Kalman filter (forward) in Mdc
102 void filter_fwd_anal(KalFitTrack& trk, int l_mass, int way, HepSymMatrix& Eakal);
103 void filter_fwd_calib(KalFitTrack& trk, int l_mass, int way, HepSymMatrix& Eakal);
104
105 void init_matrix(MdcRec_trk& trk, HepSymMatrix& Ea);
106 void init_matrix(int k, MdcRec_trk& trk, HepSymMatrix& Ea);
107
108 void start_seed(KalFitTrack& track, int lead_, int way, MdcRec_trk& trk);
109
110 /// Kalman filter (smoothing or backward part)
111 void smoother_anal(KalFitTrack& trk, int way);
112 void smoother_calib(KalFitTrack& trk, int way);
113
114 /// Take the inner walls (eloss and mult scat) into account
115 void innerwall(KalFitTrack& trk, int l_mass, int way);
116 void innerwall(KalFitTrack& trk, int l_mass, int way,int begin,int end);
117 void innerwall(KalFitTrack& track, int l_mass, int way, double r1, double r2, int& index);//add by Huang Zhen
118 //@{
119 /// with results got at the inner Mdc hit
120 void fillTds(MdcRec_trk& TrasanTRK, KalFitTrack& track,
121 RecMdcKalTrack* trk,int l_mass);
122 void fillTds_lead(MdcRec_trk& TrasanTRK, KalFitTrack& track,
123 RecMdcKalTrack* trk, int l_mass);
124 /// with results got at the outer Mdc hit
125 void fillTds_back(KalFitTrack& track, RecMdcKalTrack* trk,
126 MdcRec_trk& TrasanTRK,int l_mass );
127
128 void fillTds_back(KalFitTrack& track, RecMdcKalTrack* trk,
129 MdcRec_trk& TrasanTRK,int l_mass,RecMdcKalHelixSegCol* segcol);
130
131 ///for smoother process
132 void fillTds_back(KalFitTrack& track, RecMdcKalTrack* trk,
133 MdcRec_trk& TrasanTRK,int l_mass,RecMdcKalHelixSegCol* segcol, int smoothflag);
134 /// with results got at (0,0,0)
135 void fillTds_ip(MdcRec_trk& TrasanTRK, KalFitTrack& track,
136 RecMdcKalTrack* trk, int l_mass);
137
138 /// complete the RecMdcKalTrackCol
139 void sameas(RecMdcKalTrack* trk, int l_mass, int imain);
140
141 void complete_track(MdcRec_trk& TrasanTRK,
142 MdcRec_trk_add& TrasanTRK_add,
143 KalFitTrack& track_lead,
144 RecMdcKalTrack* kaltrk,
145 RecMdcKalTrackCol* kalcol,RecMdcKalHelixSegCol* segcol,int flagsmooth);
146
147 void complete_track(MdcRec_trk& TrasanTRK,
148 MdcRec_trk_add& TrasanTRK_add,
149 KalFitTrack& track_lead,
150 RecMdcKalTrack* kaltrk,
152
153 // Careful refit
154 void kalman_fitting_anal(void);
155 void kalman_fitting_calib(void);
156 void kalman_fitting_csmalign(void);
158
159 // clear tables by wangdy
160 void clearTables( );
161
162 ///
163 int getWallMdcNumber(const HepPoint3D& point);
164
165 ///
166 void extToAnyPoint(KalFitTrack& trk, const HepPoint3D& point);
167
168 ///
169 void setBesFromGdml(void);
170
171
172 // --- about GEM
173 void makeGemHitsCol();
174 void fromFHitToInnerWall(KalFitTrack& track, int way);
175 void fitGemHits(KalFitTrack& track, int hypo, int way);
176 KalFitTrack Cgem_filter_anal(KalFitTrack& track, int hypo, int way);//add by Huang Zhen
177 void residual(KalFitTrack& track);//add by Huang Zhen
178
179 /// this usage is used to control the usage of this algorithm ,to be
180 /// analysis or calibration.
182 ///
184 //// flag to calculate path length in each Mdc laye :
186 /// flag to take account the wire sag into account
187 int wsag_;
188 /// flag to perform smoothing
189 int back_;
190
192
194 /// value of the pT cut for backward filter
195 double pT_;
196 /// leading mass assumption
197 int lead_;
198 ///
199 int mhyp_;
200 /// value of the momentum cut to decide refit
203
204
205 /// Flag account to multiple scattering and energy loss,
206 /// where lr flag from and whether use active hits only
208 /// flag to enhance the error matrix at the inner hit of Mdc (cosmic)
211 ///
215 int numf_;
221 ///
223 /// mass assumption for backward filter (if <0 means use leading mass)
226 /// Debug flag for the track finder part
228 /// Fill ntuples of KalFit
230 // dir of files
232 //cut for delta_chi2
234
236
237 /// factor of energy loss straggling for electron
238 double fstrag_;
239 //wire resoltion flag
242
243 /// propagation correction
247 int m_csmflag; //cosmic events flag; for cosmic events tof(y>0) should be minus
248 double m_dangcut, m_dphicut; //for cosmic events cut
249 double m_alpha;
250 private:
251 // --- KalFitCylinders
252 std::vector<KalFitCylinder> _BesKalmanFitWalls;
253 std::vector<KalFitMaterial> _BesKalmanFitMaterials;
254 std::vector<KalFitCylinder> m_innerWall;
255 std::vector<KalFitCylinder> m_CGEM;
256 std::vector<KalFitMaterial> m_CGEMMaterials;
257 //std::vector<G4Tubs> _BesKalmanFitTubs;
258
259 // --- statistics
260 int nTotalTrks;
261 int nFailedTrks[5];
262
263 // --- GEM resolution
264 double myRphiResGem; // in cm
265 double myZResGem; // in cm
266
267 // --- GEM hit coordinate choice
268 bool myUseGemPos3D;
269
270
271 KalFitWire * _wire;
272 KalFitLayer_Mdc * _layer;
273 KalFitSuper_Mdc * _superLayer;
274 HepPDT::ParticleDataTable* m_particleTable;
275 static const double RIW;
276
277 const MdcCalibFunSvc* m_mdcCalibFunSvc_;
278 const IMagneticFieldSvc* m_MFSvc_;
279 static IMdcGeomSvc* imdcGeomSvc_;
280 const CgemGeomSvc* m_CgemGeomSvc_;
281
282 int useNCGem_;
283 int nInnerCFiber_;
284 KalFitGemHitCol myGemHitCol[4];
285
286 int testCDC;
287
288 //sort the rec hits by layer
289 static bool order_rechits(const SmartRef<RecMdcHit>& m1, const SmartRef<RecMdcHit>& m2);
290
291 //ntuples
292 NTuple::Tuple* m_nt1; // KalFit track params
293 NTuple::Tuple* m_nt2; // KalFit 2-prong comparison
294 NTuple::Tuple* m_nt3; // PatRec track params
295 NTuple::Tuple* m_nt4; // PatRec 2-prong comparison
296 NTuple::Tuple* m_nt5; // for hit checking and cut
297 NTuple::Tuple* m_nt6; // for helix seg of calib
298 NTuple::Tuple* m_nt7; // for kalmanfit failure --Long LI
299
300 //for nt1
301 NTuple::Item<long> m_trackid,m_evtid;
302 NTuple::Item<double> m_chi2direct,m_prob;
303 NTuple::Matrix<double> m_ndf,m_chisq,m_stat;
304 NTuple::Array<double> m_length,m_tof,m_nhits;
305 NTuple::Item<double> m_zptot,m_zptote,m_zptotmu,m_zptotk,m_zptotp;
306 NTuple::Item<double> m_zpt,m_zpte,m_zptmu,m_zptk,m_zptp;
307 NTuple::Item<double> m_fptot,m_fptote,m_fptotmu,m_fptotk,m_fptotp;
308 NTuple::Item<double> m_fpt,m_fpte,m_fptmu,m_fptk,m_fptp;
309 NTuple::Item<double> m_lptot,m_lptote,m_lptotmu,m_lptotk,m_lptotp;
310 NTuple::Item<double> m_lpt,m_lpte,m_lptmu,m_lptk,m_lptp;
311 NTuple::Item<double> m_zsigp,m_zsigpe,m_zsigpmu,m_zsigpk,m_zsigpp;
312 NTuple::Array<double> m_zhelix,m_zhelixe,m_zhelixmu,m_zhelixk,m_zhelixp;
313 NTuple::Array<double> m_fhelix,m_fhelixe,m_fhelixmu,m_fhelixk,m_fhelixp;
314 NTuple::Array<double> m_lhelix,m_lhelixe,m_lhelixmu,m_lhelixk,m_lhelixp;
315 NTuple::Array<double> m_zerror,m_zerrore,m_zerrormu,m_zerrork,m_zerrorp;
316 NTuple::Array<double> m_ferror,m_ferrore,m_ferrormu,m_ferrork,m_ferrorp;
317 NTuple::Array<double> m_lerror,m_lerrore,m_lerrormu,m_lerrork,m_lerrorp;
318 NTuple::Array<double> m_rGem, m_chi2Gem, m_phiGemExp, m_phiGemHit, m_zGemExp, m_zGemHit;
319 //for nt1 single track MCTruth
320 NTuple::Array<double> m_mchelix;
321 NTuple::Item<double> m_mcptot;
322 NTuple::Item<long> m_mcpid;
323 //for nt3
324 NTuple::Array<double> m_trkhelix, m_trkerror;
325 NTuple::Item<double> m_trkndf, m_trkchisq, m_trkptot, m_trksigp;
326 //for nt2
327 NTuple::Item<double> m_delx,m_dely,m_delz,m_delthe,m_delphi,m_delp;
328 NTuple::Item<double> m_delpx,m_delpy,m_delpz;
329
330 //for nt4
331 NTuple::Item<double> m_trkdelx,m_trkdely,m_trkdelz;
332 NTuple::Item<double> m_trkdelthe,m_trkdelphi,m_trkdelp;
333 //for nt5
334 NTuple::Item<double> m_dchi2,m_orichi2,m_fitchi2,m_residest, m_residnew,m_anal_dr, m_anal_phi0, m_anal_kappa, m_anal_dz, m_anal_tanl, m_anal_ea_dr, m_anal_ea_phi0, m_anal_ea_kappa, m_anal_ea_dz, m_anal_ea_tanl;
335 NTuple::Item<long> m_masshyp, m_layer;
336 //for nt6
337 NTuple::Item<double> m_docaInc,m_docaExc, m_tdrift;
338 NTuple::Item<long> m_layerid,m_eventNo;
339 NTuple::Item<double> m_residualInc, m_residualExc, m_lr, m_yposition, m_dd;
340
341 //for nt7 --Long LI
342 NTuple::Item<int> m_run_kal;
343 NTuple::Item<int> m_event_kal;
344 NTuple::Item<int> m_trkid_kal;
345 NTuple::Item<int> m_dropedHits_kal_e;
346 NTuple::Item<double> m_kappa2_kal_e;
347 NTuple::Item<int> m_trackNhits_kal_e;
348 NTuple::Item<int> m_trackNster_kal_e;
349 NTuple::Item<int> m_trackNaxis_kal_e;
350 NTuple::Item<double> m_chi2_kal_e;
351 NTuple::Item<double> m_Ea00_kal_e;
352 NTuple::Item<double> m_Ea11_kal_e;
353 NTuple::Item<double> m_Ea22_kal_e;
354 NTuple::Item<double> m_Ea33_kal_e;
355 NTuple::Item<double> m_Ea44_kal_e;
356 NTuple::Item<double> m_iqual_front_kal_e;
357 NTuple::Item<int> m_dropedHits_kal_mu;
358 NTuple::Item<double> m_kappa2_kal_mu;
359 NTuple::Item<int> m_trackNhits_kal_mu;
360 NTuple::Item<int> m_trackNster_kal_mu;
361 NTuple::Item<int> m_trackNaxis_kal_mu;
362 NTuple::Item<double> m_chi2_kal_mu;
363 NTuple::Item<double> m_Ea00_kal_mu;
364 NTuple::Item<double> m_Ea11_kal_mu;
365 NTuple::Item<double> m_Ea22_kal_mu;
366 NTuple::Item<double> m_Ea33_kal_mu;
367 NTuple::Item<double> m_Ea44_kal_mu;
368 NTuple::Item<double> m_iqual_front_kal_mu;
369 NTuple::Item<int> m_dropedHits_kal_pi;
370 NTuple::Item<double> m_kappa2_kal_pi;
371 NTuple::Item<int> m_trackNhits_kal_pi;
372 NTuple::Item<int> m_trackNster_kal_pi;
373 NTuple::Item<int> m_trackNaxis_kal_pi;
374 NTuple::Item<double> m_chi2_kal_pi;
375 NTuple::Item<double> m_Ea00_kal_pi;
376 NTuple::Item<double> m_Ea11_kal_pi;
377 NTuple::Item<double> m_Ea22_kal_pi;
378 NTuple::Item<double> m_Ea33_kal_pi;
379 NTuple::Item<double> m_Ea44_kal_pi;
380 NTuple::Item<double> m_iqual_front_kal_pi;
381 NTuple::Item<int> m_dropedHits_kal_k;
382 NTuple::Item<double> m_kappa2_kal_k;
383 NTuple::Item<int> m_trackNhits_kal_k;
384 NTuple::Item<int> m_trackNster_kal_k;
385 NTuple::Item<int> m_trackNaxis_kal_k;
386 NTuple::Item<double> m_chi2_kal_k;
387 NTuple::Item<double> m_Ea00_kal_k;
388 NTuple::Item<double> m_Ea11_kal_k;
389 NTuple::Item<double> m_Ea22_kal_k;
390 NTuple::Item<double> m_Ea33_kal_k;
391 NTuple::Item<double> m_Ea44_kal_k;
392 NTuple::Item<double> m_iqual_front_kal_k;
393 NTuple::Item<int> m_dropedHits_kal_p;
394 NTuple::Item<double> m_kappa2_kal_p;
395 NTuple::Item<int> m_trackNhits_kal_p;
396 NTuple::Item<int> m_trackNster_kal_p;
397 NTuple::Item<int> m_trackNaxis_kal_p;
398 NTuple::Item<double> m_chi2_kal_p;
399 NTuple::Item<double> m_Ea00_kal_p;
400 NTuple::Item<double> m_Ea11_kal_p;
401 NTuple::Item<double> m_Ea22_kal_p;
402 NTuple::Item<double> m_Ea33_kal_p;
403 NTuple::Item<double> m_Ea44_kal_p;
404 NTuple::Item<double> m_iqual_front_kal_p;
405
406 NTuple::Item<int> m_hit_no;
407 NTuple::Item<int> m_nCluster;
408 NTuple::Array<int> m_layer_hit_e;
409 NTuple::Array<double> m_dchi2_hit_e;
410 NTuple::Array<double> m_residest_hit_e;
411 NTuple::Array<double> m_anal_dr_hit_e;
412 NTuple::Array<double> m_anal_phi0_hit_e;
413 NTuple::Array<double> m_anal_kappa_hit_e;
414 NTuple::Array<double> m_anal_dz_hit_e;
415 NTuple::Array<double> m_anal_tanl_hit_e;
416 NTuple::Array<double> m_anal_ea_dr_hit_e;
417 NTuple::Array<double> m_anal_ea_phi0_hit_e;
418 NTuple::Array<double> m_anal_ea_kappa_hit_e;
419 NTuple::Array<double> m_anal_ea_dz_hit_e;
420 NTuple::Array<double> m_anal_ea_tanl_hit_e;
421 NTuple::Array<double> m_residnew_hit_e;
422 NTuple::Array<int> m_layer_hit_mu;
423 NTuple::Array<double> m_dchi2_hit_mu;
424 NTuple::Array<double> m_residest_hit_mu;
425 NTuple::Array<double> m_anal_dr_hit_mu;
426 NTuple::Array<double> m_anal_phi0_hit_mu;
427 NTuple::Array<double> m_anal_kappa_hit_mu;
428 NTuple::Array<double> m_anal_dz_hit_mu;
429 NTuple::Array<double> m_anal_tanl_hit_mu;
430 NTuple::Array<double> m_anal_ea_dr_hit_mu;
431 NTuple::Array<double> m_anal_ea_phi0_hit_mu;
432 NTuple::Array<double> m_anal_ea_kappa_hit_mu;
433 NTuple::Array<double> m_anal_ea_dz_hit_mu;
434 NTuple::Array<double> m_anal_ea_tanl_hit_mu;
435 NTuple::Array<double> m_residnew_hit_mu;
436 NTuple::Array<int> m_layer_hit_pi;
437 NTuple::Array<double> m_dchi2_hit_pi;
438 NTuple::Array<double> m_residest_hit_pi;
439 NTuple::Array<double> m_anal_dr_hit_pi;
440 NTuple::Array<double> m_anal_phi0_hit_pi;
441 NTuple::Array<double> m_anal_kappa_hit_pi;
442 NTuple::Array<double> m_anal_dz_hit_pi;
443 NTuple::Array<double> m_anal_tanl_hit_pi;
444 NTuple::Array<double> m_anal_ea_dr_hit_pi;
445 NTuple::Array<double> m_anal_ea_phi0_hit_pi;
446 NTuple::Array<double> m_anal_ea_kappa_hit_pi;
447 NTuple::Array<double> m_anal_ea_dz_hit_pi;
448 NTuple::Array<double> m_anal_ea_tanl_hit_pi;
449 NTuple::Array<double> m_residnew_hit_pi;
450 NTuple::Array<int> m_layer_hit_k;
451 NTuple::Array<double> m_dchi2_hit_k;
452 NTuple::Array<double> m_residest_hit_k;
453 NTuple::Array<double> m_anal_dr_hit_k;
454 NTuple::Array<double> m_anal_phi0_hit_k;
455 NTuple::Array<double> m_anal_kappa_hit_k;
456 NTuple::Array<double> m_anal_dz_hit_k;
457 NTuple::Array<double> m_anal_tanl_hit_k;
458 NTuple::Array<double> m_anal_ea_dr_hit_k;
459 NTuple::Array<double> m_anal_ea_phi0_hit_k;
460 NTuple::Array<double> m_anal_ea_kappa_hit_k;
461 NTuple::Array<double> m_anal_ea_dz_hit_k;
462 NTuple::Array<double> m_anal_ea_tanl_hit_k;
463 NTuple::Array<double> m_residnew_hit_k;
464 NTuple::Array<int> m_layer_hit_p;
465 NTuple::Array<double> m_dchi2_hit_p;
466 NTuple::Array<double> m_residest_hit_p;
467 NTuple::Array<double> m_anal_dr_hit_p;
468 NTuple::Array<double> m_anal_phi0_hit_p;
469 NTuple::Array<double> m_anal_kappa_hit_p;
470 NTuple::Array<double> m_anal_dz_hit_p;
471 NTuple::Array<double> m_anal_tanl_hit_p;
472 NTuple::Array<double> m_anal_ea_dr_hit_p;
473 NTuple::Array<double> m_anal_ea_phi0_hit_p;
474 NTuple::Array<double> m_anal_ea_kappa_hit_p;
475 NTuple::Array<double> m_anal_ea_dz_hit_p;
476 NTuple::Array<double> m_anal_ea_tanl_hit_p;
477 NTuple::Array<double> m_residnew_hit_p;
478
479
480
481 NTuple::Item<double> m_dchisq0,m_dchisq1,m_dchisq2,m_dchisq3,m_dchisq4,m_dchisq5,m_dchisq6,m_dchisq7,m_dchisq8,m_dchisq9,m_dchisq10,m_dchisq11,m_dchisq12,m_dchisq13,m_dchisq14,m_dchisq15,m_dchisq16,m_dchisq17,m_dchisq18,m_dchisq19,m_dchisq20,m_dchisq21,m_dchisq22,m_dchisq23,m_dchisq24,m_dchisq25,m_dchisq26,m_dchisq27,m_dchisq28,m_dchisq29,m_dchisq30,m_dchisq31,m_dchisq32,m_dchisq33,m_dchisq34,m_dchisq35,m_dchisq36,m_dchisq37,m_dchisq38,m_dchisq39,m_dchisq40,m_dchisq41,m_dchisq42;
482 NTuple::Item<double> m_dtrack0,m_dtrack1,m_dtrack2,m_dtrack3,m_dtrack4,m_dtrack5,m_dtrack6,m_dtrack7,m_dtrack8,m_dtrack9,m_dtrack10,m_dtrack11,m_dtrack12,m_dtrack13,m_dtrack14,m_dtrack15,m_dtrack16,m_dtrack17,m_dtrack18,m_dtrack19,m_dtrack20,m_dtrack21,m_dtrack22,m_dtrack23,m_dtrack24,m_dtrack25,m_dtrack26,m_dtrack27,m_dtrack28,m_dtrack29,m_dtrack30,m_dtrack31,m_dtrack32,m_dtrack33,m_dtrack34,m_dtrack35,m_dtrack36,m_dtrack37,m_dtrack38,m_dtrack39,m_dtrack40,m_dtrack41,m_dtrack42;
483 NTuple::Item<double> m_dtdc0,m_dtdc1,m_dtdc2,m_dtdc3,m_dtdc4,m_dtdc5,m_dtdc6,m_dtdc7,m_dtdc8,m_dtdc9,m_dtdc10,m_dtdc11,m_dtdc12,m_dtdc13,m_dtdc14,m_dtdc15,m_dtdc16,m_dtdc17,m_dtdc18,m_dtdc19,m_dtdc20,m_dtdc21,m_dtdc22,m_dtdc23,m_dtdc24,m_dtdc25,m_dtdc26,m_dtdc27,m_dtdc28,m_dtdc29,m_dtdc30,m_dtdc31,m_dtdc32,m_dtdc33,m_dtdc34,m_dtdc35,m_dtdc36,m_dtdc37,m_dtdc38,m_dtdc39,m_dtdc40,m_dtdc41,m_dtdc42;
484
485 bool ifProdNt10;
486 NTuple::Tuple* m_nt10;
487 NTuple::Item<long> m_evt3;
488 NTuple::Item<long> m_nGemHits,m_qua;
489 NTuple::Array<double> m_meas_r,m_meas_phi,m_meas_z,m_esti1_r,m_esti1_phi,m_esti1_z,m_esti2_r,m_esti2_phi ,m_esti2_z,m_diff1_phi,m_diff2_z,m_diff1_z,m_diff2_phi,m_Gchi2;
490 NTuple::Array<int> m_GemLayer,m_mass;
491 NTuple::Array<double> m_meas_phierr,m_meas_zerr,m_esti_phierr,m_esti_zerr;
492 NTuple::Item<int> ctrk;
493 NTuple::Array<double> m_phi1,m_z1,m_phi2,m_z2,m_resphi1,m_resphi2,m_resz1,m_resz2,m_achi2;
494
495 bool ifProdNt11;
496 NTuple::Tuple* m_nt11;
497 NTuple::Item<int> m_evt4,m_ntruth;
498 NTuple::Array<double> m_dtphi,m_dtv,m_dtpostphi,m_dtpostz;
499 NTuple::Array<int> m_tlayer;
500
501 //calculate residual of 5 helix parameter and momemtum between kalman filter and MCtruth, add by Huang Zhen
502 bool ifProdNt12;
503 NTuple::Tuple* m_nt12;
504 NTuple::Item<long> m_track,m_evt;
505 NTuple::Item<double> m_diff_dr,m_diff_phi0,m_diff_kappa,m_diff_dz,m_diff_tanl,m_diff_p;
506};
507#endif
508
HepGeom::Point3D< double > HepPoint3D
Definition: KalFitAlg.h:54
vector< KalFitGemHit > KalFitGemHitCol
Definition: KalFitGemHit.h:49
ObjectVector< RecMdcKalHelixSeg > RecMdcKalHelixSegCol
ObjectVector< RecMdcKalTrack > RecMdcKalTrackCol
double pe_cut_
value of the momentum cut to decide refit
Definition: KalFitAlg.h:201
int debug_kft_
Definition: KalFitAlg.h:227
double gain1_
Definition: KalFitAlg.h:212
void residual(KalFitTrack &track)
Definition: KalFitAlg.cxx:8081
double m_alpha
Definition: KalFitAlg.h:249
void filter_fwd_anal(KalFitTrack &trk, int l_mass, int way, HepSymMatrix &Eakal)
Kalman filter (forward) in Mdc.
Definition: KalFitAlg.cxx:3183
void filter_fwd_calib(KalFitTrack &trk, int l_mass, int way, HepSymMatrix &Eakal)
Definition: KalFitAlg.cxx:3545
double dchi2cut_mid1_
Definition: KalFitAlg.h:235
double fstrag_
factor of energy loss straggling for electron
Definition: KalFitAlg.h:238
double pmu_cut_
Definition: KalFitAlg.h:201
StatusCode beginRun()
Definition: KalFitAlg.cxx:342
double fac_h4_
Definition: KalFitAlg.h:210
double m_dangcut
Definition: KalFitAlg.h:248
int loss_
Definition: KalFitAlg.h:207
double theta_cut_
Definition: KalFitAlg.h:202
double pt_cut_
Definition: KalFitAlg.h:202
int back_
flag to perform smoothing
Definition: KalFitAlg.h:189
double gain3_
Definition: KalFitAlg.h:212
void fillTds_lead(MdcRec_trk &TrasanTRK, KalFitTrack &track, RecMdcKalTrack *trk, int l_mass)
Definition: KalFitAlg.cxx:1663
int iqual_front_[5]
Definition: KalFitAlg.h:241
int numfcor_
Definition: KalFitAlg.h:214
int outer_steps_
Definition: KalFitAlg.h:217
int eventno
Definition: KalFitAlg.h:191
~KalFitAlg(void)
destructor
Definition: KalFitAlg.cxx:182
int muls_
Definition: KalFitAlg.h:207
void fromFHitToInnerWall(KalFitTrack &track, int way)
Definition: KalFitAlg.cxx:6872
double gain5_
Definition: KalFitAlg.h:212
double dchi2cutf_
Definition: KalFitAlg.h:233
void clean(void)
Definition: KalFitAlg.cxx:190
int tof_hyp_
Definition: KalFitAlg.h:207
void kalman_fitting_MdcxReco_Csmc_Sew(void)
Definition: KalFitAlg.cxx:5066
double pp_cut_
Definition: KalFitAlg.h:201
void setCalibSvc_init(void)
initialize for the services
Definition: KalFitAlg2.cxx:247
int numf_in_
Definition: KalFitAlg.h:218
void smoother_anal(KalFitTrack &trk, int way)
Kalman filter (smoothing or backward part)
Definition: KalFitAlg.cxx:2830
int iqual_back_
Definition: KalFitAlg.h:241
int i_back_
mass assumption for backward filter (if <0 means use leading mass)
Definition: KalFitAlg.h:224
void complete_track(MdcRec_trk &TrasanTRK, MdcRec_trk_add &TrasanTRK_add, KalFitTrack &track_lead, RecMdcKalTrack *kaltrk, RecMdcKalTrackCol *kalcol, RecMdcKalHelixSegCol *segcol, int flagsmooth)
Definition: KalFitAlg.cxx:6117
int wsag_
flag to take account the wire sag into account
Definition: KalFitAlg.h:187
double fac_h3_
Definition: KalFitAlg.h:210
double dchi2cut_mid2_
Definition: KalFitAlg.h:235
void kalman_fitting_calib(void)
Definition: KalFitAlg.cxx:4477
void sameas(RecMdcKalTrack *trk, int l_mass, int imain)
complete the RecMdcKalTrackCol
Definition: KalFitAlg.cxx:2811
void fillTds_ip(MdcRec_trk &TrasanTRK, KalFitTrack &track, RecMdcKalTrack *trk, int l_mass)
with results got at (0,0,0)
Definition: KalFitAlg.cxx:1758
void makeGemHitsCol()
Definition: KalFitAlg.cxx:7254
int tofflag_
Definition: KalFitAlg.h:207
int mhyp_
Definition: KalFitAlg.h:199
void fitGemHits(KalFitTrack &track, int hypo, int way)
Definition: KalFitAlg.cxx:7359
string matfile_
Definition: KalFitAlg.h:231
void fillTds(MdcRec_trk &TrasanTRK, KalFitTrack &track, RecMdcKalTrack *trk, int l_mass)
with results got at the inner Mdc hit
Definition: KalFitAlg.cxx:1493
void innerwall(KalFitTrack &trk, int l_mass, int way)
Take the inner walls (eloss and mult scat) into account.
Definition: KalFitAlg.cxx:3743
double fac_h1_
Definition: KalFitAlg.h:210
double m_dphicut
Definition: KalFitAlg.h:248
KalFitTrack Cgem_filter_anal(KalFitTrack &track, int hypo, int way)
Definition: KalFitAlg.cxx:7767
double fac_h2_
Definition: KalFitAlg.h:210
int fitnocut_
Definition: KalFitAlg.h:220
int debug_
Debug flag for the track finder part.
Definition: KalFitAlg.h:227
string cylfile_
Definition: KalFitAlg.h:231
int usage_
Definition: KalFitAlg.h:181
int pathl_
Definition: KalFitAlg.h:185
void start_seed(KalFitTrack &track, int lead_, int way, MdcRec_trk &trk)
Definition: KalFitAlg.cxx:6636
double dchi2cut_layid2_
Definition: KalFitAlg.h:235
void getEventStarTime(void)
void setBesFromGdml(void)
void setGeomSvc_init(void)
Definition: KalFitAlg2.cxx:259
void kalman_fitting_anal(void)
Definition: KalFitAlg.cxx:3841
int i_front_
Definition: KalFitAlg.h:225
void setDchisqCut(void)
Definition: KalFitAlg.cxx:815
int m_usevtxdb
Definition: KalFitAlg.h:246
int tprop_
propagation correction
Definition: KalFitAlg.h:244
double dchi2cut_layid3_
Definition: KalFitAlg.h:235
double fac_h5_
Definition: KalFitAlg.h:210
int choice_
Definition: KalFitAlg.h:183
int getWallMdcNumber(const HepPoint3D &point)
void set_Mdc(void)
Set up the wires, layers and superlayers...
Definition: KalFitAlg2.cxx:114
int numf_out_
Definition: KalFitAlg.h:219
void setMagneticFieldSvc_init(void)
int drifttime_choice_
Definition: KalFitAlg.h:222
int m_csmflag
Definition: KalFitAlg.h:247
double dchi2cut_outer_
Definition: KalFitAlg.h:235
int enhance_
flag to enhance the error matrix at the inner hit of Mdc (cosmic)
Definition: KalFitAlg.h:209
int myEventNo
Definition: KalFitAlg.h:245
StatusCode execute()
event function
Definition: KalFitAlg.cxx:918
double gain2_
Definition: KalFitAlg.h:212
int inner_steps_
Definition: KalFitAlg.h:216
int lead_
leading mass assumption
Definition: KalFitAlg.h:197
int resolution_
Definition: KalFitAlg.h:240
double dchi2cuts_
Definition: KalFitAlg.h:233
void smoother_calib(KalFitTrack &trk, int way)
Definition: KalFitAlg.cxx:3045
int Tds_back_no
Definition: KalFitAlg.h:193
void init_matrix(MdcRec_trk &trk, HepSymMatrix &Ea)
Definition: KalFitAlg.cxx:6538
void setCylinder_Mdc(void)
Initialize the cylinders (walls and cathodes) for Mdc.
int numf_
Definition: KalFitAlg.h:215
double pk_cut_
Definition: KalFitAlg.h:201
double pT_
value of the pT cut for backward filter
Definition: KalFitAlg.h:195
int steplev_
Definition: KalFitAlg.h:213
double matrixg_
Definition: KalFitAlg.h:210
StatusCode initialize()
initialize
Definition: KalFitAlg.cxx:204
StatusCode finalize()
Definition: KalFitAlg.cxx:320
void kalman_fitting_csmalign(void)
Definition: KalFitAlg.cxx:5555
double gain4_
Definition: KalFitAlg.h:212
int ntuple_
Fill ntuples of KalFit.
Definition: KalFitAlg.h:229
double ppi_cut_
Definition: KalFitAlg.h:201
void hist_def(void)
hist definition
Definition: KalFitAlg.cxx:378
void fillTds_back(KalFitTrack &track, RecMdcKalTrack *trk, MdcRec_trk &TrasanTRK, int l_mass)
with results got at the outer Mdc hit
Definition: KalFitAlg.cxx:2023
void setMaterial_Mdc(void)
Initialize the material for Mdc.
double dchi2cut_inner_
Definition: KalFitAlg.h:235
int activeonly_
Definition: KalFitAlg.h:207
void extToAnyPoint(KalFitTrack &trk, const HepPoint3D &point)
void clearTables()
Definition: KalFitAlg.cxx:6745
Description of a Hit in Mdc.
Definition: KalFitHitMdc.h:17
Description of a track class (<- Helix.cc)
Definition: KalFitTrack.h:36
Description of a Wire class.
Definition: KalFitWire.h:46