|
|
Go to the documentation of this file.
14 if (iSet->exists(
"bin"))
19 throw cms::Exception(
"Configuration") <<
"Parameter 'bin' is needed if more than one PSet is specified!\n";
25 for (std::vector<edm::ParameterSet>::const_iterator iSet =
bResolutions.begin(); iSet !=
bResolutions.end(); ++iSet) {
26 if (iSet->exists(
"bin"))
31 throw cms::Exception(
"Configuration") <<
"Parameter 'bin' is needed if more than one PSet is specified!\n";
41 const std::vector<edm::ParameterSet>& lepResolutions,
42 const std::vector<edm::ParameterSet>& metResolutions,
48 throw cms::Exception(
"Configuration") <<
"The number of scale factors does not fit to the number of eta bins!\n";
51 throw cms::Exception(
"Configuration") <<
"eta binning in absolut values required!\n";
55 if (iSet->exists(
"bin"))
60 throw cms::Exception(
"Configuration") <<
"Parameter 'bin' is needed if more than one PSet is specified!\n";
66 for (std::vector<edm::ParameterSet>::const_iterator iSet =
bResolutions.begin(); iSet !=
bResolutions.end(); ++iSet) {
67 if (iSet->exists(
"bin"))
72 throw cms::Exception(
"Configuration") <<
"Parameter 'bin' is needed if more than one PSet is specified!\n";
78 for (std::vector<edm::ParameterSet>::const_iterator iSet = lepResolutions.begin(); iSet != lepResolutions.end();
80 if (iSet->exists(
"bin"))
82 else if (lepResolutions.size() == 1)
85 throw cms::Exception(
"Configuration") <<
"Parameter 'bin' is needed if more than one PSet is specified!\n";
91 for (std::vector<edm::ParameterSet>::const_iterator iSet = metResolutions.begin(); iSet != metResolutions.end();
93 if (iSet->exists(
"bin"))
95 else if (metResolutions.size() == 1)
98 throw cms::Exception(
"Configuration") <<
"Parameter 'bin' is needed if more than one PSet is specified!\n";
109 std::vector<std::string>*bins_, *funcEt_, *funcEta_, *funcPhi_;
143 throw cms::Exception(
"UnsupportedObject") <<
"The object given is not supported!\n";
146 int selectedBin = -1;
148 for (
unsigned int i = 0;
i < bins_->size(); ++
i) {
152 if (select_(candidate)) {
158 if (selectedBin >= 0) {
159 if (whichResolution ==
"et")
161 else if (whichResolution ==
"eta")
163 else if (whichResolution ==
"phi")
166 throw cms::Exception(
"ProgrammingError") <<
"Only 'et', 'eta' and 'phi' resolutions supported!\n";
174 TMatrixD CovM3(3, 3);
176 TMatrixD CovM4(4, 4);
178 const double pt =
object.Pt();
179 const double eta =
object.Eta();
253 CovM3(0, 0) =
pow(muonRes.
a(
pt,
eta), 2);
254 CovM3(1, 1) =
pow(muonRes.
b(
pt,
eta), 2);
255 CovM3(2, 2) =
pow(muonRes.
c(
pt,
eta), 2);
281 CovM3(0, 0) =
pow(elecRes.
a(
pt,
eta), 2);
282 CovM3(1, 1) =
pow(elecRes.
b(
pt,
eta), 2);
283 CovM3(2, 2) =
pow(elecRes.
c(
pt,
eta), 2);
309 CovM3(0, 0) =
pow(metRes.
a(
pt), 2);
310 CovM3(1, 1) =
pow(metRes.
b(
pt), 2);
311 CovM3(2, 2) =
pow(metRes.
c(
pt), 2);
315 CovM3(0, 0) =
pow(metRes.
et(
pt), 2);
316 CovM3(1, 1) =
pow(9999., 2);
317 CovM3(2, 2) =
pow(metRes.
phi(
pt), 2);
325 CovM3(0, 0) =
pow(metRes.
et(
pt), 2);
326 CovM3(1, 1) =
pow(9999., 2);
327 CovM3(2, 2) =
pow(metRes.
phi(
pt), 2);
333 cms::Exception(
"Logic") <<
"Something went wrong while trying to setup a covariance matrix!\n";
338 double etaDependentScaleFactor = 1.;
344 etaDependentScaleFactor = 1.;
351 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)
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_