CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
reco::PFRecHit Class Reference

Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClusterAlgo. More...

#include <PFRecHit.h>

Classes

struct  Neighbours
 

Public Types

enum  { NONE = 0 }
 
using CornersVec = CaloCellGeometry::CornersVec
 
using PositionType = GlobalPoint::BasicVectorType
 
using RepCorners = CaloCellGeometry::RepCorners
 
using REPPoint = RhoEtaPhi
 
using REPPointVector = RepCorners
 

Public Member Functions

void addNeighbour (short x, short y, short z, unsigned int)
 
CaloCellGeometry const & caloCell () const
 calo cell More...
 
void clearNeighbours ()
 
int depth () const
 depth for segemntation More...
 
unsigned detId () const
 rechit detId More...
 
float energy () const
 rechit energy More...
 
uint32_t flags () const
 
RepCorners const & getCornersREP () const
 
CornersVec const & getCornersXYZ () const
 rechit corners More...
 
unsigned int getNeighbour (short x, short y, short z) const
 
bool hasCaloCell () const
 
PFLayer::Layer layer () const
 rechit layer More...
 
const std::vector< unsigned short > & neighbourInfos ()
 
Neighbours neighbours () const
 
Neighbours neighbours4 () const
 
Neighbours neighbours8 () const
 
bool operator< (const PFRecHit &rhs) const
 comparison < operator More...
 
bool operator<= (const PFRecHit &rhs) const
 comparison <= operator More...
 
PFRecHitoperator= (const PFRecHit &other)=default
 
PFRecHitoperator= (PFRecHit &&other)=default
 
bool operator> (const PFRecHit &rhs) const
 comparison > operator More...
 
bool operator>= (const PFRecHit &rhs) const
 comparison >= operator More...
 
 PFRecHit ()
 default constructor. Sets energy and position to zero More...
 
 PFRecHit (const PFRecHit &other)=default
 copy More...
 
 PFRecHit (PFRecHit &&other)=default
 
 PFRecHit (std::shared_ptr< const CaloCellGeometry > caloCell, unsigned int detId, PFLayer::Layer layer, float energy, uint32_t flags=0)
 
PositionType const & position () const
 rechit cell centre x, y, z More...
 
RhoEtaPhi const & positionREP () const
 
double pt2 () const
 rechit momentum transverse to the beam, squared. More...
 
void setDepth (int depth)
 
void setEnergy (float energy)
 
void setFlags (uint32_t flags)
 
void setTime (double time)
 
float time () const
 timing for cleaned hits More...
 
 ~PFRecHit ()=default
 destructor More...
 

Private Member Functions

Neighbours buildNeighbours (unsigned int n) const
 

Private Attributes

std::shared_ptr< const CaloCellGeometrycaloCell_ = nullptr
 cell geometry More...
 
int depth_ = 0
 depth More...
 
unsigned int detId_ = 0
 cell detid More...
 
float energy_ = 0
 rechit energy More...
 
uint32_t flags_ = 0
 
PFLayer::Layer layer_ = PFLayer::NONE
 rechit layer More...
 
std::vector< unsigned short > neighbourInfos_
 
unsigned int neighbours4_ = 0
 
unsigned int neighbours8_ = 0
 
std::vector< unsigned int > neighbours_
 indices to existing neighbours (1 common side) More...
 
float time_ = -1
 time More...
 

Detailed Description

Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClusterAlgo.

Author
Colin Bernet
Date
July 2006

Feb 2014 [Michalis: 8 years later!Modifying the class to be able to generalize the neighbours for 3D calorimeters ]

Definition at line 31 of file PFRecHit.h.

Member Typedef Documentation

◆ CornersVec

Definition at line 37 of file PFRecHit.h.

◆ PositionType

Definition at line 33 of file PFRecHit.h.

◆ RepCorners

Definition at line 35 of file PFRecHit.h.

◆ REPPoint

Definition at line 34 of file PFRecHit.h.

◆ REPPointVector

Definition at line 36 of file PFRecHit.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
NONE 

Definition at line 49 of file PFRecHit.h.

49 { NONE = 0 };

Constructor & Destructor Documentation

◆ PFRecHit() [1/4]

reco::PFRecHit::PFRecHit ( )
inline

default constructor. Sets energy and position to zero

Definition at line 51 of file PFRecHit.h.

51 {}

◆ PFRecHit() [2/4]

reco::PFRecHit::PFRecHit ( std::shared_ptr< const CaloCellGeometry caloCell,
unsigned int  detId,
PFLayer::Layer  layer,
float  energy,
uint32_t  flags = 0 
)
inline

Definition at line 53 of file PFRecHit.h.

◆ PFRecHit() [3/4]

reco::PFRecHit::PFRecHit ( const PFRecHit other)
default

copy

◆ PFRecHit() [4/4]

reco::PFRecHit::PFRecHit ( PFRecHit &&  other)
default

◆ ~PFRecHit()

reco::PFRecHit::~PFRecHit ( )
default

destructor

Member Function Documentation

◆ addNeighbour()

void reco::PFRecHit::addNeighbour ( short  x,
short  y,
short  z,
unsigned int  ref 
)

Definition at line 5 of file PFRecHit.cc.

5  {
6  //bitmask interface to accomodate more advanced naighbour finding [i.e in z as well]
7  //bit 0 side for eta [0 for <=0 , 1 for >0]
8  //bits 1,2,3 : abs(eta) wrt the center
9  //bit 4 side for phi
10  //bits 5,6,7 : abs(phi) wrt the center
11  //bit 8 side for z
12  //bits 9,10,11 : abs(z) wrt the center
13 
14  unsigned short absx = std::abs(x);
15  unsigned short absy = std::abs(y);
16  unsigned short absz = std::abs(z);
17 
18  unsigned short bitmask = 0;
19 
20  if (x > 0)
21  bitmask = bitmask | 1;
22  bitmask = bitmask | (absx << 1);
23  if (y > 0)
24  bitmask = bitmask | (1 << 4);
25  bitmask = bitmask | (absy << 5);
26  if (z > 0)
27  bitmask = bitmask | (1 << 8);
28  bitmask = bitmask | (absz << 9);
29 
30  auto pos = neighbours_.size();
31  if (z == 0) {
32  pos = neighbours8_++;
33  //find only the 4 neighbours
34  if (absx + absy == 1)
35  pos = neighbours4_++;
36  }
37  neighbours_.insert(neighbours_.begin() + pos, ref);
38  neighbourInfos_.insert(neighbourInfos_.begin() + pos, bitmask);
39 
40  assert(neighbours4_ < 5);
41  assert(neighbours8_ < 9);
43  assert(neighbours8_ <= neighbours_.size());
44  }

References funct::abs(), cms::cuda::assert(), neighbourInfos_, neighbours4_, neighbours8_, and neighbours_.

◆ buildNeighbours()

Neighbours reco::PFRecHit::buildNeighbours ( unsigned int  n) const
inlineprivate

Definition at line 139 of file PFRecHit.h.

139 { return Neighbours(neighbours_.data(), n); }

References dqmiodumpmetadata::n, and neighbours_.

Referenced by neighbours(), neighbours4(), and neighbours8().

◆ caloCell()

CaloCellGeometry const& reco::PFRecHit::caloCell ( ) const
inline

calo cell

Definition at line 89 of file PFRecHit.h.

89 { return *(caloCell_.get()); }

References caloCell_.

Referenced by getCornersREP(), getCornersXYZ(), position(), and positionREP().

◆ clearNeighbours()

void reco::PFRecHit::clearNeighbours ( )
inline

Definition at line 75 of file PFRecHit.h.

75  {
76  neighbours_.clear();
77  neighbourInfos_.clear();
79  }

References neighbourInfos_, neighbours4_, neighbours8_, and neighbours_.

◆ depth()

int reco::PFRecHit::depth ( ) const
inline

depth for segemntation

Definition at line 105 of file PFRecHit.h.

105 { return depth_; }

References depth_.

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

◆ detId()

unsigned reco::PFRecHit::detId ( ) const
inline

◆ energy()

float reco::PFRecHit::energy ( ) const
inline

◆ flags()

uint32_t reco::PFRecHit::flags ( ) const
inline

Definition at line 111 of file PFRecHit.h.

111 { return flags_; }

References flags_.

Referenced by setFlags().

◆ getCornersREP()

RepCorners const& reco::PFRecHit::getCornersREP ( ) const
inline

Definition at line 124 of file PFRecHit.h.

124 { return caloCell().getCornersREP(); }

References caloCell(), and CaloCellGeometry::getCornersREP().

◆ getCornersXYZ()

CornersVec const& reco::PFRecHit::getCornersXYZ ( ) const
inline

rechit corners

Definition at line 122 of file PFRecHit.h.

122 { return caloCell().getCorners(); }

References caloCell(), and CaloCellGeometry::getCorners().

Referenced by LinkByRecHit::testECALAndPSByRecHit().

◆ getNeighbour()

unsigned int reco::PFRecHit::getNeighbour ( short  x,
short  y,
short  z 
) const

Definition at line 46 of file PFRecHit.cc.

46  {
47  unsigned short absx = abs(x);
48  unsigned short absy = abs(y);
49  unsigned short absz = abs(z);
50 
51  unsigned short bitmask = 0;
52 
53  if (x > 0)
54  bitmask = bitmask | 1;
55  bitmask = bitmask | (absx << 1);
56  if (y > 0)
57  bitmask = bitmask | (1 << 4);
58  bitmask = bitmask | (absy << 5);
59  if (z > 0)
60  bitmask = bitmask | (1 << 8);
61  bitmask = bitmask | (absz << 9);
62 
63  for (unsigned int i = 0; i < neighbourInfos_.size(); ++i) {
64  if (neighbourInfos_[i] == bitmask)
65  return neighbours_[i];
66  }
68  }

References funct::abs(), mps_fire::i, SiStripPI::max, neighbourInfos_, and neighbours_.

◆ hasCaloCell()

bool reco::PFRecHit::hasCaloCell ( ) const
inline

Definition at line 90 of file PFRecHit.h.

90 { return (caloCell_ != nullptr); }

References caloCell_.

◆ layer()

PFLayer::Layer reco::PFRecHit::layer ( ) const
inline

◆ neighbourInfos()

const std::vector<unsigned short>& reco::PFRecHit::neighbourInfos ( )
inline

Definition at line 86 of file PFRecHit.h.

86 { return neighbourInfos_; }

References neighbourInfos_.

◆ neighbours()

Neighbours reco::PFRecHit::neighbours ( ) const
inline

Definition at line 84 of file PFRecHit.h.

84 { return buildNeighbours(neighbours_.size()); }

References buildNeighbours(), and neighbours_.

◆ neighbours4()

Neighbours reco::PFRecHit::neighbours4 ( ) const
inline

Definition at line 81 of file PFRecHit.h.

81 { return buildNeighbours(neighbours4_); }

References buildNeighbours(), and neighbours4_.

Referenced by RBXAndHPDCleaner::clean(), and SpikeAndDoubleSpikeCleaner::clean().

◆ neighbours8()

Neighbours reco::PFRecHit::neighbours8 ( ) const
inline

Definition at line 82 of file PFRecHit.h.

82 { return buildNeighbours(neighbours8_); }

References buildNeighbours(), and neighbours8_.

◆ operator<()

bool reco::PFRecHit::operator< ( const PFRecHit rhs) const
inline

comparison < operator

Definition at line 136 of file PFRecHit.h.

136 { return (energy_ < rhs.energy_); }

References energy_.

◆ operator<=()

bool reco::PFRecHit::operator<= ( const PFRecHit rhs) const
inline

comparison <= operator

Definition at line 133 of file PFRecHit.h.

133 { return (energy_ <= rhs.energy_); }

References energy_.

◆ operator=() [1/2]

PFRecHit& reco::PFRecHit::operator= ( const PFRecHit other)
default

◆ operator=() [2/2]

PFRecHit& reco::PFRecHit::operator= ( PFRecHit &&  other)
default

◆ operator>()

bool reco::PFRecHit::operator> ( const PFRecHit rhs) const
inline

comparison > operator

Definition at line 130 of file PFRecHit.h.

130 { return (energy_ > rhs.energy_); }

References energy_.

◆ operator>=()

bool reco::PFRecHit::operator>= ( const PFRecHit rhs) const
inline

comparison >= operator

Definition at line 127 of file PFRecHit.h.

127 { return (energy_ >= rhs.energy_); }

References energy_.

◆ position()

PositionType const& reco::PFRecHit::position ( ) const
inline

◆ positionREP()

RhoEtaPhi const& reco::PFRecHit::positionREP ( ) const
inline

Definition at line 119 of file PFRecHit.h.

119 { return caloCell().repPos(); }

References caloCell(), and CaloCellGeometry::repPos().

Referenced by SpikeAndDoubleSpikeCleaner::clean().

◆ pt2()

double reco::PFRecHit::pt2 ( ) const
inline

rechit momentum transverse to the beam, squared.

Definition at line 108 of file PFRecHit.h.

108 { return energy_ * energy_ * (position().perp2() / position().mag2()); }

References energy_, Basic3DVector< T >::mag2(), Basic3DVector< T >::perp2(), and position().

◆ setDepth()

void reco::PFRecHit::setDepth ( int  depth)
inline

Definition at line 74 of file PFRecHit.h.

74 { depth_ = depth; }

References depth(), and depth_.

◆ setEnergy()

void reco::PFRecHit::setEnergy ( float  energy)
inline

Definition at line 69 of file PFRecHit.h.

69 { energy_ = energy; }

References energy(), and energy_.

Referenced by PFHFRecHitCreator::importRecHits().

◆ setFlags()

void reco::PFRecHit::setFlags ( uint32_t  flags)
inline

Definition at line 114 of file PFRecHit.h.

114 { flags_ = flags; }

References flags(), and flags_.

◆ setTime()

void reco::PFRecHit::setTime ( double  time)
inline

◆ time()

float reco::PFRecHit::time ( ) const
inline

Member Data Documentation

◆ caloCell_

std::shared_ptr<const CaloCellGeometry> reco::PFRecHit::caloCell_ = nullptr
private

cell geometry

Definition at line 142 of file PFRecHit.h.

Referenced by caloCell(), and hasCaloCell().

◆ depth_

int reco::PFRecHit::depth_ = 0
private

depth

Definition at line 157 of file PFRecHit.h.

Referenced by depth(), and setDepth().

◆ detId_

unsigned int reco::PFRecHit::detId_ = 0
private

cell detid

Definition at line 145 of file PFRecHit.h.

Referenced by detId().

◆ energy_

float reco::PFRecHit::energy_ = 0
private

rechit energy

Definition at line 151 of file PFRecHit.h.

Referenced by energy(), operator<(), operator<=(), operator>(), operator>=(), pt2(), and setEnergy().

◆ flags_

uint32_t reco::PFRecHit::flags_ = 0
private

Definition at line 168 of file PFRecHit.h.

Referenced by flags(), and setFlags().

◆ layer_

PFLayer::Layer reco::PFRecHit::layer_ = PFLayer::NONE
private

rechit layer

Definition at line 148 of file PFRecHit.h.

Referenced by layer().

◆ neighbourInfos_

std::vector<unsigned short> reco::PFRecHit::neighbourInfos_
private

Definition at line 161 of file PFRecHit.h.

Referenced by addNeighbour(), clearNeighbours(), getNeighbour(), and neighbourInfos().

◆ neighbours4_

unsigned int reco::PFRecHit::neighbours4_ = 0
private

Definition at line 164 of file PFRecHit.h.

Referenced by addNeighbour(), clearNeighbours(), and neighbours4().

◆ neighbours8_

unsigned int reco::PFRecHit::neighbours8_ = 0
private

Definition at line 165 of file PFRecHit.h.

Referenced by addNeighbour(), clearNeighbours(), and neighbours8().

◆ neighbours_

std::vector<unsigned int> reco::PFRecHit::neighbours_
private

indices to existing neighbours (1 common side)

Definition at line 160 of file PFRecHit.h.

Referenced by addNeighbour(), buildNeighbours(), clearNeighbours(), getNeighbour(), and neighbours().

◆ time_

float reco::PFRecHit::time_ = -1
private

time

Definition at line 154 of file PFRecHit.h.

Referenced by setTime(), and time().

reco::PFRecHit::time_
float time_
time
Definition: PFRecHit.h:154
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
reco::PFRecHit::buildNeighbours
Neighbours buildNeighbours(unsigned int n) const
Definition: PFRecHit.h:139
reco::PFRecHit::energy
float energy() const
rechit energy
Definition: PFRecHit.h:99
pos
Definition: PixelAliasList.h:18
reco::PFRecHit::flags
uint32_t flags() const
Definition: PFRecHit.h:111
Basic3DVector::perp2
T perp2() const
Squared magnitude of transverse component.
Definition: extBasic3DVector.h:119
cms::cuda::assert
assert(be >=bs)
CaloCellGeometry::getCorners
CornersVec const & getCorners() const
Returns the corner points of this cell's volume.
Definition: CaloCellGeometry.h:73
Basic3DVector::mag2
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Definition: extBasic3DVector.h:113
CaloCellGeometry::getCornersREP
RepCorners const & getCornersREP() const
Definition: CaloCellGeometry.h:77
reco::PFRecHit::depth
int depth() const
depth for segemntation
Definition: PFRecHit.h:105
reco::PFRecHit::caloCell
CaloCellGeometry const & caloCell() const
calo cell
Definition: PFRecHit.h:89
CaloCellGeometry::getPosition
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
Definition: CaloCellGeometry.h:80
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
reco::PFRecHit::energy_
float energy_
rechit energy
Definition: PFRecHit.h:151
reco::PFRecHit::NONE
Definition: PFRecHit.h:49
reco::PFRecHit::neighbours4_
unsigned int neighbours4_
Definition: PFRecHit.h:164
reco::PFRecHit::neighbourInfos_
std::vector< unsigned short > neighbourInfos_
Definition: PFRecHit.h:161
reco::PFRecHit::layer_
PFLayer::Layer layer_
rechit layer
Definition: PFRecHit.h:148
PV3DBase::basicVector
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
reco::PFRecHit::time
float time() const
timing for cleaned hits
Definition: PFRecHit.h:102
reco::PFRecHit::detId
unsigned detId() const
rechit detId
Definition: PFRecHit.h:93
reco::PFRecHit::caloCell_
std::shared_ptr< const CaloCellGeometry > caloCell_
cell geometry
Definition: PFRecHit.h:142
reco::PFRecHit::depth_
int depth_
depth
Definition: PFRecHit.h:157
eostools.move
def move(src, dest)
Definition: eostools.py:511
reco::PFRecHit::neighbours_
std::vector< unsigned int > neighbours_
indices to existing neighbours (1 common side)
Definition: PFRecHit.h:160
reco::PFRecHit::neighbours8_
unsigned int neighbours8_
Definition: PFRecHit.h:165
CaloCellGeometry::repPos
RhoEtaPhi const & repPos() const
Definition: CaloCellGeometry.h:86
reco::PFRecHit::position
PositionType const & position() const
rechit cell centre x, y, z
Definition: PFRecHit.h:117
reco::PFRecHit::detId_
unsigned int detId_
cell detid
Definition: PFRecHit.h:145
reco::PFRecHit::layer
PFLayer::Layer layer() const
rechit layer
Definition: PFRecHit.h:96
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::PFRecHit::flags_
uint32_t flags_
Definition: PFRecHit.h:168