CMS 3D CMS Logo

Public Types | Public Member Functions | Protected Attributes | Static Protected Attributes | Friends

reco::CaloCluster Class Reference

#include <CaloCluster.h>

Inheritance diagram for reco::CaloCluster:
reco::PFCluster reco::PreshowerCluster reco::SuperCluster

List of all members.

Public Types

enum  AlgoId {
  island = 0, hybrid = 1, fixedMatrix = 2, dynamicHybrid = 3,
  multi5x5 = 4, particleFlow = 5, undefined = 1000
}
typedef AlgoId AlgoID
enum  SCFlags { cleanOnly = 0, common = 100, uncleanOnly = 200 }

Public Member Functions

void addHitAndFraction (DetId id, float fraction)
AlgoId algo () const
 algorithm identifier
AlgoID algoID () const
 CaloCluster ()
 default constructor. Sets energy and position to zero
 CaloCluster (double energy, const math::XYZPoint &position, float chi2, const std::vector< DetId > &usedHits, const AlgoId algoId, uint32_t flags=0)
 temporary compatibility constructor
 CaloCluster (AlgoID algoID)
 constructor with algoId, to be used in all child classes
 CaloCluster (double energy, const math::XYZPoint &position)
 constructor from values
 CaloCluster (double energy, const math::XYZPoint &position, const CaloID &caloID)
 CaloCluster (double energy, const math::XYZPoint &position, const CaloID &caloID, const AlgoID &algoID, uint32_t flags=0)
 CaloCluster (double energy, const math::XYZPoint &position, const CaloID &caloID, const std::vector< std::pair< DetId, float > > &usedHitsAndFractions, const AlgoId algoId, const DetId seedId=DetId(0), uint32_t flags=0)
const CaloIDcaloID () const
double energy () const
 cluster energy
double eta () const
 pseudorapidity of cluster centroid
uint32_t flags () const
const std::vector< std::pair
< DetId, float > > & 
hitsAndFractions () const
bool isInClean () const
bool isInUnclean () const
bool operator< (const CaloCluster &rhs) const
 comparison < operator
bool operator<= (const CaloCluster &rhs) const
 comparison <= operator
bool operator== (const CaloCluster &rhs) const
 comparison == operator
bool operator> (const CaloCluster &rhs) const
 comparison > operator
bool operator>= (const CaloCluster &rhs) const
 comparison >= operator
double phi () const
 azimuthal angle of cluster centroid
const math::XYZPointposition () const
 cluster centroid position
std::string printHitAndFraction (unsigned i) const
 print hitAndFraction
void reset ()
 resets the CaloCluster (position, energy, hitsAndFractions)
DetId seed () const
 return DetId of seed
void setFlags (uint32_t flags)
size_t size () const
 size in number of hits (e.g. in crystals for ECAL)
double x () const
 x coordinate of cluster centroid
double y () const
 y coordinate of cluster centroid
double z () const
 z coordinate of cluster centroid
virtual ~CaloCluster ()
 destructor

Protected Attributes

AlgoID algoID_
CaloID caloID_
 bitmask for detector information
double energy_
 cluster energy
uint32_t flags_
std::vector< std::pair< DetId,
float > > 
hitsAndFractions_
math::XYZPoint position_
 cluster centroid position
DetId seedId_
 DetId of seed.

Static Protected Attributes

static const uint32_t flagsMask_ = 0x0FFFFFFF
static const uint32_t flagsOffset_ = 28

Friends

std::ostream & operator<< (std::ostream &out, const CaloCluster &cluster)
 print me

Detailed Description

Base class for all types calorimeter clusters

Author:
Shahram Rahatlou, INFN
Version:
Id:
CaloCluster.h,v 1.21 2010/12/10 09:07:11 argiro Exp

Comments: modified AlgoId enumeration to include cleaning status flags In summary: algoID_ < 200 object is in clean collection algoID_ >=100 object is in unclean collection

Definition at line 30 of file CaloCluster.h.


Member Typedef Documentation

Definition at line 40 of file CaloCluster.h.


Member Enumeration Documentation

Enumerator:
island 
hybrid 
fixedMatrix 
dynamicHybrid 
multi5x5 
particleFlow 
undefined 

Definition at line 33 of file CaloCluster.h.

{ island = 0, hybrid = 1, fixedMatrix = 2, dynamicHybrid = 3, multi5x5 = 4, particleFlow = 5,  undefined = 1000};
Enumerator:
cleanOnly 
common 
uncleanOnly 

