00001
00002
00012
00013
00014 #ifndef APEvtWeight_h
00015 #define APEvtWeight_h
00016
00017 #include "TNamed.h"
00018 #include <vector>
00019
00020 class APWeightEntry;
00021
00022 class APEvtWeight : public TNamed {
00023
00024 public:
00025 enum ObjType {kMuon, kTau, kElectron, kJet, kMuonMO, kTauMO, kElectronMO, kJetMO, kDiMuon, kDiTau, kDiElectron, kDiJet, kANDed, kORed, kMOORed, kMOANDed};
00027 APEvtWeight(ObjType type);
00028 virtual ~APEvtWeight();
00029 void AddWeightToEvt(APWeightEntry* weight);
00031 double GetWeight();
00032 double GetStdDev();
00033 double GetVariance();
00034 double GetSysUncert();
00035 double GetSysVariance();
00037 std::vector< APWeightEntry* > GetWeightObjects(ObjType type);
00038 unsigned long NEntries();
00039 ObjType GetType();
00041 const friend APEvtWeight operator&&(const APEvtWeight& a_in, const APEvtWeight& b_in);
00042 const friend APEvtWeight operator||(const APEvtWeight& a_in, const APEvtWeight& b_in);
00043 const friend APEvtWeight operator!(const APEvtWeight& a_in);
00045
00046
00047 protected:
00048 void Compute();
00049 std::vector< std::vector< APWeightEntry* > > _current_evt_weights;
00050 unsigned long int _n_entries;
00051 double _k_evt_weight;
00052 double _variance;
00053 double _variance_sys;
00054 bool _isComputed;
00055 ObjType _type;
00056 };
00057
00058 #endif