CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HGCalTriggerClusterInterpretationEM Class Reference
Inheritance diagram for HGCalTriggerClusterInterpretationEM:
HGCalTriggerClusterInterpreterBase

Public Member Functions

void eventSetup (const edm::EventSetup &es) final
 
 HGCalTriggerClusterInterpretationEM ()
 
void initialize (const edm::ParameterSet &conf) final
 
void interpret (l1t::HGCalMulticlusterBxCollection &multiclusters) const final
 
 ~HGCalTriggerClusterInterpretationEM () override
 
- Public Member Functions inherited from HGCalTriggerClusterInterpreterBase
 HGCalTriggerClusterInterpreterBase ()
 
virtual ~HGCalTriggerClusterInterpreterBase ()
 

Private Attributes

std::vector< double > dr_bylayer_
 
std::vector< double > layer_containment_corrs_
 
std::vector< double > scale_corrections_coeff_
 
HGCalTriggerTools triggerTools_
 

Detailed Description

Definition at line 7 of file HGCalTriggerClusterInterpretationEM.cc.

Constructor & Destructor Documentation

◆ HGCalTriggerClusterInterpretationEM()

HGCalTriggerClusterInterpretationEM::HGCalTriggerClusterInterpretationEM ( )

Definition at line 25 of file HGCalTriggerClusterInterpretationEM.cc.

25 {}

◆ ~HGCalTriggerClusterInterpretationEM()

HGCalTriggerClusterInterpretationEM::~HGCalTriggerClusterInterpretationEM ( )
inlineoverride

Definition at line 10 of file HGCalTriggerClusterInterpretationEM.cc.

10 {};

Member Function Documentation

◆ eventSetup()

void HGCalTriggerClusterInterpretationEM::eventSetup ( const edm::EventSetup es)
finalvirtual

◆ initialize()

void HGCalTriggerClusterInterpretationEM::initialize ( const edm::ParameterSet conf)
finalvirtual

Implements HGCalTriggerClusterInterpreterBase.

Definition at line 27 of file HGCalTriggerClusterInterpretationEM.cc.

27  {
28  layer_containment_corrs_ = conf.getParameter<std::vector<double>>("layer_containment_corrs");
29  scale_corrections_coeff_ = conf.getParameter<std::vector<double>>("scale_correction_coeff");
30  dr_bylayer_ = conf.getParameter<std::vector<double>>("dr_bylayer");
31 
32  const unsigned corrections_size = 2;
33  if (scale_corrections_coeff_.size() != corrections_size) {
34  throw cms::Exception("HGCTriggerParameterError")
35  << "HGCalTriggerClusterInterpretationEM::scale_correction_coeff parameter has size: "
36  << scale_corrections_coeff_.size() << " while expected is " << corrections_size;
37  }
38  if (layer_containment_corrs_.size() != dr_bylayer_.size()) {
39  throw cms::Exception("HGCTriggerParameterError")
40  << "HGCalTriggerClusterInterpretationEM::layer_containment_corrs and "
41  "HGCalTriggerClusterInterpretationEM::dr_bylayer have different size!";
42  }
43 }

References dr_bylayer_, Exception, edm::ParameterSet::getParameter(), layer_containment_corrs_, and scale_corrections_coeff_.

◆ interpret()

void HGCalTriggerClusterInterpretationEM::interpret ( l1t::HGCalMulticlusterBxCollection multiclusters) const
finalvirtual

Implements HGCalTriggerClusterInterpreterBase.

Definition at line 47 of file HGCalTriggerClusterInterpretationEM.cc.

