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 <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:
47
48 public:
56 static const CDCWireLayer* getInstance(ILayer iCLayer);
57
59 static const CDCWireLayer* getInstance(ISuperLayer iSuperLayer, ILayer iLayer);
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
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(); }
115 { return m_shift; }
116
124 ERotation getShiftDelta(const CDCWireLayer& baseLayer) const
125 { return static_cast<ERotation>(getShift() - baseLayer.getShift()); }
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;
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); }
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
245 double getInnerCylindricalR() const
246 { return m_innerCylindricalR; }
247
249 double getOuterCylindricalR() const
250 { return m_outerCylindricalR; }
251
253 double getRadialCellWidth() const
255
262 double getLateralCellWidth() const
263 { return getOuterCylindricalR() * 2 * M_PI / size(); }
266 private:
275 ERotation m_shift = ERotation::c_Invalid;
276
283
285 double m_tanStereoAngle = 0.0;
286
288 double m_minCylindricalR = 0.0;
289
291 double m_refCylindricalR = 0.0;
292
294 double m_refZ = 0.0;
295
298
301
303 double m_forwardZ = 0.0;
304
306 double m_backwardZ = 0.0;
308
315
318
322
323
324 };
325
326 }
328}
Class representating a sense wire layer in the central drift chamber.
Definition: CDCWireLayer.h:42
double getRefCylindricalR() const
Getter for the common (averaged) cylindrical radius at the wire reference point.
Definition: CDCWireLayer.h:214
const CDCWire & getClosestWire(const Vector3D &pos3D) const
Gets the wire in this layer that is closest to the given position.
Definition: CDCWireLayer.cc:89
ERotation m_shift
Indicates if this layer is shifted clockwise or counterclockwise.
Definition: CDCWireLayer.h:275
double getStereoAngle() const
Getter for the average stereo angle of all wires in this layer.
Definition: CDCWireLayer.h:206
const CDCWire & getWire(IWire iWire) const
Gives the wire by its id in the layer.
Definition: CDCWireLayer.h:138
double m_refZ
Storage for common (averaged) z coordinate of all wire reference positions.
Definition: CDCWireLayer.h:294
bool isValidIWire(IWire iWire) const
Checks if the given wire id belongs to a valid wire in this layer.
Definition: CDCWireLayer.h:134
double m_backwardZ
Storage for z position of backward wire ends.
Definition: CDCWireLayer.h:306
void initialize()
Intializes the wire layer variables to the average of according variables in the wire range.
Definition: CDCWireLayer.cc:32
ISuperLayer getISuperLayer() const
Getter for the super layer id.
Definition: CDCWireLayer.h:96
const CDCWire & getSecondNeighborCW(IWire iWire) const
Getter for the first clockwise neighbor by wire id in the layer.
Definition: CDCWireLayer.h:177
double getBackwardCylindricalR() const
Getter for the average distance to the beamline ( z-axes ) at the backward joint points of all wires ...
Definition: CDCWireLayer.h:226
bool isAxial() const
Indicates if the wire is axial or stereo.
Definition: CDCWireLayer.h:188
static const CDCWireLayer * getInstance(ILayer iCLayer)
Getter from the the continuous layer id. Does not construct a new object.
Definition: CDCWireLayer.cc:22
double getForwardCylindricalR() const
Getter for the average distance to the beamline ( z-axes ) at the forward joint points of all wires i...
Definition: CDCWireLayer.h:222
double getForwardZ() const
Getter for the average z coordinate at the forward joint points of all wires in this layer.
Definition: CDCWireLayer.h:230
const CDCWire & getSecondNeighborCCW(IWire iWire) const
Getter for the first counterclockwise neighbor by wire id in the layer.
Definition: CDCWireLayer.h:173
double getInnerCylindricalR() const
Getter for inner radius of the layer as taken from the CDCGeometryPar.
Definition: CDCWireLayer.h:245
double m_backwardCylindricalR
Storage for average distance from beamline of backward wire ends.
Definition: CDCWireLayer.h:300
double m_innerCylindricalR
Storage of the inner radius of the wire layer as taken from the CDCGeometryPar instance.
Definition: CDCWireLayer.h:317
const CDCWire & getNeighborCCW(IWire iWire) const
Getter for the first counterclockwise neighbor by wire id in the layer.
Definition: CDCWireLayer.h:165
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.
Definition: CDCWireLayer.h:161
ILayer getICLayer() const
Getter for the continuous layer id unique over all layers.
Definition: CDCWireLayer.h:88
ILayer getILayer() const
Getter for the layer id unique within the superlayer.
Definition: CDCWireLayer.h:92
double m_forwardZ
Storage for z position of forward wire ends.
Definition: CDCWireLayer.h:303
double getLateralCellWidth() const
Getter for the width of the wire layer in the lateral direction.
Definition: CDCWireLayer.h:262
double m_minCylindricalR
Storage for minimal distance from beamline.
Definition: CDCWireLayer.h:288
ERotation getShift() const
Getter for the numbering shift.
Definition: CDCWireLayer.h:114
double getTanStereoAngle() const
Getter for the averaged tan stereo angle of all wires in this layer.
Definition: CDCWireLayer.h:202
double m_tanStereoAngle
Storage for average tan stereo angle.
Definition: CDCWireLayer.h:285
EStereoKind getStereoKind() const
Getter for the stereo type of the wire layer Gives the stereo type of the wire.
Definition: CDCWireLayer.h:198
double getRefZ() const
Getter for the common (averaged) z component of the wire reference point.
Definition: CDCWireLayer.h:218
double m_refCylindricalR
Storage for common (averaged) cylindrical radius of all wire reference positions.
Definition: CDCWireLayer.h:291
double getOuterCylindricalR() const
Getter for outer radius of the layer as taken from the CDCGeometryPar.
Definition: CDCWireLayer.h:249
double getMinCylindricalR() const
Getter for the closest distance to the beamline ( z-axes ) of all wires in this layer.
Definition: CDCWireLayer.h:210
double m_outerCylindricalR
Storage of the outer radius of the wire layer as taken from the CDCGeometryPar instance.
Definition: CDCWireLayer.h:320
const CDCWire & getNeighborCW(IWire iWire) const
Getter for the first clockwise neighbor by wire id in the layer.
Definition: CDCWireLayer.h:169
double getBackwardZ() const
Getter for the average z coordinate at the backward joint points of all wires in this layer.
Definition: CDCWireLayer.h:234
double getRadialCellWidth() const
Getter for the width of the wire layer in the radial direction.
Definition: CDCWireLayer.h:253
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.
Definition: CDCWireLayer.h:297
ERotation getShiftDelta(const CDCWireLayer &baseLayer) const
Getter for the relative difference in wire numbering shift.
Definition: CDCWireLayer.h:124
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
A pair of iterators usable with the range base for loop.
Definition: Range.h:25
Reference front() const
Returns the derefenced 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
ERotation
Enumeration to represent the distinct possibilities of the right left passage information.
Definition: ERotation.h:25
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