2 #include <Math/Functions.h> 13 std::vector<double> constr = cfg.
getParameter<std::vector<double> > (
"constraints");
19 std::vector<edm::ParameterSet> functionSets_ = cfg.
getParameter <std::vector<edm::ParameterSet> >(
"functions");
20 for(std::vector<edm::ParameterSet>::const_iterator iSet = functionSets_.begin(); iSet != functionSets_.end(); ++iSet){
21 if(iSet->exists(
"bin"))
bins_.push_back(iSet->getParameter<
std::string>(
"bin"));
22 else if(functionSets_.size()==1)
bins_.push_back(
"");
23 else throw cms::Exception(
"WrongConfig") <<
"Parameter 'bin' is needed if more than one PSet is specified\n";
39 for(
unsigned int i=0;
i<
bins_.size(); ++
i){
46 std::vector<pat::CandKinResolution::Scalar> covariances(3);
48 covariances[0] = ROOT::Math::Square(
Function(
funcEt_ [selectedBin]).
operator()(cand));
49 covariances[1] = ROOT::Math::Square(
Function(
funcEta_[selectedBin]).
operator()(cand));
50 covariances[2] = ROOT::Math::Square(
Function(
funcPhi_[selectedBin]).
operator()(cand));
53 else for(
int i=0;
i<3; ++
i){covariances[
i] = 0.;}
T getParameter(std::string const &) const
pat::CandKinResolution::Parametrization parametrization_
virtual ~StringResolutionProvider()
default destructor
StringObjectFunction< reco::Candidate > Function
short cut within the common namespace
virtual pat::CandKinResolution getResolution(const reco::Candidate &cand) const
get a CandKinResolution object from the service
std::vector< std::string > funcEt_
vectors for the resolution functions
parametrization
specify parametrization (see SWGuidePATKinematicResolutions for more details)
StringResolutionProvider(const edm::ParameterSet &cfg)
default constructor
std::vector< std::string > funcEta_
std::vector< pat::CandKinResolution::Scalar > constraints_
std::vector< std::string > bins_
a vector of strings for the binning
pat::CandKinResolution::Parametrization fromString(const std::string &name)
Convert a name into a parametrization code.
std::vector< std::string > funcPhi_