15 for (vInputTag::const_iterator
inputTag = srcType1Corrections.begin();
inputTag != srcType1Corrections.end(); ++
inputTag)
26 if ( cfg.
exists(
"type2Binning") )
28 typedef std::vector<edm::ParameterSet> vParameterSet;
29 vParameterSet cfgType2Binning = cfg.
getParameter<vParameterSet>(
"type2Binning");
30 for ( vParameterSet::const_iterator cfgType2BinningEntry = cfgType2Binning.begin();
31 cfgType2BinningEntry != cfgType2Binning.end(); ++cfgType2BinningEntry ) {
56 if (cfg.
exists(
"type2Binning"))
throw cms::Exception(
"Invalid Arg") <<
"Currently, applyType0Corrections and type2Binning cannot be used together!";
58 if (!(type2CorrFormula ==
"A"))
throw cms::Exception(
"Invalid Arg") <<
"type2CorrFormula must be \"A\" if applyType0Corrections!";
60 type0Cuncl_ = type2CorrParameter.
getParameter<
double>(
"A");
67 for ( std::vector<type2BinningEntryType*>::const_iterator it =
type2Binning_.begin();
100 metCorr.
mex += type1Correction->
mex;
101 metCorr.
mey += type1Correction->
mey;
114 for ( std::vector<type2BinningEntryType*>::const_iterator type2BinningEntry =
type2Binning_.begin();
115 type2BinningEntry !=
type2Binning_.end(); ++type2BinningEntry )
119 for (std::vector<
edm::EDGetTokenT<CorrMETData> >::const_iterator corrToken = (*type2BinningEntry)->corrTokens_.begin(); corrToken != (*type2BinningEntry)->corrTokens_.end(); ++corrToken)
121 evt.
getByToken(*corrToken, unclEnergySummand);
123 unclEnergySum.
mex += unclEnergySummand->
mex;
124 unclEnergySum.
mey += unclEnergySummand->
mey;
125 unclEnergySum.
sumet += unclEnergySummand->
sumet;
129 double unclEnergySumPt =
sqrt(unclEnergySum.
mex*unclEnergySum.
mex + unclEnergySum.
mey*unclEnergySum.
mey);
130 double unclEnergyScaleFactor = (*type2BinningEntry)->binCorrFormula_->Eval(unclEnergySumPt);
134 metCorr.
mex -= (unclEnergyScaleFactor - 1.)*unclEnergySum.
mex;
135 metCorr.
mey -= (unclEnergyScaleFactor - 1.)*unclEnergySum.
mey;
136 metCorr.
sumet += (unclEnergyScaleFactor - 1.)*unclEnergySum.
sumet;
T getParameter(std::string const &) const
CorrMETData compMETCorrection(edm::Event &, const edm::EventSetup &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
METCorrectionAlgorithm(const edm::ParameterSet &, edm::ConsumesCollector &&iConsumesCollector)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< edm::InputTag > vInputTag
~METCorrectionAlgorithm()
std::vector< edm::EDGetTokenT< CorrMETData > > chsSumTokens_
bool applyType0Corrections_
bool applyType2Corrections_
bool applyType1Corrections_
std::vector< type2BinningEntryType * > type2Binning_
std::vector< edm::EDGetTokenT< CorrMETData > > type1Tokens_