5 #include "vdt/vdtMath.h"
6 #include "Math/GenVector/etaMax.h"
13 template<
typename Scalar>
15 using namespace ROOT::Math;
17 const Scalar big_z_scaled =
21 if (std::fabs(z_scaled) < big_z_scaled) {
22 return vdt::fast_log(z_scaled+
std::sqrt(z_scaled*z_scaled+1.0));
25 return z>0 ? vdt::fast_log(2.0*z_scaled + 0.5/z_scaled) : -vdt::fast_log(-2.0*z_scaled);
33 return z + etaMax<Scalar>();
36 return z - etaMax<Scalar>();
40 inline void calculateREP(
const math::XYZPoint& pos,
double& rho,
double&
eta,
double& phi) {
41 const double z = pos.z();
43 eta = Eta_FromRhoZ_fast<double>(rho,z);
44 phi = (pos.x()==0 && pos.y()==0) ? 0 : vdt::fast_atan2(pos.y(), pos.x());
71 const vector< math::XYZPoint >& cornersxyz) :
79 cornersxyz_(cornersxyz)
87 double posx,
double posy,
double posz,
88 double axisx,
double axisy,
double axisz) :
95 position_(posx, posy, posz),
96 axisxyz_(axisx, axisy, axisz) {
133 double rho(0),
eta(0), phi(0);
137 calculateREP(corner, rho, eta, phi);
145 double rho(0),
eta(0), phi(0);
154 calculateREP(corner,rho,eta,phi);
174 unsigned short bitmask=0;
178 bitmask = bitmask | 1 ;
179 bitmask = bitmask | (absx << 1);
181 bitmask = bitmask | (1<<4) ;
182 bitmask = bitmask | (absy << 5);
184 bitmask = bitmask | (1<<8) ;
185 bitmask = bitmask | (absz << 9);
200 unsigned short absx =
abs(x);
201 unsigned short absy =
abs(y);
202 unsigned short absz =
abs(z);
204 unsigned short bitmask=0;
207 bitmask = bitmask | 1 ;
208 bitmask = bitmask | (absx << 1);
210 bitmask = bitmask | (1<<4) ;
211 bitmask = bitmask | (absy << 5);
213 bitmask = bitmask | (1<<8) ;
214 bitmask = bitmask | (absz << 9);
230 for (
unsigned ic=0; ic<
cornersxyz_.size(); ++ic ) {
234 if(phi>maxphi) maxphi=phi;
235 if(phi<minphi) minphi=phi;
236 if(eta>maxeta) maxeta=
eta;
237 if(eta<mineta) mineta=
eta;
240 deta = maxeta - mineta;
241 dphi = maxphi - minphi;
254 out<<
"hit id:"<<hit.
detId()
258 <<
" rep:"<<posxyz.Rho()<<
","<<posxyz.Eta()<<
","<<posxyz.Phi()<<
"| N:";
void setSECorner(double posx, double posy, double posz)
static const char layer_[]
std::vector< math::XYZPoint > cornersxyz_
rechit cell corners
void setNECorner(double posx, double posy, double posz)
PFRecHitRefVector neighbours4_
unsigned detId() const
rechit detId
void addNeighbour(short x, short y, short z, const PFRecHitRef &)
std::vector< unsigned short > neighbourInfos_
PFLayer::Layer layer() const
rechit layer
void setSWCorner(double posx, double posy, double posz)
const PFRecHitRef getNeighbour(short x, short y, short z)
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Abs< T >::type abs(const T &t)
layer definition for PFRecHit and PFCluster
void size(double &deta, double &dphi) const
edm::Ref< PFRecHitCollection > PFRecHitRef
persistent reference to PFRecHit objects
void setNWCorner(double posx, double posy, double posz)
const math::XYZPoint & position() const
rechit cell centre x, y, z
void calculatePositionREP()
ROOT::Math::PositionVector3D< ROOT::Math::CylindricalEta3D< double > > REPPoint
PFRecHitRefVector neighbours8_
math::XYZPoint position_
rechit cell centre: x, y, z
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
PFRecHitRefVector neighbours_
indices to existing neighbours (1 common side)
std::vector< REPPoint > cornersrep_
rechit cell corners rho/eta/phi
double energy() const
rechit energy
static int position[264][3]
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
REPPoint positionrep_
rechit cell centre: rho, eta, phi (transient)
static const unsigned nCorners_
number of corners
double time() const
timing for cleaned hits
Power< A, B >::type pow(const A &a, const B &b)
void setCorner(unsigned i, double posx, double posy, double posz)
set position of one of the corners
PFRecHit()
default constructor. Sets energy and position to zero