Belle II Software  release-05-01-25
CDCWireLayer.cc
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 
11 #include <tracking/trackFindingCDC/topology/CDCWireLayer.h>
12 #include <tracking/trackFindingCDC/topology/CDCWireTopology.h>
13 #include <cdc/geometry/CDCGeometryPar.h>
14 
15 using namespace Belle2;
16 using namespace TrackFindingCDC;
17 
19  : Super(wireRange)
20 {
21  initialize();
22 }
23 
25 {
26  return &(CDCWireTopology::getInstance().getWireLayer(iCLayer));
27 }
28 
29 const CDCWireLayer* CDCWireLayer::getInstance(ISuperLayer iSuperLayer, ILayer iLayer)
30 {
31  return &(CDCWireTopology::getInstance().getWireLayer(iSuperLayer, iLayer));
32 }
33 
35 {
36  size_t nWiresInLayer = size();
37  ILayer iCLayer = getICLayer();
38 
39  // values from CDCGeometryPar
41 
42  const double* innerRadiusWireLayer = cdcgp.innerRadiusWireLayer();
43  const double* outerRadiusWireLayer = cdcgp.outerRadiusWireLayer();
44 
45  m_innerCylindricalR = innerRadiusWireLayer[iCLayer];
46  m_outerCylindricalR = outerRadiusWireLayer[iCLayer];
47 
50 
51  // average values from wires
52  m_tanStereoAngle = 0.0;
53  m_minCylindricalR = 1000000.0;
54  m_refZ = 0.0;
55  m_refCylindricalR = 0.0;
58  m_forwardZ = 0.0;
59  m_backwardZ = 0.0;
60 
61  for (const CDCWire& wire : *this) {
63 
64  double minROfWire = wire.getMinCylindricalR();
65  m_minCylindricalR = std::min(minROfWire, m_minCylindricalR);
66 
67  m_refZ += wire.getRefZ();
69 
70  // calculate the forward nad backward r in the xy projection. take the average
73 
74  // calculate the forward and backward z position. take the average of all wires
75  m_forwardZ += wire.getForwardZ();
76  m_backwardZ += wire.getBackwardZ();
77  }
78 
79  m_tanStereoAngle /= nWiresInLayer;
80 
81  m_refZ /= nWiresInLayer;
82  m_refCylindricalR /= nWiresInLayer;
83 
84  m_forwardCylindricalR /= nWiresInLayer;
85  m_backwardCylindricalR /= nWiresInLayer;
86 
87  m_forwardZ /= nWiresInLayer;
88  m_backwardZ /= nWiresInLayer;
89 }
90 
91 const CDCWire& CDCWireLayer::getClosestWire(const Vector3D& pos3D) const
92 {
93  IWire iWire = CDC::CDCGeometryPar::Instance().cellId(getICLayer(), pos3D);
94  // Safety measure against error in the cellId function
95  iWire %= size();
96  return getWire(iWire);
97 }
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::CDCWire::getForwardZ
double getForwardZ() const
Getter for the z coordinate at the forward joint points of the wires.
Definition: CDCWire.h:278
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::m_shift
ERotation m_shift
Indicates if this layer is shifted clockwise or counterclockwise.
Definition: CDCWireLayer.h:285
Belle2::CDC::CDCGeometryPar::innerRadiusWireLayer
const double * innerRadiusWireLayer() const
Returns an array of inner radius of wire layers.
Definition: CDCGeometryPar.cc:1709
Belle2::TrackFindingCDC::CDCWireLayer::m_forwardZ
double m_forwardZ
Storage for z position of forward wire ends.
Definition: CDCWireLayer.h:313
Belle2::TrackFindingCDC::CDCWire::getRefZ
double getRefZ() const
Getter for the wire reference z coordinate Gives the wire's reference z coordinate.
Definition: CDCWire.h:238
Belle2::TrackFindingCDC::CDCWireTopology::getInstance
static CDCWireTopology & getInstance()
Getter for the singleton instance of the wire topology.
Definition: CDCWireTopology.cc:22
Belle2::TrackFindingCDC::CDCWire::getBackwardZ
double getBackwardZ() const
Getter for the z coordinate at the backward joint points of the wires.
Definition: CDCWire.h:282
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::CDCWireTopology::getWireLayer
const CDCWireLayer & getWireLayer(const WireID &wireId) const
Getter for wire layer getter by wireID object.
Definition: CDCWireTopology.h:147
Belle2::TrackFindingCDC::CDCWireLayer::getICLayer
ILayer getICLayer() const
Getter for the continuous layer id unique over all layers.
Definition: CDCWireLayer.h:98
Belle2::TrackFindingCDC::CDCWire::getBackwardCylindricalR
double getBackwardCylindricalR() const
Getter for the distance to the beamline ( z-axes ) at the backward joint point.
Definition: CDCWire.h:274
Belle2::CDC::CDCGeometryPar
The Class for CDC Geometry Parameters.
Definition: CDCGeometryPar.h:75
Belle2::TrackFindingCDC::CDCWireLayer::CDCWireLayer
CDCWireLayer(const ConstVectorRange< CDCWire > &wireRange)
Constructor taking the range of wires the layer shall contain.
Definition: CDCWireLayer.cc:18
Belle2::CDC::CDCGeometryPar::Instance
static CDCGeometryPar & Instance(const CDCGeometry *=nullptr)
Static method to get a reference to the CDCGeometryPar instance.
Definition: CDCGeometryPar.cc:41
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::CDC::CDCGeometryPar::outerRadiusWireLayer
const double * outerRadiusWireLayer() const
Returns an array of outer radius of wire layers.
Definition: CDCGeometryPar.cc:1721
Belle2::TrackFindingCDC::Vector3D
A three dimensional vector.
Definition: Vector3D.h:34
Belle2::TrackFindingCDC::CDCWireLayer::getISuperLayer
ISuperLayer getISuperLayer() const
Getter for the super layer id.
Definition: CDCWireLayer.h:106
Belle2::CDC::CDCGeometryPar::getShiftInSuperLayer
signed short getShiftInSuperLayer(unsigned short iSuperLayer, unsigned short iLayer) const
Returns shift in the super-layer.
Definition: CDCGeometryPar.cc:2889
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::CDC::CDCGeometryPar::cellId
unsigned cellId(unsigned layerId, const TVector3 &position) const
The method to get cell id based on given layer id and the position.
Definition: CDCGeometryPar.cc:1733
Belle2::TrackFindingCDC::CDCWire::getMinCylindricalR
double getMinCylindricalR() const
Getter for the closest distance to the beamline ( z-axes )
Definition: CDCWire.h:266
Belle2::TrackFindingCDC::NRotation::ERotation
ERotation
Enumeration to represent the distinct possibilities of the right left passage information.
Definition: ERotation.h:35
Belle2::TrackFindingCDC::Range
A pair of iterators usable with the range base for loop.
Definition: Range.h:35
Belle2::TrackFindingCDC::CDCWireLayer
Class representating a sense wire layer in the central drift chamber.
Definition: CDCWireLayer.h:51
Belle2::TrackFindingCDC::CDCWire::getTanStereoAngle
double getTanStereoAngle() const
Getter for the tangents of the stereo angle of the wire.
Definition: CDCWire.h:242
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::CDCWire::getForwardCylindricalR
double getForwardCylindricalR() const
Getter for the nominal distance to the beamline ( z-axes ) at the forward joint point.
Definition: CDCWire.h:270
Belle2::TrackFindingCDC::CDCWire
Class representing a sense wire in the central drift chamber.
Definition: CDCWire.h:60
Belle2::TrackFindingCDC::CDCWireLayer::m_tanStereoAngle
double m_tanStereoAngle
Storage for average tan stereo angle.
Definition: CDCWireLayer.h:295
Belle2::TrackFindingCDC::CDCWireLayer::getILayer
ILayer getILayer() const
Getter for the layer id unique within the superlayer.
Definition: CDCWireLayer.h:102
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::CDCWire::getRefCylindricalR
double getRefCylindricalR() const
Getter for the cylindrical radius at the wire reference position.
Definition: CDCWire.h:262