CMS 3D CMS Logo

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)
 
 HGCalClusteringDummyImpl (const edm::ParameterSet &conf)
 
void setGeometry (const HGCalTriggerGeometryBase *const geom)
 

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.

References calibSF_.

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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< double > layerWeights_
Log< level::Info, false > LogInfo

Member Function Documentation

◆ calibratePt()

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

Definition at line 33 of file HGCalClusteringDummyImpl.cc.

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().

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 }
double pt() const final
transverse momentum
uint32_t detId() const
Definition: HGCalClusterT.h:92
void setPt(double pt)
Definition: HGCalClusterT.h:94
std::vector< double > layerWeights_
bool isNose(const DetId &) const
unsigned layerWithOffset(const DetId &) const
double mipPt() const
Definition: HGCalClusterT.h:90

◆ clusterizeDummy()

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

Definition at line 16 of file HGCalClusteringDummyImpl.cc.

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

Referenced by CaloTruthCellsProducer::produce().

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 }
void calibratePt(l1t::HGCalCluster &cluster)

◆ setGeometry()

void HGCalClusteringDummyImpl::setGeometry ( const HGCalTriggerGeometryBase *const  geom)
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 setGeometry().