CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

SuperClusterHelper Class Reference

#include <SuperClusterHelper.h>

List of all members.

Public Member Functions

float clustersSize () const
float e2nd () const
float e2x5Bottom () const
float e2x5Left () const
float e2x5Max () const
float e2x5Right () const
float e2x5Top () const
float e3x3 () const
float e5x5 () const
float eBottom () const
float eESClusters () const
float eLeft () const
float eMax () const
float eRight () const
float esClusterEnergy (unsigned i) const
float esClusterEta (unsigned i) const
float esClusterPhi (unsigned i) const
float eSubClusters () const
float eta () const
float etaCrySeed ()
float etaWidth () const
float eTop () const
float hadronicOverEm () const
int ietaSeed ()
int iphiSeed ()
float nPreshowerClusters () const
float phi () const
float phiCrySeed ()
float phiTilt ()
float phiWidth () const
float preshowerEnergy () const
float preshowerEnergyOverRaw () const
float r9 () const
float rawEnergy () const
float seedEnergy () const
float seedEta () const
float seedPhi () const
float sep ()
float sigmaIetaIeta () const
float spp ()
float subClusterE3x3 (unsigned i) const
float subClusterEmax (unsigned i) const
float subClusterEnergy (unsigned i) const
float subClusterEta (unsigned i) const
float subClusterPhi (unsigned i) const
 SuperClusterHelper (const pat::Electron *electron, const EcalRecHitCollection *rechits, const CaloTopology *, const CaloGeometry *)
 SuperClusterHelper (const reco::GsfElectron *electron, const EcalRecHitCollection *rechits, const CaloTopology *, const CaloGeometry *)
float thetaTilt ()
 ~SuperClusterHelper ()

Private Member Functions

void computeLocalCovariances ()
void localCoordinates ()

Static Private Member Functions

static bool sortClusters (const reco::CaloCluster *c1, const reco::CaloCluster *c2)

Private Attributes

bool barrel_
bool covComputed_
float eESClusters_
float eSubClusters_
float etaCrySeed_
const CaloGeometrygeometry_
int ietaSeed_
int iphiSeed_
EcalClusterLocal local_
bool localCoordinatesComputed_
 local coordinates
unsigned nBasicClusters_
unsigned nESClusters_
float phiCrySeed_
float phiTilt_
const EcalRecHitCollectionrechits_
const reco::CaloClusterseedCluster_
float sep_
float spp_
std::vector< const
reco::CaloCluster * > 
theBasicClusters_
const reco::GsfElectrontheElectron_
std::vector< const
reco::CaloCluster * > 
theESClusters_
const reco::SuperClustertheSuperCluster_
float thetaTilt_
const CaloTopologytopology_
std::vector< float > vCov_

Detailed Description

Definition at line 14 of file SuperClusterHelper.h.


Constructor & Destructor Documentation

SuperClusterHelper::SuperClusterHelper ( const reco::GsfElectron electron,
const EcalRecHitCollection rechits,
const CaloTopology topo,
const CaloGeometry geom 
)

Definition at line 7 of file SuperClusterHelper.cc.

References barrel_, reco::SuperCluster::clustersBegin(), reco::SuperCluster::clustersEnd(), covComputed_, eESClusters_, metsig::electron, eSubClusters_, relativeConstraints::geom, geometry_, reco::GsfElectron::isEB(), localCoordinatesComputed_, nBasicClusters_, nESClusters_, reco::SuperCluster::preshowerClustersBegin(), reco::SuperCluster::preshowerClustersEnd(), HI_PhotonSkim_cff::rechits, rechits_, seedCluster_, python::multivaluedict::sort(), sortClusters(), reco::GsfElectron::superCluster(), theBasicClusters_, theElectron_, theESClusters_, theSuperCluster_, and topology_.

                                                                                                                                                                  {
  theElectron_  = electron;
  rechits_ = rechits ;
  seedCluster_ = & (*(electron->superCluster()->seed()));
  theSuperCluster_ = &(*electron->superCluster());
  
  eSubClusters_ = 0.;
  // Store subclusters
  reco::CaloCluster_iterator itscl = theSuperCluster_->clustersBegin();
  reco::CaloCluster_iterator itsclE = theSuperCluster_->clustersEnd();
  for(; itscl < itsclE ; ++itscl) {
    if((*itscl)==electron->superCluster()->seed()) continue; // skip seed cluster
    theBasicClusters_.push_back(&(**itscl));  
    eSubClusters_ += (*itscl)->energy();
  }
  // sort subclusters
  sort(theBasicClusters_.begin(), theBasicClusters_.end(), SuperClusterHelper::sortClusters);
  // Add seed cluster at the beginning
  theBasicClusters_.insert(theBasicClusters_.begin(), seedCluster_);

  nBasicClusters_ = theBasicClusters_.size();

  // Store ES clusters
  eESClusters_ = 0. ;
  itscl = theSuperCluster_->preshowerClustersBegin();
  itsclE = theSuperCluster_->preshowerClustersEnd();
  for( ; itscl < itsclE ; ++ itscl) {
    theESClusters_.push_back(&(**itscl)); 
    eESClusters_ += (*itscl)->energy(); 
  }
  // sort ES clusters
  sort(theESClusters_.begin(), theESClusters_.end(), SuperClusterHelper::sortClusters);

  nESClusters_ = theESClusters_.size();

  topology_ = topo;
  geometry_ = geom;
  barrel_ = electron->isEB();
  covComputed_ = false;
  localCoordinatesComputed_ = false;
}
SuperClusterHelper::SuperClusterHelper ( const pat::Electron electron,
const EcalRecHitCollection rechits,
const CaloTopology topo,
const CaloGeometry geom 
)

