43 if(
evtStore()->retrieve( te,
"TruthEvents" ).isFailure() ) {
44 ATH_MSG_ERROR(
"TruthEvents could not be retrieved. Throwing exception");
45 throw std::runtime_error(
"McEventWeight ASG Tool: TruthEvents could not be retrieved");
47 if( te->
size() == 0 ) {
48 ATH_MSG_ERROR(
"TruthEvents has no events in it. Throwing exception");
49 throw std::runtime_error(
"McEventWeight ASG Tool: TruthEvents has no events in it");
52 ATH_MSG_ERROR(
"TruthEvents first event has " << te->
at(0)->weights().size() <<
" weights, but "
54 throw std::runtime_error(
"McEventWeight ASG Tool: TruthEvents has too few weights.");
57 ATH_MSG_DEBUG (
"Got weight in McEventWeight::computeWeight() = " << weight <<
".");
62 ATH_MSG_DEBUG (
"Got weight in McEventWeight::computeWeight() = " << weight <<
".");
70 if(
sc.isFailure() || !evtInfo) {
76 ATH_MSG_VERBOSE (
" " << name() <<
" returning weight= " << weight <<
".");
#define ATH_MSG_VERBOSE(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
std::string m_eventInfoName
virtual double evaluate(const xAOD::IParticle *part) const override
returns: the value that was calculated from the xAOD::IParticle (composite built event object for ins...
unsigned int m_McEventWeightIndex
virtual double getWeight() const override
returns: the value that was calculated from the usual Athena storegate
double computeWeight(const xAOD::EventInfo *) const
McEventWeight(const std::string &name)
Create a proper constructor for Athena.
bool eventType(EventType type) const
Check for one particular bitmask value.
@ IS_SIMULATION
true: simulation, false: data
float mcEventWeight(size_t i=0) const
The weight of one specific MC event used in the simulation.
Class providing the definition of the 4-vector interface.
TruthEventContainer_v1 TruthEventContainer
Declare the latest version of the truth event container.
EventInfo_v1 EventInfo
Definition of the latest event info version.