BmnRoot
Loading...
Searching...
No Matches
BmnSsdSetup.h
Go to the documentation of this file.
1
8#ifndef BMNSSDSETUP_H
9#define BMNSSDSETUP_H 1
10
11#include <map>
12#include "BmnSsdElement.h"
13#include "BmnSsdSensor.h"
14
15class TGeoManager;
16class BmnSsdDigitize;
18class BmnSsdModule;
19class BmnSsdStation;
20
21
30{
31
32 public:
33
35 virtual ~BmnSsdSetup() { };
36
37
47 BmnSsdSensor* AssignSensor(Int_t address,
48 TGeoPhysicalNode* node = nullptr);
49
50
64 BmnSsdSensor* DefaultSensor(Int_t address, TGeoPhysicalNode* node);
65
66
68 BmnSsdDigitize* GetDigitizer() const { return fDigitizer; }
69
70
73 return fSettings;
74 }
75
76
82 BmnSsdElement* GetElement(Int_t address, Int_t level);
83
84
89 const char* GetLevelName(Int_t level);
90
91
99 BmnSsdModule* GetModule(Int_t index) { return fModuleVector.at(index); }
100
101
103 Int_t GetNofModules() const { return fModules.size(); }
104
105
107 Int_t GetNofSensors() const { return fSensors.size(); }
108
109
111 Int_t GetNofStations() const { return fStations.size(); }
112
113
118 BmnSsdStation* GetStation(Int_t stationId) {
119 if ( fStations.find(stationId) == fStations.end() ) return NULL;
120 return fStations[stationId];
121 }
122
123
128 Int_t GetStationNumber(Int_t address);
129
130
147 Bool_t Init(const char* geometryFile = nullptr,
148 const char* sensorParameterFile = nullptr);
149
150
154 Bool_t IsInit() const { return fIsInitialised; }
155
156
158 static BmnSsdSetup* Instance();
159
160
162 void ListModules() const;
163
164
166 void ListSensors() const {
167 for (auto it = fSensors.begin(); it != fSensors.end(); it++)
168 LOG(info) << it->second->ToString();
169 }
170
171
180 Int_t ModifyStripPitch(Double_t pitch);
181
182
192 void SetDefaultSensorParameters(Double_t dInact, Double_t pitch,
193 Double_t stereoF, Double_t stereoB);
194
195
202 void SetDigitizer(BmnSsdDigitize* digitizer) {
203 fDigitizer = digitizer;
204 }
205
206
214 fSettings = settings;
215 }
216
217
232 Int_t SetModuleParameters(Double_t dynRange, Double_t threshold,
233 Int_t nAdc, Double_t timeResolution,
234 Double_t deadTime, Double_t noise,
235 Double_t zeroNoiseRate,
236 Double_t fracDeadChannels);
237
238
251 Int_t SetModuleParameters(const char* fileName);
252
253
265 Int_t SetSensorConditions();
266
267
279 Int_t SetSensorConditions(Double_t vDep, Double_t vBias,
280 Double_t temperature, Double_t cCoupling,
281 Double_t cInterstrip);
282
283
295 Int_t SetSensorConditions(const char* fileName);
296
297
298
299 private:
300
301 static BmnSsdSetup* fgInstance;
302 BmnSsdDigitize* fDigitizer;
303 BmnSsdDigitizeParameters* fSettings;
304
305 Bool_t fIsInitialised;
306 Bool_t fIsOld;
307 Int_t fNofSensorsDefault;
308
309 // --- Default sensor parameters (for type DssdStereo)
310 Double_t fSensorDinact;
311 Double_t fSensorPitch;
312 Double_t fSensorStereoF; // Stereo angle front side [degrees]
313 Double_t fSensorStereoB; // Stereo angle back side [degrees]
314
315 // --- Map of sensors. Key is address.
316 std::map<Int_t, BmnSsdSensor*> fSensors;
317
318 // --- Map of modules. Key is address.
319 std::map<Int_t, BmnSsdModule*> fModules;
320
321 // --- Vector of modules. For convenient loops.
322 std::vector<BmnSsdModule*> fModuleVector;
323
324 // --- Map of stations. Key is station number.
325 // --- Stations are a special case needed for reconstruction;
326 // --- they are not elements in the setup.
327 std::map<Int_t, BmnSsdStation*> fStations;
328
330 BmnSsdSetup();
331
332
334 Int_t CreateStations();
335
336
345 Bool_t ReadGeometry(TGeoManager* geoManager);
346
347
356 Bool_t ReadGeometry(const char* fileName);
357
358
368 Int_t ReadSensorParameters(const char* fileName);
369
370
372 BmnSsdSetup(const BmnSsdSetup&) = delete;
373
374
376 BmnSsdSetup operator=(const BmnSsdSetup&) = delete;
377
378 ClassDef(BmnSsdSetup, 2);
379
380};
381
382#endif /* BMNSSDSETUP_H */
Parameters for SSD digitization.
Task class for simulating the detector response of the SSD.
Class representing an element of the SSD setup.
Class representing an instance of a readout unit in the BMN-SSD.
Class representing an instance of a sensor in the BMN-SSD.
Class representing the top level of the SSD setup.
Definition BmnSsdSetup.h:30
Int_t GetStationNumber(Int_t address)
Int_t GetNofStations() const
void SetDefaultSensorParameters(Double_t dInact, Double_t pitch, Double_t stereoF, Double_t stereoB)
Set the default sensor parameters.
static BmnSsdSetup * Instance()
Int_t SetModuleParameters(Double_t dynRange, Double_t threshold, Int_t nAdc, Double_t timeResolution, Double_t deadTime, Double_t noise, Double_t zeroNoiseRate, Double_t fracDeadChannels)
Set parameters for all modules.
Int_t ModifyStripPitch(Double_t pitch)
Modify the strip pitch for all sensors.
Int_t GetNofSensors() const
Bool_t IsInit() const
Initialisation status.
virtual ~BmnSsdSetup()
Definition BmnSsdSetup.h:35
void SetDigitizer(BmnSsdDigitize *digitizer)
Set the digitiser task.
const char * GetLevelName(Int_t level)
BmnSsdStation * GetStation(Int_t stationId)
void ListModules() const
Int_t GetNofModules() const
BmnSsdDigitize * GetDigitizer() const
Definition BmnSsdSetup.h:68
BmnSsdModule * GetModule(Int_t index)
Get a module from the module array.
Definition BmnSsdSetup.h:99
Bool_t Init(const char *geometryFile=nullptr, const char *sensorParameterFile=nullptr)
Initialise the setup.
Int_t SetSensorConditions()
Set conditions for all sensors (same values for all)
BmnSsdDigitizeParameters * GetDigiParameters() const
Definition BmnSsdSetup.h:72
BmnSsdElement * GetElement(Int_t address, Int_t level)
void SetDigiParameters(BmnSsdDigitizeParameters *settings)
Set the digitiser parameters.
void ListSensors() const
BmnSsdSensor * AssignSensor(Int_t address, TGeoPhysicalNode *node=nullptr)
BmnSsdSensor * DefaultSensor(Int_t address, TGeoPhysicalNode *node)
Instantiate the default sensor class for a given node.
Class representing a station of the SsdSystem.