1#ifndef _DEFINE_KALFITTRACK_H_
2#define _DEFINE_KALFITTRACK_H_
8#include "CLHEP/Geometry/Point3D.h"
9#include "CLHEP/Geometry/Transform3D.h"
10#include "CLHEP/Matrix/Matrix.h"
11#include "CLHEP/Matrix/Vector.h"
12#include "EventModel/Event.h"
13#include "KalFitAlg/KalFitHelixSeg.h"
14#include "KalFitAlg/KalFitHitMdc.h"
15#include "KalFitAlg/coil/Bfield.h"
16#include "KalFitAlg/helix/Helix.h"
17#include "MagneticFieldSvc/IBesMagFieldSvc.h"
18#include "MdcCalibFunSvc/IMdcCalibFunSvc.h"
19#include "MdcRawEvent/MdcDigi.h"
21#ifndef ENABLE_BACKWARDS_COMPATIBILITY
39 unsigned int nchits_, nster_, ncath_, ndf_back_;
40 double chiSq_back_, pathip_, path_rd_, path_ab_, tof_, dchi2_max_, r_max_;
41 double tof_kaon_, tof_proton_;
42 double p_kaon_, p_proton_;
49 CLHEP::Hep3Vector mom_[43];
56 CLHEP::HepVector a_last_;
57 CLHEP::HepSymMatrix Ea_last_;
62 CLHEP::HepVector a_forMdc_;
63 CLHEP::HepSymMatrix Ea_forMdc_;
64 vector<KalFitHitMdc> HitsMdc_;
66 vector<KalFitHelixSeg> HelixSegs_;
69 static const double MASS[NMASS];
72 static int lead_, back_;
74 static const IMdcCalibFunSvc* CalibFunSvc_;
75 static const IBesMagFieldSvc* MFSvc_;
76 static IMdcGeomSvc* iGeomSvc_;
77 static double EventT0_;
78 static HepSymMatrix initMatrix_;
84 const CLHEP::HepSymMatrix&
Ea,
unsigned int m,
double chiSq,
108 double& dchi2,
int csmflag );
113 double& dchi2,
double& dtrack,
double& dtracknew,
double& dtdc,
117 double& dchi2,
int csmflag );
119 int way,
double& dchi2,
int csmflag );
133 void point_last(
const HepPoint3D& point ) { point_last_ = point; }
137 const HepPoint3D&
pivot_last(
void )
const {
return pivot_last_; }
138 const CLHEP::HepVector&
a_last(
void )
const {
return a_last_; }
139 const CLHEP::HepSymMatrix&
Ea_last(
void )
const {
return Ea_last_; }
142 const CLHEP::HepVector&
a_forMdc(
void )
const {
return a_forMdc_; }
143 const CLHEP::HepSymMatrix&
Ea_forMdc(
void )
const {
return Ea_forMdc_; }
160 double filter(
double v_m,
const CLHEP::HepVector& m_H,
double v_d,
double m_V );
168 int insist(
void )
const {
return insist_; }
169 int type(
void )
const {
return type_; }
171 double r0(
void )
const {
return r0_; }
172 double mass(
void )
const {
return mass_; }
173 double chiSq(
void )
const {
return chiSq_; }
176 double pathip(
void )
const {
return pathip_; }
177 double path_rd(
void )
const {
return path_rd_; }
178 double path_ab(
void )
const {
return path_ab_; }
179 double*
pathl(
void ) {
return PathL_; }
180 CLHEP::Hep3Vector*
mom(
void ) {
return mom_; }
181 double tof(
void )
const {
return tof_; }
182 double tof_kaon(
void )
const {
return tof_kaon_; }
184 double p_kaon(
void )
const {
return p_kaon_; }
185 double p_proton(
void )
const {
return p_proton_; }
187 double r_max(
void )
const {
return r_max_; }
188 unsigned int nchits(
void )
const {
return nchits_; }
189 unsigned int nster(
void )
const {
return nster_; }
190 unsigned int ncath(
void )
const {
return ncath_; }
191 int pat1(
void )
const {
return pat1_; }
192 int pat2(
void )
const {
return pat2_; }
193 int nhit_r(
void )
const {
return nhit_r_; }
194 int nhit_z(
void )
const {
return nhit_z_; }
201 void pathip(
double pl ) { pathip_ = pl; }
202 void p_kaon(
double pl ) { p_kaon_ = pl; }
204 void chiSq(
double c ) { chiSq_ = c; }
219 vector<KalFitHitMdc>&
HitsMdc(
void ) {
return HitsMdc_; }
224 vector<KalFitHelixSeg>&
HelixSegs(
void ) {
return HelixSegs_; }
241 double getSigma(
int layerId,
double driftDist )
const;
328 for (
int i = 0; i < 43; i++ )
n += myLayerUsed[i];
333 for (
int i = 0; i < 43; i++ ) myLayerUsed[i] = 0;
337 if ( iLay >= 0 && iLay <= 43 ) myLayerUsed[iLay] = 1;
341 int myLayerUsed[43]{};
HepGeom::Point3D< double > HepPoint3D
HepGeom::Transform3D HepTransform3D
ObjectVector< MdcDigi > MdcDigiCol
Description of a Hit in Mdc.
Description of a track class (<- Helix.cc).
~KalFitTrack(void)
destructor
double chi2_next(Helix &H, KalFitHitMdc &HitMdc, int csmflag)
void chiSq_back(double c)
CLHEP::Hep3Vector * mom(void)
double getDriftTime(KalFitHitMdc &hitmdc, double toftime) const
static double chi2_hitf_
Cut chi2 for each hit.
KalFitTrack(const HepPoint3D &pivot, const CLHEP::HepVector &a, const CLHEP::HepSymMatrix &Ea, unsigned int m, double chiSq, unsigned int nhits)
constructor
static double dchi2cuts_anal[43]
unsigned int nchits(void) const
static double dchi2cuts_calib[43]
double tof_proton(void) const
static int debug_
for debug
double filter(double v_m, const CLHEP::HepVector &m_H, double v_d, double m_V)
double tof_kaon(void) const
static void setMdcDigiCol(MdcDigiCol *digicol)
int insist(void) const
Extractor :
double update_hits(KalFitHelixSeg &HelixSeg, int inext, CLHEP::Hep3Vector &meas, int way, double &dchi2, int csmflag)
double path_rd(void) const
static double mass(int i)
void order_wirhit(int index)
double getSigma(KalFitHitMdc &hitmdc, double tanlam, int lr, double dist) const
HepSymMatrix getInitMatrix(void) const
double path_ab(void) const
const HepPoint3D & point_last(void)
unsigned int ncath(void) const
static int nmdc_hit2_
Cut chi2 for each hit.
double getSigma(int layerId, double driftDist) const
double dchi2_max(void) const
KalFitHelixSeg & HelixSeg(int i)
void addTofSM(double time)
double PathL(int layer)
Function to calculate the path length in the layer.
static int resolflag_
wire resoltion flag
static double factor_strag_
factor of energy loss straggling for electron
int trasan_id(void) const
const HepPoint3D & pivot_numf(const HepPoint3D &newPivot)
Sets pivot position in a given mag field.
void ms(double path, const KalFitMaterial &m, int index)
static int Tof_correc_
Flag for TOF correction.
const HepPoint3D & pivot_numf(const HepPoint3D &newPivot, double &pathl)
double intersect_cylinder(double r) const
Intersection with different geometry.
double chiSq_back(void) const
const CLHEP::HepSymMatrix & Ea_last(void) const
void HitsMdc(vector< KalFitHitMdc > &lh)
vector< KalFitHitMdc > & HitsMdc(void)
double pathip(void) const
static void setInitMatrix(HepSymMatrix m)
void point_last(const HepPoint3D &point)
set and give out the last point of the track
void HelixSegs(vector< KalFitHelixSeg > &vs)
static int numf_
Flag for treatment of non-uniform mag field.
void path_add(double path)
Update the path length estimation.
unsigned int nster(void) const
static double chi2mdc_hit2_
void appendHelixSegs(KalFitHelixSeg s)
double smoother_Mdc(KalFitHitMdc &HitMdc, CLHEP::Hep3Vector &meas, KalFitHelixSeg &seg, double &dchi2, int csmflag)
const CLHEP::HepVector & a_last(void) const
double p_proton(void) const
double update_hits_csmalign(KalFitHelixSeg &HelixSeg, int inext, CLHEP::Hep3Vector &meas, int way, double &dchi2, int csmflag)
const HepPoint3D & pivot_forMdc(void) const
void tof(double path)
Update the tof estimation.
static int drifttime_choice_
the drifttime choice
const CLHEP::HepSymMatrix & Ea_forMdc(void) const
double smoother_Mdc(KalFitHelixSeg &seg, CLHEP::Hep3Vector &meas, int &flg, int csmflag)
Kalman smoother for Mdc.
void msgasmdc(double path, int index)
Calculate multiple scattering angle.
static int tprop_
for signal propagation correction
void appendHitsMdc(KalFitHitMdc h)
Functions for Mdc hits list.
void addPathSM(double path)
static double mdcGasRadlen_
double cor_tanldep(double *p, double er)
Correct the error according the current tanl value :
static double dchi2cutf_calib[43]
static void setIMdcGeomSvc(IMdcGeomSvc *igeomsvc)
const CLHEP::HepVector & a_forMdc(void) const
void eloss(double path, const KalFitMaterial &m, int index)
Calculate total energy lost in material.
void update_last(void)
Record the current parameters as ..._last information :
double getDriftDist(KalFitHitMdc &hitmdc, double drifttime, int lr) const
double intersect_yz_plane(const HepTransform3D &plane, double x) const
double intersect_zx_plane(const HepTransform3D &plane, double y) const
static void setT0(double t0)
static int numfcor_
NUMF treatment improved.
static void setMdcCalibFunSvc(const IMdcCalibFunSvc *calibsvc)
double chi2_next(Helix &H, KalFitHitMdc &HitMdc)
static void setMagneticFieldSvc(IBesMagFieldSvc *)
static int lead(void)
Magnetic field map.
double intersect_xy_plane(double z) const
double radius_numf(void) const
Estimation of the radius in a given mag field.
double smoother_Mdc_csmalign(KalFitHelixSeg &seg, CLHEP::Hep3Vector &meas, int &flg, int csmflag)
void type(int t)
Reinitialize (modificator).
double update_hits(KalFitHitMdc &HitMdc, int inext, CLHEP::Hep3Vector &meas, int way, double &dchi2, double &dtrack, double &dtracknew, double &dtdc, int csmflag)
Include the Mdc wire hits.
static double dchi2cutf_anal[43]
static int LR_
Use L/R decision from MdcRecHit information :
vector< KalFitHelixSeg > & HelixSegs(void)
double p_kaon(void) const
const HepPoint3D & pivot_last(void) const
returns helix parameters
KalFitHitMdc & HitMdc(int i)
static int strag_
Flag to take account of energy loss straggling :
const HepSymMatrix & Ea(void) const
returns error matrix.
HepPoint3D x(double dPhi=0.) const
returns position after rotating angle dPhi in phi direction.
const HepVector & a(void) const
returns helix parameters.
Helix(const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
Constructor with pivot, helix parameter a, and its error matrix.
const HepPoint3D & pivot(void) const
returns pivot position.