Belle II Software prerelease-10-00-00a
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 <tracking/trackFindingCDC/topology/CDCWire.h>
11#include <tracking/trackFindingCDC/topology/ISuperLayer.h>
12#include <tracking/trackFindingCDC/topology/ILayer.h>
13#include <tracking/trackFindingCDC/topology/IWire.h>
14#include <tracking/trackFindingCDC/topology/EStereoKind.h>
15
16#include <tracking/trackFindingCDC/numerics/ERotation.h>
17#include <tracking/trackFindingCDC/utilities/VectorRange.h>
18
19namespace Belle2 {
24 namespace TrackFindingCDC {
25
42 : public ConstVectorRange<CDCWire> {
43
44 private:
46 using Super = 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 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
88 ILayer getICLayer() const
89 { return front().getICLayer(); }
90
92 ILayer getILayer() const
93 { return front().getILayer(); }
94
96 ISuperLayer getISuperLayer() const
97 { return front().getISuperLayer(); }
98
99
100
105
114 ERotation getShift() const
115 { return m_shift; }
116
124 ERotation getShiftDelta(const CDCWireLayer& baseLayer) const
125 { return static_cast<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 Vector3D& pos3D) const;
147
148
153
161 const CDCWire& getWireWrappedAround(IWire iWire) const
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
173 const CDCWire& getSecondNeighborCCW(IWire iWire) const
174 { return getWireWrappedAround(iWire + 2); }
175
177 const CDCWire& getSecondNeighborCW(IWire iWire) const
178 { return getWireWrappedAround(iWire - 2); }
179
180
186
188 bool isAxial() const
189 { return front().isAxial(); }
190
198 EStereoKind getStereoKind() const
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 ERotation m_shift = ERotation::c_Invalid;
322 };
323
324 }
326}
double getRefCylindricalR() const
Getter for the common (averaged) cylindrical radius at the wire reference point.
const CDCWire & getClosestWire(const Vector3D &pos3D) const
Gets the wire in this layer that is closest to the given position.
ERotation m_shift
Indicates if this layer is shifted clockwise or counterclockwise.
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.
ConstVectorRange< CDCWire > Super
Type of the base class.
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.
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.
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.
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.
CDCWireLayer(const ConstVectorRange< CDCWire > &wireRange)
Constructor taking the range of wires the layer shall contain.
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.
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.
ERotation getShift() const
Getter for the numbering shift.
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.
ERotation getShiftDelta(const CDCWireLayer &baseLayer) const
Getter for the relative difference in wire numbering shift.
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:58
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
A three dimensional vector.
Definition Vector3D.h:33
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