CMS 3D CMS Logo

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