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

#include <MuidTrackIsolation.h>

Inheritance diagram for Rec::MuidTrackIsolation:
Collaboration diagram for Rec::MuidTrackIsolation:

Public Member Functions

 MuidTrackIsolation (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~MuidTrackIsolation (void)=default
 
StatusCode initialize () override
 
std::pair< int, double > trackIsolation (const EventContext &ctx, double eta, double phi) const override
 IMuidTrackIsolation interface: get the number of tracks and summed momentum in a cone at the production vertex or around the muon calo intersect. 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 ()
 AlgTool and IAlgTool interface methods. 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

std::pair< int, double > trackVertex (const TrackCollection *indetTracks, double eta, double phi) const
 
std::pair< int, double > trackExtrapolated (const TrackCollection *indetTracks, double eta, double phi) 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

double m_barrelCotTheta {}
 
std::unique_ptr< const Trk::Surfacem_caloBackwardDisc
 
std::unique_ptr< const Trk::Surfacem_caloCylinder
 
std::unique_ptr< const Trk::Surfacem_caloForwardDisc
 
double m_etaSafetyFactor
 
SG::ReadHandleKey< TrackCollectionm_inDetTracksLocation {this, "InDetTracksLocation", "Tracks", "ID tracks"}
 
ToolHandle< Trk::IIntersectorm_intersector {this, "RungeKuttaIntersector", "Trk::RungeKuttaIntersector/RungeKuttaIntersector"}
 
Gaudi::Property< double > m_minPt {this, "MinPt", 1.0 * Gaudi::Units::GeV}
 
Gaudi::Property< double > m_trackCone {this, "TrackCone", 0.2}
 
double m_trackCone2 {0.}
 
Gaudi::Property< bool > m_trackExtrapolation {this, "TrackExtrapolation", false}
 
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

Definition at line 30 of file MuidTrackIsolation.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

◆ MuidTrackIsolation()

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

Definition at line 28 of file MuidTrackIsolation.cxx.

28  :
30  declareInterface<IMuidTrackIsolation>(this);
31  }

◆ ~MuidTrackIsolation()

virtual Rec::MuidTrackIsolation::~MuidTrackIsolation ( void  )
virtualdefault

Member Function Documentation

◆ 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 MuidTrackIsolation::initialize ( )
override

Definition at line 35 of file MuidTrackIsolation.cxx.

35  {
36  ATH_MSG_INFO("MuidTrackIsolation::initialize()");
37 
38  // get the Tools
39  ATH_CHECK(m_intersector.retrieve());
41  // create the calo barrel surfaces (cylinder) and 2 endcap discs)
42  double radius = 2.0 * Gaudi::Units::meter;
43  double halfLength = 4.0 * Gaudi::Units::meter;
45  transform.setIdentity();
46  m_caloCylinder = std::make_unique<Trk::CylinderSurface>(transform, radius, halfLength);
47 
48  // the corresponding max barrel cotTheta
49  m_barrelCotTheta = halfLength / radius;
50 
51  // and the forward/backward endcap disks
52  Amg::Transform3D discRotation;
53  discRotation.setIdentity();
54  Amg::Vector3D forwardDiscPosition(0., 0., halfLength);
55  auto transform1 = std::make_unique<Amg::Transform3D>(discRotation * forwardDiscPosition);
56  m_caloForwardDisc = std::make_unique<Trk::DiscSurface>(*transform1, 0., radius);
57  Amg::Vector3D backwardDiscPosition(0., 0., -halfLength);
58  auto transform2 = std::make_unique<Amg::Transform3D>(discRotation * backwardDiscPosition);
59  m_caloBackwardDisc = std::make_unique<Trk::DiscSurface>(*transform2, 0., radius);
60 
61  ATH_CHECK(m_inDetTracksLocation.initialize());
62 
63  return StatusCode::SUCCESS;
64  }

◆ 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& Rec::IMuidTrackIsolation::interfaceID ( )
inlinestaticinherited

AlgTool and IAlgTool interface methods.

Interface ID for IMuidTrackIsolation

Definition at line 34 of file IMuidTrackIsolation.h.

34  {
35  static const InterfaceID IID_IMuidTrackIsolation("IMuidTrackIsolation", 1, 0);
36  return IID_IMuidTrackIsolation;
37  }

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

◆ trackExtrapolated()

std::pair< int, double > MuidTrackIsolation::trackExtrapolated ( const TrackCollection indetTracks,
double  eta,
double  phi 
) const
private

Use identiy of cot (x) = tan( pi/2 - x)

Definition at line 135 of file MuidTrackIsolation.cxx.

135  {
136  // set initial state
137  double sumP = 0.;
138  int numberTracks = 0;
139 
140  // extrapolate close in eta tracks to calorimeter surface
141  for (const Trk::Track* id : *inDetTracks) {
142  const Trk::Perigee& perigee = *id->perigeeParameters();
143  if (id->info().trackProperties(Trk::TrackInfo::StraightTrack) || perigee.pT() < m_minPt) continue;
144 
145  double inDetEta = perigee.eta();
146  if (std::abs(eta - inDetEta) > m_trackCone + m_etaSafetyFactor) continue;
147 
148  // track has sufficient momentum and is close in eta:
149  // find intersection at calo surface
150  double qOverP = perigee.parameters()[Trk::qOverP];
152  double cotTheta = std::tan(M_PI_2 - perigee.parameters()[Trk::theta]);
153  Amg::Vector3D direction(std::cos(perigee.parameters()[Trk::phi]), std::sin(perigee.parameters()[Trk::phi]), cotTheta);
154  direction /= direction.mag();
155 
156  const Trk::TrackSurfaceIntersection idIntersection(perigee.position(), direction, 0.);
157  const Trk::Surface* surface = m_caloCylinder.get();
158  if (cotTheta > m_barrelCotTheta) {
159  surface = m_caloForwardDisc.get();
160  } else if (cotTheta < -m_barrelCotTheta) {
161  surface = m_caloBackwardDisc.get();
162  }
163  std::optional<Trk::TrackSurfaceIntersection> caloIntersection(
164  m_intersector->intersectSurface(*surface, idIntersection, qOverP));
165 
166  // no intersection - should never happen !
167  if (!caloIntersection) {
168  ATH_MSG_DEBUG(" track didn't find intersection !!! "
169  << std::setiosflags(std::ios::fixed) << " Id track: momentum " << std::setw(8) << std::setprecision(1)
170  << perigee.momentum().mag() / Gaudi::Units::GeV << " with initial eta " << std::setw(8)
171  << std::setprecision(3) << perigee.eta() << " and phi " << std::setw(8) << std::setprecision(3)
172  << perigee.parameters()[Trk::phi]);
173 
174  continue;
175  }
176 
177  double diffEta = eta - caloIntersection->position().eta();
178  double diffPhi = xAOD::P4Helpers::deltaPhi(phi, caloIntersection->position().phi());
179  ATH_MSG_VERBOSE(std::endl
180  << std::setiosflags(std::ios::fixed) << " Id track: momentum " << std::setw(8) << std::setprecision(1)
181  << perigee.momentum().mag() / Gaudi::Units::GeV << " with initial,extrapolated and calo difference for eta "
182  << std::setw(8) << std::setprecision(3) << perigee.eta() << std::setw(8) << std::setprecision(3)
183  << caloIntersection->position().eta() << std::setw(8) << std::setprecision(3) << diffEta << " and phi "
184  << std::setw(8) << std::setprecision(3) << perigee.parameters()[Trk::phi] << std::setw(8)
185  << std::setprecision(3) << caloIntersection->position().phi() << std::setw(8) << std::setprecision(3)
186  << diffPhi);
187 
188  // check if inside cone
189  if ((diffPhi * diffPhi + diffEta * diffEta) < m_trackCone2) {
190  ++numberTracks;
191  const double p = perigee.momentum().mag();
192  sumP += p;
193 
194  ATH_MSG_VERBOSE(" inside cone, track#" << std::setw(3) << numberTracks);
195  }
196  }
197 
198  return std::make_pair(numberTracks, sumP);
199  }

◆ trackIsolation()

std::pair< int, double > MuidTrackIsolation::trackIsolation ( const EventContext &  ctx,
double  eta,
double  phi 
) const
overridevirtual

IMuidTrackIsolation interface: get the number of tracks and summed momentum in a cone at the production vertex or around the muon calo intersect.

Implements Rec::IMuidTrackIsolation.

Definition at line 65 of file MuidTrackIsolation.cxx.

65  {
66  // debug input quantities
67  ATH_MSG_DEBUG(" MuidTrackIsolation:: " << std::setiosflags(std::ios::fixed)
68  << (m_trackExtrapolation ? "applied after extrapolation to calo, " : "applied at perigee, ")
69  << " for muon at calo with eta,phi " << std::setw(8) << std::setprecision(3) << eta
70  << std::setw(8) << std::setprecision(3) << phi);
71 
72  // set initial state
73  std::pair<int, double> isolation{0, 0.};
74 
75  // retrieve track collection
77  if (!inDetTracks.isPresent()) {
78  ATH_MSG_DEBUG(" no ID Track container at location " << m_inDetTracksLocation.key());
79  return isolation;
80  }
81 
82  if (!inDetTracks.isValid()) {
83  ATH_MSG_WARNING(" ID Track container " << m_inDetTracksLocation.key() << " not valid!");
84  return isolation;
85  }
86 
87  // evaluate isolation according to configuration
89  isolation = trackExtrapolated(inDetTracks.cptr(), eta, phi);
90  } else {
91  isolation = trackVertex(inDetTracks.cptr(), eta, phi);
92  }
93 
94  // debug result
95  ATH_MSG_DEBUG("Found " << isolation.first << std::setiosflags(std::ios::fixed) << " InDet tracks with total momentum "
96  << std::setw(8) << std::setprecision(1) << isolation.second / Gaudi::Units::GeV << " GeV");
97 
98  return isolation;
99  }

◆ trackVertex()

std::pair< int, double > MuidTrackIsolation::trackVertex ( const TrackCollection indetTracks,
double  eta,
double  phi 
) const
private

Definition at line 101 of file MuidTrackIsolation.cxx.

101  {
102  // set initial state
103  double sumP = 0.;
104  int numberTracks = 0;
105 
106  // choose tracks in cone
107  for (const Trk::Track* id : *inDetTracks) {
108  const Trk::Perigee& perigee = *id->perigeeParameters();
109  if (id->info().trackProperties(Trk::TrackInfo::StraightTrack) || perigee.pT() < m_minPt) continue;
110 
111  double inDetPhi = perigee.parameters()[Trk::phi];
112  double inDetEta = perigee.eta();
113 
114  double diffEta = std::abs(eta - inDetEta);
115  double diffPhi = xAOD::P4Helpers::deltaPhi(phi, inDetPhi);
116 
117  ATH_MSG_DEBUG(std::endl
118  << std::setiosflags(std::ios::fixed) << " Id track: momentum " << std::setw(8) << std::setprecision(1)
119  << perigee.momentum().mag() / Gaudi::Units::GeV << " with perigee eta and difference " << std::setw(8)
120  << std::setprecision(3) << perigee.eta() << std::setw(8) << std::setprecision(3) << diffEta
121  << " and same for phi " << std::setw(8) << std::setprecision(3) << perigee.parameters()[Trk::phi] << std::setw(8)
122  << std::setprecision(3) << diffPhi);
123 
124  if ((diffPhi * diffPhi + diffEta * diffEta) > m_trackCone2) continue;
125  ++numberTracks;
126  const double p = perigee.momentum().mag();
127  sumP += p;
128 
129  ATH_MSG_VERBOSE("inside cone, track#" << std::setw(3) << numberTracks);
130  }
131 
132  return std::make_pair(numberTracks, sumP);
133  }

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

double Rec::MuidTrackIsolation::m_barrelCotTheta {}
private

Definition at line 49 of file MuidTrackIsolation.h.

◆ m_caloBackwardDisc

std::unique_ptr<const Trk::Surface> Rec::MuidTrackIsolation::m_caloBackwardDisc
private

Definition at line 50 of file MuidTrackIsolation.h.

◆ m_caloCylinder

std::unique_ptr<const Trk::Surface> Rec::MuidTrackIsolation::m_caloCylinder
private

Definition at line 51 of file MuidTrackIsolation.h.

◆ m_caloForwardDisc

std::unique_ptr<const Trk::Surface> Rec::MuidTrackIsolation::m_caloForwardDisc
private

Definition at line 52 of file MuidTrackIsolation.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_etaSafetyFactor

double Rec::MuidTrackIsolation::m_etaSafetyFactor
private

Definition at line 53 of file MuidTrackIsolation.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_inDetTracksLocation

SG::ReadHandleKey<TrackCollection> Rec::MuidTrackIsolation::m_inDetTracksLocation {this, "InDetTracksLocation", "Tracks", "ID tracks"}
private

Definition at line 54 of file MuidTrackIsolation.h.

