ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::InDetConversionTrackSelectorTool Class Reference

#include <InDetConversionTrackSelectorTool.h>

Inheritance diagram for InDet::InDetConversionTrackSelectorTool:
Collaboration diagram for InDet::InDetConversionTrackSelectorTool:

Public Member Functions

virtual StatusCode initialize () override
 InDetConversionTrackSelectorTool (const std::string &t, const std::string &n, const IInterface *p)
virtual ~InDetConversionTrackSelectorTool ()=default
virtual bool decision (const Trk::Track &track, const Trk::Vertex *vertex) const override final
 Select a Trk::Track.
virtual bool decision (const Trk::TrackParticleBase &track, const Trk::Vertex *vertex) const override final
 Select a Trk::TrackParticleBase.
virtual bool decision (const xAOD::TrackParticle &, const xAOD::Vertex *) const override final
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

int getCount (const xAOD::TrackParticle &tp, xAOD::SummaryType type) const
unsigned int getEtaBin (const Trk::Perigee &perigee) const
Amg::Vector3D getPosOrBeamSpot (const EventContext &ctx, const xAOD::Vertex *) const
Trk::VertexgetBeamSpot (const EventContext &ctx) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< Trk::IExtrapolatorm_extrapolator
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey
SG::ReadHandleKey< xAOD::EventInfom_eventInfo_key {this, "EventInfo", "EventInfo", "Input event information"}
Gaudi::Property< bool > m_useEventInfoBs {this,"UseEventInfoBS",false}
DoubleProperty m_maxSiD0 {this, "maxSiD0", 35., "Maximal d0 at (0,0,0) for tracks with Si hits"}
 Properties for track selection:all cuts are ANDed.
DoubleProperty m_maxTrtD0 {this, "maxTrtD0", 100., "Maximal d0 at (0,0,0) for standalone TRT tracks"}
DoubleProperty m_maxSiZ0 {this, "maxSiZ0", 200., "Maximal z0 at (0,0,0)"}
DoubleProperty m_maxTrtZ0 {this, "maxTrtZ0", 1200., "Maximal z0 at (0,0,0) for standalone TRT tracks"}
DoubleProperty m_minPt {this, "minPt", 500., "Minimum Pt of tracks"}
DoubleProperty m_trRatio1 {this, "RatioCut1", 0.5, "TR ratio for tracks with 15 or less TRT hits"}
DoubleProperty m_trRatio2 {this, "RatioCut2", 0.1, "TR ratio for tracks with 16 to 25 TRT hits"}
DoubleProperty m_trRatio3 {this, "RatioCut3", 0.05, "TR ratio for tracks with 26 or more TRT hits"}
DoubleProperty m_trRatioTRT {this, "RatioTRT", 0.1, "TR ratio for all TRT only tracks"}
DoubleArrayProperty m_TRTTrksEtaBins
DoubleArrayProperty m_TRTTrksBinnedRatioTRT
DoubleProperty m_trRatioV0 {this, "RatioV0", 1., "TR ratio for pion selection during V0 reconstruction"}
DoubleProperty m_sD0_Si {this, "significanceD0_Si", 2., "Cut on D0 significance of Si tracks"}
DoubleProperty m_sD0_Trt {this, "significanceD0_Trt", 0.5, "Cut on D0 significance of TRT tracks"}
DoubleProperty m_sZ0_Trt {this, "significanceZ0_Trt", 3., "Cut on Z0 significance of TRT tracks"}
BooleanProperty m_isConv {this, "IsConversion", true, "Conversion flag"}
BooleanProperty m_PIDonlyForXe {this, "PIDonlyForXe", false, "Only check TRT PID if all hits are Xe hits"}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 32 of file InDetConversionTrackSelectorTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ InDetConversionTrackSelectorTool()

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

Definition at line 21 of file InDetConversionTrackSelectorTool.cxx.

22 :AthAlgTool(t,n,p)
23 {
24 declareInterface<ITrackSelectorTool>(this);
25 }
AthAlgTool()
Default constructor:

◆ ~InDetConversionTrackSelectorTool()

virtual InDet::InDetConversionTrackSelectorTool::~InDetConversionTrackSelectorTool ( )
virtualdefault

Member Function Documentation

◆ decision() [1/3]

bool InDet::InDetConversionTrackSelectorTool::decision ( const Trk::Track & track,
const Trk::Vertex * vertex ) const
finaloverridevirtual

Select a Trk::Track.

Implements Trk::ITrackSelectorTool.

Definition at line 78 of file InDetConversionTrackSelectorTool.cxx.

79 {
80 const EventContext& ctx = Gaudi::Hive::currentContext();
81 bool pass = false;
82 const Trk::Perigee* perigee=dynamic_cast<const Trk::Perigee*>(track.perigeeParameters());
83 const bool vertexSuppliedByUser{vx!=nullptr};
84 const Trk::Vertex* myVertex=vx;
85 //in case no Vertex is provided by the user, beam position will be used if available
86 if (not vertexSuppliedByUser) {
87 myVertex = getBeamSpot(ctx);
88 }
89 Trk::PerigeeSurface perigeeSurface(myVertex->position());
90 const Trk::TrackParameters *firstmeaspar=nullptr;
91 for (const auto *i : *track.trackParameters()){
92 if ( i->covariance() && !dynamic_cast<const Trk::Perigee*>(i)) {
93 firstmeaspar=i;
94 break;
95 }
96 }
97 if (!firstmeaspar) {
98 //assumes perigeeParameters exist...
99 //no track selection if firstmeas + perigee does not exist !
100 firstmeaspar=track.perigeeParameters();
101 if (!firstmeaspar){
102 ATH_MSG_WARNING( " First measurment on track is missing. Using perigee Parameters, but they are missing: 0 pointer! Track selection failed " );
103 //clean up vertex
104 if (not vertexSuppliedByUser) delete myVertex;
105 return false;
106 }
107 }
108
109 const Trk::TrackParameters* extrapolatedParameters =
110 m_extrapolator->extrapolate(ctx,
111 *firstmeaspar,
112 perigeeSurface,
114 true,
115 track.info().particleHypothesis()).release();
116 perigee = extrapolatedParameters
117 ? dynamic_cast<const Trk::Perigee*>(extrapolatedParameters)
118 : nullptr;
119 if (perigee==nullptr || !perigee->covariance() ) {
120 ATH_MSG_WARNING( "Track Selector failed to extrapolate track to the vertex: " << myVertex->position() );
121 if (extrapolatedParameters!=nullptr) {
122 ATH_MSG_WARNING( "The return object of the extrapolator was not a perigee even if a perigeeSurface was used!");
123 delete extrapolatedParameters;
124 if (not vertexSuppliedByUser) delete myVertex;
125 return false;
126 }
127 if (not vertexSuppliedByUser) delete myVertex;
128 return false;
129 }
130
131 double qOverP = perigee->parameters()[Trk::qOverP];
132 double pt = std::fabs(1./qOverP)*std::sin(perigee->parameters()[Trk::theta]);
133 double d0 = perigee->parameters()[Trk::d0];
134 double z0 = perigee->parameters()[Trk::z0];
135 const Trk::TrackSummary* tSum = track.trackSummary();
136 if(tSum){
137 double ratioTrk = 1.0;
138 int nclus = tSum->get(Trk::numberOfPixelHits) + tSum->get(Trk::numberOfSCTHits);
139 bool isSilicon = (nclus > 0);
140 int nTrtHits = tSum->get(Trk::numberOfTRTHits);
141 int nTrtOutliers = tSum->get(Trk::numberOfTRTOutliers);
142 int ntrt = nTrtHits + nTrtOutliers;
143 int nTrtXenonHits = tSum->get(Trk::numberOfTRTXenonHits);
144 if(m_isConv) {
145 if(ntrt > 0 && (!m_PIDonlyForXe || nTrtXenonHits==ntrt) ){
146 // only check TRT PID if m_PIDonlyForXe is false or all TRT hits are Xenon hits
147 ATH_MSG_FATAL( "eProbabilityHT not available for Trk::Tracks only xAOD::TrackParticle objects" );
148 }
149
150 // Start of track cuts
151 if ( pt >= m_minPt ) {
152
153 // Silicon track cuts
154 if ( isSilicon && (std::fabs(d0)<=m_maxSiD0) && (fabs(z0)<=m_maxSiZ0) ) {
155 if((ntrt<=15 && ratioTrk>=m_trRatio1) ||
156 (ntrt>15 && ntrt<=25 && ratioTrk>=m_trRatio2) ||
157 (ntrt>25 && ratioTrk>=m_trRatio3)) pass = true;
158 }
159
160 // TRT-only track cuts
161 if ( (not isSilicon) && (std::fabs(d0)<=m_maxTrtD0) && (std::fabs(z0)<=m_maxTrtZ0) ) {
162
163 unsigned int eta_bin = getEtaBin(*perigee);
164 // TRT-only Tracks: eProbabilityHT cut below
165 // See InDet Trt Track Scoring Tool for nTRT cut on TRT-only tracks
166 double trRatioTRT = std::max( m_trRatioTRT.value(), m_TRTTrksBinnedRatioTRT[eta_bin] );
167
168 if ( ratioTrk >= trRatioTRT ) pass = true; // TRT Track cuts
169 }
170 } // end of track cuts for isConv
171
172 } else {
173 //The cuts below are necessary for the V0 track selection
174 const AmgSymMatrix(5)& err = *perigee->covariance();
175 double sd0sq = err(0,0);
176 double sd0 = (sd0sq>0.)?std::sqrt(sd0sq):0.;
177 double sz0sq = err(1,1);
178 double sz0 = (sz0sq>0.)?std::sqrt(sz0sq):0.;
179 if(nclus == 0){
180 if(std::fabs(d0)>=m_sD0_Trt*sd0 && std::fabs(d0)<=m_maxTrtD0 && std::fabs(z0)<=m_sZ0_Trt*sz0 && pt>=m_minPt) pass = true;
181 }else{
182 if(std::fabs(d0)>=m_sD0_Si*sd0 && std::fabs(z0)<=m_maxSiZ0 && pt>=m_minPt) pass = true;
183 }
184 ratioTrk = 1.0;
185 if(ntrt > 0 && (!m_PIDonlyForXe || nTrtXenonHits==ntrt) ) { // only check TRT PID if m_PIDonlyForXe is false or all TRT hits are Xenon hits
186 ATH_MSG_FATAL( "eProbabilityHT not available for Trk::Tracks only xAOD::TrackParticle objects" );
187 }
188 if(ratioTrk>m_trRatioV0) pass = false;
189 }
190
191 } else pass = false;
192 if (not vertexSuppliedByUser) delete myVertex;
193 if (perigee!=track.perigeeParameters()) delete perigee;
194 return pass;
195 }
#define ATH_MSG_FATAL(x)
#define ATH_MSG_WARNING(x)
#define AmgSymMatrix(dim)
unsigned int getEtaBin(const Trk::Perigee &perigee) const
DoubleProperty m_maxSiD0
Properties for track selection:all cuts are ANDed.
Trk::Vertex * getBeamSpot(const EventContext &ctx) const
int get(const SummaryType &type) const
returns the summary information for the passed SummaryType.
const Amg::Vector3D & position() const
return position of vertex
Definition Vertex.cxx:63
@ qOverP
perigee
@ anyDirection
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
@ theta
Definition ParamDefs.h:66
@ qOverP
perigee
Definition ParamDefs.h:67
@ d0
Definition ParamDefs.h:63
@ z0
Definition ParamDefs.h:64
ParametersBase< TrackParametersDim, Charged > TrackParameters
@ numberOfPixelHits
number of pixel layers on track with absence of hits

