ATLAS Offline Software
APWeightSum.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
16 
18 #ifndef APWeightSum_h
19 #define APWeightSum_h
20 
21 #include "TNamed.h"
22 #include "APEvtWeight.h"
23 #include <vector>
24 
25 class APWeightEntry;
26 class APReweightBase;
27 class THnSparse;
28 
29 class APWeightSum : public TNamed {
30 
31 public:
32  APWeightSum();
33  virtual ~APWeightSum();
35  void FinishEvt(double ext_weight = 1.0);
36  void AddEvt(APEvtWeight* evt_weight, double ext_weight = 1.0);
38  double GetSumW() const;
39  double GetSumW2() const;
40  double GetSumWExternal() const;
41  double GetStdDev();
42  double GetVariance();
43  double GetVarianceNoCorr();
44  double GetVarianceFullCorr();
45  double GetSysUncert() const;
47  unsigned long GetKUnweighted() const;
49  THnSparse* GetUncertHistogram( APReweightBase* weighter );
50  std::vector<THnSparse*> GetAllUncertHistograms();
52  ClassDef(APWeightSum,1)
53 
54 protected:
55  void Compute();
57  std::vector< APWeightEntry* > m_current_evt_weights;
58  std::vector< THnSparse* > m_linear_uncert;
59  unsigned long int m_k_evt_orig;
60  double m_k_evt_weight;
61  double m_k_evt_weight2;
63  double m_variance;
66  double m_variance_sys;
68 };
69 
70 #endif
APEvtWeight.h
APWeightSum::m_linear_uncert
std::vector< THnSparse * > m_linear_uncert
Holds all histograms for uncertainties.
Definition: APWeightSum.h:58
APWeightEntry
Definition: APWeightEntry.h:25
APWeightSum::GetUncertHistogram
THnSparse * GetUncertHistogram(APReweightBase *weighter)
Returns THnSparse holding the uncertainties for given APReweightBase instance.
Definition: APWeightSum.cxx:471
APWeightSum::GetSumW2
double GetSumW2() const
Returns sum of (weights^2).
Definition: APWeightSum.cxx:43
APWeightSum::FinishEvt
void FinishEvt(double ext_weight=1.0)
Finishes the current event and calculates the event weight.
Definition: APWeightSum.cxx:78
APWeightSum::GetSysUncert
double GetSysUncert() const
Returns the systematic uncertainty (from systematics assigned to weights).
Definition: APWeightSum.cxx:70
APWeightSum::~APWeightSum
virtual ~APWeightSum()
Default destructor.
Definition: APWeightSum.cxx:30
APWeightSum::GetVarianceFullCorr
double GetVarianceFullCorr()
Returns the variance, assuming full correlation amongst objects.
Definition: APWeightSum.cxx:65
APWeightSum::m_k_evt_orig
unsigned long int m_k_evt_orig
Holds the original amount of unweighted counts ("sum of 1's").
Definition: APWeightSum.h:59
APWeightSum::m_variance_fullcorr
double m_variance_fullcorr
Holds the variance, assuming full correlation amongst objects.
Definition: APWeightSum.h:65
APReweightBase
Definition: APReweightBase.h:23
APWeightSum::m_k_evt_weight
double m_k_evt_weight
Holds the sum of weights.
Definition: APWeightSum.h:60
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
APEvtWeight
Definition: APEvtWeight.h:26
APWeightSum::GetSumWExternal
double GetSumWExternal() const
Returns the sum of weights without taking into account the trigger weighting (external weights only) ...
Definition: APWeightSum.cxx:47
APWeightSum::m_variance
double m_variance
Holds the variance.
Definition: APWeightSum.h:63
APWeightSum::GetVariance
double GetVariance()
Returns the variance.
Definition: APWeightSum.cxx:56
APWeightSum::GetSumW
double GetSumW() const
Returns the sum of weights.
Definition: APWeightSum.cxx:39
APWeightSum::GetKUnweighted
unsigned long GetKUnweighted() const
Returns the unweighted sum of entries.
Definition: APWeightSum.cxx:74
APWeightSum::m_variance_sys
double m_variance_sys
Holds the systematic variance (from systematics assigned to weights).
Definition: APWeightSum.h:66
APWeightSum::m_current_evt_weights
ClassDef(APWeightSum, 1) protected std::vector< APWeightEntry * > m_current_evt_weights
< Calculates the final uncertainties including correlations.
Definition: APWeightSum.h:52
APWeightSum::APWeightSum
APWeightSum()
Default constructor.
Definition: APWeightSum.cxx:17
APWeightSum::m_k_evt_weight2
double m_k_evt_weight2
Holds the sum of squared weights.
Definition: APWeightSum.h:61
APWeightSum::m_isComputed
bool m_isComputed
Definition: APWeightSum.h:67
APWeightSum::GetAllUncertHistograms
std::vector< THnSparse * > GetAllUncertHistograms()
Returns vector of THnSparses holding the uncertainties for all APReweight IDs.
Definition: APWeightSum.cxx:480
APWeightSum::m_variance_nocorr
double m_variance_nocorr
Holds the variance, assuming no correlations.
Definition: APWeightSum.h:64
APWeightSum::GetStdDev
double GetStdDev()
Returns the standard deviation.
Definition: APWeightSum.cxx:51
APWeightSum::GetVarianceNoCorr
double GetVarianceNoCorr()
Returns the variance, assuming no correlations.
Definition: APWeightSum.cxx:61
APWeightSum::AddWeightToEvt
void AddWeightToEvt(APWeightEntry *weight)
Adds a weight to the sum of weights.
Definition: APWeightSum.cxx:35
APWeightSum
Definition: APWeightSum.h:29
APWeightSum::m_k_evt_weight_external
double m_k_evt_weight_external
Holds the sum of external weights (no trigger weighting).
Definition: APWeightSum.h:62
APWeightSum::AddEvt
void AddEvt(APEvtWeight *evt_weight, double ext_weight=1.0)
Adds an event with an externally calculated EvtWeight object.
Definition: APWeightSum.cxx:100