9#include <cdc/topology/CDCWireTopology.h>
11#include <tracking/trackingUtilities/utilities/Algorithms.h>
13#include <tracking/trackingUtilities/utilities/Common.h>
15#include <cdc/geometry/CDCGeometryPar.h>
19using namespace TrackingUtilities;
42 for (
size_t iCLayer = 0; iCLayer < cdcGeo.
nWireLayers() ; ++iCLayer) {
43 for (
size_t iWire = 0; iWire < cdcGeo.
nWiresInLayer(iCLayer); ++iWire) {
49 std::vector<VectorRange<CDCWire>> wiresByILayer =
52 for (VectorRange<CDCWire> wiresForILayer : wiresByILayer) {
57 std::vector<VectorRange<CDCWireLayer> > layersByISuperLayer =
66 for (VectorRange<CDCWireLayer> layersForISuperLayer : layersByISuperLayer) {
74 wire.initialize(wirePosition, ignoreWireSag);
78 wireLayer.initialize();
82 wireSuperLayer.initialize();
89 const std::vector<CDCWireSuperLayer>& wireSuperLayers = cdcWireTopology.
getWireSuperLayers();
91 if (std::isnan(cylindricalR) or cylindricalR < 0) {
100 if (cylindricalR <= wireSuperLayer.getOuterCylindricalR()) {
101 return wireSuperLayer.getISuperLayer();
The Class for CDC Geometry Parameters.
ushort getOffsetOfFirstLayer() const
Get the offset of the first layer.
unsigned nWiresInLayer(int layerId) const
Returns wire numbers in a layer.
static CDCGeometryPar & Instance(const CDCGeometry *=nullptr)
Static method to get a reference to the CDCGeometryPar instance.
ushort getOffsetOfFirstSuperLayer() const
Get the offset of the first super layer.
unsigned nWireLayers() const
Returns a number of wire layers.
Class representing a sense wire layer in the central drift chamber.
Class representing a sense wire superlayer in the central drift chamber.
double getInnerCylindricalR() const
Getter for the inner radius of the layer as retrieved from the CDCGeometryPar by the inner most layer...
WireNeighborKind getNeighborKind(ILayer iLayer, IWire iWire, ILayer iOtherLayer, IWire iOtherWire) const
Checks if two wires are closest neighbors.
static const ISuperLayer c_NSuperLayers
Total number of superlayers.
WireNeighborKind getNeighborKind(const WireID &wireID, const WireID &otherWireID) const
Checks if two wires are closest neighbors.
void initialize()
Create all wires, wire layers and wire superlayers and their interdependences with base geometry from...
std::vector< CDCWireSuperLayer > m_wireSuperLayers
Storage for all wire superlayers in the CDC.
static const ILayer c_NLayers
Total number of layers.
std::vector< CDCWire > m_wires
Storage for all wires in the CDC.
ISuperLayer getISuperLayerAtCylindricalR(double cylindricalR)
Returns the logical superlayer number at the given radius.
const CDCWireSuperLayer & getWireSuperLayer(const WireID &wireID) const
Getter for wire superlayer getter by wireID object.
void reinitialize(EWirePosition wirePosition, bool ignoreWireSag)
Reload all geometry parameters form the CDCGeometryPar to adjust to changes in geometry.
std::vector< CDCWireLayer > m_wireLayers
Storage for all wire layers in the CDC.
CDCWireTopology()
Default constructor for ROOT compatibility. Use rather getInstance to get the shared singleton instan...
static CDCWireTopology & getInstance()
Getter for the singleton instance of the wire topology.
ILayer m_FirstLayerOffset
Offset of first layer.
const std::vector< CDCWireSuperLayer > & getWireSuperLayers() const
Getter for the underlying storing superlayer vector.
static const IWire c_NWires
Total number of wires.
bool isValidISuperLayer(ISuperLayer iSuperLayer) const
Checks the validity of the superlayer id.
Class representing a sense wire in the central drift chamber.
Type for the neighbor relationship from one wire to another.
Class to identify a wire inside the CDC.
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.
CDCGeometryPar::EWirePosition EWirePosition
For ease-of-use just create a new alias for CDCGeometryPar::EWirePosition.
signed short ISuperLayer
The type of the layer and superlayer ids.
Abstract base class for different kinds of events.
Generic functor to get the superlayer id from an object.
static const ISuperLayer c_Invalid
Constant making an invalid superlayer id.
static const ISuperLayer c_InnerVolume
Constant marking the subdetectors closer to the IP than the CDC.
static const ISuperLayer c_OuterVolume
Constant marking the subdetectors further away from the IP than the CDC.
Adapter of a category function to find the common category of several objects.