Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JWeightEvent.hh
Go to the documentation of this file.
1 #ifndef __JAANET__JWEIGHTEVENT__
2 #define __JAANET__JWEIGHTEVENT__
3 
6 
7 #include "JLang/JClonable.hh"
8 
9 #include "JAAnet/JHead.hh"
10 
11 /**
12  * \author mdejong
13  */
14 
15 namespace JAANET {
16 
17  using JLANG::JClonable;
18 
19 
20  /**
21  * Low-level interface for event weighing.
22  */
23  struct JWeightEvent :
24  public JClonable<JWeightEvent>
25  {
26  /**
27  * Virtual destructor.
28  */
29  virtual ~JWeightEvent()
30  {}
31 
32 
33  /**
34  * Configuration.
35  *
36  * \param header header
37  */
38  virtual void configure(const JHead& header) = 0;
39 
40 
41  /**
42  * Check whether header is consistent with this event weighter.
43  *
44  * \param header header
45  * \return true if consistent; else false
46  */
47  virtual bool check(const JHead& head) const = 0;
48 
49 
50  /**
51  * Get weight of given event.
52  *
53  * \param evt event
54  * \return weight [Hz]
55  */
56  virtual double getWeight(const Evt& evt) const = 0;
57 
58 
59  /**
60  * Get weight of given event.
61  *
62  * \param evt event
63  * \param flux neutrino flux [m^-2 s^-1 sr^-1 GeV^-1]
64  * \return weight [Hz]
65  */
66  virtual double getWeight(const Evt& evt,
67  const double flux) const
68  {
69  return getWeight(evt);
70  }
71  };
72 }
73 
74 #endif
virtual bool check(const JHead &head) const =0
Check whether header is consistent with this event weighter.
virtual double getWeight(const Evt &evt, const double flux) const
Get weight of given event.
Definition: JWeightEvent.hh:66
Neutrino flux.
Definition: JHead.hh:839
Template class for object cloning.
Definition: JClonable.hh:20
Low-level interface for event weighing.
Definition: JWeightEvent.hh:23
Monte Carlo run header.
Definition: JHead.hh:1050
virtual ~JWeightEvent()
Virtual destructor.
Definition: JWeightEvent.hh:29
virtual void configure(const JHead &header)=0
Configuration.
virtual double getWeight(const Evt &evt) const =0
Get weight of given event.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition: Evt.hh:19