36#include "FairDetector.h"
37#include "FairRootManager.h"
41#include "TClonesArray.h"
46#include <boost/functional/hash.hpp>
54#include <unordered_map>
93 boost::hash_combine(res, key.
fFile);
94 boost::hash_combine(res, key.
fEntry);
95 boost::hash_combine(res, key.
fIndex);
115 using DFSET = std::set<std::pair<int, int>>;
153 CbmL1(
const char* name, Int_t verbose = 1, Int_t performance = 0);
176 virtual InitStatus
Init();
179 virtual InitStatus
ReInit();
247 switch (detectorID) {
248 case ca::EDetectorID::kMvd:
return "MVD";
249 case ca::EDetectorID::kSts:
return "STS";
250 case ca::EDetectorID::kMuch:
return "MuCh";
251 case ca::EDetectorID::kTrd:
return "TRD";
252 case ca::EDetectorID::kTof:
return "TOF";
253 case ca::EDetectorID::END:
break;
280 LOG(warning) <<
"CbmL1::SetMvdMaterialBudgetFileName() is obsolete and will be deleted soon, don't call it\n"
281 <<
" ! The material budget files are not used anymore !";
287 LOG(warning) <<
"CbmL1::SetStsMaterialBudgetFileName() is obsolete and will be deleted soon, don't call it\n"
288 <<
" ! The material budget files are not used anymore !";
294 LOG(warning) <<
"CbmL1::SetMuchMaterialBudgetFileName() is obsolete and will be deleted soon, don't call it\n"
295 <<
" ! The material budget files are not used anymore !";
301 LOG(warning) <<
"CbmL1::SetTrdMaterialBudgetFileName() is obsolete and will be deleted soon, don't call it\n"
302 <<
" ! The material budget files are not used anymore !";
308 LOG(warning) <<
"CbmL1::SetTofMaterialBudgetFileName() is obsolete and will be deleted soon, don't call it\n"
309 <<
" ! The material budget files are not used anymore !";
333 template<ca::EDetectorID DetId>
415 std::unique_ptr<cbm::ca::TimeSliceReader>
fpTSReader =
nullptr;
488 "CbmL1::fvHitDebugInfo"};
Input-output data manager for L1 tracking algorithm.
Input data management class for the CA tracking algorithm (header)
CA Tracking monitor class.
CA Tracking performance interface for CBM (header)
Time-slice/event reader for CA tracker in CBM (header)
Implementation of L1DetectorID enum class for CBM.
A class to collect statistics for kf::MaterialMap.
Class characterising one event by a collection of links (indices) to data objects,...
@ Param
Parameter initialization (when algorithm execution is not required)
@ Full
Full initialization (default)
std::shared_ptr< ca::DataManager > fpIODataManager
Input-output data manager.
bool fMatBudgetParallelProjection
int fNStations
number of total active detector stations
void SetMvdMaterialBudgetFileName(const TString &)
Obsolete setters to be removed.
void SetInitMode(EInitMode mode)
Sets initialization mode.
void SetMaterialBudgetNrays(int nRaysPerDimension)
Sets material budget n rays per dimansion in each bin.
static CbmL1 * Instance()
Pointer to CbmL1 instance.
TH1F * fTimeHisto[fNTimeHistos]
friend class L1AlgoEfficiencyPerformance
void Reconstruct(CbmEvent *event=nullptr)
double fTrackingTime
time of track finding procedure
std::string fInputDataFilename
File name to read/write input hits.
std::vector< cbm::algo::kf::MaterialMonitor > fMaterialMonitor
Material monitors for each material budget map.
static const int fNGhostHistos
void WriteHistosCurFile(TObject *obj)
const auto & GetQaHits() const
void EfficienciesPerformance(bool doFinish=kFALSE)
Calculates tracking efficiencies (counters)
double fTargetX
target position X
std::tuple< int, std::vector< int > > MatchHitWithMc(int iHit) const
Matches hit with MC point.
void SetMaterialBudgetNbins(int nBinsPerDimension)
Sets material budget binning.
TTree * fpMcTripletsTree
Tree to save MC-triplets.
void SetTrdMaterialBudgetFileName(const TString &)
Sets material budget file name for TRD.
void SetTofMaterialBudgetFileName(const TString &)
Sets material budget file name for TOF.
std::string fsMcTripletsOutputFilename
Name of file to save MC-triplets tree.
static std::istream & eatwhite(std::istream &is)
void DumpMaterialToFile(TString fileName)
cbm::ca::tools::MCData fMCData
MC Data object.
void Fill_vMCTracks()
Fills the fvMCTracks vector and the fmMCTracksMap.
double fMatBudgetPitch
material budget minimal bin size in cm
void WriteSTAPParamObject()
Writes initialized L1Parameters object to file "".
void ReadSTAPPerfInputData()
void SetConfigUser(const char *path)
Sets user configuration filename.
static CbmL1 * fpInstance
Instance of CbmL1.
virtual InitStatus Init()
Defines action in the beginning of the run (initialization)
cbm::ca::DetIdArr_t< std::set< int > > fvmDisabledStationIDs
CbmL1()
Default constructor.
void WriteSTAPAlgoInputData(int iJob=0)
void DisableTrackingStation(ca::EDetectorID detID, int iSt)
Disables tracking station for a given detector subsystem.
std::unique_ptr< cbm::ca::MCModule > fpMCModule
MC module.
void ReadSTAPAlgoInputData(int iJob=0)
ca::InitManager * GetInitManager()
Gets a pointer to L1InitManager (for an access in run_reco.C)
int fSTAPDataMode
Option to work with files for the standalone mode.
ca::Vector< CbmL1HitId > fvExternalHits
Array of hits.
ca::InitManager fInitManager
Tracking parameters data manager.
double fTargetZ
target position Z
Int_t fPerformance
performance mode: 0 - w\o perf. 1 - L1-Efficiency definition. 2 - QA-Eff.definition
int fEventNo
Current number of event/TS.
ca::Framework * fpAlgo
Pointer to the L1 track finder algorithm.
std::string fsInputSearchWindowsFilename
File name to read search windows.
void SetInputSearchWindowFilename(const char *filename)
Sets a name for the input search window file If the filename is not defined, a default track finder w...
CbmL1(const CbmL1 &)=delete
Copy constructor.
ca::TrackingMonitor fMonitor
Tracking monitor.
void FieldIntegralCheck()
void WriteSTAPPerfInputData()
static constexpr std::string_view kSTAPParamSuffix
Extension for IO of the L1Parameters object.
EInitMode fInitMode
Initialization mode.
ca::Vector< CbmL1Track > fvRecoTracks
Reconstructed tracks container.
static constexpr std::string_view kSTAPAlgoIDataDir
Name of subdirectory for handling ca::InputData objects.
bool fDoSafeMaterialInitialization
void FillFitHistos(cbm::algo::kf::TrackParamV &tr, const cbm::ca::tools::MCPoint &mc, bool isTimeFitted, TH1F *h[])
void IdealTrackFinder()
Runs ideal track finder: copies all MC-tracks into reconstructed tracks.
void SetParameterFilename(const char *filename)
Sets a name for the ca-parameter file.
void SetOutputMcTripletsTreeFilename(const char *filename)
Sets output file for MC triplets tree If the filename is empty string, tree is not filled.
void TrackFitPerformance()
double fTargetY
target position Y
TString fSTAPParamFile
Name of the parameter file (generated automatically, if not provided manually)
TFile * fPerfFile
Array of local indices of disabled tracking stations.
void Finish()
Defines action in the end of the run (saves results)
CbmL1 & operator=(CbmL1 &&)=delete
Move assignment operator.
TString fSTAPDataPrefix
Name of input/output file prefix. The prefix is defined by output TTree file.
CbmL1 & operator=(const CbmL1 &)=delete
Copy assignment operator.
CbmL1(CbmL1 &&)=delete
Move constructor.
bool fExtrapolateToTheEndOfSTS
ca::Vector< CbmL1HitDebugInfo > fvHitDebugInfo
Container of hits with extended information.
int fMatBudgetNbins
n bins in mat budget maps (fMatBudgetNbins x fMatBudgetNbins)
ca::TrackingMode fTrackingMode
Tracking mode.
void SetSafeMaterialInitialization(bool val=true)
void DumpMCTripletsToTree()
std::unique_ptr< cbm::ca::TimeSliceReader > fpTSReader
event/TS reader
void DefineSTAPNames(const char *dirName)
Defines names for output in STAP mode.
static constexpr const char * GetDetectorName(ca::EDetectorID detectorID)
Utility to map the L1DetectorID items into detector names.
std::set< std::pair< int, int > > DFSET
void SetMaterialBudgetParallelProjection()
static constexpr std::string_view kSTAPSetupSuffix
void SetOutputConfigName(const char *filename)
Sets a name for the output configuration file.
int fMatBudgetNrays
material budget n rays per dimansion in each bin
void HistoPerformance()
Fills performance histograms.
void SetMaterialBudgetPitch(double pitchCm)
Sets material budget minimal bin size in cm.
void ReadSTAPParamObject()
void SetRandomSeed(unsigned int seed)
Sets random seed to CA internal random generator.
const cbm::ca::tools::MCData & GetMCData() const
Gets reference to MC data object.
TString fSTAPDataDir
Name of input/output directory for running in a STAP mode.
TH1F * fGhostHisto[fNGhostHistos]
void SetExtrapolateToTheEndOfSTS(bool b)
void SetMuchMaterialBudgetFileName(const TString &)
Sets material budget file name for MuCh.
static void writedir2current(TObject *obj)
static constexpr std::string_view kSTAPAlgoIDataSuffix
int fNofRecoTracks
Total number of reconstructed tracks.
static const int fNTimeHistos
void SetStsMaterialBudgetFileName(const TString &)
Sets material budget file name for STS.
static double boundedGaus(double sigma)
virtual InitStatus ReInit()
Reruns the initialization.
TFile * fpMcTripletsOutFile
File to save MC-triplets tree.
Access to a MC data branch for time-based analysis.
Data class with information on a STS local track.
A CA Parameters object initialization class.
void SetConfigUser(const std::string &userConfig)
Sets user configuration file.
void SetRandomSeed(unsigned int seed)
Sets pseudo-random numbers generator seed.
void SetOutputConfigName(const std::string &filename)
Sets a name of the output configuration file.
A monitor specialization for cbm::algo::ca::Framework class.
TODO: SZh 8.11.2022: add selection of parameterisation.
EDetectorID
Enumeration for the tracking detector subsystems in CBM-CA.
Internal structure to handle link keys.
int32_t fFile
index of link file
int32_t fEntry
index of link entry
int32_t fIndex
index of point/track, saved to link
CbmL1LinkKey(int32_t index, int32_t entry, int32_t file)
Constructor from links.
bool operator==(const CbmL1LinkKey &other) const
std::size_t operator()(const CbmL1LinkKey &key) const