HighLAND
EventVariationBase.hxx
1 #ifndef EventVariationBase_h
2 #define EventVariationBase_h
3 
4 #include "SystematicBase.hxx"
5 #include "ToyExperiment.hxx"
6 
7 /// This is the base class that all systematics variations should inherit from.
8 /// - Variation: modify some aspect of the input data. The selection needs to be redone
9 /// in general. This is what we call Toy Experiments
10 
12 
13 public:
14 
15  /// Create the systematic, with one parameter
16  EventVariationBase(){_type=kVariation;}
17 
18  /// Create the systematic, specifying the number of systematic parameters
19  EventVariationBase(UInt_t npar):SystematicBase(npar){_type=kVariation;}
20 
21  /// Everyone should have a destructor.
22  virtual ~EventVariationBase() {}
23 
24  /// Initialize the SystBox for this event
25  virtual void InitializeEvent(const AnaEventC& event, const SelectionBase& sel);
26  virtual void InitializeEvent(const AnaEventC& event);
27 
28  //----------------------- MANDATORY METHODS -----------------------------------------
29 
30  /// Apply the systematic
31  /// This MUST be overridden in the derived class.
32  virtual void Apply(const ToyExperiment& toy, AnaEventC& event) = 0;
33 
34 protected:
35 
36  // Get the IDs of the RecObject groups that are relevant for this systematic in a given selection
37  virtual Int_t GetRelevantRecObjectGroups(const SelectionBase& sel, Int_t* IDs) const = 0;
38 
39  //----------------------- OPTIONAL METHODS -----------------------------------------
40 
41 public:
42 
43  /// Undo the systematic variations done by ApplyVariation. This is faster tha reseting the full Spill
44  /// This undos the variations. If it return true the Spill will be reset
45  /// By default the Spill is reset
46  virtual bool UndoSystematic(AnaEventC&){return true;}
47 
48 protected:
49 
50  /// Check whether a AnaRecObject is relevant for this systematic or not
51  virtual bool IsRelevantRecObject(const AnaEventC&, const AnaRecObjectC&) const {return true;}
52 
53  //----------------------- INTERNAL METHODS -----------------------------------------
54 
55  /// Fills the SystBox
56  void FillSystBox(const AnaEventC& event, const SelectionBase& sel, SystBoxB& box);
57 
58 };
59 
60 #endif
virtual bool UndoSystematic(AnaEventC &)
virtual ~EventVariationBase()
Everyone should have a destructor.
virtual void Apply(const ToyExperiment &toy, AnaEventC &event)=0
void FillSystBox(const AnaEventC &event, const SelectionBase &sel, SystBoxB &box)
Fills the SystBox.
EventVariationBase(UInt_t npar)
Create the systematic, specifying the number of systematic parameters.
virtual void InitializeEvent(const AnaEventC &event, const SelectionBase &sel)
Initialize the SystBox for this event.
EventVariationBase()
Create the systematic, with one parameter.
TypeEnum _type
The type of this systematic (variation, weight or flux)
virtual bool IsRelevantRecObject(const AnaEventC &, const AnaRecObjectC &) const
Check whether a AnaRecObject is relevant for this systematic or not.