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

Augment secondary vertices with muon-information-based mass. More...

#include <BPhysAddMuonBasedInvMass.h>

Inheritance diagram for DerivationFramework::BPhysAddMuonBasedInvMass:
Collaboration diagram for DerivationFramework::BPhysAddMuonBasedInvMass:

Public Member Functions

 BPhysAddMuonBasedInvMass (const std::string &t, const std::string &n, const IInterface *p)
 Main contructor. More...
 
virtual StatusCode initialize ()
 Initialize augmentation tool. More...
 
virtual StatusCode finalize ()
 Finalize augmentation tool. More...
 
virtual StatusCode addBranches () const
 Main method called for each event. 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 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...
 
Internal protected methods

Calculate muon-information based mass values if available.

Parameters
[in]vtxsecondary vertex
[in]trkMassesordered vector of track mass values
[in]nMuRequestednumber of muons requested
Returns
muon-information based invariant mass for secondary vertex and the corresponding uncertainty
std::pair< double, double > getMuCalcMass (xAOD::BPhysHelper &vtx, const std::vector< double > &trkMasses, int nMuRequested, BasedInvCache &cache) const
 
std::pair< TrackBag, int > getTracksWithMuons (xAOD::BPhysHelper &vtx, BasedInvCache &) const
 Obtain a set of tracks with muon track information if available. More...
 
std::pair< double, double > getInvariantMassWithError (TrackBag trksIn, const std::vector< double > &massHypotheses, const Amg::Vector3D &pos, BasedInvCache &) const
 Calculate invariant mass and uncertainty from a set of tracks. More...
 
double getMinChi2ToAnyPV (xAOD::BPhysHelper &vtx, const xAOD::VertexContainer *pvContainer, const std::vector< int > &pvtypes, const int minNTracksInPV, const int mode, const xAOD::BPhysHelper::pv_type &pvAssocType, BasedInvCache &cache) const
 Determine minimum log chi2 of signal muon tracks w.r.t. More...
 
double getTrackPVChi2 (const xAOD::TrackParticle &track, const Amg::Vector3D &pos, BasedInvCache &cache) const
 Calculate log chi2 value of a track w.r.t. More...
 
MuonBag findAllMuonsInDecay (xAOD::BPhysHelper &vtx) const
 Find all muons associated to secondary vertex. More...
 
TrackBag getIdTracksForMuons (MuonBag &muons) const
 Obtain a set of ID tracks for a set of muons. More...
 
const xAOD::TrackParticleadjustTrackParticle (const xAOD::Muon *muon, BasedInvCache &cache) const
 Extract TrackParticle for Muon and adjust kinematics. More...
 
void initPvAssocTypeVec ()
 Initialize PV-to-SV association type vector. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

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

std::vector< xAOD::BPhysHelper::pv_typem_pvAssocTypes
 
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
 
job options
std::string m_branchPrefix
 
std::string m_vertexContainerName
 
std::vector< double > m_trkMasses
 
ToolHandle< Reco::ITrackToVertexm_trackToVertexTool
 
bool m_adjustToMuonKinematics
 
int m_addMinChi2ToAnyPVMode
 
std::string m_pvContainerName
 
int m_minNTracksInPV
 
std::vector< int > m_pvTypesToConsider
 
int m_doVertexType
 

Detailed Description

Augment secondary vertices with muon-information-based mass.

Author
Wolfgang Walkowiak wolfg.nosp@m.ang..nosp@m.walko.nosp@m.wiak.nosp@m.@cern.nosp@m..ch

Add muon-information based invarient mass to secondary vertices using a four vector sum. Optionally, it also calculates the minimum chi2 for all muon tracks of the secondary vertex candidate w.r.t. any primary vertex matching the selection criteria.

Job options provided by this class:

