CbmRoot
CbmKFTofHit.cxx
Go to the documentation of this file.
1 // ----------------------------------------------------------------------
2 // ----- CbmKFTofHit -----
3 // ----- Created 12/12/2005 by D.Kresan -----
4 // ----------------------------------------------------------------------
5 
6 #include "CbmKFTofHit.h"
7 
8 #include "CbmKF.h"
9 #include "CbmKFMaterial.h"
10 
11 #include "CbmTofHit.h"
12 
13 #include "TMath.h"
14 #include "TVector3.h"
15 
16 #include <iostream>
17 
18 using std::cout;
19 using std::endl;
20 
21 
22 // ------------------------ Create from CbmTofHit -----------------------
24  // Get pointer to the Kalman filter
25  CbmKF* KF = CbmKF::Instance();
26  if (NULL == KF) {
27  cout << "-E- CbmKFTofHit::Create : "
28  << "Kalman filter is not instantiated." << endl;
29  return;
30  }
31  // Get index of material
33  // Store pointer to the material
34  wall = (MaterialIndex >= 0) ? (CbmKFWall*) KF->vMaterial[MaterialIndex] : 0;
35 
36  // Get position and position error
37  TVector3 pos, err;
38  hit->Position(pos);
39  hit->PositionError(err);
40  // Store values
41  /* FitPoint.x = pos.X();
42  FitPoint.y = pos.Y();
43  FitPoint.z = pos.Z();
44  FitPoint.V[0] = 1e-8 * err.X() * err.X();
45  FitPoint.V[1] = 0;
46  FitPoint.V[2] = 1e-8 * err.Y() * err.Y();*/
47  Double_t u = pos.X();
48  Double_t phi = 0.;
49  Double_t sigma2 = err.X() * err.X();
50  if (err.Y() < err.X()) {
51  u = pos.Y();
52  phi = TMath::Pi() / 2.;
53  sigma2 = err.Y() * err.Y();
54  }
55  FitPoint.Set(pos.Z(), u, phi, sigma2);
56 }
57 // ----------------------------------------------------------------------
58 
59 
60 // ------------------------------ Filter --------------------------------
62  Bool_t /*downstream*/,
63  Double_t& QP0) {
64  Bool_t err = 0;
65  /*
66  Double_t zfst, zlst, zend;
67  if( downstream ) {
68  zfst = wall->ZReference - wall->ZThickness/4.;
69  zlst = wall->ZReference + wall->ZThickness/4.;
70  zend = wall->ZReference + wall->ZThickness/2.;
71  }
72  else {
73  zfst = wall->ZReference + wall->ZThickness/4.;
74  zlst = wall->ZReference - wall->ZThickness/4.;
75  zend = wall->ZReference - wall->ZThickness/2.;
76  }
77  Double_t zthick = wall->ZThickness/2.;
78 */
79  // wall->Pass( zfst, zthick, track, downstream, QP0 );
80  // KF->Propagate( track, FitPoint.z, QP0 );
81 
82  err = err || track.Propagate(FitPoint.z, QP0);
83  err = err || FitPoint.Filter(track);
84  // cout<<" Filter z "<<FitPoint.z<<", QP0 "<<QP0<<endl;
85  // wall->Pass( zlst, zthick, track, downstream, QP0 );
86  // KF->Propagate( track, zend, QP0 );
87  return err;
88 }
89 // ----------------------------------------------------------------------
90 
91 
CbmPixelHit::Position
void Position(TVector3 &pos) const
Copies hit position to pos.
Definition: CbmPixelHit.cxx:64
CbmKF.h
CbmKFTofHit::FitPoint
CbmKFUMeasurement FitPoint
Definition: CbmKFTofHit.h:30
CbmKF::GetMaterialIndex
Int_t GetMaterialIndex(Int_t uid)
Definition: CbmKF.cxx:328
CbmKFTofHit::wall
CbmKFWall * wall
Definition: CbmKFTofHit.h:37
CbmKF
Definition: CbmKF.h:33
CbmKFTofHit::Filter
Int_t Filter(CbmKFTrackInterface &track, Bool_t downstream, Double_t &QP0)
Definition: CbmKFTofHit.cxx:61
ClassImp
ClassImp(CbmKFTofHit)
CbmKFUMeasurement::Set
void Set(Double_t z, Double_t u, Double_t phi, Double_t sigma2)
CbmKF::Instance
static CbmKF * Instance()
Definition: CbmKF.h:39
CbmKFHit::MaterialIndex
Int_t MaterialIndex
Definition: CbmKFHit.h:22
CbmKFUMeasurement::Filter
Int_t Filter(CbmKFTrackInterface &track)
Definition: CbmKFUMeasurement.cxx:22
CbmKFWall
Definition: CbmKFMaterial.h:69
CbmKF::vMaterial
std::vector< CbmKFMaterial * > vMaterial
Definition: CbmKF.h:71
CbmKFUMeasurement::z
Double_t z
Definition: CbmKFUMeasurement.h:30
CbmKFTofHit
Definition: CbmKFTofHit.h:23
xMath::Pi
double Pi()
Definition: xMath.h:5
CbmKFTofHit::Create
void Create(CbmTofHit *hit)
Definition: CbmKFTofHit.cxx:23
CbmKFTrackInterface
Definition: CbmKFTrackInterface.h:26
CbmKFMaterial.h
CbmKFTofHit.h
pos
TVector3 pos
Definition: CbmMvdSensorDigiToHitTask.cxx:60
CbmTofHit
Definition: core/data/tof/CbmTofHit.h:26
CbmKFTrackInterface::Propagate
Int_t Propagate(Double_t z_out, Double_t QP0)
Definition: CbmKFTrackInterface.cxx:449
CbmPixelHit::PositionError
void PositionError(TVector3 &dpos) const
Copies hit position error to pos.
Definition: CbmPixelHit.cxx:68
CbmTofHit::GetPlaneId
Int_t GetPlaneId() const
Inherited from CbmBaseHit.
Definition: core/data/tof/CbmTofHit.h:88