#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 EcalRecHitCollection * | ebRecHits_ |
const EcalRecHitCollection * | eeRecHits_ |
const CaloGeometry * | geometry_ |
tool to clean reco::Supercluster from effects of multiple interactions ( PU )
Definition at line 22 of file EcalClusterPUCleaningTools.h.
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.
References getEBRecHits(), getEERecHits(), and getGeometry().
{ getGeometry( es ); getEBRecHits( ev, redEBRecHits ); getEERecHits( ev, redEERecHits ); }
EcalClusterPUCleaningTools::~EcalClusterPUCleaningTools | ( | ) |
Definition at line 23 of file EcalClusterPUCleaningTools.cc.
{ }
reco::SuperCluster EcalClusterPUCleaningTools::CleanedSuperCluster | ( | float | xi, |
const reco::SuperCluster & | cluster, | ||
const edm::Event & | ev | ||
) |
Definition at line 52 of file EcalClusterPUCleaningTools.cc.
References SuperClusterShapeAlgo::Calculate_Covariances(), reco::SuperCluster::clustersBegin(), reco::SuperCluster::clustersEnd(), gather_cfg::cout, ebRecHits_, DetId::Ecal, EcalBarrel, EcalEndcap, eeRecHits_, relval_parameters_module::energy, SuperClusterShapeAlgo::etaWidth(), geometry_, CaloGeometry::getSubdetectorGeometry(), SuperClusterShapeAlgo::phiWidth(), reco::SuperCluster::preshowerEnergy(), edm::PtrVector< T >::push_back(), reco::SuperCluster::seed(), and mathSSE::sqrt().
{ //std::cout << "\nEcalClusterPUCleaningTools::CleanedSuperCluster called, this will give you back a cleaned supercluster" << std::endl; // seed basic cluster of initial SC: this will remain in the cleaned SC, by construction reco::CaloClusterPtr seed = scluster.seed(); float seedBCEnergy = (scluster.seed())->energy(); // this should be replaced by the 5x5 around the seed; a good approx of how E_seed is defined float eSeed = 0.35; // standard eSeed in EB ; see CMS IN-2010/008 int numBcRemoved = 0; double ClusterE = 0; //Sum of cluster energies for supercluster. //Holders for position of this supercluster. double posX=0; double posY=0; double posZ=0; reco::CaloClusterPtrVector thissc; // looping on basic clusters within the Supercluster for(reco::CaloCluster_iterator bcIt = scluster.clustersBegin(); bcIt!=scluster.clustersEnd(); bcIt++) { // E_seed is an Et selection on 5x1 dominoes (around which BC's are built), see CMS IN-2010/008 // here such selection is implemented on the full BC around it if( (*bcIt)->energy() > sqrt( eSeed*eSeed + xi*xi*seedBCEnergy*seedBCEnergy/cosh((*bcIt)->eta())/cosh((*bcIt)->eta()) ) ) { ; }// the sum only of the BC's that pass the Esee selection else{ numBcRemoved++; continue; }// count how many basic cluster get removed by the cleaning // if BC passes dynamic selection, include it in the 'cleaned' supercluster thissc.push_back( (*bcIt) ); // cumulate energy and position of the cleaned supercluster ClusterE += (*bcIt)->energy(); posX += (*bcIt)->energy() * (*bcIt)->position().X(); posY += (*bcIt)->energy() * (*bcIt)->position().Y(); posZ += (*bcIt)->energy() * (*bcIt)->position().Z(); }// loop on basic clusters of the original SC posX /= ClusterE; posY /= ClusterE; posZ /= ClusterE; // make temporary 'cleaned' supercluster in oder to compute the covariances double Epreshower=scluster.preshowerEnergy(); double phiWidth=0.; double etaWidth=0.; reco::SuperCluster suCltmp(ClusterE, math::XYZPoint(posX, posY, posZ), seed, thissc, Epreshower, phiWidth, etaWidth); // construct cluster shape to compute ieta and iphi covariances of the SC const CaloSubdetectorGeometry *geometry_p=0; if (seed->seed().det() == DetId::Ecal && seed->seed().subdetId() == EcalBarrel){ geometry_p = geometry_->getSubdetectorGeometry(DetId::Ecal, EcalBarrel); SuperClusterShapeAlgo SCShape( ebRecHits_ , geometry_p); SCShape.Calculate_Covariances( suCltmp ); phiWidth= SCShape.phiWidth(); etaWidth= SCShape.etaWidth(); } else if (seed->seed().det() == DetId::Ecal && seed->seed().subdetId() == EcalEndcap){ geometry_p = geometry_->getSubdetectorGeometry(DetId::Ecal, EcalEndcap); SuperClusterShapeAlgo SCShape( eeRecHits_ , geometry_p); SCShape.Calculate_Covariances( suCltmp ); phiWidth= SCShape.phiWidth(); etaWidth= SCShape.etaWidth(); } else { std::cout << "The seed crystal of this SC is neither in EB nor in EE. This is a problem. Bailing out " << std::endl; assert(-1); } // return the cleaned supercluster SCluster, with covariances updated return reco::SuperCluster(ClusterE, math::XYZPoint(posX, posY, posZ), seed, thissc, Epreshower, phiWidth, etaWidth); }
void EcalClusterPUCleaningTools::getEBRecHits | ( | const edm::Event & | ev, |
const edm::InputTag & | redEBRecHits | ||
) | [private] |
Definition at line 35 of file EcalClusterPUCleaningTools.cc.
References ebRecHits_, edm::Event::getByLabel(), and edm::Handle< T >::product().
Referenced by EcalClusterPUCleaningTools().
{ edm::Handle< EcalRecHitCollection > pEBRecHits; ev.getByLabel( redEBRecHits, pEBRecHits ); ebRecHits_ = pEBRecHits.product(); }
void EcalClusterPUCleaningTools::getEERecHits | ( | const edm::Event & | ev, |
const edm::InputTag & | redEERecHits | ||
) | [private] |
Definition at line 44 of file EcalClusterPUCleaningTools.cc.
References eeRecHits_, edm::Event::getByLabel(), and edm::Handle< T >::product().
Referenced by EcalClusterPUCleaningTools().
{ edm::Handle< EcalRecHitCollection > pEERecHits; ev.getByLabel( redEERecHits, pEERecHits ); eeRecHits_ = pEERecHits.product(); }
void EcalClusterPUCleaningTools::getGeometry | ( | const edm::EventSetup & | es | ) | [private] |
Definition at line 28 of file EcalClusterPUCleaningTools.cc.
References geometry_, edm::EventSetup::get(), and edm::ESHandle< T >::product().
Referenced by EcalClusterPUCleaningTools().
{ edm::ESHandle<CaloGeometry> pGeometry; es.get<CaloGeometryRecord>().get(pGeometry); geometry_ = pGeometry.product(); }
const EcalRecHitCollection* EcalClusterPUCleaningTools::ebRecHits_ [private] |
Definition at line 34 of file EcalClusterPUCleaningTools.h.
Referenced by CleanedSuperCluster(), and getEBRecHits().
const EcalRecHitCollection* EcalClusterPUCleaningTools::eeRecHits_ [private] |
Definition at line 35 of file EcalClusterPUCleaningTools.h.
Referenced by CleanedSuperCluster(), and getEERecHits().
const CaloGeometry* EcalClusterPUCleaningTools::geometry_ [private] |
Definition at line 33 of file EcalClusterPUCleaningTools.h.
Referenced by CleanedSuperCluster(), and getGeometry().