8#include <tracking/trackFindingCDC/filters/segment/AdvancedSegmentVarSet.h>
10#include <tracking/trackFindingCDC/fitting/CDCRiemannFitter.h>
12#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
13#include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
15#include <tracking/trackFindingCDC/topology/CDCWireTopology.h>
16#include <tracking/trackFindingCDC/topology/ISuperLayer.h>
18#include <cdc/dataobjects/CDCHit.h>
21using namespace TrackFindingCDC;
27 ISuperLayer iSuperLayer = segment->getISuperLayer();
32 double superLayerCenter = superLayer.getMiddleCylindricalR();
33 unsigned int size = segment->size();
35 int totalNNeighbors = 0;
36 double totalInnerDistance = 0;
37 double totalDriftLength = 0;
38 double totalDriftLengthSquared = 0;
39 double driftVariance = 0;
40 double totalADCCount = 0;
41 double totalADCCountSquared = 0;
42 double adcCountVariance;
43 unsigned int numberOfTakenHits = 0;
46 std::vector<bool> layerIsHit(8,
false);
49 const CDCWireHit& wireHit = recoHit.getWireHit();
60 totalNNeighbors += nNeighbors;
67 totalDriftLength += driftLength;
68 totalDriftLengthSquared += driftLength * driftLength;
73 totalADCCountSquared += adc * adc;
77 double driftLengthVarianceSquared = (totalDriftLengthSquared - totalDriftLength * totalDriftLength / size) / (size - 1.0) ;
78 double adcVarianceSquared = (totalADCCountSquared - totalADCCount * totalADCCount / size) / (size - 1.0) ;
80 if (driftLengthVarianceSquared > 0) {
81 driftVariance = std::sqrt(driftLengthVarianceSquared);
86 if (adcVarianceSquared > 0) {
87 adcCountVariance = std::sqrt(adcVarianceSquared);
94 adcCountVariance = -1;
97 unsigned int numberOfHitLayers = 0;
98 for (
bool hit : layerIsHit) {
108 var<
named(
"is_stereo")>() = segment->getStereoKind() != EStereoKind::c_Axial;
111 var<
named(
"number_of_taken_hits")>() = numberOfTakenHits;
113 var<
named(
"number_of_hit_layers")>() = numberOfHitLayers;
115 var<
named(
"total_number_of_neighbors")>() = totalNNeighbors;
116 var<
named(
"total_drift_length")>() = totalDriftLength;
117 var<
named(
"total_adc_count")>() = totalADCCount;
118 var<
named(
"total_inner_distance")>() = totalInnerDistance;
120 var<
named(
"variance_drift_length")>() = driftVariance;
121 var<
named(
"variance_adc_count")>() = adcCountVariance;
123 var<
named(
"distance_to_superlayer_center")>() = superLayerCenter - totalInnerDistance / size;
124 var<
named(
"superlayer_id")>() = iSuperLayer;
126 var<
named(
"mean_drift_length")>() = totalDriftLength / size;
127 var<
named(
"mean_adc_count")>() = totalADCCount / size;
128 var<
named(
"mean_inner_distance")>() = totalInnerDistance / size;
129 var<
named(
"mean_number_of_neighbors")>() = 1.0 * totalNNeighbors / size;
unsigned short getADCCount() const
Getter for integrated charge.
bool extract(const CDCSegment2D *segment) final
Generate and assign the contained variables.
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.
Class implementing the Riemann fit for two dimensional trajectory circle.
static const CDCRiemannFitter & getFitter()
Static getter for a general Riemann fitter.
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 Vector2D &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 CDCWire & getWire() const
Getter for the CDCWire the hit is located on.
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
const Vector2D & getRefPos2D() const
The two dimensional reference position (z=0) of the underlying wire.
Class representing a sense wire superlayer in the central drift chamber.
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 ...
static constexpr int named(const char *name)
Getter for the index from the name.
Float_t & var()
Reference getter for the value of the ith variable. Static version.
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
double norm() const
Calculates the length of the vector.
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...