BmnRoot
Loading...
Searching...
No Matches
CbmStsModule.cxx
Go to the documentation of this file.
1
7#include "FairLogger.h"
11
12
13// ----- Default constructor -------------------------------------------
14CbmStsModule::CbmStsModule() : CbmStsElement(), fSensors(), fBuffer()
15{
16}
17// -------------------------------------------------------------------------
18
19
20
21// ----- Standard constructor ------------------------------------------
22CbmStsModule::CbmStsModule(const char* name, const char* title,
23 TGeoPhysicalNode* node) :
24 CbmStsElement(name, title, kStsModule, node),
25 fSensors(), fBuffer()
26{
27}
28// -------------------------------------------------------------------------
29
30
31
32// --- Destructor --------------------------------------------------------
35// -------------------------------------------------------------------------
36
37
38
39// ----- Add a sensor -----------------------------------------------------
41
42 // TODO: Unify adding elements from base class and adding sensors
43 // If AddDaughter is used, compatibility of sensor types is not assured.
44 // Still unclear how sensor types are assigned when setup is read from
45 // geometry.
46
47 // Check compatibility with already present sensors
48 if ( ! fSensors.empty() ) {
49 if ( sensor->GetType() != fSensors[0]->GetType() ) {
50 LOG(error) << "Sensor type " << sensor->GetType()->GetTypeId()
51 << " incompatible with sensor type "
52 << fSensors[0]->GetType()->GetTypeId();
53 return;
54 }
55 }
56
57 // Add sensor to the array
58 fSensors.push_back(sensor);
59
60 // Set sensor address and pointer to module
61 Int_t sensorId = fDaughters.size() - 1;
63 sensorId);
64 sensor->SetAddress(address);
65 sensor->SetModule(this);
66
67 return;
68}
69// -------------------------------------------------------------------------
70
71
72// ----- Add a signal to the buffer ------------------------------------
73void CbmStsModule::AddSignal(Int_t channel, Double_t time,
74 Double_t charge) {
75
76// TODO: implementation
77
78}
79// -------------------------------------------------------------------------
@ kStsModule
Module.
@ kStsSensor
Sensor.
static UInt_t SetElementId(UInt_t address, Int_t level, Int_t newId)
Class representing an element of the STS setup.
UInt_t fAddress
Unique address.
vector< CbmStsElement * > fDaughters
Array of daughters.
void AddSignal(Int_t channel, Double_t time, Double_t charge)
void AddSensor(CbmStsSenzor *sensor)
virtual ~CbmStsModule()
Int_t GetTypeId() const
Class representing an instance of a sensor in the CBM-STS.
void SetModule(CbmStsModule *module)
CbmStsSensorType * GetType() const
void SetAddress(UInt_t address)