MINT2
IWeightedEvent.h
Go to the documentation of this file.
1 #ifndef IWeightedEvent_HH
2 #define IWeightedEvent_HH
3 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
4 // status: Mon 2 March 2015
5 
6 // The point of this class is to communicate to
7 // Neg2LL if the events in the eventlist are weighted
8 // or not. Events that are weighted should inherit
9 // from this abstract base class.
10 // Using the getWeight functions, Neg2LL
11 // (and possibly other methods) gets events with
12 // weight 1 for any other type of event, without
13 // having to know about the event type in anyw
14 // way, so it keeps it completely general,
15 // people can still use doubles or whatever
16 // they want as event type w/o having
17 // to implement a weight function if they
18 // don't want one. If you do want an event weight, though,
19 // and you want to use Neg2LL to implement that weight,
20 // you have to make sure your event class
21 // inherits from IWeightedEvent.
22 //
23 
24 
25 namespace MINT{
27  public:
28  virtual double getWeight() const=0;
29  };
30 
31  template<typename EVT_TYPE>
32  double getWeight(const EVT_TYPE& ){
33  return 1;
34  }
35  template<> inline
36  double getWeight(const MINT::IWeightedEvent& evt){
37  return evt.getWeight();
38  }
39 
40 }//namespace MINT
41 
42 #endif
43 //
double getWeight(const EVT_TYPE &)
virtual double getWeight() const =0