CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
SCEnergyCorrectorSemiParm Class Reference

#include <SCEnergyCorrectorSemiParm.h>

Classes

class  RegParam
 

Public Member Functions

std::pair< double, double > getCorrections (const reco::SuperCluster &sc) const
 
std::vector< float > getRegData (const reco::SuperCluster &sc) const
 
void modifyObject (reco::SuperCluster &sc) const
 
 SCEnergyCorrectorSemiParm ()
 
 SCEnergyCorrectorSemiParm (const edm::ParameterSet &iConfig, edm::ConsumesCollector cc)
 
void setEvent (const edm::Event &e)
 
void setEventSetup (const edm::EventSetup &es)
 
template<edm::Transition tr = edm::Transition::BeginLuminosityBlock>
void setTokens (const edm::ParameterSet &iConfig, edm::ConsumesCollector cc)
 

Static Public Member Functions

static void fillPSetDescription (edm::ParameterSetDescription &desc)
 
static edm::ParameterSetDescription makePSetDescription ()
 

Private Member Functions

std::vector< float > getRegDataECALHLTV1 (const reco::SuperCluster &sc) const
 
std::vector< float > getRegDataECALV1 (const reco::SuperCluster &sc) const
 
std::vector< float > getRegDataHGCALHLTV1 (const reco::SuperCluster &sc) const
 
std::vector< float > getRegDataHGCALV1 (const reco::SuperCluster &sc) const
 
const RegParamgetRegParam (const DetId &detId) const
 

Private Attributes

bool applySigmaIetaIphiBug_
 
const CaloGeometrycaloGeom_
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordcaloGeomToken_
 
const CaloTopologycaloTopo_
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordcaloTopoToken_
 
float hgcalCylinderR_
 
HGCalShowerShapeHelper hgcalShowerShapes_
 
float hitsEnergyThreshold_
 
bool isHLT_
 
bool isPhaseII_
 
int nHitsAboveThresholdEB_
 
int nHitsAboveThresholdEE_
 
int nHitsAboveThresholdHG_
 
edm::Handle< EcalRecHitCollectionrecHitsEB_
 
edm::Handle< EcalRecHitCollectionrecHitsEE_
 
edm::Handle< reco::PFRecHitCollectionrecHitsHgcal_
 
RegParam regParamBarrel_
 
RegParam regParamEndcap_
 
edm::EDGetTokenT< EcalRecHitCollectiontokenEBRecHits_
 
edm::EDGetTokenT< EcalRecHitCollectiontokenEERecHits_
 
edm::EDGetTokenT< reco::PFRecHitCollectiontokenHgcalRecHits_
 
edm::EDGetTokenT< reco::VertexCollectiontokenVertices_
 
edm::Handle< reco::VertexCollectionvertices_
 

Detailed Description

Definition at line 37 of file SCEnergyCorrectorSemiParm.h.

Constructor & Destructor Documentation

◆ SCEnergyCorrectorSemiParm() [1/2]

SCEnergyCorrectorSemiParm::SCEnergyCorrectorSemiParm ( )

Definition at line 49 of file SCEnergyCorrectorSemiParm.cc.

50  : caloTopo_(nullptr),
51  caloGeom_(nullptr),
52  isHLT_(false),
53  isPhaseII_(false),
59  hgcalCylinderR_(0.) {}

◆ SCEnergyCorrectorSemiParm() [2/2]

SCEnergyCorrectorSemiParm::SCEnergyCorrectorSemiParm ( const edm::ParameterSet iConfig,
edm::ConsumesCollector  cc 
)

Definition at line 61 of file SCEnergyCorrectorSemiParm.cc.

63  setTokens(iConfig, cc);
64 }

References setTokens().

Member Function Documentation

◆ fillPSetDescription()

void SCEnergyCorrectorSemiParm::fillPSetDescription ( edm::ParameterSetDescription desc)
static

Definition at line 66 of file SCEnergyCorrectorSemiParm.cc.

66  {
67  desc.add<bool>("isHLT", false);
68  desc.add<bool>("isPhaseII", false);
69  desc.add<bool>("applySigmaIetaIphiBug", false);
70  desc.add<edm::InputTag>("ecalRecHitsEE", edm::InputTag("ecalRecHit", "EcalRecHitsEE"));
71  desc.add<edm::InputTag>("ecalRecHitsEB", edm::InputTag("ecalRecHit", "EcalRecHitsEB"));
72  desc.add<std::string>("regressionKeyEB", "pfscecal_EBCorrection_offline_v2");
73  desc.add<std::string>("regressionKeyEE", "pfscecal_EECorrection_offline_v2");
74  desc.add<std::string>("uncertaintyKeyEB", "pfscecal_EBUncertainty_offline_v2");
75  desc.add<std::string>("uncertaintyKeyEE", "pfscecal_EEUncertainty_offline_v2");
76  desc.add<double>("regressionMinEB", 0.2);
77  desc.add<double>("regressionMaxEB", 2.0);
78  desc.add<double>("regressionMinEE", 0.2);
79  desc.add<double>("regressionMaxEE", 2.0);
80  desc.add<double>("uncertaintyMinEB", 0.0002);
81  desc.add<double>("uncertaintyMaxEB", 0.5);
82  desc.add<double>("uncertaintyMinEE", 0.0002);
83  desc.add<double>("uncertaintyMaxEE", 0.5);
84  desc.add<edm::InputTag>("vertexCollection", edm::InputTag("offlinePrimaryVertices"));
85  desc.add<double>("eRecHitThreshold", 1.);
86  desc.add<edm::InputTag>("hgcalRecHits", edm::InputTag());
87  desc.add<double>("hgcalCylinderR", EgammaHGCALIDParamDefaults::kRCylinder);
88 }

References submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, EgammaHGCALIDParamDefaults::kRCylinder, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by makePSetDescription().

◆ getCorrections()

std::pair< double, double > SCEnergyCorrectorSemiParm::getCorrections ( const reco::SuperCluster sc) const

Definition at line 128 of file SCEnergyCorrectorSemiParm.cc.

128  {
129  std::pair<double, double> corrEnergyAndRes = {-1, -1};
130 
131  const auto regData = getRegData(sc);
132  if (regData.empty()) {
133  //supercluster has no valid regression, return default values
134  return corrEnergyAndRes;
135  }
136  DetId seedId = sc.seed()->seed();
137  const auto& regParam = getRegParam(seedId);
138 
139  double mean = regParam.mean(regData);
140  double sigma = regParam.sigma(regData);
141 
142  double energyCorr = mean * sc.rawEnergy();
143  if (isHLT_ && sc.seed()->seed().det() == DetId::Ecal && seedId.subdetId() == EcalEndcap) {
144  energyCorr += sc.preshowerEnergy();
145  }
146  double resolutionEst = sigma * energyCorr;
147 
148  corrEnergyAndRes.first = energyCorr;
149  corrEnergyAndRes.second = resolutionEst;
150 
151  return corrEnergyAndRes;
152 }

References DetId::det(), DetId::Ecal, EcalEndcap, getRegData(), getRegParam(), isHLT_, SiStripPI::mean, reco::SuperCluster::preshowerEnergy(), reco::SuperCluster::rawEnergy(), reco::SuperCluster::seed(), reco::CaloCluster::seed(), and DetId::subdetId().

Referenced by modifyObject().

◆ getRegData()

std::vector< float > SCEnergyCorrectorSemiParm::getRegData ( const reco::SuperCluster sc) const

Definition at line 165 of file SCEnergyCorrectorSemiParm.cc.

165  {
166  switch (sc.seed()->seed().det()) {
167  case DetId::Ecal:
168  if (isPhaseII_ && sc.seed()->seed().subdetId() == EcalEndcap) {
169  throw cms::Exception("ConfigError") << " Error in SCEnergyCorrectorSemiParm: "
170  << " running over events with EcalEndcap clusters while enabling "
171  "isPhaseII, please set isPhaseII = False in regression config";
172  }
173  return isHLT_ ? getRegDataECALHLTV1(sc) : getRegDataECALV1(sc);
174  case DetId::HGCalEE:
175  if (!isPhaseII_) {
176  throw cms::Exception("ConfigError") << " Error in SCEnergyCorrectorSemiParm: "
177  << " running over PhaseII events without enabling isPhaseII, please set "
178  "isPhaseII = True in regression config";
179  }
180  return isHLT_ ? getRegDataHGCALHLTV1(sc) : getRegDataHGCALV1(sc);
181  default:
182  return std::vector<float>();
183  }
184 }

References DetId::det(), DetId::Ecal, EcalEndcap, Exception, getRegDataECALHLTV1(), getRegDataECALV1(), getRegDataHGCALHLTV1(), getRegDataHGCALV1(), DetId::HGCalEE, isHLT_, isPhaseII_, reco::SuperCluster::seed(), reco::CaloCluster::seed(), and DetId::subdetId().

Referenced by getCorrections(), and SCEnergyCorrectorProducer::produce().

◆ getRegDataECALHLTV1()

std::vector< float > SCEnergyCorrectorSemiParm::getRegDataECALHLTV1 ( const reco::SuperCluster sc) const
private

Definition at line 315 of file SCEnergyCorrectorSemiParm.cc.

315  {
316  std::vector<float> eval(7, 0.);
317  auto maxDRNonSeedClus = getMaxDRNonSeedCluster(sc);
318  const float clusterMaxDR = maxDRNonSeedClus.first ? maxDRNonSeedClus.second : 999.;
319 
320  const reco::CaloCluster& seedCluster = *(sc.seed());
321  const bool iseb = seedCluster.hitsAndFractions()[0].first.subdetId() == EcalBarrel;
322  const EcalRecHitCollection* recHits = iseb ? recHitsEB_.product() : recHitsEE_.product();
323 
325  eval[1] = sc.eta();
326  eval[2] = sc.phiWidth();
327  eval[3] = EcalClusterTools::e3x3(seedCluster, recHits, caloTopo_) / sc.rawEnergy();
328  eval[4] = std::max(0, static_cast<int>(sc.clusters().size()) - 1);
329  eval[5] = clusterMaxDR;
330  eval[6] = sc.rawEnergy();
331 
332  return eval;
333 }

References caloTopo_, reco::SuperCluster::clusters(), EcalBarrel, reco::CaloCluster::eta(), reco::CaloCluster::hitsAndFractions(), SiStripPI::max, nHitsAboveThresholdEB_, nHitsAboveThresholdEE_, reco::SuperCluster::phiWidth(), reco::SuperCluster::rawEnergy(), FastTrackerRecHitMaskProducer_cfi::recHits, recHitsEB_, recHitsEE_, reco::SuperCluster::seed(), and edm::PtrVectorBase::size().

Referenced by getRegData().

◆ getRegDataECALV1()

std::vector< float > SCEnergyCorrectorSemiParm::getRegDataECALV1 ( const reco::SuperCluster sc) const
private

Definition at line 199 of file SCEnergyCorrectorSemiParm.cc.