◆ m_intersector

ToolHandle<Trk::IIntersector> Rec::MuidTrackIsolation::m_intersector {this, "RungeKuttaIntersector", "Trk::RungeKuttaIntersector/RungeKuttaIntersector"}
private

Definition at line 56 of file MuidTrackIsolation.h.

◆ m_minPt

Gaudi::Property<double> Rec::MuidTrackIsolation::m_minPt {this, "MinPt", 1.0 * Gaudi::Units::GeV}
private

Definition at line 57 of file MuidTrackIsolation.h.

◆ m_trackCone

Gaudi::Property<double> Rec::MuidTrackIsolation::m_trackCone {this, "TrackCone", 0.2}
private

Definition at line 58 of file MuidTrackIsolation.h.

◆ m_trackCone2

double Rec::MuidTrackIsolation::m_trackCone2 {0.}
private

Definition at line 59 of file MuidTrackIsolation.h.

◆ m_trackExtrapolation

Gaudi::Property<bool> Rec::MuidTrackIsolation::m_trackExtrapolation {this, "TrackExtrapolation", false}
private

Definition at line 60 of file MuidTrackIsolation.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:
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Rec::MuidTrackIsolation::m_minPt
Gaudi::Property< double > m_minPt
Definition: MuidTrackIsolation.h:57
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::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
Rec::MuidTrackIsolation::m_caloForwardDisc
std::unique_ptr< const Trk::Surface > m_caloForwardDisc
Definition: MuidTrackIsolation.h:52
xAOD::P4Helpers::deltaPhi
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
Definition: xAODP4Helpers.h:69
Rec::MuidTrackIsolation::m_etaSafetyFactor
double m_etaSafetyFactor
Definition: MuidTrackIsolation.h:53
Trk::TrackSurfaceIntersection
Definition: TrackSurfaceIntersection.h:32
Rec::MuidTrackIsolation::trackExtrapolated
std::pair< int, double > trackExtrapolated(const TrackCollection *indetTracks, double eta, double phi) const
Definition: MuidTrackIsolation.cxx:135
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
InDetAccessor::qOverP
@ qOverP
perigee
Definition: InDetAccessor.h:35
Rec::MuidTrackIsolation::m_trackExtrapolation
Gaudi::Property< bool > m_trackExtrapolation
Definition: MuidTrackIsolation.h:60
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Trk::TrackInfo::StraightTrack
@ StraightTrack
A straight track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:84
AthCommonDataStore
Definition: AthCommonDataStore.h:52
python.SystemOfUnits.meter
int meter
Definition: SystemOfUnits.py:61
Rec::MuidTrackIsolation::trackVertex
std::pair< int, double > trackVertex(const TrackCollection *indetTracks, double eta, double phi) const
Definition: MuidTrackIsolation.cxx:101
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trk::theta
@ theta
Definition: ParamDefs.h:72
Rec::MuidTrackIsolation::m_trackCone2
double m_trackCone2
Definition: MuidTrackIsolation.h:59
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Rec::MuidTrackIsolation::m_trackCone
Gaudi::Property< double > m_trackCone
Definition: MuidTrackIsolation.h:58
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
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:
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
Rec::MuidTrackIsolation::m_intersector
ToolHandle< Trk::IIntersector > m_intersector
Definition: MuidTrackIsolation.h:56
generateBunchGroupSetFromOldKey.transform2
def transform2(oldbgs, bgsname, bgnames)
Definition: generateBunchGroupSetFromOldKey.py:37
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:191
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Rec::MuidTrackIsolation::m_caloCylinder
std::unique_ptr< const Trk::Surface > m_caloCylinder
Definition: MuidTrackIsolation.h:51
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Rec::MuidTrackIsolation::m_caloBackwardDisc
std::unique_ptr< const Trk::Surface > m_caloBackwardDisc
Definition: MuidTrackIsolation.h:50
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:73
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
TRT::Track::cotTheta
@ cotTheta
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:65
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
Trk::phi
@ phi
Definition: ParamDefs.h:81
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
Rec::MuidTrackIsolation::m_inDetTracksLocation
SG::ReadHandleKey< TrackCollection > m_inDetTracksLocation
Definition: MuidTrackIsolation.h:54
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Rec::MuidTrackIsolation::m_barrelCotTheta
double m_barrelCotTheta
Definition: MuidTrackIsolation.h:49
fitman.k
k
Definition: fitman.py:528