CMS 3D CMS Logo

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

reco::PFRecHit Class Reference

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

#include <PFRecHit.h>

List of all members.

Public Types

enum  { NONE = 0 }
typedef
ROOT::Math::PositionVector3D
< ROOT::Math::CylindricalEta3D
< Double32_t > > 
REPPoint
typedef std::vector< REPPointREPPointVector

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
double energyUp () const
 For HF hits: rechit energy (and neighbour's) in the other HF layer.
const math::XYZVectorgetAxisXYZ () const
 rechit cell axis x, y, z
const REPPointVectorgetCornersREP () const
 rechit corners
const std::vector
< math::XYZPoint > & 
getCornersXYZ () const
 rechit corners
bool isNeighbour4 (unsigned id) const
bool isNeighbour8 (unsigned id) const
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 (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 (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 ()
 default constructor. Sets energy and position to zero
const math::XYZPointposition () const
 is seed ?
const REPPointpositionREP () const
 rechit cell centre rho, eta, phi. call calculatePositionREP before !
double pt2 () const
 rechit momentum transverse to the beam, squared.
double rescale () const
 rescaling factor (obsolete)
void setEnergyUp (double eUp)
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 setRescale (double factor)
void setSECorner (double posx, double posy, double posz)
void setSWCorner (double posx, double posy, double posz)
void size (double &deta, double &dphi) const
double time () const
 timing for cleaned hits
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::XYZPointcornersxyz_
 rechit cell corners
unsigned detId_
 C cell detid - should be detid or index in collection ?
double energy_
 rechit energy
double energyUp_
 For HF hits : hit energy in the other layer (EM for HAD, and HAD for EM)
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)
double rescale_
 Internal rescaling factor of the energy (1. = default, 0 = killed channels, x = rescaled)

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)

Detailed Description

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

Author:
Colin Bernet
Date:
July 2006

Definition at line 31 of file PFRecHit.h.


Member Typedef Documentation

typedef ROOT::Math::PositionVector3D<ROOT::Math::CylindricalEta3D<Double32_t> > reco::PFRecHit::REPPoint

Definition at line 39 of file PFRecHit.h.

Definition at line 41 of file PFRecHit.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
NONE 

Definition at line 35 of file PFRecHit.h.

         {
      NONE=0
    };

Constructor & Destructor Documentation

PFRecHit::PFRecHit ( )

default constructor. Sets energy and position to zero

Definition at line 9 of file PFRecHit.cc.

References cornersrep_, cornersxyz_, reco::tau::disc::Eta(), i, nCorners_, colinearityKinematic::Phi, and position_.

                   : 
  detId_(0),
  layer_(PFLayer::NONE),
  energy_(0.), 
  rescale_(1.),
  energyUp_(0.),
  // seedState_(-1), 
  position_(math::XYZPoint(0.,0.,0.)),
  posrep_(REPPoint(0.,0.,0.)) {

  cornersxyz_.reserve( nCorners_ );
  for(unsigned i=0; i<nCorners_; i++) { 
    cornersxyz_.push_back( position_ );    
  }

  cornersrep_.reserve( nCorners_ );
  for ( unsigned i=0; i<nCorners_; ++i ) {
    cornersrep_.push_back( 
      REPPoint(cornersxyz_[i].Rho(),
               cornersxyz_[i].Eta(),
               cornersxyz_[i].Phi() ) );
  }

}
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 61 of file PFRecHit.cc.

References cornersrep_, cornersxyz_, reco::tau::disc::Eta(), i, nCorners_, colinearityKinematic::Phi, and position_.

                                                             :

  detId_(detId),
  layer_(layer),
  energy_(energy), 
  rescale_(1.),
  energyUp_(0.),
  // seedState_(-1), 
  position_(posx, posy, posz),
  posrep_( position_.Rho(), 
           position_.Eta(), 
           position_.Phi() ),  
  axisxyz_(axisx, axisy, axisz) {
  

  cornersxyz_.reserve( nCorners_ );
  for(unsigned i=0; i<nCorners_; i++) { 
    cornersxyz_.push_back( position_ );    
  } 

  cornersrep_.reserve( nCorners_ );
  for ( unsigned i=0; i<nCorners_; ++i ) {
    cornersrep_.push_back( 
      REPPoint(cornersxyz_[i].Rho(),
               cornersxyz_[i].Eta(),
               cornersxyz_[i].Phi() ) );
  }
 
}    
PFRecHit::PFRecHit ( const PFRecHit other)

copy

Definition at line 96 of file PFRecHit.cc.

                                        :
  detId_(other.detId_), 
  layer_(other.layer_), 
  energy_(other.energy_), 
  rescale_(other.rescale_), 
  energyUp_(other.energyUp_),
  // seedState_(other.seedState_),
  position_(other.position_), 
  posrep_(other.posrep_),
  axisxyz_(other.axisxyz_),
  cornersxyz_(other.cornersxyz_),
  cornersrep_(other.cornersrep_),
  //   neighbours_(other.neighbours_),
  neighbours4_(other.neighbours4_),
  neighbours8_(other.neighbours8_),
  neighboursIds4_(other.neighboursIds4_),
  neighboursIds8_(other.neighboursIds8_)
{}
PFRecHit::~PFRecHit ( ) [virtual]

destructor

Definition at line 116 of file PFRecHit.cc.

{}

Member Function Documentation

void PFRecHit::add4Neighbour ( unsigned  index)
void PFRecHit::add8Neighbour ( unsigned  index)
void PFRecHit::calculatePositionREP ( )

calculates rho eta phi position once and for all

Definition at line 130 of file PFRecHit.cc.

References cornersrep_, cornersxyz_, reco::tau::disc::Eta(), i, nCorners_, colinearityKinematic::Phi, position_, and posrep_.

                               {
  posrep_.SetCoordinates( position_.Rho(),  position_.Eta(),  position_.Phi() );
  for ( unsigned i=0; i<nCorners_; ++i ) {
    cornersrep_[i].SetCoordinates(cornersxyz_[i].Rho(),cornersxyz_[i].Eta(),cornersxyz_[i].Phi() );
  }
}
void reco::PFRecHit::clearNeighbours ( ) [inline]

Definition at line 76 of file PFRecHit.h.

References neighbours4_, and neighbours8_.

Referenced by PFRootEventManager::setRecHitNeigbours().

                           {
      neighbours4_.clear();
      neighbours8_.clear();
      neighbours4_.reserve(4);
      neighbours8_.reserve(8);    
    }
unsigned reco::PFRecHit::detId ( ) const [inline]
double reco::PFRecHit::energy ( ) const [inline]
double reco::PFRecHit::energyUp ( ) const [inline]

For HF hits: rechit energy (and neighbour's) in the other HF layer.

Definition at line 114 of file PFRecHit.h.

References energyUp_.

Referenced by PFClusterAlgo::findSeeds().

{ return energyUp_; }
const math::XYZVector& reco::PFRecHit::getAxisXYZ ( ) const [inline]

rechit cell axis x, y, z

Definition at line 141 of file PFRecHit.h.

References axisxyz_.

Referenced by PFClusterAlgo::calculateClusterPosition().

{ return axisxyz_; }    
const REPPointVector& reco::PFRecHit::getCornersREP ( ) const [inline]

rechit corners

Definition at line 148 of file PFRecHit.h.

References cornersrep_.

Referenced by LinkByRecHit::testTrackAndClusterByRecHit().

      { return cornersrep_; }    
const std::vector< math::XYZPoint >& reco::PFRecHit::getCornersXYZ ( ) const [inline]
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 248 of file PFRecHit.cc.

References i, and neighbours4_.

Referenced by PFClusterAlgo::calculateClusterPosition().

                                             {

  for(unsigned i=0; i<neighbours4_.size(); i++ )
    if( id == neighbours4_[i] ) return true;

  return false;           
}
bool PFRecHit::isNeighbour8 ( unsigned  id) const

is rechit 'id' a neighbour of this ? id is the rechit index ! not the detId

Definition at line 257 of file PFRecHit.cc.

References i, and neighbours8_.

Referenced by PFClusterAlgo::calculateClusterPosition().

                                             {
  
  for(unsigned i=0; i<neighbours8_.size(); i++ )
    if( id == neighbours8_[i] ) return true;

  return false;           
}
PFLayer::Layer reco::PFRecHit::layer ( ) const [inline]
const std::vector< unsigned >& reco::PFRecHit::neighbours4 ( ) const [inline]
const std::vector< unsigned >& reco::PFRecHit::neighbours8 ( ) const [inline]

Definition at line 154 of file PFRecHit.h.

References neighbours8_.

Referenced by PFClusterAlgo::buildTopoCluster(), and PFClusterAlgo::findSeeds().

      {return neighbours8_;}  
const std::vector< unsigned >& reco::PFRecHit::neighboursIds4 ( ) const [inline]

Definition at line 157 of file PFRecHit.h.

References neighboursIds4_.

Referenced by PFRootEventManager::setRecHitNeigbours().

      {return neighboursIds4_;}  
const std::vector< unsigned >& reco::PFRecHit::neighboursIds8 ( ) const [inline]

Definition at line 160 of file PFRecHit.h.

References neighboursIds8_.

Referenced by PFRootEventManager::setRecHitNeigbours().

      {return neighboursIds8_;}  
bool reco::PFRecHit::operator< ( const PFRecHit rhs) const [inline]

comparison < operator

Definition at line 190 of file PFRecHit.h.

References energy_.

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

comparison <= operator

Definition at line 187 of file PFRecHit.h.

References energy_.

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

comparison > operator

Definition at line 184 of file PFRecHit.h.

References energy_.

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

comparison >= operator

Definition at line 181 of file PFRecHit.h.

References energy_.

{ return (energy_>=rhs.energy_); }
const math::XYZPoint& reco::PFRecHit::position ( ) const [inline]
const PFRecHit::REPPoint & PFRecHit::positionREP ( ) const

rechit cell centre rho, eta, phi. call calculatePositionREP before !

Definition at line 121 of file PFRecHit.cc.

References posrep_.

Referenced by PFClusterAlgo::buildTopoCluster(), PFClusterAlgo::findSeeds(), and LinkByRecHit::testTrackAndClusterByRecHit().

                            {
  //   if( posrep_ == REPPoint() ) {
  //     posrep_.SetCoordinates( position_.Rho(), position_.Eta(), position_.Phi() );
  //   }
  return posrep_;
}
double reco::PFRecHit::pt2 ( ) const [inline]

rechit momentum transverse to the beam, squared.

Definition at line 117 of file PFRecHit.h.

References energy_, and position_.

Referenced by PFClusterAlgo::buildTopoCluster(), and PFClusterAlgo::findSeeds().

                       { return energy_ * energy_ *
                           ( position_.X()*position_.X() + 
                             position_.Y()*position_.Y() ) / 
                           ( position_.X()*position_.X() +
                             position_.Y()*position_.Y() + 
                             position_.Z()*position_.Z()) ; }
double reco::PFRecHit::rescale ( ) const [inline]

rescaling factor (obsolete)

Definition at line 108 of file PFRecHit.h.

References rescale_.

{ return rescale_; }
void PFRecHit::setCorner ( unsigned  i,
double  posx,
double  posy,
double  posz 
) [private]

set position of one of the corners

Definition at line 236 of file PFRecHit.cc.

References cornersrep_, cornersxyz_, reco::tau::disc::Eta(), i, nCorners_, and colinearityKinematic::Phi.

Referenced by setNECorner(), setNWCorner(), setSECorner(), and setSWCorner().

                                                                            {
  assert( cornersxyz_.size() == nCorners_);
  assert( cornersrep_.size() == nCorners_);
  assert( i<cornersxyz_.size() );

  cornersxyz_[i] = math::XYZPoint( posx, posy, posz);
  cornersrep_[i] = REPPoint(cornersxyz_[i].Rho(),
                            cornersxyz_[i].Eta(),
                            cornersxyz_[i].Phi() );
}
void reco::PFRecHit::setEnergyUp ( double  eUp) [inline]

Definition at line 73 of file PFRecHit.h.

References energyUp_.

{ energyUp_ = eUp; }
void PFRecHit::setNECorner ( double  posx,
double  posy,
double  posz 
)
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 216 of file PFRecHit.cc.

References setCorner().

Referenced by PFRecHitProducerECAL::createEcalRecHit(), PFRecHitProducerHCAL::createHcalRecHit(), and PFRecHitProducerHO::createHORecHit().

                                                                  {
  setCorner(0, posx, posy, posz);
}
void reco::PFRecHit::setRescale ( double  factor) [inline]

Definition at line 74 of file PFRecHit.h.

References rescale_.

Referenced by PFRecHitProducerPS::createRecHits().

{ rescale_ = factor; }
void PFRecHit::setSECorner ( double  posx,
double  posy,
double  posz 
)
void PFRecHit::setSWCorner ( double  posx,
double  posy,
double  posz 
)
void PFRecHit::size ( double &  deta,
double &  dphi 
) const

Definition at line 266 of file PFRecHit.cc.

References cornersrep_, eta(), and phi.

Referenced by DisplayManager::lookForMaxRecHit().

                                                    {

  double minphi=9999;
  double maxphi=-9999;
  double mineta=9999;
  double maxeta=-9999;
  for ( unsigned ic=0; ic<cornersrep_.size(); ++ic ) { 
    double eta = cornersrep_[ic].Eta();
    double phi = cornersrep_[ic].Phi();
    
    if(phi>maxphi) maxphi=phi;
    if(phi<minphi) minphi=phi;
    if(eta>maxeta) maxeta=eta;
    if(eta<mineta) mineta=eta;    
  }

  deta = maxeta - mineta;
  dphi = maxphi - minphi;
}
double reco::PFRecHit::time ( ) const [inline]

timing for cleaned hits

Definition at line 111 of file PFRecHit.h.

References rescale_.

Referenced by PFAlgo::checkCleaning().

{ return rescale_; }

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const reco::PFRecHit hit 
) [friend]

Member Data Documentation

rechit cell axisxyz

Definition at line 222 of file PFRecHit.h.

Referenced by getAxisXYZ().

Definition at line 226 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 225 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 198 of file PFRecHit.h.

Referenced by detId().

double reco::PFRecHit::energy_ [private]

rechit energy

Definition at line 204 of file PFRecHit.h.

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

double reco::PFRecHit::energyUp_ [private]

For HF hits : hit energy in the other layer (EM for HAD, and HAD for EM)

Definition at line 210 of file PFRecHit.h.

Referenced by energyUp(), and setEnergyUp().

rechit layer

Definition at line 201 of file PFRecHit.h.

Referenced by layer().

const unsigned PFRecHit::nCorners_ = 4 [static, private]

number of corners

Definition at line 244 of file PFRecHit.h.

Referenced by calculatePositionREP(), PFRecHit(), and setCorner().

std::vector< unsigned > reco::PFRecHit::neighbours4_ [private]

indices to existing neighbours (1 common side)

Definition at line 229 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 232 of file PFRecHit.h.

Referenced by add4Neighbour(), add8Neighbour(), clearNeighbours(), isNeighbour8(), and neighbours8().

std::vector< unsigned > reco::PFRecHit::neighboursIds4_ [private]

detids of existing neighbours (1 common side)

Definition at line 235 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 238 of file PFRecHit.h.

Referenced by neighboursIds8().

const unsigned PFRecHit::nNeighbours_ = 8 [static, private]

number of neighbours

Definition at line 241 of file PFRecHit.h.

is this a seed ? (-1:unknown, 0:no, 1 yes) (transient)

rechit cell centre: x, y, z

Definition at line 216 of file PFRecHit.h.

Referenced by calculatePositionREP(), PFRecHit(), position(), and pt2().

rechit cell centre: rho, eta, phi (transient)

Definition at line 219 of file PFRecHit.h.

Referenced by calculatePositionREP(), and positionREP().

double reco::PFRecHit::rescale_ [private]

Internal rescaling factor of the energy (1. = default, 0 = killed channels, x = rescaled)

Definition at line 207 of file PFRecHit.h.

Referenced by rescale(), setRescale(), and time().