CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalClusterPUCleaningTools Class Reference

#include <EcalClusterPUCleaningTools.h>

Public Member Functions

reco::SuperCluster CleanedSuperCluster (float xi, const reco::SuperCluster &cluster, const edm::Event &ev)
 
 EcalClusterPUCleaningTools (const edm::Event &ev, const edm::EventSetup &es, const edm::InputTag &redEBRecHits, const edm::InputTag &redEERecHits)
 
 ~EcalClusterPUCleaningTools ()
 

Private Member Functions

void getEBRecHits (const edm::Event &ev, const edm::InputTag &redEBRecHits)
 
void getEERecHits (const edm::Event &ev, const edm::InputTag &redEERecHits)
 
void getGeometry (const edm::EventSetup &es)
 

Private Attributes

const EcalRecHitCollectionebRecHits_
 
const EcalRecHitCollectioneeRecHits_
 
const CaloGeometrygeometry_
 

Detailed Description

tool to clean reco::Supercluster from effects of multiple interactions ( PU )

Author
G. Franzoni - UMN
Version
$Id:

Definition at line 22 of file EcalClusterPUCleaningTools.h.

Constructor & Destructor Documentation

◆ EcalClusterPUCleaningTools()

EcalClusterPUCleaningTools::EcalClusterPUCleaningTools ( const edm::Event ev,
const edm::EventSetup es,
const edm::InputTag redEBRecHits,
const edm::InputTag redEERecHits 
)

Definition at line 14 of file EcalClusterPUCleaningTools.cc.

17  {
18  getGeometry(es);
19  getEBRecHits(ev, redEBRecHits);
20  getEERecHits(ev, redEERecHits);
21 }

References ev, getEBRecHits(), getEERecHits(), and getGeometry().

◆ ~EcalClusterPUCleaningTools()

EcalClusterPUCleaningTools::~EcalClusterPUCleaningTools ( )

Definition at line 23 of file EcalClusterPUCleaningTools.cc.

23 {}

Member Function Documentation

◆ CleanedSuperCluster()

reco::SuperCluster EcalClusterPUCleaningTools::CleanedSuperCluster ( float  xi,
const reco::SuperCluster cluster,
const edm::Event ev 
)

Definition at line 43 of file EcalClusterPUCleaningTools.cc.

45  {
46  //std::cout << "\nEcalClusterPUCleaningTools::CleanedSuperCluster called, this will give you back a cleaned supercluster" << std::endl;
47 
48  // seed basic cluster of initial SC: this will remain in the cleaned SC, by construction
49  const reco::CaloClusterPtr &seed = scluster.seed();
50 
51  // this should be replaced by the 5x5 around the seed; a good approx of how E_seed is defined
52  float seedBCEnergy = (scluster.seed())->energy();
53  float eSeed = 0.35; // standard eSeed in EB ; see CMS IN-2010/008
54  int numBcRemoved = 0;
55 
56  double ClusterE = 0; //Sum of cluster energies for supercluster.
57  //Holders for position of this supercluster.
58  double posX = 0;
59  double posY = 0;
60  double posZ = 0;
61 
63 
64  // looping on basic clusters within the Supercluster
65  for (reco::CaloCluster_iterator bcIt = scluster.clustersBegin(); bcIt != scluster.clustersEnd(); bcIt++) {
66  // E_seed is an Et selection on 5x1 dominoes (around which BC's are built), see CMS IN-2010/008
67  // here such selection is implemented on the full BC around it
68  if ((*bcIt)->energy() >
69  sqrt(eSeed * eSeed + xi * xi * seedBCEnergy * seedBCEnergy / cosh((*bcIt)->eta()) / cosh((*bcIt)->eta()))) {
70  ;
71  } // the sum only of the BC's that pass the Esee selection
72  else {
73  numBcRemoved++;
74  continue;
75  } // count how many basic cluster get removed by the cleaning
76 
77  // if BC passes dynamic selection, include it in the 'cleaned' supercluster
78  thissc.push_back((*bcIt));
79  // cumulate energy and position of the cleaned supercluster
80  ClusterE += (*bcIt)->energy();
81  posX += (*bcIt)->energy() * (*bcIt)->position().X();
82  posY += (*bcIt)->energy() * (*bcIt)->position().Y();
83  posZ += (*bcIt)->energy() * (*bcIt)->position().Z();
84 
85  } // loop on basic clusters of the original SC
86 
87  posX /= ClusterE;
88  posY /= ClusterE;
89  posZ /= ClusterE;
90 
91  // make temporary 'cleaned' supercluster in oder to compute the covariances
92  double Epreshower = scluster.preshowerEnergy();
93  double phiWidth = 0.;
94  double etaWidth = 0.;
95  reco::SuperCluster suCltmp(ClusterE, math::XYZPoint(posX, posY, posZ), seed, thissc, Epreshower, phiWidth, etaWidth);
96 
97  // construct cluster shape to compute ieta and iphi covariances of the SC
98  const CaloSubdetectorGeometry *geometry_p = nullptr;
99  if (seed->seed().det() == DetId::Ecal && seed->seed().subdetId() == EcalBarrel) {
101  SuperClusterShapeAlgo SCShape(ebRecHits_, geometry_p);
102  SCShape.Calculate_Covariances(suCltmp);
103  phiWidth = SCShape.phiWidth();
104  etaWidth = SCShape.etaWidth();
105  } else if (seed->seed().det() == DetId::Ecal && seed->seed().subdetId() == EcalEndcap) {
107  SuperClusterShapeAlgo SCShape(eeRecHits_, geometry_p);
108  SCShape.Calculate_Covariances(suCltmp);
109  phiWidth = SCShape.phiWidth();
110  etaWidth = SCShape.etaWidth();
111  } else {
112  std::cout << "The seed crystal of this SC is neither in EB nor in EE. This is a problem. Bailing out " << std::endl;
113  assert(-1);
114  }
115 
116  // return the cleaned supercluster SCluster, with covariances updated
117  return reco::SuperCluster(ClusterE, math::XYZPoint(posX, posY, posZ), seed, thissc, Epreshower, phiWidth, etaWidth);
118 }