◆ decision() [2/3]

bool InDet::InDetConversionTrackSelectorTool::decision ( const Trk::TrackParticleBase & track,
const Trk::Vertex * vertex ) const
finaloverridevirtual

Select a Trk::TrackParticleBase.

Implements Trk::ITrackSelectorTool.

Definition at line 197 of file InDetConversionTrackSelectorTool.cxx.

198 {
199 const EventContext& ctx = Gaudi::Hive::currentContext();
200 bool pass = false;
201 const Trk::TrackParameters* definintParameters=&(track.definingParameters());
202 const Trk::Perigee* perigee=dynamic_cast<const Trk::Perigee*>(definintParameters);
203 const Trk::Vertex* myVertex=vx;
204 const bool vertexSuppliedByUser{vx!=nullptr};
205 //in case no Vertex is provided by the user, beam position will be used if available
206 if (not vertexSuppliedByUser) {
207 myVertex = getBeamSpot(ctx);
208 }
209
210 Trk::PerigeeSurface perigeeSurface(myVertex->position());
211 const Trk::TrackParameters *firstmeaspar=nullptr;
212 for (const auto *i : track.trackParameters()){
213 if ( i->covariance() && !dynamic_cast<const Trk::Perigee*>(i)) {
214 firstmeaspar=i;
215 break;
216 }
217 }
218 if (!firstmeaspar) {
219 //using perigee instead of firstmeasurement, since first measurement was not found...
220 firstmeaspar=&(track.definingParameters());
221 if (!firstmeaspar){
222 ATH_MSG_WARNING( " Track Paraemters at first measurement not found. Perigee not found. Cannot do TrackSelection..." );
223 if (not vertexSuppliedByUser) delete myVertex;
224 return false;
225 }
226 }
227 const Trk::TrackParameters* extrapolatedParameters =
228 m_extrapolator->extrapolate(
229 ctx, *firstmeaspar, perigeeSurface, Trk::anyDirection, true, Trk::pion).release();
230 perigee = extrapolatedParameters
231 ? dynamic_cast<const Trk::Perigee*>(extrapolatedParameters)
232 : nullptr;
233 if (perigee == nullptr || !perigee->covariance()) {
234 ATH_MSG_WARNING( "Track Selector failed to extrapolate track to the vertex: " << myVertex->position() );
235 if (extrapolatedParameters!=nullptr) {
236 ATH_MSG_WARNING( "The return object of the extrapolator was not a perigee even if a perigeeSurface was used!" );
237 delete extrapolatedParameters;
238 if (not vertexSuppliedByUser) delete myVertex;
239 return false;
240 }
241 if (not vertexSuppliedByUser) delete myVertex;
242 return false;
243 }
244
245 double qOverP = perigee->parameters()[Trk::qOverP];
246 double pt = std::fabs(1./qOverP)*std::sin(perigee->parameters()[Trk::theta]);
247 double d0 = perigee->parameters()[Trk::d0];
248 double z0 = perigee->parameters()[Trk::z0];
249 const Trk::TrackSummary* tSum = track.trackSummary();
250 if(tSum){
251 double ratioTrk = 1.0;
252 int nclus = tSum->get(Trk::numberOfPixelHits) + tSum->get(Trk::numberOfSCTHits);
253 bool isSilicon = (nclus > 0);
254 int nTrtHits = tSum->get(Trk::numberOfTRTHits);
255 int nTrtOutliers = tSum->get(Trk::numberOfTRTOutliers);
256 int ntrt = nTrtHits + nTrtOutliers;
257 int nTrtXenonHits = tSum->get(Trk::numberOfTRTXenonHits);
258
259 if(m_isConv){
260 if(ntrt > 0 && (!m_PIDonlyForXe || nTrtXenonHits==ntrt) ){
261 // only check TRT PID if m_PIDonlyForXe is false or all TRT hits are Xenon hits
262 ATH_MSG_FATAL( "eProbabilityHT not available for Trk::TrackParticleBase only xAOD::TrackParticle objects" );
263 }
264
265 // Start of track cuts
266 if ( pt >= m_minPt ) {
267
268 // Silicon track cuts
269 if ( isSilicon && (std::fabs(d0)<=m_maxSiD0) && (fabs(z0)<=m_maxSiZ0) ) {
270 if((ntrt<=15 && ratioTrk>=m_trRatio1) ||
271 (ntrt>15 && ntrt<=25 && ratioTrk>=m_trRatio2) ||
272 (ntrt>25 && ratioTrk>=m_trRatio3)) pass = true;
273 }
274
275 // TRT-only track cuts
276 if ( (not isSilicon) && (std::fabs(d0)<=m_maxTrtD0) && (std::fabs(z0)<=m_maxTrtZ0) ) {
277
278 unsigned int eta_bin = getEtaBin(*perigee);
279 // TRT-only Tracks: eProbabilityHT cuts below
280 // See InDet Trt Track Scoring Tool for nTRT cut on TRT-only tracks
281 double trRatioTRT = std::max( m_trRatioTRT.value(), m_TRTTrksBinnedRatioTRT[eta_bin] );
282
283 if ( ratioTrk >= trRatioTRT ) pass = true; // TRT Track cuts
284 }
285 } // end of track cuts for isConv
286
287 } else {
288 //The cuts below are necessary for the V0 track selection
289 const AmgSymMatrix(5)& err = *perigee->covariance();
290 double sd0sq = err(0,0);
291 double sd0 = (sd0sq>0.)?std::sqrt(sd0sq):0.;
292 double sz0sq = err(1,1);
293 double sz0 = (sz0sq>0.)?std::sqrt(sz0sq):0.;
294 if(nclus == 0){
295 if(std::fabs(d0)>=m_sD0_Trt*sd0 && std::fabs(d0)<= m_maxTrtD0 && std::fabs(z0)<=m_sZ0_Trt*sz0 && pt>=m_minPt) pass = true;
296 }else{
297 if(std::fabs(d0)>=m_sD0_Si*sd0 && std::fabs(z0)<=m_maxSiZ0 && pt>=m_minPt) pass = true;
298 }
299
300 ratioTrk = 1.0;
301 if(ntrt > 0 && (!m_PIDonlyForXe || nTrtXenonHits==ntrt) ) {// only check TRT PID if m_PIDonlyForXe is false or all TRT hits are Xenon hits
302 ATH_MSG_FATAL( "eProbabilityHT not available for Trk::TrackParticleBase only xAOD::TrackParticle objects" );
303 }
304 if(ratioTrk>m_trRatioV0) pass = false;
305 }
306 } else pass = false;
307 if (not vertexSuppliedByUser) delete myVertex;
308 if (perigee!=&(track.definingParameters())) delete perigee;
309
310 return pass;
311 }

