CbmRoot
CbmBinnedTrackerConfigurator.cxx
Go to the documentation of this file.
1 /*
2  * To change this license header, choose License Headers in Project Properties.
3  * To change this template file, choose Tools | Templates
4  * and open the template in the editor.
5  */
6 
8 #include "CbmMCDataManager.h"
9 #include "CbmStsSetup.h"
10 #include "FairLogger.h"
11 #include "FairRunAna.h"
12 #include "FairRuntimeDb.h"
13 #include "GeoReader.h"
14 
16  : fUseAllDetectors(useAllDetectors)
17  , fTracker(0)
18  , fSettings(0)
19  , fPrimaryParticleIds()
20  , fMCTracks(0)
21  , fStsPoints(0)
22  , fMuchPoints(0)
23  , fTrdPoints(0)
24  , fTofPoints(0) {
26  fPrimaryParticleIds.push_back(ppiNone);
27  //fUseModules[kMuch] = false;// Temporary hack
28  fUseModules[ToIntegralType(ECbmModuleId::kRich)] = false; // Temporary hack
29 }
30 
32  delete fTracker;
33 }
34 
36  CbmStsSetup* stsSetup = CbmStsSetup::Instance();
37 
38  if (!stsSetup->IsInit()) stsSetup->Init();
39 
49 
50  if (0 == geoReader) LOG(fatal) << "Couldn't instantiate CbmBinnedGeoReader";
51 
52  geoReader->Read();
53 
54  FairRootManager* ioman = FairRootManager::Instance();
55 
56  if (0 == ioman) LOG(fatal) << "No FairRootManager";
57 
58  fMCTracks = static_cast<TClonesArray*>(ioman->GetObject("MCTrack"));
59 
60  if (0 == fMCTracks) LOG(fatal) << "No MC tracks in the input file";
61 
63  fStsPoints = static_cast<TClonesArray*>(ioman->GetObject("StsPoint"));
64 
65  if (0 == fStsPoints) LOG(fatal) << "No sts MC points in the input file";
66  }
67 
69  fMuchPoints = static_cast<TClonesArray*>(ioman->GetObject("MuchPoint"));
70 
71  if (0 == fMuchPoints) LOG(fatal) << "No much MC points in the input file";
72  }
73 
75  fTrdPoints = static_cast<TClonesArray*>(ioman->GetObject("TrdPoint"));
76 
77  if (0 == fTrdPoints) LOG(fatal) << "No trd MC points in the input file";
78  }
79 
81  fTofPoints = static_cast<TClonesArray*>(ioman->GetObject("TofPoint"));
82 
83  if (0 == fTofPoints) LOG(fatal) << "No tof MC points in the input file";
84  }
85 
86  return kSUCCESS;
87 }
88 
92 }
93 
96 }
97 
99  fSettings = static_cast<CbmBinnedSettings*>(
100  FairRunAna::Instance()->GetRuntimeDb()->getContainer("CbmBinnedSettings"));
101 }
102 
CbmBinnedSettings::SetPrimaryParticles
void SetPrimaryParticles(const std::list< EPrimaryParticleId > v)
Definition: Settings.h:221
CbmBinnedTrackerConfigurator::Exec
void Exec(Option_t *opt)
Definition: CbmBinnedTrackerConfigurator.cxx:89
CbmMCDataManager.h
CbmBinnedGeoReader::Instance
static CbmBinnedGeoReader * Instance()
Definition: GeoReader.cxx:17
CbmBinnedSettings::SetNofTrdStations
void SetNofTrdStations(Int_t v)
Definition: Settings.h:181
CbmBinnedSettings::Use
bool Use(ECbmModuleId m) const
Definition: Settings.h:164
CbmBinnedTrackerConfigurator::fMuchPoints
TClonesArray * fMuchPoints
Definition: CbmBinnedTrackerConfigurator.h:55
CbmBinnedTrackerConfigurator::fPrimaryParticleIds
std::list< EPrimaryParticleId > fPrimaryParticleIds
Definition: CbmBinnedTrackerConfigurator.h:51
CbmStsSetup.h
CbmBinnedSettings::SetNofStsStations
void SetNofStsStations(Int_t v)
Definition: Settings.h:177
CbmBinnedTrackerConfigurator::SetParContainers
void SetParContainers()
Definition: CbmBinnedTrackerConfigurator.cxx:98
CbmBinnedSettings::SetConfiguring
void SetConfiguring(bool v)
Definition: Settings.h:161
CbmBinnedTrackerConfigurator::fUseModules
bool fUseModules[ToIntegralType(ECbmModuleId::kLastModule)]
Definition: CbmBinnedTrackerConfigurator.h:48
CbmStsSetup::Instance
static CbmStsSetup * Instance()
Definition: CbmStsSetup.cxx:293
CbmBinnedTrackerConfigurator::fMCTracks
TClonesArray * fMCTracks
Definition: CbmBinnedTrackerConfigurator.h:53
ECbmModuleId::kTof
@ kTof
Time-of-flight Detector.
ppiNone
@ ppiNone
Definition: Settings.h:25
CbmBinnedTrackerConfigurator::fTofPoints
TClonesArray * fTofPoints
Definition: CbmBinnedTrackerConfigurator.h:57
CbmBinnedTrackerConfigurator::fSettings
CbmBinnedSettings * fSettings
Definition: CbmBinnedTrackerConfigurator.h:50
CbmBinnedHitReader::Read
virtual void Read()=0
CbmBinnedHitReader::Instance
static CbmBinnedHitReader * Instance()
Definition: HitReader.cxx:813
CbmBinnedTrackerConfigurator.h
ECbmModuleId::kRich
@ kRich
Ring-Imaging Cherenkov Detector.
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmStsSetup::Init
Bool_t Init(const char *geometryFile=nullptr)
Initialise the setup.
Definition: CbmStsSetup.cxx:201
CbmBinnedTrackerConfigurator
Definition: CbmBinnedTrackerConfigurator.h:23
CbmStsSetup
Class representing the top level of the STS setup.
Definition: CbmStsSetup.h:39
CbmBinnedSettings::SetNofStations
void SetNofStations(Int_t v)
Definition: Settings.h:183
CbmBinnedHitReader::Handle
virtual void Handle()
Definition: HitReader.h:42
CbmBinnedSettings::ResetScats
void ResetScats()
Definition: Settings.h:203
CbmBinnedSettings::SetUse
void SetUse(Int_t m, bool v)
Definition: Settings.h:167
ECbmModuleId::kTrd
@ kTrd
Transition Radiation Detector.
CbmBinnedTrackerConfigurator::CbmBinnedTrackerConfigurator
CbmBinnedTrackerConfigurator(bool useAllDetectors)
Definition: CbmBinnedTrackerConfigurator.cxx:15
ECbmModuleId::kLastModule
@ kLastModule
For loops over all modules.
CbmBinnedTrackerConfigurator::fTrdPoints
TClonesArray * fTrdPoints
Definition: CbmBinnedTrackerConfigurator.h:56
CbmBinnedTrackerConfigurator::fUseAllDetectors
bool fUseAllDetectors
Definition: CbmBinnedTrackerConfigurator.h:47
CbmBinnedGeoReader
Definition: GeoReader.h:27
CbmBinnedGeoReader::Read
void Read()
Definition: GeoReader.cxx:109
CbmBinnedTrackerConfigurator::Init
InitStatus Init()
Definition: CbmBinnedTrackerConfigurator.cxx:35
CbmBinnedTrackerConfigurator::fTracker
CbmBinnedTracker * fTracker
Definition: CbmBinnedTrackerConfigurator.h:49
ToIntegralType
constexpr auto ToIntegralType(T enumerator) -> typename std::underlying_type< T >::type
Definition: CbmDefs.h:24
CbmBinnedSettings
Definition: Settings.h:27
ECbmModuleId::kMuch
@ kMuch
Muon detection system.
GeoReader.h
CbmBinnedSettings::SetNofMuchStations
void SetNofMuchStations(Int_t v)
Definition: Settings.h:179
ECbmModuleId::kSts
@ kSts
Silicon Tracking System.
CbmBinnedTrackerConfigurator::fStsPoints
TClonesArray * fStsPoints
Definition: CbmBinnedTrackerConfigurator.h:54
CbmBinnedTrackerConfigurator::Finish
void Finish()
Definition: CbmBinnedTrackerConfigurator.cxx:94
CbmBinnedHitReader::Finish
virtual void Finish()
Definition: HitReader.h:44
CbmStsSetup::IsInit
Bool_t IsInit() const
Initialisation status for sensor parameters.
Definition: CbmStsSetup.h:124
CbmBinnedTrackerConfigurator::~CbmBinnedTrackerConfigurator
~CbmBinnedTrackerConfigurator()
Definition: CbmBinnedTrackerConfigurator.cxx:31