00001 00002 00012 00013 00014 #ifndef APWeightSum_h 00015 #define APWeightSum_h 00016 00017 #include "TNamed.h" 00018 #include "APEvtWeight.h" 00019 #include <vector> 00020 00021 class APWeightEntry; 00022 class APReweightBase; 00023 class THnSparse; 00024 00025 class APWeightSum : public TNamed { 00026 00027 public: 00028 APWeightSum(); 00029 virtual ~APWeightSum(); 00030 void AddWeightToEvt(APWeightEntry* weight); 00031 void FinishEvt(double ext_weight = 1.0); 00032 void AddEvt(APEvtWeight* evt_weight, double ext_weight = 1.0); 00034 double GetSumW() const; 00035 double GetSumW2() const; 00036 double GetSumWExternal() const; 00037 double GetStdDev(); 00038 double GetVariance(); 00039 double GetVarianceNoCorr(); 00040 double GetVarianceFullCorr(); 00041 double GetSysUncert() const; 00043 unsigned long GetKUnweighted() const; 00045 THnSparse* GetUncertHistogram( APReweightBase* weighter ); 00046 std::vector<THnSparse*> GetAllUncertHistograms(); 00048 //ClassDef(APWeightSum,1) 00049 00050 protected: 00051 void Compute(); 00053 std::vector< APWeightEntry* > _current_evt_weights; 00054 std::vector< THnSparse* > _linear_uncert; 00055 unsigned long int _k_evt_orig; 00056 double _k_evt_weight; 00057 double _k_evt_weight2; 00058 double _k_evt_weight_external; 00059 double _variance; 00060 double _variance_nocorr; 00061 double _variance_fullcorr; 00062 double _variance_sys; 00063 bool _isComputed; 00064 }; 00065 00066 #endif