10#include <framework/dataobjects/EventMetaData.h>
11#include <framework/datastore/StoreObjPtr.h>
13#include <tracking/trackFindingVXD/variableExtractors/VariableExtractor.h>
14#include <tracking/dataobjects/RecoTrack.h>
38 addVariable(
"N_diff_PXD_SVD_RecoTracks", variableSet);
39 addVariable(
"N_diff_SVD_CDC_RecoTracks", variableSet);
51 int n_pxdRecoTracks = 0;
52 int n_svdRecoTracks = 0;
53 int n_cdcRecoTracks = 0;
54 float min_mom_diff_mag = std::numeric_limits<float>::max();
55 float min_mom_diff_Pt = std::numeric_limits<float>::max();
56 float min_pos_diff_Theta = std::numeric_limits<float>::max();
57 float min_pos_diff_Phi = std::numeric_limits<float>::max();
59 for (
const RecoTrack& recoTrack : recoTracks) {
60 if (recoTrack.hasPXDHits())
62 if (recoTrack.hasSVDHits())
64 if (recoTrack.hasCDCHits())
67 if (recoTrack.getArrayIndex() == thisRecoTrack.
getArrayIndex())
70 float mom_diff_mag = fabs(recoTrack.getMomentumSeed().R() - thisRecoTrack.
getMomentumSeed().R());
71 if (mom_diff_mag < min_mom_diff_mag) {
72 min_mom_diff_mag = mom_diff_mag;
74 float mom_diff_Pt = fabs(recoTrack.getMomentumSeed().Rho() - thisRecoTrack.
getMomentumSeed().Rho());
75 if (mom_diff_Pt < min_mom_diff_Pt) {
76 min_mom_diff_Pt = mom_diff_Pt;
78 float pos_diff_Theta = fabs(recoTrack.getPositionSeed().Theta() - thisRecoTrack.
getPositionSeed().Theta());
79 if (pos_diff_Theta < min_pos_diff_Theta) {
80 min_pos_diff_Theta = pos_diff_Theta;
82 float pos_diff_Phi = fabs(recoTrack.getPositionSeed().Phi() - thisRecoTrack.
getPositionSeed().Phi());
83 if (pos_diff_Phi < min_pos_diff_Phi) {
84 min_pos_diff_Phi = pos_diff_Phi;
90 m_variables.at(
"__experiment__") = m_eventMetaData->getExperiment();
91 m_variables.at(
"__run__") = m_eventMetaData->getRun();
92 m_variables.at(
"__event__") = m_eventMetaData->getEvent();
93 m_variables.at(
"N_PXDRecoTracks") = n_pxdRecoTracks;
94 m_variables.at(
"N_SVDRecoTracks") = n_svdRecoTracks;
95 m_variables.at(
"N_CDCRecoTracks") = n_cdcRecoTracks;
96 m_variables.at(
"N_diff_PXD_SVD_RecoTracks") = n_svdRecoTracks - n_pxdRecoTracks;
97 m_variables.at(
"N_diff_SVD_CDC_RecoTracks") = n_cdcRecoTracks - n_svdRecoTracks;
98 m_variables.at(
"RTs_Min_Mom_diff_Mag") = min_mom_diff_mag;
99 m_variables.at(
"RTs_Min_Mom_diff_Pt") = min_mom_diff_Pt;
100 m_variables.at(
"RTs_Min_Pos_diff_Theta") = min_pos_diff_Theta;
101 m_variables.at(
"RTs_Min_Pos_diff_Phi") = min_pos_diff_Phi;
A mixin class to attach a name to an object. Based on class with same name in CDC package.
This is the Reconstruction Event-Data Model Track.
ROOT::Math::XYZVector getPositionSeed() const
Return the position seed stored in the reco track. ATTENTION: This is not the fitted position.
ROOT::Math::XYZVector getMomentumSeed() const
Return the momentum seed stored in the reco track. ATTENTION: This is not the fitted momentum.
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
Accessor to arrays stored in the data store.
int getEntries() const
Get the number of objects in the array.
Type-safe access to single objects in the data store.
Abstract base class for different kinds of events.