|
|
Go to the documentation of this file.
15 if (iSet->exists(
"bin"))
20 throw cms::Exception(
"Configuration") <<
"Parameter 'bin' is needed if more than one PSet is specified!\n";
26 for (std::vector<edm::ParameterSet>::const_iterator iSet =
bResolutions.begin(); iSet !=
bResolutions.end(); ++iSet) {
27 if (iSet->exists(
"bin"))
32 throw cms::Exception(
"Configuration") <<
"Parameter 'bin' is needed if more than one PSet is specified!\n";
42 const std::vector<edm::ParameterSet>& lepResolutions,
43 const std::vector<edm::ParameterSet>& metResolutions,
49 throw cms::Exception(
"Configuration") <<
"The number of scale factors does not fit to the number of eta bins!\n";
52 throw cms::Exception(
"Configuration") <<
"eta binning in absolut values required!\n";
56 if (iSet->exists(
"bin"))
61 throw cms::Exception(
"Configuration") <<
"Parameter 'bin' is needed if more than one PSet is specified!\n";
67 for (std::vector<edm::ParameterSet>::const_iterator iSet =
bResolutions.begin(); iSet !=
bResolutions.end(); ++iSet) {
68 if (iSet->exists(
"bin"))
73 throw cms::Exception(
"Configuration") <<
"Parameter 'bin' is needed if more than one PSet is specified!\n";
79 for (std::vector<edm::ParameterSet>::const_iterator iSet = lepResolutions.begin(); iSet != lepResolutions.end();
81 if (iSet->exists(
"bin"))
83 else if (lepResolutions.size() == 1)
86 throw cms::Exception(
"Configuration") <<
"Parameter 'bin' is needed if more than one PSet is specified!\n";
92 for (std::vector<edm::ParameterSet>::const_iterator iSet = metResolutions.begin(); iSet != metResolutions.end();
94 if (iSet->exists(
"bin"))
96 else if (metResolutions.size() == 1)
99 throw cms::Exception(
"Configuration") <<
"Parameter 'bin' is needed if more than one PSet is specified!\n";
110 std::vector<std::string>*bins_, *funcEt_, *funcEta_, *funcPhi_;
144 throw cms::Exception(
"UnsupportedObject") <<
"The object given is not supported!\n";
147 int selectedBin = -1;
149 for (
unsigned int i = 0;
i < bins_->size(); ++
i) {
153 if (select_(candidate)) {
159 if (selectedBin >= 0) {
160 if (whichResolution ==
"et")
162 else if (whichResolution ==
"eta")
164 else if (whichResolution ==
"phi")
167 throw cms::Exception(
"ProgrammingError") <<
"Only 'et', 'eta' and 'phi' resolutions supported!\n";
175 TMatrixD CovM3(3, 3);
177 TMatrixD CovM4(4, 4);
179 const double pt =
object.Pt();
180 const double eta =
object.Eta();
254 CovM3(0, 0) =
pow(muonRes.
a(
pt,
eta), 2);
255 CovM3(1, 1) =
pow(muonRes.
b(
pt,
eta), 2);
256 CovM3(2, 2) =
pow(muonRes.
c(
pt,
eta), 2);
282 CovM3(0, 0) =
pow(elecRes.
a(
pt,
eta), 2);
283 CovM3(1, 1) =
pow(elecRes.
b(
pt,
eta), 2);
284 CovM3(2, 2) =
pow(elecRes.
c(
pt,
eta), 2);
310 CovM3(0, 0) =
pow(metRes.
a(
pt), 2);
311 CovM3(1, 1) =
pow(metRes.
b(
pt), 2);
312 CovM3(2, 2) =
pow(metRes.
c(
pt), 2);
316 CovM3(0, 0) =
pow(metRes.
et(
pt), 2);
317 CovM3(1, 1) =
pow(9999., 2);
318 CovM3(2, 2) =
pow(metRes.
phi(
pt), 2);
326 CovM3(0, 0) =
pow(metRes.
et(
pt), 2);
327 CovM3(1, 1) =
pow(9999., 2);
328 CovM3(2, 2) =
pow(metRes.
phi(
pt), 2);
334 cms::Exception(
"Logic") <<
"Something went wrong while trying to setup a covariance matrix!\n";
339 double etaDependentScaleFactor = 1.;
345 etaDependentScaleFactor = 1.;
352 return etaDependentScaleFactor;
double et(double pt, double eta)
const std::vector< double > jetEnergyResolutionScaleFactors_
scale factors for the jet energy resolution
std::vector< std::string > funcPhiUdsc_
double c(double pt, double eta)
double c(double pt, double eta, Flavor flav)
std::vector< std::string > funcEtMet_
CovarianceMatrix()
default constructor
std::vector< std::string > binsLep_
std::vector< std::string > funcPhiLep_
double b(double pt, double eta)
double phi(double pt, double eta, Flavor flav)
Log< level::Warning, false > LogWarning
double phi(double pt, double eta)
double theta(double pt, double eta)
double eta(double pt, double eta)
std::vector< std::string > funcPhiMet_
std::vector< std::string > funcEtaLep_
double getResolution(const TLorentzVector &object, const ObjectType objType, const std::string &whichResolution="")
get resolution for a given component of an object
double et(double pt, double eta)
double d(double pt, double eta, Flavor flav)
std::vector< std::string > funcEtaMet_
std::vector< std::string > binsB_
const std::vector< double > jetEnergyResolutionEtaBinning_
double b(double pt, double eta, Flavor flav)
double theta(double pt, double eta, Flavor flav)
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_
double a(double pt, double eta)
double eta(double pt, double eta)
double theta(double pt, double eta)
std::vector< std::string > funcPhiB_
double eta(double pt, double eta, Flavor flav)
std::vector< std::string > binsMet_
double phi(double pt, double eta)
double b(double pt, double eta)
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)
double a(double pt, double eta)
double a(double pt, double eta, Flavor flav)
Param
supported parameterizations
double et(double pt, double eta, Flavor flav)
double c(double pt, double eta)
std::vector< std::string > funcEtaUdsc_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::vector< std::string > funcEtLep_
std::vector< std::string > funcEtaB_