199  {
200  std::vector<float> eval(30, 0.);
201 
202  const reco::CaloCluster& seedCluster = *(sc.seed());
203  const bool iseb = seedCluster.hitsAndFractions()[0].first.subdetId() == EcalBarrel;
204  const EcalRecHitCollection* recHits = iseb ? recHitsEB_.product() : recHitsEE_.product();
205 
206  const double raw_energy = sc.rawEnergy();
207  const int numberOfClusters = sc.clusters().size();
208 
209  const auto& localCovariances = EcalClusterTools::localCovariances(seedCluster, recHits, caloTopo_);
210 
211  const float eLeft = EcalClusterTools::eLeft(seedCluster, recHits, caloTopo_);
212  const float eRight = EcalClusterTools::eRight(seedCluster, recHits, caloTopo_);
213  const float eTop = EcalClusterTools::eTop(seedCluster, recHits, caloTopo_);
214  const float eBottom = EcalClusterTools::eBottom(seedCluster, recHits, caloTopo_);
215 
216  float sigmaIetaIeta = sqrt(localCovariances[0]);
217  float sigmaIetaIphi = std::numeric_limits<float>::max();
218  float sigmaIphiIphi = std::numeric_limits<float>::max();
219 
220  if (!edm::isNotFinite(localCovariances[2]))
221  sigmaIphiIphi = sqrt(localCovariances[2]);
222 
223  // extra shower shapes
224  const float see_by_spp = sigmaIetaIeta * (applySigmaIetaIphiBug_ ? std::numeric_limits<float>::max() : sigmaIphiIphi);
225  if (see_by_spp > 0) {
226  sigmaIetaIphi = localCovariances[1] / see_by_spp;
227  } else if (localCovariances[1] > 0) {
228  sigmaIetaIphi = 1.f;
229  } else {
230  sigmaIetaIphi = -1.f;
231  }
232 
233  // calculate sub-cluster variables
234  std::vector<float> clusterRawEnergy;
235  clusterRawEnergy.resize(std::max(3, numberOfClusters), 0);
236  std::vector<float> clusterDEtaToSeed;
237  clusterDEtaToSeed.resize(std::max(3, numberOfClusters), 0);
238  std::vector<float> clusterDPhiToSeed;
239  clusterDPhiToSeed.resize(std::max(3, numberOfClusters), 0);
240  float clusterMaxDR = 999.;
241  float clusterMaxDRDPhi = 999.;
242  float clusterMaxDRDEta = 999.;
243  float clusterMaxDRRawEnergy = 0.;
244 
245  size_t iclus = 0;
246  float maxDR = 0;
248  const edm::Ptr<reco::CaloCluster>& theseed = sc.seed();
249  // loop over all clusters that aren't the seed
250  auto clusend = sc.clustersEnd();
251  for (auto clus = sc.clustersBegin(); clus != clusend; ++clus) {
252  pclus = *clus;
253 
254  if (theseed == pclus)
255  continue;
256  clusterRawEnergy[iclus] = pclus->energy();
257  clusterDPhiToSeed[iclus] = reco::deltaPhi(pclus->phi(), theseed->phi());
258  clusterDEtaToSeed[iclus] = pclus->eta() - theseed->eta();
259 
260  // find cluster with max dR
261  const auto the_dr = reco::deltaR(*pclus, *theseed);
262  if (the_dr > maxDR) {
263  maxDR = the_dr;
264  clusterMaxDR = maxDR;
265  clusterMaxDRDPhi = clusterDPhiToSeed[iclus];
266  clusterMaxDRDEta = clusterDEtaToSeed[iclus];
267  clusterMaxDRRawEnergy = clusterRawEnergy[iclus];
268  }
269  ++iclus;
270  }
271 
272  eval[0] = vertices_->size();
273  eval[1] = raw_energy;
274  eval[2] = sc.etaWidth();
275  eval[3] = sc.phiWidth();
276  eval[4] = EcalClusterTools::e3x3(seedCluster, recHits, caloTopo_) / raw_energy;
277  eval[5] = seedCluster.energy() / raw_energy;
278  eval[6] = EcalClusterTools::eMax(seedCluster, recHits) / raw_energy;
279  eval[7] = EcalClusterTools::e2nd(seedCluster, recHits) / raw_energy;
280  eval[8] = (eLeft + eRight != 0.f ? (eLeft - eRight) / (eLeft + eRight) : 0.f);
281  eval[9] = (eTop + eBottom != 0.f ? (eTop - eBottom) / (eTop + eBottom) : 0.f);
282  eval[10] = sigmaIetaIeta;
283  eval[11] = sigmaIetaIphi;
284  eval[12] = sigmaIphiIphi;
285  eval[13] = std::max(0, numberOfClusters - 1);
286  eval[14] = clusterMaxDR;
287  eval[15] = clusterMaxDRDPhi;
288  eval[16] = clusterMaxDRDEta;
289  eval[17] = clusterMaxDRRawEnergy / raw_energy;
290  eval[18] = clusterRawEnergy[0] / raw_energy;
291  eval[19] = clusterRawEnergy[1] / raw_energy;
292  eval[20] = clusterRawEnergy[2] / raw_energy;
293  eval[21] = clusterDPhiToSeed[0];
294  eval[22] = clusterDPhiToSeed[1];
295  eval[23] = clusterDPhiToSeed[2];
296  eval[24] = clusterDEtaToSeed[0];
297  eval[25] = clusterDEtaToSeed[1];
298  eval[26] = clusterDEtaToSeed[2];
299  if (iseb) {
300  EBDetId ebseedid(seedCluster.seed());
301  eval[27] = ebseedid.ieta();
302  eval[28] = ebseedid.iphi();
303  } else {
304  EEDetId eeseedid(seedCluster.seed());
305  eval[27] = eeseedid.ix();
306  eval[28] = eeseedid.iy();
307  //seed cluster eta is only needed for the 106X Ultra Legacy regressions
308  //and was not used in the 74X regression however as its just an extra varaible
309  //at the end, its harmless to add for the 74X regression
310  eval[29] = seedCluster.eta();
311  }
312  return eval;
313 }

