CbmRoot
Loading...
Searching...
No Matches
CbmLitToolFactory.cxx
Go to the documentation of this file.
1/* Copyright (C) 2008-2019 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Andrey Lebedev [committer] */
4
12
13#include "FairRunAna.h"
14#include "base/CbmLitMapField.h"
15#include "base/CbmLitPtrTypes.h"
34
35#include <boost/assign/list_of.hpp>
36
37#include <cassert>
38
39using boost::assign::list_of;
40
42
44
46{
47 assert(name == "line" || name == "rk4" || name == "lit");
48 if (name == "line") {
50 }
51 else if (name == "rk4") {
52 std::shared_ptr<CbmLitField> field(new CbmLitMapField(FairRunAna::Instance()->GetField()));
53 //CbmLitField* field = new CbmLitMapField(FairRunAna::Instance()->GetField());
55 }
56 else if (name == "lit") {
58 }
59 return TrackExtrapolatorPtr();
60}
61
63{
64 assert(name == "lit" || name == "rk4" || name == "line");
65 if (name == "lit") {
67 }
68 else if (name == "rk4") {
70 }
71 else if (name == "line") {
73 }
74 return TrackPropagatorPtr();
75}
76
78{
79 assert(name == "kalman");
80 if (name == "kalman") {
82 }
83 return TrackUpdatePtr();
84}
85
87{
88 assert(name == "lit_kalman" || name == "kalman_smoother");
89 if (name == "lit_kalman") {
91 }
92 else if (name == "kalman_smoother") {
94 }
95 return TrackFitterPtr();
96}
97
99{
100 assert(name == "empty" || name == "momentum" || name == "momentum_seed" || name == "chi_square"
101 || name == "much_final" || name == "trd_final");
102 if (name == "empty") {
104 }
105 else if (name == "momentum") {
107 momSelection->SetMinMomentum(0.1);
108 return TrackSelectionPtr(momSelection);
109 }
110 else if (name == "momentum_seed") {
112 momSelection->SetMinMomentum(0.1);
113 return TrackSelectionPtr(momSelection);
114 }
115 else if (name == "chi_square") {
117 chiSqSelection->SetMaxChiSq(30.);
118 return TrackSelectionPtr(chiSqSelection);
119 }
120 else if (name == "much_final") {
122 muchSelection->SetNofSharedHits(3);
123 return TrackSelectionPtr(muchSelection);
124 }
125 else if (name == "trd_final") {
127 trdSelection->SetNofSharedHits(3);
128 return TrackSelectionPtr(trdSelection);
129 }
130 return TrackSelectionPtr();
131}
132
134{
135 assert(name == "e_nn" || name == "e_branch" || name == "mu_nn" || name == "mu_branch" || name == "mvd_nn");
136 if (name == "e_nn") {
137 CbmLitTrackFinderNN* trdFinderNN = new CbmLitTrackFinderNN();
138 trdFinderNN->SetSeedSelection(CreateTrackSelection("momentum"));
139 trdFinderNN->SetFinalSelection(CreateTrackSelection("trd_final"));
140 trdFinderNN->SetPropagator(CreateTrackPropagator("lit"));
141 trdFinderNN->SetFilter(CreateTrackUpdate("kalman"));
142 trdFinderNN->SetNofStations(CbmLitTrackingGeometryConstructor::Instance()->GetNofMuchTrdStations());
143 trdFinderNN->SetNofIterations(1);
144 trdFinderNN->SetMaxNofMissingHits(list_of(4));
145 trdFinderNN->SetPDG(list_of(211));
146 trdFinderNN->SetChiSqStripHitCut(list_of(9.));
147 trdFinderNN->SetChiSqPixelHitCut(list_of(25.));
148 trdFinderNN->SetSigmaCoef(list_of(5.));
149 return TrackFinderPtr(trdFinderNN);
150 }
151 else if (name == "e_branch") {
152 CbmLitTrackFinderBranch* trdFinderBranch = new CbmLitTrackFinderBranch();
153 trdFinderBranch->SetSeedSelection(CreateTrackSelection("momentum"));
154 trdFinderBranch->SetFinalSelection(CreateTrackSelection("trd_final"));
155 trdFinderBranch->SetPropagator(CreateTrackPropagator("lit"));
156 trdFinderBranch->SetFilter(CreateTrackUpdate("kalman"));
157 trdFinderBranch->SetNofStations(CbmLitTrackingGeometryConstructor::Instance()->GetNofMuchTrdStations());
158 trdFinderBranch->SetNofIterations(1);
159 trdFinderBranch->SetMaxNofMissingHits(list_of(4));
160 trdFinderBranch->SetPDG(list_of(211));
161 trdFinderBranch->SetChiSqStripHitCut(list_of(9.));
162 trdFinderBranch->SetChiSqPixelHitCut(list_of(25.));
163 trdFinderBranch->SetSigmaCoef(list_of(5.));
164 return TrackFinderPtr(trdFinderBranch);
165 }
166 else if (name == "mu_nn") {
167 CbmLitTrackFinderNN* muchFinderNN = new CbmLitTrackFinderNN();
168 muchFinderNN->SetSeedSelection(CreateTrackSelection("momentum_seed"));
169 muchFinderNN->SetFinalSelection(CreateTrackSelection("much_final"));
170 muchFinderNN->SetPropagator(CreateTrackPropagator("lit"));
171 muchFinderNN->SetFilter(CreateTrackUpdate("kalman"));
172 muchFinderNN->SetNofStations(CbmLitTrackingGeometryConstructor::Instance()->GetNofMuchTrdStations());
173 muchFinderNN->SetNofIterations(1);
174 muchFinderNN->SetMaxNofMissingHits(list_of(4));
175 muchFinderNN->SetPDG(list_of(13));
176 muchFinderNN->SetChiSqStripHitCut(list_of(9.));
177 muchFinderNN->SetChiSqPixelHitCut(list_of(25.));
178 muchFinderNN->SetSigmaCoef(list_of(5.));
179 return TrackFinderPtr(muchFinderNN);
180 }
181 else if (name == "mu_branch") {
182 CbmLitTrackFinderBranch* muchFinderBranch = new CbmLitTrackFinderBranch();
183 muchFinderBranch->SetSeedSelection(CreateTrackSelection("momentum_seed"));
184 muchFinderBranch->SetFinalSelection(CreateTrackSelection("much_final"));
185 muchFinderBranch->SetPropagator(CreateTrackPropagator("lit"));
186 muchFinderBranch->SetFilter(CreateTrackUpdate("kalman"));
187 muchFinderBranch->SetNofStations(CbmLitTrackingGeometryConstructor::Instance()->GetNofMuchTrdStations());
188 muchFinderBranch->SetNofIterations(1);
189 muchFinderBranch->SetMaxNofMissingHits(list_of(4));
190 muchFinderBranch->SetPDG(list_of(13));
191 muchFinderBranch->SetChiSqStripHitCut(list_of(9.));
192 muchFinderBranch->SetChiSqPixelHitCut(list_of(25.));
193 muchFinderBranch->SetSigmaCoef(list_of(5.));
194 return TrackFinderPtr(muchFinderBranch);
195 }
196 else if (name == "mvd_nn") {
197 CbmLitTrackFinderNN* mvdFinderNN = new CbmLitTrackFinderNN();
198 mvdFinderNN->SetSeedSelection(CreateTrackSelection("empty"));
199 mvdFinderNN->SetFinalSelection(CreateTrackSelection("empty"));
200 mvdFinderNN->SetPropagator(CreateTrackPropagator("rk4"));
201 mvdFinderNN->SetFilter(CreateTrackUpdate("kalman"));
202 mvdFinderNN->SetNofStations(CbmLitTrackingGeometryConstructor::Instance()->GetNofMvdStations());
203 mvdFinderNN->SetNofIterations(1);
204 mvdFinderNN->SetMaxNofMissingHits(list_of(1));
205 mvdFinderNN->SetPDG(list_of(211));
206 mvdFinderNN->SetChiSqStripHitCut(list_of(9.));
207 mvdFinderNN->SetChiSqPixelHitCut(list_of(15.));
208 mvdFinderNN->SetSigmaCoef(list_of(5.));
209 return TrackFinderPtr(mvdFinderNN);
210 }
211 return TrackFinderPtr();
212}
213
215{
216 assert(name == "tof_nearest_hit" || name == "tof_all_hits");
217 if (name == "tof_nearest_hit") {
220 nhMerger->SetLinePropagator(CreateTrackPropagator("line"));
221 nhMerger->SetFilter(CreateTrackUpdate("kalman"));
222 nhMerger->SetPDG(211);
223 nhMerger->SetChiSqCut(-1.); //50.); //13.86);
224 return HitToTrackMergerPtr(nhMerger);
225 }
226 else if (name == "tof_all_hits") {
229 nhMerger->SetLinePropagator(CreateTrackPropagator("line"));
230 nhMerger->SetFilter(CreateTrackUpdate("kalman"));
231 nhMerger->SetPDG(211);
232 nhMerger->SetChiSqCut(50.); //13.86);
233 return HitToTrackMergerPtr(nhMerger);
234 }
235 return HitToTrackMergerPtr();
236}
Hit-to-track merging in TOF detector attaching all hits in the validation region.
"Clever" track extrapolation.
Interface for accessing the magnetic field.
Implementation of Kalman smoother algorithm.
Hit-to-track merging in TOF detector using nearest hit approach.
Typedefs for algorithm interfaces.
Tool factory for creation of littrack algorithms.
Track reconstruction using branching method.
Implementation of nearest neighbor tracking algorithm.
Implementation of Kalman Filter track fit.
Track selection for MUCH.
Track selection for TRD.
Tracking geometry constructor.
boost::shared_ptr< CbmLitTrackFitter > TrackFitterPtr
boost::shared_ptr< CbmLitTrackFinder > TrackFinderPtr
boost::shared_ptr< CbmLitTrackPropagator > TrackPropagatorPtr
boost::shared_ptr< CbmLitTrackUpdate > TrackUpdatePtr
boost::shared_ptr< CbmLitTrackSelection > TrackSelectionPtr
boost::shared_ptr< CbmLitHitToTrackMerger > HitToTrackMergerPtr
boost::shared_ptr< CbmLitTrackExtrapolator > TrackExtrapolatorPtr
void SetFilter(TrackUpdatePtr filter)
void SetLinePropagator(TrackPropagatorPtr propagator)
void SetChiSqCut(litfloat chiSqCut)
void SetFieldPropagator(TrackPropagatorPtr propagator)
Implementation of Kalman smoother algorithm.
void SetLinePropagator(TrackPropagatorPtr propagator)
void SetFieldPropagator(TrackPropagatorPtr propagator)
void SetChiSqCut(litfloat chiSqCut)
void SetFilter(TrackUpdatePtr filter)
static TrackFinderPtr CreateTrackFinder(const string &name)
Create track selection tool by name.
static HitToTrackMergerPtr CreateHitToTrackMerger(const string &name)
Create hot to track merge tool by name.
static TrackPropagatorPtr CreateTrackPropagator(const string &name)
Create track propagation tool by name.
static TrackUpdatePtr CreateTrackUpdate(const string &name)
Create track update tool by name.
static TrackSelectionPtr CreateTrackSelection(const string &name)
Create track selection tool by name.
CbmLitToolFactory()
Constructor. Constructor is protected since singleton pattern is used. Pointer to the object is retur...
static TrackExtrapolatorPtr CreateTrackExtrapolator(const string &name)
Create track extrapolation tool by name.
static TrackFitterPtr CreateTrackFitter(const string &name)
Create track fit tool by name.
virtual ~CbmLitToolFactory()
Destructor.
void SetPDG(const vector< Int_t > &pdg)
void SetNofIterations(Int_t nofIterations)
void SetMaxNofMissingHits(const vector< Int_t > &maxNofMissingHits)
void SetSeedSelection(TrackSelectionPtr seedSelection)
void SetChiSqStripHitCut(const vector< litfloat > &chiSqStripHitCut)
void SetChiSqPixelHitCut(const vector< litfloat > &chiSqPixelHitCut)
void SetNofStations(Int_t nofStations)
void SetSigmaCoef(const vector< litfloat > &sigmaCoef)
void SetPropagator(TrackPropagatorPtr propagator)
void SetFinalSelection(TrackSelectionPtr finalSelection)
void SetFilter(TrackUpdatePtr filter)
void SetPropagator(TrackPropagatorPtr propagator)
void SetPDG(const vector< Int_t > &pdg)
void SetMaxNofMissingHits(const vector< Int_t > &maxNofMissingHits)
void SetNofStations(Int_t nofStations)
void SetChiSqPixelHitCut(const vector< litfloat > &chiSqPixelHitCut)
void SetChiSqStripHitCut(const vector< litfloat > &chiSqStripHitCut)
void SetFilter(TrackUpdatePtr filter)
void SetNofIterations(Int_t nofIterations)
void SetSeedSelection(TrackSelectionPtr seedSelection)
void SetFinalSelection(TrackSelectionPtr finalSelection)
void SetSigmaCoef(const vector< litfloat > &sigmaCoef)
Implementation of Kalman Filter track fit.
void SetMaxChiSq(litfloat maxChiSq)
void SetMinMomentum(litfloat minMomentum)
void SetNofSharedHits(Int_t nofHits)
static CbmLitTrackingGeometryConstructor * Instance()
Return pointer to singleton object.