CMS 3D CMS Logo

PFECALSuperClusterAlgo.cc
Go to the documentation of this file.
13 #include "Math/GenVector/VectorUtil.h"
14 #include "TVector2.h"
15 
17 
18 #include <stdexcept>
19 #include <string>
20 #include <sstream>
21 #include <cmath>
22 #include <functional>
23 
24 using namespace std;
25 using namespace std::placeholders; // for _1, _2, _3...
26 
27 namespace {
28  typedef edm::View<reco::PFCluster> PFClusterView;
29  typedef edm::Ptr<reco::PFCluster> PFClusterPtr;
30  typedef edm::PtrVector<reco::PFCluster> PFClusterPtrVector;
31  typedef PFECALSuperClusterAlgo::CalibratedClusterPtr CalibClusterPtr;
32  typedef PFECALSuperClusterAlgo::CalibratedClusterPtrVector CalibClusterPtrVector;
33  typedef std::pair<reco::CaloClusterPtr::key_type, reco::CaloClusterPtr> EEPSPair;
34 
35  bool sortByKey(const EEPSPair& a, const EEPSPair& b) { return a.first < b.first; }
36 
37  inline double ptFast(const double energy, const math::XYZPoint& position, const math::XYZPoint& origin) {
38  const auto v = position - origin;
39  return energy * std::sqrt(v.perp2() / v.mag2());
40  }
41 
42  bool greaterByEt(const CalibClusterPtr& x, const CalibClusterPtr& y) {
43  const math::XYZPoint zero(0, 0, 0);
44  const double xpt = ptFast(x->energy(), x->the_ptr()->position(), zero);
45  const double ypt = ptFast(y->energy(), y->the_ptr()->position(), zero);
46  return xpt > ypt;
47  }
48 
49  bool isSeed(const CalibClusterPtr& x, double threshold, bool useETcut) {
50  const math::XYZPoint zero(0, 0, 0);
51  double e_or_et = x->energy();
52  if (useETcut)
53  e_or_et = ptFast(e_or_et, x->the_ptr()->position(), zero);
54  return e_or_et > threshold;
55  }
56 
57  bool isLinkedByRecHit(const CalibClusterPtr& x,
58  const CalibClusterPtr& seed,
59  const double threshold,
60  const double majority,
61  const double maxDEta,
62  const double maxDPhi) {
63  if (seed->energy_nocalib() < threshold) {
64  return false;
65  }
66  const double dEta = std::abs(seed->eta() - x->eta());
67  const double dPhi = std::abs(TVector2::Phi_mpi_pi(seed->phi() - x->phi()));
68  if (maxDEta < dEta || maxDPhi < dPhi) {
69  return false;
70  }
71  // now see if the clusters overlap in rechits
72  const auto& seedHitsAndFractions = seed->the_ptr()->hitsAndFractions();
73  const auto& xHitsAndFractions = x->the_ptr()->hitsAndFractions();
74  double x_rechits_tot = xHitsAndFractions.size();
75  double x_rechits_match = 0.0;
76  for (const std::pair<DetId, float>& seedHit : seedHitsAndFractions) {
77  for (const std::pair<DetId, float>& xHit : xHitsAndFractions) {
78  if (seedHit.first == xHit.first) {
79  x_rechits_match += 1.0;
80  }
81  }
82  }
83  return x_rechits_match / x_rechits_tot > majority;
84  }
85 
86  bool isClustered(const CalibClusterPtr& x,
87  const CalibClusterPtr seed,
89  const bool dyn_dphi,
90  const double etawidthSuperCluster,
91  const double phiwidthSuperCluster) {
92  const double dphi = std::abs(TVector2::Phi_mpi_pi(seed->phi() - x->phi()));
93  const bool passes_dphi = ((!dyn_dphi && dphi < phiwidthSuperCluster) ||
95  seed->eta(), seed->phi(), x->energy_nocalib(), x->eta(), x->phi())));
96 
98  return (std::abs(seed->eta() - x->eta()) < etawidthSuperCluster && passes_dphi);
99  }
101  return (passes_dphi &&
102  reco::MustacheKernel::inMustache(seed->eta(), seed->phi(), x->energy_nocalib(), x->eta(), x->phi()));
103  }
104  return false;
105  }
106 
107 } // namespace
108 
110 
111 void PFECALSuperClusterAlgo::setPFClusterCalibration(const std::shared_ptr<PFEnergyCalibration>& calib) {
113 }
114 
116  inputTagPFClusters_ = cc.consumes<edm::View<reco::PFCluster> >(iConfig.getParameter<edm::InputTag>("PFClusters"));
118  cc.consumes<reco::PFCluster::EEtoPSAssociation>(iConfig.getParameter<edm::InputTag>("ESAssociation"));
119  inputTagBeamSpot_ = cc.consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("BeamSpot"));
120 
121  if (useRegression_) {
122  const edm::ParameterSet& regconf = iConfig.getParameter<edm::ParameterSet>("regressionConfig");
123 
124  regr_.reset(new SCEnergyCorrectorSemiParm());
125  regr_->setTokens(regconf, cc);
126  }
127 
128  if (isOOTCollection_) { // OOT photons only
129  inputTagBarrelRecHits_ = cc.consumes<EcalRecHitCollection>(iConfig.getParameter<edm::InputTag>("barrelRecHits"));
130  inputTagEndcapRecHits_ = cc.consumes<EcalRecHitCollection>(iConfig.getParameter<edm::InputTag>("endcapRecHits"));
131  }
132 }
133 
135  if (useRegression_) {
136  regr_->setEventSetup(setup);
137  }
138 
139  edm::ESHandle<ESEEIntercalibConstants> esEEInterCalibHandle_;
140  setup.get<ESEEIntercalibConstantsRcd>().get(esEEInterCalibHandle_);
141  _pfEnergyCalibration->initAlphaGamma_ESplanes_fromDB(esEEInterCalibHandle_.product());
142 
143  edm::ESHandle<ESChannelStatus> esChannelStatusHandle_;
144  setup.get<ESChannelStatusRcd>().get(esChannelStatusHandle_);
145  channelStatus_ = esChannelStatusHandle_.product();
146 }
147 
149  //load input collections
150  //Load the pfcluster collections
151  edm::Handle<edm::View<reco::PFCluster> > pfclustersHandle;
152  iEvent.getByToken(inputTagPFClusters_, pfclustersHandle);
153 
155  iEvent.getByToken(inputTagPFClustersES_, psAssociationHandle);
156 
157  const PFClusterView& clusters = *pfclustersHandle.product();
158  const reco::PFCluster::EEtoPSAssociation& psclusters = *psAssociationHandle.product();
159 
160  //load BeamSpot
162  iEvent.getByToken(inputTagBeamSpot_, bsHandle);
163  beamSpot_ = bsHandle.product();
164 
165  //initialize regression for this event
166  if (useRegression_) {
167  regr_->setEvent(iEvent);
168  }
169 
170  // reset the system for running
171  superClustersEB_ = std::make_unique<reco::SuperClusterCollection>();
172  _clustersEB.clear();
173  superClustersEE_ = std::make_unique<reco::SuperClusterCollection>();
174  _clustersEE.clear();
175  EEtoPS_ = &psclusters;
176 
177  //Select PF clusters available for the clustering
178  for (size_t i = 0; i < clusters.size(); ++i) {
179  auto cluster = clusters.ptrAt(i);
180  LogDebug("PFClustering") << "Loading PFCluster i=" << cluster.key() << " energy=" << cluster->energy() << std::endl;
181 
182  // protection for sim clusters
183  if (cluster->caloID().detectors() == 0 && cluster->hitsAndFractions().empty())
184  continue;
185 
186  CalibratedClusterPtr calib_cluster(new CalibratedPFCluster(cluster));
187  switch (cluster->layer()) {
189  if (calib_cluster->energy() > threshPFClusterBarrel_) {
190  _clustersEB.push_back(calib_cluster);
191  }
192  break;
193  case PFLayer::HGCAL:
195  if (calib_cluster->energy() > threshPFClusterEndcap_) {
196  _clustersEE.push_back(calib_cluster);
197  }
198  break;
199  default:
200  break;
201  }
202  }
203  // sort full cluster collections by their calibrated energy
204  // this will put all the seeds first by construction
205  std::sort(_clustersEB.begin(), _clustersEB.end(), greaterByEt);
206  std::sort(_clustersEE.begin(), _clustersEE.end(), greaterByEt);
207 
208  // set recHit collections for OOT photons
209  if (isOOTCollection_) {
210  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
211  iEvent.getByToken(inputTagBarrelRecHits_, barrelRecHitsHandle);
212  if (!barrelRecHitsHandle.isValid()) {
213  throw cms::Exception("PFECALSuperClusterAlgo")
214  << "If you use OOT photons, need to specify proper barrel rec hit collection";
215  }
216  barrelRecHits_ = barrelRecHitsHandle.product();
217 
218  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
219  iEvent.getByToken(inputTagEndcapRecHits_, endcapRecHitsHandle);
220  if (!endcapRecHitsHandle.isValid()) {
221  throw cms::Exception("PFECALSuperClusterAlgo")
222  << "If you use OOT photons, need to specify proper endcap rec hit collection";
223  }
224  endcapRecHits_ = endcapRecHitsHandle.product();
225  }
226 }
227 
229  // clusterize the EB
231  // clusterize the EE
233 }
234 
235 void PFECALSuperClusterAlgo::buildAllSuperClusters(CalibClusterPtrVector& clusters, double seedthresh) {
236  auto seedable = std::bind(isSeed, _1, seedthresh, threshIsET_);
237  // make sure only seeds appear at the front of the list of clusters
238  std::stable_partition(clusters.begin(), clusters.end(), seedable);
239  // in each iteration we are working on a list that is already sorted
240  // in the cluster energy and remains so through each iteration
241  // NB: since clusters is sorted in loadClusters any_of has O(1)
242  // timing until you run out of seeds!
243  while (std::any_of(clusters.cbegin(), clusters.cend(), seedable)) {
245  }
246 }
247 
248 void PFECALSuperClusterAlgo::buildSuperCluster(CalibClusterPtr& seed, CalibClusterPtrVector& clusters) {
249  double etawidthSuperCluster = 0.0;
250  double phiwidthSuperCluster = 0.0;
251  bool isEE = false;
252  switch (seed->the_ptr()->layer()) {
254  phiwidthSuperCluster = phiwidthSuperClusterBarrel_;
255  etawidthSuperCluster = etawidthSuperClusterBarrel_;
256  edm::LogInfo("PFClustering") << "Building SC number " << superClustersEB_->size() + 1 << " in the ECAL barrel!";
257  break;
258  case PFLayer::HGCAL:
260 
261  phiwidthSuperCluster = phiwidthSuperClusterEndcap_;
262  etawidthSuperCluster = etawidthSuperClusterEndcap_;
263  edm::LogInfo("PFClustering") << "Building SC number " << superClustersEE_->size() + 1 << " in the ECAL endcap!"
264  << std::endl;
265  isEE = true;
266  break;
267  default:
268  break;
269  }
270  auto isClusteredWithSeed =
271  std::bind(isClustered, _1, seed, _clustype, useDynamicDPhi_, etawidthSuperCluster, phiwidthSuperCluster);
272  auto matchesSeedByRecHit = std::bind(isLinkedByRecHit, _1, seed, satelliteThreshold_, fractionForMajority_, 0.1, 0.2);
273 
274  // this function shuffles the list of clusters into a list
275  // where all clustered sub-clusters are at the front
276  // and returns a pointer to the first unclustered cluster.
277  // The relative ordering of clusters is preserved
278  // (i.e. both resulting sub-lists are sorted by energy).
279  auto not_clustered = std::stable_partition(clusters.begin(), clusters.end(), isClusteredWithSeed);
280  // satellite cluster merging
281  // it was found that large clusters can split!
283  not_clustered = std::stable_partition(not_clustered, clusters.end(), matchesSeedByRecHit);
284  }
285 
286  if (verbose_) {
287  edm::LogInfo("PFClustering") << "Dumping cluster detail";
288  edm::LogVerbatim("PFClustering") << "\tPassed seed: e = " << seed->energy_nocalib() << " eta = " << seed->eta()
289  << " phi = " << seed->phi() << std::endl;
290  for (auto clus = clusters.cbegin(); clus != not_clustered; ++clus) {
291  edm::LogVerbatim("PFClustering") << "\t\tClustered cluster: e = " << (*clus)->energy_nocalib()
292  << " eta = " << (*clus)->eta() << " phi = " << (*clus)->phi() << std::endl;
293  }
294  for (auto clus = not_clustered; clus != clusters.end(); ++clus) {
295  edm::LogVerbatim("PFClustering") << "\tNon-Clustered cluster: e = " << (*clus)->energy_nocalib()
296  << " eta = " << (*clus)->eta() << " phi = " << (*clus)->phi() << std::endl;
297  }
298  }
299 
300  if (not_clustered == clusters.begin()) {
301  if (dropUnseedable_) {
302  clusters.erase(clusters.begin());
303  return;
304  } else {
305  throw cms::Exception("PFECALSuperClusterAlgo::buildSuperCluster")
306  << "Cluster is not seedable!" << std::endl
307  << "\tNon-Clustered cluster: e = " << (*not_clustered)->energy_nocalib()
308  << " eta = " << (*not_clustered)->eta() << " phi = " << (*not_clustered)->phi() << std::endl;
309  }
310  }
311 
312  // move the clustered clusters out of available cluster list
313  // and into a temporary vector for building the SC
314  CalibratedClusterPtrVector clustered(clusters.begin(), not_clustered);
315  clusters.erase(clusters.begin(), not_clustered);
316  // need the vector of raw pointers for a PF width class
317  std::vector<const reco::PFCluster*> bare_ptrs;
318  // calculate necessary parameters and build the SC
319  double posX(0), posY(0), posZ(0), corrSCEnergy(0), corrPS1Energy(0), corrPS2Energy(0), energyweight(0),
320  energyweighttot(0);
321  for (auto& clus : clustered) {
322  double ePS1 = 0.0;
323  double ePS2 = 0.0;
324  energyweight = clus->energy_nocalib();
325  bare_ptrs.push_back(clus->the_ptr().get());
326  // update EE calibrated super cluster energies
327  if (isEE) {
328  auto ee_key_val = std::make_pair(clus->the_ptr().key(), edm::Ptr<reco::PFCluster>());
329  const auto clustops = std::equal_range(EEtoPS_->begin(), EEtoPS_->end(), ee_key_val, sortByKey);
330  std::vector<reco::PFCluster const*> psClusterPointers;
331  for (auto i_ps = clustops.first; i_ps != clustops.second; ++i_ps) {
332  psClusterPointers.push_back(i_ps->second.get());
333  }
334  auto calibratedEnergies = _pfEnergyCalibration->calibrateEndcapClusterEnergies(
335  *(clus->the_ptr()), psClusterPointers, *channelStatus_, applyCrackCorrections_);
336  ePS1 = calibratedEnergies.ps1Energy;
337  ePS2 = calibratedEnergies.ps2Energy;
338  }
339 
340  if (ePS1 == -1.)
341  ePS1 = 0;
342  if (ePS2 == -1.)
343  ePS2 = 0;
344 
345  switch (_eweight) {
346  case kRaw: // energyweight is initialized to raw cluster energy
347  break;
348  case kCalibratedNoPS:
349  energyweight = clus->energy() - ePS1 - ePS2;
350  break;
351  case kCalibratedTotal:
352  energyweight = clus->energy();
353  break;
354  default:
355  break;
356  }
357  const math::XYZPoint& cluspos = clus->the_ptr()->position();
358  posX += energyweight * cluspos.X();
359  posY += energyweight * cluspos.Y();
360  posZ += energyweight * cluspos.Z();
361 
362  energyweighttot += energyweight;
363  corrSCEnergy += clus->energy();
364  corrPS1Energy += ePS1;
365  corrPS2Energy += ePS2;
366  }
367  posX /= energyweighttot;
368  posY /= energyweighttot;
369  posZ /= energyweighttot;
370 
371  // now build the supercluster
372  reco::SuperCluster new_sc(corrSCEnergy, math::XYZPoint(posX, posY, posZ));
373  new_sc.setCorrectedEnergy(corrSCEnergy);
374  new_sc.setSeed(clustered.front()->the_ptr());
375  new_sc.setPreshowerEnergy(corrPS1Energy + corrPS2Energy);
376  new_sc.setPreshowerEnergyPlane1(corrPS1Energy);
377  new_sc.setPreshowerEnergyPlane2(corrPS2Energy);
378  for (const auto& clus : clustered) {
379  new_sc.addCluster(clus->the_ptr());
380 
381  auto& hits_and_fractions = clus->the_ptr()->hitsAndFractions();
382  for (auto& hit_and_fraction : hits_and_fractions) {
383  new_sc.addHitAndFraction(hit_and_fraction.first, hit_and_fraction.second);
384  }
385  if (isEE) {
386  auto ee_key_val = std::make_pair(clus->the_ptr().key(), edm::Ptr<reco::PFCluster>());
387  const auto clustops = std::equal_range(EEtoPS_->begin(), EEtoPS_->end(), ee_key_val, sortByKey);
388  // EE rechits should be uniquely matched to sets of pre-shower
389  // clusters at this point, so we throw an exception if otherwise
390  // now wrapped in EDM debug flags
391  for (auto i_ps = clustops.first; i_ps != clustops.second; ++i_ps) {
392  edm::Ptr<reco::PFCluster> psclus(i_ps->second);
393 #ifdef EDM_ML_DEBUG
394  auto found_pscluster = std::find_if(new_sc.preshowerClustersBegin(),
395  new_sc.preshowerClustersEnd(),
396  [&i_ps](const auto& i) { return i.key() == i_ps->first; });
397  if (found_pscluster == new_sc.preshowerClustersEnd()) {
398 #endif
399  new_sc.addPreshowerCluster(psclus);
400 #ifdef EDM_ML_DEBUG
401  } else {
402  throw cms::Exception("PFECALSuperClusterAlgo::buildSuperCluster")
403  << "Found a PS cluster matched to more than one EE cluster!" << std::endl
404  << std::hex << psclus.get() << " == " << found_pscluster->get() << std::dec << std::endl;
405  }
406 #endif
407  }
408  }
409  }
410 
411  // calculate linearly weighted cluster widths
412  PFClusterWidthAlgo pfwidth(bare_ptrs);
413  new_sc.setEtaWidth(pfwidth.pflowEtaWidth());
414  new_sc.setPhiWidth(pfwidth.pflowPhiWidth());
415 
416  // cache the value of the raw energy
417  new_sc.rawEnergy();
418 
419  //apply regression energy corrections
420  if (useRegression_) {
421  regr_->modifyObject(new_sc);
422  }
423 
424  // save the super cluster to the appropriate list (if it passes the final
425  // Et threshold)
426  //Note that Et is computed here with respect to the beamspot position
427  //in order to be consistent with the cut applied in the
428  //ElectronSeedProducer
429  double scEtBS = ptFast(new_sc.energy(), new_sc.position(), beamSpot_->position());
430 
431  if (scEtBS > threshSuperClusterEt_) {
432  switch (seed->the_ptr()->layer()) {
434  if (isOOTCollection_) {
435  DetId seedId = new_sc.seed()->seed();
437  if (!seedRecHit->checkFlag(EcalRecHit::kOutOfTime))
438  break;
439  }
440  superClustersEB_->push_back(new_sc);
441  break;
442  case PFLayer::HGCAL:
444  if (isOOTCollection_) {
445  DetId seedId = new_sc.seed()->seed();
447  if (!seedRecHit->checkFlag(EcalRecHit::kOutOfTime))
448  break;
449  }
450  superClustersEE_->push_back(new_sc);
451  break;
452  default:
453  break;
454  }
455  }
456 }
PFECALSuperClusterAlgo::clustering_type
clustering_type
Definition: PFECALSuperClusterAlgo.h:44
PFECALSuperClusterAlgo::inputTagPFClustersES_
edm::EDGetTokenT< reco::PFCluster::EEtoPSAssociation > inputTagPFClustersES_
Definition: PFECALSuperClusterAlgo.h:115
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
PFECALSuperClusterAlgo::verbose_
bool verbose_
Definition: PFECALSuperClusterAlgo.h:132
mps_fire.i
i
Definition: mps_fire.py:355
PFClusterWidthAlgo::pflowEtaWidth
double pflowEtaWidth() const
Definition: PFClusterWidthAlgo.h:15
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
MessageLogger.h
PFECALSuperClusterAlgo::buildAllSuperClusters
void buildAllSuperClusters(CalibratedClusterPtrVector &, double seedthresh)
Definition: PFECALSuperClusterAlgo.cc:235
edm::Handle::product
T const * product() const
Definition: Handle.h:70
PFECALSuperClusterAlgo::superClustersEE_
std::unique_ptr< reco::SuperClusterCollection > superClustersEE_
Definition: PFECALSuperClusterAlgo.h:124
PFECALSuperClusterAlgo::doSatelliteClusterMerge_
bool doSatelliteClusterMerge_
Definition: PFECALSuperClusterAlgo.h:150
PFECALSuperClusterAlgo::inputTagEndcapRecHits_
edm::EDGetTokenT< EcalRecHitCollection > inputTagEndcapRecHits_
Definition: PFECALSuperClusterAlgo.h:162
reco::SuperCluster
Definition: SuperCluster.h:18
ESChannelStatusRcd
Definition: ESChannelStatusRcd.h:5
HLT_2018_cff.maxDPhi
maxDPhi
Definition: HLT_2018_cff.py:7827
hgcalDigisL1Seeded_cfi.maxDEta
maxDEta
Definition: hgcalDigisL1Seeded_cfi.py:6
PFECALSuperClusterAlgo::_eweight
energy_weight _eweight
Definition: PFECALSuperClusterAlgo.h:128
PFECALSuperClusterAlgo::inputTagPFClusters_
edm::EDGetTokenT< edm::View< reco::PFCluster > > inputTagPFClusters_
Definition: PFECALSuperClusterAlgo.h:114
reco::CaloCluster::setCorrectedEnergy
void setCorrectedEnergy(double cenergy)
Definition: CaloCluster.h:137
PFECALSuperClusterAlgo::_pfEnergyCalibration
std::shared_ptr< PFEnergyCalibration > _pfEnergyCalibration
Definition: PFECALSuperClusterAlgo.h:126
reco::SuperCluster::setEtaWidth
void setEtaWidth(double ew)
Definition: SuperCluster.h:74
edm::LogInfo
Definition: MessageLogger.h:254
PFECALSuperClusterAlgo::barrelRecHits_
const EcalRecHitCollection * barrelRecHits_
Definition: PFECALSuperClusterAlgo.h:163
PFECALSuperClusterAlgo::channelStatus_
const ESChannelStatus * channelStatus_
Definition: PFECALSuperClusterAlgo.h:119
edm::SortedCollection< EcalRecHit >
edm::Ptr::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:139
ESDetId.h
findQualityFiles.v
v
Definition: findQualityFiles.py:179
PFECALSuperClusterAlgo::etawidthSuperClusterEndcap_
double etawidthSuperClusterEndcap_
Definition: PFECALSuperClusterAlgo.h:148
reco::SuperCluster::setPreshowerEnergy
void setPreshowerEnergy(double preshowerEnergy)
Definition: SuperCluster.h:70
ESChannelStatusRcd.h
edm::Handle
Definition: AssociativeIterator.h:50
PFECALSuperClusterAlgo.h
PFECALSuperClusterAlgo::kMustache
Definition: PFECALSuperClusterAlgo.h:44
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
PFECALSuperClusterAlgo::setPFClusterCalibration
void setPFClusterCalibration(const std::shared_ptr< PFEnergyCalibration > &)
Definition: PFECALSuperClusterAlgo.cc:111
HLT_2018_cff.dEta
dEta
Definition: HLT_2018_cff.py:12289
PFRecHit.h
PFECALSuperClusterAlgo::useRegression_
bool useRegression_
Definition: PFECALSuperClusterAlgo.h:135
Mustache.h
PFLayer::ECAL_BARREL
Definition: PFLayer.h:33
PFClusterWidthAlgo::pflowPhiWidth
double pflowPhiWidth() const
Definition: PFClusterWidthAlgo.h:14
cc
PFLayer.h
reco::SuperCluster::addCluster
void addCluster(const CaloClusterPtr &r)
add reference to constituent BasicCluster
Definition: SuperCluster.h:122
PFECALSuperClusterAlgo::threshPFClusterSeedEndcap_
double threshPFClusterSeedEndcap_
Definition: PFECALSuperClusterAlgo.h:142
reco::SuperCluster::setSeed
void setSeed(const CaloClusterPtr &r)
list of used xtals by DetId // now inherited by CaloCluster
Definition: SuperCluster.h:107
reco::SuperCluster::preshowerClustersBegin
CaloCluster_iterator preshowerClustersBegin() const
fist iterator over PreshowerCluster constituents
Definition: SuperCluster.h:92
SCEnergyCorrectorSemiParm
Definition: SCEnergyCorrectorSemiParm.h:37
DetId
Definition: DetId.h:17
PFECALSuperClusterAlgo::loadAndSortPFClusters
void loadAndSortPFClusters(const edm::Event &evt)
Definition: PFECALSuperClusterAlgo.cc:148
PFECALSuperClusterAlgo::phiwidthSuperClusterBarrel_
double phiwidthSuperClusterBarrel_
Definition: PFECALSuperClusterAlgo.h:145
PFECALSuperClusterAlgo::run
void run()
Definition: PFECALSuperClusterAlgo.cc:228
PFECALSuperClusterAlgo::CalibratedClusterPtr
std::shared_ptr< CalibratedPFCluster > CalibratedClusterPtr
Definition: PFECALSuperClusterAlgo.h:62
PFECALSuperClusterAlgo::buildSuperCluster
void buildSuperCluster(CalibratedClusterPtr &, CalibratedClusterPtrVector &)
Definition: PFECALSuperClusterAlgo.cc:248
ESEEIntercalibConstantsRcd
Definition: ESEEIntercalibConstantsRcd.h:5
edm::PtrVector< reco::PFCluster >
PFECALSuperClusterAlgo::threshSuperClusterEt_
double threshSuperClusterEt_
Definition: PFECALSuperClusterAlgo.h:138
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
vertices_cff.x
x
Definition: vertices_cff.py:29
reco::BeamSpot
Definition: BeamSpot.h:21
PFECALSuperClusterAlgo::CalibratedClusterPtrVector
std::vector< CalibratedClusterPtr > CalibratedClusterPtrVector
Definition: PFECALSuperClusterAlgo.h:63
HLT_2018_cff.dPhi
dPhi
Definition: HLT_2018_cff.py:12290
edm::ESHandle< ESEEIntercalibConstants >
RecoTauValidation_cfi.posX
posX
Definition: RecoTauValidation_cfi.py:288
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
reco::MustacheKernel::inDynamicDPhiWindow
bool inDynamicDPhiWindow(const float seedEta, const float seedPhi, const float ClustE, const float ClusEta, const float clusPhi)
Definition: Mustache.cc:68
PFLayer::HGCAL
Definition: PFLayer.h:40
PFECALSuperClusterAlgo::setTokens
void setTokens(const edm::ParameterSet &, edm::ConsumesCollector &&)
Definition: PFECALSuperClusterAlgo.cc:115
reco::BeamSpot::position
const Point & position() const
position
Definition: BeamSpot.h:59
PFECALSuperClusterAlgo::dropUnseedable_
bool dropUnseedable_
Definition: PFECALSuperClusterAlgo.h:152
PFECALSuperClusterAlgo::_clustype
clustering_type _clustype
Definition: PFECALSuperClusterAlgo.h:127
PFECALSuperClusterAlgo::threshPFClusterEndcap_
double threshPFClusterEndcap_
Definition: PFECALSuperClusterAlgo.h:143
PFClusterWidthAlgo.h
b
double b
Definition: hdecay.h:118
reco::SuperCluster::setPreshowerEnergyPlane1
void setPreshowerEnergyPlane1(double preshowerEnergy1)
Definition: SuperCluster.h:71
L1EGammaClusterEmuProducer_cfi.calib
calib
Definition: L1EGammaClusterEmuProducer_cfi.py:4
calib
Definition: CalibElectron.h:12
PFECALSuperClusterAlgo::kRaw
Definition: PFECALSuperClusterAlgo.h:45
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
PFECALSuperClusterAlgo::inputTagBarrelRecHits_
edm::EDGetTokenT< EcalRecHitCollection > inputTagBarrelRecHits_
Definition: PFECALSuperClusterAlgo.h:161
edm::View
Definition: CaloClusterFwd.h:14
EcalRecHit::kOutOfTime
Definition: EcalRecHit.h:23
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
a
double a
Definition: hdecay.h:119
PFECALSuperClusterAlgo::threshPFClusterSeedBarrel_
double threshPFClusterSeedBarrel_
Definition: PFECALSuperClusterAlgo.h:140
PFECALSuperClusterAlgo::applyCrackCorrections_
bool applyCrackCorrections_
Definition: PFECALSuperClusterAlgo.h:156
reco::SuperCluster::seed
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
PFECALSuperClusterAlgo::fractionForMajority_
double fractionForMajority_
Definition: PFECALSuperClusterAlgo.h:151
PFECALSuperClusterAlgo::threshPFClusterBarrel_
double threshPFClusterBarrel_
Definition: PFECALSuperClusterAlgo.h:141
HcalDetId.h
reco::CaloCluster::addHitAndFraction
void addHitAndFraction(DetId id, float fraction)
Definition: CaloCluster.h:203
PFECALSuperClusterAlgo::EEtoPS_
const reco::PFCluster::EEtoPSAssociation * EEtoPS_
Definition: PFECALSuperClusterAlgo.h:125
LinkByRecHit.h
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
ESChannelStatus.h
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::LogVerbatim
Definition: MessageLogger.h:297
edm::EventSetup
Definition: EventSetup.h:57
ESEEIntercalibConstantsRcd.h
PFECALSuperClusterAlgo::inputTagBeamSpot_
edm::EDGetTokenT< reco::BeamSpot > inputTagBeamSpot_
Definition: PFECALSuperClusterAlgo.h:116
reco::SuperCluster::addPreshowerCluster
void addPreshowerCluster(const CaloClusterPtr &r)
add reference to constituent BasicCluster
Definition: SuperCluster.h:128
get
#define get
ESEEIntercalibConstants.h
PFECALSuperClusterAlgo::phiwidthSuperClusterEndcap_
double phiwidthSuperClusterEndcap_
Definition: PFECALSuperClusterAlgo.h:147
PFECALSuperClusterAlgo::satelliteThreshold_
double satelliteThreshold_
Definition: PFECALSuperClusterAlgo.h:151
reco::CaloCluster::position
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:154
edm::Ptr< reco::PFCluster >
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
reco::PFCluster::EEtoPSAssociation
std::vector< std::pair< CaloClusterPtr::key_type, edm::Ptr< PFCluster > > > EEtoPSAssociation
Definition: PFCluster.h:48
reco::SuperCluster::setPreshowerEnergyPlane2
void setPreshowerEnergyPlane2(double preshowerEnergy2)
Definition: SuperCluster.h:72
edm::SortedCollection::find
iterator find(key_type k)
Definition: SortedCollection.h:240
type
type
Definition: HCALResponse.h:21
std
Definition: JetResolutionObject.h:76
PFECALSuperClusterAlgo::kCalibratedTotal
Definition: PFECALSuperClusterAlgo.h:45
PFECALSuperClusterAlgo::update
void update(const edm::EventSetup &)
Definition: PFECALSuperClusterAlgo.cc:134
reco::SuperCluster::rawEnergy
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
Definition: SuperCluster.h:58
PFECALSuperClusterAlgo::_clustersEE
CalibratedClusterPtrVector _clustersEE
Definition: PFECALSuperClusterAlgo.h:122
Exception
Definition: hltDiff.cc:246
PFClusterWidthAlgo
Definition: PFClusterWidthAlgo.h:6
PFECALSuperClusterAlgo::kBOX
Definition: PFECALSuperClusterAlgo.h:44
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
reco::SuperCluster::preshowerClustersEnd
CaloCluster_iterator preshowerClustersEnd() const
last iterator over PreshowerCluster constituents
Definition: SuperCluster.h:95
ptFast
double ptFast(const double energy, const math::XYZPoint &position, const math::XYZPoint &origin)
Definition: SuperClusterImporter.cc:12
reco::SuperCluster::setPhiWidth
void setPhiWidth(double pw)
Definition: SuperCluster.h:73
EEPSPair
reco::PFCluster::EEtoPSAssociation::value_type EEPSPair
Definition: PFClusterMatchedToPhotonsSelector.cc:40
PFECALSuperClusterAlgo::_clustersEB
CalibratedClusterPtrVector _clustersEB
Definition: PFECALSuperClusterAlgo.h:121
sortByKey
bool sortByKey(const EEPSPair &a, const EEPSPair &b)
Definition: PFClusterMatchedToPhotonsSelector.cc:41
PFECALSuperClusterAlgo::CalibratedPFCluster
Definition: PFECALSuperClusterAlgo.h:48
PFECALSuperClusterAlgo::beamSpot_
const reco::BeamSpot * beamSpot_
Definition: PFECALSuperClusterAlgo.h:118
reco::MustacheKernel::inMustache
bool inMustache(const float maxEta, const float maxPhi, const float ClustE, const float ClusEta, const float ClusPhi)
Definition: Mustache.cc:9
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
PFECALSuperClusterAlgo::superClustersEB_
std::unique_ptr< reco::SuperClusterCollection > superClustersEB_
Definition: PFECALSuperClusterAlgo.h:123
PFECALSuperClusterAlgo::PFECALSuperClusterAlgo
PFECALSuperClusterAlgo()
constructor
Definition: PFECALSuperClusterAlgo.cc:109
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426
PFECALSuperClusterAlgo::etawidthSuperClusterBarrel_
double etawidthSuperClusterBarrel_
Definition: PFECALSuperClusterAlgo.h:146
PFLayer::ECAL_ENDCAP
Definition: PFLayer.h:32
edm::Event
Definition: Event.h:73
PFECALSuperClusterAlgo::kCalibratedNoPS
Definition: PFECALSuperClusterAlgo.h:45
PFECALSuperClusterAlgo::endcapRecHits_
const EcalRecHitCollection * endcapRecHits_
Definition: PFECALSuperClusterAlgo.h:164
reco::CaloCluster::energy
double energy() const
cluster energy
Definition: CaloCluster.h:149
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
PFECALSuperClusterAlgo::isOOTCollection_
bool isOOTCollection_
Definition: PFECALSuperClusterAlgo.h:160
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
RecoTauValidation_cfi.posY
posY
Definition: RecoTauValidation_cfi.py:289
SurveyInfoScenario_cff.seed
seed
Definition: SurveyInfoScenario_cff.py:295
PFECALSuperClusterAlgo::useDynamicDPhi_
bool useDynamicDPhi_
Definition: PFECALSuperClusterAlgo.h:154
PFECALSuperClusterAlgo::threshIsET_
bool threshIsET_
Definition: PFECALSuperClusterAlgo.h:157
PFECALSuperClusterAlgo::regr_
std::unique_ptr< SCEnergyCorrectorSemiParm > regr_
Definition: PFECALSuperClusterAlgo.h:136