References applySigmaIetaIphiBug_, caloTopo_, reco::SuperCluster::clusters(), reco::SuperCluster::clustersBegin(), reco::SuperCluster::clustersEnd(), reco::deltaPhi(), reco::deltaR(), EcalBarrel, cosmicPhotonAnalyzer_cfi::eMax, reco::CaloCluster::energy(), reco::CaloCluster::eta(), reco::SuperCluster::etaWidth(), reco::CaloCluster::hitsAndFractions(), EBDetId::ieta(), edm::isNotFinite(), EEDetId::ix(), SiStripPI::max, jets_cff::maxDR, reco::CaloCluster::phi(), reco::SuperCluster::phiWidth(), reco::SuperCluster::rawEnergy(), FastTrackerRecHitMaskProducer_cfi::recHits, recHitsEB_, recHitsEE_, reco::SuperCluster::seed(), reco::CaloCluster::seed(), edm::PtrVectorBase::size(), mathSSE::sqrt(), and vertices_.

Referenced by getRegData().

◆ getRegDataHGCALHLTV1()

std::vector< float > SCEnergyCorrectorSemiParm::getRegDataHGCALHLTV1 ( const reco::SuperCluster sc) const
private

Definition at line 366 of file SCEnergyCorrectorSemiParm.cc.

366  {
367  std::vector<float> eval(7, 0.);
368  const float clusterMaxDR = getMaxDRNonSeedCluster(sc).second;
369 
370  auto ssCalc = hgcalShowerShapes_.createCalc(sc);
371 
372  eval[0] = sc.rawEnergy();
373  eval[1] = sc.eta();
374  eval[2] = sc.phiWidth();
375  eval[3] = std::max(0, static_cast<int>(sc.clusters().size()) - 1);
376  eval[4] = ssCalc.getRvar(hgcalCylinderR_);
377  eval[5] = clusterMaxDR;
379 
380  return eval;
381 }

References reco::SuperCluster::clusters(), HGCalShowerShapeHelper::createCalc(), reco::CaloCluster::eta(), hgcalCylinderR_, hgcalShowerShapes_, SiStripPI::max, nHitsAboveThresholdEB_, nHitsAboveThresholdHG_, reco::SuperCluster::phiWidth(), reco::SuperCluster::rawEnergy(), and edm::PtrVectorBase::size().

Referenced by getRegData().

◆ getRegDataHGCALV1()

std::vector< float > SCEnergyCorrectorSemiParm::getRegDataHGCALV1 ( const reco::SuperCluster sc) const
private

Definition at line 335 of file SCEnergyCorrectorSemiParm.cc.

335  {
336  std::vector<float> eval(17, 0.);
337 
338  auto ssCalc = hgcalShowerShapes_.createCalc(sc);
339  auto pcaWidths = ssCalc.getPCAWidths(hgcalCylinderR_);
340  auto energyHighestHits = ssCalc.getEnergyHighestHits(2);
341 
342  auto maxDRNonSeedClus = getMaxDRNonSeedCluster(sc);
343  const float clusterMaxDR = maxDRNonSeedClus.first ? maxDRNonSeedClus.second : 999.;
344 
345  eval[0] = sc.rawEnergy();
346  eval[1] = sc.eta();
347  eval[2] = sc.etaWidth();
348  eval[3] = sc.phiWidth();
349  eval[4] = sc.clusters().size();
350  eval[5] = sc.hitsAndFractions().size();
351  eval[6] = clusterMaxDR;
352  eval[7] = sc.eta() - sc.seed()->eta();
353  eval[8] = reco::deltaPhi(sc.phi(), sc.seed()->phi());
354  eval[9] = energyHighestHits[0] / sc.rawEnergy();
355  eval[10] = energyHighestHits[1] / sc.rawEnergy();
356  eval[11] = std::sqrt(pcaWidths.sigma2uu);
357  eval[12] = std::sqrt(pcaWidths.sigma2vv);
358  eval[13] = std::sqrt(pcaWidths.sigma2ww);
359  eval[14] = ssCalc.getRvar(hgcalCylinderR_, sc.rawEnergy());
360  eval[15] = sc.seed()->energy() / sc.rawEnergy();
362 
363  return eval;
364 }

References reco::SuperCluster::clusters(), HGCalShowerShapeHelper::createCalc(), reco::deltaPhi(), reco::CaloCluster::energy(), reco::CaloCluster::eta(), reco::SuperCluster::etaWidth(), HGCalShowerShapeHelper::ShowerShapeCalc::getPCAWidths(), hgcalCylinderR_, hgcalShowerShapes_, reco::CaloCluster::hitsAndFractions(), nHitsAboveThresholdEB_, nHitsAboveThresholdHG_, reco::CaloCluster::phi(), reco::SuperCluster::phiWidth(), reco::SuperCluster::rawEnergy(), reco::SuperCluster::seed(), edm::PtrVectorBase::size(), and mathSSE::sqrt().

Referenced by getRegData().

◆ getRegParam()

const RegParam& SCEnergyCorrectorSemiParm::getRegParam ( const DetId detId) const
inlineprivate

Definition at line 100 of file SCEnergyCorrectorSemiParm.h.

100  {
101  return detId.det() == DetId::Ecal && detId.subdetId() == EcalBarrel ? regParamBarrel_ : regParamEndcap_;
102  }

