CbmRoot
Loading...
Searching...
No Matches
CbmDefs.h File Reference
#include "CbmEnumDict.h"
#include <iosfwd>
#include <string>
#include <type_traits>
#include <xpu/defines.h>
Include dependency graph for CbmDefs.h:

Go to the source code of this file.

Namespaces

namespace  cbm
 
namespace  cbm::algo
 
namespace  cbm::algo::ca
 TODO: SZh 8.11.2022: add selection of parameterisation.
 

Enumerations

enum class  ECbmModuleId {
  kRef = 0 , kMvd = 1 , kSts = 2 , kRich = 3 ,
  kMuch = 4 , kTrd = 5 , kTof = 6 , kMust = 7 ,
  kPsd = 8 , kHodo = 9 , kDummyDet = 10 , kBmon = 11 ,
  kTrd2d = 12 , kFsd = 13 , kNofSystems = 14 , kMagnet = 17 ,
  kTarget = 18 , kPipe = 19 , kShield = 20 , kPlatform = 21 ,
  kCave = 22 , kLastModule = 23 , kNotExist = -1
}
 Enumerator for module Identifiers. More...
 
enum class  ECbmDataType {
  kUnknown = -1 , kMCTrack = 0 , kMvdPoint = ToIntegralType(ECbmModuleId::kMvd) * 100 , kMvdDigi ,
  kMvdCluster , kMvdHit , kStsPoint = ToIntegralType(ECbmModuleId::kSts) * 100 , kStsDigi ,
  kStsCluster , kStsHit , kStsTrack , kRichPoint = ToIntegralType(ECbmModuleId::kRich) * 100 ,
  kRichDigi , kRichHit , kRichRing , kRichTrackParamZ ,
  kRichTrackProjection , kMuchPoint = ToIntegralType(ECbmModuleId::kMuch) * 100 , kMuchDigi , kMuchCluster ,
  kMuchPixelHit , kMuchStrawHit , kMuchTrack , kMustPoint = ToIntegralType(ECbmModuleId::kMust) * 100 ,
  kMustDigi , kMustCluster , kMustPixelHit , kMustStrawHit ,
  kMustTrack , kTrdPoint = ToIntegralType(ECbmModuleId::kTrd) * 100 , kTrdDigi , kTrdCluster ,
  kTrdHit , kTrdTrack , kTofPoint = ToIntegralType(ECbmModuleId::kTof) * 100 , kTofDigi ,
  kTofCalDigi , kTofHit , kTofTrack , kTofUHit ,
  kTofTracklet , kPsdPoint = ToIntegralType(ECbmModuleId::kPsd) * 100 , kPsdDigi , kPsdHit ,
  kBmonPoint = ToIntegralType(ECbmModuleId::kBmon) * 100 , kBmonDigi , kBmonCalDigi , kBmonHit ,
  kFsdPoint = ToIntegralType(ECbmModuleId::kFsd) * 100 , kFsdDigi , kFsdHit , kGlobalTrack = 2000
}
 Enumerator for CBM data types. More...
 
enum class  ECbmTreeAccess { kRegular , kRepeat , kRandom }
 
enum class  ECbmRecoMode { Timeslice , EventByEvent , Undefined }
 Reconstruct the full time slice or event-by-event. More...
 
enum class  cbm::algo::ca::EDetectorID {
  cbm::algo::ca::kMvd = 0 , cbm::algo::ca::kSts , cbm::algo::ca::kMuch , cbm::algo::ca::kTrd ,
  cbm::algo::ca::kTof , cbm::algo::ca::END
}
 Enumeration for the tracking detector subsystems in CBM-CA. More...
 

Functions

template<typename T>
XPU_D constexpr auto ToIntegralType (T enumerator) -> typename std::underlying_type< T >::type
 Converts an element of enum class to its underlying integral type.
 
 CBM_ENUM_DICT (ECbmModuleId, {"Ref", ECbmModuleId::kRef}, {"Mvd", ECbmModuleId::kMvd}, {"Sts", ECbmModuleId::kSts}, {"Rich", ECbmModuleId::kRich}, {"Much", ECbmModuleId::kMuch}, {"Trd", ECbmModuleId::kTrd}, {"Tof", ECbmModuleId::kTof}, {"Must", ECbmModuleId::kMust}, {"Psd", ECbmModuleId::kPsd}, {"Hodo", ECbmModuleId::kHodo}, {"DummyDet", ECbmModuleId::kDummyDet}, {"Bmon", ECbmModuleId::kBmon}, {"Trd2d", ECbmModuleId::kTrd2d}, {"Fsd", ECbmModuleId::kFsd}, {"NofSystems", ECbmModuleId::kNofSystems}, {"Magnet", ECbmModuleId::kMagnet}, {"Target", ECbmModuleId::kTarget}, {"Pipe", ECbmModuleId::kPipe}, {"Shield", ECbmModuleId::kShield}, {"Platform", ECbmModuleId::kPlatform}, {"Cave", ECbmModuleId::kCave}, {"LastModule", ECbmModuleId::kLastModule}, {"NotExist", ECbmModuleId::kNotExist})
 A dictionary for ECbmModuleId.
 
