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