CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

FixedGridEnergyDensity Class Reference

#include <FixedGridEnergyDensity.h>

List of all members.

Public Types

enum  EtaRegion { Central, Forward, All }

Public Member Functions

 FixedGridEnergyDensity (const reco::PFCandidateCollection *input)
float fixedGridRho (std::vector< float > &etabins, std::vector< float > &phibins)
float fixedGridRho (EtaRegion etaRegion=Central)
 ~FixedGridEnergyDensity ()

Private Attributes

const reco::PFCandidateCollectionpfCandidates

Detailed Description

Definition at line 6 of file FixedGridEnergyDensity.h.


Member Enumeration Documentation

Enumerator:
Central 
Forward 
All 

Definition at line 11 of file FixedGridEnergyDensity.h.


Constructor & Destructor Documentation

FixedGridEnergyDensity::FixedGridEnergyDensity ( const reco::PFCandidateCollection input) [inline]

Definition at line 9 of file FixedGridEnergyDensity.h.

References collect_tpl::input, and pfCandidates.

FixedGridEnergyDensity::~FixedGridEnergyDensity ( ) [inline]

Definition at line 10 of file FixedGridEnergyDensity.h.

{};

Member Function Documentation

float FixedGridEnergyDensity::fixedGridRho ( EtaRegion  etaRegion = Central)

Definition at line 11 of file FixedGridEnergyDensity.cc.

References muon::All, i, Pi, and TwoPi.

                                                             {
  //define the phi bins
  vector<float> phibins;
  for (int i=0;i<10;i++) phibins.push_back(-TMath::Pi()+(2*i+1)*TMath::TwoPi()/20.);
  //define the eta bins
  vector<float> etabins;
  if (etaRegion==Central) {
    for (int i=0;i<8;++i) etabins.push_back(-2.1+0.6*i);
  } else if (etaRegion==Forward) {
     for (int i=0;i<10;++i) {
       if (i<5) etabins.push_back(-5.1+0.6*i);
       else etabins.push_back(2.7+0.6*(i-5));
     }
  } else if (etaRegion==All) {
     for (int i=0;i<18;++i) etabins.push_back(-5.1+0.6*i);
  }
  return fixedGridRho(etabins,phibins);
}
float FixedGridEnergyDensity::fixedGridRho ( std::vector< float > &  etabins,
std::vector< float > &  phibins 
)

Definition at line 31 of file FixedGridEnergyDensity.cc.

References reco::deltaPhi(), reco::tau::pfCandidates(), and python::multivaluedict::sort().

                                                                                              {
     float etadist = etabins[1]-etabins[0];
     float phidist = phibins[1]-phibins[0];
     float etahalfdist = (etabins[1]-etabins[0])/2.;
     float phihalfdist = (phibins[1]-phibins[0])/2.;
     vector<float> sumPFNallSMDQ;
     sumPFNallSMDQ.reserve(etabins.size()*phibins.size());
     for (unsigned int ieta=0;ieta<etabins.size();++ieta) {
       for (unsigned int iphi=0;iphi<phibins.size();++iphi) {
         float pfniso_ieta_iphi = 0;
         for(PFCandidateCollection::const_iterator pf_it = pfCandidates->begin(); pf_it != pfCandidates->end(); pf_it++) {
           if (fabs(etabins[ieta]-pf_it->eta())>etahalfdist) continue;
           if (fabs(reco::deltaPhi(phibins[iphi],pf_it->phi()))>phihalfdist) continue;
           pfniso_ieta_iphi+=pf_it->pt();
         }
         sumPFNallSMDQ.push_back(pfniso_ieta_iphi);
       }
     }
     float evt_smdq = 0;
     sort(sumPFNallSMDQ.begin(),sumPFNallSMDQ.end());
     if (sumPFNallSMDQ.size()%2) evt_smdq = sumPFNallSMDQ[(sumPFNallSMDQ.size()-1)/2];
     else evt_smdq = (sumPFNallSMDQ[sumPFNallSMDQ.size()/2]+sumPFNallSMDQ[(sumPFNallSMDQ.size()-2)/2])/2.;
     return evt_smdq/(etadist*phidist);
}

Member Data Documentation

Definition at line 16 of file FixedGridEnergyDensity.h.

Referenced by FixedGridEnergyDensity().