CbmRoot
Loading...
Searching...
No Matches
CbmMvdSensor.h
Go to the documentation of this file.
1/* Copyright (C) 2014-2019 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
19#ifndef CBMMVDSENSOR_H
20#define CBMMVDSENSOR_H 1
21
22#include "CbmMvdDetectorId.h" // for CbmMvdDetectorId
23#include "CbmMvdSensorDataSheet.h" // for CbmMvdSensorDataSheet
24#include "CbmMvdSensorPlugin.h" // for CbmMvdSensorPlugin
25
26#include <Rtypes.h> // for ClassDef
27#include <RtypesCore.h> // for Int_t, Double_t, Float_t, UInt_t
28#include <TGeoBBox.h> // for TGeoBBox
29#include <TNamed.h> // for TNamed
30#include <TObjArray.h> // for TObjArray
31#include <TString.h> // for TString
32
33#include <map> // for map
34#include <string> // for string
35
36class TBuffer;
37class TClass;
38class TClonesArray;
39class TGeoHMatrix;
40class TMemberInspector;
41class TObject;
42class TH1;
43
44class CbmMvdSensor : public TNamed, CbmMvdDetectorId {
45
46public:
49
50
51 CbmMvdSensor(const char* name, CbmMvdSensorDataSheet* dataSheet, TString volName, TString nodeName, Int_t stationNr,
52 Int_t volume, Double_t sensorStartTime);
53
54
56 virtual ~CbmMvdSensor();
57
58
60 Int_t GetStationNr() const { return fStationNr; }
61 Int_t GetVolumeId() const { return fVolumeId; }
62 Int_t GetDetectorID() const { return fDetectorID; };
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; };
78 void SetMap(std::map<Int_t, Int_t> SensorMap) { fSensorMap = SensorMap; } // Get Sensor Map to identify every Sensor
79 /*
80 //void SendInput(CbmMvdPoint* point);
81 void SendInputDigi(CbmMvdDigi* digi);
82 void SendInputDigiToHit(CbmMvdDigi* digi);
83 void SendInputCluster(CbmMvdCluster* cluster);
84*/
85 void SetStation(Int_t StationNumber) { fStationNr = StationNumber; }
86 void SendInputToPlugin(Int_t nPlugin, TObject* input);
87
88
90 void LocalToTop(Double_t* local, Double_t* lab);
91 void TopToLocal(Double_t* lab, Double_t* local);
92 void LocalToPixel(Double_t* local, Int_t& pixelNumberX, Int_t& pixelNumberY);
93 void PixelToLocal(Int_t pixelNumberX, Int_t pixelNumberY, Double_t* local);
94 void PixelToTop(Int_t pixelNumberX, Int_t pixelNumberY, Double_t* lab);
95 void TopToPixel(Double_t* lab, Int_t& pixelNumberX, Int_t& pixelNumberY);
96
97 Int_t GetFrameNumber(Double_t absoluteTime, Int_t pixelNumberY = 0) const;
98
99 Double_t GetFrameStartTime(Int_t frameNumber);
100 Double_t GetFrameEndTime(Int_t frameNumber) { return GetFrameStartTime(frameNumber + 1); }
101
102 Int_t GetDigiPlugin() const { return fDigiPlugin; };
103 Int_t GetHitPlugin() const { return fHitPlugin; };
104 Int_t GetClusterPlugin() const { return fClusterPlugin; }
105 TObjArray* GetPluginArray() { return fPluginArray; }
107 {
108 if (fPluginArray) { return fPluginArray->GetEntriesFast(); }
109 else
110 return 0;
111 }
112
113 Double_t ComputeIndecatedAnalogTime(Double_t hitMCTime, Float_t diodeCharge);
114 Double_t ComputeEndOfBusyTime(Double_t hitMCTime, Float_t diodeCharge, Int_t pixelNumberY);
115
116
117 void SetDigiPlugin(const Int_t& nPlugin) { fDigiPlugin = nPlugin; };
118 void SetHitPlugin(const Int_t& nPlugin) { fHitPlugin = nPlugin; };
119 void SetClusterPlugin(const Int_t& nPlugin) { fClusterPlugin = nPlugin; }
120
121 void SetAlignment(TGeoHMatrix* alignmentMatrix);
122 TGeoHMatrix* GetAlignmentCorr() { return fAlignmentCorr; };
123 TGeoHMatrix* GetRecoMatrix() { return fRecoMatrix; };
124
125
127 void ReadSensorGeometry(TString nodeName);
128
129 void Init();
130 void ShowDebugHistos();
133 void SetPluginList(TObjArray* pluginArray) { fPluginArray = pluginArray; };
134
135 void AddPlugin(CbmMvdSensorPlugin* plugin) { fPluginArray->AddLast((TObject*) plugin); };
136
137 CbmMvdSensorPlugin* GetPlugin(UInt_t nPlugin) { return (CbmMvdSensorPlugin*) fPluginArray->At(nPlugin); }
138
139 void SetMisalignment(Float_t misalignment[3])
140 {
141 for (Int_t i = 0; i < 3; i++)
142 epsilon[i] = misalignment[i];
143 }
144
146 virtual void Print(Option_t* opt = "") const;
147 std::string ToString() const;
151 void ExecChain(); //runs chain of plugins
152 void Exec(UInt_t nPlugin); //runs individual plugin
153 void ExecTo(UInt_t nPlugin);
154 void ExecFrom(UInt_t nPlugin);
155 void Finish();
156
159 void ClearInputArray() { ; }
160
161 TClonesArray* GetOutputBuffer() const;
162 TClonesArray* GetOutputArray(Int_t nPlugin) const;
163 TClonesArray* GetMatchArray(Int_t nPlugin) const;
164 Int_t GetOutputArrayLen(Int_t nPlugin) const;
165 TH1* GetHistogram(UInt_t nPlugin, UInt_t nHisto);
166 UInt_t GetNumberOfHistograms(UInt_t nPlugin);
167
168protected:
169 Int_t fStationNr; // Station identifier
170 Int_t fSensorNr; // Sensor identifier
171 Int_t fVolumeId; // MC unique volume ID
172 Int_t fDetectorID; // unique Detector ID
175 Int_t fDigiLen;
177 TString fVolName; // Name of the volume attached to this sensor
178 TString fNodeName; // full name of the volume (including path) of the volume
180 Float_t epsilon[3];
181
182
184 TGeoBBox* fShape; // volume corresponding to the sensor in the TGeoManager
185 TGeoHMatrix* fMCMatrix; // coordinate transformation from Master to MC-Position of this volume
186 TGeoHMatrix* fRecoMatrix; // The reconstructed position of the sensor
187 TGeoHMatrix* fAlignmentCorr; // Correction of the sensor position according to alignment
188 Double_t fTempCoordinate[3]; // Just a vector to buffer temporarily position data.
189 Double_t fSensorPosition[3];
190
193 std::map<Int_t, Int_t> fSensorMap;
194
196 TObjArray* fPluginArray;
197
200 Double_t fSensorStartTime; // Defines the start time of the sensor
201 // as expressed according to CBM time stamps
202 // Unit: [s]
203
205
206private:
209
211};
212
213
214#endif
Double_t lab[3]
virtual Double_t GetIntegrationTime()
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])
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
ClassDef(CbmMvdSensor, 1)
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()
TObjArray * fPluginArray
TGeoHMatrix * GetRecoMatrix()
Bool_t initialized
TClonesArray * GetOutputBuffer() const
TObjArray * GetPluginArray()
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
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