ATLAS Offline Software
Static Protected Member Functions | List of all members
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. More...
 

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;
60  listRoIs.clear();
61 
62  //select tracks, then order by pT
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());
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 }

◆ initialize()

StatusCode InDet::LeadTracksRoISeedTool::initialize ( )
overridevirtual

Definition at line 36 of file LeadTracksRoISeedTool.cxx.

37 {
39 
40  ATH_CHECK( m_inputTracksCollectionKey.initialize() );
42 
43  ATH_CHECK( m_trackToVertex.retrieve() );
44 
45  return sc;
46 }

◆ operator=()

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

◆ tracksPtGreaterThan()

static 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  }

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.

◆ m_inputTracksCollectionKey

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

Definition at line 63 of file LeadTracksRoISeedTool.h.

◆ 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.

◆ 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.

◆ m_trkD0Max

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

Definition at line 67 of file LeadTracksRoISeedTool.h.

◆ 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.

◆ 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.

◆ 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.

◆ m_z0Window

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

Definition at line 69 of file LeadTracksRoISeedTool.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
InDet::LeadTracksRoISeedTool::m_z0Window
FloatProperty m_z0Window
Definition: LeadTracksRoISeedTool.h:69
test_pyathena.eta
eta
Definition: test_pyathena.py:10
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
InDet::LeadTracksRoISeedTool::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: LeadTracksRoISeedTool.h:70
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
initialize
void initialize()
Definition: run_EoverP.cxx:894
test_pyathena.pt
pt
Definition: test_pyathena.py:11
Trk::z0
@ z0
Definition: ParamDefs.h:64
InDet::LeadTracksRoISeedTool::m_maxDeltaZ
FloatProperty m_maxDeltaZ
Definition: LeadTracksRoISeedTool.h:68
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
InDet::LeadTracksRoISeedTool::m_trkSubLeadingPt
FloatProperty m_trkSubLeadingPt
Definition: LeadTracksRoISeedTool.h:65
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
InDet::LeadTracksRoISeedTool::m_inputTracksCollectionKey
SG::ReadHandleKey< TrackCollection > m_inputTracksCollectionKey
Definition: LeadTracksRoISeedTool.h:63
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
InDet::IZWindowRoISeedTool::ZWindow
Definition: IZWindowRoISeedTool.h:46
beamspotman.n
n
Definition: beamspotman.py:731
Trk::theta
@ theta
Definition: ParamDefs.h:66
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDet::IZWindowRoISeedTool::ZWindow::zPerigeePos
float zPerigeePos[2]
Definition: IZWindowRoISeedTool.h:53
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
jobOption.theta
theta
Definition: jobOption.ParticleGun_fwd_sequence.py:13
Trk::Track::perigeeParameters
const Perigee * perigeeParameters() const
return Perigee.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:163
InDet::LeadTracksRoISeedTool::m_trkD0Max
FloatProperty m_trkD0Max
Definition: LeadTracksRoISeedTool.h:67
Trk::d0
@ d0
Definition: ParamDefs.h:63
InDet::LeadTracksRoISeedTool::tracksPtGreaterThan
static bool tracksPtGreaterThan(const Trk::Track *const &track1, const Trk::Track *const &track2)
Definition: LeadTracksRoISeedTool.h:75
InDet::IZWindowRoISeedTool::ZWindow::zWindow
float zWindow[2]
Definition: IZWindowRoISeedTool.h:49
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
InDet::LeadTracksRoISeedTool::m_trackToVertex
ToolHandle< Reco::ITrackToVertex > m_trackToVertex
Definition: LeadTracksRoISeedTool.h:71
InDet::LeadTracksRoISeedTool::m_trkLeadingPt
FloatProperty m_trkLeadingPt
Definition: LeadTracksRoISeedTool.h:64
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
InDet::IZWindowRoISeedTool::ZWindow::zReference
float zReference
Definition: IZWindowRoISeedTool.h:51
InDet::LeadTracksRoISeedTool::m_trkEtaMax
FloatProperty m_trkEtaMax
Definition: LeadTracksRoISeedTool.h:66