9#include <tracking/trackFindingCDC/topology/CDCWire.h>
11#include <tracking/trackFindingCDC/topology/CDCWireTopology.h>
12#include <tracking/trackFindingCDC/topology/CDCWireSuperLayer.h>
13#include <tracking/trackFindingCDC/topology/CDCWireLayer.h>
15#include <tracking/trackFindingCDC/topology/EWirePositionToCDC.h>
16#include <tracking/trackFindingCDC/topology/EWirePosition.h>
18#include <cdc/geometry/CDCGeometryPar.h>
19#include <cdc/dataobjects/CDCHit.h>
22using namespace TrackFindingCDC;
37 WireID wireID(hit.getID());
38 B2ERROR(
"Invalid encoded wire id of cdc hit " << wireID);
41 B2ERROR(
"Layer id: " << wireID.
getILayer());
42 B2ERROR(
"Wire id: " << wireID.
getIWire());
43 B2FATAL(
"Do not continue with wrong wire id");
49 if (wire.
getEWire() != hit.getID()) {
50 B2ERROR(
"WireID.getEWire() differs from CDCHit.getID()");
51 B2ERROR(
"WireID.getEWire() : " << wire.
getEWire());
52 B2ERROR(
"CDCHit.getEWire() : " << hit.getID());
79 double sagCoeff = ignoreWireSag ? 0 : cdcgp.
getWireSagCoef(wirePosSet, iCLayer, iWire);
86 B2WARNING(
"Odd wire " << *
this);
87 B2WARNING(
"wireForwardPosition " << forwardPos);
88 B2WARNING(
"wireBackwardPosition " << backwardPos);
99 if (not inZ)
return false;
107 bool inCylindricalR = innerCylindricalR < cylindricalR and cylindricalR < outerCylindricalR;
108 if (not inCylindricalR)
return false;
112 iWire %= wireLayer.
size();
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
The Class for CDC Geometry Parameters.
EWirePosition
Wire position set.
unsigned cellId(unsigned layerId, const B2Vector3D &position) const
The method to get cell id based on given layer id and the position.
const B2Vector3D wireForwardPosition(uint layerId, int cellId, EWirePosition set=c_Base) const
Returns the forward position of the input sense wire.
const B2Vector3D wireBackwardPosition(uint layerId, int cellId, EWirePosition set=c_Base) const
Returns the backward position of the input sense wire.
double getWireSagCoef(EWirePosition set, uint layerId, int cellId) const
Returns coefficient for the sense wire sag.
static CDCGeometryPar & Instance(const CDCGeometry *=nullptr)
Static method to get a reference to the CDCGeometryPar instance.
Class representing a sense wire layer in the central drift chamber.
double getInnerCylindricalR() const
Getter for inner radius of the layer as taken from the CDCGeometryPar.
double getLateralCellWidth() const
Getter for the width of the wire layer in the lateral direction.
double getOuterCylindricalR() const
Getter for outer radius of the layer as taken from the CDCGeometryPar.
double getRadialCellWidth() const
Getter for the width of the wire layer in the radial direction.
Class representing a sense wire superlayer in the central drift chamber.
MayBePtr< const CDCWire > getNeighborCCWInwards(const WireID &wireID) const
Getter for the nearest counterclockwise neighbor in the next layer outwards.
const CDCWire & getWire(const WireID &wireId) const
Getter for wire getter by wireID object.
WireNeighborKind getNeighborKind(const WireID &wireID, const WireID &otherWireID) const
Checks if two wires are closest neighbors.
bool arePrimaryNeighbors(const WireID &wireID, const WireID &otherWireID) const
Checks if two wires are primary neighbors.
MayBePtr< const CDCWire > getSecondaryNeighbor(short oClockDirection, const WireID &wireID) const
Getter for the secondary neighbor of the given wire id.
MayBePtr< const CDCWire > getNeighborCCWOutwards(const WireID &wireID) const
Getter for the nearest counterclockwise neighbor in the next layer outwards.
const CDCWireSuperLayer & getWireSuperLayer(const WireID &wireID) const
Getter for wire superlayer getter by wireID object.
WireNeighborPair getNeighborsOutwards(const WireID &wireID) const
Getter for the two closest neighbors in the layer outwards.
MayBePtr< const CDCWire > getNeighborCWInwards(const WireID &wireID) const
Getter for the nearest clockwise neighbor in the next layer outwards.
MayBePtr< const CDCWire > getNeighborCCW(const WireID &wireID) const
Getter for the nearest counterclockwise neighbor.
MayBePtr< const CDCWire > getNeighborCWOutwards(const WireID &wireID) const
Getter for the nearest clockwise neighbor in the next layer outwards.
const CDCWireLayer & getWireLayer(const WireID &wireId) const
Getter for wire layer getter by wireID object.
static CDCWireTopology & getInstance()
Getter for the singleton instance of the wire topology.
MayBePtr< const CDCWire > getNeighborCW(const WireID &wireID) const
Getter for the nearest clockwise neighbor.
WireNeighborPair getNeighborsInwards(const WireID &wireID) const
Getter for the two closest neighbors in the layer inwards.
Class representing a sense wire in the central drift chamber.
CDCWire(const WireID &wireID)
Constructor taking the combined wire id convenience object.
ISuperLayer getISuperLayer() const
Gives the superlayer id ranging from 0 - 8.
MayBePtr< const CDCWire > getNeighborCWOutwards() const
Gives the closest neighbor in the clockwise outwards direction This does not cross superlayer boundar...
WireNeighborKind getNeighborKind(const CDCWire &wire) const
Returns gives the kind of neighborhood relation from this wire to the given wire.
bool isInCell(const Vector3D &pos3D) const
Checks whether the position is in the drift cell surrounding the wire.
WireLine m_wireLine
The line representation of the wire.
const WireID & getWireID() const
Getter for the wire id.
bool isAxial() const
Indicates if the wire is axial or stereo.
MayBePtr< const CDCWire > getNeighborCCWOutwards() const
Gives the closest neighbor in the countclockwise outwards direction This does not cross superlayer bo...
MayBePtr< const CDCWire > getNeighborCCW() const
Gives the closest neighbor in the counterclockwise direction - always exists.
MayBePtr< const CDCWire > getSecondaryNeighbor(short oClockDirection) const
Getter for the secondary neighbors of this wire id following the direction on the clock.
double getForwardZ() const
Getter for the z coordinate at the forward joint points of the wires.
WireNeighborPair getNeighborsOutwards() const
Gives the two wires in the next layer outward.
IWire getIWire() const
Getter for the wire id within its layer.
bool isPrimaryNeighborWith(const CDCWire &wire) const
Returns whether the give wire is a neighbor of this wire.
void initialize(EWirePosition wirePosition, bool ignoreWireSag)
(Re)load all geometry parameters form the CDCGeometryPar to adjust to changes in geometry.
unsigned short getEWire() const
Getter for the encoded wire number.
static const CDCWire * getInstance(const WireID &wireID)
Getter from the wireID convenience object. Does not construct a new object.
ILayer getICLayer() const
Getter for the continuous layer id ranging from 0 - 55.
MayBePtr< const CDCWire > getNeighborCWInwards() const
Gives the closest neighbor in the clockwise inwards direction This does not cross superlayer boundari...
MayBePtr< const CDCWire > getNeighborCW() const
Gives the closest neighbor in the clockwise direction - always exists.
const Vector2D & getRefPos2D() const
Getter for the wire reference position for 2D tracking Gives the wire's reference position projected ...
const CDCWireLayer & getWireLayer() const
Getter for the wire layer.
double getLateralCellWidth() const
Getter for the cell widths in lateral direction.
MayBePtr< const CDCWire > getNeighborCCWInwards() const
Gives the closest neighbor in the countclockwise inwards direction This does not cross superlayer bou...
double m_refCylindricalR
Precomputed distance to the beam line at the reference position.
WireNeighborPair getNeighborsInwards() const
Gives the two wires in the next layer inward.
const CDCWireSuperLayer & getWireSuperLayer() const
Getter for the wire super layer.
double getBackwardZ() const
Getter for the z coordinate at the backward joint points of the wires.
double getRadialCellWidth() const
Getter for the cell widths in radial direction.
std::size_t size() const
Returns the total number of objects in this range.
double norm() const
Calculates the length of the vector.
A three dimensional vector.
double cylindricalR() const
Getter for the cylindrical radius ( xy projected norm )
double z() const
Getter for the z coordinate.
A three dimensional limited line represented by its closest approach to the z-axes (reference positio...
const Vector3D & refPos3D() const
Returns the reference position.
double tanTheta() const
Returns the tangent of the opening angle between tangential vector and the z axes Also know as ds / d...
Vector3D backward3D() const
Gives the position of the backward point.
Vector3D forward3D() const
Gives the position of the forward point.
Type for the neighbor relationship from one wire to another.
Class representing a pair of neighbors in the CDC in a single layer For certain circumstances it is a...
Class to identify a wire inside the CDC.
unsigned short getICLayer() const
Getter for continuous layer numbering.
unsigned short getIWire() const
Getter for wire within the layer.
unsigned short getISuperLayer() const
Getter for Super-Layer.
unsigned short getILayer() const
Getter for layer within the Super-Layer.
EWirePosition
Wire position set.
Abstract base class for different kinds of events.