CMS 3D CMS Logo

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

#include <PFClusterEMEnergyCorrector.h>

Inheritance diagram for PFClusterEMEnergyCorrector:
PFClusterEnergyCorrectorBase

Public Member Functions

void correctEnergies (reco::PFClusterCollection &cs)
 
void correctEnergy (reco::PFCluster &c)
 
PFClusterEMEnergyCorrectoroperator= (const PFClusterEMEnergyCorrector &)=delete
 
 PFClusterEMEnergyCorrector (const edm::ParameterSet &conf)
 
 PFClusterEMEnergyCorrector (const PFClusterEMEnergyCorrector &)=delete
 
void setClusterIndex (const unsigned i)
 
void setEEtoPSAssociation (const reco::PFCluster::EEtoPSAssociation &assoc)
 
- Public Member Functions inherited from PFClusterEnergyCorrectorBase
const std::string & name () const
 
Correctoroperator= (const Corrector &)=delete
 
 PFClusterEnergyCorrectorBase (const edm::ParameterSet &conf)
 
 PFClusterEnergyCorrectorBase (const Corrector &)=delete
 
virtual void update (const edm::EventSetup &)
 
 ~PFClusterEnergyCorrectorBase ()
 

Private Member Functions

void correctEnergyActual (reco::PFCluster &, const unsigned) const
 

Private Attributes

const bool _applyCrackCorrections
 
const
reco::PFCluster::EEtoPSAssociation
_assoc
 
std::unique_ptr
< PFEnergyCalibration
_calibrator
 
unsigned _idx
 

Detailed Description

Definition at line 9 of file PFClusterEMEnergyCorrector.h.

Constructor & Destructor Documentation

PFClusterEMEnergyCorrector::PFClusterEMEnergyCorrector ( const edm::ParameterSet conf)
inline

Definition at line 11 of file PFClusterEMEnergyCorrector.h.

11  :
13  _applyCrackCorrections(conf.getParameter<bool>("applyCrackCorrections")),
14  _assoc(NULL),
15  _idx(0),
T getParameter(std::string const &) const
PFClusterEnergyCorrectorBase(const edm::ParameterSet &conf)
#define NULL
Definition: scimark2.h:8
std::unique_ptr< PFEnergyCalibration > _calibrator
const reco::PFCluster::EEtoPSAssociation * _assoc
PFClusterEMEnergyCorrector::PFClusterEMEnergyCorrector ( const PFClusterEMEnergyCorrector )
delete

Member Function Documentation

void PFClusterEMEnergyCorrector::correctEnergies ( reco::PFClusterCollection cs)
inlinevirtual

Implements PFClusterEnergyCorrectorBase.

Definition at line 26 of file PFClusterEMEnergyCorrector.h.

References correctEnergyActual(), and i.

26  {
27  for( unsigned i = 0; i < cs.size(); ++i ) correctEnergyActual(cs[i],i);
28  }
int i
Definition: DBlmapReader.cc:9
auto_ptr< ClusterSequence > cs
void correctEnergyActual(reco::PFCluster &, const unsigned) const
void PFClusterEMEnergyCorrector::correctEnergy ( reco::PFCluster c)
inlinevirtual

Implements PFClusterEnergyCorrectorBase.

Definition at line 25 of file PFClusterEMEnergyCorrector.h.

References _idx, and correctEnergyActual().

void correctEnergyActual(reco::PFCluster &, const unsigned) const
void PFClusterEMEnergyCorrector::correctEnergyActual ( reco::PFCluster cluster,
const unsigned  idx 
) const
private

Definition at line 11 of file PFClusterEMEnergyCorrector.cc.

References _applyCrackCorrections, _assoc, _calibrator, PFLayer::ECAL_ENDCAP, eCorr(), reco::PFCluster::layer(), PFLayer::PS1, PFLayer::PS2, and reco::CaloCluster::setCorrectedEnergy().

Referenced by correctEnergies(), and correctEnergy().

11  {
12  std::vector<double> ps1_energies,ps2_energies;
13  double ePS1=0, ePS2=0;
14  if( cluster.layer() == PFLayer::ECAL_ENDCAP && _assoc ) {
15  auto ee_key_val = std::make_pair(idx,edm::Ptr<reco::PFCluster>());
16  const auto clustops = std::equal_range(_assoc->begin(),
17  _assoc->end(),
18  ee_key_val,
19  sortByKey);
20  for( auto i_ps = clustops.first; i_ps != clustops.second; ++i_ps) {
21  edm::Ptr<reco::PFCluster> psclus(i_ps->second);
22  switch( psclus->layer() ) {
23  case PFLayer::PS1:
24  ps1_energies.push_back(psclus->energy());
25  break;
26  case PFLayer::PS2:
27  ps2_energies.push_back(psclus->energy());
28  break;
29  default:
30  break;
31  }
32  }
33  }
34  const double eCorr= _calibrator->energyEm(cluster,
35  ps1_energies,ps2_energies,
36  ePS1,ePS2,
38  cluster.setCorrectedEnergy(eCorr);
39 }
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
Definition: PFCluster.cc:85
std::unique_ptr< PFEnergyCalibration > _calibrator
void setCorrectedEnergy(double cenergy)
Definition: CaloCluster.h:109
const reco::PFCluster::EEtoPSAssociation * _assoc
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
static float eCorr(int ieta, int iphi, double ampl, int runnum)
Ugly hack to apply energy corrections to some HB- cells.
PFClusterEMEnergyCorrector& PFClusterEMEnergyCorrector::operator= ( const PFClusterEMEnergyCorrector )
delete
void PFClusterEMEnergyCorrector::setClusterIndex ( const unsigned  i)
inline

Definition at line 23 of file PFClusterEMEnergyCorrector.h.

References _idx, and i.

23 { _idx = i; }
int i
Definition: DBlmapReader.cc:9
void PFClusterEMEnergyCorrector::setEEtoPSAssociation ( const reco::PFCluster::EEtoPSAssociation assoc)
inline

Definition at line 20 of file PFClusterEMEnergyCorrector.h.

References _assoc.

20  {
21  _assoc = &assoc;
22  }
const reco::PFCluster::EEtoPSAssociation * _assoc

Member Data Documentation

const bool PFClusterEMEnergyCorrector::_applyCrackCorrections
private

Definition at line 31 of file PFClusterEMEnergyCorrector.h.

Referenced by correctEnergyActual().

const reco::PFCluster::EEtoPSAssociation* PFClusterEMEnergyCorrector::_assoc
private

Definition at line 32 of file PFClusterEMEnergyCorrector.h.

Referenced by correctEnergyActual(), and setEEtoPSAssociation().

std::unique_ptr<PFEnergyCalibration> PFClusterEMEnergyCorrector::_calibrator
private

Definition at line 34 of file PFClusterEMEnergyCorrector.h.

Referenced by correctEnergyActual().

unsigned PFClusterEMEnergyCorrector::_idx
private

Definition at line 33 of file PFClusterEMEnergyCorrector.h.

Referenced by correctEnergy(), and setClusterIndex().