◆ decision() [3/3]

bool InDet::InDetConversionTrackSelectorTool::decision ( const xAOD::TrackParticle & tp,
const xAOD::Vertex * vertex ) const
finaloverridevirtual

Implements Trk::ITrackSelectorTool.

Definition at line 338 of file InDetConversionTrackSelectorTool.cxx.

339 {
340 const EventContext& ctx = Gaudi::Hive::currentContext();
341 bool pass = false;
342 const Trk::Perigee& perigee=tp.perigeeParameters();
343 // in case no Vertex is provided by the user, beam position will be used if
344 // available
345 Trk::PerigeeSurface perigeeSurface(getPosOrBeamSpot(ctx, vertex));
346 const Trk::TrackParameters* extrapolatedParameters =
347 m_extrapolator->extrapolate(
348 ctx, perigee, perigeeSurface, Trk::anyDirection, false, Trk::pion).release();
349 if (extrapolatedParameters == nullptr) {
350 ATH_MSG_WARNING("Extrapolation to the vertex failed: " << perigeeSurface
351 << "\n"
352 << perigee);
353 return false;
354 }
355 double qOverP = perigee.parameters()[Trk::qOverP];
356 double pt = std::fabs(1./qOverP)*std::sin(perigee.parameters()[Trk::theta]);
357 double d0 = extrapolatedParameters->parameters()[Trk::d0];
358 double z0 = extrapolatedParameters->parameters()[Trk::z0];
359
360 double ratioTrk = 1.0;
362 bool isSilicon = (nclus > 0);
363 int nTrtHits = getCount(tp,xAOD::numberOfTRTHits);
364 int nTrtOutliers = getCount(tp,xAOD::numberOfTRTOutliers);
365 int ntrt = nTrtHits + nTrtOutliers;
366 int nTrtXenonHits = getCount(tp,xAOD::numberOfTRTXenonHits);
367
368 if(m_isConv){
369 float temp(0);
370 if(ntrt > 0 && (!m_PIDonlyForXe || nTrtXenonHits==ntrt) ){
371 // only check TRT PID if m_PIDonlyForXe is false or all TRT hits are Xenon hits
372 ratioTrk = tp.summaryValue(temp,xAOD::eProbabilityHT) ? temp: 0 ;
373 }
374
375 // Start of track cuts
376 if ( pt >= m_minPt ) {
377
378 // Silicon track cuts
379 if ( isSilicon && (std::fabs(d0)<=m_maxSiD0) && (fabs(z0)<=m_maxSiZ0) ) {
380 if((ntrt<=15 && ratioTrk>=m_trRatio1) ||
381 (ntrt>15 && ntrt<=25 && ratioTrk>=m_trRatio2) ||
382 (ntrt>25 && ratioTrk>=m_trRatio3)) pass = true;
383 }
384
385 // TRT-only track cuts
386 if ( (not isSilicon) && (std::fabs(d0)<=m_maxTrtD0) && (std::fabs(z0)<=m_maxTrtZ0) ) {
387
388 unsigned int eta_bin = getEtaBin(perigee);
389 // TRT-only Tracks: eProbabilityHT cuts below
390 // See InDet Trt Track Scoring Tool for nTRT cut on TRT-only tracks
391 double trRatioTRT = std::max( m_trRatioTRT.value(), m_TRTTrksBinnedRatioTRT[eta_bin] );
392
393 if ( ratioTrk >= trRatioTRT ) pass = true; // TRT Track cuts
394 }
395 } // end of track cuts for isConv
396
397 } else {
398 //The cuts below are necessary for the V0 track selection
399 const AmgSymMatrix(5)& err = *perigee.covariance();
400 double sd0sq = err(0,0);
401 double sd0 = (sd0sq>0.)?std::sqrt(sd0sq):0.;
402 double sz0sq = err(1,1);
403 double sz0 = (sz0sq>0.)?std::sqrt(sz0sq):0.;
404 if(nclus == 0){
405 if(std::fabs(d0)>=m_sD0_Trt*sd0 && std::fabs(d0)<= m_maxTrtD0 && std::fabs(z0)<=m_sZ0_Trt*sz0 && pt>=m_minPt) pass = true;
406 }else{
407 if(std::fabs(d0)>=m_sD0_Si*sd0 && std::fabs(z0)<=m_maxSiZ0 && pt>=m_minPt) pass = true;
408 }
409 ratioTrk = 1.0;
410 float temp(0);
411 if(ntrt > 0 && (!m_PIDonlyForXe || nTrtXenonHits==ntrt) ) // only check TRT PID if m_PIDonlyForXe is false or all TRT hits are Xenon hits
412 ratioTrk = tp.summaryValue(temp,xAOD::eProbabilityHT) ? temp: 0 ;
413 if(ratioTrk>m_trRatioV0) pass = false;
414 }
415
416
417 delete extrapolatedParameters;
418 return pass;
419 }
int getCount(const xAOD::TrackParticle &tp, xAOD::SummaryType type) const
Amg::Vector3D getPosOrBeamSpot(const EventContext &ctx, const xAOD::Vertex *) const
@ numberOfTRTXenonHits
number of TRT hits on track in straws with xenon [unit8_t].
@ numberOfTRTHits
number of TRT hits [unit8_t].
@ eProbabilityHT
Electron probability from High Threshold (HT) information [float].
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfTRTOutliers
number of TRT outliers [unit8_t].

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ getBeamSpot()

