CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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)
 
 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 ( 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 }
std::vector< double > layerWeights_
Log< level::Info, false > LogInfo
T getParameter(std::string const &) const
Definition: ParameterSet.h:303

Member Function Documentation

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
unsigned layerWithOffset(const DetId &) const
void setPt(double pt)
Definition: HGCalClusterT.h:94
std::vector< double > layerWeights_
double mipPt() const
Definition: HGCalClusterT.h:90
uint32_t detId() const
Definition: HGCalClusterT.h:92
bool isNose(const DetId &) const
void HGCalClusteringDummyImpl::clusterizeDummy ( const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &  triggerCellsPtrs,
l1t::HGCalClusterBxCollection clusters 
)

Definition at line 16 of file HGCalClusteringDummyImpl.cc.

References calibratePt(), mps_fire::i, BXVector< T >::resize(), BXVector< T >::set(), 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)
void set(int bx, unsigned i, const T &object)
void resize(int bx, unsigned size)
void HGCalClusteringDummyImpl::setGeometry ( const HGCalTriggerGeometryBase *const  geom)
inline

Definition at line 17 of file HGCalClusteringDummyImpl.h.

References HGCalTriggerTools::setGeometry(), and triggerTools_.

Referenced by CaloTruthCellsProducer::produce().

17 { triggerTools_.setGeometry(geom); }
void setGeometry(const HGCalTriggerGeometryBase *const)

Member Data Documentation

bool HGCalClusteringDummyImpl::applyLayerWeights_
private

Definition at line 25 of file HGCalClusteringDummyImpl.h.

Referenced by calibratePt().

double HGCalClusteringDummyImpl::calibSF_
private

Definition at line 23 of file HGCalClusteringDummyImpl.h.

Referenced by calibratePt(), and HGCalClusteringDummyImpl().

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

Definition at line 24 of file HGCalClusteringDummyImpl.h.

Referenced by calibratePt().

HGCalTriggerTools HGCalClusteringDummyImpl::triggerTools_
private

Definition at line 26 of file HGCalClusteringDummyImpl.h.

Referenced by calibratePt(), and setGeometry().