CbmRoot
Loading...
Searching...
No Matches
CbmMvdSensor.h
Go to the documentation of this file.
1/* Copyright (C) 2014-2025 Institut fuer Kernphysik, Goethe-Universitaet Frankfurt, Frankfurt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Michael Deveaux, Philipp Sitzmann [committer] */
4
5// -------------------------------------------------------------------------
6// ----- CbmMvdSensor header file -----
7// ----- Created 02/12/08 by M. Deveaux -----
8// -------------------------------------------------------------------------
9
10
17
18
19#ifndef CBMMVDSENSOR_H
20#define CBMMVDSENSOR_H 1
21
22#include "CbmMvdSensorDataSheet.h" // for CbmMvdSensorDataSheet
23#include "CbmMvdSensorPlugin.h" // for CbmMvdSensorPlugin
24
25#include <Rtypes.h> // for ClassDef
26#include <RtypesCore.h> // for Int_t, Double_t, Float_t, UInt_t
27#include <TGeoBBox.h> // for TGeoBBox
28#include <TNamed.h> // for TNamed
29#include <TObjArray.h> // for TObjArray
30#include <TString.h> // for TString
31
32#include <map> // for map
33#include <string> // for string
34
35class TBuffer;
36class TClass;
37class TClonesArray;
38class TGeoHMatrix;
39class TMemberInspector;
40class TObject;
41class TH1;
42
43class CbmMvdSensor : public TNamed {
44
45 public:
48
49
50 CbmMvdSensor(const char* name, CbmMvdSensorDataSheet* dataSheet, TString volName, TString nodeName, Int_t sensorNr,
51 Int_t volume, Double_t sensorStartTime);
52
53
55 virtual ~CbmMvdSensor();
56
57
59 uint32_t GetAddress() const { return fAddress; }
60 Int_t GetStationNr() const { return fStationNr; }
61 Int_t GetVolumeId() const { return fVolumeId; }
62 Int_t GetDetectorID() const { return fAddress; }; // TODO: remove detectorID (use fAddress instead)
63 Int_t GetSensorNr() const { return fSensorNr; }
64
65 Double_t GetDX() const { return fShape->GetDX(); };
66 Double_t GetDY() const { return fShape->GetDY(); };
67 Double_t GetDZ() const { return fShape->GetDZ(); };
68 Double_t GetX() const { return fSensorPosition[0]; }; // returns x position for pixle 0/0
69 Double_t GetY() const { return fSensorPosition[1]; }; // returns y position for pixle 0/0
70 Double_t GetZ() const { return fSensorPosition[2]; }; // returns z position
71 Double_t GetIntegrationtime() const { return fSensorData->GetIntegrationTime(); };
72 Double_t GetCurrentEventTime() const { return fcurrentEventTime; };
73 Double_t GetReadoutTime(Double_t absoluteTime) const;
74
75 TString GetNodeName() { return fNodeName; };
77
80 void SetAddress(uint32_t address) { fAddress = address; }
82 void SetMap(std::map<Int_t, Int_t> SensorMap) { fSensorMap = SensorMap; } // Get Sensor Map to identify every Sensor
83 /*
84 //void SendInput(CbmMvdPoint* point);
85 void SendInputDigi(CbmMvdDigi* digi);
86 void SendInputDigiToHit(CbmMvdDigi* digi);
87 void SendInputCluster(CbmMvdCluster* cluster);
88*/
89 void SetStation(Int_t StationNumber) { fStationNr = StationNumber; }
90 void SendInputToPlugin(Int_t nPlugin, TObject* input);
91
92
94 void LocalToTop(Double_t* local, Double_t* lab);
95 void TopToLocal(Double_t* lab, Double_t* local);
96 void LocalToPixel(Double_t* local, Int_t& pixelNumberX, Int_t& pixelNumberY);
97 void PixelToLocal(Int_t pixelNumberX, Int_t pixelNumberY, Double_t* local);
98 void PixelToTop(Int_t pixelNumberX, Int_t pixelNumberY, Double_t* lab);
99 void TopToPixel(Double_t* lab, Int_t& pixelNumberX, Int_t& pixelNumberY);
100
101 Int_t GetFrameNumber(Double_t absoluteTime, Int_t pixelNumberY = 0) const;
102
103 Double_t GetFrameStartTime(Int_t frameNumber);
104 Double_t GetFrameEndTime(Int_t frameNumber) { return GetFrameStartTime(frameNumber + 1); }
105
106 Int_t GetDigiPlugin() const { return fDigiPlugin; };
107 Int_t GetHitPlugin() const { return fHitPlugin; };
109 TObjArray* GetPluginArray() { return fPluginArray; }
111 {
112 if (fPluginArray) { return fPluginArray->GetEntriesFast(); }
113 else
114 return 0;
115 }
116
117 Double_t ComputeIndecatedAnalogTime(Double_t hitMCTime, Float_t diodeCharge);
118 Double_t ComputeEndOfBusyTime(Double_t hitMCTime, Float_t diodeCharge, Int_t pixelNumberY);
119
120
121 void SetDigiPlugin(const Int_t& nPlugin) { fDigiPlugin = nPlugin; };
122 void SetHitPlugin(const Int_t& nPlugin) { fHitPlugin = nPlugin; };
123 void SetClusterPlugin(const Int_t& nPlugin) { fClusterPlugin = nPlugin; }
124
125 void SetAlignment(TGeoHMatrix* alignmentMatrix);
126 TGeoHMatrix* GetAlignmentCorr() { return fAlignmentCorr; };
127 TGeoHMatrix* GetRecoMatrix() { return fRecoMatrix; };
128
129
131 void ReadSensorGeometry(TString nodeName);
132
133 void Init();
134 void ShowDebugHistos();
136
137 void SetPluginList(TObjArray* pluginArray) { fPluginArray = pluginArray; };
138
139 void AddPlugin(CbmMvdSensorPlugin* plugin) { fPluginArray->AddLast((TObject*) plugin); };
140
141 CbmMvdSensorPlugin* GetPlugin(UInt_t nPlugin) { return (CbmMvdSensorPlugin*) fPluginArray->At(nPlugin); }
142
143 void SetMisalignment(Float_t misalignment[3])
144 {
145 for (Int_t i = 0; i < 3; i++)
146 epsilon[i] = misalignment[i];
147 }
148
150 virtual void Print(Option_t* opt = "") const;
151 std::string ToString() const;
153
154
155 void ExecChain(); //runs chain of plugins
156 void Exec(UInt_t nPlugin); //runs individual plugin
157 void ExecTo(UInt_t nPlugin);
158 void ExecFrom(UInt_t nPlugin);
159 void Finish();
160
162
163 void ClearInputArray() { ; }
164
165 TClonesArray* GetOutputBuffer() const;
166 TClonesArray* GetOutputArray(Int_t nPlugin) const;
167 TClonesArray* GetMatchArray(Int_t nPlugin) const;
168 Int_t GetOutputArrayLen(Int_t nPlugin) const;
169 TH1* GetHistogram(UInt_t nPlugin, UInt_t nHisto);
170 UInt_t GetNumberOfHistograms(UInt_t nPlugin);
171
172protected:
173 Int_t fStationNr; // Station identifier // TODO: re-define from fAddress
174 Int_t fSensorNr; // Sensor identifier
175 Int_t fVolumeId; // MC unique volume ID
180 uint32_t fAddress; // Address of the sensor (bits 0-12 of CbmMvdAddress)
181 TString fVolName; // Name of the volume attached to this sensor
182 TString fNodeName; // full name of the volume (including path) of the volume
185
186
188 TGeoBBox* fShape; // volume corresponding to the sensor in the TGeoManager
189 TGeoHMatrix* fMCMatrix; // coordinate transformation from Master to MC-Position of this volume
190 TGeoHMatrix* fRecoMatrix; // The reconstructed position of the sensor
191 TGeoHMatrix* fAlignmentCorr; // Correction of the sensor position according to alignment
192 Double_t fTempCoordinate[3]; // Just a vector to buffer temporarily position data.
193 Double_t fSensorPosition[3];
194
197 std::map<Int_t, Int_t> fSensorMap;
198
200 TObjArray* fPluginArray;
201
203
204 Double_t fSensorStartTime; // Defines the start time of the sensor
205 // as expressed according to CBM time stamps
206 // Unit: [s]
207
209
210private:
213
215};
216
217
218#endif
Double_t lab[3]
float Float_t
int Int_t
bool Bool_t
Int_t GetOutputArrayLen(Int_t nPlugin) const
Int_t GetDigiPlugin() const
TClonesArray * GetMatchArray(Int_t nPlugin) const
CbmMvdSensor(const CbmMvdSensor &)
void LocalToTop(Double_t *local, Double_t *lab)
Int_t GetFrameNumber(Double_t absoluteTime, Int_t pixelNumberY=0) const
void TopToLocal(Double_t *lab, Double_t *local)
void PixelToTop(Int_t pixelNumberX, Int_t pixelNumberY, Double_t *lab)
void SetAlignment(TGeoHMatrix *alignmentMatrix)
TString GetNodeName()
void SetMap(std::map< Int_t, Int_t > SensorMap)
Double_t GetDX() const
Double_t fTempCoordinate[3]
UInt_t GetNumberOfHistograms(UInt_t nPlugin)
void SetMisalignment(Float_t misalignment[3])
uint32_t fAddress
TH1 * GetHistogram(UInt_t nPlugin, UInt_t nHisto)
Double_t GetY() const
Int_t GetSensorNr() const
void PixelToLocal(Int_t pixelNumberX, Int_t pixelNumberY, Double_t *local)
void ReadSensorGeometry(TString nodeName)
Double_t GetFrameStartTime(Int_t frameNumber)
void SetDataSheet(CbmMvdSensorDataSheet *sheet)
Double_t GetDY() const
Int_t GetHitPlugin() const
void ExecTo(UInt_t nPlugin)
void SetStation(Int_t StationNumber)
TString fVolName
void SendInputToPlugin(Int_t nPlugin, TObject *input)
CbmMvdSensorDataSheet * fSensorData
void AddPlugin(CbmMvdSensorPlugin *plugin)
CbmMvdSensor operator=(const CbmMvdSensor &)
Int_t GetClusterPlugin() const
Double_t GetCurrentEventTime() const
void ClearInputArray()
ClassDef(CbmMvdSensor, 2)
TObjArray * fPluginArray
TGeoHMatrix * GetRecoMatrix()
Bool_t initialized
TClonesArray * GetOutputBuffer() const
TObjArray * GetPluginArray()
void SetAddress(uint32_t address)
Sets a hardware address of the sensor.
virtual void Print(Option_t *opt="") const
Double_t GetX() const
Double_t fcurrentEventTime
void LocalToPixel(Double_t *local, Int_t &pixelNumberX, Int_t &pixelNumberY)
Int_t GetVolumeId() const
Int_t GetDetectorID() const
TString fNodeName
UInt_t GetPluginArraySize()
void SetDigiPlugin(const Int_t &nPlugin)
void Exec(UInt_t nPlugin)
Double_t GetIntegrationtime() const
std::map< Int_t, Int_t > fSensorMap
TGeoHMatrix * GetAlignmentCorr()
void SetClusterPlugin(const Int_t &nPlugin)
Double_t GetZ() const
Double_t fSensorStartTime
Double_t ComputeEndOfBusyTime(Double_t hitMCTime, Float_t diodeCharge, Int_t pixelNumberY)
void ShowDebugHistos()
void SetPluginList(TObjArray *pluginArray)
TGeoHMatrix * fRecoMatrix
void ExecFrom(UInt_t nPlugin)
Double_t ComputeIndecatedAnalogTime(Double_t hitMCTime, Float_t diodeCharge)
Float_t epsilon[3]
CbmMvdSensor()
includes from C
Double_t GetReadoutTime(Double_t absoluteTime) const
Double_t GetFrameEndTime(Int_t frameNumber)
Double_t fSensorPosition[3]
TGeoHMatrix * fMCMatrix
TGeoBBox * fShape
uint32_t GetAddress() const
virtual ~CbmMvdSensor()
std::string ToString() const
Int_t GetStationNr() const
Double_t GetDZ() const
CbmMvdSensorPlugin * GetPlugin(UInt_t nPlugin)
void SetHitPlugin(const Int_t &nPlugin)
void TopToPixel(Double_t *lab, Int_t &pixelNumberX, Int_t &pixelNumberY)
TClonesArray * GetOutputArray(Int_t nPlugin) const
Int_t fClusterPlugin
CbmMvdSensorDataSheet * GetDataSheet()
TGeoHMatrix * fAlignmentCorr