CMS 3D CMS Logo

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

#include <HGCalClusteringDummyImpl.h>

Public Member Functions

void clusterizeDummy (const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &triggerCellsPtrs, l1t::HGCalClusterBxCollection &clusters)
 
void eventSetup (const edm::EventSetup &es)
 
 HGCalClusteringDummyImpl (const edm::ParameterSet &conf)
 

Private Member Functions

void calibratePt (l1t::HGCalCluster &cluster)
 

Private Attributes

bool applyLayerWeights_
 
double calibSF_
 
std::vector< double > layerWeights_
 
HGCalTriggerTools triggerTools_
 

Detailed Description

Definition at line 13 of file HGCalClusteringDummyImpl.h.

Constructor & Destructor Documentation

◆ HGCalClusteringDummyImpl()

HGCalClusteringDummyImpl::HGCalClusteringDummyImpl ( const edm::ParameterSet conf)

Definition at line 8 of file HGCalClusteringDummyImpl.cc.

9  : calibSF_(conf.getParameter<double>("calibSF_cluster")),
10  layerWeights_(conf.getParameter<std::vector<double>>("layerWeights")),
11  applyLayerWeights_(conf.getParameter<bool>("applyLayerCalibration")) {
12  edm::LogInfo("HGCalClusterParameters") << "C2d global calibration factor: " << calibSF_;
13 }

References calibSF_.

Member Function Documentation

◆ calibratePt()

void HGCalClusteringDummyImpl::calibratePt ( l1t::HGCalCluster cluster)
private

Definition at line 33 of file HGCalClusteringDummyImpl.cc.

33  {
34  double calibPt = 0.;
35 
36  if (applyLayerWeights_ && !triggerTools_.isNose(cluster.detId())) {
37  unsigned layerN = triggerTools_.layerWithOffset(cluster.detId());
38 
39  if (layerWeights_.at(layerN) == 0.) {
40  throw cms::Exception("BadConfiguration")
41  << "2D cluster energy forced to 0 by calibration coefficients.\n"
42  << "The configuration should be changed. "
43  << "Discarded layers should be defined in hgcalTriggerGeometryESProducer.TriggerGeometry.DisconnectedLayers "
44  "and not with calibration coefficients = 0\n";
45  }
46 
47  calibPt = layerWeights_.at(layerN) * cluster.mipPt();
48 
49  }
50 
51  else {
52  calibPt = cluster.pt() * calibSF_;
53  }
54 
55  cluster.setPt(calibPt);
56 }

References applyLayerWeights_, calibSF_, l1t::HGCalClusterT< C >::detId(), Exception, HGCalTriggerTools::isNose(), layerWeights_, HGCalTriggerTools::layerWithOffset(), l1t::HGCalClusterT< C >::mipPt(), reco::LeafCandidate::pt(), l1t::HGCalClusterT< C >::setPt(), and triggerTools_.

Referenced by clusterizeDummy().

◆ clusterizeDummy()

void HGCalClusteringDummyImpl::clusterizeDummy ( const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &  triggerCellsPtrs,
l1t::HGCalClusterBxCollection clusters 
)

Definition at line 16 of file HGCalClusteringDummyImpl.cc.

17  {
18  std::vector<l1t::HGCalCluster> clustersTmp;
19  for (std::vector<edm::Ptr<l1t::HGCalTriggerCell>>::const_iterator tc = triggerCellsPtrs.begin();
20  tc != triggerCellsPtrs.end();
21  ++tc) {
22  clustersTmp.emplace_back(*tc);
23  }
24 
25  /* store clusters in the persistent collection */
26  clusters.resize(0, clustersTmp.size());
27  for (unsigned i(0); i < clustersTmp.size(); ++i) {
28  calibratePt(clustersTmp.at(i));
29  clusters.set(0, i, clustersTmp.at(i));
30  }
31 }

References calibratePt(), bsc_activity_cfg::clusters, mps_fire::i, and trackerHitRTTI::vector.

Referenced by CaloTruthCellsProducer::produce().

◆ eventSetup()

void HGCalClusteringDummyImpl::eventSetup ( const edm::EventSetup es)
inline

Member Data Documentation

◆ applyLayerWeights_

bool HGCalClusteringDummyImpl::applyLayerWeights_
private

Definition at line 25 of file HGCalClusteringDummyImpl.h.

Referenced by calibratePt().

◆ calibSF_

double HGCalClusteringDummyImpl::calibSF_
private

Definition at line 23 of file HGCalClusteringDummyImpl.h.

Referenced by calibratePt(), and HGCalClusteringDummyImpl().

◆ layerWeights_

std::vector<double> HGCalClusteringDummyImpl::layerWeights_
private

Definition at line 24 of file HGCalClusteringDummyImpl.h.

Referenced by calibratePt().

◆ triggerTools_

HGCalTriggerTools HGCalClusteringDummyImpl::triggerTools_
private

Definition at line 26 of file HGCalClusteringDummyImpl.h.

Referenced by calibratePt(), and eventSetup().

HGCalTriggerTools::eventSetup
void eventSetup(const edm::EventSetup &)
Definition: HGCalTriggerTools.cc:35
mps_fire.i
i
Definition: mps_fire.py:428
l1t::HGCalClusterT::mipPt
double mipPt() const
Definition: HGCalClusterT.h:91
HGCalClusteringDummyImpl::applyLayerWeights_
bool applyLayerWeights_
Definition: HGCalClusteringDummyImpl.h:25
HGCalClusteringDummyImpl::calibratePt
void calibratePt(l1t::HGCalCluster &cluster)
Definition: HGCalClusteringDummyImpl.cc:33
HGCalClusteringDummyImpl::triggerTools_
HGCalTriggerTools triggerTools_
Definition: HGCalClusteringDummyImpl.h:26
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
HGCalClusteringDummyImpl::layerWeights_
std::vector< double > layerWeights_
Definition: HGCalClusteringDummyImpl.h:24
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
l1t::HGCalClusterT::setPt
void setPt(double pt)
Definition: HGCalClusterT.h:95
l1t::HGCalClusterT::detId
uint32_t detId() const
Definition: HGCalClusterT.h:93
HGCalTriggerTools::layerWithOffset
unsigned layerWithOffset(const DetId &) const
Definition: HGCalTriggerTools.cc:134
HGCalClusteringDummyImpl::calibSF_
double calibSF_
Definition: HGCalClusteringDummyImpl.h:23
HGCalTriggerTools::isNose
bool isNose(const DetId &) const
Definition: HGCalTriggerTools.cc:170
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::Ptr
Definition: AssociationVector.h:31
Exception
Definition: hltDiff.cc:245
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303