ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
TrigMuonEFTrackIsolationTool Class Reference

EF Track Isolation tool. More...

#include <TrigMuonEFTrackIsolationTool.h>

Inheritance diagram for TrigMuonEFTrackIsolationTool:
Collaboration diagram for TrigMuonEFTrackIsolationTool:

Public Member Functions

 TrigMuonEFTrackIsolationTool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor. More...
 
virtual StatusCode initialize () override
 initialize the tool More...
 
virtual StatusCode calcTrackIsolation (const xAOD::Muon *efmuon, const xAOD::TrackParticleContainer *idtrks, const std::vector< double > &conesizes, std::vector< double > &results, std::vector< double > *dzvals, std::vector< double > *drvals, std::vector< double > *selfremoval) const override
 Sum the track pT in cones around the muon. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Retrieve interface ID. More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode checkIsolation (const xAOD::IParticle *muon, double selfpt, const xAOD::TrackParticle *muon_idtrk, const Trk::Perigee *muidtrk_perigee, const xAOD::TrackParticleContainer *trks, std::vector< double > conesizes, std::vector< double > &results, std::vector< double > *dzvals, std::vector< double > *drvals, std::vector< double > *selfremoval) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

bool m_debug
 
double m_deltaz_cut
 cut between z of muon id trk and z of id trks - < 0 means no cut More...
 
bool m_removeSelf
 flag to determine whether to remove pT of muon track from the calculation More...
 
bool m_useAnnulus
 flag to determine if we should use an inner annulus More...
 
double m_annulusSize
 size of the annulus within which we ignore tracks More...
 
bool m_useVarIso
 flag to determine if we want to use offline isolation variables More...
 
ToolHandle< InDet::IInDetTrackSelectionToolm_trkSelTool
 Track selection tool. More...
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

EF Track Isolation tool.

Calculates track isolation around EF muon in varying cone sizes. Has possibility to cut on dz(muon id trk, id trk) to suppress pileup.

Definition at line 22 of file TrigMuonEFTrackIsolationTool.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

◆ TrigMuonEFTrackIsolationTool()

TrigMuonEFTrackIsolationTool::TrigMuonEFTrackIsolationTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Constructor.

Standard constructor.

Definition at line 16 of file TrigMuonEFTrackIsolationTool.cxx.

16  :
18  m_debug(false),
19  m_deltaz_cut(0.0),
20  m_removeSelf(true),
21  m_useAnnulus(false),
22  m_annulusSize(-1.0),
23  m_useVarIso(false),
24  m_trkSelTool( "InDet::InDetTrackSelectionTool/TrackSelectionTool", this )
25 {
26 
27  declareInterface<IMuonEFTrackIsolationTool>(this);
28 
29  declareProperty("deltaZCut", m_deltaz_cut);
30  declareProperty("removeSelf", m_removeSelf);
31  declareProperty("useAnnulus", m_useAnnulus);
32  declareProperty("annulusSize", m_annulusSize);
33  declareProperty("useVarIso", m_useVarIso);
34  declareProperty("TrackSelectionTool",m_trkSelTool);
35 }

Member Function Documentation

◆ calcTrackIsolation()

StatusCode TrigMuonEFTrackIsolationTool::calcTrackIsolation ( const xAOD::Muon efmuon,
const xAOD::TrackParticleContainer idtrks,
const std::vector< double > &  conesizes,
std::vector< double > &  results,
std::vector< double > *  dzvals,
std::vector< double > *  drvals,
std::vector< double > *  selfremoval 
) const
overridevirtual

Sum the track pT in cones around the muon.

Parameters
efmuon- EF muon
idtrks- Container of id trks
conesizes- Vector of conesizes (in dR)
results- Vector where the results for each cone will be stored
dzvals- Vector where dz vals of good tracks will be stored
drvals- Vector where dr vals of good tracks will be stored
selfremoval- Vector storing the selfpt and removed pt

Implements IMuonEFTrackIsolationTool.

