CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
FixedGridEnergyDensity Class Reference

#include <FixedGridEnergyDensity.h>

Public Types

enum  EtaRegion { Central, Forward, All }
 

Public Member Functions

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

Private Attributes

const reco::PFCandidateCollectionpfCandidates
 

Detailed Description

Definition at line 6 of file FixedGridEnergyDensity.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 9 of file FixedGridEnergyDensity.h.

References input, and pfCandidates.

const reco::PFCandidateCollection * pfCandidates
static std::string const input
Definition: EdmProvDump.cc:43
FixedGridEnergyDensity::~FixedGridEnergyDensity ( )
inline

Definition at line 10 of file FixedGridEnergyDensity.h.

10 {};

Member Function Documentation

float FixedGridEnergyDensity::fixedGridRho ( EtaRegion  etaRegion = Central)

Definition at line 11 of file FixedGridEnergyDensity.cc.

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

11  {
12  //define the phi bins
13  vector<float> phibins;
14  for (int i=0;i<10;i++) phibins.push_back(-TMath::Pi()+(2*i+1)*TMath::TwoPi()/20.);
15  //define the eta bins
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));
23  }
24  } else if (etaRegion==All) {
25  for (int i=0;i<18;++i) etabins.push_back(-5.1+0.6*i);
26  }
27  return fixedGridRho(etabins,phibins);
28 }
const double TwoPi
const double Pi
int i
Definition: DBlmapReader.cc:9
float fixedGridRho(EtaRegion etaRegion=Central)
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().

31  {
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;
41  for(PFCandidateCollection::const_iterator pf_it = pfCandidates->begin(); pf_it != pfCandidates->end(); pf_it++) {
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();
45  }
46  sumPFNallSMDQ.push_back(pfniso_ieta_iphi);
47  }
48  }
49  float evt_smdq = 0;
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);
54 }
const reco::PFCandidateCollection * pfCandidates
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:12

Member Data Documentation

const reco::PFCandidateCollection* FixedGridEnergyDensity::pfCandidates
private

Definition at line 16 of file FixedGridEnergyDensity.h.

Referenced by FixedGridEnergyDensity().