HighLAND
EventWeightBase.hxx
1 #ifndef EventWeightBase_h
2 #define EventWeightBase_h
3 
4 #include "SystematicBase.hxx"
5 #include "ToyExperiment.hxx"
6 #include "WeightType.hxx"
7 
8 /// This is the base class that all weight systematics should inherit from.
9 /// - Weight: A weight for the event is calculated, which depends on the event properties, but no variation on the event is
10 /// performed. Selection does not have to be redone
11 ///
13 
14 public:
15 
16  /// Create the systematic, with one parameter
18  _type = kWeight;
19  }
20 
21  /// Create the systematic, specifying the number of systematic parameters
22  EventWeightBase(UInt_t npar):SystematicBase(npar){
23  _type = kWeight;
24  }
25 
26  /// Everyone should have a destructor.
27  virtual ~EventWeightBase() {}
28 
29  /// Initialize the SystBox for this event
30  virtual void InitializeEvent(const AnaEventC& event, const SelectionBase& sel, Int_t ibranch);
31 
32  //----------------------- MANDATORY METHODS -----------------------------------------
33 
34  /// This is now the actual method called by SystematicManager, which allows further selection tunning of relevant objects once the ToyBox is filled
35  virtual Weight_h ComputeWeight(const ToyExperiment& toy, const AnaEventC& event, const ToyBoxB& box, const SelectionBase& sel){
36  (void)sel; return ComputeWeight(toy, event, box);
37  }
38 
39  /// This is now the actual method called by SystematicManager, which allows further selection tunning of relevant objects once the ToyBox is filled
40  /// This MUST be overridden in the derived class.
41  virtual Weight_h ComputeWeight(const ToyExperiment& toy, const AnaEventC& event, const ToyBoxB& box) = 0;
42 
43 protected:
44 
45  //------------------------ OPTIONAL METHODS ----------------------------------------
46 
47  /// Get the IDs of the RecObject groups that are relevant for this systematic in a given selection
48  virtual Int_t GetRelevantRecObjectGroups(const SelectionBase&, Int_t ibranch, Int_t* IDs) const {(void)IDs;(void)ibranch;return 0;}
49 
50  /// Get the IDs of the TrueObject groups that are relevant for this systematic in a given selection
51  virtual Int_t GetRelevantTrueObjectGroups(const SelectionBase&, Int_t ibranch, Int_t* IDs) const {(void)IDs;(void)ibranch;return 0;}
52 
53  /// Check whether a AnaRecObject is relevant for this systematic or not
54  virtual bool IsRelevantRecObject(const AnaEventC&, const AnaRecObjectC&) const {return true;}
55 
56  /// Check whether a AnaTrueObject is relevant for this systematic or not
57  virtual bool IsRelevantTrueObject(const AnaEventC&, const AnaTrueObjectC&) const {return true;}
58 
59  /// Fills the SystBox
60  virtual void FillSystBox(const AnaEventC& event, const SelectionBase& sel, Int_t ibranch);
61 
62  /// Criteria for true-reco association for this systematic
63  virtual bool CheckTrueRecoAssociation(const AnaTrueObjectC& trueRecObject, const AnaRecObjectC& track) const;
64 
65  //------------------------ INTERNAL METHODS ----------------------------------------
66 
67  /// Fll the true-reco association array
69 
70 };
71 
72 #endif
virtual void InitializeEvent(const AnaEventC &event, const SelectionBase &sel, Int_t ibranch)
Initialize the SystBox for this event.
virtual Int_t GetRelevantRecObjectGroups(const SelectionBase &, Int_t ibranch, Int_t *IDs) const
Get the IDs of the RecObject groups that are relevant for this systematic in a given selection...
virtual ~EventWeightBase()
Everyone should have a destructor.
virtual bool CheckTrueRecoAssociation(const AnaTrueObjectC &trueRecObject, const AnaRecObjectC &track) const
Criteria for true-reco association for this systematic.
virtual Int_t GetRelevantTrueObjectGroups(const SelectionBase &, Int_t ibranch, Int_t *IDs) const
Get the IDs of the TrueObject groups that are relevant for this systematic in a given selection...
virtual void FillSystBox(const AnaEventC &event, const SelectionBase &sel, Int_t ibranch)
Fills the SystBox.
TypeEnum _type
The type of this systematic (variation, weight or flux)
void FillTrueRecoAssociation(SystBoxB &box)
Fll the true-reco association array.
virtual Weight_h ComputeWeight(const ToyExperiment &toy, const AnaEventC &event, const ToyBoxB &box, const SelectionBase &sel)
This is now the actual method called by SystematicManager, which allows further selection tunning of ...
virtual bool IsRelevantRecObject(const AnaEventC &, const AnaRecObjectC &) const
Check whether a AnaRecObject is relevant for this systematic or not.
EventWeightBase()
Create the systematic, with one parameter.
EventWeightBase(UInt_t npar)
Create the systematic, specifying the number of systematic parameters.
virtual bool IsRelevantTrueObject(const AnaEventC &, const AnaTrueObjectC &) const
Check whether a AnaTrueObject is relevant for this systematic or not.