Definition at line 49 of file TrigMuonEFTrackIsolationTool.cxx.

49  {
50 
51 
52  if (m_debug)
53  msg() << MSG::DEBUG << "Running isolation over EF Muon!" << endmsg;
54 
55  // clear vectors
56  results.clear();
57  dzvals->clear();
58  drvals->clear();
59  selfremoval->clear();
60 
61  // this will point to the muon (combined or extrapolated)
62  const xAOD::TrackParticle* muon=0;
63 
64  // variable to store pt of the muon (this is different for different muon types so we pass it separately)
65  double selfpt=0.0;
66 
67  //for combined muons use the associated ID track for the self removal
68  const xAOD::TrackParticle* muon_idtrk = 0;
69  const Trk::Perigee* muidtrk_perigee = 0;
70  if( efmuon->combinedTrackParticleLink().isValid() ) {
71  if(m_debug) {
72  msg() << MSG::DEBUG << "EF muon has combined muon" << endmsg;
73  }
74  muon = *(efmuon->combinedTrackParticleLink());
75  if( efmuon->inDetTrackParticleLink().isValid() ) {
76  muon_idtrk = *(efmuon->inDetTrackParticleLink());
77  muidtrk_perigee = &(muon_idtrk->perigeeParameters());
78  selfpt = muon_idtrk->pt();
79  if(m_debug) {
80  msg() << MSG::DEBUG << "Found ID track attached to combined muon, " << muon_idtrk << ",pt = " << selfpt << endmsg;
81  }
82  }
83  else {
84  msg() << MSG::WARNING << "Found EF combined muon without a link to ID track, will use combined pt for self removal" << endmsg;
85  selfpt = muon->pt();
86  }
87  }//combinedmuon
88  else {
89  // for extrapolated muons use the extrapolated muon for self removal
90  if( !efmuon->muonSpectrometerTrackParticleLink().isValid() ) {
91  if(m_removeSelf) {
92  msg() << MSG::WARNING << "This EF muon has neither a combined or extrapolated muon and removeSelf is requested, do not process further" << endmsg;
93  return StatusCode::FAILURE;
94  }//m_removeSelf
95  msg() << MSG::WARNING << "This EF muon has neither a combined, extrapolated or MS muon, do not process further" << endmsg;
96  return StatusCode::FAILURE;
97  }
98  else {
100  selfpt = muon->pt();
101  }//extrapmuon
102  }//not combined
103 
104  StatusCode isoResult = checkIsolation(muon, selfpt, muon_idtrk, muidtrk_perigee, idtrks, conesizes, results, dzvals, drvals, selfremoval);
105 
106  return isoResult;
107 }

◆ checkIsolation()

StatusCode TrigMuonEFTrackIsolationTool::checkIsolation ( const xAOD::IParticle muon,
double  selfpt,
const xAOD::TrackParticle muon_idtrk,
const Trk::Perigee muidtrk_perigee,
const xAOD::TrackParticleContainer trks,
std::vector< double >  conesizes,
std::vector< double > &  results,
std::vector< double > *  dzvals,
std::vector< double > *  drvals,
std::vector< double > *  selfremoval 
) const
private

consistency checks

Definition at line 111 of file TrigMuonEFTrackIsolationTool.cxx.

