HerdSoftware  0.1.1
SiliconDetectorGeoParams.h
Go to the documentation of this file.
1 /*
2  * SiliconDetectorGeoParams.h
3  *
4  * Created on: 14 Nov 2018
5  * Author: Nicola Mori
6  */
7 
10 #ifndef HERD_SILICONDETECTORGEOPARAMS_H_
11 #define HERD_SILICONDETECTORGEOPARAMS_H_
12 
13 // HERD headers
14 #include "common/AxesArray.h"
15 #include "common/DefaultValues.h"
16 #include "common/SidesArray.h"
17 #include "dataobjects/Point.h"
19 
20 #ifdef HS_USE_ROOT
21 #include "Rtypes.h"
22 #endif
23 
24 // C++ headers
25 #include <vector>
26 
27 namespace Herd {
28 
33 public:
48  SiliconDetectorGeoParams(RefFrame::Side dside, size_t layerNumber, RefFrame::Direction stripMainSegm);
49 
51  virtual ~SiliconDetectorGeoParams() = default;
52 
58  size_t NWafers() const { return _waferPos.size(); }
59 
65  float StripPitch() const { return ElementPitch(); }
66 
72  int NStripsPerLadder() const { return _nStripsPerLadder; }
73 
79  float FirstStripPosition() const { return _firstStripPos; }
80 
89 
96  const AxesArray<int> &NLadders() const { return _nLadders; }
97 
103  const AxesArray<float> &WaferSize() const { return _waferSize; }
104 
111  Point ElementPosition(unsigned int volID) const override;
112 
119  Point StripPosition(unsigned int volID) const { return ElementPosition(volID); };
120 
127  const Point &WaferPosition(unsigned int volID) const { return _waferPos.at(volID); }
128 
135  Point LadderPosition(unsigned int ladderID) const;
136 
147  std::pair<RefFrame::Direction, RefFrame::Direction> StripSegmentationDirections() const {
148  return SegmentationDirections();
149  };
150 
161  std::pair<RefFrame::Direction, RefFrame::Direction> WaferSegmentationDirections() const;
162 
173  std::pair<RefFrame::Direction, RefFrame::Direction> LadderSegmentationDirections() const;
174 
180  unsigned int LadderIDFromStripID(unsigned int stripID) const;
181 
187  unsigned int LadderIDFromWaferID(unsigned int waferID) const;
188 
194  std::pair<unsigned int, unsigned int> WaferIDsFromLadderID(unsigned int ladderID) const;
195 
201  std::pair<unsigned int, unsigned int> StripIDsFromLadderID(unsigned int ladderID) const;
202 
211  unsigned int StripIDOnLadder(unsigned int stripID) const;
212 
220  unsigned int WaferID(const Point &position) const;
221 
229  virtual unsigned int ElementID(const Point &position) const override;
230 
240  unsigned int StripID(const Point &position) const { return ElementID(position); };
241 
250  SetSideAndMainSegmDir(dside, segmDir);
251  };
252 
259  virtual void SetSideAndMainSegmDir(RefFrame::Side dside, RefFrame::Direction segmDir) override;
260 
271  void SetStripPitch(float pitch);
272 
283  void SetNStripsPerLadder(int nStrips);
284 
296  void SetNWafersPerLadder(AxesArray<int> nWafers);
297 
306  void SetNLadders(AxesArray<int> nLadders);
307 
315  void SetWaferSize(const AxesArray<float> &sizes) { _waferSize = sizes; }
316 
325  void SetWaferPosition(size_t waferID, Point position) { _waferPos.at(waferID) = position; }
326 
327 private:
333  std::vector<Point> _waferPos;
334 
335 #ifdef HS_USE_ROOT
336  ClassDefOverride(SiliconDetectorGeoParams, 1)
337 #endif
338 };
339 
340 } // namespace Herd
341 
342 #endif /* HERD_SILICONDETECTORGEOPARAMS_H_ */
float FirstStripPosition() const
Get distance of first strip from wafer edge.
Definition: SiliconDetectorGeoParams.h:79
virtual std::pair< RefFrame::Direction, RefFrame::Direction > SegmentationDirections() const
Return the segmentation directions of the tracking elements.
Definition: TrackingDetectorGeoParams.h:111
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:24
virtual ~SiliconDetectorGeoParams()=default
Virtual destructor.
std::pair< RefFrame::Direction, RefFrame::Direction > WaferSegmentationDirections() const
Return the segmentation directions of the silicon Wafers.
Definition: SiliconDetectorGeoParams.cpp:104
AxesArray< int > _nLadders
Number of wafers in each ladder along the three axes.
Definition: SiliconDetectorGeoParams.h:332
#define DEFAULT_INIT(x)
Definition: DefaultValues.h:23
void SetWaferPosition(size_t waferID, Point position)
Set the wafer position for a given wafer.
Definition: SiliconDetectorGeoParams.h:325
Point StripPosition(unsigned int volID) const
Get position of a given strip.
Definition: SiliconDetectorGeoParams.h:119
void SetNLadders(AxesArray< int > nLadders)
Set the number of ladders along each axis.
Definition: SiliconDetectorGeoParams.cpp:80
void SetWaferSize(const AxesArray< float > &sizes)
Set the wafer sizes along the three axes.
Definition: SiliconDetectorGeoParams.h:315
Side
Aliases for the five sides. RefFrame.h common/RefFrame.h.
Definition: RefFrame.h:104
SiliconDetectorGeoParams()
Default constructor.
Definition: SiliconDetectorGeoParams.h:38
std::pair< unsigned int, unsigned int > StripIDsFromLadderID(unsigned int ladderID) const
Retrieves the volume ID of the first and last strip contained in the ladder with the given volumeID...
Definition: SiliconDetectorGeoParams.cpp:170
size_t NWafers() const
Get the total number of wafers in a single layer.
Definition: SiliconDetectorGeoParams.h:58
std::pair< RefFrame::Direction, RefFrame::Direction > LadderSegmentationDirections() const
Return the segmentation directions of the silicon Ladders.
Definition: SiliconDetectorGeoParams.cpp:108
A class describing a vector in 3D space.
Definition: Vec3D.h:33
AxesArray< int > _nWafersPerLadder
Dimensions of a Si wafer along the three axes.
Definition: SiliconDetectorGeoParams.h:331
virtual unsigned int ElementID(const Point &position) const override
Utility function to get volumeID from a set of coordinates. Reimplemented in derived classes...
Definition: SiliconDetectorGeoParams.cpp:200
const Point & WaferPosition(unsigned int volID) const
Get position of a given wafer in layer.
Definition: SiliconDetectorGeoParams.h:127
void SetStripPitch(float pitch)
Set the strip pitch.
Definition: SiliconDetectorGeoParams.cpp:22
virtual float ElementPitch() const
Get element pitch.
Definition: TrackingDetectorGeoParams.h:75
std::pair< unsigned int, unsigned int > WaferIDsFromLadderID(unsigned int ladderID) const
Retrieves the volume ID of the first and last wafers contained in the ladder with the given volumeID...
Definition: SiliconDetectorGeoParams.cpp:162
unsigned int LadderIDFromWaferID(unsigned int waferID) const
Retrieves the volume ID of the ladder containing the wafer with the given volumeID.
Definition: SiliconDetectorGeoParams.cpp:158
virtual void SetSideAndMainSegmDir(RefFrame::Side dside, RefFrame::Direction segmDir) override
Set the detector side and the main segmentation direction for channels.
Definition: SiliconDetectorGeoParams.cpp:229
unsigned int WaferID(const Point &position) const
Utility function to get waferID from a set of coordinates.
Definition: SiliconDetectorGeoParams.cpp:183
int NStripsPerLadder() const
Number of strips for each ladder.
Definition: SiliconDetectorGeoParams.h:72
void SetNWafersPerLadder(AxesArray< int > nWafers)
Set the number of wafers in each ladder along each axis.
Definition: SiliconDetectorGeoParams.cpp:54
const AxesArray< int > & NLadders() const
Get the number of ladder that make up a layer. This is intended as number of ladders along each direc...
Definition: SiliconDetectorGeoParams.h:96
unsigned int LadderIDFromStripID(unsigned int stripID) const
Retrieves the volume ID of the ladder containing the strip with the given volumeID.
Definition: SiliconDetectorGeoParams.cpp:150
AxesArray< float > _waferSize
Number of strips in each wafer.
Definition: SiliconDetectorGeoParams.h:330
unsigned int StripIDOnLadder(unsigned int stripID) const
Returns the strip ID on ladder.
Definition: SiliconDetectorGeoParams.cpp:179
std::vector< Point > _waferPos
Number of ladders in each wafer along the three axes.
Definition: SiliconDetectorGeoParams.h:333
Data structure for single silicon layer geometry parameters.
Definition: SiliconDetectorGeoParams.h:32
unsigned int StripID(const Point &position) const
Utility function to get stripID from a set of coordinates. Calls ElementID.
Definition: SiliconDetectorGeoParams.h:240
void SetNStripsPerLadder(int nStrips)
Set the number of strips per ladder.
Definition: SiliconDetectorGeoParams.cpp:38
int _nStripsPerLadder
Position of the first strip w.r.t the left border of the wafer [cm];.
Definition: SiliconDetectorGeoParams.h:329
float StripPitch() const
Get strip pitch.Calls ChannelPitch. Kept for backwards compatibility.
Definition: SiliconDetectorGeoParams.h:65
const AxesArray< float > & WaferSize() const
Get the dimensions of the single wafer.
Definition: SiliconDetectorGeoParams.h:103
const AxesArray< int > & NWafersPerLadder() const
Get the number of wafers that make up a ladder. This is intended as number of wafers along each direc...
Definition: SiliconDetectorGeoParams.h:88
Base data structure for single tracking detector layer geometry parameters.
Definition: TrackingDetectorGeoParams.h:28
float _firstStripPos
Definition: SiliconDetectorGeoParams.h:328
Point ElementPosition(unsigned int volID) const override
Get position of a given strip.
Definition: SiliconDetectorGeoParams.cpp:115
Point LadderPosition(unsigned int ladderID) const
Get position of a given ladder.
Definition: SiliconDetectorGeoParams.cpp:138
std::pair< RefFrame::Direction, RefFrame::Direction > StripSegmentationDirections() const
Return the segmentation directions of the silicon strips.
Definition: SiliconDetectorGeoParams.h:147
void SetSideAndStripMainSegmDir(RefFrame::Side dside, RefFrame::Direction segmDir)
Set the detector side and the main segmentation direction for strips. Calls SetSideAndMainSegmDir. Kept for backwards compatibility.
Definition: SiliconDetectorGeoParams.h:249
Direction
Aliases for the six axis directions. RefFrame.h common/RefFrame.h.
Definition: RefFrame.h:52