CbmRoot
Loading...
Searching...
No Matches
cbm::algo::RecoSetup Class Reference

An instance of reconstruction setup unit interfaces for online/offline data reconstruction. More...

#include <RecoSetup.h>

Public Member Functions

 RecoSetup ()=default
 Default constructor.
 
 RecoSetup (const std::string &filename)
 Constructor from parameters.
 
template<class Visitor>
void ForEachOptUnit (Visitor &&visitor) const
 A for-each method, which is applied to each unit as an std::optional<> (constant access)
 
template<class Visitor>
void ForEachOptUnit (Visitor &&visitor)
 A for-each method, which is applied to each unit as an std::optional<> (mutable access)
 
template<class Visitor>
void ForEachUnit (Visitor &&visitor) const
 A for-each method, which is applied to each unit, if it has a value (constant access)
 
template<class Visitor>
void ForEachUnit (Visitor &&visitor)
 A for-each method, which is applied to each unit, if it has a value (mutable access)
 
template<ECbmModuleId ModuleId>
const RecoSetupUnit_t< ModuleId > * Get () const
 Access to a reconstruction setup unit.
 
const much::RecoSetupUnitGetMuch () const
 Access to MuCh reconstruction setup unit.
 
const mvd::RecoSetupUnitGetMvd () const
 Access to MVD reconstruction setup unit.
 
const sts::RecoSetupUnitGetSts () const
 Access to STS reconstruction setup unit.
 
const tof::RecoSetupUnitGetTof () const
 Access to TOF reconstruction setup unit.
 
const trd::RecoSetupUnitGetTrd () const
 Access to TRD reconstruction setup unit.
 
template<ECbmModuleId ModuleId>
bool Has () const
 Checks, if a setup unit is available (compile-time)
 
bool Has (ECbmModuleId moduleId) const
 Checks, if a setup unit is available (run-time)
 
bool HasMuch () const
 Checks, if the MuCh reconstruction setup unit is available.
 
bool HasMvd () const
 Checks, if the MVD reconstruction setup unit is available.
 
bool HasSts () const
 Checks, if the STS reconstruction setup unit is available.
 
bool HasTof () const
 Checks, if the TOF reconstruction setup unit is available.
 
bool HasTrd () const
 Checks, if the TRD reconstruction setup unit is available.
 
void SetMuch (much::RecoSetupUnit much)
 Defines MuCh reconstruction setup unit.
 
void SetMvd (mvd::RecoSetupUnit mvd)
 Defines STS reconstruction setup unit.
 
void SetSts (sts::RecoSetupUnit sts)
 Defines STS reconstruction setup unit.
 
void SetTof (tof::RecoSetupUnit tof)
 Defines TOF reconstruction setup unit.
 
void SetTrd (trd::RecoSetupUnit trd)
 Defines TRD reconstruction setup unit.
 
std::string ToString () const
 Dumps contents to string.
 

Static Public Member Functions

static RecoSetup Load (const std::string &filename)
 Loads setup from a file.
 
static void Store (const RecoSetup &setup, const std::string &filename)
 Stores setup in a file.
 

Private Member Functions

template<class Archive>
void load (Archive &ar, const unsigned int)
 Serialization load method.
 
template<class Archive>
void save (Archive &ar, const unsigned int) const
 Serialization save method.
 
template<class Archive>
void serialize (Archive &ar, const unsigned int version)
 Serialization method.
 

Private Attributes

std::optional< mvd::RecoSetupUnitfMvd {std::nullopt}
 MVD reconstruction setup unit.
 
std::optional< sts::RecoSetupUnitfSts {std::nullopt}
 STS reconstruction setup unit.
 
std::optional< much::RecoSetupUnitfMuch {std::nullopt}
 MuCh reconstruction setup unit.
 
std::optional< trd::RecoSetupUnitfTrd {std::nullopt}
 TRD reconstruction setup unit.
 
std::optional< tof::RecoSetupUnitfTof {std::nullopt}
 TOF reconstruction setup unit.
 

Static Private Attributes

static constexpr auto kUnits
 A tuple of units (for loops)
 

Friends

class boost::serialization::access
 

Detailed Description

