Jpp  18.0.1-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JEvtWeight.hh
Go to the documentation of this file.
1 #ifndef __JAANET__JEVTWEIGHT__
2 #define __JAANET__JEVTWEIGHT__
3 
5 
7 
8 #include "JLang/JClonable.hh"
9 
11 
12 
13 /**
14  * \author mdejong, bjjung
15  */
16 
17 namespace JAANET {
18 
19  using JLANG::JClonable;
20 
21 
22  /**
23  * Abstract base class for event weighing.
24  */
25  struct JEvtWeight :
26  public JEvtWeightInterface,
27  public JClonable<JEvtWeight>
28  {
29  /**
30  * Default constructor.
31  */
32  JEvtWeight() : norm(0.0)
33  {}
34 
35 
36  /**
37  * Virtual destructor.
38  */
39  virtual ~JEvtWeight()
40  {}
41 
42 
43  /**
44  * Get event-weight normalisation.
45  * Note: the return-value should be *multiplied* in order to normalise the event-weight
46  *
47  * \return event-weight normalisation
48  */
49  virtual double getNormalisation() const override
50  {
51  return norm;
52  }
53 
54 
55  /**
56  * Get event-weight normalisation.
57  * Note: the return-value should be *multiplied* in order to normalise the event-weight
58  *
59  * \param evt event
60  * \return event-weight normalisation
61  */
62  virtual double getNormalisation(const Evt& evt) const
63  {
64  return (evt.w.size() > WEIGHTLIST_NORMALISATION &&
65  evt.w[WEIGHTLIST_NORMALISATION] > 0.0 ?
67  }
68 
69 
70  protected:
71 
72  double norm; //!< Event-weight normalisation
73  };
74 }
75 
76 #endif
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
virtual double getNormalisation(const Evt &evt) const
Get event-weight normalisation.
Definition: JEvtWeight.hh:62
Low-level interface for event weighing.
Abstract base class for event weighing.
Definition: JEvtWeight.hh:25
Template class for object cloning.
Definition: JClonable.hh:20
virtual ~JEvtWeight()
Virtual destructor.
Definition: JEvtWeight.hh:39
JEvtWeight()
Default constructor.
Definition: JEvtWeight.hh:32
double norm
Event-weight normalisation.
Definition: JEvtWeight.hh:72
virtual double getNormalisation() const override
Get event-weight normalisation.
Definition: JEvtWeight.hh:49
static const int WEIGHTLIST_NORMALISATION
Event rate normalisation.
Definition: weightlist.hh:16
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition: Evt.hh:20