CbmRoot
LitTrackFitter.h
Go to the documentation of this file.
1 
8 #ifndef LITTRACKFITTER_H_
9 #define LITTRACKFITTER_H_
10 
11 #include "LitAddMaterial.h"
12 #include "LitDetectorLayout.h"
13 #include "LitExtrapolation.h"
14 #include "LitFiltration.h"
15 #include "LitScalPixelHit.h"
16 #include "LitTrackParam.h"
17 #include "LitTypes.h"
18 
19 namespace lit {
20  namespace parallel {
21 
25  inline void LitTrackFitter(LitScalTrack& track,
26  const LitDetectorLayoutScal& layout) {
27  LitTrackParamScal par = track.GetParamFirst();
28 
29  unsigned char nofVirtualStations = layout.GetNofVirtualStations();
30  unsigned char nofSteps = (nofVirtualStations - 1) / 2;
31  for (unsigned char iStep = 0; iStep < nofSteps; iStep++) {
32  const LitVirtualStationScal& vsFront =
33  layout.GetVirtualStation(2 * iStep + 0);
34  const LitVirtualStationScal& vsMiddle =
35  layout.GetVirtualStation(2 * iStep + 1);
36  const LitVirtualStationScal& vsBack =
37  layout.GetVirtualStation(2 * iStep + 2);
38  if (vsFront.GetField().IsEmpty() || vsMiddle.GetField().IsEmpty()
39  || vsBack.GetField().IsEmpty()) {
40  LitLineExtrapolation(par, vsBack.GetZ());
41  } else {
43  vsBack.GetZ(),
44  vsFront.GetField(),
45  vsMiddle.GetField(),
46  vsBack.GetField());
47  }
48 
49  if (!vsFront.GetMaterial().IsEmpty()) {
50  fscal thickness = vsFront.GetMaterial().GetMaterial(par.X, par.Y);
51  if (thickness > 0) LitAddMaterial<fscal>(par, thickness);
52  }
53 
54  if (!vsMiddle.GetMaterial().IsEmpty()) {
55  fscal thickness = vsMiddle.GetMaterial().GetMaterial(par.X, par.Y);
56  if (thickness > 0) LitAddMaterial<fscal>(par, thickness);
57  }
58 
59  if (!vsBack.GetMaterial().IsEmpty()) {
60  fscal thickness = vsBack.GetMaterial().GetMaterial(par.X, par.Y);
61  if (thickness > 0) LitAddMaterial<fscal>(par, thickness);
62  }
63  }
64 
65  fscal chiSq = 0.;
66  unsigned char prevStationId =
67  -1; // start with -1, i.e. there where no previous station id
68  unsigned short nofHits = track.GetNofHits();
69  for (unsigned short iHit = 0; iHit < nofHits; iHit++) {
70  const LitScalPixelHit* hit = track.GetHit(iHit);
71 
72  LitLineExtrapolation(par, hit->Z);
73 
74  // lit::parallel::LitFieldGrid field1, field2, field3;
75  // LitRK4Extrapolation(par, hit->Z, field1, field2, field3);
76 
77  // Add material taking into account missing hits
78  for (unsigned char iStation = prevStationId + 1;
79  iStation <= hit->stationId;
80  iStation++) {
81  const LitVirtualStationScal& vs =
82  layout.GetStation(iStation).GetVirtualStation(0);
83  if (!vs.GetMaterial().IsEmpty()) {
84  fscal thickness = vs.GetMaterial().GetMaterial(par.X, par.Y);
85  if (thickness > 0) LitAddMaterial<fscal>(par, thickness);
86  }
87  }
88  prevStationId = hit->stationId;
89 
90  LitFiltration(par, *hit, chiSq);
91 
92  if (iHit == 0) track.SetParamFirst(par);
93  }
94  track.SetParamLast(par);
95  }
96 
97  } // namespace parallel
98 } // namespace lit
99 #endif /* LITTRACKFITTER_H_ */
fscal
float fscal
Definition: L1/vectors/P4_F32vec4.h:250
lit::parallel::LitScalPixelHit
Base class for scalar pixel hits.
Definition: LitScalPixelHit.h:31
LitExtrapolation.h
Functions for track parameters extrapolation.
lit::parallel::LitFiltration
void LitFiltration(LitTrackParam< T > &par, const LitPixelHit< T > &hit, T &chiSq)
Function implements Kalman filter update step for pixel hit.
Definition: LitFiltration.h:34
lit::parallel::LitTrackParam::X
T X
Definition: LitTrackParam.h:92
lit::parallel::LitTrackParam::Y
T Y
Definition: LitTrackParam.h:93
lit::parallel::LitScalTrack::GetHit
const LitScalPixelHit * GetHit(unsigned short index) const
Returns pointer to the hit.
Definition: LitScalTrack.h:82
lit::parallel::LitMaterialGrid::GetMaterial
fscal GetMaterial(fscal x, fscal y) const
Return material thickness in silicon equivalent for (X, Y) position (scalar version).
Definition: LitMaterialGrid.h:91
LitAddMaterial.h
Functions for calculation of the material effects.
lit::parallel::LitDetectorLayout::GetVirtualStation
const LitVirtualStation< T > & GetVirtualStation(unsigned char virtualStation) const
Return virtual station by index.
Definition: LitDetectorLayout.h:90
LitTrackParam.h
Track parameters data class.
lit::parallel::LitScalPixelHit::Z
fscal Z
Definition: LitScalPixelHit.h:78
lit::parallel::LitVirtualStation
Virtual detector station which stores information needed for track propagation.
Definition: LitVirtualStation.h:31
lit::parallel::LitScalTrack
Scalar track data class.
Definition: LitScalTrack.h:33
lit::parallel::LitScalTrack::GetNofHits
unsigned short GetNofHits() const
Returns number of hits in track.
Definition: LitScalTrack.h:66
lit::parallel::LitTrackFitter
void LitTrackFitter(LitScalTrack &track, const LitDetectorLayoutScal &layout)
Fast scalar track fit.
Definition: LitTrackFitter.h:25
lit::parallel::LitFieldGrid::IsEmpty
bool IsEmpty() const
Check if field was set.
Definition: LitFieldGrid.h:193
lit::parallel::LitDetectorLayout< fscal >
LitTypes.h
Header files for SSE operations.
lit::parallel::LitTrackParam< fscal >
lit::parallel::LitScalTrack::SetParamFirst
void SetParamFirst(const LitTrackParamScal &param)
Sets first track parameter.
Definition: LitScalTrack.h:96
lit::parallel::LitMaterialGrid::IsEmpty
bool IsEmpty() const
Check if material was set.
Definition: LitMaterialGrid.h:161
lit::parallel::LitRK4Extrapolation
void LitRK4Extrapolation(LitTrackParam< T > &par, T zOut, const LitFieldGrid &field1, const LitFieldGrid &field2, const LitFieldGrid &field3)
Definition: LitExtrapolation.h:73
LitScalPixelHit.h
Base class for scalar pixel hits.
lit::parallel::LitScalPixelHit::stationId
unsigned char stationId
Definition: LitScalPixelHit.h:76
lit::parallel::LitVirtualStation::GetMaterial
const LitMaterialGrid & GetMaterial() const
Definition: LitVirtualStation.h:51
LitFiltration.h
LitDetectorLayout.h
Detector layout class.
lit::parallel::LitVirtualStation::GetZ
T GetZ() const
Definition: LitVirtualStation.h:53
lit::parallel::LitScalTrack::GetParamFirst
const LitTrackParamScal & GetParamFirst() const
Returns first parameter of the track.
Definition: LitScalTrack.h:90
lit::parallel::LitScalTrack::SetParamLast
void SetParamLast(const LitTrackParamScal &param)
Sets last track parameter.
Definition: LitScalTrack.h:110
lit::parallel::LitVirtualStation::GetField
const LitFieldGrid & GetField() const
Definition: LitVirtualStation.h:52
lit::parallel::LitDetectorLayout::GetNofVirtualStations
unsigned char GetNofVirtualStations() const
Return number of virtual stations.
Definition: LitDetectorLayout.h:71
lit::parallel::LitLineExtrapolation
void LitLineExtrapolation(LitTrackParam< T > &par, T zOut)
Line track extrapolation for the field free regions.
Definition: LitExtrapolation.h:37
lit::parallel::LitDetectorLayout::GetStation
const LitStation< T > & GetStation(unsigned char station) const
Return station by index.
Definition: LitDetectorLayout.h:80
lit
Definition: LitTrackFinderNNVecElectron.h:19