00001 #ifndef JETUNCERTAINTIES_UNCERTAINTYCOMPONENT_H
00002 #define JETUNCERTAINTIES_UNCERTAINTYCOMPONENT_H
00003
00004 #include "JetUncertainties/UncertaintyEnum.h"
00005 #include "JetUncertainties/UncertaintyHistogram.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 class TFile;
00016
00017 namespace jet
00018 {
00019
00020 class UncertaintyComponent : public asg::AsgMessaging
00021 {
00022 public:
00023
00024 UncertaintyComponent(const ComponentHelper& component, const size_t numHist = 1);
00025 UncertaintyComponent(const UncertaintyComponent& toCopy);
00026 virtual UncertaintyComponent* clone() const = 0;
00027 virtual ~UncertaintyComponent();
00028 virtual StatusCode initialize(TFile* histFile);
00029
00030
00031 virtual TString getName() const { return m_uncHistName; }
00032 virtual TString getValidName() const { return m_validHistName; }
00033 virtual CompScaleVar::TypeEnum getScaleVar() const { return m_scaleVar; }
00034
00035
00036 virtual bool isAlwaysZero() const;
00037
00038
00039 virtual bool getValidity(const xAOD::Jet& jet, const xAOD::EventInfo& eInfo) const;
00040 virtual double getUncertainty(const xAOD::Jet& jet, const xAOD::EventInfo& eInfo) const;
00041 virtual bool getValidUncertainty(double& unc, const xAOD::Jet& jet, const xAOD::EventInfo& eInfo) const;
00042
00043 protected:
00044
00045 bool m_isInit;
00046 const TString m_uncHistName;
00047 const TString m_validHistName;
00048 const CompScaleVar::TypeEnum m_scaleVar;
00049 const float m_energyScale;
00050 const bool m_interpolate;
00051 const int m_splitNumber;
00052
00053 int m_numExpectedHist;
00054 UncertaintyHistogram* m_uncHist;
00055 UncertaintyHistogram* m_validHist;
00056
00057
00058 virtual bool getValidityImpl(const xAOD::Jet& jet, const xAOD::EventInfo& eInfo) const = 0;
00059 virtual double getUncertaintyImpl(const xAOD::Jet& jet, const xAOD::EventInfo& eInfo) const = 0;
00060
00061
00062 virtual bool getValidBool(const double validity) const;
00063 virtual double getSplitFactor(const xAOD::Jet& jet) const;
00064 virtual double getMassOverPt(const xAOD::Jet& jet, const CompMassDef::TypeEnum massDef) const;
00065
00066 private:
00067 UncertaintyComponent(const std::string& name = "");
00068 };
00069
00070
00071 bool operator < (const UncertaintyComponent& componentA, const UncertaintyComponent& componentB);
00072 bool operator == (const UncertaintyComponent& componentA, const UncertaintyComponent& componentB);
00073
00074 }
00075
00076
00077 #endif