47  {
48  for (unsigned int idx = 0; idx != multiclusters.size(); idx++) {
49  l1t::HGCalMulticluster& cluster3d = multiclusters[idx];
50 
51  const GlobalPoint& cluster3d_position = cluster3d.centreProj();
52  double energy = 0.;
53 
54  for (const auto& cluster2d : cluster3d.constituents()) {
55  const unsigned layer = triggerTools_.triggerLayer(cluster2d.first);
56  if (layer <= layer_containment_corrs_.size() - 1) {
57  double dr = (cluster3d_position - cluster2d.second->centreProj()).mag();
58  if (dr <= dr_bylayer_.at(layer)) {
59  energy += layer_containment_corrs_.at(layer) * cluster2d.second->energy();
60  }
61  }
62  }
64  cluster3d.saveEnergyInterpretation(l1t::HGCalMulticluster::EnergyInterpretation::EM, max(energy, 0.));
65  }
66 }

References funct::abs(), l1t::HGCalClusterT< C >::centreProj(), l1t::HGCalClusterT< C >::constituents(), flavorHistoryFilter_cfi::dr, dr_bylayer_, HCALHighEnergyHPDFilter_cfi::energy, reco::LeafCandidate::eta(), charmTagsComputerCvsB_cfi::idx, layer_containment_corrs_, mag(), SiStripPI::max, l1t::HGCalMulticluster::saveEnergyInterpretation(), scale_corrections_coeff_, BXVector< T >::size(), HGCalTriggerTools::triggerLayer(), and triggerTools_.

Member Data Documentation

◆ dr_bylayer_

std::vector<double> HGCalTriggerClusterInterpretationEM::dr_bylayer_
private

Definition at line 18 of file HGCalTriggerClusterInterpretationEM.cc.

Referenced by initialize(), and interpret().

◆ layer_containment_corrs_

std::vector<double> HGCalTriggerClusterInterpretationEM::layer_containment_corrs_
private

Definition at line 16 of file HGCalTriggerClusterInterpretationEM.cc.

Referenced by initialize(), and interpret().

◆ scale_corrections_coeff_

std::vector<double> HGCalTriggerClusterInterpretationEM::scale_corrections_coeff_
private

Definition at line 17 of file HGCalTriggerClusterInterpretationEM.cc.

Referenced by initialize(), and interpret().

◆ triggerTools_

HGCalTriggerTools HGCalTriggerClusterInterpretationEM::triggerTools_
private

Definition at line 20 of file HGCalTriggerClusterInterpretationEM.cc.

Referenced by eventSetup(), and interpret().

HGCalTriggerTools::eventSetup
void eventSetup(const edm::EventSetup &)
Definition: HGCalTriggerTools.cc:35
HGCalTriggerClusterInterpretationEM::scale_corrections_coeff_
std::vector< double > scale_corrections_coeff_
Definition: HGCalTriggerClusterInterpretationEM.cc:17
charmTagsComputerCvsB_cfi.idx
idx
Definition: charmTagsComputerCvsB_cfi.py:108
HGCalTriggerClusterInterpretationEM::dr_bylayer_
std::vector< double > dr_bylayer_
Definition: HGCalTriggerClusterInterpretationEM.cc:18
l1t::HGCalMulticluster
Definition: HGCalMulticluster.h:13
l1t::HGCalMulticluster::saveEnergyInterpretation
void saveEnergyInterpretation(const HGCalMulticluster::EnergyInterpretation eInt, double energy)
Definition: HGCalMulticluster.cc:13
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
l1t::HGCalClusterT::constituents
const std::unordered_map< uint32_t, edm::Ptr< C > > & constituents() const
Definition: HGCalClusterT.h:51
Point3DBase< float, GlobalTag >
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
HGCalTriggerClusterInterpretationEM::triggerTools_
HGCalTriggerTools triggerTools_
Definition: HGCalTriggerClusterInterpretationEM.cc:20
HGCalTriggerTools::triggerLayer
unsigned triggerLayer(const unsigned id) const
Definition: HGCalTriggerTools.h:84
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
Exception
Definition: hltDiff.cc:246
HGCalTriggerClusterInterpretationEM::layer_containment_corrs_
std::vector< double > layer_containment_corrs_
Definition: HGCalTriggerClusterInterpretationEM.cc:16
BXVector::size
unsigned size(int bx) const
l1t::HGCalClusterT::centreProj
const GlobalPoint & centreProj() const
Definition: HGCalClusterT.h:103
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22