ECbmModuleIdoperator++ (ECbmModuleId &)
 operator ++ for ECbmModuleId for convenient usage in loops
 
std::ostream & operator<< (std::ostream &, const ECbmDataType &)
 operator << for convenient output to std::ostream.
 
constexpr ECbmModuleId cbm::algo::ca::ToCbmModuleId (EDetectorID detID)
 Conversion map from EDetectorID to ECbmModuleId.
 
constexpr EDetectorID cbm::algo::ca::ToCaDetectorID (ECbmModuleId modId)
 Conversion map from EDetectorID to ECbmModuleId.
 
double CbmProtonMass ()
 
double CbmNeutronMass ()
 
double CbmElectronMass ()
 

Detailed Description

Author
Volker Friese v.fri.nosp@m.ese@.nosp@m.gsi.d.nosp@m.e
Date
30.05.2017

Header for definition of CBM enumerators and constants

Definition in file CbmDefs.h.

Enumeration Type Documentation

◆ ECbmDataType

enum class ECbmDataType
strong

Enumerator for CBM data types.

Enumerator
kUnknown 
kMCTrack 
kMvdPoint 
kMvdDigi 
kMvdCluster 
kMvdHit 
kStsPoint 
kStsDigi 
kStsCluster 
kStsHit 
kStsTrack 
kRichPoint 
kRichDigi 
kRichHit 
kRichRing 
kRichTrackParamZ 
kRichTrackProjection 
kMuchPoint 
kMuchDigi 
kMuchCluster 
kMuchPixelHit 
kMuchStrawHit 
kMuchTrack 
kMustPoint 
kMustDigi 
kMustCluster 
kMustPixelHit 
kMustStrawHit 
kMustTrack 
kTrdPoint 
kTrdDigi 
kTrdCluster 
kTrdHit 
kTrdTrack 
kTofPoint 
kTofDigi 
kTofCalDigi 
kTofHit 
kTofTrack 
kTofUHit 
kTofTracklet 
kPsdPoint 
kPsdDigi 
kPsdHit 
kBmonPoint 
kBmonDigi 
kBmonCalDigi 
kBmonHit 
kFsdPoint 
kFsdDigi 
kFsdHit 
kGlobalTrack 

Definition at line 121 of file CbmDefs.h.

◆ ECbmModuleId

enum class ECbmModuleId
strong

Enumerator for module Identifiers.

Modules can be active (detector systems) or passive (magnet, beam pipe, target etc.) In order to loop over all detectors, loop until kNofSystems.

Enumerator
kRef 

Reference plane.

kMvd 

Micro-Vertex Detector.

kSts 

Silicon Tracking System.

kRich 

Ring-Imaging Cherenkov Detector.

kMuch 

Muon detection system.

kTrd 

Transition Radiation Detector.

kTof 

Time-of-flight Detector.

kMust 

MuSt detection system.

kPsd 

Projectile spectator detector.

kHodo 

Hodoscope (for test beam times)

kDummyDet 

Dummy for tutorials or tests.

kBmon 

Bmon Counter.

kTrd2d 

TRD-FASP Detector (FIXME)

kFsd 

Forward spectator detector.

kNofSystems 

For loops over active systems.

kMagnet 

Magnet.

kTarget 

Target.

kPipe 

Beam pipe.

kShield 

Beam pipe shielding in MUCH section.

kPlatform 

RICH rail platform.

kCave 

Cave.

kLastModule 

For loops over all modules.

kNotExist 

If not found.

Definition at line 44 of file CbmDefs.h.

◆ ECbmRecoMode

enum class ECbmRecoMode
strong

Reconstruct the full time slice or event-by-event.

Enumerator
Timeslice 
EventByEvent 
Undefined 

Definition at line 201 of file CbmDefs.h.

◆ ECbmTreeAccess

enum class ECbmTreeAccess
strong
Enumerator
kRegular 
kRepeat 
kRandom 

Definition at line 191 of file CbmDefs.h.

Function Documentation

◆ CBM_ENUM_DICT()

