BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
CbmStsModule.cxx
Go to the documentation of this file.
1/** @file CbmStsModule.cxx
2 ** @author Volker Friese <v.friese@gsi.de>
3 ** @date 14.05.2013
4 **/
5
7
8#include "FairLogger.h"
11
12// ----- Default constructor -------------------------------------------
18// -------------------------------------------------------------------------
19
20// ----- Standard constructor ------------------------------------------
21CbmStsModule::CbmStsModule(const char* name, const char* title, TGeoPhysicalNode* node)
22 : CbmStsElement(name, title, kStsModule, node)
23 , fSensors()
24 , fBuffer()
25{}
26// -------------------------------------------------------------------------
27
28// --- Destructor --------------------------------------------------------
30// -------------------------------------------------------------------------
31
32// ----- Add a sensor -----------------------------------------------------
34{
35
36 // TODO: Unify adding elements from base class and adding sensors
37 // If AddDaughter is used, compatibility of sensor types is not assured.
38 // Still unclear how sensor types are assigned when setup is read from
39 // geometry.
40
41 // Check compatibility with already present sensors
42 if (!fSensors.empty()) {
43 if (sensor->GetType() != fSensors[0]->GetType()) {
44 LOG(error) << "Sensor type " << sensor->GetType()->GetTypeId() << " incompatible with sensor type "
45 << fSensors[0]->GetType()->GetTypeId();
46 return;
47 }
48 }
49
50 // Add sensor to the array
51 fSensors.push_back(sensor);
52
53 // Set sensor address and pointer to module
54 Int_t sensorId = fDaughters.size() - 1;
55 UInt_t address = CbmStsAddress::SetElementId(fAddress, kStsSensor, sensorId);
56 sensor->SetAddress(address);
57 sensor->SetModule(this);
58
59 return;
60}
61// -------------------------------------------------------------------------
62
63// ----- Add a signal to the buffer ------------------------------------
65{
66
67 // TODO: implementation
68}
69// -------------------------------------------------------------------------
@ kStsModule
Module.
@ kStsSensor
Sensor.
int Int_t
double Double_t
static UInt_t SetElementId(UInt_t address, Int_t level, Int_t newId)
Set the index of an element leaving the other element levels untouched.
UInt_t fAddress
Unique address.
vector< CbmStsElement * > fDaughters
Array of daughters.
CbmStsElement()
Default constructor.
void AddSignal(Int_t channel, Double_t time, Double_t charge)
Add an analogue signal to the buffer.
void AddSensor(CbmStsSenzor *sensor)
Add a sensor to the module.
vector< CbmStsSenzor * > fSensors
Array of sensors.
CbmStsModule()
Default constructor.
virtual ~CbmStsModule()
Destructor.
map< Int_t, pair< Double_t, Double_t > > fBuffer
Buffer for the analogue signals.
Int_t GetTypeId() const
Type identifier.
Class representing an instance of a sensor in the CBM-STS.
void SetModule(CbmStsModule *module)
Set a pointer to the mother module.
CbmStsSensorType * GetType() const
Pointer to sensor type.
void SetAddress(UInt_t address)
Set the sensor address.