Belle II Software  release-05-02-19
CDCWireLayer.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/trackFindingCDC/topology/CDCWire.h>
13 #include <tracking/trackFindingCDC/topology/ISuperLayer.h>
14 #include <tracking/trackFindingCDC/topology/ILayer.h>
15 #include <tracking/trackFindingCDC/topology/IWire.h>
16 #include <tracking/trackFindingCDC/topology/EStereoKind.h>
17 
18 #include <tracking/trackFindingCDC/numerics/ERotation.h>
19 #include <tracking/trackFindingCDC/utilities/VectorRange.h>
20 
21 namespace Belle2 {
26  namespace TrackFindingCDC {
27 
43  class CDCWireLayer
44  : public ConstVectorRange<CDCWire> {
45 
46  private:
48  using Super = ConstVectorRange<CDCWire>;
49 
50  public:
57  static const CDCWireLayer* getInstance(ILayer iCLayer);
59 
61  static const CDCWireLayer* getInstance(ISuperLayer iSuperLayer, ILayer iLayer);
68  explicit CDCWireLayer(const ConstVectorRange<CDCWire>& wireRange);
69 
70 
72  CDCWireLayer(const CDCWireLayer& wireLayer) = delete;
73 
75  CDCWireLayer(CDCWireLayer&& wireLayer) = default;
76 
78  void operator=(const CDCWireLayer& wireLayer) = delete;
79 
80  public:
82  void initialize();
83 
89  ILayer getICLayer() const
91  { return front().getICLayer(); }
92 
94  ILayer getILayer() const
95  { return front().getILayer(); }
96 
98  ISuperLayer getISuperLayer() const
99  { return front().getISuperLayer(); }
116  ERotation getShift() const
117  { return m_shift; }
118 
126  ERotation getShiftDelta(const CDCWireLayer& baseLayer) const
127  { return static_cast<ERotation>(getShift() - baseLayer.getShift()); }
135  bool isValidIWire(IWire iWire) const
137  { return 0 <= iWire and iWire < IWire(size()); }
138 
140  const CDCWire& getWire(IWire iWire) const
141  {
142  // cppcheck-suppress returnTempReference
143  return at(iWire);
144  }
145 
147  const CDCWire& getClosestWire(const Vector3D& pos3D) const;
163  const CDCWire& getWireWrappedAround(IWire iWire) const
164  { return getWire(IWireUtil::wrappedAround(iWire, size())); }
165 
167  const CDCWire& getNeighborCCW(IWire iWire) const
168  { return getWireWrappedAround(iWire + 1); }
169 
171  const CDCWire& getNeighborCW(IWire iWire) const
172  { return getWireWrappedAround(iWire - 1); }
173 
175  const CDCWire& getSecondNeighborCCW(IWire iWire) const
176  { return getWireWrappedAround(iWire + 2); }
177 
179  const CDCWire& getSecondNeighborCW(IWire iWire) const
180  { return getWireWrappedAround(iWire - 2); }
189  bool isAxial() const
191  { return front().isAxial(); }
192 
200  EStereoKind getStereoKind() const
201  { return front().getStereoKind(); }
202 
204  double getTanStereoAngle() const
205  { return m_tanStereoAngle; }
206 
208  double getStereoAngle() const
209  { return std::atan(getTanStereoAngle()); }
210 
212  double getMinCylindricalR() const
213  { return m_minCylindricalR; }
214 
216  double getRefCylindricalR() const
217  { return m_refCylindricalR; }
218 
220  double getRefZ() const
221  { return m_refZ; }
222 
224  double getForwardCylindricalR() const
225  { return m_forwardCylindricalR; };
226 
228  double getBackwardCylindricalR() const
229  { return m_backwardCylindricalR; };
230 
232  double getForwardZ() const
233  { return m_forwardZ; }
234 
236  double getBackwardZ() const
237  { return m_backwardZ; }
238 
246  double getInnerCylindricalR() const
248  { return m_innerCylindricalR; }
249 
251  double getOuterCylindricalR() const
252  { return m_outerCylindricalR; }
253 
255  double getRadialCellWidth() const
257 
264  double getLateralCellWidth() const
265  { return getOuterCylindricalR() * 2 * M_PI / size(); }
268  private:
277  ERotation m_shift = ERotation::c_Invalid;
278 
285 
287  double m_tanStereoAngle = 0.0;
288 
290  double m_minCylindricalR = 0.0;
291 
293  double m_refCylindricalR = 0.0;
294 
296  double m_refZ = 0.0;
297 
299  double m_forwardCylindricalR = 0.0;
300 
302  double m_backwardCylindricalR = 0.0;
303 
305  double m_forwardZ = 0.0;
306 
308  double m_backwardZ = 0.0;
310 
317 
319  double m_innerCylindricalR = 0.0;
320 
322  double m_outerCylindricalR = 0.0;
324 
325 
326  };
327 
328  }
330 }
Belle2::TrackFindingCDC::CDCWireLayer::m_refCylindricalR
double m_refCylindricalR
Storage for common (averaged) cylindrical radius of all wire reference positions.
Definition: CDCWireLayer.h:301
Belle2::TrackFindingCDC::CDCWireLayer::m_refZ
double m_refZ
Storage for common (averaged) z coordinate of all wire reference positions.
Definition: CDCWireLayer.h:304
Belle2::TrackFindingCDC::CDCWireLayer::getNeighborCCW
const CDCWire & getNeighborCCW(IWire iWire) const
Getter for the first counterclockwise neighbor by wire id in the layer.
Definition: CDCWireLayer.h:175
Belle2::TrackFindingCDC::CDCWireLayer::Super
ConstVectorRange< CDCWire > Super
Type of the base class.
Definition: CDCWireLayer.h:56
Belle2::TrackFindingCDC::CDCWireLayer::getSecondNeighborCW
const CDCWire & getSecondNeighborCW(IWire iWire) const
Getter for the first clockwise neighbor by wire id in the layer.
Definition: CDCWireLayer.h:187
Belle2::TrackFindingCDC::Range::size
std::size_t size() const
Returns the total number of objects in this range.
Definition: Range.h:86
Belle2::TrackFindingCDC::CDCWireLayer::m_backwardZ
double m_backwardZ
Storage for z position of backward wire ends.
Definition: CDCWireLayer.h:316
Belle2::TrackFindingCDC::CDCWireLayer::isValidIWire
bool isValidIWire(IWire iWire) const
Checks if the given wire id belongs to a valid wire in this layer.
Definition: CDCWireLayer.h:144
Belle2::TrackFindingCDC::CDCWireLayer::m_shift
ERotation m_shift
Indicates if this layer is shifted clockwise or counterclockwise.
Definition: CDCWireLayer.h:285
Belle2::TrackFindingCDC::CDCWireLayer::m_forwardZ
double m_forwardZ
Storage for z position of forward wire ends.
Definition: CDCWireLayer.h:313
Belle2::TrackFindingCDC::CDCWireLayer::getNeighborCW
const CDCWire & getNeighborCW(IWire iWire) const
Getter for the first clockwise neighbor by wire id in the layer.
Definition: CDCWireLayer.h:179
Belle2::TrackFindingCDC::IWireUtil::wrappedAround
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:47
Belle2::TrackFindingCDC::CDCWireLayer::getStereoKind
EStereoKind getStereoKind() const
Getter for the stereo type of the wire layer Gives the stereo type of the wire.
Definition: CDCWireLayer.h:208
Belle2::TrackFindingCDC::CDCWireLayer::initialize
void initialize()
Intializes the wire layer variables to the average of according variables in the wire range.
Definition: CDCWireLayer.cc:34
Belle2::TrackFindingCDC::CDCWireLayer::m_forwardCylindricalR
double m_forwardCylindricalR
Storage for average distance from beamline of forward wire ends.
Definition: CDCWireLayer.h:307
Belle2::TrackFindingCDC::CDCWireLayer::getICLayer
ILayer getICLayer() const
Getter for the continuous layer id unique over all layers.
Definition: CDCWireLayer.h:98
Belle2::TrackFindingCDC::CDCWireLayer::getOuterCylindricalR
double getOuterCylindricalR() const
Getter for outer radius of the layer as taken from the CDCGeometryPar.
Definition: CDCWireLayer.h:259
Belle2::TrackFindingCDC::CDCWireLayer::getMinCylindricalR
double getMinCylindricalR() const
Getter for the closest distance to the beamline ( z-axes ) of all wires in this layer.
Definition: CDCWireLayer.h:220
Belle2::TrackFindingCDC::CDCWireLayer::getRefCylindricalR
double getRefCylindricalR() const
Getter for the common (averaged) cylindrical radius at the wire reference point.
Definition: CDCWireLayer.h:224
Belle2::TrackFindingCDC::CDCWireLayer::getBackwardZ
double getBackwardZ() const
Getter for the average z coordinate at the backward joint points of all wires in this layer.
Definition: CDCWireLayer.h:244
Belle2::TrackFindingCDC::CDCWireLayer::getForwardCylindricalR
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:232
Belle2::TrackFindingCDC::CDCWireLayer::getRadialCellWidth
double getRadialCellWidth() const
Getter for the width of the wire layer in the radial direction.
Definition: CDCWireLayer.h:263
Belle2::TrackFindingCDC::CDCWireLayer::CDCWireLayer
CDCWireLayer(const ConstVectorRange< CDCWire > &wireRange)
Constructor taking the range of wires the layer shall contain.
Definition: CDCWireLayer.cc:18
Belle2::TrackFindingCDC::CDCWireLayer::getTanStereoAngle
double getTanStereoAngle() const
Getter for the averaged tan stereo angle of all wires in this layer.
Definition: CDCWireLayer.h:212
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::CDCWireLayer::m_minCylindricalR
double m_minCylindricalR
Storage for minimal distance from beamline.
Definition: CDCWireLayer.h:298
Belle2::TrackFindingCDC::CDCWireLayer::getBackwardCylindricalR
double getBackwardCylindricalR() const
Getter for the average distance to the beamline ( z-axes ) at the backward joint points of all wires ...
Definition: CDCWireLayer.h:236
Belle2::TrackFindingCDC::CDCWireLayer::getWireWrappedAround
const CDCWire & getWireWrappedAround(IWire iWire) const
Returns the wire by its id in the layer.
Definition: CDCWireLayer.h:171
Belle2::TrackFindingCDC::CDCWireLayer::getSecondNeighborCCW
const CDCWire & getSecondNeighborCCW(IWire iWire) const
Getter for the first counterclockwise neighbor by wire id in the layer.
Definition: CDCWireLayer.h:183
Belle2::TrackFindingCDC::Vector3D
A three dimensional vector.
Definition: Vector3D.h:34
Belle2::TrackFindingCDC::CDCWireLayer::getRefZ
double getRefZ() const
Getter for the common (averaged) z component of the wire reference point.
Definition: CDCWireLayer.h:228
Belle2::TrackFindingCDC::CDCWireLayer::getISuperLayer
ISuperLayer getISuperLayer() const
Getter for the super layer id.
Definition: CDCWireLayer.h:106
Belle2::TrackFindingCDC::CDCWireLayer::isAxial
bool isAxial() const
Indicates if the wire is axial or stereo.
Definition: CDCWireLayer.h:198
Belle2::TrackFindingCDC::CDCWireLayer::getWire
const CDCWire & getWire(IWire iWire) const
Gives the wire by its id in the layer.
Definition: CDCWireLayer.h:148
Belle2::TrackFindingCDC::CDCWireLayer::m_outerCylindricalR
double m_outerCylindricalR
Storage of the outer radius of the wire layer as taken from the CDCGeometryPar instance.
Definition: CDCWireLayer.h:330
Belle2::TrackFindingCDC::CDCWireLayer::m_backwardCylindricalR
double m_backwardCylindricalR
Storage for average distance from beamline of backward wire ends.
Definition: CDCWireLayer.h:310
Belle2::TrackFindingCDC::CDCWireLayer::operator=
void operator=(const CDCWireLayer &wireLayer)=delete
Disallow copy assignment of wire layers.
Belle2::TrackFindingCDC::NRotation::ERotation
ERotation
Enumeration to represent the distinct possibilities of the right left passage information.
Definition: ERotation.h:35
Belle2::TrackFindingCDC::CDCWireLayer::getForwardZ
double getForwardZ() const
Getter for the average z coordinate at the forward joint points of all wires in this layer.
Definition: CDCWireLayer.h:240
Belle2::TrackFindingCDC::CDCWireLayer::getInstance
static const CDCWireLayer * getInstance(ILayer iCLayer)
Getter from the the continuous layer id. Does not construct a new object.
Definition: CDCWireLayer.cc:24
Belle2::TrackFindingCDC::CDCWireLayer::getLateralCellWidth
double getLateralCellWidth() const
Getter for the width of the wire layer in the lateral direction.
Definition: CDCWireLayer.h:272
Belle2::TrackFindingCDC::CDCWire
Class representing a sense wire in the central drift chamber.
Definition: CDCWire.h:60
Belle2::TrackFindingCDC::CDCWireLayer::getStereoAngle
double getStereoAngle() const
Getter for the average stereo angle of all wires in this layer.
Definition: CDCWireLayer.h:216
Belle2::TrackFindingCDC::Range::at
Reference at(std::size_t i) const
Returns the object at index i.
Definition: Range.h:102
Belle2::TrackFindingCDC::CDCWireLayer::m_tanStereoAngle
double m_tanStereoAngle
Storage for average tan stereo angle.
Definition: CDCWireLayer.h:295
Belle2::TrackFindingCDC::CDCWireLayer::getShift
ERotation getShift() const
Getter for the numbering shift.
Definition: CDCWireLayer.h:124
Belle2::TrackFindingCDC::CDCWireLayer::getILayer
ILayer getILayer() const
Getter for the layer id unique within the superlayer.
Definition: CDCWireLayer.h:102
Belle2::TrackFindingCDC::CDCWireLayer::getInnerCylindricalR
double getInnerCylindricalR() const
Getter for inner radius of the layer as taken from the CDCGeometryPar.
Definition: CDCWireLayer.h:255
Belle2::TrackFindingCDC::CDCWireLayer::getShiftDelta
ERotation getShiftDelta(const CDCWireLayer &baseLayer) const
Getter for the relative difference in wire numbering shift.
Definition: CDCWireLayer.h:134
Belle2::TrackFindingCDC::CDCWireLayer::getClosestWire
const CDCWire & getClosestWire(const Vector3D &pos3D) const
Gets the wire in this layer that is closest to the given position.
Definition: CDCWireLayer.cc:91
Belle2::TrackFindingCDC::CDCWireLayer::m_innerCylindricalR
double m_innerCylindricalR
Storage of the inner radius of the wire layer as taken from the CDCGeometryPar instance.
Definition: CDCWireLayer.h:327
Belle2::TrackFindingCDC::Range::front
Reference front() const
Returns the derefenced iterator at begin()
Definition: Range.h:90