Belle II Software development
CDCWireLayer.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <cdc/topology/CDCWire.h>
11#include <cdc/topology/ISuperLayer.h>
12#include <cdc/topology/ILayer.h>
13#include <cdc/topology/IWire.h>
14#include <cdc/topology/EStereoKind.h>
15
16#include <tracking/trackingUtilities/numerics/ERotation.h>
17#include <tracking/trackingUtilities/utilities/VectorRange.h>
18
19namespace Belle2 {
24 namespace CDC {
25
42 : public TrackingUtilities::ConstVectorRange<CDCWire> {
43
44 private:
46 using Super = TrackingUtilities::ConstVectorRange<CDCWire>;
47
48 public:
54
56 static const CDCWireLayer* getInstance(ILayer iCLayer);
57
59 static const CDCWireLayer* getInstance(ISuperLayer iSuperLayer, ILayer iLayer);
61
66 explicit CDCWireLayer(const TrackingUtilities::ConstVectorRange<CDCWire>& wireRange);
67
68
70 CDCWireLayer(const CDCWireLayer& wireLayer) = delete;
71
73 CDCWireLayer(CDCWireLayer&& wireLayer) = default;
74
76 void operator=(const CDCWireLayer& wireLayer) = delete;
77
78 public:
80 void initialize();
81
86
89 { return front().getICLayer(); }
90
93 { return front().getILayer(); }
94
97 { return front().getISuperLayer(); }
98
99
100
105
114 TrackingUtilities::ERotation getShift() const
115 { return m_shift; }
116
124 TrackingUtilities::ERotation getShiftDelta(const CDCWireLayer& baseLayer) const
125 { return static_cast<TrackingUtilities::ERotation>(getShift() - baseLayer.getShift()); }
126
127
132
134 bool isValidIWire(IWire iWire) const
135 { return 0 <= iWire and iWire < IWire(size()); }
136
138 const CDCWire& getWire(IWire iWire) const
139 {
140 // cppcheck-suppress returnTempReference
141 return at(iWire);
142 }
143
145 const CDCWire& getClosestWire(const ROOT::Math::XYZVector& pos3D) const;
147
148
153
162 { return getWire(IWireUtil::wrappedAround(iWire, size())); }
163
165 const CDCWire& getNeighborCCW(IWire iWire) const
166 { return getWireWrappedAround(iWire + 1); }
167
169 const CDCWire& getNeighborCW(IWire iWire) const
170 { return getWireWrappedAround(iWire - 1); }
171
174 { return getWireWrappedAround(iWire + 2); }
175
178 { return getWireWrappedAround(iWire - 2); }
179
180
186
188 bool isAxial() const
189 { return front().isAxial(); }
190
199 { return front().getStereoKind(); }
200
202 double getTanStereoAngle() const
203 { return m_tanStereoAngle; }
204
206 double getStereoAngle() const
207 { return std::atan(getTanStereoAngle()); }
208
210 double getMinCylindricalR() const
211 { return m_minCylindricalR; }
212
214 double getRefCylindricalR() const
215 { return m_refCylindricalR; }
216
218 double getRefZ() const
219 { return m_refZ; }
220
223 { return m_forwardCylindricalR; };
224
227 { return m_backwardCylindricalR; };
228
230 double getForwardZ() const
231 { return m_forwardZ; }
232
234 double getBackwardZ() const
235 { return m_backwardZ; }
236
238
243
245 double getInnerCylindricalR() const
246 { return m_innerCylindricalR; }
247
249 double getOuterCylindricalR() const
250 { return m_outerCylindricalR; }
251
255
262 double getLateralCellWidth() const
263 { return getOuterCylindricalR() * 2 * M_PI / size(); }
264
265
266 private:
273
275 double m_tanStereoAngle = 0.0;
276
278 double m_minCylindricalR = 0.0;
279
281 double m_refCylindricalR = 0.0;
282
284 double m_refZ = 0.0;
285
288
291
293 double m_forwardZ = 0.0;
294
296 double m_backwardZ = 0.0;
298
305
308
312
321 TrackingUtilities::ERotation m_shift = TrackingUtilities::ERotation::c_Invalid;
322 };
323
324 }
326}
double getRefCylindricalR() const
Getter for the common (averaged) cylindrical radius at the wire reference point.
TrackingUtilities::ERotation getShift() const
Getter for the numbering shift.
double getStereoAngle() const
Getter for the average stereo angle of all wires in this layer.
const CDCWire & getWire(IWire iWire) const
Gives the wire by its id in the layer.
double m_refZ
Storage for common (averaged) z coordinate of all wire reference positions.
bool isValidIWire(IWire iWire) const
Checks if the given wire id belongs to a valid wire in this layer.
double m_backwardZ
Storage for z position of backward wire ends.
void initialize()
Initializes the wire layer variables to the average of according variables in the wire range.
ISuperLayer getISuperLayer() const
Getter for the super layer id.
const CDCWire & getSecondNeighborCW(IWire iWire) const
Getter for the first clockwise neighbor by wire id in the layer.
double getBackwardCylindricalR() const
Getter for the average distance to the beamline ( z-axes ) at the backward joint points of all wires ...
bool isAxial() const
Indicates if the wire is axial or stereo.
const CDCWire & getClosestWire(const ROOT::Math::XYZVector &pos3D) const
Gets the wire in this layer that is closest to the given position.
static const CDCWireLayer * getInstance(ILayer iCLayer)
Getter from the the continuous layer id. Does not construct a new object.
double getForwardCylindricalR() const
Getter for the average distance to the beamline ( z-axes ) at the forward joint points of all wires i...
double getForwardZ() const
Getter for the average z coordinate at the forward joint points of all wires in this layer.
TrackingUtilities::ERotation getShiftDelta(const CDCWireLayer &baseLayer) const
Getter for the relative difference in wire numbering shift.
const CDCWire & getSecondNeighborCCW(IWire iWire) const
Getter for the first counterclockwise neighbor by wire id in the layer.
double getInnerCylindricalR() const
Getter for inner radius of the layer as taken from the CDCGeometryPar.
TrackingUtilities::ERotation m_shift
Indicates if this layer is shifted clockwise or counterclockwise.
double m_backwardCylindricalR
Storage for average distance from beamline of backward wire ends.
double m_innerCylindricalR
Storage of the inner radius of the wire layer as taken from the CDCGeometryPar instance.
const CDCWire & getNeighborCCW(IWire iWire) const
Getter for the first counterclockwise neighbor by wire id in the layer.
CDCWireLayer(const CDCWireLayer &wireLayer)=delete
Disallow copy construction of wire layers.
const CDCWire & getWireWrappedAround(IWire iWire) const
Returns the wire by its id in the layer.
ILayer getICLayer() const
Getter for the continuous layer id unique over all layers.
CDCWireLayer(const TrackingUtilities::ConstVectorRange< CDCWire > &wireRange)
Constructor taking the range of wires the layer shall contain.
ILayer getILayer() const
Getter for the layer id unique within the superlayer.
double m_forwardZ
Storage for z position of forward wire ends.
double getLateralCellWidth() const
Getter for the width of the wire layer in the lateral direction.
double m_minCylindricalR
Storage for minimal distance from beamline.
double getTanStereoAngle() const
Getter for the averaged tan stereo angle of all wires in this layer.
double m_tanStereoAngle
Storage for average tan stereo angle.
EStereoKind getStereoKind() const
Getter for the stereo type of the wire layer Gives the stereo type of the wire.
double getRefZ() const
Getter for the common (averaged) z component of the wire reference point.
double m_refCylindricalR
Storage for common (averaged) cylindrical radius of all wire reference positions.
double getOuterCylindricalR() const
Getter for outer radius of the layer as taken from the CDCGeometryPar.
double getMinCylindricalR() const
Getter for the closest distance to the beamline ( z-axes ) of all wires in this layer.
double m_outerCylindricalR
Storage of the outer radius of the wire layer as taken from the CDCGeometryPar instance.
const CDCWire & getNeighborCW(IWire iWire) const
Getter for the first clockwise neighbor by wire id in the layer.
double getBackwardZ() const
Getter for the average z coordinate at the backward joint points of all wires in this layer.
double getRadialCellWidth() const
Getter for the width of the wire layer in the radial direction.
CDCWireLayer(CDCWireLayer &&wireLayer)=default
Allow move construction of wire layers for use in std::vector.
double m_forwardCylindricalR
Storage for average distance from beamline of forward wire ends.
TrackingUtilities::ConstVectorRange< CDCWire > Super
Type of the base class.
void operator=(const CDCWireLayer &wireLayer)=delete
Disallow copy assignment of wire layers.
Class representing a sense wire in the central drift chamber.
Definition CDCWire.h:50
Reference front() const
Returns the dereferenced iterator at begin()
Definition Range.h:80
std::size_t size() const
Returns the total number of objects in this range.
Definition Range.h:76
Reference at(std::size_t i) const
Returns the object at index i.
Definition Range.h:92
signed short IWire
The type of the wire ids enumerating wires within a given layer.
Definition IWire.h:20
signed short ILayer
The type of the layer ids enumerating layers within a superlayer.
Definition ILayer.h:18
EStereoKind
Type for the stereo property of the wire.
Definition EStereoKind.h:20
signed short ISuperLayer
The type of the layer and superlayer ids.
Definition ISuperLayer.h:24
Abstract base class for different kinds of events.
static IWire wrappedAround(IWire iWire, IWire nWires)
Wraps the given in layer wire index by the total number of wires in this layer.
Definition IWire.h:37