00001 #ifndef JETUNCERTAINTIES_UNCERTAINTYGROUP_H
00002 #define JETUNCERTAINTIES_UNCERTAINTYGROUP_H
00003
00004 #include "JetUncertainties/UncertaintyEnum.h"
00005 #include "JetUncertainties/UncertaintyComponent.h"
00006 #include "JetUncertainties/ConfigHelper.h"
00007
00008 #include "xAODJet/Jet.h"
00009 #include "xAODEventInfo/EventInfo.h"
00010
00011 #include "AsgTools/AsgMessaging.h"
00012
00013 #include "TString.h"
00014
00015 #include <set>
00016 #include <map>
00017
00018 class TFile;
00019
00020 namespace jet
00021 {
00022
00023 class UncertaintyGroup : public asg::AsgMessaging
00024 {
00025 public:
00026
00027 UncertaintyGroup(const GroupHelper& group);
00028 UncertaintyGroup(const UncertaintyGroup& toCopy);
00029
00030 virtual ~UncertaintyGroup();
00031 virtual StatusCode addComponent(UncertaintyComponent* component);
00032 virtual StatusCode addSubgroup(UncertaintyGroup* subgroup);
00033 virtual StatusCode initialize(TFile* histFile);
00034
00035
00036 virtual TString getName() const { return m_name; }
00037 virtual TString getDesc() const { return m_desc; }
00038 virtual int getGroupNum() const { return m_groupNum; }
00039 virtual int getSubgroupNum() const { return m_subgroupNum; }
00040 virtual CompCategory::TypeEnum getCategory() const { return m_category; }
00041 virtual CompCorrelation::TypeEnum getCorrType() const { return m_corrType; }
00042 virtual bool getIsReducible() const { return m_isReducible; }
00043 virtual size_t getNumRawComps() const { return m_subgroups.size(); }
00044 virtual size_t getNumSubgroups() const { return m_subgroups.size(); }
00045 virtual size_t getNumComponents() const;
00046
00047 virtual std::vector<UncertaintyComponent*> getComponents() const { return m_components; }
00048 virtual std::vector<UncertaintyGroup*> getSubgroups() const { return m_subgroups; }
00049
00050
00051 virtual std::set<CompScaleVar::TypeEnum> getScaleVars() const;
00052
00053
00054 virtual bool isAlwaysZero() const;
00055
00056
00057 virtual bool getValidity(const xAOD::Jet& jet, const xAOD::EventInfo& eInfo, const CompScaleVar::TypeEnum scaleVar) const;
00058 virtual double getUncertainty(const xAOD::Jet& jet, const xAOD::EventInfo& eInfo, const CompScaleVar::TypeEnum scaleVar) const;
00059 virtual bool getValidUncertainty(double& unc, const xAOD::Jet& jet, const xAOD::EventInfo& eInfo, const CompScaleVar::TypeEnum scaleVar) const;
00060
00061
00062 protected:
00063
00064 bool m_isInit;
00065 const TString m_name;
00066 const TString m_desc;
00067 const int m_groupNum;
00068 const int m_subgroupNum;
00069 const CompCategory::TypeEnum m_category;
00070 const CompCorrelation::TypeEnum m_corrType;
00071 const bool m_isReducible;
00072 std::vector<UncertaintyComponent*> m_components;
00073 std::vector<UncertaintyGroup*> m_subgroups;
00074 std::map<CompScaleVar::TypeEnum,std::vector<UncertaintyComponent*>*> m_compScaleMap;
00075
00076 private:
00077 UncertaintyGroup(const std::string& name = "");
00078
00079 };
00080
00081
00082 bool operator < (const UncertaintyGroup& groupA, const UncertaintyGroup& groupB);
00083 bool operator == (const UncertaintyGroup& groupA, const UncertaintyGroup& groupB);
00084
00085 }
00086
00087
00088 #endif