1 #ifndef ST_FWD_TRACK_MAKER_H
2 #define ST_FWD_TRACK_MAKER_H
4 #include "StChain/StMaker.h"
7 #include "GenFit/Track.h"
10 #include "FwdTrackerConfig.h"
49 const size_t MAX_TREE_ELEMENTS = 4000;
54 vector<float> fttX, fttY, fttZ;
55 vector<int> fttVolumeId;
58 vector<int> fttTrackId, fttVertexId;
62 vector<float> fstX, fstY, fstZ;
63 vector<int> fstTrackId;
66 vector<float> fcsX, fcsY, fcsZ;
71 vector<float> rcPt, rcEta, rcPhi, rcQuality;
72 vector<int> rcTrackId, rcNumFST, rcCharge, rcNumFTT, rcNumPV;
76 vector<float> mcPt, mcEta, mcPhi;
77 vector<int> mcVertexId, mcCharge;
82 vector<float> vmcX, vmcY, vmcZ;
85 vector<float> tprojX, tprojY, tprojZ;
86 vector<float> tprojPx, tprojPy, tprojPz;
87 vector<int> tprojIdD, tprojIdT;
91 vector<float> vrcX, vrcY, vrcZ;
94 vector<float> thdX, thdY, thaX, thaY, thaZ;
96 bool saveCrit =
false;
97 std::map<string, std::vector<float>> Crits;
98 std::map<string, std::vector<int>> CritTrackIds;
113 void Clear(
const Option_t *opts =
"");
115 enum { kInnerGeometry,
118 void SetConfigFile(std::string n) {
122 void LoadConfiguration();
123 void SetGenerateHistograms(
bool _genHisto ){ mGenHistograms = _genHisto; }
124 void SetGenerateTree(
bool _genTree) { mGenTree = _genTree; }
125 void SetVisualize(
bool _viz ) { mVisualize = _viz; }
127 vector<StFwdTrack*> mFwdTracks;
133 typedef std::vector<KiTrack::IHit *>
Seed_t;
137 size_t eventIndex = 0;
140 bool mGenHistograms =
false;
141 bool mGenTree =
false;
142 std::string mConfigFile;
145 std::map<std::string, TH1 *> mHistograms;
146 TFile *mTreeFile =
nullptr;
147 TTree *mTree =
nullptr;
150 bool mVisualize =
false;
151 vector<TVector3> mFttHits;
152 vector<TVector3> mFstHits;
153 vector<TVector3> mFcsClusters;
154 vector<float> mFcsClusterEnergy;
155 vector<TVector3> mFcsPreHits;
157 std::vector< genfit::GFRaveVertex * > mRaveVertices;
159 void ProcessFwdTracks();
161 void FillTrackDeltas();
168 std::shared_ptr<SiRasterizer> mSiRasterizer;
170 std::shared_ptr<ForwardTracker> mForwardTracker;
171 std::shared_ptr<FwdDataSource> mForwardData;
173 size_t loadMcTracks( std::map<
int, std::shared_ptr<McTrack>> &mcTrackMap );
175 void loadFttHits( std::map<
int, std::shared_ptr<McTrack>> &mcTrackMap, std::map<
int, std::vector<KiTrack::IHit *>> &hitMap,
int count = 0 );
176 void loadFttHitsFromStEvent( std::map<
int, std::shared_ptr<McTrack>> &mcTrackMap, std::map<
int, std::vector<KiTrack::IHit *>> &hitMap,
int count = 0 );
177 void loadFttHitsFromGEANT( std::map<
int, std::shared_ptr<McTrack>> &mcTrackMap, std::map<
int, std::vector<KiTrack::IHit *>> &hitMap,
int count = 0 );
179 void loadFstHits( std::map<
int, std::shared_ptr<McTrack>> &mcTrackMap, std::map<
int, std::vector<KiTrack::IHit *>> &hitMap,
int count = 0 );
180 void loadFstHitsFromGEANT( std::map<
int, std::shared_ptr<McTrack>> &mcTrackMap, std::map<
int, std::vector<KiTrack::IHit *>> &hitMap,
int count = 0 );
181 void loadFstHitsFromStEvent( std::map<
int, std::shared_ptr<McTrack>> &mcTrackMap, std::map<
int, std::vector<KiTrack::IHit *>> &hitMap,
int count = 0 );
187 static std::string defaultConfigIdealSim;
188 static std::string defaultConfigData;
189 std::string defaultConfig;
190 bool configLoaded =
false;
216 defaultConfig = defaultConfigData;
316 void setZeroB(
bool zeroB =
true ) { mFwdConfig.
set<
bool>(
"TrackFitter:zeroB", zeroB ); }
320 void setConstB(
bool constB =
true ) { mFwdConfig.
set<
bool>(
"TrackFitter:constB", constB ); }
332 void setTrackRefit(
bool refit =
true) { mFwdConfig.
set<
bool>(
"TrackFitter:refit", refit ); }
341 void setFitDebugLvl(
int level = 0 ) {mFwdConfig.
set<
int>(
"TrackFitter.KalmanFitterRefTrack:DebugLvl", level); }
void setConfigForIdealSim()
Setup the StFwdTrackMaker for running on Data Load the default configuration for IDEAL simulation...
void setConfigForData()
Setup the StFwdTrackMaker for running on Data Load the default configuration for Data. Note: Apply any overrides after calling this.
void setSmearMcPrimaryVertex(bool pvs=true)
Enables smearing of the MC Primary Vertex according to sigmaXY,Z.
void setZeroB(bool zeroB=true)
Set B-field to zero (for zero field running)
void setPrimaryVertexSigmaZ(double sZ)
Set the resolution for the Primary Vertex in Z sZ : sigma in Z (cm)
void setSeedFindingUseHitRemover(bool use=true)
Enable or disable the HitRemover.
void setConfigForRealisticSim()
Setup the StFwdTrackMaker for running on Data Load the default configuration for Realistic simulation...
void setFittingMaterialEffects(bool mat=true)
Enable / disable material effects Material effects in kalman filter.
void setIncludePrimaryVertexInFit(bool pvf=true)
Include or exclude the Primary Vertex in fit.
void setFttHitSource(std::string source)
Set the data source for FTT hits.
void setUseMcSeedForFit(bool mcSeed=true)
Force the use of McSeed for fit.
void setMaxFailedHitsInFit(int n=-1)
Sets the maximum number of hits that can be considered failed before the entire track fit fails...
void setSeedFindingConnectorDistance(int d=1)
Set the connector distance for track finding.
void setUseFstRasteredGeantHits(bool use=true)
Enable or disable the Fst Rasterizer.
void setSeedFindingUseSubsetNN(bool use=true)
Enable or disable the SubsetNN.
void setConstB(bool constB=true)
Set B-field to constant (even outside of TPC)
void setTrackFittingOff()
Turn off track fitting Useful if you want to speed up the run but dont need fitting (testing seed fin...
void setSeedFindingWithFtt()
Use Ftt hits in the Seed Finding.
void set(std::string path, T v)
Writes a value of type T to the map Uses convertTo<T> to convert type T to a string rep...
void setSeedFindingNumInterations(int n=1)
Set the number of track finding iterations.
void setFstRasterPhi(double phi=0.00409)
Set the resolution in phi for rasterizing FST hits (from fast sim) Only used when the Rasterizer is e...
void setFitMaxIterations(int n=4)
Sets Max fit iterations before failing.
void setFstRasterR(double r=3.0)
Set the resolution in R for rasterizing FST hits (from fast sim) Only used when the Rasterizer is ena...
void setSeedFindingMinHitsOnTrack(int n=3)
Enable or disable the SubsetNN.
void setUseTruthSeedFinding(bool use=true)
Enable or disable the Truth Seed finding.
void setOutputFilename(std::string fn)
Set the filename for output ROOT file.
void setFitDebugLvl(int level=0)
Sets Fitter debug level.
void setTrackRefit(bool refit=true)
Sets the tracking to refit This adds compatible hits from whichever detector was NOT used in seed fin...
void setSeedFindingNumPhiSlices(int n=8)
Set the number of phi slices to split the track iterations into.
void setFitMinIterations(int n=1)
Sets Min fit iterations before converging.
void setPrimaryVertexSigmaXY(double sXY)
Set the resolution for the Primary Vertex in XY sXY : sigma in XY (cm)
void setSeedFindingWithFst()
Use Fst hits in the Seed Finding.