An instance of reconstruction setup unit interfaces for online/offline data reconstruction.

Definition at line 62 of file RecoSetup.h.

Constructor & Destructor Documentation

◆ RecoSetup() [1/2]

cbm::algo::RecoSetup::RecoSetup ( )
default

Default constructor.

Referenced by Load(), RecoSetup(), and Store().

◆ RecoSetup() [2/2]

RecoSetup::RecoSetup ( const std::string & filename)

Constructor from parameters.

Parameters
filenameA path to file containing the setup

Definition at line 24 of file RecoSetup.cxx.

References Load(), and RecoSetup().

Member Function Documentation

◆ ForEachOptUnit() [1/2]

template<class Visitor>
void cbm::algo::RecoSetup::ForEachOptUnit ( Visitor && visitor)
inline

A for-each method, which is applied to each unit as an std::optional<> (mutable access)

Template Parameters
VisitorA type of Visitor
Parameters
visitorA callable of a particular std::optional<RecoSetupUnit>

Definition at line 86 of file RecoSetup.h.

References kUnits.

◆ ForEachOptUnit() [2/2]

template<class Visitor>
void cbm::algo::RecoSetup::ForEachOptUnit ( Visitor && visitor) const
inline

A for-each method, which is applied to each unit as an std::optional<> (constant access)

Template Parameters
VisitorA type of Visitor
Parameters
visitorA callable of a particular std::optional<RecoSetupUnit>

Definition at line 77 of file RecoSetup.h.

References kUnits.

Referenced by load(), and save().

◆ ForEachUnit() [1/2]

template<class Visitor>
void cbm::algo::RecoSetup::ForEachUnit ( Visitor && visitor)
inline

A for-each method, which is applied to each unit, if it has a value (mutable access)

Template Parameters
VisitorA type of Visitor
Parameters
visitorA callable of a particular RecoSetupUnit

Definition at line 104 of file RecoSetup.h.

References kUnits.

◆ ForEachUnit() [2/2]

template<class Visitor>
void cbm::algo::RecoSetup::ForEachUnit ( Visitor && visitor) const
inline

A for-each method, which is applied to each unit, if it has a value (constant access)

Template Parameters
VisitorA type of Visitor
Parameters
visitorA callable of a particular RecoSetupUnit

Definition at line 95 of file RecoSetup.h.

References kUnits.

Referenced by cbm::ca::InputQaSetup::CreateSummary(), cbm::ca::InputQaSetup::InitQa(), and ToString().

◆ Get()

template<ECbmModuleId ModuleId>
const RecoSetupUnit_t< ModuleId > * cbm::algo::RecoSetup::Get ( ) const
inline

◆ GetMuch()

const much::RecoSetupUnit * cbm::algo::RecoSetup::GetMuch ( ) const
inline

Access to MuCh reconstruction setup unit.

Note
Returns a nullptr, if MuCh is not in setup

Definition at line 132 of file RecoSetup.h.

References fMuch, and HasMuch().

Referenced by CbmKfTrackFitter< FlagFitTime >::CreateFromGlobalTrack(), and Get().

◆ GetMvd()

const mvd::RecoSetupUnit * cbm::algo::RecoSetup::GetMvd ( ) const
inline

Access to MVD reconstruction setup unit.

Note
Returns a nullptr, if MVD is not in setup

Definition at line 136 of file RecoSetup.h.

References fMvd, and HasMvd().

Referenced by CbmKfTrackFitter< FlagFitTime >::CreateFromGlobalTrack(), and Get().

◆ GetSts()

const sts::RecoSetupUnit * cbm::algo::RecoSetup::GetSts ( ) const
inline

Access to STS reconstruction setup unit.

Note
Returns a nullptr, if STS is not in setup

Definition at line 140 of file RecoSetup.h.

References fSts, and HasSts().

Referenced by CbmKfTrackFitter< FlagFitTime >::CreateFromGlobalTrack(), CbmBbaAlignmentMcbmTask::Finish(), Get(), and CbmBbaAlignTask::Init().

◆ GetTof()

const tof::RecoSetupUnit * cbm::algo::RecoSetup::GetTof ( ) const
inline

Access to TOF reconstruction setup unit.

