00001 #ifndef JETUNCERTAINTIES_FLAVOURUNCERTAINTYCOMPONENT_H
00002 #define JETUNCERTAINTIES_FLAVOURUNCERTAINTYCOMPONENT_H
00003
00004 #include "JetUncertainties/UncertaintyComponent.h"
00005
00006 #include <vector>
00007
00008 namespace jet
00009 {
00010
00011 class FlavourUncertaintyComponent : public UncertaintyComponent
00012 {
00013 public:
00014
00015 FlavourUncertaintyComponent(const ComponentHelper& component,
00016 const TString jetType,
00017 const TString analysisRootFileName,
00018 const TString path
00019 );
00020 FlavourUncertaintyComponent(const FlavourUncertaintyComponent& toCopy);
00021 virtual FlavourUncertaintyComponent* clone() const;
00022 virtual ~FlavourUncertaintyComponent();
00023 virtual StatusCode initialize(TFile* histFile);
00024
00025
00026 virtual FlavourComp::TypeEnum getFlavourType() const { return m_flavourType; }
00027
00028 protected:
00029
00030
00031 virtual bool getValidityImpl(const xAOD::Jet& jet, const xAOD::EventInfo& eInfo) const;
00032 virtual double getUncertaintyImpl(const xAOD::Jet& jet, const xAOD::EventInfo& eInfo) const;
00033
00034 private:
00035
00036 FlavourUncertaintyComponent(const std::string& name = "");
00037
00038 enum FlavourRespType { FlavourResp_UNKNOWN, FlavourResp_GLUON, FlavourResp_QUARK };
00039
00040
00041 const FlavourComp::TypeEnum m_flavourType;
00042 const TString m_jetType;
00043 const TString m_analysisFileName;
00044 const TString m_path;
00045 const bool m_absEta;
00046 const TString m_secondUncName;
00047
00048 UncertaintyHistogram* m_secondUncHist;
00049 FlavourRespType m_respType;
00050 FlavourRespType m_secondRespType;
00051 SG::AuxElement::Accessor<char> m_BjetAccessor;
00052 SG::AuxElement::Accessor<int> m_NjetAccessor;
00053
00054
00055 std::vector<UncertaintyHistogram*> m_gluonFractionHists;
00056 std::vector<UncertaintyHistogram*> m_gluonFractionErrorHists;
00057
00058
00059 double getFlavourResponseUncertainty(const xAOD::Jet& jet, const xAOD::EventInfo& eInfo) const;
00060 double getFlavourCompositionUncertainty(const xAOD::Jet& jet, const xAOD::EventInfo& eInfo) const;
00061 double getBJESUncertainty(const xAOD::Jet& jet, const xAOD::EventInfo& eInfo) const;
00062 double getGluonFraction(const double pT, const double eta, const int nJets) const;
00063 double getGluonFractionError(const double pT, const double eta, const int nJets) const;
00064 double getGluonResponseDifference(const double pT, const double eta) const;
00065 double getGluonResponseBaseline(const double pT, const double eta) const;
00066 double getQuarkResponseBaseline(const double pT, const double eta) const;
00067
00068
00069 StatusCode readNjetsHistograms(std::vector<UncertaintyHistogram*>& hists, const std::vector<TString>& histKeys);
00070 StatusCode getNjetFromKey(const TString& key, int& nJets) const;
00071 StatusCode checkNjetsInput(int& nJets) const;
00072 bool isBjet(const xAOD::Jet& jet) const;
00073 };
00074
00075 }
00076
00077 #endif