CbmRoot
Loading...
Searching...
No Matches
CbmTrdGeoSetup.h
Go to the documentation of this file.
1/* Copyright (C) 2024 National Institute of Physics and Nuclear Engineering - Horia Hulubei, Bucharest
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Alexandru Bercuci [committer] */
4
23#ifndef CBMTRDGEOSETUP_H_
24#define CBMTRDGEOSETUP_H_
25
26#include "CbmTrdDefs.h" // for trd namespace
27
28#include <FairParGenericSet.h> // for FairParGenericSet
29#include <FairTask.h> // for FairTask
30
31#include <TNamed.h> // for the base class
32
33#include <map>
34#include <string>
35#include <vector>
36
37using namespace std;
38using namespace cbm::trd;
39class FairParamList;
40class TGeoNode;
41namespace cbm::trd::geo
42{
46 class Setup : public FairParGenericSet {
47 public:
48 friend class SetupManager;
49 class Asic;
50 class Module;
51
56 Setup(const char* n, const char* t);
57 virtual ~Setup();
61 virtual const char* GetInfo(const char* label) const;
64 virtual int GetModuleId(int i) const;
67 virtual const Module* GetModulePar(int detId) const;
69 virtual size_t GetNrOfModules() const { return fModule.size(); }
71 vector<Module*> GetModules() { return fModule; }
72 virtual void addParam(Module* mod);
74 virtual void putParams(FairParamList*);
76 virtual bool getParams(FairParamList*);
77
78 protected:
79 int fVersion = 1;
81 vector<Module*> fModule = {};
82 vector<string> fMetaFields = {};
83 map<string, string> fMeta = {};
84
85 private:
86 Setup(const Setup&);
88 void Help(const char* lab = nullptr) const;
90 size_t Parse();
91
92 ClassDef(cbm::trd::geo::Setup, 1) // Setup description of the TRD system, accompanying the geometry
93 }; // class cbm::trd::geo::Setup
94
95
100 class Setup::Module : public TNamed {
101 public:
102 friend class Setup;
103 friend class SetupManager;
104 Module(const char* n = "", const char* t = "");
105
106 int GetModuleId() const { return (fId == 0xffff ? -1 : 1); }
107 int GetType() const { return fType; }
108 int GetRotation() const { return fRot; }
109 ePadPlane GetFamily() const { return fFamily; }
110 eAsic GetFeeType() const { return fFee; }
111 eWindow GetWindowType() const { return fWindow; }
112 vector<int> GetDaq() const { return fDaq; }
113 vector<Asic*> GetFEE() const { return fFEE; }
114
115 protected:
117 virtual InitStatus init(TGeoNode*);
119 virtual void putParams(FairParamList*);
121 virtual bool getParams(FairParamList*);
122
123 uint16_t fId = 0xffff;
128 int fType = 1;
129 int fFeeType = 1;
130 int fRot = 0;
131 vector<int> fDaq = {};
132 vector<Asic*> fFEE = {};
133 private:
134 Module(const Module&);
135
136 ClassDef(cbm::trd::geo::Setup::Module, 1) // Setup description of a TRD module
137 }; // class cbm::trd::geo::Setup::Module
138
139
144 class Setup::Asic : public TNamed {
145 public:
146 friend class Setup;
147 friend class SetupManager;
148 Asic(const char* n, const char* t);
149 int GetMask() const { return fMask; }
150 int GetId() const { return (fId == 0xff ? -1 : fId); }
151 int GetUniqueId() const { return (fUnique == 0xffff ? -1 : fUnique); }
152 vector<int> GetPads() const { return fPad; }
153
154 private:
155 Asic(const Asic&);
156
157 uint8_t fId = 0xff;
158 uint16_t fUnique = 0xffff;
159 uint16_t fMask = 0xffff;
160 vector<int> fPad = {};
161
162 ClassDef(cbm::trd::geo::Setup::Asic, 1) // Setup description of an ASIC
163 }; // class cbm::trd::geo::Setup::Asic
164
165
170 class SetupManager : public FairTask {
171 public:
173 SetupManager() : FairTask("TrdSetupManager") { ; }
175 virtual ~SetupManager() { ; }
177 virtual InitStatus Init();
179 virtual void SetParContainers();
181 virtual void Exec(Option_t*) { ; }
183 virtual void Finish();
184
185 void SetContact(const char* contact) { fContact = contact; }
186 void SetDescription(const char* text) { fDescription = text; }
187
188 private:
192 void CreateModuleParameters(const TString& path);
194 bool CreateParFilesFromGeometry(TString outDir = "");
195
196 string fGeoTag = "";
197 string fContact = "";
198 string fDescription = "";
199 Setup* fSetup = nullptr;
200
201 ClassDef(cbm::trd::geo::SetupManager, 1) // Manages the creation of meta info for the TRD system setup
202 }; // class cbm::trd::geo::SetupManager
203} // namespace cbm::trd::geo
204#endif // CBMTRDGEOSETUP_H_
Double_t lab[3]
Generate setup meta info for the TRD system.
string fDescription
further description of the current setup
Setup * fSetup
the setup object
virtual void Finish()
Inherited from FairTask.
SetupManager(const SetupManager &)
void CreateModuleParameters(const TString &path)
bool CreateParFilesFromGeometry(TString outDir="")
string fContact
contact info (usual email) of the responsible
virtual InitStatus Init()
Inherited from FairTask.
void SetContact(const char *contact)
void SetDescription(const char *text)
virtual void Exec(Option_t *)
Inherited from FairTask.
SetupManager()
Default constructor.
virtual void SetParContainers()
Inherited from FairTask.
virtual ~SetupManager()
Destructor.
SetupManager & operator=(const SetupManager &)
string fGeoTag
the setup name
Meta info for one TRD ASIC.
uint16_t fUnique
ASIC id in the production.
Asic(const char *n, const char *t)
vector< int > GetPads() const
uint8_t fId
ASIC id in the chamber.
Meta info for one TRD module.
int fRot
rotation of chamber in steps of 90 deg
ePadPlane fFamily
Chamber family (1D / 2D)
virtual void putParams(FairParamList *)
Write out the setup from object to FairParamList.
vector< int > GetDaq() const
int fFeeType
FEB type for each FEE version.
uint16_t fId
TRD chamber id in the setup.
virtual InitStatus init(TGeoNode *)
Read info relevant for the module from the geometry.
int fType
TRD chamber sub-type (e.g. 1, 3, 5, 7 for TRD1D)
Module(const char *n="", const char *t="")
eWindow fWindow
Entrance window type.
vector< Asic * > GetFEE() const
eAsic fFee
ASIC family (SPADIC/FASP)
virtual bool getParams(FairParamList *)
Read in the setup from FairParamList.
Setup meta info for the TRD system to supplement the geometry.
virtual const Module * GetModulePar(int detId) const
Get module par by detector id.
virtual void addParam(Module *mod)
void Help(const char *lab=nullptr) const
Help message for user.
vector< Module * > fModule
list of modules defined in the setup
Setup(const char *n, const char *t)
Setup descriptor for the TRD setup. The identification should be :
map< string, string > fMeta
meta info attached to this setup
virtual int GetModuleId(int i) const
Get module par by index.
virtual bool getParams(FairParamList *)
Read in the setup from FairParamList.
virtual void putParams(FairParamList *)
Write out the setup from object to FairParamList.
Setup(const Setup &)
vector< string > fMetaFields
ordered list of meta info types
virtual const char * GetInfo(const char *label) const
Retrieve meta info for the setup according to label.
virtual size_t GetNrOfModules() const
Retrieve no of modules in the setup.
vector< Module * > GetModules()
Retrieve full list of modules in the setup.
size_t Parse()
Parse setup description for meta info.
@ kNotSet
active gas not set / recognized
@ kNotSet
window not set / recognized
@ kNotSet
pad=plane not set / recognized
@ kNotSet
ASIC not set / recognized.
Hash for CbmL1LinkKey.