Name
Description
BranchPrefix assign the prefix of added branches (possibly the derivation format's name)
VertexContainerName name of container for vertices
TrkMasses ordered list of track masses (Important to keep proper order: J/psi muons go first!)
TrackToVertexTool
ToolHandle for track-to-vertex tool
AdjustToMuonKinematics Adjust the primary track particle's kinematics to the one of the muon.
AddMinChi2ToAnyPVMode mode of minLogChi2ToAnyPV calculation: (default: 0)
Value Explanation
0 no such calculation
1 use all PVs of requested type(s)
2 exclude PVs associated to SVs
3 replace PVs associated to SVs by corresponding refitted PVs
PrimaryVertexContainerName name of container for primary vertices
MinNTracksInPV minimum number of tracks in PV for PV to be considered in calculation of minChi2MuToAnyPV variable.
PVTypesToConsider list of primary vertex types to consider (default: {1, 3})
DoVertexType PV-to-SV association types to be considered (bitwise variable, see xAODBPhys::BPhysHelper)
Note: only needed for AddMinChi2ToAnyPVMode > 1
Note

For a usage example see BPHY8.py .

Definition at line 105 of file BPhysAddMuonBasedInvMass.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

◆ BPhysAddMuonBasedInvMass()

DerivationFramework::BPhysAddMuonBasedInvMass::BPhysAddMuonBasedInvMass ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Main contructor.

Definition at line 44 of file BPhysAddMuonBasedInvMass.cxx.

47  : AthAlgTool(t,n,p), m_trackToVertexTool("Reco::TrackToVertex") {
48 
49  declareInterface<DerivationFramework::IAugmentationTool>(this);
50 
51  // Declare branch prefix
52  declareProperty("BranchPrefix", m_branchPrefix = "_NONE_");
53  // Necessary containers
54  declareProperty("VertexContainerName" , m_vertexContainerName = "");
55  // track mass assignment
56  declareProperty("TrkMasses", m_trkMasses = std::vector<double>());
57  // track-to-vertex tool
58  declareProperty("TrackToVertexTool" , m_trackToVertexTool);
59  // adjust track from muon kinematics?
60  declareProperty("AdjustToMuonKinematics", m_adjustToMuonKinematics = false);
61  // add minChi2ToAnyPV decoration
62  declareProperty("AddMinChi2ToAnyPVMode" , m_addMinChi2ToAnyPVMode = 0);
63  // name of container for primary vertices
64  declareProperty("PrimaryVertexContainerName", m_pvContainerName = "");
65  // minimum number of tracks in PV for PV to be considered in calculation
66  // of minChi2MuToAnyPV variable
67  declareProperty("MinNTracksInPV" , m_minNTracksInPV = 0);
68  // list of primary vertex types to consider
69  declareProperty("PVTypesToConsider" , m_pvTypesToConsider = {1,3});
70  // PV-to-SV association types to be considered
71  declareProperty("DoVertexType" , m_doVertexType = 63);
72  }

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::BPhysAddMuonBasedInvMass::addBranches ( ) const
virtual

Main method called for each event.

Implements DerivationFramework::IAugmentationTool.

Definition at line 123 of file BPhysAddMuonBasedInvMass.cxx.

123  {
124 
125  ATH_MSG_DEBUG("BPhysAddMuonBasedInvMass::addBranches() -- begin");
126  BasedInvCache cache;
127  // vertex container and its auxilliary store
128  xAOD::VertexContainer* vtxContainer = NULL;
129  xAOD::VertexAuxContainer* vtxAuxContainer = NULL;
130 
131  // retrieve from StoreGate
132  CHECK(evtStore()->retrieve(vtxContainer , m_vertexContainerName));
133  CHECK(evtStore()->retrieve(vtxAuxContainer, m_vertexContainerName+"Aux."));
134 
135  const xAOD::VertexContainer* pvContainer = NULL;
136  if ( m_addMinChi2ToAnyPVMode > 0 ) {
137  CHECK(evtStore()->retrieve(pvContainer , m_pvContainerName));
138  }
139 
140  // apply the decorations
141  std::string branchPrefix("");
142  if ( m_branchPrefix != "" && m_branchPrefix != "_NONE_" ) {
143  branchPrefix = m_branchPrefix + "_";
144  }
145 
146  // loop over secondary vertices
147  for (xAOD::VertexContainer::iterator vtxItr = vtxContainer->begin();
148  vtxItr!=vtxContainer->end(); ++vtxItr) {
149 
150  xAOD::BPhysHelper vtx(*vtxItr);
151 
153  d_mucalc_mass(branchPrefix+"MUCALC_mass");
155  d_mucalc_massErr(branchPrefix+"MUCALC_massErr");
156 
157  // TODO: check number of muons requested!
158  std::pair<double,double> MuCalcCandMass =
159  getMuCalcMass(vtx, m_trkMasses, 2, cache);
160 
161  // fill default values
162  d_mucalc_mass(**vtxItr) = MuCalcCandMass.first;
163  d_mucalc_massErr(**vtxItr) = MuCalcCandMass.second;
164 
165  // add MinChi2ToAnyPV information if requested
166  if ( m_addMinChi2ToAnyPVMode > 0 ) {
167 
168  if (m_addMinChi2ToAnyPVMode == 1) {
169  // w.r.t. to all PVs
171  d_minChi2ToAnyPV(branchPrefix+"minLogChi2ToAnyPV");
172  // fill it
173  d_minChi2ToAnyPV(**vtxItr) =
174  getMinChi2ToAnyPV(vtx, pvContainer, m_pvTypesToConsider,
176  xAOD::BPhysHelper::PV_MIN_A0, cache); // dummy
177  } else if (m_addMinChi2ToAnyPVMode > 1 && m_addMinChi2ToAnyPVMode < 4) {
178  // skip or replace associated PVs
179  for (auto pvAssocType : m_pvAssocTypes) {
181  d_minChi2ToAnyPV(branchPrefix+"minLogChi2ToAnyPV_"
182  +xAOD::BPhysHelper::pv_type_str[pvAssocType]);
183  // fill it
184  d_minChi2ToAnyPV(**vtxItr) =
185  getMinChi2ToAnyPV(vtx, pvContainer, m_pvTypesToConsider,
187  pvAssocType, cache);
188 
189  } // for pvAssocType
190  } else {
191  ATH_MSG_WARNING("BPhysAddMuonBasedInvMass::addBranches():"
192  << " Undefined AddMinChi2ToAnyPVMode value: "
194  }
195  } // if m_addMinChi2ToAnyPVMode
196  } // end of loop over vertices
197 
198 
199  ATH_MSG_DEBUG("BPhysAddMuonBasedInvMass::addBranches() -- end");
200 
201  // nothing to do here
202  return StatusCode::SUCCESS;
203  }

◆ adjustTrackParticle()

const xAOD::TrackParticle * DerivationFramework::BPhysAddMuonBasedInvMass::adjustTrackParticle ( const xAOD::Muon muon,
BasedInvCache cache 
) const
protected

Extract TrackParticle for Muon and adjust kinematics.

Extract primary track particle from muon; if configured adjust pt, eta and phi of it before returning a pointer to it.

Parameters
[in]muonpointer to muon
Returns
TrackParticle pointer

Definition at line 316 of file BPhysAddMuonBasedInvMass.cxx.

317  {
318 
319  const xAOD::TrackParticle* tp = NULL;
320  const xAOD::TrackParticle* org = muon->primaryTrackParticle();
321 
322  if ( m_adjustToMuonKinematics ) {
323  if ( org != NULL ) {
324  auto it = cache.adjTpCache.find(org);
325  if ( it != cache.adjTpCache.end() ) {
326  // copy cached link
327  tp = it->second;
328  ATH_MSG_DEBUG("adjustTrackParticle(): from cache: tp = " << tp);
329  } else {
330  // copy object -- this does not work because of seg fault later
331  // xAOD::TrackParticle* newTp = new xAOD::TrackParticle(*org);
332 
333  // create new object and copy properties
335  newTp->makePrivateStore(*org);
336 
337  // ajdust pt, eta and phi to the muon's properties
338  xAOD::IParticle::FourMom_t p4 = muon->p4();
339  float qoverp = p4.P() > 0. ? 1./p4.P() : 10.e6;
340  if ( org->qOverP() < 0. ) qoverp *= -1.;
341  newTp->setDefiningParameters(org->d0(), org->z0(),
342  p4.Phi(), p4.Theta(), qoverp);
343  // cache new TrackParticle
344  cache.adjTpCache[org] = newTp;
345  tp = newTp;
346  ATH_MSG_DEBUG("adjustTrackParticle(): new tp = " << tp
347  << " org = " << org);
348  } // if it != end()
349  } // if != NULL
350  } else {
351  // copy pointer
352  tp = org;
353  ATH_MSG_DEBUG("adjustTrackParticle(): copy: org: " << org
354  << " -> tp: " << tp);
355  }
356 
357  // debug output
358  if ( org != NULL ) {
359  ATH_MSG_DEBUG("adjustTrackParticle(): org: " << org << " ("
360  << org->d0() << "," << org->z0() << "," << org->phi0()
361  << "," << org->theta() << "," << org->qOverP() << ") pt: "
362  << org->pt());
363  } else {
364  ATH_MSG_DEBUG("adjustTrackParticle(): org = NULL");
365  }
366  if ( org != NULL ) {
367  ATH_MSG_DEBUG("adjustTrackParticle(): tp : " << tp << " ("
368  << tp->d0() << "," << tp->z0() << "," << tp->phi0()
369  << "," << tp->theta() << "," << tp->qOverP() << ") pt: "
370  << tp->pt());
371  } else {
372  ATH_MSG_DEBUG("adjustTrackParticle(): tp = NULL");
373  }
374  return tp;
375  }

◆ 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

◆ finalize()

StatusCode DerivationFramework::BPhysAddMuonBasedInvMass::finalize ( )
virtual

Finalize augmentation tool.

Definition at line 115 of file BPhysAddMuonBasedInvMass.cxx.

115  {
116 
117  ATH_MSG_DEBUG("BPhysAddMuonBasedInvMass::finalize()");
118 
119  // everything all right
120  return StatusCode::SUCCESS;
121  }

◆ findAllMuonsInDecay()

MuonBag DerivationFramework::BPhysAddMuonBasedInvMass::findAllMuonsInDecay ( xAOD::BPhysHelper vtx) const
protected

Find all muons associated to secondary vertex.

Returns a vector of xAOD::Muon objects found in this vertex and subsequent decay vertices. Recursively calls itself if necessary.

Parameters
[in]vtxsecondary vertex
Returns
container of muons found

Definition at line 382 of file BPhysAddMuonBasedInvMass.cxx.

383  {
384 
385  MuonBag muons = vtx.muons();
386 
387  // loop over preceeding vertices
388  for (int ivtx = 0; ivtx < vtx.nPrecedingVertices(); ++ivtx) {
389  xAOD::BPhysHelper precVtx(vtx.precedingVertex(ivtx));
390  MuonBag muonsForVtx = findAllMuonsInDecay(precVtx);
391  muons.insert(muons.end(), muonsForVtx.begin(), muonsForVtx.end());
392  }
393  return muons;
394  }

◆ getIdTracksForMuons()

TrackBag DerivationFramework::BPhysAddMuonBasedInvMass::getIdTracksForMuons ( MuonBag muons) const
protected

Obtain a set of ID tracks for a set of muons.

Parameters
[in]muonscontainer of muon objects
Returns
container of associated ID tracks

Definition at line 239 of file BPhysAddMuonBasedInvMass.cxx.

239  {
240 
241  TrackBag muTracks;
242 
243  for (auto &muon : muons) {
244  if ( muon != nullptr ) {
245  const xAOD::TrackParticle* trk =
246  muon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
247  if ( trk != nullptr ) {
248  muTracks.push_back(trk);
249  } else {
250  ATH_MSG_WARNING("BPhysAddMuonBasedInvMass::getIdTracksForMuon:"
251  << " no ID track for muon found.");
252  }
253  } else {
254  ATH_MSG_WARNING("BPhysAddMuonBasedInvMass::getIdTracksForMuon:"
255  << " muon pointer is NULL!");
256  }
257  } // for muon
258  return muTracks;
259  }

◆ getInvariantMassWithError()

std::pair< double, double > DerivationFramework::BPhysAddMuonBasedInvMass::getInvariantMassWithError ( TrackBag  trksIn,
const std::vector< double > &  massHypotheses,
const Amg::Vector3D pos,
BasedInvCache cache 
) const
protected

Calculate invariant mass and uncertainty from a set of tracks.

Returns invariant mass and mass error given a set of tracks, their mass hypotheses and a reference position. Each track must have a separate mass hypothesis in the vector, and they must be in the same order as the tracks in the track vector. Otherwise it will go horribly wrong.

Parameters
[in]trksIncontainer with tracks to be considered
[in]massHypoThesesvector of mass hypotheses in the same order as the tracks
[in]posposition of the vertex
Returns
invariant mass value and uncertainty

Definition at line 518 of file BPhysAddMuonBasedInvMass.cxx.

522  {
523 
524  std::pair<double, double> mass(0.,0.);
525 
526  // ensure there is a mass hypothesis for each track
527  if ( trksIn.size() == massHypotheses.size() ) {
530  auto massHypItr = massHypotheses.cbegin();
531 
532  double pxTmp,pyTmp,pzTmp,massTmp,eTmp;
533 
534  std::vector<TLorentzVector> trkMom;
535  TLorentzVector totMom;
536  std::vector<const Trk::Perigee*> trkPer;
537  const auto &ctx = cache.ctx;
538  for (;trItr != trItrEnd; ++trItr,++massHypItr){
539  auto trkPerigee =
540  m_trackToVertexTool->perigeeAtVertex(ctx, *(*trItr), pos);
541 
542  if ( trkPerigee != NULL ) {
543  // try to get the correct momentum measurement
544  pxTmp = trkPerigee->momentum()[Trk::px];
545  pyTmp = trkPerigee->momentum()[Trk::py];
546  pzTmp = trkPerigee->momentum()[Trk::pz];
547  ATH_MSG_DEBUG("getInvariantMassWithError(): pvec = ("
548  << pxTmp << "," << pyTmp << "," << pzTmp << ")");
549  } else {
550  // otherwise default to this one
551  pxTmp = ((*trItr)->p4()).Px();
552  pyTmp = ((*trItr)->p4()).Py();
553  pzTmp = ((*trItr)->p4()).Pz();
554  ATH_MSG_WARNING("BPhysAddMuonBasedInvMass::getInvariantMassError: "
555  "defaulting to simple momentum!");
556  }
557  trkPer.push_back(trkPerigee.release());
558  massTmp = *massHypItr;
559  eTmp = pxTmp*pxTmp+pyTmp*pyTmp+pzTmp*pzTmp+massTmp*massTmp;
560  eTmp = eTmp > 0. ? sqrt(eTmp) : 0.;
561  TLorentzVector tmpMom(pxTmp, pyTmp, pzTmp, eTmp);
562  trkMom.push_back(tmpMom);
563  totMom += tmpMom;
564  }
565  mass.first = totMom.M();
566  double mErr2 = 0.;
567  // reset trItr
568  trItr = trksIn.begin();
569  std::vector<TLorentzVector>::iterator tmItr = trkMom.begin();
570  std::vector<const Trk::Perigee*>::iterator perItr = trkPer.begin();
571  AmgVector(3) dMdP;
572  dMdP.setZero();
573  for (; tmItr != trkMom.end(); ++tmItr, ++trItr, ++perItr) {
574  dMdP(0) = (totMom.E() * tmItr->Px()/tmItr->E() - totMom.Px())/totMom.M();
575  dMdP(1) = (totMom.E() * tmItr->Py()/tmItr->E() - totMom.Py())/totMom.M();
576  dMdP(2) = (totMom.E() * tmItr->Pz()/tmItr->E() - totMom.Pz())/totMom.M();
577  if ( *perItr != NULL ) {
578  mErr2 += (dMdP.transpose() * getMomentumCov(*perItr) * dMdP)(0,0);
579  } else {
580  mErr2 += (dMdP.transpose() * getMomentumCov(*trItr ) * dMdP)(0,0);
581  }
582  }
583  mass.second = mErr2 > 0. ? sqrt(mErr2) : 0.;
584  // clean up
585  for ( perItr = trkPer.begin(); perItr != trkPer.end(); ++perItr) {
586  delete (*perItr);
587  }
588  } else {
589  ATH_MSG_WARNING("BPhysAddMuonBasedInvMass::getInvariantMassError: "
590  "size mismatch of tracks and mass hypotheses vectors!");
591  } // if size comparison
592 
593  return mass;
594  }

◆ getMinChi2ToAnyPV()

double DerivationFramework::BPhysAddMuonBasedInvMass::getMinChi2ToAnyPV ( xAOD::BPhysHelper vtx,
const xAOD::VertexContainer pvContainer,
const std::vector< int > &  pvtypes,
const int  minNTracksInPV,
const int  mode,
const xAOD::BPhysHelper::pv_type pvAssocType,
BasedInvCache cache 
) const
protected

Determine minimum log chi2 of signal muon tracks w.r.t.

Find minimum log chi2 distance of signal muons w.r.t any primary vertex of required types and with a minimum number of tracks cut. It also depends on the mode w.r.t. the treatment of the associated primary vertex and the type of PV-to-SV association. Returns this minimum chi2.

Parameters
[in]vtxsecondary vertex
[in]pvContainercontainer of primary vertices @parma[in] pvtypes vector of primary vertex types to be considered
[in]minNTracksInPVminimum number of tracks in primary vertex for it to be considered
[in]modemode of operation (possible values: 0, 1, 2 ,3)
[in]pv_typetype of PV-to-SV association
Returns
minimum log chi2 = log(d0^2/d0e^+z0^2/z0e^2) w.r.t. any primary vertex

Definition at line 404 of file BPhysAddMuonBasedInvMass.cxx.

412  {
413 
414  MuonBag muons = findAllMuonsInDecay(vtx);
415  TrackBag tracks = getIdTracksForMuons(muons);
416  const xAOD::Vertex* origPV = nullptr;
417  const xAOD::Vertex* refPV = nullptr;
418 
419  if ( mode > 1 ) {
420  // need to obtain original PV
421  origPV = vtx.origPv(pvAssocType);
422  if ( origPV == nullptr ) {
423  ATH_MSG_WARNING("BPhysAddMuonBasedInvMass::getMinChi2ToAnyPV:"
424  << " origPV == NULL for pvAssocType = "
425  << pvAssocType);
426  }
427  if ( mode > 2 ) {
428  refPV = vtx.pv(pvAssocType);
429  if ( refPV == nullptr ) {
430  ATH_MSG_WARNING("BPhysAddMuonBasedInvMass::getMinChi2ToAnyPV:"
431  << " refPV == NULL for pvAssocType = "
432  << pvAssocType);
433  }
434  }
435  }
436 
437  double minChi2 = std::numeric_limits<double>::max();
438 
439  for (const auto pvtx : *pvContainer) {
440  if ( pvtx != nullptr ) {
441  if ( std::find(pvtypes.begin(),pvtypes.end(),pvtx->vertexType())
442  != pvtypes.end() ) {
443  const xAOD::Vertex* cvtx = pvtx;
444  // switch if PV matches original PV and replacement is requested
445  if ( mode > 1 && pvtx == origPV ) {
446  // mode 2 -- skip
447  switch(mode) {
448  case 2: // skip current PV
449  continue;
450  break;
451  case 3: // replace by refitted PV
452  if ( refPV != nullptr ) {
453  cvtx = refPV;
454  } else {
455  ATH_MSG_WARNING("BPhysAddMuonBasedInvMass::getMinChi2ToAnyPV:"
456  << " refPV == NULL!");
457  continue;
458  }
459  break;
460  }
461  }
462  if ( (int)cvtx->nTrackParticles() >= minNTracksInPV ) {
463  for (auto &track : tracks) {
464  const Amg::Vector3D pos = cvtx->position();
465  minChi2 = std::min(minChi2, getTrackPVChi2(*track, pos, cache));
466  } // for track
467  } // if minNTracksInPV
468  } // if pvTypes in pvtypes vector
469  } else {
470  ATH_MSG_WARNING("BPhysAddMuonBasedInvMass::getMinChi2ToAnyPV:"
471  << " pvtx == NULL!");
472  } // if vtx != nullptr
473  } // for pvtx
474 
475  return minChi2;
476  }

◆ getMuCalcMass()

std::pair< double, double > DerivationFramework::BPhysAddMuonBasedInvMass::getMuCalcMass ( xAOD::BPhysHelper vtx,
const std::vector< double > &  trkMasses,
int  nMuRequested,
BasedInvCache cache 
) const
protected

Definition at line 208 of file BPhysAddMuonBasedInvMass.cxx.

210  {
211 
212  std::pair<double, double> mpe(0., -1.);
213 
214  std::pair<TrackBag, int> tracksWithMu = getTracksWithMuons(vtx, cache);
215 
216  if ( tracksWithMu.second == nMuRequested ) {
217  if ( tracksWithMu.first.size() == trkMasses.size() ) {
218  mpe = getInvariantMassWithError(tracksWithMu.first,
219  trkMasses,
220  vtx.vtx()->position(), cache);
221  } else {
222  ATH_MSG_WARNING("BPhysAddMuonBasedInvMass::getMuCalcMass:"
223  << " vector sizes disagree!"
224  << " tracksWithMu: " << tracksWithMu.first.size()
225  << " BtrkMasses: " << trkMasses.size());
226  }
227  } else {
228  mpe.second = -10 - tracksWithMu.second;
229  ATH_MSG_DEBUG("BPhysAddMuonBasedInvMass::getMuCalcMass:"
230  << " muon number mismatch:"
231  << " tracksWithMu: " << tracksWithMu.second
232  << " requested: " << nMuRequested);
233  }
234  return mpe;
235  }

◆ getTrackPVChi2()

double DerivationFramework::BPhysAddMuonBasedInvMass::getTrackPVChi2 ( const xAOD::TrackParticle track,
const Amg::Vector3D pos,
BasedInvCache cache 
) const
protected

Calculate log chi2 value of a track w.r.t.

a position.

Calculate the log chi2 ( = log((d0/d0e)^2+(z0/z0e)^2) contribution of a track at the position closest to the given PV.

Parameters
[in]tracktrack considered
[in]posposition considered
Returns
log chi2 value

Definition at line 483 of file BPhysAddMuonBasedInvMass.cxx.

484  {
485 
486  double chi2 = -100.;
487 
488  auto trkPerigee =
489  m_trackToVertexTool->perigeeAtVertex(cache.ctx, track, pos);
490  if ( trkPerigee != NULL ) {
491  const AmgSymMatrix(5)* locError = trkPerigee->covariance();
492  if ( locError != NULL ) {
493  double d0 = trkPerigee->parameters()[Trk::d0];
494  double z0 = trkPerigee->parameters()[Trk::z0];
495  double d0Err = Amg::error(*locError, Trk::d0);
496  double z0Err = Amg::error(*locError, Trk::z0);
497  if (fabs(d0Err) > 0. && fabs(z0Err) > 0.) {
498  chi2 = log( pow(d0/d0Err,2.0) + pow(z0/z0Err,2.0) );
499  } else {
500  ATH_MSG_WARNING("BPhysAddMuonBasedInvMass::getTrackPVChi2():"
501  << " d0 = " << d0 << ", d0Err = " << d0Err
502  << ", z0 = " << z0 << ", z0Err = " << z0Err);
503  }
504  } // locError != NULL
505  } else {
506  ATH_MSG_WARNING("getTrackPVChi2: Could not get perigee");
507  }
508 
509  return chi2;
510 }

◆ getTracksWithMuons()

std::pair< TrackBag, int > DerivationFramework::BPhysAddMuonBasedInvMass::getTracksWithMuons ( xAOD::BPhysHelper vtx,
BasedInvCache cache 
) const
protected

Obtain a set of tracks with muon track information if available.

Parameters
[in]vtxsecondary vertex
Returns
container of muon tracks, number of muons found

Definition at line 264 of file BPhysAddMuonBasedInvMass.cxx.

264  {
265 
266  TrackBag tracksWithMu;
267  int nMuFound = 0;
268  std::vector<int> vnMuFound;
269 
270  MuonBag muons = findAllMuonsInDecay(vtx);
271 
272  if ( muons.size() > 0 ) {
273  for (int itrk=0; itrk<vtx.nRefTrks(); ++itrk) {
274  // only charged tracks are of interest
275  if ( abs(vtx.refTrkCharge(itrk)) > 0. ) {
276  const xAOD::TrackParticle* trkParticle =
277  (xAOD::TrackParticle*)vtx.refTrkOrigin(itrk);
278  for (unsigned int imu = 0; imu<muons.size(); ++imu) {
279  if ( vtx.refTrkOrigin(itrk) ==
280  muons.at(imu)->trackParticle(xAOD::Muon::InnerDetectorTrackParticle) ) {
281  const xAOD::TrackParticle* trkMuon =
282  adjustTrackParticle(muons.at(imu), cache);
283  if ( trkMuon != NULL ) {
284  trkParticle = trkMuon;
285  nMuFound++;
286  break;
287  }
288  }
289  } // for imu
290  tracksWithMu.push_back(trkParticle);
291  vnMuFound.push_back(nMuFound);
292  } // for charged track
293  } // for itrk
294  } else {
295  ATH_MSG_DEBUG("BPhysAddMuonBasedInvMass::getTracksWithMuons: "
296  "vertex contains no muons, but "
297  << vtx.nRefTrks() << " refitted tracks ...");
298  }
299  // debug output
300  std::string svnMuFound = "[";
301  for (unsigned int i=0; i<vnMuFound.size(); ++i) {
302  svnMuFound += std::to_string(vnMuFound[i]) + ',';
303  }
304  svnMuFound.back() = ']';
305  ATH_MSG_DEBUG("BPhysAddMuonBasedInvMass::getTracksWithMuons: "
306  "nMuFound = " << nMuFound
307  << "\nvnMuFound = " << svnMuFound );
308 
309  return std::pair<TrackBag, int>(std::move(tracksWithMu), nMuFound);
310  }

◆ initialize()

StatusCode DerivationFramework::BPhysAddMuonBasedInvMass::initialize ( )
virtual

Initialize augmentation tool.

Definition at line 74 of file BPhysAddMuonBasedInvMass.cxx.

74  {
75 
76  ATH_MSG_DEBUG("BPhysAddMuonBasedInvMass::initialize() -- begin");
77 
78  // candidate vertices container
79  if ( m_vertexContainerName == "" ) {
80  ATH_MSG_ERROR("No vertex container name provided!");
81  }
82 
83  // TrackToVertexTool
84  CHECK(m_trackToVertexTool.retrieve());
85 
86  // PV container if needed
87  if ( m_addMinChi2ToAnyPVMode > 0 && m_pvContainerName == "" ) {
88  ATH_MSG_ERROR("No primary vertex container name provided!");
89  }
90 
91  // PV type list if needed
92  if ( m_addMinChi2ToAnyPVMode > 0 && m_pvTypesToConsider.size() == 0 ) {
93  ATH_MSG_ERROR("No primary vertex types to be considered provided!");
94  }
95 
96  // PV-to-SV association type if needed
97  if ( m_addMinChi2ToAnyPVMode > 1 && m_doVertexType < 1 ) {
98  ATH_MSG_ERROR("No PV-to-SV association types to be considered provided!");
99  }
100 
101  ATH_MSG_INFO("BPhysAddMuonBasedInvMass::initialize(): "
102  << "AdjustToMuonKinematics = " << m_adjustToMuonKinematics);
103 
104  ATH_MSG_INFO("BPhysAddMuonBasedInvMass::initialize(): "
105  << "AddMinChi2ToAnyPVMode = " << m_addMinChi2ToAnyPVMode);
106 
107  // initialize PV-to-SV association type vector
109 
110  ATH_MSG_DEBUG("BPhysAddMuonBasedInvMass::initialize() -- end");
111 
112  return StatusCode::SUCCESS;
113  }

◆ initPvAssocTypeVec()

void DerivationFramework::BPhysAddMuonBasedInvMass::initPvAssocTypeVec ( )
protected

Initialize PV-to-SV association type vector.

◆ 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& DerivationFramework::IAugmentationTool::interfaceID ( )
inlinestaticinherited

AlgTool interface methods.

Definition at line 31 of file IAugmentationTool.h.

31 { return IID_IAugmentationTool; }

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

int DerivationFramework::BPhysAddMuonBasedInvMass::m_addMinChi2ToAnyPVMode
private

Definition at line 282 of file BPhysAddMuonBasedInvMass.h.

◆ m_adjustToMuonKinematics

bool DerivationFramework::BPhysAddMuonBasedInvMass::m_adjustToMuonKinematics
private

Definition at line 281 of file BPhysAddMuonBasedInvMass.h.

◆ m_branchPrefix

std::string DerivationFramework::BPhysAddMuonBasedInvMass::m_branchPrefix
private

Definition at line 277 of file BPhysAddMuonBasedInvMass.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_doVertexType

int DerivationFramework::BPhysAddMuonBasedInvMass::m_doVertexType
private

Definition at line 286 of file BPhysAddMuonBasedInvMass.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_minNTracksInPV

int DerivationFramework::BPhysAddMuonBasedInvMass::m_minNTracksInPV
private

Definition at line 284 of file BPhysAddMuonBasedInvMass.h.

◆ m_pvAssocTypes

std::vector<xAOD::BPhysHelper::pv_type> DerivationFramework::BPhysAddMuonBasedInvMass::m_pvAssocTypes
private

cache for individual vertex types

Definition at line 291 of file BPhysAddMuonBasedInvMass.h.

◆ m_pvContainerName

std::string DerivationFramework::BPhysAddMuonBasedInvMass::m_pvContainerName
private

Definition at line 283 of file BPhysAddMuonBasedInvMass.h.

◆ m_pvTypesToConsider

std::vector<int> DerivationFramework::BPhysAddMuonBasedInvMass::m_pvTypesToConsider
private

Definition at line 285 of file BPhysAddMuonBasedInvMass.h.

◆ m_trackToVertexTool

ToolHandle<Reco::ITrackToVertex> DerivationFramework::BPhysAddMuonBasedInvMass::m_trackToVertexTool
private

Definition at line 280 of file BPhysAddMuonBasedInvMass.h.

◆ m_trkMasses

std::vector<double> DerivationFramework::BPhysAddMuonBasedInvMass::m_trkMasses
private

Definition at line 279 of file BPhysAddMuonBasedInvMass.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexContainerName

std::string DerivationFramework::BPhysAddMuonBasedInvMass::m_vertexContainerName
private

Definition at line 278 of file BPhysAddMuonBasedInvMass.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.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
xAOD::BPhysHelper::refTrkCharge
float refTrkCharge(const size_t index) const
Returns charge of the i-th track.
Definition: BPhysHelper.cxx:255
DerivationFramework::BPhysAddMuonBasedInvMass::m_minNTracksInPV
int m_minNTracksInPV
Definition: BPhysAddMuonBasedInvMass.h:284
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
Trk::py
@ py
Definition: ParamDefs.h:60
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
xAOD::Vertex_v1::nTrackParticles
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
Definition: Vertex_v1.cxx:270
xAOD::BPhysHelper
Definition: BPhysHelper.h:71
xAOD::VertexAuxContainer_v1
Temporary container used until we have I/O for AuxStoreInternal.
Definition: VertexAuxContainer_v1.h:32
xAOD::BPhysHelper::pv_type_str
static const std::string pv_type_str[]
Definition: BPhysHelper.h:605
xAOD::BPhysHelper::nRefTrks
int nRefTrks()
Returns number of stored refitted track momenta.
Definition: BPhysHelper.cxx:115
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
DerivationFramework::BPhysAddMuonBasedInvMass::adjustTrackParticle
const xAOD::TrackParticle * adjustTrackParticle(const xAOD::Muon *muon, BasedInvCache &cache) const
Extract TrackParticle for Muon and adjust kinematics.
Definition: BPhysAddMuonBasedInvMass.cxx:317
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
DerivationFramework::BPhysAddMuonBasedInvMass::m_pvAssocTypes
std::vector< xAOD::BPhysHelper::pv_type > m_pvAssocTypes
Definition: BPhysAddMuonBasedInvMass.h:291
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
skel.it
it
Definition: skel.GENtoEVGEN.py:396
DerivationFramework::BPhysAddMuonBasedInvMass::m_pvTypesToConsider
std::vector< int > m_pvTypesToConsider
Definition: BPhysAddMuonBasedInvMass.h:285
xAOD::TrackParticle_v1::z0
float z0() const
Returns the parameter.
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
ParticleTest.tp
tp
Definition: ParticleTest.py:25
xAOD::TrackParticle_v1::setDefiningParameters
void setDefiningParameters(float d0, float z0, float phi0, float theta, float qOverP)
Set the defining parameters.
Definition: TrackParticle_v1.cxx:177
Trk::z0
@ z0
Definition: ParamDefs.h:64
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
DerivationFramework::BPhysAddMuonBasedInvMass::findAllMuonsInDecay
MuonBag findAllMuonsInDecay(xAOD::BPhysHelper &vtx) const
Find all muons associated to secondary vertex.
Definition: BPhysAddMuonBasedInvMass.cxx:382
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Trk::pz
@ pz
global momentum (cartesian)
Definition: ParamDefs.h:61
DerivationFramework::BPhysAddMuonBasedInvMass::initPvAssocTypeVec
void initPvAssocTypeVec()
Initialize PV-to-SV association type vector.
DerivationFramework::MuonBag
std::vector< const xAOD::Muon * > MuonBag
Definition: BPhysAddMuonBasedInvMass.h:33
xAOD::TrackParticle_v1::d0
float d0() const
Returns the parameter.
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
DerivationFramework::AmgSymMatrix
AmgSymMatrix(3) BPhysAddMuonBasedInvMass
Definition: BPhysAddMuonBasedInvMass.cxx:601
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
xAOD::IParticle::FourMom_t
TLorentzVector FourMom_t
Definition of the 4-momentum type.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:69
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
DerivationFramework::BPhysAddMuonBasedInvMass::getInvariantMassWithError
std::pair< double, double > getInvariantMassWithError(TrackBag trksIn, const std::vector< double > &massHypotheses, const Amg::Vector3D &pos, BasedInvCache &) const
Calculate invariant mass and uncertainty from a set of tracks.
Definition: BPhysAddMuonBasedInvMass.cxx:519
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
xAOD::BPhysHelper::precedingVertex
const xAOD::Vertex * precedingVertex(const size_t index)
Returns pointer to a preceding vertex.
Definition: BPhysHelper.cxx:613
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
DerivationFramework::BPhysAddMuonBasedInvMass::m_doVertexType
int m_doVertexType
Definition: BPhysAddMuonBasedInvMass.h:286
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:523
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
Trk::px
@ px
Definition: ParamDefs.h:59
xAOD::BPhysHelper::PV_MIN_A0
@ PV_MIN_A0
Definition: BPhysHelper.h:475
Preparation.mode
mode
Definition: Preparation.py:94
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
DerivationFramework::TrackBag
std::vector< const xAOD::TrackParticle * > TrackBag
Definition: BPhysAddMuonBasedInvMass.h:32
xAOD::BPhysHelper::origPv
const xAOD::Vertex * origPv(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
original PV
Definition: BPhysHelper.cxx:807
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
DerivationFramework::BPhysAddMuonBasedInvMass::m_addMinChi2ToAnyPVMode
int m_addMinChi2ToAnyPVMode
Definition: BPhysAddMuonBasedInvMass.h:282
xAOD::BPhysHelper::refTrkOrigin
const xAOD::IParticle * refTrkOrigin(const size_t index) const
: Returns the original track (charged or neutral) corresponding to the i-th refitted track
Definition: BPhysHelper.cxx:171
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
DerivationFramework::BPhysAddMuonBasedInvMass::m_trkMasses
std::vector< double > m_trkMasses
Definition: BPhysAddMuonBasedInvMass.h:279
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
xAOD::TrackParticle_v1::phi0
float phi0() const
Returns the parameter, which has range to .
Definition: TrackParticle_v1.cxx:158
xAOD::TrackParticle_v1::qOverP
float qOverP() const
Returns the parameter.
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::d0
@ d0
Definition: ParamDefs.h:63
xAOD::BPhysHelper::vtx
const xAOD::Vertex * vtx() const
Getter method for the cached xAOD::Vertex.
Definition: BPhysHelper.h:108
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
Amg::error
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Definition: EventPrimitivesHelpers.h:40
SG::AuxElement::makePrivateStore
void makePrivateStore()
Create a new (empty) private store for this object.
Definition: AuxElement.cxx:192
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
DerivationFramework::BPhysAddMuonBasedInvMass::getMinChi2ToAnyPV
double getMinChi2ToAnyPV(xAOD::BPhysHelper &vtx, const xAOD::VertexContainer *pvContainer, const std::vector< int > &pvtypes, const int minNTracksInPV, const int mode, const xAOD::BPhysHelper::pv_type &pvAssocType, BasedInvCache &cache) const
Determine minimum log chi2 of signal muon tracks w.r.t.
Definition: BPhysAddMuonBasedInvMass.cxx:404
DerivationFramework::BPhysAddMuonBasedInvMass::m_pvContainerName
std::string m_pvContainerName
Definition: BPhysAddMuonBasedInvMass.h:283
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DerivationFramework::BPhysAddMuonBasedInvMass::m_adjustToMuonKinematics
bool m_adjustToMuonKinematics
Definition: BPhysAddMuonBasedInvMass.h:281
DerivationFramework::BPhysAddMuonBasedInvMass::getTrackPVChi2
double getTrackPVChi2(const xAOD::TrackParticle &track, const Amg::Vector3D &pos, BasedInvCache &cache) const
Calculate log chi2 value of a track w.r.t.
Definition: BPhysAddMuonBasedInvMass.cxx:483
a
TList * a
Definition: liststreamerinfos.cxx:10
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
DerivationFramework::BPhysAddMuonBasedInvMass::getIdTracksForMuons
TrackBag getIdTracksForMuons(MuonBag &muons) const
Obtain a set of ID tracks for a set of muons.
Definition: BPhysAddMuonBasedInvMass.cxx:239
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DerivationFramework::BPhysAddMuonBasedInvMass::getTracksWithMuons
std::pair< TrackBag, int > getTracksWithMuons(xAOD::BPhysHelper &vtx, BasedInvCache &) const
Obtain a set of tracks with muon track information if available.
Definition: BPhysAddMuonBasedInvMass.cxx:264
xAOD::BPhysHelper::nPrecedingVertices
int nPrecedingVertices()
: Links to preceding vertices
Definition: BPhysHelper.cxx:601
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
xAOD::BPhysHelper::pv
const xAOD::Vertex * pv(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Get the refitted collision vertex of type pv_type.
Definition: BPhysHelper.cxx:796
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
DerivationFramework::BPhysAddMuonBasedInvMass::m_vertexContainerName
std::string m_vertexContainerName
Definition: BPhysAddMuonBasedInvMass.h:278
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
xAOD::BPhysHelper::muons
const std::vector< const xAOD::Muon * > & muons()
Returns linked muons.
Definition: BPhysHelper.cxx:468
DerivationFramework::BPhysAddMuonBasedInvMass::m_trackToVertexTool
ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
Definition: BPhysAddMuonBasedInvMass.h:280
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
xAOD::TrackParticle_v1::theta
float theta() const
Returns the parameter, which has range 0 to .
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
DerivationFramework::BPhysAddMuonBasedInvMass::getMuCalcMass
std::pair< double, double > getMuCalcMass(xAOD::BPhysHelper &vtx, const std::vector< double > &trkMasses, int nMuRequested, BasedInvCache &cache) const
Definition: BPhysAddMuonBasedInvMass.cxx:208
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
DerivationFramework::BPhysAddMuonBasedInvMass::m_branchPrefix
std::string m_branchPrefix
Definition: BPhysAddMuonBasedInvMass.h:277