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
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 & other);
00032 EffiCollection & operator =(const EffiCollection & other);
00033
00035 EfficiencyScaleFactor* retrieveSF(const xAOD::Muon & mu, unsigned int RunNumber);
00036
00037
00038 std::string sysname();
00039
00040
00041 bool CheckConsistency();
00042
00043 virtual ~EffiCollection();
00044
00045 protected:
00046
00047 class CollectionContainer {
00048 public:
00049 CollectionContainer(const std::string &FileName, SystematicSet sys, CP::MuonEfficiencyType effType, bool isLowPt = false, bool hasPtDepSys = false);
00050 CollectionContainer & operator =(const CollectionContainer & other);
00051 CollectionContainer(const CollectionContainer & other);
00052 virtual ~CollectionContainer();
00053 EfficiencyScaleFactor* retrieve(unsigned int RunNumer);
00054 bool CheckConsistency();
00055 std::string sysname();
00056 protected:
00057 bool LoadPeriod(unsigned int RunNumber);
00058 typedef std::pair<unsigned int, unsigned int> RunRanges;
00059 std::map<RunRanges, EfficiencyScaleFactor*> m_SF;
00060 std::map<RunRanges, EfficiencyScaleFactor*>::const_iterator m_currentSF;
00061 };
00062 CollectionContainer* m_central_eff;
00063 CollectionContainer* m_calo_eff;
00064 CollectionContainer* m_forward_eff;
00065 CollectionContainer* m_lowpt_central_eff;
00066 CollectionContainer* m_lowpt_calo_eff;
00067 private:
00068 double m_lowpt_transition;
00069 CP::MuonEfficiencyType m_Type;
00070 };
00071 }
00072 #endif