111  {
112 
114  if(m_removeSelf && selfpt==0.0) {
115  msg() << MSG::WARNING << "Inconsistency, removeSelf requested, but selfpt = 0" << endmsg;
116  }
117  if(!muon) {
118  msg() << MSG::WARNING << "Could not find a muon to update with the isolation, skipping this muon" << endmsg;
119  return StatusCode::FAILURE;
120  }
121 
122  // fill results vector with 0
123  results.insert(results.end(), conesizes.size(), 0.0);
124 
125  // loop over other tracks in the container
126  // these are arrays, so that if using leadTrk or dRMatched selfremoval it can be different between the two cone sizes
127  int ntrks_tmp[2];
128  ntrks_tmp[0]=0; ntrks_tmp[1]=0;
129 
130 
132  trkit!=trks->end(); ++trkit) {
133 
134  if (m_debug)
135 
136  msg() << MSG::DEBUG << "INFO: Track pT = " << (*trkit)->pt() << " eta = " << (*trkit)->eta() << endmsg;
137 
138  // check track passes the selection tool
139  const auto& trkSelResult = m_trkSelTool->accept(*trkit);
140  if(trkSelResult) {
141  ATH_MSG_DEBUG("Track passes selection tool");
142  } else {
143  if(m_debug) {
144  ATH_MSG_DEBUG("Track failed selection tool");
145  for(unsigned int i=0; i<trkSelResult.getNCuts (); ++i) {
146  ATH_MSG_DEBUG(" Cut " << i << trkSelResult.getCutName(i).data() << " pass = " << trkSelResult.getCutResult(i));
147  }
148  }
149  continue; // skip this track
150  }
151 
152  // check dZ if necessary
153  double dz=0;
154  if(m_deltaz_cut > 0.0 && muidtrk_perigee) {
155  const Trk::Perigee& idtrk_perigee = (*trkit)->perigeeParameters();
156  dz = idtrk_perigee.parameters()[Trk::z0] - muidtrk_perigee->parameters()[Trk::z0];
157  if( fabs(dz) > m_deltaz_cut ) {
158  if(m_debug) {
159  msg() << MSG::DEBUG << "Track failed dz cut, ignoring it. dz = " << dz << endmsg;
160  }
161  continue;
162  }//failed delta(z)
163  // store dz (after cut)
164  // if(dzvals) dzvals->push_back(dz); // moved to after the pT cut for plotting purposes
165  if(m_debug) {
166  msg() << MSG::DEBUG << "ID track passes dz cut. dz = " << dz << endmsg;
167  }
168 
169  }//deltaz_cut
170  if(dzvals) dzvals->push_back(dz);
171 
172  // check if trk within cone
173  double dr = 0;
174  if(muon_idtrk) { //use ID track for dR if available
175  dr = (*trkit)->p4().DeltaR( muon_idtrk->p4() );
176  } else { //use the muon
177  dr = (*trkit)->p4().DeltaR( muon->p4() );
178  }
179 
180  if(drvals) drvals->push_back(dr);
181 
182  // if needed check the inner annululs
183  if(m_useAnnulus) {
184  if( dr < m_annulusSize ) {
185  if(m_debug) {
186  msg() << MSG::DEBUG << "ID track within annulus, ignoring it, dR = " << dr << ", annulus = " << m_annulusSize << endmsg;
187 
188  }
189  continue; // skip tracks in the annulus
190  }//annulus cut
191  if(m_debug) {
192  msg() << MSG::DEBUG << "ID track outside annulus, keep it, dR = " << dr << ", annulus = " << m_annulusSize << endmsg;
193  }
194  }//use Annulus
195 
196  // Define new conesizes that depend on useVarIso flag
197  double ptvarcone20 = std::min(0.2,10000/selfpt);
198  double ptvarcone30 = std::min(0.3,10000/selfpt);
199  if (m_useVarIso){
200  conesizes.clear();
201  conesizes.push_back(ptvarcone20);
202  conesizes.push_back(ptvarcone30);
203  }
204 
205  // add trk pT to relevant results vector
206  for(unsigned int conepos=0; conepos<conesizes.size(); ++conepos) {
207  if(dr < conesizes.at(conepos) ) {
208  if(m_debug) {
209  msg() << MSG::DEBUG << "Adding trk pt = " << (*trkit)->pt() << ", with dr = " << dr << ", into cone = " << conesizes.at(conepos) << endmsg;
210  }
211  results.at(conepos) += (*trkit)->pt();
212  ++ntrks_tmp[conepos];
213 
214  }
215  }
216 
217  }// track loop
218 
219  // Muon pT plots
220  selfremoval->push_back(selfpt);
221  selfremoval->push_back(muon->pt());
222 
223  if(m_debug) {
224  for(unsigned int conepos=0; conepos<conesizes.size(); ++conepos) {
225  msg() << MSG::DEBUG << "Scalar pT sum of tracks around this muon cone " << conesizes.at(conepos) << " = " << results.at(conepos) << endmsg;
226  }
227  }
228  if(m_removeSelf && !m_useAnnulus) { // remove muon pt from the sums
229  for(unsigned int conepos=0; conepos<conesizes.size(); ++conepos) {
230  results.at(conepos) -= selfpt;
231  }
232  if(m_debug) {
233  for(unsigned int conepos=0; conepos<conesizes.size(); ++conepos) {
234  msg() << MSG::DEBUG << "Scalar pT sum of tracks around this muon cone " << conesizes.at(conepos) << " after self removal = " << results.at(conepos) << endmsg;
235  }
236  }
237 
238  }//m_removeSelf
239 
240  return StatusCode::SUCCESS;
241 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

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

