8#include <tracking/ckf/pxd/filters/results/PXDResultVarSet.h>
10#include <tracking/spacePointCreation/SpacePoint.h>
11#include <tracking/dataobjects/RecoTrack.h>
13#include <framework/core/ModuleParamList.templateDetails.h>
16using namespace TrackFindingCDC;
18PXDResultVarSet::PXDResultVarSet() : Super()
20 addProcessingSignalListener(&m_advancer);
27 moduleParamList.
getParameter<std::string>(
"direction").setValue(
"both");
34 const ROOT::Math::XYZVector& resultMomentum = result->getMomentum();
35 var<
named(
"pt")>() = resultMomentum.Rho();
36 var<
named(
"theta")>() = resultMomentum.Theta();
38 const std::vector<const SpacePoint*>& spacePoints = result->getHits();
40 var<
named(
"number_of_hits")>() = spacePoints.size();
42 std::vector<bool> layerUsed;
43 layerUsed.resize(7,
false);
45 for (
const SpacePoint* spacePoint : spacePoints) {
46 layerUsed[spacePoint->getVxdID().getLayerNumber()] =
true;
52 var<
named(
"number_of_holes")>() = std::count(layerUsed.begin(), layerUsed.end(),
true);
54 var<
named(
"has_missing_layer_1")>() = layerUsed[1] == 0;
55 var<
named(
"has_missing_layer_2")>() = layerUsed[2] == 0;
56 var<
named(
"has_missing_layer_3")>() = layerUsed[3] == 0;
57 var<
named(
"has_missing_layer_4")>() = layerUsed[4] == 0;
58 var<
named(
"has_missing_layer_5")>() = layerUsed[5] == 0;
59 var<
named(
"has_missing_layer_6")>() = layerUsed[6] == 0;
65 var<
named(
"number_of_overlap_hits")>() = std::count(layerUsed.begin(), layerUsed.end(), 2);
67 if (spacePoints.empty()) {
69 var<
named(
"first_hit_layer")>() = -1;
71 var<
named(
"last_hit_layer")>() = spacePoints.back()->getVxdID().getLayerNumber();
72 var<
named(
"first_hit_layer")>() = spacePoints.front()->getVxdID().getLayerNumber();
75 genfit::MeasuredStateOnPlane mSoP = result->getMSoP();
76 const genfit::MeasuredStateOnPlane& firstCDCHit = result->getSeedMSoP();
79 const auto& distance = mSoP.getPos() - firstCDCHit.getPos();
80 var<
named(
"distance_to_seed_track")>() = distance.Mag();
81 var<
named(
"distance_to_seed_track_xy")>() = distance.Pt();
83 const RecoTrack* seedTrack = result->getSeed();
85 var<
named(
"chi2")>() = result->getChi2();
86 var<
named(
"chi2_vxd_max")>() = result->getMaximalChi2();
87 var<
named(
"chi2_vxd_min")>() = result->getMinimalChi2();
89 var<
named(
"weight_sum")>() = result->getWeightSum();
double extrapolateToPlane(genfit::MeasuredStateOnPlane &measuredStateOnPlane, const genfit::SharedPlanePtr &plane) const
Extrapolate the mSoP of one plane to another plane and return the traveled distance or NAN,...
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
Expose the parameters.
Specialized CKF Result for extrapolating into the PXD.
The Module parameter list class.
void initialize() override
Receive signal before the start of the event processing.
PXDAdvancer m_advancer
Findlet for advancing.
bool extract(const CKFToPXDResult *object) final
Generate and assign the variables from the object.
This is the Reconstruction Event-Data Model Track.
const genfit::FitStatus * getTrackFitStatus(const genfit::AbsTrackRep *representation=nullptr) const
Return the track fit status for the given representation or for the cardinal one. You are not allowed...
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
void initialize() override
Receive and dispatch signal before the start of the event processing.
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.
ModuleParam< T > & getParameter(const std::string &name) const
Returns a reference to a parameter.
Abstract base class for different kinds of events.