References DetId::det(), DetId::Ecal, EcalBarrel, regParamBarrel_, regParamEndcap_, and DetId::subdetId().

Referenced by getCorrections().

◆ makePSetDescription()

edm::ParameterSetDescription SCEnergyCorrectorSemiParm::makePSetDescription ( )
static

◆ modifyObject()

void SCEnergyCorrectorSemiParm::modifyObject ( reco::SuperCluster sc) const

Definition at line 154 of file SCEnergyCorrectorSemiParm.cc.

154  {
155  std::pair<double, double> cor = getCorrections(sc);
156  if (cor.first < 0)
157  return;
158  sc.setEnergy(cor.first);
159  sc.setCorrectedEnergy(cor.first);
160  if (cor.second >= 0) {
161  sc.setCorrectedEnergyUncertainty(cor.second);
162  }
163 }

References getCorrections(), reco::CaloCluster::setCorrectedEnergy(), reco::CaloCluster::setCorrectedEnergyUncertainty(), and reco::CaloCluster::setEnergy().

Referenced by SCEnergyCorrectorProducer::produce().

◆ setEvent()

void SCEnergyCorrectorSemiParm::setEvent ( const edm::Event e)

Definition at line 108 of file SCEnergyCorrectorSemiParm.cc.

108  {
109  event.getByToken(tokenEBRecHits_, recHitsEB_);
110  if (!isPhaseII_) {
111  event.getByToken(tokenEERecHits_, recHitsEE_);
112  } else {
113  event.getByToken(tokenHgcalRecHits_, recHitsHgcal_);
115  }
116  if (isHLT_ || isPhaseII_) {
117  //note countRecHits checks the validity of the handle and returns 0
118  //if invalid so its okay to call on all rec-hit collections here
122  }
123  if (!isHLT_) {
124  event.getByToken(tokenVertices_, vertices_);
125  }
126 }

References hgcalShowerShapes_, hitsEnergyThreshold_, HGCalShowerShapeHelper::initPerEvent(), isHLT_, isPhaseII_, nHitsAboveThresholdEB_, nHitsAboveThresholdEE_, nHitsAboveThresholdHG_, recHitsEB_, recHitsEE_, recHitsHgcal_, tokenEBRecHits_, tokenEERecHits_, tokenHgcalRecHits_, tokenVertices_, and vertices_.

Referenced by SCEnergyCorrectorProducer::produce().

◆ setEventSetup()

void SCEnergyCorrectorSemiParm::setEventSetup ( const edm::EventSetup es)

◆ setTokens()

template<edm::Transition esTransition>
void SCEnergyCorrectorSemiParm::setTokens ( const edm::ParameterSet iConfig,
edm::ConsumesCollector  cc 
)

Definition at line 146 of file SCEnergyCorrectorSemiParm.h.

146  {
147  isHLT_ = iConfig.getParameter<bool>("isHLT");
148  isPhaseII_ = iConfig.getParameter<bool>("isPhaseII");
149  applySigmaIetaIphiBug_ = iConfig.getParameter<bool>("applySigmaIetaIphiBug");
150  tokenEBRecHits_ = cc.consumes<EcalRecHitCollection>(iConfig.getParameter<edm::InputTag>("ecalRecHitsEB"));
151  if (not isPhaseII_) {
152  tokenEERecHits_ = cc.consumes<EcalRecHitCollection>(iConfig.getParameter<edm::InputTag>("ecalRecHitsEE"));
153  } else {
154  tokenHgcalRecHits_ = cc.consumes<reco::PFRecHitCollection>(iConfig.getParameter<edm::InputTag>("hgcalRecHits"));
155  hgcalCylinderR_ = iConfig.getParameter<double>("hgcalCylinderR");
156  hgcalShowerShapes_.setTokens<esTransition>(cc);
157  }
158  caloGeomToken_ = cc.esConsumes<CaloGeometry, CaloGeometryRecord, esTransition>();
159  caloTopoToken_ = cc.esConsumes<CaloTopology, CaloTopologyRecord, esTransition>();
160 
161  regParamBarrel_ = RegParam(iConfig.getParameter<std::string>("regressionKeyEB"),
162  iConfig.getParameter<double>("regressionMinEB"),
163  iConfig.getParameter<double>("regressionMaxEB"),
164  iConfig.getParameter<std::string>("uncertaintyKeyEB"),
165  iConfig.getParameter<double>("uncertaintyMinEB"),
166  iConfig.getParameter<double>("uncertaintyMaxEB"));
167  regParamBarrel_.setTokens<esTransition>(cc);
168  regParamEndcap_ = RegParam(iConfig.getParameter<std::string>("regressionKeyEE"),
169  iConfig.getParameter<double>("regressionMinEE"),
170  iConfig.getParameter<double>("regressionMaxEE"),
171  iConfig.getParameter<std::string>("uncertaintyKeyEE"),
172  iConfig.getParameter<double>("uncertaintyMinEE"),
173  iConfig.getParameter<double>("uncertaintyMaxEE"));
174  regParamEndcap_.setTokens<esTransition>(cc);
175  hitsEnergyThreshold_ = iConfig.getParameter<double>("eRecHitThreshold");
176  if (not isHLT_) {
177  tokenVertices_ = cc.consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertexCollection"));
178  }
179 }