Definition at line 36 of file CaloCluster.h.

{ cleanOnly = 0, common = 100, uncleanOnly = 200 };

Constructor & Destructor Documentation

reco::CaloCluster::CaloCluster ( ) [inline]

default constructor. Sets energy and position to zero

Definition at line 43 of file CaloCluster.h.

                  : 
      energy_(0), 
      algoID_( undefined ), flags_(0) {}
reco::CaloCluster::CaloCluster ( AlgoID  algoID) [inline]

constructor with algoId, to be used in all child classes

Definition at line 48 of file CaloCluster.h.

                               : 
      energy_(0), 
      algoID_( algoID ), flags_(0) {}
reco::CaloCluster::CaloCluster ( double  energy,
const math::XYZPoint position,
const CaloID caloID 
) [inline]

Definition at line 52 of file CaloCluster.h.

reco::CaloCluster::CaloCluster ( double  energy,
const math::XYZPoint position 
) [inline]

constructor from values

Definition at line 62 of file CaloCluster.h.

reco::CaloCluster::CaloCluster ( double  energy,
const math::XYZPoint position,
const CaloID caloID,
const AlgoID algoID,
uint32_t  flags = 0 
) [inline]

Definition at line 67 of file CaloCluster.h.

References flags(), flags_, and flagsMask_.

reco::CaloCluster::CaloCluster ( double  energy,
const math::XYZPoint position,
const CaloID caloID,
const std::vector< std::pair< DetId, float > > &  usedHitsAndFractions,
const AlgoId  algoId,
const DetId  seedId = DetId(0),
uint32_t  flags = 0 
) [inline]

Definition at line 77 of file CaloCluster.h.

References flags(), flags_, and flagsMask_.

                                     :
      energy_ (energy), position_ (position), caloID_(caloID), 
      hitsAndFractions_(usedHitsAndFractions), algoID_(algoId),seedId_(seedId){
      flags_=flags&flagsMask_;
    }
reco::CaloCluster::CaloCluster ( double  energy,
const math::XYZPoint position,
float  chi2,
const std::vector< DetId > &  usedHits,
const AlgoId  algoId,
uint32_t  flags = 0 
) [inline]

temporary compatibility constructor

Definition at line 91 of file CaloCluster.h.

References flags(), flags_, flagsMask_, hitsAndFractions_, and i.

                                     :
      energy_ (energy), position_ (position),  algoID_(algoId)
       {
          hitsAndFractions_.reserve(usedHits.size());
          for(size_t i = 0; i < usedHits.size(); i++) hitsAndFractions_.push_back(std::pair< DetId, float > ( usedHits[i],1.));
          flags_=flags&flagsMask_;
      }
virtual reco::CaloCluster::~CaloCluster ( ) [inline, virtual]

destructor

Definition at line 106 of file CaloCluster.h.

{}

Member Function Documentation

void reco::CaloCluster::addHitAndFraction ( DetId  id,
float  fraction 
) [inline]

Definition at line 171 of file CaloCluster.h.

References hitsAndFractions_.

Referenced by reco::PFCluster::addRecHitFraction(), and PFElectronTranslator::createSuperClusters().

                                                       { 
            hitsAndFractions_.push_back( std::pair<DetId, float>(id, fraction) );
    }
AlgoId reco::CaloCluster::algo ( ) const [inline]

algorithm identifier

Definition at line 158 of file CaloCluster.h.

References algoID_.

Referenced by algoID(), and PFElectronTranslator::createBasicCluster().

{ return algoID_; }
AlgoID reco::CaloCluster::algoID ( ) const [inline]

Definition at line 159 of file CaloCluster.h.

References algo().

{ return algo(); }
const CaloID& reco::CaloCluster::caloID ( ) const [inline]

Definition at line 169 of file CaloCluster.h.

References caloID_.

Referenced by PFElectronTranslator::createBasicCluster(), and reco::PFCluster::layer().

{return caloID_;}
double reco::CaloCluster::energy ( ) const [inline]

cluster energy

Reimplemented in reco::PFCluster.

Definition at line 109 of file CaloCluster.h.

References energy_.

