|
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "CLHEP/Random/RandomEngine.h"
31 return StatusCode::SUCCESS;
34 static double calcmag(
const HepMC::FourVector& vect){
35 return std::sqrt(vect.x() * vect.x() + vect.y() * vect.y() + vect.z() * vect.z());
41 HepMC::FourVector
diff(endpos->x() - startpos->x(), endpos->y() - startpos->y(), endpos->z() - startpos->z(), endpos->t() - startpos->t());
44 HepMC::FourVector
p(ptr->
px(),ptr->
py(),ptr->
pz(),ptr->
e());
54 ATH_MSG_ERROR(
"No TruthParticle collection with name " <<
"TruthGen" <<
" found in StoreGate!");
55 return StatusCode::FAILURE;
60 const EventContext& ctx = Gaudi::Hive::currentContext();
63 ATH_MSG_WARNING(
"Failed to retrieve random number engine xAODDecayTimeFilter.");
64 setFilterPassed(
false);
65 return StatusCode::SUCCESS;
69 unsigned int nPart = xTruthParticleContainer->
size();
70 for (
unsigned int iPart = 0; iPart < nPart; ++iPart) {
74 if(pdg ==
part->pdgId()){
79 double rnd = rndm->flat();
89 setFilterPassed((nPassPDG > 0) &
passed);
90 return StatusCode::SUCCESS;
95 const EventContext& ctx)
const
99 rngWrapper->
setSeed( rngName, ctx );
def retrieve(aClass, aKey=None)
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
float pz() const
The z component of the particle's momentum.
std::vector< int > m_particleID
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
float px() const
The x component of the particle's momentum.
virtual StatusCode filterEvent()
float py() const
The y component of the particle's momentum.
double calcmag(const HepMC::FourVector &vect)
ServiceHandle< IAthRNGSvc > m_rndmSvc
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Base class for event generator filtering modules.
virtual double e() const override final
The total energy of the particle.
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
#define CHECK(...)
Evaluate an expression and check for errors.
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
xAODDecayTimeFilter(const std::string &name, ISvcLocator *pSvcLocator)
A wrapper class for event-slot-local random engines.
double tau(const xAOD::TruthParticle *ptr) const
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
#define ATH_MSG_WARNING(x)
virtual StatusCode filterInitialize()
size_type size() const noexcept
Returns the number of elements in the collection.
Scalar mag() const
mag method
virtual double m() const override final
The mass of the particle.