Definition at line 49 of file SuperClusterHelper.cc.

References barrel_, pat::Electron::basicClusters(), covComputed_, alignCSCRings::e, eESClusters_, reco::CaloCluster::energy(), relval_parameters_module::energy, eSubClusters_, reco::CaloCluster::eta(), eta(), relativeConstraints::geom, geometry_, reco::GsfElectron::isEB(), localCoordinatesComputed_, nBasicClusters_, nESClusters_, phi(), reco::CaloCluster::phi(), pat::Electron::preshowerClusters(), HI_PhotonSkim_cff::rechits, rechits_, pat::Electron::seed(), seedCluster_, python::multivaluedict::sort(), sortClusters(), pat::Electron::superCluster(), theBasicClusters_, theElectron_, theESClusters_, theSuperCluster_, and topology_.

                                                                                                                                                               {
  theElectron_  = (const reco::GsfElectron*)electron;
  rechits_ = rechits ;
//  for(unsigned ir=0; ir<rechits_->size();++ir) {
//    std::cout << "RecHit " << (*rechits_)[ir].id().rawId() << " " << (*rechits_)[ir] << std::endl;
//  }
  // Get the embedded objects
  theSuperCluster_ = &(*electron->superCluster());
  seedCluster_ = & (*(electron->seed()));
  const std::vector<reco::CaloCluster>& basicClusters(electron->basicClusters());
  nBasicClusters_ = basicClusters.size();
  eSubClusters_ = 0. ;
  // Store subclusters
  for ( unsigned ib = 0; ib < nBasicClusters_ ; ++ib) {
    if(fabs((basicClusters[ib].energy()-seedCluster_->energy())/seedCluster_->energy())<1.e-5 &&
       fabs((basicClusters[ib].eta()-seedCluster_->eta())/seedCluster_->eta())<1.e-5 &&
       fabs((basicClusters[ib].phi()-seedCluster_->phi())/seedCluster_->phi())<1.e-5 
       ) 
        continue; // skip seed cluster
    theBasicClusters_.push_back(&basicClusters[ib]); 
    eSubClusters_ += basicClusters[ib].energy();
  }
  // sort subclusters
  sort(theBasicClusters_.begin(), theBasicClusters_.end(), SuperClusterHelper::sortClusters);
  // Add seed cluster at the beginning
  theBasicClusters_.insert(theBasicClusters_.begin(), seedCluster_);
          
  // Store ES clusters
  const std::vector<reco::CaloCluster>& esClusters(electron->preshowerClusters());
  nESClusters_ = esClusters.size();
  eESClusters_ = 0. ;
  for (unsigned ib = 0 ; ib < nESClusters_ ; ++ ib) {
    theESClusters_.push_back(&esClusters[ib]);
    eESClusters_ += esClusters[ib].energy();
  }
  // sort ES clusters
  sort(theESClusters_.begin(), theESClusters_.end(), SuperClusterHelper::sortClusters);

//  std::vector< std::pair<DetId, float> >::const_iterator it=seedCluster_->hitsAndFractions().begin();
//  std::vector< std::pair<DetId, float> >::const_iterator itend=seedCluster_->hitsAndFractions().end();
//  for( ; it!=itend ; ++it) {
//    DetId id=it->first;
//    std::cout << " Basic cluster " << id.rawId() << std::endl;
//  }
  topology_ = topo;
  geometry_ = geom;
  barrel_ = electron->isEB();
  covComputed_ = false;
  localCoordinatesComputed_ = false; 
}
SuperClusterHelper::~SuperClusterHelper ( ) [inline]

Definition at line 18 of file SuperClusterHelper.h.

{};

Member Function Documentation

