8#include <tracking/ckf/svd/filters/results/SVDResultVarSet.h>
10#include <tracking/spacePointCreation/SpacePoint.h>
11#include <tracking/dataobjects/RecoTrack.h>
12#include <framework/core/ModuleParamList.templateDetails.h>
15using namespace TrackFindingCDC;
17SVDResultVarSet::SVDResultVarSet() : Super()
19 addProcessingSignalListener(&m_advancer);
26 moduleParamList.
getParameter<std::string>(
"direction").setValue(
"both");
33 const ROOT::Math::XYZVector& resultMomentum = result->getMomentum();
34 var<
named(
"pt")>() = resultMomentum.Rho();
35 var<
named(
"theta")>() = resultMomentum.Theta();
37 const std::vector<const SpacePoint*>& spacePoints = result->getHits();
39 var<
named(
"number_of_hits")>() = spacePoints.size();
41 std::vector<bool> layerUsed;
42 layerUsed.resize(7,
false);
44 for (
const SpacePoint* spacePoint : spacePoints) {
45 layerUsed[spacePoint->getVxdID().getLayerNumber()] =
true;
51 var<
named(
"number_of_holes")>() = std::count(layerUsed.begin(), layerUsed.end(),
true);
53 var<
named(
"has_missing_layer_1")>() = layerUsed[1] == 0;
54 var<
named(
"has_missing_layer_2")>() = layerUsed[2] == 0;
55 var<
named(
"has_missing_layer_3")>() = layerUsed[3] == 0;
56 var<
named(
"has_missing_layer_4")>() = layerUsed[4] == 0;
57 var<
named(
"has_missing_layer_5")>() = layerUsed[5] == 0;
58 var<
named(
"has_missing_layer_6")>() = layerUsed[6] == 0;
60 if (spacePoints.empty()) {
62 var<
named(
"first_hit_layer")>() = -1;
64 var<
named(
"last_hit_layer")>() = spacePoints.back()->getVxdID().getLayerNumber();
65 var<
named(
"first_hit_layer")>() = spacePoints.front()->getVxdID().getLayerNumber();
68 const RecoTrack* cdcTrack = result->getSeed();
70 B2ASSERT(
"CDC hits must be present", not cdcHits.empty());
72 const auto sortByCDCLayer = [](
const CDCHit * lhs,
const CDCHit * rhs) {
76 const auto& firstCDCHitIterator = std::min_element(cdcHits.begin(), cdcHits.end(), sortByCDCLayer);
77 var<
named(
"cdc_lowest_layer")>() = (*firstCDCHitIterator)->getICLayer();
79 genfit::MeasuredStateOnPlane mSoP = result->getMSoP();
80 const genfit::MeasuredStateOnPlane& firstCDCHit = result->getSeedMSoP();
83 const auto& distance = mSoP.getPos() - firstCDCHit.getPos();
84 var<
named(
"distance_to_cdc_track")>() = distance.Mag();
85 var<
named(
"distance_to_cdc_track_xy")>() = distance.Pt();
87 var<
named(
"chi2")>() = result->getChi2();
88 var<
named(
"chi2_vxd_max")>() = result->getMaximalChi2();
89 var<
named(
"chi2_vxd_min")>() = result->getMinimalChi2();
91 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.
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
unsigned short getICLayer() const
Getter for iCLayer (0-55).
Specialized CKF Result for extrapolating into the SVD.
The Module parameter list class.
This is the Reconstruction Event-Data Model Track.
std::vector< Belle2::RecoTrack::UsedCDCHit * > getCDCHitList() const
Return an unsorted list of cdc hits.
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...
bool extract(const CKFToSVDResult *object) final
Generate and assign the variables from the object.
void initialize() override
Receive signal before the start of the event processing.
SVDAdvancer m_advancer
Findlet for advancing.
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.