Trk::Vertex * InDet::InDetConversionTrackSelectorTool::getBeamSpot ( const EventContext & ctx) const
private

Definition at line 37 of file InDetConversionTrackSelectorTool.cxx.

38 {
40 SG::ReadHandle<xAOD::EventInfo> evt(m_eventInfo_key, ctx);
41 if (evt.isValid()) {
42 InDet::BeamSpotData temp(evt->beamStatus(), evt->beamPosX(), evt->beamPosY(), evt->beamPosZ(),
43 evt->beamPosSigmaX(), evt->beamPosSigmaY(), evt->beamPosSigmaZ(),
44 evt->beamTiltXZ(), evt->beamTiltYZ(), evt->beamPosSigmaXY());
45 return new Trk::RecVertex(temp.beamVtx());
46 } else {
47 ATH_MSG_WARNING( " Cannot get beamSpot center from xAOD::EventInfo. Using (0,0,0)... " );
48 return new Trk::Vertex(Amg::Vector3D(0,0,0));
49 }
50 }else{
51 SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey, ctx };
52 if (beamSpotHandle.isValid()) {
53 return new Trk::RecVertex(beamSpotHandle->beamVtx());
54 } else {
55 ATH_MSG_WARNING( " Cannot get beamSpot center from BeamSpotData. Using (0,0,0)... " );
56 return new Trk::Vertex(Amg::Vector3D(0,0,0));
57 }
58 }
59 }
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo_key
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Eigen::Matrix< double, 3, 1 > Vector3D

