#ifndef REWEIGHTFACTORSMANAGER_HPP #define REWEIGHTFACTORSMANAGER_HPP #include "TH1.h" #include "TH2.h" #include "TLorentzVector.h" #include class ReweightFactorsManager { public: /// Singleton. If no instance exists, create one. Get pointer to instance. static ReweightFactorsManager* get_instance(); /// Just check if an instance already exists. static bool check_instance() { return _instance !=0 ; } /// initialize void initialize(); /// get muon trigger efficiency for data and MC void getMuonTrigEff(bool isData, bool useGeV, double pT, double eta, double phi, double& eff, double& err); /// get electron trigger efficiency for data and MC void getElecTrigEff(bool isData, bool useGeV, double pT, double eta, double phi, double& eff, double& err); /// get event trigger effciency for events with various configurations, /// can have several electrons, muons or electrons/muons (such as emumu, eemu etc) double getEventTrigSF(bool useGeV, std::vector electrons, std::vector muons); private: /// Pointer to singleton static ReweightFactorsManager* _instance; /// This is a singleton, so hide constructor. It gets invoked by calling /// get_instance. Constructor does nothing. ReweightFactorsManager(); /// Destructor ~ReweightFactorsManager(); /// histograms for muon TH2D *_MuonTrigEff_EtaPhi_Barrel_Data; TH2D *_MuonTrigEff_EtaPhi_Barrel_MC; TH1D *_MuonTrigEff_Pt_Endcap_Data; TH1D *_MuonTrigEff_Pt_Endcap_MC; /// histograms for electron TH1D *_ElecTrigEff_Eta_MC; }; #endif