1 #ifndef SystematicManager_h 2 #define SystematicManager_h 4 #include "EventVariationBase.hxx" 5 #include "EventWeightBase.hxx" 6 #include "SystematicCovariance.hxx" 7 #include "SelectionManager.hxx" 10 #include "HLClonesArray.hxx" 11 #include "ToyExperiment.hxx" 66 Int_t GetSystematicWeightIndex(
const std::string& name);
67 Int_t GetSystematicFluxIndex(
const std::string& name);
71 nSys = _nVariationSystematics;
77 nSys = _nWeightSystematics;
83 nSys = _nFluxSystematics;
93 std::vector<SystematicBase*>
GetSystematics(
const std::vector<Int_t>& indices)
const;
159 void FinalizeEventSystematics(
AnaEventC& event);
168 bool HasSystematics()
const {
return (_nVariationSystematics+_nWeightSystematics+_nFluxSystematics!=0);}
181 nSys = _nWeightSystematicsEnabled;
190 nSys = _nVariationSystematicsEnabled;
232 int _nVariationSystematics;
236 int _nWeightSystematics;
240 int _nFluxSystematics;
247 int _nVariationSystematicsEnabled;
251 int _nWeightSystematicsEnabled;
255 int _nFluxSystematicsEnabled;
bool UndoVariationSystematics(AnaEventC &event)
Undo the variation systematic (Undo the variation, that is, go back to the previous values of modifie...
TRandom3 _RandomGenerator
A random generator that can be used to generate throws.
TMatrixT< double > * GetCovarianceMatrix() const
Get the covariance matrix.
void AddWeightSystematic(Int_t index, EventWeightBase *sys)
Register an SystematicBase as a weight systematic.
void DisableAllFluxSystematics()
Disable all fluxSystematics.
EventWeightBase * _weightSystematics[NMAXSYSTEMATICS]
The systematics that were registered as weightSystematics.
UInt_t GetNEnabledWeightSystematics()
Returns the number of enabled weight systematics.
void DisableAllVariationSystematics()
Disable all variationSystematics.
void DumpFluxSystematics()
Dump all fluxSystematics.
void DisableAllWeightSystematics()
Disable all weightSystematics.
void EnableAllSystematics()
Enable all Systematics.
UInt_t GetNVariationSystematics() const
Returns the number of VariationSystematics.
void ReplaceFluxSystematic(Int_t index, EventWeightBase *sys)
Replace one of the existing EventWeightBase.
EventVariationBase * _variationSystematics[NMAXSYSTEMATICS]
The systematics that were registered as variationSystematics.
EventVariationBase ** GetVariationSystematics(int &nSys)
Get the vector of variationSystematics.
const Int_t * GetEnabledWeightSystematics(int &nSys)
Returns the vector of indices for all enabled weight systematics.
void ReplaceVariationSystematic(Int_t index, EventVariationBase *sys)
Replace one of the existing EventVariationBase.
void EnableSystematic(Int_t index)
Enable the systematic registered with the given index.
Int_t GetPDFBin(int syst)
Gets the PDF bin for a systematic variation with a given with index.
void DumpVariationSystematics()
Dump all variationSystematics.
void AddFluxSystematic(Int_t index, EventWeightBase *sys)
Register an SystematicBase as a flux systematic.
Int_t _fluxSystematicsEnabled[NMAXSYSTEMATICS]
The weight systematics that are enabled.
Int_t _variationSystematicsEnabled[NMAXSYSTEMATICS]
The variation systematics that are enabled.
void ReplaceWeightSystematic(Int_t index, EventWeightBase *sys)
Replace one of the existing EventWeightBase.
Int_t GetSystematicVariationIndex(const std::string &name)
Get the index of a systematic registered with the given name.
SystematicCovariance * _covariance
The associated systematic covariance.
void DisableSystematic(Int_t index)
Disable the systematic registered with the given index.
void DumpSystematics()
Dump all systematics.
const Int_t * GetEnabledVariationSystematics(int &nSys)
Returns the vector of indices for all enabled variation systematics.
UInt_t GetNWeightSystematics() const
Returns the number of WeightSystematics.
Weight_h ApplyFluxSystematics(const ToyExperiment &toy, const AnaEventC &event, const ToyBoxB &ToyBox)
Apply all fluxSystematics. Returns the total event Weight.
Weight_h ApplyWeightSystematics(const ToyExperiment &toy, const AnaEventC &event, const ToyBoxB &ToyBox)
Aplpy all weightSystematics. Returns the total event normalization weight.
bool HasSystematics() const
Is there any systematic added ?
std::vector< SystematicBase * > _systematics
The systematics that were registered.
The maximum number of systematics that is supported.
Weight_h ApplyWeightSystematic(Int_t index, const ToyExperiment &toy, const AnaEventC &event, const ToyBoxB &ToyBox)
Apply weight Systematics with a given index. Returns the event normalization weight.
void ApplyVariationSystematics(const ToyExperiment &toy, AnaEventC &event)
Apply all variationSystematics.
void SetPDFBin(int syst, int bin)
Sets the PDF bin for a systematic variation with a given with index.
void ConstructCovarianceMatrix()
Make the covariance.
UInt_t GetNEnabledVariationSystematics()
Returns the number of enabled variation systematics.
std::vector< SystematicBase * > & GetSystematics()
Get the vector containing all systematics (contains NULL pointers)
bool HasSystematic(const std::string &name)
Check if a systematic already exists.
void DisableAllSystematics()
Disable all Systematics.
EventWeightBase ** GetWeightSystematics(int &nSys)
Get the vector of weightsSystematics.
void EnableAllFluxSystematics()
Enable all systematic fluxSystematics.
EventWeightBase ** GetFluxSystematics(int &nSys)
Get the vector of fluxSystematics.
void DumpWeightSystematics()
Dump all weightSystematics.
EventVariationBase * GetSystematicVariation(const std::string &name) const
Get the systematic registered with the given name.
Int_t _weightSystematicsEnabled[NMAXSYSTEMATICS]
The weight systematics that are enabled.
void DisableSystematics(const std::vector< Int_t > &systs)
Disable the systematics registered with the given indices.
void EnableSystematics(const std::vector< Int_t > &systs)
Enable the systematics registered with the given indices.
UInt_t GetNFluxSystematics() const
Returns the number of Flux Systematics.
EventWeightBase * _fluxSystematics[NMAXSYSTEMATICS]
The systematics that were registered as fluxSystematics.
void ReadSystematics(const std::string &file)
Read the systematics from a file.
void EnableAllWeightSystematics()
Enable all systematic weightSystematics.
void AddVariationSystematic(Int_t index, EventVariationBase *sys)
Register an EventVariationBase as a variation systematic.
void EnableAllVariationSystematics()
Enable all variationSystematics.