13 vector<float> phibins;
16 vector<float> etabins;
17 if (etaRegion==Central) {
18 for (
int i=0;
i<8;++
i) etabins.push_back(-2.1+0.6*
i);
19 }
else if (etaRegion==Forward) {
20 for (
int i=0;
i<10;++
i) {
21 if (
i<5) etabins.push_back(-5.1+0.6*
i);
22 else etabins.push_back(2.7+0.6*(
i-5));
24 }
else if (etaRegion==
All) {
25 for (
int i=0;
i<18;++
i) etabins.push_back(-5.1+0.6*
i);
27 return fixedGridRho(etabins,phibins);
32 float etadist = etabins[1]-etabins[0];
33 float phidist = phibins[1]-phibins[0];
34 float etahalfdist = (etabins[1]-etabins[0])/2.;
35 float phihalfdist = (phibins[1]-phibins[0])/2.;
36 vector<float> sumPFNallSMDQ;
37 sumPFNallSMDQ.reserve(etabins.size()*phibins.size());
38 for (
unsigned int ieta=0;ieta<etabins.size();++ieta) {
39 for (
unsigned int iphi=0;iphi<phibins.size();++iphi) {
40 float pfniso_ieta_iphi = 0;
42 if (fabs(etabins[ieta]-pf_it->eta())>etahalfdist)
continue;
43 if (fabs(
reco::deltaPhi(phibins[iphi],pf_it->phi()))>phihalfdist)
continue;
44 pfniso_ieta_iphi+=pf_it->pt();
46 sumPFNallSMDQ.push_back(pfniso_ieta_iphi);
50 sort(sumPFNallSMDQ.begin(),sumPFNallSMDQ.end());
51 if (sumPFNallSMDQ.size()%2) evt_smdq = sumPFNallSMDQ[(sumPFNallSMDQ.size()-1)/2];
52 else evt_smdq = (sumPFNallSMDQ[sumPFNallSMDQ.size()/2]+sumPFNallSMDQ[(sumPFNallSMDQ.size()-2)/2])/2.;
53 return evt_smdq/(etadist*phidist);
constexpr double deltaPhi(double phi1, double phi2)
float fixedGridRho(EtaRegion etaRegion=Central)