HerdSoftware  0.4.0
ScdChannelGeoInfo.h
Go to the documentation of this file.
1 /*
2  * ScdChannelGeoInfo.h
3  *
4  * Created on: 6 Oct 2020
5  * Author: Nicola Mori
6  */
7 
10 #ifndef HERD_SCDCHANNELGEOINFO_H_
11 #define HERD_SCDCHANNELGEOINFO_H_
12 
13 // HerdSoftware headers
15 
16 #ifdef HS_USE_ROOT
17 #include "Rtypes.h"
18 #endif
19 
20 #include <optional>
21 #include <utility>
22 
23 namespace Herd {
24 
25 // clang-format off
54 // clang-format on
56 public:
59 
61  virtual ~ScdChannelGeoInfo() = default;
62 
77  ScdChannelGeoInfo(unsigned int nStripsPerLadder, unsigned int firstReadoutStrip, unsigned int readoutStripPeriod,
78  unsigned int nLadders);
79 
87  bool IsReadoutStrip(unsigned int stripVolumeID);
88 
98  std::pair<unsigned int, unsigned int> ClosestChannelIDFromVolumeID(unsigned int stripVolumeID);
99 
108  std::optional<unsigned int> ChannelIDFromVolumeID(unsigned int stripVolumeID);
109 
119  std::optional<unsigned int> VolumeIDFromChannelID(unsigned int stripChannelID);
120 
127  unsigned int FirstReadoutStrip() { return _firstReadoutStrip; };
128 
135  unsigned int ReadoutStripPeriod() { return _readoutStripPeriod; }
136 
143  unsigned int NReadoutStrips() { return _nReadoutStrips; }
144 
145 private:
146  unsigned int _nStripsPerLadder; // Readout+floating on a single ladder
147  unsigned int _nStrips; // Readout+floating on the whole layer
148  unsigned int _firstReadoutStrip; // On the ladder
149  unsigned int _readoutStripPeriod;
150  unsigned int _nReadoutStrips; // On the whole layer
152 
153  // Transient members used to optimize the execution of the methods
154  unsigned int
156 
157 #ifdef HS_USE_ROOT
158  ClassDef(ScdChannelGeoInfo, 1)
159 #endif
160 };
161 
162 } // namespace Herd
163 
164 #endif /* HERD_SCDCHANNELGEOINFO_H_ */
Herd::ScdChannelGeoInfo::ReadoutStripPeriod
unsigned int ReadoutStripPeriod()
Gets the readout period.
Definition: ScdChannelGeoInfo.h:135
Herd::ScdChannelGeoInfo::_nStrips
unsigned int _nStrips
Definition: ScdChannelGeoInfo.h:147
Herd::ScdChannelGeoInfo::_nReadoutStrips
unsigned int _nReadoutStrips
Definition: ScdChannelGeoInfo.h:150
Herd::ScdChannelGeoInfo::NReadoutStrips
unsigned int NReadoutStrips()
Gets the total number of readout strips in the layer.
Definition: ScdChannelGeoInfo.h:143
Herd::ScdChannelGeoInfo::_firstReadoutStrip
unsigned int _firstReadoutStrip
Definition: ScdChannelGeoInfo.h:148
Herd::ScdChannelGeoInfo::_nStripsPerLadder
unsigned int _nStripsPerLadder
Definition: ScdChannelGeoInfo.h:146
Herd::ScdChannelGeoInfo
Object managing the geometry of the Si readout strips in a single layer.
Definition: ScdChannelGeoInfo.h:55
Herd
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:22
Herd::ScdChannelGeoInfo::_volumeIDOnLadder
unsigned int _volumeIDOnLadder
Definition: ScdChannelGeoInfo.h:155
Herd::ScdChannelGeoInfo::IsReadoutStrip
bool IsReadoutStrip(unsigned int stripVolumeID)
Checks if a strip is a readout one.
Definition: ScdChannelGeoInfo.cpp:30
Herd::ScdChannelGeoInfo::ChannelIDFromVolumeID
std::optional< unsigned int > ChannelIDFromVolumeID(unsigned int stripVolumeID)
Gets the channel ID of a readout strip.
Definition: ScdChannelGeoInfo.cpp:45
Herd::ScdChannelGeoInfo::VolumeIDFromChannelID
std::optional< unsigned int > VolumeIDFromChannelID(unsigned int stripChannelID)
Gets the volume ID on the layer of a readout strip.
Definition: ScdChannelGeoInfo.cpp:56
Herd::ScdChannelGeoInfo::_readoutStripPeriod
unsigned int _readoutStripPeriod
Definition: ScdChannelGeoInfo.h:149
Herd::ScdChannelGeoInfo::_nReadoutStripsPerLadder
unsigned int _nReadoutStripsPerLadder
Definition: ScdChannelGeoInfo.h:151
Herd::ScdChannelGeoInfo::~ScdChannelGeoInfo
virtual ~ScdChannelGeoInfo()=default
Destructor.
DefaultValues.h
Herd::ScdChannelGeoInfo::FirstReadoutStrip
unsigned int FirstReadoutStrip()
Gets the volume ID on the ladder of the first readout strip.
Definition: ScdChannelGeoInfo.h:127
Herd::ScdChannelGeoInfo::ScdChannelGeoInfo
ScdChannelGeoInfo()
Default constructor.
Definition: ScdChannelGeoInfo.cpp:16
Herd::ScdChannelGeoInfo::ClosestChannelIDFromVolumeID
std::pair< unsigned int, unsigned int > ClosestChannelIDFromVolumeID(unsigned int stripVolumeID)
Gets the closest left readout strip and the inter-readout position.
Definition: ScdChannelGeoInfo.cpp:36