Referenced by ErsatzMEt::analyze(), GenPurposeSkimmerData::analyze(), HiEgammaSCEnergyCorrectionAlgo::applyCorrection(), EgammaSCEnergyCorrectionAlgo::applyCorrection(), ConversionTrackCandidateProducer::buildCollections(), ConvertedPhotonProducer::buildCollections(), SuperClusterShapeAlgo::Calculate_Covariances(), converter::SuperClusterToCandidate::convert(), HFRecoEcalCandidateAlgo::correctEPosition(), GsfElectronAlgo::createElectron(), DetectorVector(), reco::PreshowerCluster::et(), fBremScCorr(), ZeeCalibration::fillEleInfo(), FastElectronSeedProducer::filterClusters(), ElectronSeedProducer::filterClusters(), EcalClusterSeverityLevelAlgo::fractionAroundClosestProblematic(), EcalClusterEnergyUncertainty::getValue(), EcalClusterEnergyCorrection::getValue(), EcalClusterCrackCorrection::getValue(), EcalClusterSeverityLevelAlgo::goodFraction(), PreshowerClusterAlgo::makeOneCluster(), HybridClusterAlgo::makeSuperClusters(), SuperClusterEt::operator()(), HoECalculator::operator()(), ClusterEtLess::operator()(), reco::PreshowerCluster::operator<(), PhysicsVector(), EcalDigiSelector::produce(), UnifiedSCCollectionProducer::produce(), EgammaSCCorrectionMaker::produce(), ElectronRecalibSuperClusterAssociator::produce(), PreshowerClusterProducer::produce(), HiEgammaSCCorrectionMaker::produce(), HFRecoEcalCandidateAlgo::produce(), UncleanSCRecoveryProducer::produce(), and SiStripElectronProducer::produce().

{ return energy_; }
double reco::CaloCluster::eta ( ) const [inline]
uint32_t reco::CaloCluster::flags ( ) const [inline]
const std::vector< std::pair<DetId, float> >& reco::CaloCluster::hitsAndFractions ( ) const [inline]
bool reco::CaloCluster::isInClean ( ) const [inline]

Definition at line 166 of file CaloCluster.h.

References flags(), and uncleanOnly.

Referenced by UnifiedSCCollectionProducer::produce(), and UncleanSCRecoveryProducer::produce().

{ return flags() < uncleanOnly; }
bool reco::CaloCluster::isInUnclean ( ) const [inline]

Definition at line 167 of file CaloCluster.h.

References common, and flags().

Referenced by UnifiedSCCollectionProducer::produce(), and UncleanSCRecoveryProducer::produce().

{ return flags() >= common; }
bool reco::CaloCluster::operator< ( const CaloCluster rhs) const [inline]

comparison < operator

Definition at line 130 of file CaloCluster.h.

References energy_.

                                                   { 
      return (energy_< rhs.energy_); 
    }
bool reco::CaloCluster::operator<= ( const CaloCluster rhs) const [inline]

comparison <= operator

Definition at line 125 of file CaloCluster.h.

References energy_.

                                                   { 
      return (energy_<=rhs.energy_); 
    }
bool reco::CaloCluster::operator== ( const CaloCluster rhs) const [inline]

comparison == operator

Definition at line 135 of file CaloCluster.h.

References energy_.

                                                   { 
             return (energy_ == rhs.energy_); 
     }; 
bool reco::CaloCluster::operator> ( const CaloCluster rhs) const [inline]

comparison > operator

Definition at line 120 of file CaloCluster.h.

References energy_.

                                                   { 
      return (energy_> rhs.energy_); 
    }
bool reco::CaloCluster::operator>= ( const CaloCluster rhs) const [inline]

comparison >= operator

Definition at line 115 of file CaloCluster.h.

References energy_.

                                                   { 
      return (energy_>=rhs.energy_); 
    }
double reco::CaloCluster::phi ( ) const [inline]
const math::XYZPoint& reco::CaloCluster::position ( ) const [inline]

cluster centroid position

Definition at line 112 of file CaloCluster.h.

References position_.