Note
Returns a nullptr, if TOF is not in setup

Definition at line 144 of file RecoSetup.h.

References fTof, and HasTof().

Referenced by CbmKfTrackFitter< FlagFitTime >::CreateFromGlobalTrack(), and Get().

◆ GetTrd()

const trd::RecoSetupUnit * cbm::algo::RecoSetup::GetTrd ( ) const
inline

Access to TRD reconstruction setup unit.

Note
Returns a nullptr, if TRD is not in setup

Definition at line 148 of file RecoSetup.h.

References fTrd, and HasTrd().

Referenced by CbmKfTrackFitter< FlagFitTime >::CreateFromGlobalTrack(), CbmTrackingTrdQa::Exec(), CbmTrackingTrdQa::FillHitMap(), Get(), and CbmTrackingTrdQa::GetGeometry().

◆ Has() [1/2]

template<ECbmModuleId ModuleId>
bool cbm::algo::RecoSetup::Has ( ) const
inline

Checks, if a setup unit is available (compile-time)

Template Parameters
ModuleIdCBM module ID

Definition at line 153 of file RecoSetup.h.

References HasMuch(), HasMvd(), HasSts(), HasTof(), HasTrd(), kMuch, kMvd, kSts, kTof, and kTrd.

Referenced by Has().

◆ Has() [2/2]

bool RecoSetup::Has ( ECbmModuleId moduleId) const

Checks, if a setup unit is available (run-time)

Definition at line 28 of file RecoSetup.cxx.

References Has(), kMuch, kMvd, kSts, kTof, and kTrd.

◆ HasMuch()

bool cbm::algo::RecoSetup::HasMuch ( ) const
inline

Checks, if the MuCh reconstruction setup unit is available.

Definition at line 172 of file RecoSetup.h.

References fMuch.

Referenced by GetMuch(), and Has().

◆ HasMvd()

bool cbm::algo::RecoSetup::HasMvd ( ) const
inline

Checks, if the MVD reconstruction setup unit is available.

Definition at line 175 of file RecoSetup.h.

References fMvd.

Referenced by GetMvd(), and Has().

◆ HasSts()

bool cbm::algo::RecoSetup::HasSts ( ) const
inline

Checks, if the STS reconstruction setup unit is available.

Definition at line 178 of file RecoSetup.h.

References fSts.

Referenced by GetSts(), and Has().

◆ HasTof()

bool cbm::algo::RecoSetup::HasTof ( ) const
inline

Checks, if the TOF reconstruction setup unit is available.

Definition at line 181 of file RecoSetup.h.

References fTof.

Referenced by GetTof(), and Has().

◆ HasTrd()

bool cbm::algo::RecoSetup::HasTrd ( ) const
inline

Checks, if the TRD reconstruction setup unit is available.

Definition at line 184 of file RecoSetup.h.

References fTrd.

Referenced by GetTrd(), and Has().

◆ Load()

RecoSetup RecoSetup::Load ( const std::string & filename)
static

Loads setup from a file.

Parameters
filenamePath to input binary file with the setup
Exceptions
Ifsetup was loaded inproperly

Definition at line 42 of file RecoSetup.cxx.

References RecoSetup().

Referenced by cbm::RecoSetupManager::LoadSetup(), and RecoSetup().

◆ load()

template<class Archive>
void cbm::algo::RecoSetup::load ( Archive & ar,
const unsigned int  )
inlineprivate

Serialization load method.

Definition at line 239 of file RecoSetup.h.

References ForEachOptUnit().

◆ save()

template<class Archive>
void cbm::algo::RecoSetup::save ( Archive & ar,
const unsigned int  ) const
inlineprivate

Serialization save method.

Definition at line 258 of file RecoSetup.h.

References ForEachOptUnit().

◆ serialize()

template<class Archive>
void cbm::algo::RecoSetup::serialize ( Archive & ar,
const unsigned int version )
inlineprivate

Serialization method.

Definition at line 273 of file RecoSetup.h.

◆ SetMuch()

void cbm::algo::RecoSetup::SetMuch ( much::RecoSetupUnit much)
inline

Defines MuCh reconstruction setup unit.