float SuperClusterHelper::clustersSize ( ) const [inline]
void SuperClusterHelper::computeLocalCovariances ( ) [private]
float SuperClusterHelper::e2nd ( ) const [inline]
float SuperClusterHelper::e2x5Bottom ( ) const [inline]
float SuperClusterHelper::e2x5Left ( ) const [inline]
float SuperClusterHelper::e2x5Max ( ) const [inline]
float SuperClusterHelper::e2x5Right ( ) const [inline]
float SuperClusterHelper::e2x5Top ( ) const [inline]
float SuperClusterHelper::e3x3 ( ) const [inline]
float SuperClusterHelper::e5x5 ( ) const [inline]
float SuperClusterHelper::eBottom ( ) const [inline]
float SuperClusterHelper::eESClusters ( ) const [inline]
float SuperClusterHelper::eLeft ( ) const [inline]
float SuperClusterHelper::eMax ( ) const [inline]
float SuperClusterHelper::eRight ( ) const [inline]
float SuperClusterHelper::esClusterEnergy ( unsigned  i) const
float SuperClusterHelper::esClusterEta ( unsigned  i) const
float SuperClusterHelper::esClusterPhi ( unsigned  i) const
float SuperClusterHelper::eSubClusters ( ) const [inline]
float SuperClusterHelper::eta ( ) const [inline]
float SuperClusterHelper::etaCrySeed ( ) [inline]
float SuperClusterHelper::etaWidth ( ) const [inline]
float SuperClusterHelper::eTop ( ) const [inline]
float SuperClusterHelper::hadronicOverEm ( ) const [inline]
int SuperClusterHelper::ietaSeed ( ) [inline]
int SuperClusterHelper::iphiSeed ( ) [inline]
void SuperClusterHelper::localCoordinates ( ) [private]
float SuperClusterHelper::nPreshowerClusters ( ) const [inline]
float SuperClusterHelper::phi ( void  ) const [inline]
float SuperClusterHelper::phiCrySeed ( ) [inline]
float SuperClusterHelper::phiTilt ( ) [inline]

Definition at line 55 of file SuperClusterHelper.h.

References localCoordinates(), and phiTilt_.

float SuperClusterHelper::phiWidth ( ) const [inline]
float SuperClusterHelper::preshowerEnergy ( ) const [inline]
float SuperClusterHelper::preshowerEnergyOverRaw ( ) const [inline]
float SuperClusterHelper::r9 ( ) const [inline]
float SuperClusterHelper::rawEnergy ( ) const [inline]
float SuperClusterHelper::seedEnergy ( ) const [inline]
float SuperClusterHelper::seedEta ( ) const [inline]
float SuperClusterHelper::seedPhi ( ) const [inline]
float SuperClusterHelper::sep ( )
float SuperClusterHelper::sigmaIetaIeta ( ) const [inline]
static bool SuperClusterHelper::sortClusters ( const reco::CaloCluster c1,
const reco::CaloCluster c2 
) [inline, static, private]

Definition at line 109 of file SuperClusterHelper.h.

References reco::CaloCluster::energy().

Referenced by SuperClusterHelper().

  {
      return (c1->energy()>c2->energy());
  }
float SuperClusterHelper::spp ( )
float SuperClusterHelper::subClusterE3x3 ( unsigned  i) const
float SuperClusterHelper::subClusterEmax ( unsigned  i) const
float SuperClusterHelper::subClusterEnergy ( unsigned  i) const
float SuperClusterHelper::subClusterEta ( unsigned  i) const
float SuperClusterHelper::subClusterPhi ( unsigned  i) const
float SuperClusterHelper::thetaTilt ( ) [inline]

Definition at line 54 of file SuperClusterHelper.h.

References localCoordinates(), and thetaTilt_.


Member Data Documentation

Definition at line 83 of file SuperClusterHelper.h.

Referenced by localCoordinates(), and SuperClusterHelper().

cached variables covariance matrix

Definition at line 88 of file SuperClusterHelper.h.

Referenced by computeLocalCovariances(), and SuperClusterHelper().

Definition at line 103 of file SuperClusterHelper.h.

Referenced by eESClusters(), and SuperClusterHelper().

Definition at line 102 of file SuperClusterHelper.h.

Referenced by eSubClusters(), and SuperClusterHelper().

Definition at line 96 of file SuperClusterHelper.h.

Referenced by etaCrySeed(), and localCoordinates().

Definition at line 81 of file SuperClusterHelper.h.

Referenced by localCoordinates(), and SuperClusterHelper().

Definition at line 94 of file SuperClusterHelper.h.

Referenced by ietaSeed(), and localCoordinates().

Definition at line 95 of file SuperClusterHelper.h.

Referenced by iphiSeed(), and localCoordinates().

Definition at line 82 of file SuperClusterHelper.h.

Referenced by localCoordinates().

local coordinates

Definition at line 93 of file SuperClusterHelper.h.

Referenced by localCoordinates(), and SuperClusterHelper().

Definition at line 97 of file SuperClusterHelper.h.

Referenced by localCoordinates(), and phiCrySeed().

Definition at line 99 of file SuperClusterHelper.h.

Referenced by localCoordinates(), and phiTilt().

float SuperClusterHelper::sep_ [private]

Definition at line 91 of file SuperClusterHelper.h.

Referenced by computeLocalCovariances(), and sep().

float SuperClusterHelper::spp_ [private]

Definition at line 90 of file SuperClusterHelper.h.

Referenced by computeLocalCovariances(), and spp().

Definition at line 98 of file SuperClusterHelper.h.

Referenced by localCoordinates(), and thetaTilt().

std::vector<float> SuperClusterHelper::vCov_ [private]

Definition at line 89 of file SuperClusterHelper.h.

Referenced by computeLocalCovariances().