CbmRoot
CbmLitToolFactory.cxx
Go to the documentation of this file.
1 
8 #include "base/CbmLitMapField.h"
9 #include "base/CbmLitPtrTypes.h"
19 #include "interface/CbmLitField.h"
28 
29 #include "FairRunAna.h"
30 
31 #include <cassert>
32 
33 #include <boost/assign/list_of.hpp>
34 
35 using boost::assign::list_of;
36 
38 
40 
43  assert(name == "line" || name == "rk4" || name == "lit");
44  if (name == "line") {
46  } else if (name == "rk4") {
47  std::shared_ptr<CbmLitField> field(
48  new CbmLitMapField(FairRunAna::Instance()->GetField()));
49  //CbmLitField* field = new CbmLitMapField(FairRunAna::Instance()->GetField());
51  } else if (name == "lit") {
53  }
54  return TrackExtrapolatorPtr();
55 }
56 
58 CbmLitToolFactory::CreateTrackPropagator(const std::string& name) {
59  assert(name == "lit" || name == "rk4" || name == "line");
60  if (name == "lit") {
61  return TrackPropagatorPtr(
63  } else if (name == "rk4") {
64  return TrackPropagatorPtr(
66  } else if (name == "line") {
67  return TrackPropagatorPtr(
69  }
70  return TrackPropagatorPtr();
71 }
72 
74  assert(name == "kalman");
75  if (name == "kalman") { return TrackUpdatePtr(new CbmLitKalmanFilter()); }
76  return TrackUpdatePtr();
77 }
78 
80  assert(name == "lit_kalman" || name == "kalman_smoother");
81  if (name == "lit_kalman") {
83  CreateTrackPropagator("lit"), CreateTrackUpdate("kalman")));
84  } else if (name == "kalman_smoother") {
86  }
87  return TrackFitterPtr();
88 }
89 
91 CbmLitToolFactory::CreateTrackSelection(const std::string& name) {
92  assert(name == "empty" || name == "momentum" || name == "momentum_seed"
93  || name == "chi_square" || name == "much_final"
94  || name == "trd_final");
95  if (name == "empty") {
97  } else if (name == "momentum") {
99  momSelection->SetMinMomentum(0.1);
100  return TrackSelectionPtr(momSelection);
101  } else if (name == "momentum_seed") {
103  momSelection->SetMinMomentum(0.1);
104  return TrackSelectionPtr(momSelection);
105  } else if (name == "chi_square") {
106  CbmLitTrackSelectionCuts* chiSqSelection = new CbmLitTrackSelectionCuts();
107  chiSqSelection->SetMaxChiSq(30.);
108  return TrackSelectionPtr(chiSqSelection);
109  } else if (name == "much_final") {
110  CbmLitTrackSelectionMuch* muchSelection = new CbmLitTrackSelectionMuch();
111  muchSelection->SetNofSharedHits(3);
112  return TrackSelectionPtr(muchSelection);
113  } else if (name == "trd_final") {
114  CbmLitTrackSelectionTrd* trdSelection = new CbmLitTrackSelectionTrd();
115  trdSelection->SetNofSharedHits(3);
116  return TrackSelectionPtr(trdSelection);
117  }
118  return TrackSelectionPtr();
119 }
120 
122  assert(name == "e_nn" || name == "e_branch" || name == "mu_nn"
123  || name == "mu_branch" || name == "mvd_nn");
124  if (name == "e_nn") {
125  CbmLitTrackFinderNN* trdFinderNN = new CbmLitTrackFinderNN();
126  trdFinderNN->SetSeedSelection(CreateTrackSelection("momentum"));
127  trdFinderNN->SetFinalSelection(CreateTrackSelection("trd_final"));
128  trdFinderNN->SetPropagator(CreateTrackPropagator("lit"));
129  trdFinderNN->SetFilter(CreateTrackUpdate("kalman"));
130  trdFinderNN->SetNofStations(
131  CbmLitTrackingGeometryConstructor::Instance()->GetNofMuchTrdStations());
132  trdFinderNN->SetNofIterations(1);
133  trdFinderNN->SetMaxNofMissingHits(list_of(4));
134  trdFinderNN->SetPDG(list_of(211));
135  trdFinderNN->SetChiSqStripHitCut(list_of(9.));
136  trdFinderNN->SetChiSqPixelHitCut(list_of(25.));
137  trdFinderNN->SetSigmaCoef(list_of(5.));
138  return TrackFinderPtr(trdFinderNN);
139  } else if (name == "e_branch") {
140  CbmLitTrackFinderBranch* trdFinderBranch = new CbmLitTrackFinderBranch();
141  trdFinderBranch->SetSeedSelection(CreateTrackSelection("momentum"));
142  trdFinderBranch->SetFinalSelection(CreateTrackSelection("trd_final"));
143  trdFinderBranch->SetPropagator(CreateTrackPropagator("lit"));
144  trdFinderBranch->SetFilter(CreateTrackUpdate("kalman"));
145  trdFinderBranch->SetNofStations(
146  CbmLitTrackingGeometryConstructor::Instance()->GetNofMuchTrdStations());
147  trdFinderBranch->SetNofIterations(1);
148  trdFinderBranch->SetMaxNofMissingHits(list_of(4));
149  trdFinderBranch->SetPDG(list_of(211));
150  trdFinderBranch->SetChiSqStripHitCut(list_of(9.));
151  trdFinderBranch->SetChiSqPixelHitCut(list_of(25.));
152  trdFinderBranch->SetSigmaCoef(list_of(5.));
153  return TrackFinderPtr(trdFinderBranch);
154  } else if (name == "mu_nn") {
155  CbmLitTrackFinderNN* muchFinderNN = new CbmLitTrackFinderNN();
156  muchFinderNN->SetSeedSelection(CreateTrackSelection("momentum_seed"));
157  muchFinderNN->SetFinalSelection(CreateTrackSelection("much_final"));
158  muchFinderNN->SetPropagator(CreateTrackPropagator("lit"));
159  muchFinderNN->SetFilter(CreateTrackUpdate("kalman"));
160  muchFinderNN->SetNofStations(
161  CbmLitTrackingGeometryConstructor::Instance()->GetNofMuchTrdStations());
162  muchFinderNN->SetNofIterations(1);
163  muchFinderNN->SetMaxNofMissingHits(list_of(4));
164  muchFinderNN->SetPDG(list_of(13));
165  muchFinderNN->SetChiSqStripHitCut(list_of(9.));
166  muchFinderNN->SetChiSqPixelHitCut(list_of(25.));
167  muchFinderNN->SetSigmaCoef(list_of(5.));
168  return TrackFinderPtr(muchFinderNN);
169  } else if (name == "mu_branch") {
170  CbmLitTrackFinderBranch* muchFinderBranch = new CbmLitTrackFinderBranch();
171  muchFinderBranch->SetSeedSelection(CreateTrackSelection("momentum_seed"));
172  muchFinderBranch->SetFinalSelection(CreateTrackSelection("much_final"));
173  muchFinderBranch->SetPropagator(CreateTrackPropagator("lit"));
174  muchFinderBranch->SetFilter(CreateTrackUpdate("kalman"));
175  muchFinderBranch->SetNofStations(
176  CbmLitTrackingGeometryConstructor::Instance()->GetNofMuchTrdStations());
177  muchFinderBranch->SetNofIterations(1);
178  muchFinderBranch->SetMaxNofMissingHits(list_of(4));
179  muchFinderBranch->SetPDG(list_of(13));
180  muchFinderBranch->SetChiSqStripHitCut(list_of(9.));
181  muchFinderBranch->SetChiSqPixelHitCut(list_of(25.));
182  muchFinderBranch->SetSigmaCoef(list_of(5.));
183  return TrackFinderPtr(muchFinderBranch);
184  } else if (name == "mvd_nn") {
185  CbmLitTrackFinderNN* mvdFinderNN = new CbmLitTrackFinderNN();
186  mvdFinderNN->SetSeedSelection(CreateTrackSelection("empty"));
187  mvdFinderNN->SetFinalSelection(CreateTrackSelection("empty"));
188  mvdFinderNN->SetPropagator(CreateTrackPropagator("rk4"));
189  mvdFinderNN->SetFilter(CreateTrackUpdate("kalman"));
190  mvdFinderNN->SetNofStations(
191  CbmLitTrackingGeometryConstructor::Instance()->GetNofMvdStations());
192  mvdFinderNN->SetNofIterations(1);
193  mvdFinderNN->SetMaxNofMissingHits(list_of(1));
194  mvdFinderNN->SetPDG(list_of(211));
195  mvdFinderNN->SetChiSqStripHitCut(list_of(9.));
196  mvdFinderNN->SetChiSqPixelHitCut(list_of(15.));
197  mvdFinderNN->SetSigmaCoef(list_of(5.));
198  return TrackFinderPtr(mvdFinderNN);
199  }
200  return TrackFinderPtr();
201 }
202 
205  assert(name == "tof_nearest_hit" || name == "tof_all_hits");
206  if (name == "tof_nearest_hit") {
208  nhMerger->SetFieldPropagator(CreateTrackPropagator("lit"));
209  nhMerger->SetLinePropagator(CreateTrackPropagator("line"));
210  nhMerger->SetFilter(CreateTrackUpdate("kalman"));
211  nhMerger->SetPDG(211);
212  nhMerger->SetChiSqCut(50.); //13.86);
213  return HitToTrackMergerPtr(nhMerger);
214  } else if (name == "tof_all_hits") {
216  nhMerger->SetFieldPropagator(CreateTrackPropagator("lit"));
217  nhMerger->SetLinePropagator(CreateTrackPropagator("line"));
218  nhMerger->SetFilter(CreateTrackUpdate("kalman"));
219  nhMerger->SetPDG(211);
220  nhMerger->SetChiSqCut(50.); //13.86);
221  return HitToTrackMergerPtr(nhMerger);
222  }
223  return HitToTrackMergerPtr();
224 }
CbmLitMapField
Definition: CbmLitMapField.h:16
CbmLitToolFactory::CreateTrackPropagator
static TrackPropagatorPtr CreateTrackPropagator(const string &name)
Create track propagation tool by name.
Definition: CbmLitToolFactory.cxx:58
CbmLitAllHitsTofMerger::SetFilter
void SetFilter(TrackUpdatePtr filter)
Definition: CbmLitAllHitsTofMerger.h:43
CbmLitRK4TrackExtrapolator.h
CbmLitTrackFinderNN::SetPropagator
void SetPropagator(TrackPropagatorPtr propagator)
Definition: CbmLitTrackFinderNN.h:49
CbmLitLineTrackExtrapolator.h
CbmLitTrackFinderBranch
Definition: CbmLitTrackFinderBranch.h:28
CbmLitTrackFinderNN::SetFilter
void SetFilter(TrackUpdatePtr filter)
Definition: CbmLitTrackFinderNN.h:52
TrackSelectionPtr
boost::shared_ptr< CbmLitTrackSelection > TrackSelectionPtr
Definition: CbmTofPtrTypes.h:25
CbmLitTrackFinderBranch::SetNofStations
void SetNofStations(Int_t nofStations)
Definition: CbmLitTrackFinderBranch.h:58
CbmLitAllHitsTofMerger::SetPDG
void SetPDG(Int_t pdg)
Definition: CbmLitAllHitsTofMerger.h:44
CbmLitTrackFinderNN::SetSeedSelection
void SetSeedSelection(TrackSelectionPtr seedSelection)
Definition: CbmLitTrackFinderNN.h:43
CbmLitTrackSelectionCuts::SetMaxChiSq
void SetMaxChiSq(litfloat maxChiSq)
Definition: CbmLitTrackSelectionCuts.h:46
CbmLitMapField.h
CbmLitTrackFinderBranch.h
Track reconstruction using branching method.
CbmLitNearestHitTofMerger.h
Hit-to-track merging in TOF detector using nearest hit approach.
CbmLitCleverTrackExtrapolator.h
"Clever" track extrapolation.
CbmLitToolFactory::~CbmLitToolFactory
virtual ~CbmLitToolFactory()
Destructor.
Definition: CbmLitToolFactory.cxx:39
CbmLitTrackFinderBranch::SetSeedSelection
void SetSeedSelection(TrackSelectionPtr seedSelection)
Definition: CbmLitTrackFinderBranch.h:51
CbmLitAllHitsTofMerger::SetFieldPropagator
void SetFieldPropagator(TrackPropagatorPtr propagator)
Definition: CbmLitAllHitsTofMerger.h:37
TrackPropagatorPtr
boost::shared_ptr< CbmLitTrackPropagator > TrackPropagatorPtr
Definition: CbmTofPtrTypes.h:23
CbmLitTrackSelectionCuts.h
CbmLitAllHitsTofMerger::SetLinePropagator
void SetLinePropagator(TrackPropagatorPtr propagator)
Definition: CbmLitAllHitsTofMerger.h:40
CbmLitTrackFinderBranch::SetNofIterations
void SetNofIterations(Int_t nofIterations)
Definition: CbmLitTrackFinderBranch.h:59
CbmLitTrackFinderNN::SetMaxNofMissingHits
void SetMaxNofMissingHits(const vector< Int_t > &maxNofMissingHits)
Definition: CbmLitTrackFinderNN.h:55
CbmLitToolFactory::CbmLitToolFactory
CbmLitToolFactory()
Constructor. Constructor is protected since singleton pattern is used. Pointer to the object is retur...
Definition: CbmLitToolFactory.cxx:37
CbmLitTrackFinderNN::SetNofStations
void SetNofStations(Int_t nofStations)
Definition: CbmLitTrackFinderNN.h:53
CbmLitTrackingGeometryConstructor.h
Tracking geometry constructor.
TrackUpdatePtr
boost::shared_ptr< CbmLitTrackUpdate > TrackUpdatePtr
Definition: CbmTofPtrTypes.h:26
CbmLitNearestHitTofMerger::SetFieldPropagator
void SetFieldPropagator(TrackPropagatorPtr propagator)
Definition: CbmLitNearestHitTofMerger.h:36
CbmLitTrackSelectionTrd::SetNofSharedHits
void SetNofSharedHits(Int_t nofHits)
Definition: CbmLitTrackSelectionTrd.h:37
CbmLitToolFactory.h
Tool factory for creation of littrack algorithms.
CbmLitTrackFinderBranch::SetFilter
void SetFilter(TrackUpdatePtr filter)
Definition: CbmLitTrackFinderBranch.h:54
CbmLitNearestHitTofMerger::SetLinePropagator
void SetLinePropagator(TrackPropagatorPtr propagator)
Definition: CbmLitNearestHitTofMerger.h:39
CbmLitField.h
Interface for accessing the magnetic field.
CbmLitTrackSelectionEmpty
Definition: CbmLitTrackSelectionEmpty.h:14
CbmLitTrackFinderNN::SetChiSqStripHitCut
void SetChiSqStripHitCut(const vector< litfloat > &chiSqStripHitCut)
Definition: CbmLitTrackFinderNN.h:59
CbmLitToolFactory::CreateTrackExtrapolator
static TrackExtrapolatorPtr CreateTrackExtrapolator(const string &name)
Create track extrapolation tool by name.
Definition: CbmLitToolFactory.cxx:42
CbmLitTrackFinderNN::SetPDG
void SetPDG(const vector< Int_t > &pdg)
Definition: CbmLitTrackFinderNN.h:58
CbmLitTrackSelectionMuch
Definition: CbmLitTrackSelectionMuch.h:14
CbmLitToolFactory::CreateTrackFitter
static TrackFitterPtr CreateTrackFitter(const string &name)
Create track fit tool by name.
Definition: CbmLitToolFactory.cxx:79
CbmLitTrackSelectionMuch.h
Track selection for MUCH.
CbmLitCleverTrackExtrapolator
Definition: CbmLitCleverTrackExtrapolator.h:21
CbmLitTrackFinderNN::SetChiSqPixelHitCut
void SetChiSqPixelHitCut(const vector< litfloat > &chiSqPixelHitCut)
Definition: CbmLitTrackFinderNN.h:62
CbmLitTrackSelectionTrd.h
Track selection for TRD.
CbmLitToolFactory::CreateTrackFinder
static TrackFinderPtr CreateTrackFinder(const string &name)
Create track selection tool by name.
Definition: CbmLitToolFactory.cxx:121
CbmLitTrackFitterImp
Implementation of Kalman Filter track fit.
Definition: CbmLitTrackFitterImp.h:20
CbmLitTrackSelectionTrd
Definition: CbmLitTrackSelectionTrd.h:14
CbmLitTrackFinderBranch::SetChiSqPixelHitCut
void SetChiSqPixelHitCut(const vector< litfloat > &chiSqPixelHitCut)
Definition: CbmLitTrackFinderBranch.h:67
CbmLitTrackSelectionEmpty.h
TrackFitterPtr
boost::shared_ptr< CbmLitTrackFitter > TrackFitterPtr
Definition: CbmTofPtrTypes.h:24
CbmLitTrackSelectionCuts::SetMinMomentum
void SetMinMomentum(litfloat minMomentum)
Definition: CbmLitTrackSelectionCuts.h:57
CbmLitLineTrackExtrapolator
Definition: CbmLitLineTrackExtrapolator.h:15
TrackExtrapolatorPtr
boost::shared_ptr< CbmLitTrackExtrapolator > TrackExtrapolatorPtr
Definition: CbmTofPtrTypes.h:22
CbmLitTrackFinderBranch::SetPropagator
void SetPropagator(TrackPropagatorPtr propagator)
Definition: CbmLitTrackFinderBranch.h:55
CbmLitNearestHitTofMerger
Definition: CbmLitNearestHitTofMerger.h:17
CbmLitTGeoTrackPropagator.h
CbmLitNearestHitTofMerger::SetChiSqCut
void SetChiSqCut(litfloat chiSqCut)
Definition: CbmLitNearestHitTofMerger.h:44
CbmLitTGeoTrackPropagator
Definition: CbmLitTGeoTrackPropagator.h:18
CbmLitTrackFinderBranch::SetChiSqStripHitCut
void SetChiSqStripHitCut(const vector< litfloat > &chiSqStripHitCut)
Definition: CbmLitTrackFinderBranch.h:64
CbmLitAllHitsTofMerger.h
Hit-to-track merging in TOF detector attaching all hits in the validation region.
CbmLitTrackFinderBranch::SetFinalSelection
void SetFinalSelection(TrackSelectionPtr finalSelection)
Definition: CbmLitTrackFinderBranch.h:48
CbmLitToolFactory::CreateTrackSelection
static TrackSelectionPtr CreateTrackSelection(const string &name)
Create track selection tool by name.
Definition: CbmLitToolFactory.cxx:91
CbmLitRK4TrackExtrapolator
Definition: CbmLitRK4TrackExtrapolator.h:24
CbmLitNearestHitTofMerger::SetPDG
void SetPDG(Int_t pdg)
Definition: CbmLitNearestHitTofMerger.h:43
CbmLitAllHitsTofMerger::SetChiSqCut
void SetChiSqCut(litfloat chiSqCut)
Definition: CbmLitAllHitsTofMerger.h:45
CbmLitTrackFinderBranch::SetMaxNofMissingHits
void SetMaxNofMissingHits(const vector< Int_t > &maxNofMissingHits)
Definition: CbmLitTrackFinderBranch.h:60
CbmLitToolFactory::CreateTrackUpdate
static TrackUpdatePtr CreateTrackUpdate(const string &name)
Create track update tool by name.
Definition: CbmLitToolFactory.cxx:73
CbmLitTrackSelectionMuch::SetNofSharedHits
void SetNofSharedHits(Int_t nofHits)
Definition: CbmLitTrackSelectionMuch.h:37
CbmLitTrackFinderBranch::SetPDG
void SetPDG(const vector< Int_t > &pdg)
Definition: CbmLitTrackFinderBranch.h:63
CbmLitAllHitsTofMerger
Definition: CbmLitAllHitsTofMerger.h:18
HitToTrackMergerPtr
boost::shared_ptr< CbmLitHitToTrackMerger > HitToTrackMergerPtr
Definition: CbmTofPtrTypes.h:30
CbmLitNearestHitTofMerger::SetFilter
void SetFilter(TrackUpdatePtr filter)
Definition: CbmLitNearestHitTofMerger.h:42
CbmLitTrackFitterIter.h
CbmLitTrackFitterImp.h
Implementation of Kalman Filter track fit.
CbmLitKalmanFilter.h
CbmLitKalmanSmoother.h
Implementation of Kalman smoother algorithm.
CbmLitPtrTypes.h
Typedefs for algorithm interfaces.
CbmLitTrackSelectionCuts
Definition: CbmLitTrackSelectionCuts.h:13
CbmLitToolFactory::CreateHitToTrackMerger
static HitToTrackMergerPtr CreateHitToTrackMerger(const string &name)
Create hot to track merge tool by name.
Definition: CbmLitToolFactory.cxx:204
CbmLitKalmanSmoother
Implementation of Kalman smoother algorithm.
Definition: CbmLitKalmanSmoother.h:20
CbmLitTrackFinderBranch::SetSigmaCoef
void SetSigmaCoef(const vector< litfloat > &sigmaCoef)
Definition: CbmLitTrackFinderBranch.h:70
CbmLitTrackingGeometryConstructor::Instance
static CbmLitTrackingGeometryConstructor * Instance()
Return pointer to singleton object.
Definition: CbmLitTrackingGeometryConstructor.cxx:55
CbmLitTrackFinderNN::SetFinalSelection
void SetFinalSelection(TrackSelectionPtr finalSelection)
Definition: CbmLitTrackFinderNN.h:46
CbmLitTrackFinderNN::SetNofIterations
void SetNofIterations(Int_t nofIterations)
Definition: CbmLitTrackFinderNN.h:54
TrackFinderPtr
boost::shared_ptr< CbmLitTrackFinder > TrackFinderPtr
Definition: CbmTofPtrTypes.h:29
CbmLitKalmanFilter
Definition: CbmLitKalmanFilter.h:19
CbmLitTrackFinderNN.h
Implementation of nearest neighbor tracking algorithm.
CbmLitTrackFinderNN
Definition: CbmLitTrackFinderNN.h:23
CbmLitTrackFinderNN::SetSigmaCoef
void SetSigmaCoef(const vector< litfloat > &sigmaCoef)
Definition: CbmLitTrackFinderNN.h:65