1 #ifndef CovarianceMatrix_h 2 #define CovarianceMatrix_h 42 const std::vector<edm::ParameterSet>& lepResolutions,
43 const std::vector<edm::ParameterSet>& metResolutions,
92 if (
object.hasKinResolution()) {
97 TMatrixD* CovM = &CovM3;
100 CovM3(0, 0) =
pow(
object.resolEt(resolutionProvider), 2);
101 if constexpr (std::is_same_v<T, reco::Jet>)
103 else if constexpr (std::is_same_v<T, reco::MET>)
104 CovM3(1, 1) =
pow(9999., 2);
106 CovM3(1, 1) =
pow(
object.resolEta(resolutionProvider), 2);
107 CovM3(2, 2) =
pow(
object.resolPhi(resolutionProvider), 2);
111 CovM3(0, 0) =
pow(
object.resolEt(resolutionProvider), 2);
112 if constexpr (std::is_same_v<T, reco::Jet>)
114 CovM3(1, 1) =
pow(
object.resolTheta(resolutionProvider), 2);
115 CovM3(2, 2) =
pow(
object.resolPhi(resolutionProvider), 2);
119 CovM4(0, 0) =
pow(1, 2);
120 CovM4(1, 1) =
pow(1, 2);
121 CovM4(2, 2) =
pow(1, 2);
122 CovM4(3, 3) =
pow(1, 2);
131 const TLorentzVector p4(
object.
px(),
object.
py(),
object.pz(),
object.
energy());
140 if constexpr (std::is_same_v<T, reco::Jet>) {
147 else if constexpr (std::is_same_v<T, reco::Muon>)
150 else if constexpr (std::is_same_v<T, reco::GsfElectron>)
153 else if constexpr (std::is_same_v<T, reco::MET>)
157 throw cms::Exception(
"UnsupportedObject") <<
"The object given is not supported!\n";
163 double etaDependentScaleFactor = 1.;
169 etaDependentScaleFactor = 1.;
176 return etaDependentScaleFactor;
Param
supported parameterizations
std::vector< std::string > binsB_
const std::vector< double > jetEnergyResolutionEtaBinning_
std::vector< std::string > funcEtUdsc_
vectors for the resolution functions
std::vector< std::string > binsMet_
jetEnergyResolutionScaleFactors
TMatrixD setupMatrix(const pat::PATObject< T > &object, const TopKinFitter::Param param, const std::string &resolutionProvider="")
return covariance matrix for a PAT object
std::vector< std::string > funcEtB_
std::vector< std::string > binsUdsc_
vector of strings for the binning of the resolutions
std::vector< std::string > funcPhiB_
const std::vector< double > jetEnergyResolutionScaleFactors_
scale factors for the jet energy resolution
ObjectType getObjectType(const pat::PATObject< T > &object, const bool isBJet=false)
determine type for a given PAT object
std::vector< std::string > funcEtaB_
jetEnergyResolutionEtaBinning
Abs< T >::type abs(const T &t)
CovarianceMatrix()
default constructor
std::vector< std::string > funcPhiUdsc_
std::vector< std::string > funcPhiLep_
std::vector< std::string > funcEtaUdsc_
double getResolution(const pat::PATObject< T > &object, const std::string &whichResolution, const bool isBJet=false)
get resolution for a given PAT object
std::vector< std::string > funcEtLep_
std::vector< std::string > funcEtMet_
std::vector< std::string > funcEtaLep_
std::vector< std::string > binsLep_
Templated PAT object container.
Log< level::Warning, false > LogWarning
std::vector< std::string > funcEtaMet_
std::vector< std::string > funcPhiMet_
double getResolution(const TLorentzVector &object, const ObjectType objType, const std::string &whichResolution="")
get resolution for a given component of an object
double getEtaDependentScaleFactor(const pat::PATObject< T > &object)
get eta dependent smear factor for a PAT object