Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
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. More...
 
virtual ~JEvtWeight ()
 Virtual destructor. More...
 
virtual double getNormalisation () const override
 Get event-weight normalisation. More...
 
virtual double getNormalisation (const Evt &evt) const
 Get event-weight normalisation. More...
 
virtual void setNormalisation (const double normalisation) override
 Set event-weight normalisation factor. More...
 
virtual const char *const getName () const =0
 Get name. More...
 
virtual void configure (const JHead &header)=0
 Configuration. More...
 
virtual bool check (const JHead &header) const =0
 Check whether header is consistent with this event weighter. More...
 
virtual double getWeight (const Evt &evt) const =0
 Get weight of given event. More...
 
virtual clone_type clone () const override
 Get clone of this object. More...
 

Protected Attributes

double normalisation
 Event-weight normalisation. More...
 

Detailed Description

Abstract base class for event weighing.

Definition at line 28 of file JEvtWeight.hh.

Member Typedef Documentation

template<class JClonable_t, class JDerived_t = JNullType>
typedef 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

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
virtual JAANET::JEvtWeight::~JEvtWeight ( )
inlinevirtual

Virtual destructor.

Definition at line 42 of file JEvtWeight.hh.

43  {}

Member Function Documentation

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  }
double normalisation
Event-weight normalisation.
Definition: JEvtWeight.hh:87
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
double normalisation
Event-weight normalisation.
Definition: JEvtWeight.hh:87
static const int WEIGHTLIST_NORMALISATION
Event rate normalisation.
Definition: weightlist.hh:16
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  }
double normalisation
Event-weight normalisation.
Definition: JEvtWeight.hh:87
virtual const char* const JAANET::JEvtWeightInterface::getName ( ) const
pure virtualinherited

Get name.

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

Configuration.

Parameters
headerheader
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
virtual double JAANET::JEvtWeightInterface::getWeight ( const Evt evt) const
pure virtualinherited

Get weight of given event.

Parameters
evtevent
Returns
weight [Hz]
template<class JClonable_t, class JDerived_t = JNullType>
virtual clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone ( ) const
inlineoverridevirtualinherited

Member Data Documentation

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: