CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | Friends
reco::PFCluster Class Reference

Particle flow cluster, see clustering algorithm in PFClusterAlgo. More...

#include <PFCluster.h>

Inheritance diagram for reco::PFCluster:
reco::CaloCluster reco::PFSuperCluster

Public Types

typedef std::vector< std::pair
< CaloClusterPtr::key_type,
edm::Ptr< PFCluster > > > 
EEtoPSAssociation
 
typedef
ROOT::Math::PositionVector3D
< ROOT::Math::CylindricalEta3D
< double > > 
REPPoint
 
- Public Types inherited from reco::CaloCluster
enum  AlgoId {
  island = 0, hybrid = 1, fixedMatrix = 2, dynamicHybrid = 3,
  multi5x5 = 4, particleFlow = 5, hgcal_em = 6, hgcal_had = 7,
  hgcal_mixed = 8, undefined = 1000
}
 
typedef AlgoId AlgoID
 
enum  SCFlags { cleanOnly = 0, common = 100, uncleanOnly = 200 }
 

Public Member Functions

void addRecHitFraction (const reco::PFRecHitFraction &frac)
 add a given fraction of the rechit More...
 
void calculatePositionREP ()
 computes posrep_ once and for all More...
 
double charge () const
 dummy charge More...
 
int color () const
 
double depth () const
 cluster depth More...
 
double energy () const
 cluster energy More...
 
PFLayer::Layer layer () const
 cluster layer, see PFLayer.h in this directory More...
 
PFClusteroperator= (const PFCluster &)
 
 PFCluster ()
 
 PFCluster (PFLayer::Layer layer, double energy, double x, double y, double z)
 constructor More...
 
const REPPointpositionREP () const
 cluster position: rho, eta, phi More...
 
template<typename pruner >
void pruneUsing (pruner prune)
 
double pt () const
 transverse momentum, massless approximation More...
 
const std::vector
< reco::PFRecHitFraction > & 
recHitFractions () const
 vector of rechit fractions More...
 
void reset ()
 resets clusters parameters More...
 
void resetHitsAndFractions ()
 reset only hits and fractions More...
 
void setColor (int color)
 set cluster color (for the PFRootEventManager display) More...
 
void setDepth (double depth)
 
void setLayer (PFLayer::Layer layer)
 set layer More...
 
void setTime (double time)
 
double theta () const
 angle More...
 
double time () const
 cluster time More...
 
math::XYZPoint const & vertex () const
 dummy vertex access More...
 
double vx () const
 
double vy () const
 
double vz () const
 
- Public Member Functions inherited from reco::CaloCluster
void addHitAndFraction (DetId id, float fraction)
 
AlgoId algo () const
 algorithm identifier More...
 
AlgoID algoID () const
 
 CaloCluster ()
 default constructor. Sets energy and position to zero More...
 
 CaloCluster (AlgoID algoID)
 constructor with algoId, to be used in all child classes More...
 
 CaloCluster (double energy, const math::XYZPoint &position, const CaloID &caloID)
 
 CaloCluster (double energy, const math::XYZPoint &position)
 constructor from values More...
 
 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)
 
 CaloCluster (double energy, const math::XYZPoint &position, float chi2, const std::vector< DetId > &usedHits, const AlgoId algoId, uint32_t flags=0)
 temporary compatibility constructor More...
 
const CaloIDcaloID () const
 
double correctedEnergy () const
 
float correctedEnergyUncertainty () const
 
double energy () const
 cluster energy More...
 
double eta () const
 pseudorapidity of cluster centroid More...
 
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 More...
 
bool operator<= (const CaloCluster &rhs) const
 comparison <= operator More...
 
bool operator== (const CaloCluster &rhs) const
 comparison == operator More...
 
bool operator> (const CaloCluster &rhs) const
 comparison > operator More...
 
bool operator>= (const CaloCluster &rhs) const
 comparison >= operator More...
 
double phi () const
 azimuthal angle of cluster centroid More...
 
const math::XYZPointposition () const
 cluster centroid position More...
 
std::string printHitAndFraction (unsigned i) const
 print hitAndFraction More...
 
void reset ()
 resets the CaloCluster (position, energy, hitsAndFractions) More...
 
DetId seed () const
 return DetId of seed More...
 
void setAlgoId (const AlgoId &id)
 
void setCaloId (const CaloID &id)
 
void setCorrectedEnergy (double cenergy)
 
void setCorrectedEnergyUncertainty (float energyerr)
 
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) More...
 
double x () const
 x coordinate of cluster centroid More...
 
double y () const
 y coordinate of cluster centroid More...
 
double z () const
 z coordinate of cluster centroid More...
 
virtual ~CaloCluster ()
 destructor More...
 

Static Public Member Functions

static double getDepthCorrection (double energy, bool isBelowPS=false, bool isHadron=false)
 
static void setDepthCorParameters (int mode, double a, double b, double ap, double bp)
 

Private Attributes

int color_
 color (transient) More...
 
double depth_
 
PFLayer::Layer layer_
 transient layer More...
 
REPPoint posrep_
 cluster position: rho, eta, phi (transient) More...
 
std::vector
< reco::PFRecHitFraction
rechits_
 vector of rechit fractions (transient) More...
 
double time_
 Michalis :Add timing and depth information. More...
 

Static Private Attributes

static std::atomic< double > depthCorA_ {0.89}
 
static std::atomic< double > depthCorAp_ {0.89}
 
static std::atomic< double > depthCorB_ {7.3}
 
static std::atomic< double > depthCorBp_ {4.0}
 
static std::atomic< int > depthCorMode_ {0}
 
static const math::XYZPoint dummyVtx_
 

Friends

std::ostream & operator<< (std::ostream &out, const PFCluster &cluster)
 

Additional Inherited Members

- Protected Attributes inherited from reco::CaloCluster
AlgoID algoID_
 
CaloID caloID_
 bitmask for detector information More...
 
double correctedEnergy_
 
float correctedEnergyUncertainty_
 
double energy_
 cluster energy More...
 
uint32_t flags_
 
std::vector< std::pair< DetId,
float > > 
hitsAndFractions_
 
math::XYZPoint position_
 cluster centroid position More...
 
DetId seedId_
 DetId of seed. More...
 
- Static Protected Attributes inherited from reco::CaloCluster
static const uint32_t flagsMask_ =0x0FFFFFFF
 
static const uint32_t flagsOffset_ =28
 

Detailed Description

Particle flow cluster, see clustering algorithm in PFClusterAlgo.

A particle flow cluster is defined by its energy and position, which are calculated from a vector of PFRecHitFraction. This calculation is performed in PFClusterAlgo.

Author
Colin Bernet
Date
July 2006

Definition at line 47 of file PFCluster.h.

Member Typedef Documentation

Definition at line 50 of file PFCluster.h.

typedef ROOT::Math::PositionVector3D<ROOT::Math::CylindricalEta3D<double> > reco::PFCluster::REPPoint

Definition at line 54 of file PFCluster.h.

Constructor & Destructor Documentation

reco::PFCluster::PFCluster ( )
inline

Definition at line 56 of file PFCluster.h.

PFLayer::Layer layer_
transient layer
Definition: PFCluster.h:183
double time_
Michalis :Add timing and depth information.
Definition: PFCluster.h:179
CaloCluster()
default constructor. Sets energy and position to zero
Definition: CaloCluster.h:42
int color_
color (transient)
Definition: PFCluster.h:220
PFCluster::PFCluster ( PFLayer::Layer  layer,
double  energy,
double  x,
double  y,
double  z 
)

constructor

Definition at line 23 of file PFCluster.cc.

24  :
26  math::XYZPoint(x,y,z),
29  posrep_( position_.Rho(), position_.Eta(), position_.Phi() ),
30  time_(-99.),
31  depth_(0.),
32  layer_(layer),
33  color_(2)
34 { }
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
Definition: PFCluster.cc:86
math::XYZPoint position_
cluster centroid position
Definition: CaloCluster.h:212
PFLayer::Layer layer_
transient layer
Definition: PFCluster.h:183
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:160
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:154
double time_
Michalis :Add timing and depth information.
Definition: PFCluster.h:179
double energy() const
cluster energy
Definition: PFCluster.h:82
static reco::CaloID toCaloID(Layer layer)
Definition: PFLayer.cc:11
REPPoint posrep_
cluster position: rho, eta, phi (transient)
Definition: PFCluster.h:176
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
CaloCluster()
default constructor. Sets energy and position to zero
Definition: CaloCluster.h:42
int color_
color (transient)
Definition: PFCluster.h:220
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:157

Member Function Documentation

void PFCluster::addRecHitFraction ( const reco::PFRecHitFraction frac)

add a given fraction of the rechit

Definition at line 57 of file PFCluster.cc.

References reco::CaloCluster::addHitAndFraction(), reco::PFRecHitFraction::fraction(), reco::PFRecHitFraction::recHitRef(), and rechits_.

Referenced by PFMultiDepthClusterizer::absorbCluster(), Basic2DGenericTopoClusterizer::buildTopoCluster(), Basic2DGenericPFlowClusterizer::seedPFClustersFromTopo(), and PFlow2DClusterizerWithTime::seedPFClustersFromTopo().

57  {
58 
59  rechits_.push_back( frac );
60 
61  addHitAndFraction( frac.recHitRef()->detId(),
62  frac.fraction() );
63 }
void addHitAndFraction(DetId id, float fraction)
Definition: CaloCluster.h:185
std::vector< reco::PFRecHitFraction > rechits_
vector of rechit fractions (transient)
Definition: PFCluster.h:173
double fraction() const
const PFRecHitRef & recHitRef() const
copy
void reco::PFCluster::calculatePositionREP ( )
inline

computes posrep_ once and for all

Definition at line 96 of file PFCluster.h.

References reco::CaloCluster::position_, and posrep_.

Referenced by Basic2DGenericPFlowPositionCalc::calculateAndSetPositionActual(), ECAL2DPositionCalcWithDepthCorr::calculateAndSetPositionActual(), PFEnergyCalibration::energyEm(), PFElecTkProducer::isSharingEcalEnergyWithEgSC(), and ConvBremPFTrackFinder::runConvBremFinder().

96  {
97  posrep_.SetCoordinates( position_.Rho(),
98  position_.Eta(),
99  position_.Phi() );
100  }
math::XYZPoint position_
cluster centroid position
Definition: CaloCluster.h:212
REPPoint posrep_
cluster position: rho, eta, phi (transient)
Definition: PFCluster.h:176
double reco::PFCluster::charge ( ) const
inline

dummy charge

some classes to make this fit into a template footprint for RecoPFClusterRefCandidate so we can make jets and MET out of PFClusters.

Definition at line 135 of file PFCluster.h.

135 { return 0;}
int reco::PFCluster::color ( ) const
inline
Returns
color

Definition at line 110 of file PFCluster.h.

References color_.

Referenced by cuy.plotElement::__init__(), cuy.superimposeElement::__init__(), cuy.graphElement::__init__(), and setColor().

110 {return color_;}
int color_
color (transient)
Definition: PFCluster.h:220
double reco::PFCluster::depth ( ) const
inline

cluster depth

Definition at line 87 of file PFCluster.h.

References depth_.

Referenced by PFMultiDepthClusterizer::link(), and setDepth().

87 {return depth_;}
double reco::PFCluster::energy ( ) const
inline
double PFCluster::getDepthCorrection ( double  energy,
bool  isBelowPS = false,
bool  isHadron = false 
)
static

Definition at line 66 of file PFCluster.cc.

References depthCorA_, depthCorAp_, depthCorB_, depthCorBp_, and dqm-mbProfile::log.

68 {
69  double corrA = depthCorA_;
70  double corrB = depthCorB_;
71  if (isBelowPS) {
72  corrA = depthCorAp_;
73  corrB = depthCorBp_;
74  }
75  return isHadron ? corrA : corrA*(corrB + log(energy));
76 }
static std::atomic< double > depthCorAp_
Definition: PFCluster.h:196
static std::atomic< double > depthCorB_
Definition: PFCluster.h:193
double energy() const
cluster energy
Definition: PFCluster.h:82
static std::atomic< double > depthCorBp_
Definition: PFCluster.h:199
static std::atomic< double > depthCorA_
Definition: PFCluster.h:190
PFLayer::Layer PFCluster::layer ( ) const
PFCluster & PFCluster::operator= ( const PFCluster other)

Definition at line 94 of file PFCluster.cc.

References color_, reco::CaloCluster::energy_, reco::CaloCluster::position_, posrep_, and rechits_.

Referenced by reco::PFSuperCluster::operator=().

94  {
95 
96  CaloCluster::operator=(other);
97  rechits_ = other.rechits_;
98  energy_ = other.energy_;
99  position_ = other.position_;
100  posrep_ = other.posrep_;
101  color_ = other.color_;
102 
103  return *this;
104 }
math::XYZPoint position_
cluster centroid position
Definition: CaloCluster.h:212
double energy_
cluster energy
Definition: CaloCluster.h:207
std::vector< reco::PFRecHitFraction > rechits_
vector of rechit fractions (transient)
Definition: PFCluster.h:173
REPPoint posrep_
cluster position: rho, eta, phi (transient)
Definition: PFCluster.h:176
int color_
color (transient)
Definition: PFCluster.h:220
const REPPoint& reco::PFCluster::positionREP ( ) const
inline

cluster position: rho, eta, phi

Definition at line 93 of file PFCluster.h.

References posrep_.

Referenced by PFEnergyCalibration::energyEm(), CalibratableTest::extractCandidate(), KDTreeLinkerPSEcal::searchLinks(), and LinkByRecHit::testTrackAndClusterByRecHit().

93 {return posrep_;}
REPPoint posrep_
cluster position: rho, eta, phi (transient)
Definition: PFCluster.h:176
template<typename pruner >
void reco::PFCluster::pruneUsing ( pruner  prune)
inline

Definition at line 157 of file PFCluster.h.

References reco::CaloCluster::hitsAndFractions_, and rechits_.

157  {
158  hitsAndFractions_.clear();
159  std::vector<reco::PFRecHitFraction>::iterator iter =
160  std::stable_partition(rechits_.begin(),rechits_.end(),prune);
161  rechits_.erase(iter,rechits_.end());
162  hitsAndFractions_.reserve(rechits_.size());
163  for( const auto& hitfrac : rechits_ ) {
164  hitsAndFractions_.emplace_back(hitfrac.recHitRef()->detId(),
165  hitfrac.fraction());
166  }
167  }
std::vector< reco::PFRecHitFraction > rechits_
vector of rechit fractions (transient)
Definition: PFCluster.h:173
std::vector< std::pair< DetId, float > > hitsAndFractions_
Definition: CaloCluster.h:218
double reco::PFCluster::pt ( void  ) const
inline
const std::vector< reco::PFRecHitFraction >& reco::PFCluster::recHitFractions ( ) const
inline
void PFCluster::reset ( void  )

resets clusters parameters

Definition at line 37 of file PFCluster.cc.

References reco::CaloCluster::energy_, layer_, PFLayer::NONE, reco::CaloCluster::position_, posrep_, rechits_, reco::CaloCluster::reset(), and time_.

Referenced by Basic2DGenericTopoClusterizer::buildClusters(), and reco::PFSuperCluster::reset().

37  {
38 
39  energy_ = 0;
40  position_ *= 0;
41  posrep_ *= 0;
42  time_=-99.;
44  rechits_.clear();
45 
47 
48 }
math::XYZPoint position_
cluster centroid position
Definition: CaloCluster.h:212
double energy_
cluster energy
Definition: CaloCluster.h:207
std::vector< reco::PFRecHitFraction > rechits_
vector of rechit fractions (transient)
Definition: PFCluster.h:173
PFLayer::Layer layer_
transient layer
Definition: PFCluster.h:183
double time_
Michalis :Add timing and depth information.
Definition: PFCluster.h:179
REPPoint posrep_
cluster position: rho, eta, phi (transient)
Definition: PFCluster.h:176
void reset()
resets the CaloCluster (position, energy, hitsAndFractions)
Definition: CaloCluster.cc:11
void PFCluster::resetHitsAndFractions ( )

reset only hits and fractions

Definition at line 50 of file PFCluster.cc.

References reco::CaloCluster::hitsAndFractions_, and rechits_.

50  {
51 
52  rechits_.clear();
53  hitsAndFractions_.clear();
54 
55 }
std::vector< reco::PFRecHitFraction > rechits_
vector of rechit fractions (transient)
Definition: PFCluster.h:173
std::vector< std::pair< DetId, float > > hitsAndFractions_
Definition: CaloCluster.h:218
void reco::PFCluster::setColor ( int  color)
inline

set cluster color (for the PFRootEventManager display)

Definition at line 107 of file PFCluster.h.

References color(), and color_.

107 {color_ = color;}
int color() const
Definition: PFCluster.h:110
int color_
color (transient)
Definition: PFCluster.h:220
void reco::PFCluster::setDepth ( double  depth)
inline

Definition at line 90 of file PFCluster.h.

References depth(), and depth_.

Referenced by Basic2DGenericPFlowPositionCalc::calculateAndSetPositionActual().

90 {depth_ = depth;}
double depth() const
cluster depth
Definition: PFCluster.h:87
static void reco::PFCluster::setDepthCorParameters ( int  mode,
double  a,
double  b,
double  ap,
double  bp 
)
inlinestatic

Definition at line 119 of file PFCluster.h.

References a, b, depthCorA_, depthCorAp_, depthCorB_, depthCorBp_, depthCorMode_, and alignBH_cfg::mode.

121  {
123  depthCorA_ = a;
124  depthCorB_ = b;
125  depthCorAp_ = ap;
126  depthCorBp_ = bp;
127  }
static std::atomic< double > depthCorAp_
Definition: PFCluster.h:196
static std::atomic< double > depthCorB_
Definition: PFCluster.h:193
static std::atomic< int > depthCorMode_
Definition: PFCluster.h:187
double b
Definition: hdecay.h:120
static std::atomic< double > depthCorBp_
Definition: PFCluster.h:199
double a
Definition: hdecay.h:121
static std::atomic< double > depthCorA_
Definition: PFCluster.h:190
void PFCluster::setLayer ( PFLayer::Layer  layer)

set layer

Definition at line 78 of file PFCluster.cc.

References reco::CaloCluster::caloID_, layer(), layer_, and PFLayer::toCaloID().

Referenced by Basic2DGenericPFlowPositionCalc::calculateAndSetPositionActual(), and ECAL2DPositionCalcWithDepthCorr::calculateAndSetPositionActual().

78  {
79  // cout<<"calling PFCluster::setLayer "<<layer<<endl;
80  layer_ = layer;
82  // cout<<"done "<<caloID_<<endl;
83 }
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
Definition: PFCluster.cc:86
CaloID caloID_
bitmask for detector information
Definition: CaloCluster.h:215
PFLayer::Layer layer_
transient layer
Definition: PFCluster.h:183
static reco::CaloID toCaloID(Layer layer)
Definition: PFLayer.cc:11
void reco::PFCluster::setTime ( double  time)
inline
double reco::PFCluster::theta ( ) const
inline

angle

Definition at line 143 of file PFCluster.h.

References reco::CaloCluster::position_.

Referenced by Tau.Tau::zImpact().

143  {
144  return position_.theta();
145  }
math::XYZPoint position_
cluster centroid position
Definition: CaloCluster.h:212
double reco::PFCluster::time ( ) const
inline

cluster time

Definition at line 85 of file PFCluster.h.

References time_.

Referenced by PFlow2DClusterizerWithTime::dist2Time(), and setTime().

85 {return time_;}
double time_
Michalis :Add timing and depth information.
Definition: PFCluster.h:179
math::XYZPoint const& reco::PFCluster::vertex ( ) const
inline

dummy vertex access

Definition at line 148 of file PFCluster.h.

References dummyVtx_.

Referenced by Tau.Tau::dxy(), vx(), vy(), and vz().

148  {
149  return dummyVtx_;
150  }
static const math::XYZPoint dummyVtx_
Definition: PFCluster.h:217
double reco::PFCluster::vx ( ) const
inline

Definition at line 151 of file PFCluster.h.

References vertex().

151 { return vertex().x(); }
math::XYZPoint const & vertex() const
dummy vertex access
Definition: PFCluster.h:148
double reco::PFCluster::vy ( ) const
inline

Definition at line 152 of file PFCluster.h.

References vertex().

152 { return vertex().y(); }
math::XYZPoint const & vertex() const
dummy vertex access
Definition: PFCluster.h:148
double reco::PFCluster::vz ( ) const
inline

Definition at line 153 of file PFCluster.h.

References vertex().

153 { return vertex().z(); }
math::XYZPoint const & vertex() const
dummy vertex access
Definition: PFCluster.h:148

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const PFCluster cluster 
)
friend

Member Data Documentation

int reco::PFCluster::color_
private

color (transient)

Definition at line 220 of file PFCluster.h.

Referenced by color(), operator=(), and setColor().

double reco::PFCluster::depth_
private

Definition at line 180 of file PFCluster.h.

Referenced by depth(), and setDepth().

std::atomic< double > PFCluster::depthCorA_ {0.89}
staticprivate

Definition at line 190 of file PFCluster.h.

Referenced by getDepthCorrection(), and setDepthCorParameters().

std::atomic< double > PFCluster::depthCorAp_ {0.89}
staticprivate

Definition at line 196 of file PFCluster.h.

Referenced by getDepthCorrection(), and setDepthCorParameters().

std::atomic< double > PFCluster::depthCorB_ {7.3}
staticprivate

Definition at line 193 of file PFCluster.h.

Referenced by getDepthCorrection(), and setDepthCorParameters().

std::atomic< double > PFCluster::depthCorBp_ {4.0}
staticprivate

Definition at line 199 of file PFCluster.h.

Referenced by getDepthCorrection(), and setDepthCorParameters().

std::atomic< int > PFCluster::depthCorMode_ {0}
staticprivate

Definition at line 187 of file PFCluster.h.

Referenced by setDepthCorParameters().

const math::XYZPoint PFCluster::dummyVtx_
staticprivate

Definition at line 217 of file PFCluster.h.

Referenced by vertex().

PFLayer::Layer reco::PFCluster::layer_
private

transient layer

Definition at line 183 of file PFCluster.h.

Referenced by layer(), reset(), and setLayer().

REPPoint reco::PFCluster::posrep_
private

cluster position: rho, eta, phi (transient)

Definition at line 176 of file PFCluster.h.

Referenced by calculatePositionREP(), operator=(), positionREP(), and reset().

std::vector< reco::PFRecHitFraction > reco::PFCluster::rechits_
private

vector of rechit fractions (transient)

Definition at line 173 of file PFCluster.h.

Referenced by addRecHitFraction(), operator=(), pruneUsing(), recHitFractions(), reset(), and resetHitsAndFractions().

double reco::PFCluster::time_
private

Michalis :Add timing and depth information.

Definition at line 179 of file PFCluster.h.

Referenced by reset(), setTime(), and time().