|
|
Go to the documentation of this file. 1 #ifndef CovarianceMatrix_h
2 #define CovarianceMatrix_h
41 const std::vector<edm::ParameterSet>& lepResolutions,
42 const std::vector<edm::ParameterSet>& metResolutions,
91 if (
object.hasKinResolution()) {
96 TMatrixD* CovM = &CovM3;
99 CovM3(0, 0) =
pow(
object.resolEt(resolutionProvider), 2);
100 if (dynamic_cast<const reco::Jet*>(&
object))
102 if (dynamic_cast<const reco::MET*>(&
object))
103 CovM3(1, 1) =
pow(9999., 2);
105 CovM3(1, 1) =
pow(
object.resolEta(resolutionProvider), 2);
106 CovM3(2, 2) =
pow(
object.resolPhi(resolutionProvider), 2);
110 CovM3(0, 0) =
pow(
object.resolEt(resolutionProvider), 2);
111 if (dynamic_cast<const reco::Jet*>(&
object))
113 CovM3(1, 1) =
pow(
object.resolTheta(resolutionProvider), 2);
114 CovM3(2, 2) =
pow(
object.resolPhi(resolutionProvider), 2);
118 CovM4(0, 0) =
pow(1, 2);
119 CovM4(1, 1) =
pow(1, 2);
120 CovM4(2, 2) =
pow(1, 2);
121 CovM4(3, 3) =
pow(1, 2);
130 const TLorentzVector
p4(
object.
px(),
object.
py(),
object.pz(),
object.
energy());
139 if (dynamic_cast<const reco::Jet*>(&
object)) {
146 else if (dynamic_cast<const reco::Muon*>(&
object))
149 else if (dynamic_cast<const reco::GsfElectron*>(&
object))
152 else if (dynamic_cast<const reco::MET*>(&
object))
156 throw cms::Exception(
"UnsupportedObject") <<
"The object given is not supported!\n";
162 double etaDependentScaleFactor = 1.;
168 etaDependentScaleFactor = 1.;
175 return etaDependentScaleFactor;
const std::vector< double > jetEnergyResolutionScaleFactors_
scale factors for the jet energy resolution
std::vector< std::string > funcPhiUdsc_
std::vector< std::string > funcEtMet_
CovarianceMatrix()
default constructor
std::vector< std::string > binsLep_
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 > funcPhiLep_
Log< level::Warning, false > LogWarning
std::vector< std::string > funcPhiMet_
std::vector< std::string > funcEtaLep_
Templated PAT object container.
double getResolution(const TLorentzVector &object, const ObjectType objType, const std::string &whichResolution="")
get resolution for a given component of an object
std::vector< std::string > funcEtaMet_
std::vector< std::string > binsB_
const std::vector< double > jetEnergyResolutionEtaBinning_
double getEtaDependentScaleFactor(const pat::PATObject< T > &object)
get eta dependent smear factor for a PAT object
std::vector< std::string > funcEtUdsc_
vectors for the resolution functions
jetEnergyResolutionEtaBinning
jetEnergyResolutionScaleFactors
std::vector< std::string > funcEtB_
ObjectType getObjectType(const pat::PATObject< T > &object, const bool isBJet=false)
determine type for a given PAT object
std::vector< std::string > funcPhiB_
std::vector< std::string > binsMet_
Power< A, B >::type pow(const A &a, const B &b)
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 > binsUdsc_
vector of strings for the binning of the resolutions
Abs< T >::type abs(const T &t)
Param
supported parameterizations
std::vector< std::string > funcEtaUdsc_
std::vector< std::string > funcEtLep_
std::vector< std::string > funcEtaB_