◆ getCount()

int InDet::InDetConversionTrackSelectorTool::getCount ( const xAOD::TrackParticle & tp,
xAOD::SummaryType type ) const
inlineprivate

Definition at line 58 of file InDetConversionTrackSelectorTool.h.

59 {
61 if (!tp.summaryValue(val, type))
62 return 0;
63 return val > 0 ? val : 0;
64 }

◆ getEtaBin()

unsigned int InDet::InDetConversionTrackSelectorTool::getEtaBin ( const Trk::Perigee & perigee) const
private

Definition at line 62 of file InDetConversionTrackSelectorTool.cxx.

63 {
64 // Find the correct bin for applying eta-dependent cuts
65
66 double tanThetaOver2 = std::tan( perigee.parameters()[Trk::theta] / 2.);
67 double abs_eta = (tanThetaOver2 == 0) ? 999.0 : std::fabs( std::log(tanThetaOver2) );
68
69 for (unsigned int i=0;i<m_TRTTrksEtaBins.size();++i) {
70 if (abs_eta < m_TRTTrksEtaBins[i]) {
71 return i;
72 }
73 }
74 return m_TRTTrksEtaBins.size()-1;
75 }

◆ getPosOrBeamSpot()

Amg::Vector3D InDet::InDetConversionTrackSelectorTool::getPosOrBeamSpot ( const EventContext & ctx,
const xAOD::Vertex * vertex ) const
private

Definition at line 314 of file InDetConversionTrackSelectorTool.cxx.

317 {
318 if (vertex) {
319 return vertex->position();
320 }
322 SG::ReadHandle<xAOD::EventInfo> evt(m_eventInfo_key, ctx);
323 if (evt.isValid()) {
324 return Amg::Vector3D(evt->beamPosX(), evt->beamPosY(), evt->beamPosZ());
325 }else{
326 return Amg::Vector3D(0, 0, 0);
327 }
328 }
329 SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle{ m_beamSpotKey, ctx };
330 if (beamSpotHandle.isValid()) {
331 return beamSpotHandle->beamVtx().position();
332 } else {
333 return Amg::Vector3D(0, 0, 0);
334 }
335 }

◆ initialize()