Definition at line 187 of file RecoSetup.h.

References fMuch.

◆ SetMvd()

void cbm::algo::RecoSetup::SetMvd ( mvd::RecoSetupUnit mvd)
inline

Defines STS reconstruction setup unit.

Definition at line 190 of file RecoSetup.h.

References fMvd.

◆ SetSts()

void cbm::algo::RecoSetup::SetSts ( sts::RecoSetupUnit sts)
inline

Defines STS reconstruction setup unit.

Definition at line 193 of file RecoSetup.h.

References fSts.

◆ SetTof()

void cbm::algo::RecoSetup::SetTof ( tof::RecoSetupUnit tof)
inline

Defines TOF reconstruction setup unit.

Definition at line 196 of file RecoSetup.h.

References fTof.

◆ SetTrd()

void cbm::algo::RecoSetup::SetTrd ( trd::RecoSetupUnit trd)
inline

Defines TRD reconstruction setup unit.

Definition at line 199 of file RecoSetup.h.

References fTrd.

◆ Store()

void RecoSetup::Store ( const RecoSetup & setup,
const std::string & filename )
static

Stores setup in a file.

Parameters
setupA reconstruction setup
filenamePath to output binary file
Exceptions
Ifsetup cannot be stored

Definition at line 69 of file RecoSetup.cxx.

References RecoSetup().

Referenced by cbm::RecoSetupManager::Init().

◆ ToString()

std::string RecoSetup::ToString ( ) const

Dumps contents to string.

Definition at line 87 of file RecoSetup.cxx.

References ForEachUnit().

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 236 of file RecoSetup.h.

References boost::serialization::access.

Referenced by boost::serialization::access.

Member Data Documentation

◆ fMuch

std::optional<much::RecoSetupUnit> cbm::algo::RecoSetup::fMuch {std::nullopt}
private

MuCh reconstruction setup unit.

Definition at line 221 of file RecoSetup.h.

Referenced by GetMuch(), HasMuch(), and SetMuch().

◆ fMvd

std::optional<mvd::RecoSetupUnit> cbm::algo::RecoSetup::fMvd {std::nullopt}
private

MVD reconstruction setup unit.

Definition at line 219 of file RecoSetup.h.

Referenced by GetMvd(), HasMvd(), and SetMvd().

◆ fSts

std::optional<sts::RecoSetupUnit> cbm::algo::RecoSetup::fSts {std::nullopt}
private

STS reconstruction setup unit.

Definition at line 220 of file RecoSetup.h.

Referenced by GetSts(), HasSts(), and SetSts().

◆ fTof

std::optional<tof::RecoSetupUnit> cbm::algo::RecoSetup::fTof {std::nullopt}
private

TOF reconstruction setup unit.

Definition at line 223 of file RecoSetup.h.

Referenced by GetTof(), HasTof(), and SetTof().

◆ fTrd

std::optional<trd::RecoSetupUnit> cbm::algo::RecoSetup::fTrd {std::nullopt}
private

TRD reconstruction setup unit.

Definition at line 222 of file RecoSetup.h.

Referenced by GetTrd(), HasTrd(), and SetTrd().

◆ kUnits

auto cbm::algo::RecoSetup::kUnits
staticconstexprprivate
Initial value:
)
std::optional< tof::RecoSetupUnit > fTof
TOF reconstruction setup unit.
Definition RecoSetup.h:223
std::optional< mvd::RecoSetupUnit > fMvd
MVD reconstruction setup unit.
Definition RecoSetup.h:219
std::optional< trd::RecoSetupUnit > fTrd
TRD reconstruction setup unit.
Definition RecoSetup.h:222
std::optional< sts::RecoSetupUnit > fSts
STS reconstruction setup unit.
Definition RecoSetup.h:220
std::optional< much::RecoSetupUnit > fMuch
MuCh reconstruction setup unit.
Definition RecoSetup.h:221
An utility, which allows to apply a callable to selected variables of a class in a loop.

A tuple of units (for loops)

Definition at line 227 of file RecoSetup.h.

Referenced by ForEachOptUnit(), ForEachOptUnit(), ForEachUnit(), and ForEachUnit().


The documentation for this class was generated from the following files: