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 (AlgoID algoID)
 constructor with algoId, to be used in all child classes
 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 (double energy, const math::XYZPoint &position)
 constructor from values
 CaloCluster (double energy, const math::XYZPoint &position, const CaloID &caloID, const AlgoID &algoID, uint32_t flags=0)
 CaloCluster ()
 default constructor. Sets energy and position to zero
 CaloCluster (double energy, const math::XYZPoint &position, const CaloID &caloID)
 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 setAlgoId (const AlgoId &id)
void setCaloId (const CaloID &id)
void setEnergy (double energy)
void setFlags (uint32_t flags)
void setPosition (const math::XYZPoint &p)
void setSeed (const DetId &id)
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.23 2011/02/18 08:16:53 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 182 of file CaloCluster.h.

References hitsAndFractions_.

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

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

algorithm identifier

Definition at line 169 of file CaloCluster.h.

References algoID_.

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

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

Definition at line 170 of file CaloCluster.h.

References algo().

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

cluster energy

Reimplemented in reco::PFCluster.

Definition at line 120 of file CaloCluster.h.

References energy_.

Referenced by ESRecoSummary::analyze(), ErsatzMEt::analyze(), GenPurposeSkimmerData::analyze(), HiEgammaSCEnergyCorrectionAlgo::applyCorrection(), EgammaSCEnergyCorrectionAlgo::applyCorrection(), EgammaSCEnergyCorrectionAlgo::applyCrackCorrection(), 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()(), ClusterEtLess::operator()(), HoECalculator::operator()(), reco::PreshowerCluster::operator<(), PhysicsVector(), EcalDigiSelector::produce(), UnifiedSCCollectionProducer::produce(), EgammaSCCorrectionMaker::produce(), ElectronRecalibSuperClusterAssociator::produce(), PreshowerClusterProducer::produce(), HiEgammaSCCorrectionMaker::produce(), UncleanSCRecoveryProducer::produce(), HFRecoEcalCandidateAlgo::produce(), SiStripElectronProducer::produce(), and setEnergy().

{ 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 177 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 178 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 141 of file CaloCluster.h.

References energy_.

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

comparison <= operator

Definition at line 136 of file CaloCluster.h.

References energy_.

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

comparison == operator

Definition at line 146 of file CaloCluster.h.

References energy_.

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

comparison > operator

Definition at line 131 of file CaloCluster.h.

References energy_.

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

comparison >= operator

Definition at line 126 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 123 of file CaloCluster.h.

References position_.

Referenced by ContainmentCorrectionAnalyzer::analyze(), HiEgammaSCEnergyCorrectionAlgo::applyCorrection(), ConversionTrackCandidateProducer::buildCollections(), SuperClusterShapeAlgo::Calculate_Covariances(), converter::SuperClusterToCandidate::convert(), PFElectronTranslator::createBasicCluster(), PFPhotonTranslator::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(), EgammaRecHitIsolation::getSum_(), EgammaTowerIsolation::getTowerESum(), EgammaTowerIsolation::getTowerEtSum(), EcalClusterCrackCorrection::getValue(), PFElecTkProducer::isSharingEcalEnergyWithEgSC(), PreshowerClusterAlgo::makeOneCluster(), ConversionTools::matchesConversion(), SuperClusterEt::operator()(), ClusterEtLess::operator()(), reco::PreshowerCluster::operator<(), reco::PreshowerCluster::operator==(), PhysicsVector(), PhysicsVectorRaw(), PFRootEventManager::printCluster(), EgammaSCCorrectionMaker::produce(), ElectronRecalibSuperClusterAssociator::produce(), HiEgammaSCCorrectionMaker::produce(), UncleanSCRecoveryProducer::produce(), PFAlgo::reconstructCluster(), KDTreeLinkerPSEcal::searchLinks(), 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]
void reco::CaloCluster::setAlgoId ( const AlgoId id) [inline]

Definition at line 115 of file CaloCluster.h.

References algoID_.

{algoID_=id;}
void reco::CaloCluster::setCaloId ( const CaloID id) [inline]

Definition at line 113 of file CaloCluster.h.

References caloID_.

{caloID_= id;}
void reco::CaloCluster::setEnergy ( double  energy) [inline]
void reco::CaloCluster::setFlags ( uint32_t  flags) [inline]

Definition at line 173 of file CaloCluster.h.

References flags_, and flagsMask_.

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

                                   { 
      uint32_t reserved = (flags_ & ~flagsMask_);
      flags_ = (reserved ) | (flags & flagsMask_); 
    }
void reco::CaloCluster::setPosition ( const math::XYZPoint p) [inline]

Definition at line 111 of file CaloCluster.h.

References AlCaHLTBitMon_ParallelJobs::p, and position_.

{position_ = p;}
void reco::CaloCluster::setSeed ( const DetId id) [inline]

Definition at line 117 of file CaloCluster.h.

References seedId_.

{seedId_=id;}
size_t reco::CaloCluster::size ( void  ) const [inline]

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

Definition at line 166 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 216 of file CaloCluster.h.

Referenced by algo(), and setAlgoId().

bitmask for detector information

Definition at line 210 of file CaloCluster.h.

Referenced by caloID(), setCaloId(), 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 224 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 219 of file CaloCluster.h.

Referenced by seed(), and setSeed().