StatusCode InDet::InDetConversionTrackSelectorTool::initialize ( )
overridevirtual

Definition at line 28 of file InDetConversionTrackSelectorTool.cxx.

29 {
30 ATH_CHECK( m_extrapolator.retrieve() );
33
34 return StatusCode::SUCCESS;
35 }
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & Trk::ITrackSelectorTool::interfaceID ( )
inlinestaticinherited

Definition at line 38 of file ITrackSelectorTool.h.

39 {
41 }
static const InterfaceID IID_ITrackSelectorTool("Trk::ITrackSelectorTool", 1, 0)

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_beamSpotKey

SG::ReadCondHandleKey<InDet::BeamSpotData> InDet::InDetConversionTrackSelectorTool::m_beamSpotKey
private
Initial value:
{
this,
"BeamSpotKey",
"BeamSpotData",
"SG key for beam spot"
}

Definition at line 76 of file InDetConversionTrackSelectorTool.h.

76 {
77 this,
78 "BeamSpotKey",
79 "BeamSpotData",
80 "SG key for beam spot"
81 };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_eventInfo_key

SG::ReadHandleKey<xAOD::EventInfo> InDet::InDetConversionTrackSelectorTool::m_eventInfo_key {this, "EventInfo", "EventInfo", "Input event information"}
private

Definition at line 82 of file InDetConversionTrackSelectorTool.h.

