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