ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::LeadTracksRoISeedTool Class Referencefinal

#include <LeadTracksRoISeedTool.h>

Inheritance diagram for InDet::LeadTracksRoISeedTool:
Collaboration diagram for InDet::LeadTracksRoISeedTool:

Public Member Functions

Standard tool methods
 LeadTracksRoISeedTool (const std::string &, const std::string &, const IInterface *)
virtual ~LeadTracksRoISeedTool ()=default
virtual StatusCode initialize () override
virtual std::vector< ZWindow > getRoIs (const EventContext &ctx) const override
 Compute RoI.

Protected Member Functions

Disallow default instantiation, copy, assignment
 LeadTracksRoISeedTool ()=delete
 LeadTracksRoISeedTool (const LeadTracksRoISeedTool &)=delete
LeadTracksRoISeedTooloperator= (const LeadTracksRoISeedTool &)=delete

Static Protected Member Functions

static bool tracksPtGreaterThan (const Trk::Track *const &track1, const Trk::Track *const &track2)

Protected Attributes

Tool configuration properties
SG::ReadHandleKey< TrackCollectionm_inputTracksCollectionKey {this, "InputTracksCollection", "ExtendedTracks", "Input Track collection."}
FloatProperty m_trkLeadingPt {this, "LeadingMinTrackPt", 18000., "min. p_{T} of leading track"}
FloatProperty m_trkSubLeadingPt {this, "SubleadingMinTrackPt", 12500., "min. p_{T} of sub-leading track"}
FloatProperty m_trkEtaMax {this, "TracksMaxEta", 2.5, "max |eta| for tracks consideration"}
FloatProperty m_trkD0Max {this, "TracksMaxD0", 9999., "max |d0| for tracks consideration"}
FloatProperty m_maxDeltaZ {this, "MaxDeltaZTracksPair", 1.0, "maximum delta z0 between leading tracks pair"}
FloatProperty m_z0Window {this, "TrackZ0Window", 30.0, "width of z0 window"}
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey {this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"}
ToolHandle< Reco::ITrackToVertexm_trackToVertex {this, "TrackToVertexTool", "Reco::TrackToVertex/TrackToVertex", "Track-to-Vertex extrapolation tool"}

Detailed Description

Definition at line 29 of file LeadTracksRoISeedTool.h.

Constructor & Destructor Documentation

◆ LeadTracksRoISeedTool() [1/3]

InDet::LeadTracksRoISeedTool::LeadTracksRoISeedTool ( const std::string & t,
const std::string & n,
const IInterface * p )

Definition at line 26 of file LeadTracksRoISeedTool.cxx.

28 : base_class(t,n,p)
29{
30}

◆ ~LeadTracksRoISeedTool()

virtual InDet::LeadTracksRoISeedTool::~LeadTracksRoISeedTool ( )
virtualdefault

◆ LeadTracksRoISeedTool() [2/3]

InDet::LeadTracksRoISeedTool::LeadTracksRoISeedTool ( )
protecteddelete

◆ LeadTracksRoISeedTool() [3/3]

InDet::LeadTracksRoISeedTool::LeadTracksRoISeedTool ( const LeadTracksRoISeedTool & )
protecteddelete

Member Function Documentation

◆ getRoIs()

std::vector< InDet::IZWindowRoISeedTool::ZWindow > InDet::LeadTracksRoISeedTool::getRoIs ( const EventContext & ctx) const
overridevirtual

Compute RoI.

Definition at line 52 of file LeadTracksRoISeedTool.cxx.

53{
54
55 static const float nonZeroInvP = 1e-9;
56
57 // prepare output
58 std::vector<InDet::IZWindowRoISeedTool::ZWindow> listRoIs;
59 InDet::IZWindowRoISeedTool::ZWindow RoI;
60 listRoIs.clear();
61
62 //select tracks, then order by pT
63 SG::ReadHandle<TrackCollection> tracks(m_inputTracksCollectionKey, ctx);
64 if ( not tracks.isValid() ) {
65 ATH_MSG_ERROR("Could not find TrackCollection " << m_inputTracksCollectionKey.key() << " in StoreGate.");
66 return listRoIs;
67 }
68 ATH_MSG_DEBUG("Input track collection size "<<tracks->size());
69 SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle{m_beamSpotKey, ctx};
70
71 std::vector<Trk::Track*> selectedTracks;
72 for ( Trk::Track* trk : tracks->stdcont() ) {
73 float theta = trk->perigeeParameters()->parameters()[Trk::theta];
74 float ptinv = std::abs(trk->perigeeParameters()->parameters()[Trk::qOverP]) / std::sin(theta);
75 if (ptinv < 0.001) //1 GeV tracks
76 ATH_MSG_VERBOSE("Examining track");
77 if ( std::abs(ptinv) > nonZeroInvP ) {
78 float pt = 1. / ptinv;
79 if (pt > 1000.) //1 GeV tracks for printout
80 ATH_MSG_VERBOSE("- pT = " << pt << " MeV");
81 if ( pt < m_trkSubLeadingPt ) continue;
82 }
83 float eta = -std::log( std::tan( 0.5*theta ) );
84 ATH_MSG_VERBOSE("- eta = " << eta);
85 if ( std::abs(eta) > m_trkEtaMax ) continue;
86 float d0 = trk->perigeeParameters()->parameters()[Trk::d0];
87 ATH_MSG_VERBOSE("- d0 = " << d0 << "mm");
88 if ( std::abs(d0) > m_trkD0Max ) continue;
89 ATH_MSG_VERBOSE("- Passed all selections");
90 selectedTracks.push_back(trk);
91 }
92
93 std::sort(selectedTracks.begin(), selectedTracks.end(), tracksPtGreaterThan);
94 ATH_MSG_DEBUG("Selected track collection size "<<selectedTracks.size());
95
96 //create all pairs that satisfy leading pT and delta z0 requirements
97 for ( Trk::Track *trkLeading : selectedTracks ) {
98 //kinematic requirements
99 float thetaLeading = trkLeading->perigeeParameters()->parameters()[Trk::theta];
100 float ptInvLeading = std::abs(trkLeading->perigeeParameters()->parameters()[Trk::qOverP]) / std::sin(thetaLeading);
101 ATH_MSG_VERBOSE("Examining selected track pairs");
102 if (std::abs(ptInvLeading) > nonZeroInvP) {
103 float pt = 1. / ptInvLeading;
104 ATH_MSG_VERBOSE("- pT_leading = " << pt << " MeV");
105 if ( pt < m_trkLeadingPt ) break; //tracks ordered by pT
106 }
107 //loop over sub-leading track
108 for ( Trk::Track* trk : selectedTracks ) {
109 //kinematic requirements
110 float z0Leading = trkLeading->perigeeParameters()->parameters()[Trk::z0];
111 float z0 = trk->perigeeParameters()->parameters()[Trk::z0];
112 ATH_MSG_VERBOSE("- z0Leading = " << z0Leading << " mm");
113 ATH_MSG_VERBOSE("- z0_sublead = " << z0 << " mm");
114
115 auto leadAtBeam = m_trackToVertex->perigeeAtBeamline(ctx, *trkLeading, *beamSpotHandle);
116 auto subleadAtBeam = m_trackToVertex->perigeeAtBeamline(ctx, *trk, *beamSpotHandle);
117 float z0LeadingBeam = leadAtBeam->parameters()[Trk::z0];
118 float z0Beam = subleadAtBeam->parameters()[Trk::z0];
119
120 if ( std::abs(z0LeadingBeam - z0Beam) > m_maxDeltaZ ) continue;
121 //create the pair in global coordinates
122 float z0TrkReference = subleadAtBeam->associatedSurface().center().z();
123 float z0TrkLeadingReference = leadAtBeam->associatedSurface().center().z();
124 RoI.zReference = (z0Beam + z0TrkReference + z0LeadingBeam + z0TrkLeadingReference) / 2;
125 RoI.zWindow[0] = RoI.zReference - m_z0Window;
126 RoI.zWindow[1] = RoI.zReference + m_z0Window;
127 RoI.zPerigeePos[0] = z0LeadingBeam;
128 RoI.zPerigeePos[1] = z0Beam;
129 ATH_MSG_DEBUG("New RoI created [mm]: " << RoI.zWindow[0] << " - " << RoI.zWindow[1] << " (z-ref: " << RoI.zReference << ")");
130 listRoIs.push_back(RoI);
131 }
132 }
133
134
135 if( listRoIs.empty() ){
136 for( Trk::Track* trkLeading : selectedTracks ){
137 //kinematic requirements
138 float thetaLeading = trkLeading->perigeeParameters()->parameters()[Trk::theta];
139 float ptInvLeading = std::abs(trkLeading->perigeeParameters()->parameters()[Trk::qOverP]) / std::sin(thetaLeading);
140 ATH_MSG_VERBOSE("Examining selected track pairs");
141 if (std::abs(ptInvLeading) > nonZeroInvP) {
142 float pt = 1. / ptInvLeading;
143 ATH_MSG_VERBOSE("- pT_leading = " << pt << " MeV");
144 if ( pt < m_trkLeadingPt ) break; //tracks ordered by pT
145
146 auto leadAtBeam = m_trackToVertex->perigeeAtBeamline(ctx, *trkLeading, *beamSpotHandle);
147 float z0LeadingBeam = leadAtBeam->parameters()[Trk::z0];
148
149 //create the pair in global coordinates
150 float z0TrkLeadingReference = leadAtBeam->associatedSurface().center().z();
151 RoI.zReference = z0LeadingBeam + z0TrkLeadingReference;
152 RoI.zWindow[0] = RoI.zReference - m_z0Window;
153 RoI.zWindow[1] = RoI.zReference + m_z0Window;
154 RoI.zPerigeePos[0] = z0LeadingBeam;
155 ATH_MSG_DEBUG("New RoI created [mm]: " << RoI.zWindow[0] << " - " << RoI.zWindow[1] << " (z-ref: " << RoI.zReference << ")");
156 listRoIs.push_back(RoI);
157 }
158
159
160 }
161 }
162
163 return listRoIs;
164
165}
Scalar eta() const
pseudorapidity method
Scalar theta() const
theta method
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
static bool tracksPtGreaterThan(const Trk::Track *const &track1, const Trk::Track *const &track2)
ToolHandle< Reco::ITrackToVertex > m_trackToVertex
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
SG::ReadHandleKey< TrackCollection > m_inputTracksCollectionKey
@ theta
Definition ParamDefs.h:66
@ qOverP
perigee
Definition ParamDefs.h:67
@ d0
Definition ParamDefs.h:63
@ z0
Definition ParamDefs.h:64
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ initialize()

StatusCode InDet::LeadTracksRoISeedTool::initialize ( )
overridevirtual

Definition at line 36 of file LeadTracksRoISeedTool.cxx.

37{
38 StatusCode sc = AlgTool::initialize();
39
41 ATH_CHECK( m_beamSpotKey.initialize() );
42
43 ATH_CHECK( m_trackToVertex.retrieve() );
44
45 return sc;
46}
#define ATH_CHECK
Evaluate an expression and check for errors.
static Double_t sc
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ operator=()

LeadTracksRoISeedTool & InDet::LeadTracksRoISeedTool::operator= ( const LeadTracksRoISeedTool & )
protecteddelete

◆ tracksPtGreaterThan()

bool InDet::LeadTracksRoISeedTool::tracksPtGreaterThan ( const Trk::Track *const & track1,
const Trk::Track *const & track2 )
inlinestaticprotected

Definition at line 75 of file LeadTracksRoISeedTool.h.

76 {
77 float theta1 = track1->perigeeParameters()->parameters()[Trk::theta];
78 float ptinv1 = std::abs(track1->perigeeParameters()->parameters()[Trk::qOverP]) / std::sin(theta1);
79 float theta2 = track2->perigeeParameters()->parameters()[Trk::theta];
80 float ptinv2 = std::abs(track2->perigeeParameters()->parameters()[Trk::qOverP]) / std::sin(theta2);
81 //return less than of inverse
82 return (ptinv1 < ptinv2);
83 }
const Perigee * perigeeParameters() const
return Perigee.

Member Data Documentation

◆ m_beamSpotKey

SG::ReadCondHandleKey<InDet::BeamSpotData> InDet::LeadTracksRoISeedTool::m_beamSpotKey {this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"}
protected

Definition at line 70 of file LeadTracksRoISeedTool.h.

70{this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"};

◆ m_inputTracksCollectionKey

SG::ReadHandleKey<TrackCollection> InDet::LeadTracksRoISeedTool::m_inputTracksCollectionKey {this, "InputTracksCollection", "ExtendedTracks", "Input Track collection."}
protected

Definition at line 63 of file LeadTracksRoISeedTool.h.

63{this, "InputTracksCollection", "ExtendedTracks", "Input Track collection."};

◆ m_maxDeltaZ

FloatProperty InDet::LeadTracksRoISeedTool::m_maxDeltaZ {this, "MaxDeltaZTracksPair", 1.0, "maximum delta z0 between leading tracks pair"}
protected

Definition at line 68 of file LeadTracksRoISeedTool.h.

68{this, "MaxDeltaZTracksPair", 1.0, "maximum delta z0 between leading tracks pair"};

◆ m_trackToVertex

ToolHandle< Reco::ITrackToVertex > InDet::LeadTracksRoISeedTool::m_trackToVertex {this, "TrackToVertexTool", "Reco::TrackToVertex/TrackToVertex", "Track-to-Vertex extrapolation tool"}
protected

Definition at line 71 of file LeadTracksRoISeedTool.h.

71{this, "TrackToVertexTool", "Reco::TrackToVertex/TrackToVertex", "Track-to-Vertex extrapolation tool"};

◆ m_trkD0Max

FloatProperty InDet::LeadTracksRoISeedTool::m_trkD0Max {this, "TracksMaxD0", 9999., "max |d0| for tracks consideration"}
protected

Definition at line 67 of file LeadTracksRoISeedTool.h.

67{this, "TracksMaxD0", 9999., "max |d0| for tracks consideration"};

◆ m_trkEtaMax

FloatProperty InDet::LeadTracksRoISeedTool::m_trkEtaMax {this, "TracksMaxEta", 2.5, "max |eta| for tracks consideration"}
protected

Definition at line 66 of file LeadTracksRoISeedTool.h.

66{this, "TracksMaxEta", 2.5, "max |eta| for tracks consideration"};

◆ m_trkLeadingPt

FloatProperty InDet::LeadTracksRoISeedTool::m_trkLeadingPt {this, "LeadingMinTrackPt", 18000., "min. p_{T} of leading track"}
protected

Definition at line 64 of file LeadTracksRoISeedTool.h.

64{this, "LeadingMinTrackPt", 18000., "min. p_{T} of leading track"};

◆ m_trkSubLeadingPt

FloatProperty InDet::LeadTracksRoISeedTool::m_trkSubLeadingPt {this, "SubleadingMinTrackPt", 12500., "min. p_{T} of sub-leading track"}
protected

Definition at line 65 of file LeadTracksRoISeedTool.h.

65{this, "SubleadingMinTrackPt", 12500., "min. p_{T} of sub-leading track"};

◆ m_z0Window

FloatProperty InDet::LeadTracksRoISeedTool::m_z0Window {this, "TrackZ0Window", 30.0, "width of z0 window"}
protected

Definition at line 69 of file LeadTracksRoISeedTool.h.

69{this, "TrackZ0Window", 30.0, "width of z0 window"};

The documentation for this class was generated from the following files: