00001
00002
00003
00004
00005
00006
00007
00008 #ifndef EFFICOLLECTION_H_
00009 #define EFFICOLLECTION_H_
00010
00011
00014
00015 #include <MuonEfficiencyCorrections/EfficiencyScaleFactor.h>
00016 #include <MuonEfficiencyCorrections/MuonEfficiencyType.h>
00017
00018 #include "PATInterfaces/ISystematicsTool.h"
00019 #include "xAODMuon/Muon.h"
00020 #include <boost/unordered_map.hpp>
00021 #include <map>
00022 #include <string>
00023 #include <iostream>
00024
00025 namespace CP {
00026 class EffiCollection {
00027 public:
00028 EffiCollection();
00029 EffiCollection(const std::string &file_central, const std::string &file_calo, const std::string &file_forward, const std::string &file_lowpt_central, const std::string &file_lowpt_caloo, SystematicSet sys, CP::MuonEfficiencyType effType, double lowPtTransition = 20000.);
00030
00031 EffiCollection(const EffiCollection* Nominal, const std::string &file_central, const std::string &file_calo, const std::string &file_forward, const std::string &file_lowpt_central, const std::string &file_lowpt_caloo, SystematicSet sys, CP::MuonEfficiencyType effType, double lowPtTransition = 20000.);
00032
00033 EffiCollection(const EffiCollection & other);
00034 EffiCollection & operator =(const EffiCollection & other);
00035
00037 EfficiencyScaleFactor* retrieveSF(const xAOD::Muon & mu, unsigned int RunNumber);
00038 enum CollectionType {
00039 Central, Calo, Forward, CentralLowPt, CaloLowPt
00040 };
00041
00042
00043 std::string sysname() const;
00044
00045
00046 bool CheckConsistency();
00047
00048 virtual ~EffiCollection();
00049 unsigned int nBins() const;
00050 bool SeySystematicBin(unsigned int Bin);
00051 protected:
00052
00053 class CollectionContainer {
00054 public:
00055 CollectionContainer(const std::string &FileName, SystematicSet sys, CP::MuonEfficiencyType effType, EffiCollection::CollectionType FileType, bool isLowPt = false, bool hasPtDepSys = false);
00056 CollectionContainer(CollectionContainer* Nominal, const std::string &FileName, SystematicSet sys, CP::MuonEfficiencyType effType, EffiCollection::CollectionType FileType, bool isLowPt = false, bool hasPtDepSys = false);
00057
00058 CollectionContainer & operator =(const CollectionContainer & other);
00059 CollectionContainer(const CollectionContainer & other);
00060 virtual ~CollectionContainer();
00061 EfficiencyScaleFactor* retrieve(unsigned int RunNumer);
00062 bool CheckConsistency();
00063 std::string sysname();
00064 bool SeySystematicBin(unsigned int Bin);
00065 protected:
00066 bool LoadPeriod(unsigned int RunNumber);
00067 typedef std::pair<unsigned int, unsigned int> RunRanges;
00068 std::map<RunRanges, EfficiencyScaleFactor*> m_SF;
00069 std::map<RunRanges, EfficiencyScaleFactor*>::const_iterator m_currentSF;
00070 EffiCollection::CollectionType m_FileType;
00071 };
00072 EffiCollection::CollectionContainer* retrieveContainer(CollectionType Type) const;
00073
00074 private:
00075
00076 CollectionContainer* m_central_eff;
00077 CollectionContainer* m_calo_eff;
00078 CollectionContainer* m_forward_eff;
00079 CollectionContainer* m_lowpt_central_eff;
00080 CollectionContainer* m_lowpt_calo_eff;
00081
00082 double m_lowpt_transition;
00083 CP::MuonEfficiencyType m_sfType;
00084 };
00085 }
00086 #endif