References cms::cuda::assert(), SuperClusterShapeAlgo::Calculate_Covariances(), reco::SuperCluster::clustersBegin(), reco::SuperCluster::clustersEnd(), gather_cfg::cout, ebRecHits_, DetId::Ecal, EcalBarrel, EcalEndcap, eeRecHits_, HCALHighEnergyHPDFilter_cfi::energy, SuperClusterShapeAlgo::etaWidth(), geometry_, CaloGeometry::getSubdetectorGeometry(), SuperClusterShapeAlgo::phiWidth(), RecoTauValidation_cfi::posX, RecoTauValidation_cfi::posY, reco::SuperCluster::preshowerEnergy(), edm::PtrVector< T >::push_back(), reco::SuperCluster::seed(), fileCollector::seed, mathSSE::sqrt(), and protons_cff::xi.

◆ getEBRecHits()

void EcalClusterPUCleaningTools::getEBRecHits ( const edm::Event ev,
const edm::InputTag redEBRecHits 
)
private

Definition at line 31 of file EcalClusterPUCleaningTools.cc.

31  {
33  ev.getByLabel(redEBRecHits, pEBRecHits);
34  ebRecHits_ = pEBRecHits.product();
35 }

References ebRecHits_, ev, and edm::Handle< T >::product().

Referenced by EcalClusterPUCleaningTools().

◆ getEERecHits()

void EcalClusterPUCleaningTools::getEERecHits ( const edm::Event ev,
const edm::InputTag redEERecHits 
)
private

Definition at line 37 of file EcalClusterPUCleaningTools.cc.

37  {
39  ev.getByLabel(redEERecHits, pEERecHits);
40  eeRecHits_ = pEERecHits.product();
41 }

References eeRecHits_, ev, and edm::Handle< T >::product().

Referenced by EcalClusterPUCleaningTools().

◆ getGeometry()

void EcalClusterPUCleaningTools::getGeometry ( const edm::EventSetup es)
private

Definition at line 25 of file EcalClusterPUCleaningTools.cc.

25  {
27  es.get<CaloGeometryRecord>().get(pGeometry);
28  geometry_ = pGeometry.product();
29 }

References geometry_, edm::EventSetup::get(), get, and edm::ESHandle< T >::product().

Referenced by EcalClusterPUCleaningTools().

Member Data Documentation

◆ ebRecHits_

const EcalRecHitCollection* EcalClusterPUCleaningTools::ebRecHits_
private

Definition at line 37 of file EcalClusterPUCleaningTools.h.

Referenced by CleanedSuperCluster(), and getEBRecHits().

◆ eeRecHits_

const EcalRecHitCollection* EcalClusterPUCleaningTools::eeRecHits_
private

Definition at line 38 of file EcalClusterPUCleaningTools.h.

Referenced by CleanedSuperCluster(), and getEERecHits().

◆ geometry_

const CaloGeometry* EcalClusterPUCleaningTools::geometry_
private

Definition at line 36 of file EcalClusterPUCleaningTools.h.

Referenced by CleanedSuperCluster(), and getGeometry().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
EcalClusterPUCleaningTools::getGeometry
void getGeometry(const edm::EventSetup &es)
Definition: EcalClusterPUCleaningTools.cc:25
edm::Handle::product
T const * product() const
Definition: Handle.h:70
reco::SuperCluster
Definition: SuperCluster.h:18
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
EcalClusterPUCleaningTools::getEERecHits
void getEERecHits(const edm::Event &ev, const edm::InputTag &redEERecHits)
Definition: EcalClusterPUCleaningTools.cc:37
gather_cfg.cout
cout
Definition: gather_cfg.py:144
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
cms::cuda::assert
assert(be >=bs)
edm::PtrVectorItr
Definition: PtrVector.h:51
EcalClusterPUCleaningTools::geometry_
const CaloGeometry * geometry_
Definition: EcalClusterPUCleaningTools.h:36
edm::Handle
Definition: AssociativeIterator.h:50
EcalBarrel
Definition: EcalSubdetector.h:10
EcalClusterPUCleaningTools::getEBRecHits
void getEBRecHits(const edm::Event &ev, const edm::InputTag &redEBRecHits)
Definition: EcalClusterPUCleaningTools.cc:31
fileCollector.seed
seed
Definition: fileCollector.py:127
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
edm::PtrVector< CaloCluster >
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
EcalClusterPUCleaningTools::eeRecHits_
const EcalRecHitCollection * eeRecHits_
Definition: EcalClusterPUCleaningTools.h:38
edm::ESHandle< CaloGeometry >
RecoTauValidation_cfi.posX
posX
Definition: RecoTauValidation_cfi.py:287
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
EcalClusterPUCleaningTools::ebRecHits_
const EcalRecHitCollection * ebRecHits_
Definition: EcalClusterPUCleaningTools.h:37
EcalEndcap
Definition: EcalSubdetector.h:10
edm::PtrVector::push_back
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:149
SuperClusterShapeAlgo
Definition: SuperClusterShapeAlgo.h:27
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
DetId::Ecal
Definition: DetId.h:27
get
#define get
edm::Ptr< CaloCluster >
protons_cff.xi
xi
Definition: protons_cff.py:31
ev
bool ev
Definition: Hydjet2Hadronizer.cc:97
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
RecoTauValidation_cfi.posY
posY
Definition: RecoTauValidation_cfi.py:288