4 #include "Math/QuantFuncMathCore.h" 5 #include "Math/SpecFuncMathCore.h" 6 #include "Math/ProbFunc.h" 20 std::vector<edm::ParameterSet> lAlgos = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"puppiAlgos");
23 std::vector<double> tmprms;
24 std::vector<double> tmpmed;
26 for(
unsigned int i0 = 0; i0 < lAlgos.size(); i0++) {
27 int pAlgoId = lAlgos[i0].getParameter<
int > (
"algoId");
28 bool pCharged = lAlgos[i0].getParameter<
bool> (
"useCharged");
29 bool pWeight0 = lAlgos[i0].getParameter<
bool> (
"applyLowPUCorr");
30 int pComb = lAlgos[i0].getParameter<
int> (
"combOpt");
31 double pConeSize = lAlgos[i0].getParameter<
double>(
"cone");
32 double pRMSPtMin = lAlgos[i0].getParameter<
double>(
"rmsPtMin");
33 double pRMSSF = lAlgos[i0].getParameter<
double>(
"rmsScaleFactor");
45 fRMS .push_back(pRMS);
47 fMean .push_back(pMean);
52 for (
unsigned int j0 = 0; j0 <
fEtaMin.size(); j0++){
53 tmprms.push_back(pRMS);
54 tmpmed.push_back(pMed);
73 for(
unsigned int i0 = 0; i0 <
fNAlgos; i0++) {
90 if(iParticle.pt() <
fRMSPtMin[iAlgo])
return;
96 if ( puppi_register == std::numeric_limits<int>::lowest() ) {
97 throw cms::Exception(
"PuppiRegisterNotSet") <<
"The puppi register is not set. This must be set before use.\n";
111 fPups.push_back(iVal);
127 if(
fNCount[iAlgo] == 0)
return;
131 for(
unsigned int i0 = 0; i0 < iAlgo; i0++) lNBefore +=
fNCount[i0];
136 for(
int i0 = lNBefore; i0 < lNBefore+
fNCount[iAlgo]; i0++) {
137 if(
fPups[i0] == 0) lNum0 = i0-lNBefore;
141 int lNHalfway = lNBefore + lNum0 +
int(
double( fNCount[iAlgo]-lNum0 )*0.50);
146 for(
int i0 = lNBefore; i0 < lNBefore+fNCount[iAlgo]; i0++) {
148 if(
fPups[i0] == 0)
continue;
154 fMean[iAlgo]/=fNCount[iAlgo];
155 if(lNRMS > 0)
fRMS [iAlgo]/=lNRMS;
167 for(
unsigned int i0 = 0; i0 <
fPupsPV.size(); i0++)
if(
fPupsPV[i0] <= lMed ) lNPV++;
168 double lAdjust = double(lNPV)/double(lNPV+0.5*fNCount[iAlgo]);
170 fMedian[iAlgo] -=
sqrt(ROOT::Math::chisquared_quantile(lAdjust,1.)*
fRMS[iAlgo]);
171 fRMS[iAlgo] -=
sqrt(ROOT::Math::chisquared_quantile(lAdjust,1.)*
fRMS[iAlgo]);
178 for (
unsigned int j0 = 0; j0 <
fEtaMin.size(); j0++){
193 for(
unsigned int i0 = 0; i0 <
fNAlgos; i0++) {
194 if(
fNCount[i0] == 0)
return 1.;
195 if(
fCombId[i0] == 1 && i0 > 0) {
196 double pPVal = ROOT::Math::chisquared_cdf(lVal,lNDOF);
201 double pVal = iVals[i0];
208 if(i0 == 0 && iChi2 != 0) lNDOF++;
209 if(i0 == 0 && iChi2 != 0) lVal+=iChi2;
212 lPVal *= ROOT::Math::chisquared_cdf(lVal,lNDOF);
void add(const PuppiCandidate &iParticle, const double &iVal, const unsigned int iAlgo)
T getParameter(std::string const &) const
std::vector< double > fEtaMin
std::vector< bool > fAdjust
std::vector< std::vector< double > > fMedian_perEta
PuppiAlgo(edm::ParameterSet &iConfig)
double cur_NeutralPtSlope
std::vector< std::vector< double > > fRMS_perEta
std::vector< double > fConeSize
std::vector< double > fRMS
std::vector< double > fNeutralPtMin
Abs< T >::type abs(const T &t)
int puppi_register() const
std::vector< float > fPupsPV
double compute(std::vector< double > const &iVals, double iChi2) const
std::vector< float > fPups
std::vector< double > fMean
std::vector< int > fAlgoId
std::vector< double > fRMSPtMin
std::vector< int > fCombId
std::vector< double > fRMSScaleFactor
std::vector< double > fPtMin
std::vector< double > fRMSEtaSF
std::vector< double > fNeutralPtSlope
void computeMedRMS(const unsigned int &iAlgo, const double &iPVFrac)
std::vector< double > fMedEtaSF
std::vector< double > fEtaMax
void fixAlgoEtaBin(int i_eta)
std::vector< bool > fCharged
std::vector< int > fNCount
std::vector< double > fMedian