ATLAS Offline Software
ParticleVariables.cxx
Go to the documentation of this file.
1 
2 /*
3  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 */
6 #include <StoreGate/ReadHandle.h>
7 
8 namespace MuonPRDTest {
10  const std::string& containerKey,
11  const std::string& outName,
12  MSG::Level msglvl) :
13  PrdTesterModule(tree, "Particles"+ containerKey+outName, msglvl),
14  m_key{containerKey} {
15  m_branch = std::make_shared<IParticleFourMomBranch>(tree, outName);
16  }
17 
18  bool ParticleVariables::fill(const EventContext& ctx) {
20  if(!readHandle.isPresent()) {
21  ATH_MSG_FATAL("Failed to retrieve "<<m_key.fullKey());
22  return false;
23  }
24  for (const xAOD::IParticle* particle : *readHandle){
25  m_branch->push_back(particle);
26  }
27  return true;
28  }
31  }
32 }
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
tree
TChain * tree
Definition: tile_monitor.h:30
ParticleVariables.h
MuonPRDTest::ParticleVariables::m_key
SG::ReadHandleKey< xAOD::IParticleContainer > m_key
Definition: ParticleVariables.h:44
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
MuonVal::MuonTesterBranch::declare_dependency
bool declare_dependency(Key &key)
Declares the ReadHandle/ ReadCondHandleKey as data dependency of the algorithm.
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
MuonVal::MuonTesterTree
Definition: MuonTesterTree.h:30
MuonPRDTest::ParticleVariables::declare_keys
bool declare_keys() override final
Definition: ParticleVariables.cxx:29
MuonPRDTest::ParticleVariables::ParticleVariables
ParticleVariables(MuonTesterTree &tree, const std::string &containerKey, const std::string &outName, MSG::Level msglvl)
Definition: ParticleVariables.cxx:9
MuonPRDTest::PrdTesterModule
Definition: PrdTesterModule.h:15
TestSUSYToolsAlg.outName
string outName
Definition: TestSUSYToolsAlg.py:173
MuonPRDTest::ParticleVariables::fill
bool fill(const EventContext &ctx) override final
The fill method checks if enough information is provided such that the branch is cleared from the inf...
Definition: ParticleVariables.cxx:18
MuonPRDTest::ParticleVariables::m_branch
std::shared_ptr< IParticleFourMomBranch > m_branch
Definition: ParticleVariables.h:45
MuonVal::MuonTesterBranch::parent
MuonTesterTree & parent()
Returns the reference to the MuonTesterTree parent.
Definition: MuonTesterBranch.cxx:38
MuonPRDTest
Definition: CSCDigitVariables.h:10
ReadHandle.h
Handle class for reading from StoreGate.
MuonVal::MuonTesterTree::addBranch
bool addBranch(std::shared_ptr< IMuonTesterBranch > branch)
Branch is added to the tree without transferring the ownership.
Definition: MuonTesterTree.cxx:61