References applySigmaIetaIphiBug_, caloGeomToken_, caloTopoToken_, edm::ParameterSet::getParameter(), hgcalCylinderR_, hgcalShowerShapes_, hitsEnergyThreshold_, isHLT_, isPhaseII_, regParamBarrel_, regParamEndcap_, SCEnergyCorrectorSemiParm::RegParam::setTokens(), HGCalShowerShapeHelper::setTokens(), AlCaHLTBitMon_QueryRunRegistry::string, tokenEBRecHits_, tokenEERecHits_, tokenHgcalRecHits_, and tokenVertices_.

Referenced by SCEnergyCorrectorSemiParm().

Member Data Documentation

◆ applySigmaIetaIphiBug_

bool SCEnergyCorrectorSemiParm::applySigmaIetaIphiBug_
private

Definition at line 130 of file SCEnergyCorrectorSemiParm.h.

Referenced by getRegDataECALV1(), and setTokens().

◆ caloGeom_

const CaloGeometry* SCEnergyCorrectorSemiParm::caloGeom_
private

Definition at line 114 of file SCEnergyCorrectorSemiParm.h.

Referenced by setEventSetup().

◆ caloGeomToken_

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> SCEnergyCorrectorSemiParm::caloGeomToken_
private

Definition at line 116 of file SCEnergyCorrectorSemiParm.h.

Referenced by setEventSetup(), and setTokens().

◆ caloTopo_

const CaloTopology* SCEnergyCorrectorSemiParm::caloTopo_
private

◆ caloTopoToken_

edm::ESGetToken<CaloTopology, CaloTopologyRecord> SCEnergyCorrectorSemiParm::caloTopoToken_
private

Definition at line 115 of file SCEnergyCorrectorSemiParm.h.

Referenced by setEventSetup(), and setTokens().

◆ hgcalCylinderR_

float SCEnergyCorrectorSemiParm::hgcalCylinderR_
private

Definition at line 135 of file SCEnergyCorrectorSemiParm.h.

Referenced by getRegDataHGCALHLTV1(), getRegDataHGCALV1(), and setTokens().

◆ hgcalShowerShapes_

HGCalShowerShapeHelper SCEnergyCorrectorSemiParm::hgcalShowerShapes_
private

◆ hitsEnergyThreshold_

float SCEnergyCorrectorSemiParm::hitsEnergyThreshold_
private

Definition at line 134 of file SCEnergyCorrectorSemiParm.h.

Referenced by setEvent(), and setTokens().

◆ isHLT_

bool SCEnergyCorrectorSemiParm::isHLT_
private

Definition at line 128 of file SCEnergyCorrectorSemiParm.h.

Referenced by getCorrections(), getRegData(), setEvent(), and setTokens().

◆ isPhaseII_

bool SCEnergyCorrectorSemiParm::isPhaseII_
private

Definition at line 129 of file SCEnergyCorrectorSemiParm.h.

Referenced by getRegData(), setEvent(), setEventSetup(), and setTokens().

◆ nHitsAboveThresholdEB_

int SCEnergyCorrectorSemiParm::nHitsAboveThresholdEB_
private

◆ nHitsAboveThresholdEE_

int SCEnergyCorrectorSemiParm::nHitsAboveThresholdEE_
private

Definition at line 132 of file SCEnergyCorrectorSemiParm.h.

Referenced by getRegDataECALHLTV1(), and setEvent().

◆ nHitsAboveThresholdHG_

int SCEnergyCorrectorSemiParm::nHitsAboveThresholdHG_
private

Definition at line 133 of file SCEnergyCorrectorSemiParm.h.

Referenced by getRegDataHGCALHLTV1(), getRegDataHGCALV1(), and setEvent().

◆ recHitsEB_

edm::Handle<EcalRecHitCollection> SCEnergyCorrectorSemiParm::recHitsEB_
private

Definition at line 123 of file SCEnergyCorrectorSemiParm.h.

Referenced by getRegDataECALHLTV1(), getRegDataECALV1(), and setEvent().

◆ recHitsEE_

edm::Handle<EcalRecHitCollection> SCEnergyCorrectorSemiParm::recHitsEE_
private

Definition at line 124 of file SCEnergyCorrectorSemiParm.h.

Referenced by getRegDataECALHLTV1(), getRegDataECALV1(), and setEvent().

◆ recHitsHgcal_

edm::Handle<reco::PFRecHitCollection> SCEnergyCorrectorSemiParm::recHitsHgcal_
private

Definition at line 125 of file SCEnergyCorrectorSemiParm.h.

Referenced by setEvent().

◆ regParamBarrel_

RegParam SCEnergyCorrectorSemiParm::regParamBarrel_
private

Definition at line 110 of file SCEnergyCorrectorSemiParm.h.

Referenced by getRegParam(), setEventSetup(), and setTokens().

◆ regParamEndcap_

RegParam SCEnergyCorrectorSemiParm::regParamEndcap_
private

Definition at line 111 of file SCEnergyCorrectorSemiParm.h.

Referenced by getRegParam(), setEventSetup(), and setTokens().

◆ tokenEBRecHits_

edm::EDGetTokenT<EcalRecHitCollection> SCEnergyCorrectorSemiParm::tokenEBRecHits_
private

Definition at line 118 of file SCEnergyCorrectorSemiParm.h.

Referenced by setEvent(), and setTokens().

◆ tokenEERecHits_

edm::EDGetTokenT<EcalRecHitCollection> SCEnergyCorrectorSemiParm::tokenEERecHits_
private

Definition at line 119 of file SCEnergyCorrectorSemiParm.h.

Referenced by setEvent(), and setTokens().

◆ tokenHgcalRecHits_

edm::EDGetTokenT<reco::PFRecHitCollection> SCEnergyCorrectorSemiParm::tokenHgcalRecHits_
private

Definition at line 120 of file SCEnergyCorrectorSemiParm.h.

