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

#include <MuDstarFilter.h>

Inheritance diagram for MuDstarFilter:
Collaboration diagram for MuDstarFilter:

Public Member Functions

 MuDstarFilter (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~MuDstarFilter ()
 
virtual StatusCode filterInitialize ()
 
virtual StatusCode filterFinalize ()
 
virtual StatusCode filterEvent ()
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. 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 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
 

Public Attributes

 PtMinMuon
 Default cut params. More...
 
 PtMaxMuon
 
 EtaRangeMuon
 
 PtMinDstar
 
 PtMaxDstar
 
 EtaRangeDstar
 
 RxyMinDstar
 
 PtMinPis
 
 PtMaxPis
 
 EtaRangePis
 
 D0Kpi_only
 
 PtMinKpi
 
 PtMaxKpi
 
 EtaRangeKpi
 
 mKpiMin
 
 mKpiMax
 
 delta_m_Max
 
 DstarMu_m_Max
 

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

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_PtMinMuon
 
double m_PtMaxMuon
 
double m_EtaRangeMuon
 
double m_PtMinDstar
 
double m_PtMaxDstar
 
double m_EtaRangeDstar
 
double m_RxyMinDstar
 
double m_PtMinPis
 
double m_PtMaxPis
 
double m_EtaRangePis
 
double m_PtMinKpi
 
double m_PtMaxKpi
 
double m_EtaRangeKpi
 
bool m_D0Kpi_only
 
double m_mKpiMin
 
double m_mKpiMax
 
double m_delta_m_Max
 
double m_DstarMu_m_Max
 
const double m_MuonMass = 105.6583755
 
const double m_PionMass = 139.57039
 
const double m_KaonMass = 493.677
 
DataObjIDColl m_extendedExtraObjects
 
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
 

Utility event-mangling functions

Todo:
Replace with HepMC units when available
ServiceHandle< IPartPropSvc > m_ppSvc {this, "PartPropSvc", "PartPropSvc"}
 Handle on the particle property service. More...
 
SG::ReadHandleKey< McEventCollectionm_mcevents_const { this, "McEventKey", "GEN_EVENT", "StoreGate key of the MC event collection" }
 Const handle to the MC event collection. More...
 
void GeVToMeV (HepMC::GenEvent *evt)
 Scale event energies/momenta by x 1000. More...
 
void MeVToGeV (HepMC::GenEvent *evt)
 Scale event energies/momenta by x 1/1000. More...
 
void cmTomm (HepMC::GenEvent *evt)
 Scale event lengths by x 10. More...
 
void mmTocm (HepMC::GenEvent *evt)
 Scale event lengths by x 1/10. More...
 

Detailed Description

Definition at line 37 of file MuDstarFilter.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MuDstarFilter()

MuDstarFilter::MuDstarFilter ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 49 of file MuDstarFilter.cxx.

50  : GenFilter(name, pSvcLocator) {
51  //--------------------------------------------------------------------------
52  declareProperty("PtMinMuon", m_PtMinMuon = 2500.);
53  declareProperty("PtMaxMuon", m_PtMaxMuon = 1e9);
54  declareProperty("EtaRangeMuon", m_EtaRangeMuon = 2.7);
55  //
56  declareProperty("PtMinDstar", m_PtMinDstar = 4500.);
57  declareProperty("PtMaxDstar", m_PtMaxDstar = 1e9);
58  declareProperty("EtaRangeDstar", m_EtaRangeDstar = 2.7);
59  declareProperty("RxyMinDstar", m_RxyMinDstar = -1e9);
60  //
61  declareProperty("PtMinPis", m_PtMinPis = 450.);
62  declareProperty("PtMaxPis", m_PtMaxPis = 1e9);
63  declareProperty("EtaRangePis", m_EtaRangePis = 2.7);
64  //
65  declareProperty("PtMinKpi", m_PtMinKpi = 900.);
66  declareProperty("PtMaxKpi", m_PtMaxKpi = 1e9);
67  declareProperty("EtaRangeKpi", m_EtaRangeKpi = 2.7);
68  //
69  declareProperty("D0Kpi_only", m_D0Kpi_only = false);
70  //
71  declareProperty("mKpiMin", m_mKpiMin = 1665.);
72  declareProperty("mKpiMax", m_mKpiMax = 2065.);
73  //
74  declareProperty("delta_m_Max", m_delta_m_Max = 220.);
75  //
76  declareProperty("DstarMu_m_Max", m_DstarMu_m_Max = 12000.);
77 }

◆ ~MuDstarFilter()

MuDstarFilter::~MuDstarFilter ( )
virtual

Definition at line 80 of file MuDstarFilter.cxx.

80  {
81  //--------------------------------------------------------------------------
82 
83 }

Member Function Documentation

◆ ATLAS_NOT_CONST_THREAD_SAFE() [1/2]

HepMC::GenEvent* event GenBase::ATLAS_NOT_CONST_THREAD_SAFE ( )
inlineinherited

Access the current signal event (first in the McEventCollection)

Note
This function will make a new McEventCollection if there is not already a valid one and MakeMcEvent=True.

Definition at line 76 of file GenBase.h.

76  {
77  if (events()->empty())
78  ATH_MSG_ERROR("McEventCollection is empty during first event access");
79  return *(events()->begin());
80  }

◆ ATLAS_NOT_CONST_THREAD_SAFE() [2/2]

McEventCollection* events GenBase::ATLAS_NOT_CONST_THREAD_SAFE ( )
inherited

Access the current event's McEventCollection.

Note
This function will make a new McEventCollection if there is not already a valid one and MakeMcEvent=True.

◆ cmTomm()

void GenBase::cmTomm ( HepMC::GenEvent *  evt)
protectedinherited

Scale event lengths by x 10.

Definition at line 81 of file GenBase.cxx.

81  {
82  for (HepMC::GenEvent::vertex_iterator vtx = evt->vertices_begin(); vtx != evt->vertices_end(); ++vtx) {
83  const HepMC::FourVector fv((*vtx)->position().x() * 10,
84  (*vtx)->position().y() * 10,
85  (*vtx)->position().z() * 10,
86  (*vtx)->position().t() * 10);
87  (*vtx)->set_position(fv);
88  }
89 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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; }

◆ event_const()

const HepMC::GenEvent* GenBase::event_const ( ) const
inlineinherited

Access the current signal event (const)

Definition at line 83 of file GenBase.h.

83  {
84  if (events_const()->empty())
85  ATH_MSG_ERROR("Const McEventCollection is empty during first event access");
86  return *(events_const()->begin());
87  }

◆ events_const() [1/2]

const McEventCollection* GenBase::events_const ( ) const
inlineinherited

Access the current event's McEventCollection (const)

Definition at line 96 of file GenBase.h.

96  {
97  return events_const( getContext() );
98  }

◆ events_const() [2/2]

const McEventCollection* GenBase::events_const ( const EventContext &  ctx) const
inlineinherited

Definition at line 99 of file GenBase.h.

99  {
101  if (!ret.isValid())
102  ATH_MSG_ERROR("No McEventCollection found in StoreGate with key " << m_mcevents_const.key());
103  return ret.cptr();
104  }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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; }