Referenced by ContainmentCorrectionAnalyzer::analyze(), HiEgammaSCEnergyCorrectionAlgo::applyCorrection(), EgammaSCEnergyCorrectionAlgo::applyCorrection(), ConversionTrackCandidateProducer::buildCollections(), SuperClusterShapeAlgo::Calculate_Covariances(), converter::SuperClusterToCandidate::convert(), PFElectronTranslator::createBasicCluster(), GsfElectronAlgo::createElectron(), DisplayManager::createGCluster(), egammaisolation::EgammaEcalExtractor::deposit(), fBremScCorr(), fEAddScCorr(), fEtaScCorr(), fEtEtaCorr(), ZeeCalibration::fillEleInfo(), ElectronSeedProducer::filterClusters(), InOutConversionSeedFinder::findSeeds(), EgammaEcalIsolation::getEcalEtSum(), EgammaHcalIsolation::getHcalESum(), EgammaHcalIsolation::getHcalESumDepth1(), EgammaHcalIsolation::getHcalESumDepth2(), EgammaHcalIsolation::getHcalEtSum(), EgammaHcalIsolation::getHcalEtSumDepth1(), EgammaHcalIsolation::getHcalEtSumDepth2(), EgammaTowerIsolation::getTowerESum(), EgammaTowerIsolation::getTowerEtSum(), EcalClusterCrackCorrection::getValue(), PreshowerClusterAlgo::makeOneCluster(), SuperClusterEt::operator()(), ClusterEtLess::operator()(), reco::PreshowerCluster::operator<(), reco::PreshowerCluster::operator==(), PhysicsVector(), PhysicsVectorRaw(), PFRootEventManager::printCluster(), EgammaSCCorrectionMaker::produce(), ElectronRecalibSuperClusterAssociator::produce(), HiEgammaSCCorrectionMaker::produce(), UncleanSCRecoveryProducer::produce(), PFAlgo::reconstructCluster(), InOutConversionSeedFinder::startSeed(), LinkByRecHit::testECALAndPSByRecHit(), LinkByRecHit::testHFEMAndHFHADByRecHit(), PFBlockAlgo::testPS1AndPS2(), LinkByRecHit::testTrackAndClusterByRecHit(), and PFBlockAlgo::testTrackAndPS().

{ return position_; }
string CaloCluster::printHitAndFraction ( unsigned  i) const

print hitAndFraction

Definition at line 17 of file CaloCluster.cc.

References i, dbtoconf::out, and findQualityFiles::size.

                                                        {
  
  ostringstream out; 
  if( i>=hitsAndFractions().size() ) // i >= 0, since i is unsigned
    out<<"out of range "<<i; 
  else
    out<<"( "<<hitsAndFractions()[i].first
       <<", "<<hitsAndFractions()[i].second
       <<" )";
  return out.str();
}
void CaloCluster::reset ( void  )

resets the CaloCluster (position, energy, hitsAndFractions)

Reimplemented in reco::PFCluster.

Definition at line 11 of file CaloCluster.cc.

DetId reco::CaloCluster::seed ( ) const [inline]

return DetId of seed

Reimplemented in reco::SuperCluster.

Definition at line 188 of file CaloCluster.h.

References seedId_.

Referenced by PFElectronTranslator::createBasicCluster(), and FourVectorHLTOffline::selectElectrons().

{ return seedId_; }
void reco::CaloCluster::setFlags ( uint32_t  flags) [inline]
size_t reco::CaloCluster::size ( void  ) const [inline]

size in number of hits (e.g. in crystals for ECAL)

Definition at line 155 of file CaloCluster.h.

References hitsAndFractions_.

Referenced by HiEgammaSCEnergyCorrectionAlgo::applyCorrection().

{ return hitsAndFractions_.size(); }
double reco::CaloCluster::x ( ) const [inline]
double reco::CaloCluster::y ( ) const [inline]
double reco::CaloCluster::z ( ) const [inline]

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const CaloCluster cluster 
) [friend]

print me


Member Data Documentation

Definition at line 205 of file CaloCluster.h.

Referenced by algo().

bitmask for detector information

Definition at line 199 of file CaloCluster.h.

Referenced by caloID(), and reco::PFCluster::setLayer().

double reco::CaloCluster::energy_ [protected]
uint32_t reco::CaloCluster::flags_ [protected]

flags (e.g. for handling of cleaned/uncleaned SC) 4 most significant bits reserved 28 bits for handling of cleaned/uncleaned

Definition at line 213 of file CaloCluster.h.

Referenced by CaloCluster(), flags(), reco::SuperCluster::getPreshowerPlanesStatus(), setFlags(), and reco::SuperCluster::setPreshowerPlanesStatus().

const uint32_t reco::CaloCluster::flagsMask_ = 0x0FFFFFFF [static, protected]
const uint32_t reco::CaloCluster::flagsOffset_ = 28 [static, protected]
std::vector< std::pair<DetId, float> > reco::CaloCluster::hitsAndFractions_ [protected]

DetId of seed.

Definition at line 208 of file CaloCluster.h.

Referenced by seed().