Referenced by setEvent(), and setTokens().

◆ tokenVertices_

edm::EDGetTokenT<reco::VertexCollection> SCEnergyCorrectorSemiParm::tokenVertices_
private

Definition at line 121 of file SCEnergyCorrectorSemiParm.h.

Referenced by setEvent(), and setTokens().

◆ vertices_

edm::Handle<reco::VertexCollection> SCEnergyCorrectorSemiParm::vertices_
private

Definition at line 126 of file SCEnergyCorrectorSemiParm.h.

Referenced by getRegDataECALV1(), and setEvent().

reco::CaloCluster::phi
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:184
SCEnergyCorrectorSemiParm::applySigmaIetaIphiBug_
bool applySigmaIetaIphiBug_
Definition: SCEnergyCorrectorSemiParm.h:130
SCEnergyCorrectorSemiParm::caloGeomToken_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
Definition: SCEnergyCorrectorSemiParm.h:116
SCEnergyCorrectorSemiParm::hgcalShowerShapes_
HGCalShowerShapeHelper hgcalShowerShapes_
Definition: SCEnergyCorrectorSemiParm.h:136
EBDetId::ieta
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
SCEnergyCorrectorSemiParm::getRegData
std::vector< float > getRegData(const reco::SuperCluster &sc) const
Definition: SCEnergyCorrectorSemiParm.cc:165
edm::PtrVectorBase::size
size_type size() const
Size of the RefVector.
Definition: PtrVectorBase.h:73
SCEnergyCorrectorSemiParm::recHitsHgcal_
edm::Handle< reco::PFRecHitCollection > recHitsHgcal_
Definition: SCEnergyCorrectorSemiParm.h:125
reco::SuperCluster::clusters
const CaloClusterPtrVector & clusters() const
const access to the cluster list itself
Definition: SuperCluster.h:80
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
SCEnergyCorrectorSemiParm::getRegDataHGCALHLTV1
std::vector< float > getRegDataHGCALHLTV1(const reco::SuperCluster &sc) const
Definition: SCEnergyCorrectorSemiParm.cc:366
edm::isNotFinite
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
SCEnergyCorrectorSemiParm::SCEnergyCorrectorSemiParm
SCEnergyCorrectorSemiParm()
Definition: SCEnergyCorrectorSemiParm.cc:49
SCEnergyCorrectorSemiParm::tokenEERecHits_
edm::EDGetTokenT< EcalRecHitCollection > tokenEERecHits_
Definition: SCEnergyCorrectorSemiParm.h:119
reco::deltaPhi
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
SCEnergyCorrectorSemiParm::caloTopoToken_
edm::ESGetToken< CaloTopology, CaloTopologyRecord > caloTopoToken_
Definition: SCEnergyCorrectorSemiParm.h:115
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
SCEnergyCorrectorSemiParm::caloTopo_
const CaloTopology * caloTopo_
Definition: SCEnergyCorrectorSemiParm.h:113
EBDetId
Definition: EBDetId.h:17
reco::CaloCluster::setCorrectedEnergy
void setCorrectedEnergy(double cenergy)
Definition: CaloCluster.h:137
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
SCEnergyCorrectorSemiParm::getRegDataECALV1
std::vector< float > getRegDataECALV1(const reco::SuperCluster &sc) const
Definition: SCEnergyCorrectorSemiParm.cc:199
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::SortedCollection< EcalRecHit >
SCEnergyCorrectorSemiParm::getRegDataECALHLTV1
std::vector< float > getRegDataECALHLTV1(const reco::SuperCluster &sc) const
Definition: SCEnergyCorrectorSemiParm.cc:315
SCEnergyCorrectorSemiParm::nHitsAboveThresholdHG_
int nHitsAboveThresholdHG_
Definition: SCEnergyCorrectorSemiParm.h:133
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
EEDetId::ix
int ix() const
Definition: EEDetId.h:77
CaloTopology
Definition: CaloTopology.h:19
SCEnergyCorrectorSemiParm::isHLT_
bool isHLT_
Definition: SCEnergyCorrectorSemiParm.h:128
HGCalShowerShapeHelper::setTokens
void setTokens(edm::ConsumesCollector consumesCollector)
Definition: HGCalShowerShapeHelper.h:144
EcalBarrel
Definition: EcalSubdetector.h:10
cc
SCEnergyCorrectorSemiParm::regParamEndcap_
RegParam regParamEndcap_
Definition: SCEnergyCorrectorSemiParm.h:111
SCEnergyCorrectorSemiParm::caloGeom_
const CaloGeometry * caloGeom_
Definition: SCEnergyCorrectorSemiParm.h:114
DetId
Definition: DetId.h:17
DetId::HGCalEE
Definition: DetId.h:32
CaloGeometry
Definition: CaloGeometry.h:21
SCEnergyCorrectorSemiParm::hgcalCylinderR_
float hgcalCylinderR_
Definition: SCEnergyCorrectorSemiParm.h:135
reco::PFRecHitCollection
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
Definition: PFRecHitFwd.h:9
reco::SuperCluster::phiWidth
double phiWidth() const
obtain phi and eta width of the Super Cluster
Definition: SuperCluster.h:66
SCEnergyCorrectorSemiParm::getRegDataHGCALV1
std::vector< float > getRegDataHGCALV1(const reco::SuperCluster &sc) const
Definition: SCEnergyCorrectorSemiParm.cc:335
reco::CaloCluster
Definition: CaloCluster.h:31
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
EEDetId
Definition: EEDetId.h:14
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalEndcap
Definition: EcalSubdetector.h:10
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
SCEnergyCorrectorSemiParm::tokenVertices_
edm::EDGetTokenT< reco::VertexCollection > tokenVertices_
Definition: SCEnergyCorrectorSemiParm.h:121
SCEnergyCorrectorSemiParm::RegParam::setTokens
void setTokens(edm::ConsumesCollector cc)
Definition: SCEnergyCorrectorSemiParm.h:140
SCEnergyCorrectorSemiParm::getCorrections
std::pair< double, double > getCorrections(const reco::SuperCluster &sc) const
Definition: SCEnergyCorrectorSemiParm.cc:128
reco::SuperCluster::seed
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
SCEnergyCorrectorSemiParm::nHitsAboveThresholdEB_
int nHitsAboveThresholdEB_
Definition: SCEnergyCorrectorSemiParm.h:131
HGCalShowerShapeHelper::createCalc
HGCalShowerShapeHelper::ShowerShapeCalc createCalc(const std::vector< std::pair< DetId, float > > &hitsAndFracs, double rawEnergy, double minHitE=0, double minHitET=0, int minLayer=1, int maxLayer=-1, DetId::Detector subDet=DetId::HGCalEE) const
reco::CaloCluster::eta
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181
EgammaHGCALIDParamDefaults::kRCylinder
static constexpr float kRCylinder
Definition: EgammaHGCALIDParamDefaults.h:5
reco::CaloCluster::hitsAndFractions
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:210
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
cosmicPhotonAnalyzer_cfi.eMax
eMax
Definition: cosmicPhotonAnalyzer_cfi.py:10
reco::CaloCluster::setCorrectedEnergyUncertainty
void setCorrectedEnergyUncertainty(float energyerr)
Definition: CaloCluster.h:138
SCEnergyCorrectorSemiParm::regParamBarrel_
RegParam regParamBarrel_
Definition: SCEnergyCorrectorSemiParm.h:110
SCEnergyCorrectorSemiParm::getRegParam
const RegParam & getRegParam(const DetId &detId) const
Definition: SCEnergyCorrectorSemiParm.h:100
reco::SuperCluster::clustersBegin
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:86
DetId::Ecal
Definition: DetId.h:27
cc
SCEnergyCorrectorSemiParm::setTokens
void setTokens(const edm::ParameterSet &iConfig, edm::ConsumesCollector cc)
Definition: SCEnergyCorrectorSemiParm.h:146
reco::CaloCluster::seed
DetId seed() const
return DetId of seed
Definition: CaloCluster.h:219
edm::Ptr
Definition: AssociationVector.h:31
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
SCEnergyCorrectorSemiParm::tokenHgcalRecHits_
edm::EDGetTokenT< reco::PFRecHitCollection > tokenHgcalRecHits_
Definition: SCEnergyCorrectorSemiParm.h:120
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
reco::CaloCluster::setEnergy
void setEnergy(double energy)
Definition: CaloCluster.h:136
SCEnergyCorrectorSemiParm::nHitsAboveThresholdEE_
int nHitsAboveThresholdEE_
Definition: SCEnergyCorrectorSemiParm.h:132
reco::SuperCluster::preshowerEnergy
double preshowerEnergy() const
energy deposited in preshower
Definition: SuperCluster.h:61
SCEnergyCorrectorSemiParm::hitsEnergyThreshold_
float hitsEnergyThreshold_
Definition: SCEnergyCorrectorSemiParm.h:134
SCEnergyCorrectorSemiParm::isPhaseII_
bool isPhaseII_
Definition: SCEnergyCorrectorSemiParm.h:129
reco::SuperCluster::rawEnergy
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
Definition: SuperCluster.h:58
Exception
Definition: hltDiff.cc:245
SCEnergyCorrectorSemiParm::vertices_
edm::Handle< reco::VertexCollection > vertices_
Definition: SCEnergyCorrectorSemiParm.h:126
SCEnergyCorrectorSemiParm::tokenEBRecHits_
edm::EDGetTokenT< EcalRecHitCollection > tokenEBRecHits_
Definition: SCEnergyCorrectorSemiParm.h:118
reco::SuperCluster::etaWidth
double etaWidth() const
Definition: SuperCluster.h:67
reco::deltaR
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SCEnergyCorrectorSemiParm::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: SCEnergyCorrectorSemiParm.cc:66
jets_cff.maxDR
maxDR
Definition: jets_cff.py:126
reco::SuperCluster::clustersEnd
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:89
HGCalShowerShapeHelper::initPerEvent
void initPerEvent(const std::vector< reco::PFRecHit > &recHits)
Definition: HGCalShowerShapeHelper.cc:303
SCEnergyCorrectorSemiParm::recHitsEB_
edm::Handle< EcalRecHitCollection > recHitsEB_
Definition: SCEnergyCorrectorSemiParm.h:123
reco::CaloCluster::energy
double energy() const
cluster energy
Definition: CaloCluster.h:149
HGCalShowerShapeHelper::ShowerShapeCalc::getPCAWidths
ShowerWidths getPCAWidths(double cylinderR, bool useFractions=false) const
Definition: HGCalShowerShapeHelper.cc:86
edm::InputTag
Definition: InputTag.h:15
SCEnergyCorrectorSemiParm::recHitsEE_
edm::Handle< EcalRecHitCollection > recHitsEE_
Definition: SCEnergyCorrectorSemiParm.h:124
HGCalShowerShapeHelper::initPerSetup
void initPerSetup(const edm::EventSetup &iSetup)
Definition: HGCalShowerShapeHelper.cc:299
SCEnergyCorrectorSemiParm::RegParam::setForests
void setForests(const edm::EventSetup &setup)
Definition: SCEnergyCorrectorSemiParm.cc:186