8#include <tracking/trackFindingCDC/filters/segment/AdvancedSegmentVarSet.h>
10#include <tracking/trackFindingCDC/fitting/CDCRiemannFitter.h>
12#include <tracking/trackingUtilities/eventdata/segments/CDCSegment2D.h>
13#include <tracking/trackingUtilities/eventdata/hits/CDCWireHit.h>
15#include <cdc/topology/CDCWireTopology.h>
16#include <cdc/topology/ISuperLayer.h>
18#include <cdc/dataobjects/CDCHit.h>
20#include <Math/Vector2D.h>
24using namespace TrackFindingCDC;
25using namespace TrackingUtilities;
31 ISuperLayer iSuperLayer = segment->getISuperLayer();
37 unsigned int size = segment->size();
39 int totalNNeighbors = 0;
40 double totalInnerDistance = 0;
41 double totalDriftLength = 0;
42 double totalDriftLengthSquared = 0;
43 double driftVariance = 0;
44 double totalADCCount = 0;
45 double totalADCCountSquared = 0;
46 double adcCountVariance;
47 unsigned int numberOfTakenHits = 0;
50 std::vector<bool> layerIsHit(8,
false);
53 const CDCWireHit& wireHit = recoHit.getWireHit();
64 totalNNeighbors += nNeighbors;
71 totalDriftLength += driftLength;
72 totalDriftLengthSquared += driftLength * driftLength;
75 double adc =
static_cast<double>(wireHit.
getHit()->getADCCount());
77 totalADCCountSquared += adc * adc;
81 double driftLengthVarianceSquared = (totalDriftLengthSquared - totalDriftLength * totalDriftLength / size) / (size - 1.0) ;
82 double adcVarianceSquared = (totalADCCountSquared - totalADCCount * totalADCCount / size) / (size - 1.0) ;
84 if (driftLengthVarianceSquared > 0) {
85 driftVariance = std::sqrt(driftLengthVarianceSquared);
90 if (adcVarianceSquared > 0) {
91 adcCountVariance = std::sqrt(adcVarianceSquared);
98 adcCountVariance = -1;
101 unsigned int numberOfHitLayers = 0;
102 for (
bool hit : layerIsHit) {
112 var<
named(
"is_stereo")>() = segment->getStereoKind() != EStereoKind::c_Axial;
115 var<
named(
"number_of_taken_hits")>() = numberOfTakenHits;
117 var<
named(
"number_of_hit_layers")>() = numberOfHitLayers;
119 var<
named(
"total_number_of_neighbors")>() = totalNNeighbors;
120 var<
named(
"total_drift_length")>() = totalDriftLength;
121 var<
named(
"total_adc_count")>() = totalADCCount;
122 var<
named(
"total_inner_distance")>() = totalInnerDistance;
124 var<
named(
"variance_drift_length")>() = driftVariance;
125 var<
named(
"variance_adc_count")>() = adcCountVariance;
127 var<
named(
"distance_to_superlayer_center")>() = superLayerCenter - totalInnerDistance / size;
128 var<
named(
"superlayer_id")>() = iSuperLayer;
130 var<
named(
"mean_drift_length")>() = totalDriftLength / size;
131 var<
named(
"mean_adc_count")>() = totalADCCount / size;
132 var<
named(
"mean_inner_distance")>() = totalInnerDistance / size;
133 var<
named(
"mean_number_of_neighbors")>() = 1.0 * totalNNeighbors / size;
Class representing a sense wire superlayer in the central drift chamber.
double getMiddleCylindricalR() const
Getter for the radius in the middle of the layer.
Class representing the sense wire arrangement in the whole of the central drift chamber.
const CDCWireSuperLayer & getWireSuperLayer(const WireID &wireID) const
Getter for wire superlayer getter by wireID object.
static CDCWireTopology & getInstance()
Getter for the singleton instance of the wire topology.
ILayer getILayer() const
Getter for the layer id within its superlayer Gives the layer id within its superlayer ranging from ...
bool extract(const TrackingUtilities::CDCSegment2D *segment) final
Generate and assign the contained variables.
Class implementing the Riemann fit for two dimensional trajectory circle.
static const CDCRiemannFitter & getFitter()
Static getter for a general Riemann fitter.
Weight getCellWeight() const
Getter for the cell weight.
bool hasTakenFlag() const
Gets the current state of the taken marker flag.
Class representing a two dimensional reconstructed hit in the central drift chamber.
A reconstructed sequence of two dimensional hits in one super layer.
Particle trajectory as it is seen in xy projection represented as a circle.
double getPValue() const
Getter for p-value.
double getDist2D(const ROOT::Math::XYVector &point) const
Calculates the distance from the point to the trajectory as seen from the xy projection.
Class representing a hit wire in the central drift chamber.
const CDCHit * getHit() const
Getter for the CDCHit pointer into the StoreArray.
double getRefDriftLength() const
Getter for the drift length at the reference position of the wire.
const ROOT::Math::XYVector & getRefPos2D() const
The two dimensional reference position (z=0) of the underlying wire.
const CDC::CDCWire & getWire() const
Getter for the CDCWire the hit is located on.
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
static constexpr int named(const char *name)
signed short ISuperLayer
The type of the layer and superlayer ids.
Abstract base class for different kinds of events.
static bool isInCDC(ISuperLayer iSuperLayer)
Indicates if the given number corresponds to a true cdc superlayer - excludes the logic ids for inner...