◆ execute()

StatusCode GenFilter::execute ( )
virtualinherited
Todo:
Probably the filter should only look at the first event... right?

Reimplemented from GenBase.

Definition at line 29 of file GenFilter.cxx.

29  {
30  if (events_const()->empty()) {
31  ATH_MSG_ERROR("No events found in McEventCollection");
32  return StatusCode::FAILURE;
33  } else if (events_const()->size() > 1) {
35  ATH_MSG_WARNING("More than one event in current McEventCollection -- which is valid?");
36  }
38 #ifdef HEPMC3
39  if (filterPassed() || m_keepAll ) {
40 #else
41  if (filterPassed() ) {
42 #endif
43  ATH_MSG_DEBUG("Event passed filter");
44  m_nPass += 1;
45  } else {
46  ATH_MSG_DEBUG("Event failed filter");
47  m_nFail += 1;
48  }
49  // Bail out once we have enough events
50  if (m_nPass >= m_nNeeded && m_nNeeded > 0)
51  sc = StatusCode::FAILURE;
52  return sc;
53 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ filterEvent()

StatusCode MuDstarFilter::filterEvent ( )
virtual

Implements GenFilter.

Definition at line 126 of file MuDstarFilter.cxx.

126  {
127  //---------------------------------------------------------------------------
128 
129  // Loop over all events in McEventCollection
131 
132  ATH_MSG_DEBUG(" MuDstarFilter filtering ");
133 
134  for (itr = events_const() -> begin(); itr != events_const() -> end(); ++itr) {
135 
136  double primx = 0.;
137  double primy = 0.;
138 
139  #ifdef HEPMC3
140  HepMC::ConstGenVertexPtr vprim = * (( * itr) -> vertices().begin());
141  #else
142  HepMC::GenVertexPtr vprim = * (( * itr) -> vertices_begin());
143  #endif
144 
145  primx = vprim -> position().x();
146  primy = vprim -> position().y();
147 
148  ATH_MSG_DEBUG("MuDstarFilter: PV x, y = " << primx << " , " << primy);
149 
150  int NumMuons = 0;
151  int NumDstars = 0;
152 
153  std::vector < HepMC::ConstGenParticlePtr > Muons;
154 
155  // Loop over all particles in the event
156  const HepMC::GenEvent * genEvt = ( * itr);
157  for (const auto & pitr: * genEvt) {
158 
159  if (!MC::isPhysical(pitr)) continue; // photos history line
160 
161  // muons
162  if (MC::isMuon(pitr)) {
163  if ((pitr -> momentum().perp() >= m_PtMinMuon) &&
164  (pitr -> momentum().perp() < m_PtMaxMuon) &&
165  (std::abs(pitr -> momentum().eta()) < m_EtaRangeMuon)) {
166  ++NumMuons;
167  Muons.push_back(pitr);
168  }
169  }
170  }
171 
172  ATH_MSG_DEBUG( "MuDstarFilter: NumMuons = " << NumMuons);
173 
174  if (NumMuons == 0) break;
175  for (const auto & pitr: * genEvt) {
176 
177  if (!MC::isPhysical(pitr)) continue; // photos history line
178 
179  // Dstars
180  if (std::abs(pitr -> pdg_id()) == MC::DSTAR) {
181  if ((pitr -> momentum().perp() >= m_PtMinDstar) &&
182  (pitr -> momentum().perp() < m_PtMaxDstar) &&
183  (std::abs(pitr -> momentum().eta()) < m_EtaRangeDstar)) {
184 
185  //Check if has end_vertex
186  if (!(pitr -> end_vertex())) continue;
187 
188  double Rxy = std::sqrt(pow(pitr -> end_vertex() -> position().x() - primx, 2) + pow(pitr -> end_vertex() -> position().y() - primy, 2));
189 
190  ATH_MSG_DEBUG("MuDstarFilter: R_xy(Dstar) = " << Rxy);
191 
192  if (Rxy < m_RxyMinDstar) continue;
193 
194  // Child
195  #ifdef HEPMC3
196  auto firstChild = pitr -> end_vertex() -> particles_out().begin();
197  auto endChild = pitr -> end_vertex() -> particles_out().end();
198  auto thisChild = firstChild;
199  #else
200  HepMC::GenVertex::particle_iterator firstChild =
201  pitr -> end_vertex() -> particles_begin(HepMC::children);
202  HepMC::GenVertex::particle_iterator endChild =
203  pitr -> end_vertex() -> particles_end(HepMC::children);
204  HepMC::GenVertex::particle_iterator thisChild = firstChild;
205  #endif
206 
207  if (( * firstChild) -> pdg_id() == pitr -> pdg_id()) continue;
208 
209  TLorentzVector p4_K;
210  TLorentzVector p4_pi;
211  TLorentzVector p4_pis;
212  TLorentzVector p4_D0;
213  TLorentzVector p4_Dstar;
214  TLorentzVector p4_Mu;
215  TLorentzVector p4_DstarMu;
216 
217  int pis_pdg = 0;
218  int K_pdg = 0;
219 
220  int NumD0 = 0;
221  int NumPis = 0;
222 
223  for (; thisChild != endChild; ++thisChild) {
224 
225  if (!MC::isPhysical(*thisChild)) continue; // photos history line
226 
227  if (std::abs(( * thisChild) -> pdg_id()) == MC::PIPLUS) {
228  if ((( * thisChild) -> momentum().perp() >= m_PtMinPis) &&
229  (( * thisChild) -> momentum().perp() < m_PtMaxPis) &&
230  (std::abs(( * thisChild) -> momentum().eta()) < m_EtaRangePis)) {
231  ++NumPis;
232 
233  p4_pis.SetPtEtaPhiM(( * thisChild) -> momentum().perp(), ( * thisChild) -> momentum().eta(), ( * thisChild) -> momentum().phi(), m_PionMass);
234  pis_pdg = ( * thisChild) -> pdg_id();
235  }
236  }
237  } // thisChild
238 
239  ATH_MSG_DEBUG("MuDstarFilter: NumPis = " << NumPis );
240 
241  if (NumPis != 1) continue;
242 
243  HepMC::ConstGenParticlePtr D0Child1 = 0;
244  HepMC::ConstGenParticlePtr D0Child2 = 0;
245  HepMC::ConstGenParticlePtr D0ChildMu = 0;
246 
247  int NumChildD0 = 0;
248  int NumChildD0Charged = 0;
249  int NumChildD0neutrinos = 0;
250  int NumChildD0gammas = 0;
251  int ChargeD0Child1 = 0;
252  int ChargeD0Child2 = 0;
253  int NumChildD0K = 0;
254  int NumChildD0pi = 0;
255  int NumChildD0mu = 0;
256 
257  for (thisChild = firstChild; thisChild != endChild; ++thisChild) {
258 
259  if (!MC::isPhysical(*thisChild)) continue; // photos history line
260 
261  if (std::abs(( * thisChild) -> pdg_id()) == MC::D0) {
262  if ((( * thisChild) -> end_vertex())) {
263  #ifdef HEPMC3
264  auto firstChild1 = ( * thisChild) -> end_vertex() -> particles_out().begin();
265  auto endChild1 = ( * thisChild) -> end_vertex() -> particles_out().end();
266  auto thisChild1 = firstChild1;
267  #else
268  HepMC::GenVertex::particle_iterator firstChild1 =
269  ( * thisChild) -> end_vertex() -> particles_begin(HepMC::children);
270  HepMC::GenVertex::particle_iterator endChild1 =
271  ( * thisChild) -> end_vertex() -> particles_end(HepMC::children);
272  HepMC::GenVertex::particle_iterator thisChild1 = firstChild1;
273 
274  #endif
275 
276  for (; thisChild1 != endChild1; ++thisChild1) {
277 
278  if (!MC::isPhysical(*thisChild1)) continue; // photos history line
279 
280  if (std::abs(( * thisChild1) -> pdg_id()) == MC::ELECTRON || std::abs(( * thisChild1) -> pdg_id()) == MC::MUON ||
281  std::abs(( * thisChild1) -> pdg_id()) == MC::PIPLUS || std::abs(( * thisChild1) -> pdg_id()) == MC::KPLUS) {
282 
283  ++NumChildD0;
284 
285  if ((( * thisChild1) -> momentum().perp() >= m_PtMinKpi) &&
286  (( * thisChild1) -> momentum().perp() < m_PtMaxKpi) &&
287  (std::abs(( * thisChild1) -> momentum().eta()) < m_EtaRangeKpi)) {
288  ++NumChildD0Charged;
289 
290  if (NumChildD0Charged == 1) {
291  D0Child1 = ( * thisChild1);
292  if (( * thisChild1) -> pdg_id() == -MC::ELECTRON || ( * thisChild1) -> pdg_id() == -MC::MUON ||
293  ( * thisChild1) -> pdg_id() == MC::PIPLUS || ( * thisChild1) -> pdg_id() == MC::KPLUS) {
294  ChargeD0Child1 = +1;
295  } else {
296  ChargeD0Child1 = -1;
297  }
298  }
299  if (NumChildD0Charged == 2) {
300  D0Child2 = ( * thisChild1);
301  if (( * thisChild1) -> pdg_id() == -MC::ELECTRON || ( * thisChild1) -> pdg_id() == -MC::MUON ||
302  ( * thisChild1) -> pdg_id() == MC::PIPLUS || ( * thisChild1) -> pdg_id() == MC::KPLUS) {
303  ChargeD0Child2 = +1;
304  } else {
305  ChargeD0Child2 = -1;
306  }
307  }
308  if (std::abs(( * thisChild1) -> pdg_id()) == MC::MUON) {
309  ++NumChildD0mu;
310  D0ChildMu = ( * thisChild1);
311  }
312  if (std::abs(( * thisChild1) -> pdg_id()) == MC::PIPLUS) ++NumChildD0pi;
313  if (std::abs(( * thisChild1) -> pdg_id()) == MC::KPLUS) {
314  ++NumChildD0K;
315  K_pdg = ( * thisChild1) -> pdg_id();
316  }
317  }
318 
319  } else if (std::abs(( * thisChild1) -> pdg_id()) == MC::PI0) {
320  ++NumChildD0;
321  } else if (std::abs(( * thisChild1) -> pdg_id()) == MC::NU_E || std::abs(( * thisChild1) -> pdg_id()) == MC::NU_MU) {
322  ++NumChildD0neutrinos;
323  } else if (std::abs(( * thisChild1) -> pdg_id()) == MC::PHOTON) {
324  ++NumChildD0gammas;
325  } else if (std::abs(( * thisChild1) -> pdg_id()) == MC::K0 || std::abs(( * thisChild1) -> pdg_id()) == MC::K0L ||
326  std::abs(( * thisChild1) -> pdg_id()) == MC::K0S) {
327  ++NumChildD0;
328  ++NumChildD0;
329  } else if ((( * thisChild1) -> end_vertex())) {
330 
331  //
332  #ifdef HEPMC3
333  auto firstChild2 = ( * thisChild1) -> end_vertex() -> particles_out().begin();
334  auto endChild2 = ( * thisChild1) -> end_vertex() -> particles_out().end();
335  auto thisChild2 = firstChild2;
336  #else
337  HepMC::GenVertex::particle_iterator firstChild2 =
338  ( * thisChild1) -> end_vertex() -> particles_begin(HepMC::children);
339  HepMC::GenVertex::particle_iterator endChild2 =
340  ( * thisChild1) -> end_vertex() -> particles_end(HepMC::children);
341  HepMC::GenVertex::particle_iterator thisChild2 = firstChild2;
342 
343  #endif
344  for (; thisChild2 != endChild2; ++thisChild2) {
345 
346  if (!MC::isPhysical(*thisChild2)) continue; // photos history line
347 
348  if (std::abs(( * thisChild2) -> pdg_id()) == MC::ELECTRON || std::abs(( * thisChild2) -> pdg_id()) == MC::MUON ||
349  std::abs(( * thisChild2) -> pdg_id()) == MC::PIPLUS || std::abs(( * thisChild2) -> pdg_id()) == MC::KPLUS) {
350 
351  ++NumChildD0;
352 
353  if ((( * thisChild2) -> momentum().perp() >= m_PtMinKpi) &&
354  (( * thisChild2) -> momentum().perp() < m_PtMaxKpi) &&
355  (std::abs(( * thisChild2) -> momentum().eta()) < m_EtaRangeKpi)) {
356  ++NumChildD0Charged;
357 
358  if (NumChildD0Charged == 1) {
359  D0Child1 = ( * thisChild2);
360  if (( * thisChild2) -> pdg_id() == -MC::ELECTRON || ( * thisChild2) -> pdg_id() == -MC::MUON ||
361  ( * thisChild2) -> pdg_id() == MC::PIPLUS || ( * thisChild2) -> pdg_id() == MC::KPLUS) {
362  ChargeD0Child1 = +1;
363  } else {
364  ChargeD0Child1 = -1;
365  }
366  }
367  if (NumChildD0Charged == 2) {
368  D0Child2 = ( * thisChild2);
369  if (( * thisChild2) -> pdg_id() == -MC::ELECTRON || ( * thisChild2) -> pdg_id() == -MC::MUON ||
370  ( * thisChild2) -> pdg_id() == MC::PIPLUS || ( * thisChild2) -> pdg_id() == MC::KPLUS) {
371  ChargeD0Child2 = +1;
372  } else {
373  ChargeD0Child2 = -1;
374  }
375  }
376  if (std::abs(( * thisChild2) -> pdg_id()) == MC::MUON) {
377  ++NumChildD0mu;
378  D0ChildMu = ( * thisChild2);
379  }
380  }
381 
382  } else if (std::abs(( * thisChild2) -> pdg_id()) == MC::PI0) {
383  ++NumChildD0;
384  } else if (std::abs(( * thisChild2) -> pdg_id()) == MC::NU_E || std::abs(( * thisChild2) -> pdg_id()) == MC::NU_MU) {
385  ++NumChildD0neutrinos;
386  } else if (std::abs(( * thisChild2) -> pdg_id()) == MC::PHOTON) {
387  ++NumChildD0gammas;
388  } else if (std::abs(( * thisChild2) -> pdg_id()) == MC::K0 || std::abs(( * thisChild2) -> pdg_id()) == MC::K0L ||
389  std::abs(( * thisChild2) -> pdg_id()) == MC::K0S) {
390  ++NumChildD0;
391  ++NumChildD0;
392  } else if ((( * thisChild2) -> end_vertex())) {
393  ++NumChildD0;
394  ++NumChildD0;
395  } else {
396  ++NumChildD0;
397  ++NumChildD0;
398  ATH_MSG_DEBUG("MuDstarFilter: unexpected D0 granddaughter = " << (*thisChild2)->pdg_id() );
399  }
400  } // thisChild2
401 
402  } else {
403  ++NumChildD0;
404  ++NumChildD0;
405  ATH_MSG_DEBUG("MuDstarFilter: unexpected D0 daughter = " << (*thisChild1)->pdg_id() );
406  }
407  } // thisChild1
408 
409  ATH_MSG_DEBUG("MuDstarFilter: NumChildD0, NumChildD0Charged = " << NumChildD0 << " , " << NumChildD0Charged);
410 
411  if (NumChildD0 <= 3 && NumChildD0Charged == 2 && ChargeD0Child1 * ChargeD0Child2 < 0) {
412  if (m_D0Kpi_only) {
413  if (NumChildD0 == 2 && NumChildD0K == 1 && NumChildD0pi == 1) ++NumD0;
414  } else {
415  ++NumD0;
416  }
417  }
418  } // enVertex
419  } // D0
420 
421  ATH_MSG_DEBUG("MuDstarFilter: NumD0 = " << NumD0 );
422 
423  if (NumD0 == 1) {
424 
425  if (pis_pdg * ChargeD0Child1 < 0) {
426 
427  p4_K.SetPtEtaPhiM(D0Child1 -> momentum().perp(), D0Child1 -> momentum().eta(), D0Child1 -> momentum().phi(), m_KaonMass);
428  p4_pi.SetPtEtaPhiM(D0Child2 -> momentum().perp(), D0Child2 -> momentum().eta(), D0Child2 -> momentum().phi(), m_PionMass);
429 
430  } else {
431 
432  p4_K.SetPtEtaPhiM(D0Child2 -> momentum().perp(), D0Child2 -> momentum().eta(), D0Child2 -> momentum().phi(), m_KaonMass);
433  p4_pi.SetPtEtaPhiM(D0Child1 -> momentum().perp(), D0Child1 -> momentum().eta(), D0Child1 -> momentum().phi(), m_PionMass);
434  }
435 
436  p4_D0 = p4_K + p4_pi;
437  double mKpi = p4_D0.M();
438 
439  ATH_MSG_DEBUG("MuDstarFilter: mKpi = " << mKpi );
440 
441  if (mKpi >= m_mKpiMin && mKpi <= m_mKpiMax) {
442 
443  p4_Dstar = p4_D0 + p4_pis;
444 
445  double delta_m = p4_Dstar.M() - mKpi;
446 
447  ATH_MSG_DEBUG("MuDstarFilter: delta_m = " << delta_m );
448 
449  if (delta_m <= m_delta_m_Max) {
450  ++NumDstars;
451 
452  ATH_MSG_DEBUG("MuDstarFilter: NumDstars = " << NumDstars );
453 
454  for (size_t i = 0; i < Muons.size(); ++i) {
455 
456  if (NumChildD0mu == 1) {
457  ATH_MSG_DEBUG("MuDstarFilter: Mu(pT), D0Mu(pT) = " << Muons[i]->momentum().perp() << " , " << D0ChildMu->momentum().perp());
458  if (std::fabs(Muons[i] -> momentum().perp() - D0ChildMu -> momentum().perp())< std::numeric_limits<double>::epsilon()) continue;
459  ATH_MSG_DEBUG("MuDstarFilter: Mu(pT), D0Mu(pT) = " << Muons[i]->momentum().perp() << " , " << D0ChildMu->momentum().perp() ) ;
460  }
461 
462  p4_Mu.SetPtEtaPhiM(Muons[i] -> momentum().perp(), Muons[i] -> momentum().eta(), Muons[i] -> momentum().phi(), m_MuonMass);
463 
464  p4_DstarMu = p4_Dstar + p4_Mu;
465 
466  ATH_MSG_DEBUG("MuDstarFilter: p4_DstarMu.M() = " << p4_DstarMu.M());
467 
468  if (p4_DstarMu.M() <= m_DstarMu_m_Max) {
469 
470  ATH_MSG_INFO("MuDstarFilter: MuDstar candidate found" );
471  ATH_MSG_INFO("MuDstarFilter: p4_DstarMu.M() = " << p4_DstarMu.M() );
472  ATH_MSG_INFO("MuDstarFilter: NumChildD0, NumChildD0Charged = " << NumChildD0 << " , " << NumChildD0Charged );
473  ATH_MSG_INFO("MuDstarFilter: NumChildD0K, NumChildD0pi, NumChildD0mu = " << NumChildD0K << " , " << NumChildD0pi << " , " << NumChildD0mu );
474 
475  if (NumChildD0mu == 1) {
476 
477  ATH_MSG_DEBUG("MuDstarFilter: Mu(pT), D0Mu(pT) = " << Muons[i]->momentum().perp() << " , " << D0ChildMu->momentum().perp() );
478  }
479 
480  ATH_MSG_INFO("MuDstarFilter: NumChildD0neutrinos, NumChildD0gammas = " << NumChildD0neutrinos << " , " << NumChildD0gammas );
481  ATH_MSG_INFO("MuDstarFilter: pis_pdg, K_pdg, ChargeD0Child1, ChargeD0Child2 = " << pis_pdg << " , " << K_pdg << " , " << ChargeD0Child1 << " , " << ChargeD0Child2 );
482 
483  setFilterPassed(true);
484  return StatusCode::SUCCESS;
485  }
486  } // for i
487 
488  } //delta_m
489  } // mKpi
490  } // NumD0
491  } // thisChild
492  } // PtMinDstar
493  } // DSTAR
494  } // pitr
495  } // itr
496 
497  //
498  // if we get here we have failed
499  //
500  setFilterPassed(false);
501  return StatusCode::SUCCESS;
502 }

◆ filterFinalize()

StatusCode MuDstarFilter::filterFinalize ( )
virtual

Reimplemented from GenFilter.

Definition at line 120 of file MuDstarFilter.cxx.

120  {
121  //---------------------------------------------------------------------------
122  return StatusCode::SUCCESS;
123 }

◆ filterInitialize()

StatusCode MuDstarFilter::filterInitialize ( )
virtual

Reimplemented from GenFilter.

Definition at line 86 of file MuDstarFilter.cxx.

86  {
87  //---------------------------------------------------------------------------
88  ATH_MSG_INFO( "MuDstarFilter v1.02 INITIALISING " );
89 
90  ATH_MSG_INFO( "PtMinMuon = " << m_PtMinMuon );
91  ATH_MSG_INFO( "PtMaxMuon = " << m_PtMaxMuon );
92  ATH_MSG_INFO( "EtaRangeMuon = " << m_EtaRangeMuon );
93 
94  ATH_MSG_INFO( "PtMinDstar = " << m_PtMinDstar );
95  ATH_MSG_INFO( "PtMaxDstar = " << m_PtMaxDstar );
96  ATH_MSG_INFO( "EtaRangeDstar = " << m_EtaRangeDstar );
97 
98  ATH_MSG_INFO( "RxyMinDstar = " << m_RxyMinDstar );
99 
100  ATH_MSG_INFO( "PtMinPis = " << m_PtMinPis );
101  ATH_MSG_INFO( "PtMaxPis = " << m_PtMaxPis );
102  ATH_MSG_INFO( "EtaRangePis = " << m_EtaRangePis );
103 
104  ATH_MSG_INFO( "D0Kpi_only = " << m_D0Kpi_only );
105  ATH_MSG_INFO( "PtMinKpi = " << m_PtMinKpi );
106  ATH_MSG_INFO( "PtMaxKpi = " << m_PtMaxKpi );
107  ATH_MSG_INFO( "EtaRangeKpi = " << m_EtaRangeKpi );
108 
109  ATH_MSG_INFO( "mKpiMin = " << m_mKpiMin );
110  ATH_MSG_INFO( "mKpiMax = " << m_mKpiMax );
111 
112  ATH_MSG_INFO( "delta_m_Max = " << m_delta_m_Max );
113 
114  ATH_MSG_INFO( "DstarMu_m_Max = " << m_DstarMu_m_Max );
115 
116  return StatusCode::SUCCESS;
117 }

◆ finalize()

StatusCode GenFilter::finalize ( )
inherited

Definition at line 56 of file GenFilter.cxx.

56  {
57  ATH_MSG_INFO("Events passed = " << m_nPass << " Events failed = " << m_nFail);
59  return StatusCode::SUCCESS;
60 }

◆ GeVToMeV()

void GenBase::GeVToMeV ( HepMC::GenEvent *  evt)
protectedinherited

Scale event energies/momenta by x 1000.

Todo:
Add HepMC units awareness and do it differently when HepMC provides this functionality directly (and reference-based FourVector accessors)

Definition at line 61 of file GenBase.cxx.

61  {
62  for (HepMC::GenEvent::particle_iterator p = evt->particles_begin(); p != evt->particles_end(); ++p) {
63  const HepMC::FourVector fv((*p)->momentum().px() * 1000,
64  (*p)->momentum().py() * 1000,
65  (*p)->momentum().pz() * 1000,
66  (*p)->momentum().e() * 1000);
67  (*p)->set_momentum(fv);
68  (*p)->set_generated_mass(1000 * (*p)->generated_mass());
69  }
70 }

◆ initialize()

StatusCode GenFilter::initialize ( )
virtualinherited

Reimplemented from GenBase.

Definition at line 20 of file GenFilter.cxx.

20  {
22  m_nPass = 0;
23  m_nFail = 0;
25  return StatusCode::SUCCESS;
26 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::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.

◆ MeVToGeV()

void GenBase::MeVToGeV ( HepMC::GenEvent *  evt)
protectedinherited

Scale event energies/momenta by x 1/1000.

Definition at line 71 of file GenBase.cxx.

71  {
72  for (HepMC::GenEvent::particle_iterator p = evt->particles_begin(); p != evt->particles_end(); ++p) {
73  const HepMC::FourVector fv((*p)->momentum().px() / 1000,
74  (*p)->momentum().py() / 1000,
75  (*p)->momentum().pz() / 1000,
76  (*p)->momentum().e() / 1000);
77  (*p)->set_momentum(fv);
78  (*p)->set_generated_mass((*p)->generated_mass() / 1000);
79  }
80 }

◆ mmTocm()

void GenBase::mmTocm ( HepMC::GenEvent *  evt)
protectedinherited

Scale event lengths by x 1/10.

Definition at line 90 of file GenBase.cxx.

90  {
91  for (HepMC::GenEvent::vertex_iterator vtx = evt->vertices_begin(); vtx != evt->vertices_end(); ++vtx) {
92  const HepMC::FourVector fv((*vtx)->position().x() / 10,
93  (*vtx)->position().y() / 10,
94  (*vtx)->position().z() / 10,
95  (*vtx)->position().t() / 10);
96  (*vtx)->set_position(fv);
97  }
98 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::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< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

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

◆ nFailed()

int GenFilter::nFailed ( ) const
inlineinherited

Definition at line 53 of file GenFilter.h.

53 { return m_nFail; }

◆ nNeeded()

int GenFilter::nNeeded ( ) const
inlineinherited

Definition at line 54 of file GenFilter.h.

54 { return m_nNeeded; }

◆ nPassed()

int GenFilter::nPassed ( ) const
inlineinherited

Definition at line 52 of file GenFilter.h.

52 { return m_nPass; }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::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.

◆ particleData()

const HepPDT::ParticleData* GenBase::particleData ( int  pid) const
inlineinherited

Access an element in the particle data table.

Definition at line 126 of file GenBase.h.

126  {
127  return pdt().particle(HepPDT::ParticleID(std::abs(pid)));
128  }

◆ particleTable()

const HepPDT::ParticleDataTable& GenBase::particleTable ( ) const
inlineinherited

Get a particle data table.

Definition at line 118 of file GenBase.h.

118  {
119  return *(m_ppSvc->PDT());
120  }

◆ partPropSvc()

const ServiceHandle<IPartPropSvc> GenBase::partPropSvc ( ) const
inlineinherited

Access the particle property service.

Definition at line 113 of file GenBase.h.

113  {
114  return m_ppSvc;
115  }

◆ pdt()

const HepPDT::ParticleDataTable& GenBase::pdt ( ) const
inlineinherited

Shorter alias to get a particle data table.

Definition at line 123 of file GenBase.h.

123 { return particleTable(); }

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

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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

◆ D0Kpi_only

MuDstarFilter.D0Kpi_only

Definition at line 16 of file MuDstarFilter.py.

◆ delta_m_Max

MuDstarFilter.delta_m_Max

Definition at line 22 of file MuDstarFilter.py.

◆ DstarMu_m_Max

MuDstarFilter.DstarMu_m_Max

Definition at line 23 of file MuDstarFilter.py.

◆ EtaRangeDstar

MuDstarFilter.EtaRangeDstar

Definition at line 11 of file MuDstarFilter.py.

◆ EtaRangeKpi

MuDstarFilter.EtaRangeKpi

Definition at line 19 of file MuDstarFilter.py.

◆ EtaRangeMuon

MuDstarFilter.EtaRangeMuon

Definition at line 8 of file MuDstarFilter.py.

◆ EtaRangePis

MuDstarFilter.EtaRangePis

Definition at line 15 of file MuDstarFilter.py.

◆ m_D0Kpi_only

bool MuDstarFilter::m_D0Kpi_only
private

Definition at line 66 of file MuDstarFilter.h.

◆ m_delta_m_Max

double MuDstarFilter::m_delta_m_Max
private

Definition at line 71 of file MuDstarFilter.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_DstarMu_m_Max

double MuDstarFilter::m_DstarMu_m_Max
private

Definition at line 73 of file MuDstarFilter.h.

◆ m_EtaRangeDstar

double MuDstarFilter::m_EtaRangeDstar
private

Definition at line 55 of file MuDstarFilter.h.

◆ m_EtaRangeKpi

double MuDstarFilter::m_EtaRangeKpi
private

Definition at line 64 of file MuDstarFilter.h.

◆ m_EtaRangeMuon

double MuDstarFilter::m_EtaRangeMuon
private

Definition at line 51 of file MuDstarFilter.h.

◆ m_EtaRangePis

double MuDstarFilter::m_EtaRangePis
private

Definition at line 60 of file MuDstarFilter.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_KaonMass

const double MuDstarFilter::m_KaonMass = 493.677
private

Definition at line 79 of file MuDstarFilter.h.

◆ m_mcEventKey

std::string GenBase::m_mcEventKey {}
protectedinherited

StoreGate key for the MC event collection (defaults to GEN_EVENT)

Definition at line 137 of file GenBase.h.

◆ m_mcevents_const

SG::ReadHandleKey<McEventCollection> GenBase::m_mcevents_const { this, "McEventKey", "GEN_EVENT", "StoreGate key of the MC event collection" }
privateinherited

Const handle to the MC event collection.

Definition at line 163 of file GenBase.h.

◆ m_mkMcEvent

BooleanProperty GenBase::m_mkMcEvent {this, "MakeMcEvent", false, "Create a new MC event collection if it doesn't exist"}
protectedinherited

Flag to determine if a new MC event collection should be made if it doesn't exist.

Definition at line 139 of file GenBase.h.

◆ m_mKpiMax

double MuDstarFilter::m_mKpiMax
private

Definition at line 69 of file MuDstarFilter.h.

◆ m_mKpiMin

double MuDstarFilter::m_mKpiMin
private

Definition at line 68 of file MuDstarFilter.h.

◆ m_MuonMass

const double MuDstarFilter::m_MuonMass = 105.6583755
private

Definition at line 77 of file MuDstarFilter.h.

◆ m_nFail

int GenFilter::m_nFail
protectedinherited

Definition at line 66 of file GenFilter.h.

◆ m_nNeeded

int GenFilter::m_nNeeded
protectedinherited

Definition at line 67 of file GenFilter.h.

◆ m_nPass

int GenFilter::m_nPass
protectedinherited

Definition at line 65 of file GenFilter.h.

◆ m_PionMass

const double MuDstarFilter::m_PionMass = 139.57039
private

Definition at line 78 of file MuDstarFilter.h.

◆ m_ppSvc

ServiceHandle<IPartPropSvc> GenBase::m_ppSvc {this, "PartPropSvc", "PartPropSvc"}
privateinherited

Handle on the particle property service.

Definition at line 160 of file GenBase.h.

◆ m_PtMaxDstar

double MuDstarFilter::m_PtMaxDstar
private

Definition at line 54 of file MuDstarFilter.h.

◆ m_PtMaxKpi

double MuDstarFilter::m_PtMaxKpi
private

Definition at line 63 of file MuDstarFilter.h.

◆ m_PtMaxMuon

double MuDstarFilter::m_PtMaxMuon
private

Definition at line 50 of file MuDstarFilter.h.

◆ m_PtMaxPis

double MuDstarFilter::m_PtMaxPis
private

Definition at line 59 of file MuDstarFilter.h.

◆ m_PtMinDstar

double MuDstarFilter::m_PtMinDstar
private

Definition at line 53 of file MuDstarFilter.h.

◆ m_PtMinKpi

double MuDstarFilter::m_PtMinKpi
private

Definition at line 62 of file MuDstarFilter.h.

◆ m_PtMinMuon

double MuDstarFilter::m_PtMinMuon
private

Definition at line 49 of file MuDstarFilter.h.

◆ m_PtMinPis

double MuDstarFilter::m_PtMinPis
private

Definition at line 58 of file MuDstarFilter.h.

◆ m_RxyMinDstar

double MuDstarFilter::m_RxyMinDstar
private

Definition at line 56 of file MuDstarFilter.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ mKpiMax

MuDstarFilter.mKpiMax

Definition at line 21 of file MuDstarFilter.py.

◆ mKpiMin

MuDstarFilter.mKpiMin

Definition at line 20 of file MuDstarFilter.py.

◆ PtMaxDstar

MuDstarFilter.PtMaxDstar

Definition at line 10 of file MuDstarFilter.py.

◆ PtMaxKpi

MuDstarFilter.PtMaxKpi

Definition at line 18 of file MuDstarFilter.py.

◆ PtMaxMuon

MuDstarFilter.PtMaxMuon

Definition at line 7 of file MuDstarFilter.py.

◆ PtMaxPis

MuDstarFilter.PtMaxPis

Definition at line 14 of file MuDstarFilter.py.

◆ PtMinDstar

MuDstarFilter.PtMinDstar

Definition at line 9 of file MuDstarFilter.py.

◆ PtMinKpi

MuDstarFilter.PtMinKpi

Definition at line 17 of file MuDstarFilter.py.

◆ PtMinMuon

MuDstarFilter.PtMinMuon

Default cut params.

Definition at line 6 of file MuDstarFilter.py.

◆ PtMinPis

MuDstarFilter.PtMinPis

Definition at line 13 of file MuDstarFilter.py.

◆ RxyMinDstar

MuDstarFilter.RxyMinDstar

Definition at line 12 of file MuDstarFilter.py.


The documentation for this class was generated from the following files:
HepMC::GenVertexPtr
HepMC::GenVertex * GenVertexPtr
Definition: GenVertex.h:59
MuDstarFilter::m_PtMinKpi
double m_PtMinKpi
Definition: MuDstarFilter.h:62
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
MuDstarFilter::m_PtMaxKpi
double m_PtMaxKpi
Definition: MuDstarFilter.h:63
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
GenFilter::m_nNeeded
int m_nNeeded
Definition: GenFilter.h:67
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
perp
Scalar perp() const
perp method - perpenticular length
Definition: AmgMatrixBasePlugin.h:35
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
GenBase::events_const
const McEventCollection * events_const() const
Access the current event's McEventCollection (const)
Definition: GenBase.h:96
SG::ReadHandle< McEventCollection >
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
MuDstarFilter::m_PtMaxMuon
double m_PtMaxMuon
Definition: MuDstarFilter.h:50
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
MuDstarFilter::m_PionMass
const double m_PionMass
Definition: MuDstarFilter.h:78
GenFilter::filterEvent
virtual StatusCode filterEvent()=0
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
x
#define x
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
GenFilter::filterInitialize
virtual StatusCode filterInitialize()
Definition: GenFilter.h:45
python.DataFormatRates.events
events
Definition: DataFormatRates.py:105
MuDstarFilter::m_delta_m_Max
double m_delta_m_Max
Definition: MuDstarFilter.h:71
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
MC::isPhysical
bool isPhysical(const T &p)
Definition: HepMCHelpers.h:32
GenBase::m_ppSvc
ServiceHandle< IPartPropSvc > m_ppSvc
Handle on the particle property service.
Definition: GenBase.h:160
MuDstarFilter::m_PtMinMuon
double m_PtMinMuon
Definition: MuDstarFilter.h:49
MuDstarFilter::m_EtaRangePis
double m_EtaRangePis
Definition: MuDstarFilter.h:60
MuDstarFilter::m_DstarMu_m_Max
double m_DstarMu_m_Max
Definition: MuDstarFilter.h:73
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
lumiFormat.i
int i
Definition: lumiFormat.py:92
ret
T ret(T t)
Definition: rootspy.cxx:260
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
GenBase::m_mcevents_const
SG::ReadHandleKey< McEventCollection > m_mcevents_const
Const handle to the MC event collection.
Definition: GenBase.h:163
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
MUON
xAOD::Muon MUON
D3PD INCLUDES.
Definition: TileCellFillerTool.h:37
jobOptions.ParticleID
ParticleID
Definition: jobOptions.decayer.py:85
MuDstarFilter::m_D0Kpi_only
bool m_D0Kpi_only
Definition: MuDstarFilter.h:66
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
MuDstarFilter::m_KaonMass
const double m_KaonMass
Definition: MuDstarFilter.h:79
MuDstarFilter::m_MuonMass
const double m_MuonMass
Definition: MuDstarFilter.h:77
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
GenBase::particleTable
const HepPDT::ParticleDataTable & particleTable() const
Get a particle data table.
Definition: GenBase.h:118
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
MuDstarFilter::m_EtaRangeDstar
double m_EtaRangeDstar
Definition: MuDstarFilter.h:55
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
GenFilter::m_nPass
int m_nPass
Definition: GenFilter.h:65
GenFilter::filterFinalize
virtual StatusCode filterFinalize()
Definition: GenFilter.h:47
MuDstarFilter::m_PtMaxPis
double m_PtMaxPis
Definition: MuDstarFilter.h:59
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
y
#define y
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
GenBase::pdt
const HepPDT::ParticleDataTable & pdt() const
Shorter alias to get a particle data table.
Definition: GenBase.h:123
MuDstarFilter::m_mKpiMax
double m_mKpiMax
Definition: MuDstarFilter.h:69
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
python.DecayParser.children
children
Definition: DecayParser.py:32
GenFilter::m_nFail
int m_nFail
Definition: GenFilter.h:66
test_pyathena.filterPassed
filterPassed
now, add a sequencer: it will only execute seqalg1 and 2 and never 3
Definition: test_pyathena.py:38
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
MuDstarFilter::m_EtaRangeKpi
double m_EtaRangeKpi
Definition: MuDstarFilter.h:64
GenFilter::GenFilter
GenFilter(const std::string &name, ISvcLocator *pSvcLocator)
Definition: GenFilter.cxx:8
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
MuDstarFilter::m_mKpiMin
double m_mKpiMin
Definition: MuDstarFilter.h:68
HepMC::ConstGenVertexPtr
const HepMC::GenVertex * ConstGenVertexPtr
Definition: GenVertex.h:60
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
MuDstarFilter::m_PtMinDstar
double m_PtMinDstar
Definition: MuDstarFilter.h:53
MuDstarFilter::m_RxyMinDstar
double m_RxyMinDstar
Definition: MuDstarFilter.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
MuDstarFilter::m_EtaRangeMuon
double m_EtaRangeMuon
Definition: MuDstarFilter.h:51
MuDstarFilter::m_PtMinPis
double m_PtMinPis
Definition: MuDstarFilter.h:58
GenBase::initialize
virtual StatusCode initialize() override
Definition: GenBase.cxx:17
MuDstarFilter::m_PtMaxDstar
double m_PtMaxDstar
Definition: MuDstarFilter.h:54
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
ServiceHandle< ICondSvc >
isMuon
bool isMuon(const T &p)
Definition: AtlasPID.h:145