CbmRoot
CbmMvdSensor.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- CbmMvdSensor header file -----
3 // ----- Created 02/12/08 by M. Deveaux -----
4 // -------------------------------------------------------------------------
5 
6 
15 #ifndef CBMMVDSENSOR_H
16 #define CBMMVDSENSOR_H 1
17 
18 #include "CbmMvdDetectorId.h"
19 #include "TNamed.h"
20 
21 #include "CbmMvdCluster.h"
24 
25 #include "TClonesArray.h"
26 #include "TGeoBBox.h"
27 #include "TObjArray.h"
28 
29 #include <map>
30 
31 #include "TString.h"
32 
33 // data classes
34 class CbmMvdPoint;
35 class CbmMvdDigi;
36 class TGeoHMatrix;
37 class TGeoHMatrix;
38 
39 
40 class CbmMvdSensor : public TNamed, CbmMvdDetectorId {
41 
42 public:
44  CbmMvdSensor();
45 
46 
47  CbmMvdSensor(const char* name,
48  CbmMvdSensorDataSheet* dataSheet,
49  TString volName,
50  TString nodeName,
51  Int_t stationNr,
52  Int_t volume,
53  Double_t sensorStartTime);
54 
55 
57  virtual ~CbmMvdSensor();
58 
59 
61  Int_t GetStationNr() const { return fStationNr; }
62  Int_t GetVolumeId() const { return fVolumeId; }
63  Int_t GetDetectorID() const { return fDetectorID; };
64  Int_t GetSensorNr() const { return fSensorNr; }
65 
66  Double_t GetDX() const { return fShape->GetDX(); };
67  Double_t GetDY() const { return fShape->GetDY(); };
68  Double_t GetDZ() const { return fShape->GetDZ(); };
69  Double_t GetX() const {
70  return fSensorPosition[0];
71  }; // returns x position for pixle 0/0
72  Double_t GetY() const {
73  return fSensorPosition[1];
74  }; // returns y position for pixle 0/0
75  Double_t GetZ() const { return fSensorPosition[2]; }; // returns z position
76  Double_t GetIntegrationtime() const {
78  };
79  Double_t GetCurrentEventTime() const { return fcurrentEventTime; };
80  Double_t GetReadoutTime(Double_t absoluteTime) const;
81 
82  TString GetNodeName() { return fNodeName; };
85  void SetMap(std::map<Int_t, Int_t> SensorMap) {
86  fSensorMap = SensorMap;
87  } // Get Sensor Map to identify every Sensor
88  void SendInput(CbmMvdPoint* point);
89  void SendInputDigi(CbmMvdDigi* digi);
90  void SendInputDigiToHit(CbmMvdDigi* digi);
91  void SendInputCluster(CbmMvdCluster* cluster);
92  void SetStation(Int_t StationNumber) { fStationNr = StationNumber; }
93 
94 
96  void LocalToTop(Double_t* local, Double_t* lab);
97  void TopToLocal(Double_t* lab, Double_t* local);
98  void LocalToPixel(Double_t* local, Int_t& pixelNumberX, Int_t& pixelNumberY);
99  void PixelToLocal(Int_t pixelNumberX, Int_t pixelNumberY, Double_t* local);
100  void PixelToTop(Int_t pixelNumberX, Int_t pixelNumberY, Double_t* lab);
101  void TopToPixel(Double_t* lab, Int_t& pixelNumberX, Int_t& pixelNumberY);
102  Int_t GetFrameNumber(Int_t pixelNumberY, Double_t absoluteTime) const;
103  Int_t GetDigiPlugin() const { return fDigiPlugin; };
104  Int_t GetHitPlugin() const { return fHitPlugin; };
105  Int_t GetClusterPlugin() const { return fClusterPlugin; }
106 
107  void SetDigiPlugin(const Int_t& nPlugin) { fDigiPlugin = nPlugin; };
108  void SetHitPlugin(const Int_t& nPlugin) { fHitPlugin = nPlugin; };
109  void SetClusterPlugin(const Int_t& nPlugin) { fClusterPlugin = nPlugin; }
110 
111  void SetAlignment(TGeoHMatrix* alignmentMatrix);
112  TGeoHMatrix* GetAlignmentCorr() { return fAlignmentCorr; };
113  TGeoHMatrix* GetRecoMatrix() { return fRecoMatrix; };
114 
115 
117  void ReadSensorGeometry(TString nodeName);
118 
119  void Init();
120  void ShowDebugHistos();
123  void SetPluginList(TObjArray* pluginArray) { fPluginArray = pluginArray; };
124 
126  fPluginArray->AddLast((TObject*) plugin);
127  };
128 
129  CbmMvdSensorPlugin* GetPlugin(UInt_t nPlugin) {
130  return (CbmMvdSensorPlugin*) fPluginArray->At(nPlugin);
131  }
132 
133  void SetMisalignment(Float_t misalignment[3]) {
134  for (Int_t i = 0; i < 3; i++)
135  epsilon[i] = misalignment[i];
136  }
137 
139  virtual void Print(Option_t* opt = "") const;
140 
144  void ExecChain(); //runs chain of plugins
145  void Exec(UInt_t nPlugin); //runs individual plugin
146  void ExecTo(UInt_t nPlugin);
147  void ExecFrom(UInt_t nPlugin);
148  void Finish();
149 
152  void ClearInputArray() { ; }
153  // void AddInputObject(TObject* dataObject);
154 
155  TClonesArray* GetOutputBuffer() const;
156  TClonesArray* GetOutputArray(Int_t nPlugin) const;
157  TClonesArray* GetOutputMatch() const;
158  Int_t GetOutputArrayLen(Int_t nPlugin) const;
159 
160  void SetProduceNoise();
161 
162 
163 protected:
164  Int_t fStationNr; // Station identifier
165  Int_t fSensorNr; // Sensor identifier
166  Int_t fVolumeId; // MC unique volume ID
167  Int_t fDetectorID; // unique Detector ID
168  Int_t fDigiPlugin;
169  Int_t fHitPlugin;
170  Int_t fDigiLen;
172  TString fVolName; // Name of the volume attached to this sensor
173  TString fNodeName; // full name of the volume (including path) of the volume
174  TClonesArray* foutputDigis;
175  TClonesArray* foutputCluster;
176  TClonesArray* foutputDigiMatch;
177  TClonesArray* foutputBuffer;
178  TClonesArray* fcurrentPoints;
180  Float_t epsilon[3];
181 
182 
184  TGeoBBox* fShape; // volume corresponding to the sensor in the TGeoManager
185  TGeoHMatrix*
186  fMCMatrix; // coordinate transformation from Master to MC-Position of this volume
187  TGeoHMatrix* fRecoMatrix; // The reconstructed position of the sensor
188  TGeoHMatrix*
189  fAlignmentCorr; // Correction of the sensor position according to alignment
190  Double_t
191  fTempCoordinate[3]; // Just a vector to buffer temporarily position data.
192  Double_t fSensorPosition[3];
193 
196  std::map<Int_t, Int_t> fSensorMap;
197 
199  TObjArray* fPluginArray;
200 
203  Double_t fSensorStartTime; // Defines the start time of the sensor
204  // as expressed according to CBM time stamps
205  // Unit: [s]
206 
207  Bool_t initialized;
208 
209 private:
212 
214 };
215 
216 
217 #endif
CbmMvdDetectorId
Definition: CbmMvdDetectorId.h:32
CbmMvdSensor::GetDetectorID
Int_t GetDetectorID() const
Definition: CbmMvdSensor.h:63
CbmMvdSensor::SetDigiPlugin
void SetDigiPlugin(const Int_t &nPlugin)
Definition: CbmMvdSensor.h:107
CbmMvdSensorDataSheet::GetIntegrationTime
virtual Double_t GetIntegrationTime()
Definition: CbmMvdSensorDataSheet.h:89
CbmMvdSensor::fRecoMatrix
TGeoHMatrix * fRecoMatrix
Definition: CbmMvdSensor.h:187
CbmMvdSensor::fSensorNr
Int_t fSensorNr
Definition: CbmMvdSensor.h:165
CbmMvdSensor::fNodeName
TString fNodeName
Definition: CbmMvdSensor.h:173
CbmMvdSensor::GetOutputArray
TClonesArray * GetOutputArray(Int_t nPlugin) const
Definition: CbmMvdSensor.cxx:491
CbmMvdSensor::fStationNr
Int_t fStationNr
Definition: CbmMvdSensor.h:164
CbmMvdSensor::GetZ
Double_t GetZ() const
Definition: CbmMvdSensor.h:75
CbmMvdSensor::Exec
void Exec(UInt_t nPlugin)
Definition: CbmMvdSensor.cxx:416
CbmMvdSensor::SendInputCluster
void SendInputCluster(CbmMvdCluster *cluster)
Definition: CbmMvdSensor.cxx:365
CbmMvdSensor::fPluginArray
TObjArray * fPluginArray
Definition: CbmMvdSensor.h:199
CbmMvdSensor::SetMap
void SetMap(std::map< Int_t, Int_t > SensorMap)
Definition: CbmMvdSensor.h:85
CbmMvdSensor::GetDY
Double_t GetDY() const
Definition: CbmMvdSensor.h:67
CbmMvdSensor::GetReadoutTime
Double_t GetReadoutTime(Double_t absoluteTime) const
Definition: CbmMvdSensor.cxx:670
CbmMvdSensor::fSensorMap
std::map< Int_t, Int_t > fSensorMap
Definition: CbmMvdSensor.h:196
CbmMvdSensor::TopToLocal
void TopToLocal(Double_t *lab, Double_t *local)
Definition: CbmMvdSensor.cxx:573
CbmMvdSensor::SetDataSheet
void SetDataSheet(CbmMvdSensorDataSheet *sheet)
Definition: CbmMvdSensor.h:84
CbmMvdSensor::SetMisalignment
void SetMisalignment(Float_t misalignment[3])
Definition: CbmMvdSensor.h:133
CbmMvdSensorPlugin
Definition: CbmMvdSensorPlugin.h:24
CbmMvdSensor::ExecFrom
void ExecFrom(UInt_t nPlugin)
Definition: CbmMvdSensor.cxx:463
CbmMvdSensor::PixelToLocal
void PixelToLocal(Int_t pixelNumberX, Int_t pixelNumberY, Double_t *local)
Definition: CbmMvdSensor.cxx:603
CbmMvdSensorPlugin.h
CbmMvdSensor::fTempCoordinate
Double_t fTempCoordinate[3]
Definition: CbmMvdSensor.h:191
CbmMvdSensor::Finish
void Finish()
Definition: CbmMvdSensor.cxx:703
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmMvdSensor::fShape
TGeoBBox * fShape
Definition: CbmMvdSensor.h:184
CbmMvdSensor::SetHitPlugin
void SetHitPlugin(const Int_t &nPlugin)
Definition: CbmMvdSensor.h:108
CbmMvdSensor::Print
virtual void Print(Option_t *opt="") const
Definition: CbmMvdSensor.cxx:688
CbmMvdSensor::Init
void Init()
Definition: CbmMvdSensor.cxx:203
CbmMvdSensor::SetStation
void SetStation(Int_t StationNumber)
Definition: CbmMvdSensor.h:92
CbmMvdSensor::fcurrentEventTime
Double_t fcurrentEventTime
Definition: CbmMvdSensor.h:179
CbmMvdSensor::LocalToTop
void LocalToTop(Double_t *local, Double_t *lab)
Definition: CbmMvdSensor.cxx:566
CbmMvdCluster
Definition: CbmMvdCluster.h:27
CbmMvdDetectorId.h
CbmMvdSensor::fDigiPlugin
Int_t fDigiPlugin
Definition: CbmMvdSensor.h:168
lab
Double_t lab[3]
Definition: CbmMvdSensorDigiToHitTask.cxx:62
CbmMvdSensor::SetPluginList
void SetPluginList(TObjArray *pluginArray)
Definition: CbmMvdSensor.h:123
CbmMvdSensor::GetStationNr
Int_t GetStationNr() const
Definition: CbmMvdSensor.h:61
CbmMvdSensor::fSensorPosition
Double_t fSensorPosition[3]
Definition: CbmMvdSensor.h:192
CbmMvdSensor::GetIntegrationtime
Double_t GetIntegrationtime() const
Definition: CbmMvdSensor.h:76
CbmMvdSensor::epsilon
Float_t epsilon[3]
Definition: CbmMvdSensor.h:180
CbmMvdSensor::operator=
CbmMvdSensor operator=(const CbmMvdSensor &)
CbmMvdSensor::ExecChain
void ExecChain()
Definition: CbmMvdSensor.cxx:380
CbmMvdSensor::LocalToPixel
void LocalToPixel(Double_t *local, Int_t &pixelNumberX, Int_t &pixelNumberY)
Definition: CbmMvdSensor.cxx:582
CbmMvdSensor::ReadSensorGeometry
void ReadSensorGeometry(TString nodeName)
Definition: CbmMvdSensor.cxx:142
CbmMvdSensor::fDetectorID
Int_t fDetectorID
Definition: CbmMvdSensor.h:167
CbmMvdSensor::fDigiLen
Int_t fDigiLen
Definition: CbmMvdSensor.h:170
CbmMvdSensor::GetHitPlugin
Int_t GetHitPlugin() const
Definition: CbmMvdSensor.h:104
CbmMvdSensor
Definition: CbmMvdSensor.h:40
CbmMvdPoint
Definition: CbmMvdPoint.h:28
CbmMvdSensor::ClearInputArray
void ClearInputArray()
Definition: CbmMvdSensor.h:152
CbmMvdSensor::SendInput
void SendInput(CbmMvdPoint *point)
Definition: CbmMvdSensor.cxx:306
CbmMvdSensor::GetOutputMatch
TClonesArray * GetOutputMatch() const
Definition: CbmMvdSensor.cxx:545
CbmMvdSensor::fMCMatrix
TGeoHMatrix * fMCMatrix
Definition: CbmMvdSensor.h:186
CbmMvdSensor::GetOutputArrayLen
Int_t GetOutputArrayLen(Int_t nPlugin) const
Definition: CbmMvdSensor.cxx:522
CbmMvdSensor::ClassDef
ClassDef(CbmMvdSensor, 1)
CbmMvdSensor::GetDigiPlugin
Int_t GetDigiPlugin() const
Definition: CbmMvdSensor.h:103
CbmMvdSensor::SendInputDigiToHit
void SendInputDigiToHit(CbmMvdDigi *digi)
Definition: CbmMvdSensor.cxx:350
CbmMvdSensor::GetNodeName
TString GetNodeName()
Definition: CbmMvdSensor.h:82
CbmMvdSensor::GetX
Double_t GetX() const
Definition: CbmMvdSensor.h:69
CbmMvdSensor::foutputDigis
TClonesArray * foutputDigis
Definition: CbmMvdSensor.h:174
CbmMvdSensor::ExecTo
void ExecTo(UInt_t nPlugin)
Definition: CbmMvdSensor.cxx:429
CbmMvdSensor::PixelToTop
void PixelToTop(Int_t pixelNumberX, Int_t pixelNumberY, Double_t *lab)
Definition: CbmMvdSensor.cxx:624
CbmMvdSensor::CbmMvdSensor
CbmMvdSensor(const CbmMvdSensor &)
CbmMvdSensor::GetAlignmentCorr
TGeoHMatrix * GetAlignmentCorr()
Definition: CbmMvdSensor.h:112
CbmMvdSensor::GetDZ
Double_t GetDZ() const
Definition: CbmMvdSensor.h:68
CbmMvdSensor::fHitPlugin
Int_t fHitPlugin
Definition: CbmMvdSensor.h:169
CbmMvdSensor::foutputBuffer
TClonesArray * foutputBuffer
Definition: CbmMvdSensor.h:177
CbmMvdSensor::SendInputDigi
void SendInputDigi(CbmMvdDigi *digi)
Definition: CbmMvdSensor.cxx:336
CbmMvdSensor::GetClusterPlugin
Int_t GetClusterPlugin() const
Definition: CbmMvdSensor.h:105
CbmMvdSensor::GetOutputBuffer
TClonesArray * GetOutputBuffer() const
Definition: CbmMvdSensor.cxx:553
CbmMvdSensor::GetDataSheet
CbmMvdSensorDataSheet * GetDataSheet()
Definition: CbmMvdSensor.h:83
CbmMvdSensor::fVolumeId
Int_t fVolumeId
Definition: CbmMvdSensor.h:166
CbmMvdSensor::fSensorStartTime
Double_t fSensorStartTime
Definition: CbmMvdSensor.h:203
CbmMvdSensor::initialized
Bool_t initialized
Definition: CbmMvdSensor.h:207
CbmMvdSensor::SetAlignment
void SetAlignment(TGeoHMatrix *alignmentMatrix)
Definition: CbmMvdSensor.cxx:133
CbmMvdSensor::CbmMvdSensor
CbmMvdSensor()
Definition: CbmMvdSensor.cxx:42
CbmMvdSensorDataSheet.h
CbmMvdSensor::~CbmMvdSensor
virtual ~CbmMvdSensor()
Definition: CbmMvdSensor.cxx:130
CbmMvdDigi
Definition: CbmMvdDigi.h:21
CbmMvdSensor::GetPlugin
CbmMvdSensorPlugin * GetPlugin(UInt_t nPlugin)
Definition: CbmMvdSensor.h:129
CbmMvdSensor::foutputCluster
TClonesArray * foutputCluster
Definition: CbmMvdSensor.h:175
CbmMvdSensor::GetSensorNr
Int_t GetSensorNr() const
Definition: CbmMvdSensor.h:64
CbmMvdSensor::GetRecoMatrix
TGeoHMatrix * GetRecoMatrix()
Definition: CbmMvdSensor.h:113
CbmMvdSensor::GetDX
Double_t GetDX() const
Definition: CbmMvdSensor.h:66
CbmMvdSensor::GetY
Double_t GetY() const
Definition: CbmMvdSensor.h:72
CbmMvdSensor::GetFrameNumber
Int_t GetFrameNumber(Int_t pixelNumberY, Double_t absoluteTime) const
Definition: CbmMvdSensor.cxx:643
CbmMvdSensor::fClusterPlugin
Int_t fClusterPlugin
Definition: CbmMvdSensor.h:171
CbmMvdSensor::TopToPixel
void TopToPixel(Double_t *lab, Int_t &pixelNumberX, Int_t &pixelNumberY)
Definition: CbmMvdSensor.cxx:633
CbmMvdSensor::foutputDigiMatch
TClonesArray * foutputDigiMatch
Definition: CbmMvdSensor.h:176
CbmMvdSensor::SetProduceNoise
void SetProduceNoise()
Definition: CbmMvdSensor.cxx:279
CbmMvdSensor::AddPlugin
void AddPlugin(CbmMvdSensorPlugin *plugin)
Definition: CbmMvdSensor.h:125
CbmMvdSensor::fcurrentPoints
TClonesArray * fcurrentPoints
Definition: CbmMvdSensor.h:178
CbmMvdSensor::fSensorData
CbmMvdSensorDataSheet * fSensorData
Definition: CbmMvdSensor.h:195
CbmMvdSensor::fAlignmentCorr
TGeoHMatrix * fAlignmentCorr
Definition: CbmMvdSensor.h:189
CbmMvdSensor::SetClusterPlugin
void SetClusterPlugin(const Int_t &nPlugin)
Definition: CbmMvdSensor.h:109
CbmMvdSensor::fVolName
TString fVolName
Definition: CbmMvdSensor.h:172
CbmMvdSensor::GetCurrentEventTime
Double_t GetCurrentEventTime() const
Definition: CbmMvdSensor.h:79
CbmMvdSensorDataSheet
Definition: CbmMvdSensorDataSheet.h:22
CbmMvdSensor::ShowDebugHistos
void ShowDebugHistos()
Definition: CbmMvdSensor.cxx:264
CbmMvdCluster.h
CbmMvdSensor::GetVolumeId
Int_t GetVolumeId() const
Definition: CbmMvdSensor.h:62