95 { return m_detStore; }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ 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

◆ initialize()

StatusCode TrigMuonEFTrackIsolationTool::initialize ( )
overridevirtual

initialize the tool

Definition at line 244 of file TrigMuonEFTrackIsolationTool.cxx.

244  {
245 
247 
248  if(m_trkSelTool.retrieve().isFailure()){
249  ATH_MSG_FATAL("Could not retrieve InDetTrackSelectionTool");
250  return StatusCode::FAILURE;
251  }
252 
253  if(m_debug) {
254  msg() << MSG::DEBUG << "Initializing TrigMuonEFTrackIsolationTool[" << name() << "]" << endmsg;
255  msg() << MSG::DEBUG
256  << "Properties set as follows: " << endmsg;
257  msg() << MSG::DEBUG
258  << "removeSelf " << m_removeSelf << endmsg;
259  msg() << MSG::DEBUG
260  << "deltaZCut " << m_deltaz_cut << endmsg;
261  msg() << MSG::DEBUG
262  << "useAnnulus " << m_useAnnulus << endmsg;
263  msg() << MSG::DEBUG
264  << "annulusSize " << m_annulusSize << endmsg;
265  msg() << MSG::DEBUG
266  << "useVarIso " << m_useVarIso << endmsg;
267  msg() << MSG::DEBUG
268  << "TrackSelectionTool " << m_trkSelTool << endmsg;
269 
270  }//debug
271 
272  // check the annulus size is valid
273  if(m_useAnnulus) {
274  if(m_annulusSize < 0.0 || m_annulusSize > 0.2) {
275  msg() << MSG::ERROR << "Bad configuration of annulusSize = " << m_annulusSize << ", fix your config!" << endmsg;
276  return StatusCode::FAILURE;
277  }
278  }//useAnnulus
279 
280  return StatusCode::SUCCESS;
281 }

◆ 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()

static const InterfaceID& IMuonEFTrackIsolationTool::interfaceID ( )
inlinestaticinherited

Retrieve interface ID.

Definition at line 37 of file IMuonEFTrackIsolationTool.h.

37 { return IID_IMuonEFTrackIsolationTool;}

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
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 DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_annulusSize

double TrigMuonEFTrackIsolationTool::m_annulusSize
private

size of the annulus within which we ignore tracks

Definition at line 50 of file TrigMuonEFTrackIsolationTool.h.

◆ m_debug

bool TrigMuonEFTrackIsolationTool::m_debug
private

Definition at line 38 of file TrigMuonEFTrackIsolationTool.h.

◆ m_deltaz_cut

double TrigMuonEFTrackIsolationTool::m_deltaz_cut
private

cut between z of muon id trk and z of id trks - < 0 means no cut

Definition at line 41 of file TrigMuonEFTrackIsolationTool.h.

◆ 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_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_removeSelf

bool TrigMuonEFTrackIsolationTool::m_removeSelf
private

flag to determine whether to remove pT of muon track from the calculation