82{this, "EventInfo", "EventInfo", "Input event information"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extrapolator

ToolHandle<Trk::IExtrapolator> InDet::InDetConversionTrackSelectorTool::m_extrapolator
private
Initial value:
{ this,
"Extrapolator",
"",
"Extrapolator Tool" }

Definition at line 72 of file InDetConversionTrackSelectorTool.h.

72 { this,
73 "Extrapolator",
74 "",
75 "Extrapolator Tool" };

◆ m_isConv

BooleanProperty InDet::InDetConversionTrackSelectorTool::m_isConv {this, "IsConversion", true, "Conversion flag"}
private

Definition at line 120 of file InDetConversionTrackSelectorTool.h.

120{this, "IsConversion", true, "Conversion flag"};

◆ m_maxSiD0

DoubleProperty InDet::InDetConversionTrackSelectorTool::m_maxSiD0 {this, "maxSiD0", 35., "Maximal d0 at (0,0,0) for tracks with Si hits"}
private

Properties for track selection:all cuts are ANDed.

Definition at line 86 of file InDetConversionTrackSelectorTool.h.

87{this, "maxSiD0", 35., "Maximal d0 at (0,0,0) for tracks with Si hits"};

◆ m_maxSiZ0

DoubleProperty InDet::InDetConversionTrackSelectorTool::m_maxSiZ0 {this, "maxSiZ0", 200., "Maximal z0 at (0,0,0)"}
private

Definition at line 90 of file InDetConversionTrackSelectorTool.h.

90{this, "maxSiZ0", 200., "Maximal z0 at (0,0,0)"};

◆ m_maxTrtD0

DoubleProperty InDet::InDetConversionTrackSelectorTool::m_maxTrtD0 {this, "maxTrtD0", 100., "Maximal d0 at (0,0,0) for standalone TRT tracks"}
private

Definition at line 88 of file InDetConversionTrackSelectorTool.h.

89{this, "maxTrtD0", 100., "Maximal d0 at (0,0,0) for standalone TRT tracks"};

◆ m_maxTrtZ0

DoubleProperty InDet::InDetConversionTrackSelectorTool::m_maxTrtZ0 {this, "maxTrtZ0", 1200., "Maximal z0 at (0,0,0) for standalone TRT tracks"}
private

Definition at line 91 of file InDetConversionTrackSelectorTool.h.

92{this, "maxTrtZ0", 1200., "Maximal z0 at (0,0,0) for standalone TRT tracks"};

◆ m_minPt

DoubleProperty InDet::InDetConversionTrackSelectorTool::m_minPt {this, "minPt", 500., "Minimum Pt of tracks"}
private

Definition at line 93 of file InDetConversionTrackSelectorTool.h.

93{this, "minPt", 500., "Minimum Pt of tracks"};

◆ m_PIDonlyForXe

BooleanProperty InDet::InDetConversionTrackSelectorTool::m_PIDonlyForXe {this, "PIDonlyForXe", false, "Only check TRT PID if all hits are Xe hits"}
private

Definition at line 121 of file InDetConversionTrackSelectorTool.h.

122{this, "PIDonlyForXe", false, "Only check TRT PID if all hits are Xe hits"};

◆ m_sD0_Si

DoubleProperty InDet::InDetConversionTrackSelectorTool::m_sD0_Si {this, "significanceD0_Si", 2., "Cut on D0 significance of Si tracks"}
private

Definition at line 113 of file InDetConversionTrackSelectorTool.h.

114{this, "significanceD0_Si", 2., "Cut on D0 significance of Si tracks"};

◆ m_sD0_Trt

DoubleProperty InDet::InDetConversionTrackSelectorTool::m_sD0_Trt {this, "significanceD0_Trt", 0.5, "Cut on D0 significance of TRT tracks"}
private

Definition at line 115 of file InDetConversionTrackSelectorTool.h.

116{this, "significanceD0_Trt", 0.5, "Cut on D0 significance of TRT tracks"};

◆ m_sZ0_Trt

DoubleProperty InDet::InDetConversionTrackSelectorTool::m_sZ0_Trt {this, "significanceZ0_Trt", 3., "Cut on Z0 significance of TRT tracks"}
private

Definition at line 117 of file InDetConversionTrackSelectorTool.h.

118{this, "significanceZ0_Trt", 3., "Cut on Z0 significance of TRT tracks"};

◆ m_trRatio1

DoubleProperty InDet::InDetConversionTrackSelectorTool::m_trRatio1 {this, "RatioCut1", 0.5, "TR ratio for tracks with 15 or less TRT hits"}
private

Definition at line 94 of file InDetConversionTrackSelectorTool.h.

95{this, "RatioCut1", 0.5, "TR ratio for tracks with 15 or less TRT hits"};

◆ m_trRatio2

DoubleProperty InDet::InDetConversionTrackSelectorTool::m_trRatio2 {this, "RatioCut2", 0.1, "TR ratio for tracks with 16 to 25 TRT hits"}
private

Definition at line 96 of file InDetConversionTrackSelectorTool.h.

97{this, "RatioCut2", 0.1, "TR ratio for tracks with 16 to 25 TRT hits"};

◆ m_trRatio3

DoubleProperty InDet::InDetConversionTrackSelectorTool::m_trRatio3 {this, "RatioCut3", 0.05, "TR ratio for tracks with 26 or more TRT hits"}
private

Definition at line 98 of file InDetConversionTrackSelectorTool.h.

99{this, "RatioCut3", 0.05, "TR ratio for tracks with 26 or more TRT hits"};

◆ m_trRatioTRT

DoubleProperty InDet::InDetConversionTrackSelectorTool::m_trRatioTRT {this, "RatioTRT", 0.1, "TR ratio for all TRT only tracks"}
private

Definition at line 100 of file InDetConversionTrackSelectorTool.h.

101{this, "RatioTRT", 0.1, "TR ratio for all TRT only tracks"};

◆ m_trRatioV0

DoubleProperty InDet::InDetConversionTrackSelectorTool::m_trRatioV0 {this, "RatioV0", 1., "TR ratio for pion selection during V0 reconstruction"}
private

Definition at line 111 of file InDetConversionTrackSelectorTool.h.

112{this, "RatioV0", 1., "TR ratio for pion selection during V0 reconstruction"};

◆ m_TRTTrksBinnedRatioTRT

DoubleArrayProperty InDet::InDetConversionTrackSelectorTool::m_TRTTrksBinnedRatioTRT
private
Initial value:
{this, "TRTTrksBinnedRatioTRT", {0., 0., 0., 0., 0., 0., 0., 0., 0., 0.},
"Eta-binned eProbabilityHT for TRT-only track cuts"}

Definition at line 107 of file InDetConversionTrackSelectorTool.h.

108 {this, "TRTTrksBinnedRatioTRT", {0., 0., 0., 0., 0., 0., 0., 0., 0., 0.},
109 "Eta-binned eProbabilityHT for TRT-only track cuts"};

◆ m_TRTTrksEtaBins

DoubleArrayProperty InDet::InDetConversionTrackSelectorTool::m_TRTTrksEtaBins
private
Initial value:
{this, "TRTTrksEtaBins",
{999., 999., 999., 999., 999., 999., 999., 999., 999., 999.},
"Eta bins (10 expected) for TRT-only track cuts"}

Definition at line 103 of file InDetConversionTrackSelectorTool.h.

104 {this, "TRTTrksEtaBins",
105 {999., 999., 999., 999., 999., 999., 999., 999., 999., 999.},
106 "Eta bins (10 expected) for TRT-only track cuts"};

◆ m_useEventInfoBs

Gaudi::Property<bool> InDet::InDetConversionTrackSelectorTool::m_useEventInfoBs {this,"UseEventInfoBS",false}
private

Definition at line 83 of file InDetConversionTrackSelectorTool.h.

83{this,"UseEventInfoBS",false};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


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