#include <DataFormats/ParticleFlowReco/interface/PFRecHit.h>
Public Types | |
enum | { NONE = 0 } |
typedef ROOT::Math::PositionVector3D < ROOT::Math::CylindricalEta3D < Double32_t > > | REPPoint |
typedef std::vector< REPPoint > | REPPointVector |
Public Member Functions | |
void | add4Neighbour (unsigned index) |
void | add8Neighbour (unsigned index) |
void | calculatePositionREP () |
calculates rho eta phi position once and for all | |
void | clearNeighbours () |
unsigned | detId () const |
rechit detId | |
double | energy () const |
rechit energy | |
const math::XYZVector & | getAxisXYZ () const |
rechit cell axis x, y, z | |
const REPPointVector & | getCornersREP () const |
rechit corners | |
const std::vector < math::XYZPoint > & | getCornersXYZ () const |
rechit corners | |
bool | isNeighbour4 (unsigned id) const |
is rechit 'id' a direct neighbour of this ? id is the rechit index ! not the detId | |
bool | isNeighbour8 (unsigned id) const |
is rechit 'id' a neighbour of this ? id is the rechit index ! not the detId | |
PFLayer::Layer | layer () const |
rechit layer | |
const std::vector< unsigned > & | neighbours4 () const |
const std::vector< unsigned > & | neighbours8 () const |
const std::vector< unsigned > & | neighboursIds4 () const |
const std::vector< unsigned > & | neighboursIds8 () const |
bool | operator< (const PFRecHit &rhs) const |
comparison < operator | |
bool | operator<= (const PFRecHit &rhs) const |
comparison <= operator | |
bool | operator> (const PFRecHit &rhs) const |
comparison > operator | |
bool | operator>= (const PFRecHit &rhs) const |
comparison >= operator | |
PFRecHit (const PFRecHit &other) | |
copy | |
PFRecHit (unsigned detId, PFLayer::Layer layer, double energy, double posx, double posy, double posz, double axisx, double axisy, double axisz) | |
PFRecHit (unsigned detId, PFLayer::Layer layer, double energy, const math::XYZPoint &posxyz, const math::XYZVector &axisxyz, const std::vector< math::XYZPoint > &cornersxyz) | |
constructor from values | |
PFRecHit () | |
default constructor. Sets energy and position to zero | |
const math::XYZPoint & | position () const |
| |
const REPPoint & | positionREP () const |
rechit cell centre rho, eta, phi. call calculatePositionREP before ! | |
void | setNECorner (double posx, double posy, double posz) |
void | setNWCorner (double posx, double posy, double posz) |
search for pointers to neighbours, using neighbours' DetId. | |
void | setSECorner (double posx, double posy, double posz) |
void | setSWCorner (double posx, double posy, double posz) |
void | size (double &deta, double &dphi) const |
virtual | ~PFRecHit () |
destructor | |
Private Member Functions | |
void | setCorner (unsigned i, double posx, double posy, double posz) |
set position of one of the corners | |
Private Attributes | |
math::XYZVector | axisxyz_ |
rechit cell axisxyz | |
REPPointVector | cornersrep_ |
std::vector< math::XYZPoint > | cornersxyz_ |
rechit cell corners | |
unsigned | detId_ |
C cell detid - should be detid or index in collection ? | |
double | energy_ |
rechit energy | |
PFLayer::Layer | layer_ |
rechit layer | |
std::vector< unsigned > | neighbours4_ |
indices to existing neighbours (1 common side) | |
std::vector< unsigned > | neighbours8_ |
indices to existing neighbours (1 common side or diagonal) | |
std::vector< unsigned > | neighboursIds4_ |
detids of existing neighbours (1 common side) | |
std::vector< unsigned > | neighboursIds8_ |
detids of existing neighbours (1 common side or diagonal) | |
math::XYZPoint | position_ |
is this a seed ? (-1:unknown, 0:no, 1 yes) (transient) | |
REPPoint | posrep_ |
rechit cell centre: rho, eta, phi (transient) | |
Static Private Attributes | |
static const unsigned | nCorners_ = 4 |
number of corners | |
static const unsigned | nNeighbours_ = 8 |
number of neighbours | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const reco::PFRecHit &hit) |
See clustering algorithm in PFClusterAlgo
Definition at line 31 of file PFRecHit.h.
typedef ROOT::Math::PositionVector3D<ROOT::Math::CylindricalEta3D<Double32_t> > reco::PFRecHit::REPPoint |
Definition at line 39 of file PFRecHit.h.
typedef std::vector<REPPoint> reco::PFRecHit::REPPointVector |
Definition at line 41 of file PFRecHit.h.
anonymous enum |
PFRecHit::PFRecHit | ( | ) |
default constructor. Sets energy and position to zero
Definition at line 9 of file PFRecHit.cc.
References cornersrep_, cornersxyz_, i, nCorners_, and position_.
00009 : 00010 detId_(0), 00011 layer_(PFLayer::NONE), 00012 energy_(0.), 00013 // seedState_(-1), 00014 position_(math::XYZPoint(0.,0.,0.)), 00015 posrep_(REPPoint(0.,0.,0.)) { 00016 00017 cornersxyz_.reserve( nCorners_ ); 00018 for(unsigned i=0; i<nCorners_; i++) { 00019 cornersxyz_.push_back( position_ ); 00020 } 00021 00022 cornersrep_.reserve( nCorners_ ); 00023 for ( unsigned i=0; i<nCorners_; ++i ) { 00024 cornersrep_.push_back( 00025 REPPoint(cornersxyz_[i].Rho(), 00026 cornersxyz_[i].Eta(), 00027 cornersxyz_[i].Phi() ) ); 00028 } 00029 00030 }
reco::PFRecHit::PFRecHit | ( | unsigned | detId, | |
PFLayer::Layer | layer, | |||
double | energy, | |||
const math::XYZPoint & | posxyz, | |||
const math::XYZVector & | axisxyz, | |||
const std::vector< math::XYZPoint > & | cornersxyz | |||
) |
constructor from values
PFRecHit::PFRecHit | ( | unsigned | detId, | |
PFLayer::Layer | layer, | |||
double | energy, | |||
double | posx, | |||
double | posy, | |||
double | posz, | |||
double | axisx, | |||
double | axisy, | |||
double | axisz | |||
) |
Definition at line 57 of file PFRecHit.cc.
References cornersrep_, cornersxyz_, i, and position_.
00061 : 00062 00063 detId_(detId), 00064 layer_(layer), 00065 energy_(energy), 00066 // seedState_(-1), 00067 position_(posx, posy, posz), 00068 posrep_( position_.Rho(), 00069 position_.Eta(), 00070 position_.Phi() ), 00071 axisxyz_(axisx, axisy, axisz) { 00072 00073 00074 cornersxyz_.reserve( nCorners_ ); 00075 for(unsigned i=0; i<nCorners_; i++) { 00076 cornersxyz_.push_back( position_ ); 00077 } 00078 00079 cornersrep_.reserve( nCorners_ ); 00080 for ( unsigned i=0; i<nCorners_; ++i ) { 00081 cornersrep_.push_back( 00082 REPPoint(cornersxyz_[i].Rho(), 00083 cornersxyz_[i].Eta(), 00084 cornersxyz_[i].Phi() ) ); 00085 } 00086 00087 }
PFRecHit::PFRecHit | ( | const PFRecHit & | other | ) |
copy
Definition at line 90 of file PFRecHit.cc.
00090 : 00091 detId_(other.detId_), 00092 layer_(other.layer_), 00093 energy_(other.energy_), 00094 // seedState_(other.seedState_), 00095 position_(other.position_), 00096 posrep_(other.posrep_), 00097 axisxyz_(other.axisxyz_), 00098 cornersxyz_(other.cornersxyz_), 00099 cornersrep_(other.cornersrep_), 00100 // neighbours_(other.neighbours_), 00101 neighbours4_(other.neighbours4_), 00102 neighbours8_(other.neighbours8_), 00103 neighboursIds4_(other.neighboursIds4_), 00104 neighboursIds8_(other.neighboursIds8_) 00105 {}
PFRecHit::~PFRecHit | ( | ) | [virtual] |
void PFRecHit::add4Neighbour | ( | unsigned | index | ) |
Definition at line 168 of file PFRecHit.cc.
References neighbours4_, and neighbours8_.
00168 { 00169 neighbours4_.push_back( index ); 00170 neighbours8_.push_back( index ); 00171 }
void PFRecHit::add8Neighbour | ( | unsigned | index | ) |
Definition at line 173 of file PFRecHit.cc.
References neighbours8_.
00173 { 00174 neighbours8_.push_back( index ); 00175 }
void PFRecHit::calculatePositionREP | ( | ) |
calculates rho eta phi position once and for all
Definition at line 122 of file PFRecHit.cc.
References cornersrep_, cornersxyz_, i, position_, and posrep_.
00122 { 00123 posrep_.SetCoordinates( position_.Rho(), position_.Eta(), position_.Phi() ); 00124 for ( unsigned i=0; i<nCorners_; ++i ) { 00125 cornersrep_[i].SetCoordinates(cornersxyz_[i].Rho(),cornersxyz_[i].Eta(),cornersxyz_[i].Phi() ); 00126 } 00127 }
void reco::PFRecHit::clearNeighbours | ( | ) | [inline] |
Definition at line 74 of file PFRecHit.h.
References neighbours4_, and neighbours8_.
00074 { 00075 neighbours4_.clear(); 00076 neighbours8_.clear(); 00077 neighbours4_.reserve(4); 00078 neighbours8_.reserve(8); 00079 }
unsigned reco::PFRecHit::detId | ( | ) | const [inline] |
rechit detId
Definition at line 97 of file PFRecHit.h.
References detId_.
Referenced by PFRootEventManager::mcTruthMatching(), and reco::operator<<().
00097 {return detId_;}
double reco::PFRecHit::energy | ( | ) | const [inline] |
rechit energy
Definition at line 103 of file PFRecHit.h.
References energy_.
Referenced by PFClusterAlgo::calculateClusterPosition(), DisplayManager::createGRecHit(), PFClusterAlgo::findSeeds(), GPFRecHit::GPFRecHit(), PFRootEventManager::mcTruthMatching(), reco::operator<<(), and PFBlockAlgo::testLinkByRecHit().
00103 { return energy_; }
const math::XYZVector& reco::PFRecHit::getAxisXYZ | ( | ) | const [inline] |
rechit cell axis x, y, z
Definition at line 122 of file PFRecHit.h.
References axisxyz_.
Referenced by PFClusterAlgo::calculateClusterPosition().
00122 { return axisxyz_; }
const REPPointVector& reco::PFRecHit::getCornersREP | ( | ) | const [inline] |
rechit corners
Definition at line 129 of file PFRecHit.h.
References cornersrep_.
Referenced by PFBlockAlgo::testLinkByRecHit().
00130 { return cornersrep_; }
const std::vector< math::XYZPoint >& reco::PFRecHit::getCornersXYZ | ( | ) | const [inline] |
rechit corners
Definition at line 125 of file PFRecHit.h.
References cornersxyz_.
Referenced by DisplayManager::createGRecHit(), and PFBlockAlgo::testLinkByRecHit().
00126 { return cornersxyz_; }
bool PFRecHit::isNeighbour4 | ( | unsigned | id | ) | const |
is rechit 'id' a direct neighbour of this ? id is the rechit index ! not the detId
Definition at line 240 of file PFRecHit.cc.
References i, and neighbours4_.
Referenced by PFClusterAlgo::calculateClusterPosition().
00240 { 00241 00242 for(unsigned i=0; i<neighbours4_.size(); i++ ) 00243 if( id == neighbours4_[i] ) return true; 00244 00245 return false; 00246 }
bool PFRecHit::isNeighbour8 | ( | unsigned | id | ) | const |
is rechit 'id' a neighbour of this ? id is the rechit index ! not the detId
Definition at line 249 of file PFRecHit.cc.
References i, and neighbours8_.
Referenced by PFClusterAlgo::calculateClusterPosition().
00249 { 00250 00251 for(unsigned i=0; i<neighbours8_.size(); i++ ) 00252 if( id == neighbours8_[i] ) return true; 00253 00254 return false; 00255 }
PFLayer::Layer reco::PFRecHit::layer | ( | ) | const [inline] |
rechit layer
Definition at line 100 of file PFRecHit.h.
References layer_.
Referenced by PFClusterAlgo::buildPFClusters(), PFClusterAlgo::calculateClusterPosition(), DisplayManager::createGRecHit(), PFClusterAlgo::findSeeds(), and reco::operator<<().
00100 { return layer_; }
const std::vector< unsigned >& reco::PFRecHit::neighbours4 | ( | ) | const [inline] |
Definition at line 132 of file PFRecHit.h.
References neighbours4_.
Referenced by PFClusterAlgo::findSeeds().
00133 {return neighbours4_;}
const std::vector< unsigned >& reco::PFRecHit::neighbours8 | ( | ) | const [inline] |
Definition at line 135 of file PFRecHit.h.
References neighbours8_.
Referenced by PFClusterAlgo::findSeeds().
00136 {return neighbours8_;}
const std::vector< unsigned >& reco::PFRecHit::neighboursIds4 | ( | ) | const [inline] |
Definition at line 138 of file PFRecHit.h.
References neighboursIds4_.
00139 {return neighboursIds4_;}
const std::vector< unsigned >& reco::PFRecHit::neighboursIds8 | ( | ) | const [inline] |
Definition at line 141 of file PFRecHit.h.
References neighboursIds8_.
00142 {return neighboursIds8_;}
comparison < operator
Definition at line 171 of file PFRecHit.h.
References energy_.
00171 { return (energy_< rhs.energy_); }
comparison <= operator
Definition at line 168 of file PFRecHit.h.
References energy_.
00168 { return (energy_<=rhs.energy_); }
comparison > operator
Definition at line 165 of file PFRecHit.h.
References energy_.
00165 { return (energy_> rhs.energy_); }
comparison >= operator
Definition at line 162 of file PFRecHit.h.
References energy_.
00162 { return (energy_>=rhs.energy_); }
const math::XYZPoint& reco::PFRecHit::position | ( | ) | const [inline] |
is seed ? set seed status rechit cell centre x, y, z
Definition at line 116 of file PFRecHit.h.
References position_.
Referenced by PFClusterAlgo::buildPFClusters(), PFClusterAlgo::calculateClusterPosition(), DisplayManager::createGRecHit(), DisplayManager::lookForMaxRecHit(), reco::operator<<(), and PFBlockAlgo::testLinkByRecHit().
00116 { return position_; }
const PFRecHit::REPPoint & PFRecHit::positionREP | ( | ) | const |
rechit cell centre rho, eta, phi. call calculatePositionREP before !
Definition at line 113 of file PFRecHit.cc.
References posrep_.
Referenced by PFBlockAlgo::testLinkByRecHit().
00113 { 00114 // if( posrep_ == REPPoint() ) { 00115 // posrep_.SetCoordinates( position_.Rho(), position_.Eta(), position_.Phi() ); 00116 // } 00117 return posrep_; 00118 }
void PFRecHit::setCorner | ( | unsigned | i, | |
double | posx, | |||
double | posy, | |||
double | posz | |||
) | [private] |
set position of one of the corners
Definition at line 228 of file PFRecHit.cc.
References cornersrep_, and cornersxyz_.
Referenced by setNECorner(), setNWCorner(), setSECorner(), and setSWCorner().
00228 { 00229 assert( cornersxyz_.size() == nCorners_); 00230 assert( cornersrep_.size() == nCorners_); 00231 assert( i<cornersxyz_.size() ); 00232 00233 cornersxyz_[i] = math::XYZPoint( posx, posy, posz); 00234 cornersrep_[i] = REPPoint(cornersxyz_[i].Rho(), 00235 cornersxyz_[i].Eta(), 00236 cornersxyz_[i].Phi() ); 00237 }
void PFRecHit::setNECorner | ( | double | posx, | |
double | posy, | |||
double | posz | |||
) |
Definition at line 223 of file PFRecHit.cc.
References setCorner().
Referenced by PFRecHitProducerECAL::createEcalRecHit(), and PFRecHitProducerHCAL::createHcalRecHit().
00223 { 00224 setCorner(3, posx, posy, posz); 00225 }
void PFRecHit::setNWCorner | ( | double | posx, | |
double | posy, | |||
double | posz | |||
) |
search for pointers to neighbours, using neighbours' DetId.
pointers to neighbours are not persistent, in contrary to the DetId's of the neighbours. This function searches a map of rechits for the DetId's stored in neighboursIds4_ and neighboursIds8_. The corresponding pointers are stored in neighbours4_ and neighbours8_.
Definition at line 208 of file PFRecHit.cc.
References setCorner().
Referenced by PFRecHitProducerECAL::createEcalRecHit(), and PFRecHitProducerHCAL::createHcalRecHit().
00208 { 00209 setCorner(0, posx, posy, posz); 00210 }
void PFRecHit::setSECorner | ( | double | posx, | |
double | posy, | |||
double | posz | |||
) |
Definition at line 218 of file PFRecHit.cc.
References setCorner().
Referenced by PFRecHitProducerECAL::createEcalRecHit(), and PFRecHitProducerHCAL::createHcalRecHit().
00218 { 00219 setCorner(2, posx, posy, posz); 00220 }
void PFRecHit::setSWCorner | ( | double | posx, | |
double | posy, | |||
double | posz | |||
) |
Definition at line 213 of file PFRecHit.cc.
References setCorner().
Referenced by PFRecHitProducerECAL::createEcalRecHit(), and PFRecHitProducerHCAL::createHcalRecHit().
00213 { 00214 setCorner(1, posx, posy, posz); 00215 }
void PFRecHit::size | ( | double & | deta, | |
double & | dphi | |||
) | const |
Definition at line 258 of file PFRecHit.cc.
References cornersrep_, eta, and phi.
Referenced by DisplayManager::lookForMaxRecHit().
00258 { 00259 00260 double minphi=9999; 00261 double maxphi=-9999; 00262 double mineta=9999; 00263 double maxeta=-9999; 00264 for ( unsigned ic=0; ic<cornersrep_.size(); ++ic ) { 00265 double eta = cornersrep_[ic].Eta(); 00266 double phi = cornersrep_[ic].Phi(); 00267 00268 if(phi>maxphi) maxphi=phi; 00269 if(phi<minphi) minphi=phi; 00270 if(eta>maxeta) maxeta=eta; 00271 if(eta<mineta) mineta=eta; 00272 } 00273 00274 deta = maxeta - mineta; 00275 dphi = maxphi - minphi; 00276 }
std::ostream& operator<< | ( | std::ostream & | out, | |
const reco::PFRecHit & | hit | |||
) | [friend] |
math::XYZVector reco::PFRecHit::axisxyz_ [private] |
REPPointVector reco::PFRecHit::cornersrep_ [private] |
Definition at line 201 of file PFRecHit.h.
Referenced by calculatePositionREP(), getCornersREP(), PFRecHit(), setCorner(), and size().
std::vector< math::XYZPoint > reco::PFRecHit::cornersxyz_ [private] |
rechit cell corners
Definition at line 200 of file PFRecHit.h.
Referenced by calculatePositionREP(), getCornersXYZ(), PFRecHit(), and setCorner().
unsigned reco::PFRecHit::detId_ [private] |
C cell detid - should be detid or index in collection ?
Definition at line 179 of file PFRecHit.h.
Referenced by detId().
double reco::PFRecHit::energy_ [private] |
rechit energy
Definition at line 185 of file PFRecHit.h.
Referenced by energy(), operator<(), operator<=(), operator>(), and operator>=().
PFLayer::Layer reco::PFRecHit::layer_ [private] |
const unsigned PFRecHit::nCorners_ = 4 [static, private] |
std::vector< unsigned > reco::PFRecHit::neighbours4_ [private] |
indices to existing neighbours (1 common side)
Definition at line 204 of file PFRecHit.h.
Referenced by add4Neighbour(), clearNeighbours(), isNeighbour4(), and neighbours4().
std::vector< unsigned > reco::PFRecHit::neighbours8_ [private] |
indices to existing neighbours (1 common side or diagonal)
Definition at line 207 of file PFRecHit.h.
Referenced by add4Neighbour(), add8Neighbour(), clearNeighbours(), isNeighbour8(), neighbours8(), and reco::operator<<().
std::vector< unsigned > reco::PFRecHit::neighboursIds4_ [private] |
detids of existing neighbours (1 common side)
Definition at line 210 of file PFRecHit.h.
Referenced by neighboursIds4().
std::vector< unsigned > reco::PFRecHit::neighboursIds8_ [private] |
detids of existing neighbours (1 common side or diagonal)
Definition at line 213 of file PFRecHit.h.
Referenced by neighboursIds8().
const unsigned PFRecHit::nNeighbours_ = 8 [static, private] |
math::XYZPoint reco::PFRecHit::position_ [private] |
is this a seed ? (-1:unknown, 0:no, 1 yes) (transient)
rechit cell centre: x, y, z
Definition at line 191 of file PFRecHit.h.
Referenced by calculatePositionREP(), PFRecHit(), and position().
REPPoint reco::PFRecHit::posrep_ [private] |
rechit cell centre: rho, eta, phi (transient)
Definition at line 194 of file PFRecHit.h.
Referenced by calculatePositionREP(), and positionREP().