Definition at line 44 of file TrigMuonEFTrackIsolationTool.h.

◆ m_trkSelTool

ToolHandle<InDet::IInDetTrackSelectionTool> TrigMuonEFTrackIsolationTool::m_trkSelTool
private

Track selection tool.

Definition at line 56 of file TrigMuonEFTrackIsolationTool.h.

◆ m_useAnnulus

bool TrigMuonEFTrackIsolationTool::m_useAnnulus
private

flag to determine if we should use an inner annulus

Definition at line 47 of file TrigMuonEFTrackIsolationTool.h.

◆ m_useVarIso

bool TrigMuonEFTrackIsolationTool::m_useVarIso
private

flag to determine if we want to use offline isolation variables

Definition at line 53 of file TrigMuonEFTrackIsolationTool.h.

◆ 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:
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
xAOD::Iso::ptvarcone30
@ ptvarcone30
Definition: IsolationType.h:56
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
xAOD::Iso::ptvarcone20
@ ptvarcone20
Mini-Isolation http://arxiv.org/abs/1007.2221.
Definition: IsolationType.h:55
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
TrigMuonEFTrackIsolationTool::m_deltaz_cut
double m_deltaz_cut
cut between z of muon id trk and z of id trks - < 0 means no cut
Definition: TrigMuonEFTrackIsolationTool.h:41
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Trk::z0
@ z0
Definition: ParamDefs.h:70
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
TrigMuonEFTrackIsolationTool::m_debug
bool m_debug
Definition: TrigMuonEFTrackIsolationTool.h:38
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
xAOD::TrackParticle_v1::p4
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Definition: TrackParticle_v1.cxx:129
xAOD::TrackParticle_v1::perigeeParameters
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
Definition: TrackParticle_v1.cxx:485
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:92
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
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
TrigMuonEFTrackIsolationTool::m_useVarIso
bool m_useVarIso
flag to determine if we want to use offline isolation variables
Definition: TrigMuonEFTrackIsolationTool.h:53
xAOD::Muon_v1::muonSpectrometerTrackParticleLink
const ElementLink< TrackParticleContainer > & muonSpectrometerTrackParticleLink() const
Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrigMuonEFTrackIsolationTool::m_annulusSize
double m_annulusSize
size of the annulus within which we ignore tracks
Definition: TrigMuonEFTrackIsolationTool.h:50
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
min
#define min(a, b)
Definition: cfImp.cxx:40
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
python.ami.results
def results
Definition: ami.py:386
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
xAOD::Muon_v1::inDetTrackParticleLink
const ElementLink< TrackParticleContainer > & inDetTrackParticleLink() const
Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.
a
TList * a
Definition: liststreamerinfos.cxx:10
h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrigMuonEFTrackIsolationTool::checkIsolation
StatusCode checkIsolation(const xAOD::IParticle *muon, double selfpt, const xAOD::TrackParticle *muon_idtrk, const Trk::Perigee *muidtrk_perigee, const xAOD::TrackParticleContainer *trks, std::vector< double > conesizes, std::vector< double > &results, std::vector< double > *dzvals, std::vector< double > *drvals, std::vector< double > *selfremoval) const
Definition: TrigMuonEFTrackIsolationTool.cxx:111
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
TrigMuonEFTrackIsolationTool::m_removeSelf
bool m_removeSelf
flag to determine whether to remove pT of muon track from the calculation
Definition: TrigMuonEFTrackIsolationTool.h:44
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
TrigMuonEFTrackIsolationTool::m_trkSelTool
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkSelTool
Track selection tool.
Definition: TrigMuonEFTrackIsolationTool.h:56
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
TrigMuonEFTrackIsolationTool::m_useAnnulus
bool m_useAnnulus
flag to determine if we should use an inner annulus
Definition: TrigMuonEFTrackIsolationTool.h:47
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528
xAOD::Muon_v1::combinedTrackParticleLink
const ElementLink< TrackParticleContainer > & combinedTrackParticleLink() const
Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.