CBM_ENUM_DICT ( ECbmModuleId ,
{"Ref", ECbmModuleId::kRef} ,
{"Mvd", ECbmModuleId::kMvd} ,
{"Sts", ECbmModuleId::kSts} ,
{"Rich", ECbmModuleId::kRich} ,
{"Much", ECbmModuleId::kMuch} ,
{"Trd", ECbmModuleId::kTrd} ,
{"Tof", ECbmModuleId::kTof} ,
{"Must", ECbmModuleId::kMust} ,
{"Psd", ECbmModuleId::kPsd} ,
{"Hodo", ECbmModuleId::kHodo} ,
{"DummyDet", ECbmModuleId::kDummyDet} ,
{"Bmon", ECbmModuleId::kBmon} ,
{"Trd2d", ECbmModuleId::kTrd2d} ,
{"Fsd", ECbmModuleId::kFsd} ,
{"NofSystems", ECbmModuleId::kNofSystems} ,
{"Magnet", ECbmModuleId::kMagnet} ,
{"Target", ECbmModuleId::kTarget} ,
{"Pipe", ECbmModuleId::kPipe} ,
{"Shield", ECbmModuleId::kShield} ,
{"Platform", ECbmModuleId::kPlatform} ,
{"Cave", ECbmModuleId::kCave} ,
{"LastModule", ECbmModuleId::kLastModule} ,
{"NotExist", ECbmModuleId::kNotExist}  )

A dictionary for ECbmModuleId.

The dictionary provides streaming operators, conversion into std::string and back and a rule for automatic parsing of yaml configuration files.

References kRef.

◆ CbmElectronMass()

double CbmElectronMass ( )
inline

Definition at line 261 of file CbmDefs.h.

Referenced by TEST().

◆ CbmNeutronMass()

double CbmNeutronMass ( )
inline

Definition at line 260 of file CbmDefs.h.

Referenced by TEST().

◆ CbmProtonMass()

double CbmProtonMass ( )
inline

Global functions for particle masses

Definition at line 259 of file CbmDefs.h.

Referenced by CbmMCTrack::GetMass(), and TEST().

◆ operator++()

ECbmModuleId & operator++ ( ECbmModuleId & e)

operator ++ for ECbmModuleId for convenient usage in loops

This operator is tuned for ECbmModuleID. It takes into account non continuous values for the enum. Since the detectorID which is stored in the generated output has only 4 bit the maximum number of detectors can be 16 (0-15). To avoid that the enum class has to be changed again the values 11-15 are reserved for future detectors. The ids of the passive modules are only relevant at run time so they can be shifted easily The opeartor takes care about the non continuous values for the enum When it reaches the last detector it automatically continuous with the first passive module

Definition at line 24 of file CbmDefs.cxx.

References kLastModule, kMagnet, and kNofSystems.

◆ operator<<()

std::ostream & operator<< ( std::ostream & strm,
const ECbmDataType & dataType )

operator << for convenient output to std::ostream.

Converts the enum value to a string which is put in the stream

Definition at line 40 of file CbmDefs.cxx.

References ToIntegralType().

◆ ToIntegralType()

template<typename T>
XPU_D constexpr auto ToIntegralType ( T enumerator) -> typename std::underlying_type<T>::type
constexpr

Converts an element of enum class to its underlying integral type.

Starting with C++11, the return type cannot be deduced automatically, so it has to be put explicitly; constexpr should result in a compile time evaluation of the function call where possible. E.g. ToIntegralType(ECbmModuleId::KSts) should be evaluated at compile time and should not affect the run time performance at all

Definition at line 33 of file CbmDefs.h.

Referenced by CbmLitFindGlobalTracks::CalculateLength(), CbmFsdMC::CbmFsdMC(), CbmMustPoint::CbmMustPoint(), CbmMvd::CbmMvd(), CbmMvd::CbmMvd(), CbmPsdMC::CbmPsdMC(), CbmRich::CbmRich(), CbmRich::CbmRich(), CbmStsMC::CbmStsMC(), CbmStsPoint::CbmStsPoint(), CbmStsSetup::CbmStsSetup(), CbmTof::CbmTof(), CbmTof::CbmTof(), CbmTofDetectorInfo::CbmTofDetectorInfo(), CbmTofDetectorInfo::CbmTofDetectorInfo(), CbmTrd::CbmTrd(), CbmTrd::CbmTrd(), comparePsdAddressDataMembers(), CbmBmonDigitize::Exec(), PairAnalysisCutQa::Fill(), PairAnalysisCutQa::FillAll(), PairAnalysisVarManager::FillVarMuchTrack(), PairAnalysisVarManager::FillVarPairAnalysisTrack(), CbmFsdAddress::GetAddress(), CbmMuchAddress::GetAddress(), CbmMuchAddress::GetAddress(), CbmMustAddress::GetAddress(), CbmMustAddress::GetAddress(), CbmMvdAddress::GetAddress(), CbmMvdAddress::GetAddress(), CbmPsdAddress::GetAddress(), CbmRichAddress::GetAddress(), CbmStsAddress::GetAddress(), CbmStsAddress::GetAddress(), CbmTrdAddress::GetAddress(), CbmMvdAddress::GetAddressFromSensorNrAndPixelXY(), CbmTofAddress::GetUniqueAddress(), PairAnalysisEvent::Init(), operator<<(), PairAnalysisTrack::PairAnalysisTrack(), CbmRecoSts::ProcessData(), CbmRecoStsPixel::ProcessData(), TEST(), TEST(), and CbmStsAddress::UnpackDigiAddress().