Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JAANET::JEvtWeight Struct Referenceabstract

Abstract base class for event weighing. More...

#include <JEvtWeight.hh>

Inheritance diagram for JAANET::JEvtWeight:
JAANET::JEvtWeightInterface JLANG::JClonable< JClonable_t, JDerived_t >

Public Types

typedef JClonable< JClonable_t >::clone_type clone_type
 

Public Member Functions

 JEvtWeight ()
 Default constructor.
 
virtual ~JEvtWeight ()
 Virtual destructor.
 
virtual double getNormalisation () const override
 Get event-weight normalisation.
 
virtual double getNormalisation (const Evt &evt) const
 Get event-weight normalisation.
 
virtual void setNormalisation (const double normalisation) override
 Set event-weight normalisation factor.
 
virtual const char *const getName () const =0
 Get name.
 
virtual void configure (const JHead &header)=0
 Configuration.
 
virtual bool check (const JHead &header) const =0
 Check whether header is consistent with this event weighter.
 
virtual double getWeight (const Evt &evt) const =0
 Get weight of given event.
 
virtual clone_type clone () const override
 Get clone of this object.
 

Protected Attributes

double normalisation
 Event-weight normalisation.
 

Detailed Description

Abstract base class for event weighing.

Definition at line 28 of file JEvtWeight.hh.

Member Typedef Documentation

◆ clone_type

template<class JClonable_t , class JDerived_t >
JClonable<JClonable_t>::clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone_type
inherited

Definition at line 61 of file JClonable.hh.

Constructor & Destructor Documentation

◆ JEvtWeight()

JAANET::JEvtWeight::JEvtWeight ( )
inline

Default constructor.

Definition at line 35 of file JEvtWeight.hh.

35 : normalisation(1.0)
36 {}
double normalisation
Event-weight normalisation.
Definition JEvtWeight.hh:87

◆ ~JEvtWeight()

virtual JAANET::JEvtWeight::~JEvtWeight ( )
inlinevirtual

Virtual destructor.

Definition at line 42 of file JEvtWeight.hh.

43 {}

Member Function Documentation

◆ getNormalisation() [1/2]

virtual double JAANET::JEvtWeight::getNormalisation ( ) const
inlineoverridevirtual

Get event-weight normalisation.

Note: the return-value should be multiplied in order to normalise the event-weight

Returns
event-weight normalisation

Implements JAANET::JEvtWeightInterface.

Definition at line 52 of file JEvtWeight.hh.

53 {
54 return normalisation;
55 }

◆ getNormalisation() [2/2]

virtual double JAANET::JEvtWeight::getNormalisation ( const Evt & evt) const
inlinevirtual

Get event-weight normalisation.

Note: the return-value should be multiplied in order to normalise the event-weight

Parameters
evtevent
Returns
event-weight normalisation

Definition at line 65 of file JEvtWeight.hh.

66 {
67 return (evt.w.size() > WEIGHTLIST_NORMALISATION &&
68 evt.w[WEIGHTLIST_NORMALISATION] > 0.0 ?
70 }
std::vector< double > w
MC: Weights w[0]=w1, w[1]=w2, w[2]=w3 (see e.g. Tag list or km3net-dataformat/definitions)
Definition Evt.hh:42
static const int WEIGHTLIST_NORMALISATION
Event rate normalisation.
Definition weightlist.hh:16

◆ setNormalisation()

virtual void JAANET::JEvtWeight::setNormalisation ( const double normalisation)
inlineoverridevirtual

Set event-weight normalisation factor.

Note: the set-value should be multiplied in order to normalise the event-weight

Parameters
normalisationevent-weight normalisation factor.

Implements JAANET::JEvtWeightInterface.

Definition at line 79 of file JEvtWeight.hh.

80 {
82 }

◆ getName()

virtual const char *const JAANET::JEvtWeightInterface::getName ( ) const
pure virtualinherited

Get name.

Returns
name

◆ configure()

virtual void JAANET::JEvtWeightInterface::configure ( const JHead & header)
pure virtualinherited

Configuration.

Parameters
headerheader

◆ check()

virtual bool JAANET::JEvtWeightInterface::check ( const JHead & header) const
pure virtualinherited

Check whether header is consistent with this event weighter.

Parameters
headerheader
Returns
true if consistent; else false

◆ getWeight()

virtual double JAANET::JEvtWeightInterface::getWeight ( const Evt & evt) const
pure virtualinherited

Get weight of given event.

Parameters
evtevent
Returns
weight [Hz]

◆ clone()

template<class JClonable_t , class JDerived_t >
virtual clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone ( ) const
inlineoverridevirtualinherited

Member Data Documentation

◆ normalisation

double JAANET::JEvtWeight::normalisation
protected

Event-weight normalisation.

Definition at line 87 of file JEvtWeight.hh.


The documentation for this struct was generated from the following file: