3 #include "vdt/vdtMath.h"
4 #include "Math/GenVector/etaMax.h"
9 template<
typename Scalar>
11 using namespace ROOT::Math;
13 const Scalar big_z_scaled =
17 if (std::fabs(z_scaled) < big_z_scaled) {
18 return vdt::fast_log(z_scaled+
std::sqrt(z_scaled*z_scaled+1.0));
21 return z>0 ? vdt::fast_log(2.0*z_scaled + 0.5/z_scaled) : -vdt::fast_log(-2.0*z_scaled);
29 return z + etaMax<Scalar>();
32 return z - etaMax<Scalar>();
37 const double z = pos.z();
39 eta = Eta_FromRhoZ_fast<double>(rho,
z);
40 phi = (pos.x()==0 && pos.y()==0) ? 0 : vdt::fast_atan2(pos.y(), pos.x());
48 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
49 std::atomic<int> PFCluster::depthCorMode_{0};
50 std::atomic<double> PFCluster::depthCorA_{0.89};
51 std::atomic<double> PFCluster::depthCorB_{7.3};
52 std::atomic<double> PFCluster::depthCorAp_{0.89};
53 std::atomic<double> PFCluster::depthCorBp_{4.0};
55 int PFCluster::depthCorMode_ = 0;
56 double PFCluster::depthCorA_ = 0.89;
57 double PFCluster::depthCorB_ = 7.3;
58 double PFCluster::depthCorAp_ = 0.89;
59 double PFCluster::depthCorBp_ = 4.0;
66 double x,
double y,
double z ) :
71 posrep_( position_.Rho(), position_.
Eta(), position_.
Phi() ),
117 return isHadron ? corrA : corrA*(corrB +
log(energy));
138 CaloCluster::operator=(other);
156 const std::vector< reco::PFRecHitFraction >& fracs =
160 <<
", layer: "<<cluster.
layer()
161 <<
"\tE = "<<cluster.
energy()
163 <<pos.X()<<
","<<pos.Y()<<
","<<pos.Z()<<
" | "
165 <<posrep.Rho()<<
","<<posrep.Eta()<<
","<<posrep.Phi()<<
" | "
166 <<fracs.size()<<
" rechits";
168 for(
unsigned i=0;
i<fracs.size();
i++) {
170 if( !fracs[
i].recHitRef().isAvailable() )
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
void setLayer(PFLayer::Layer layer)
set layer
const math::XYZPoint & position() const
cluster centroid position
math::XYZPoint position_
cluster centroid position
static const char layer_[]
CaloID caloID_
bitmask for detector information
void addHitAndFraction(DetId id, float fraction)
double energy_
cluster energy
static std::atomic< double > depthCorAp_
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
std::vector< reco::PFRecHitFraction > rechits_
vector of rechit fractions (transient)
PFLayer::Layer layer_
transient layer
Fraction of a PFRecHit (rechits can be shared between several PFCluster's)
PFCluster & operator=(const PFCluster &)
std::vector< std::pair< DetId, float > > hitsAndFractions_
static std::atomic< double > depthCorB_
std::ostream & operator<<(std::ostream &, BeamSpot beam)
const CaloID & caloID() const
const REPPoint & positionREP() const
cluster position: rho, eta, phi
layer definition for PFRecHit and PFCluster
double time_
Michalis :Add timing and depth information.
void reset()
resets clusters parameters
double energy() const
cluster energy
void resetHitsAndFractions()
reset only hits and fractions
std::string printHitAndFraction(unsigned i) const
print hitAndFraction
static reco::CaloID toCaloID(Layer layer)
static double getDepthCorrection(double energy, bool isBelowPS=false, bool isHadron=false)
REPPoint posrep_
cluster position: rho, eta, phi (transient)
XYZPointD XYZPoint
point in space with cartesian internal representation
Geom::Phi< T > phi() const
void addRecHitFraction(const reco::PFRecHitFraction &frac)
add a given fraction of the rechit
static std::atomic< double > depthCorBp_
int color_
color (transient)
static std::atomic< double > depthCorA_
static Layer fromCaloID(const reco::CaloID &id)
ROOT::Math::PositionVector3D< ROOT::Math::CylindricalEta3D< double > > REPPoint
const std::vector< reco::PFRecHitFraction > & recHitFractions() const
vector of rechit fractions
const PFRecHitRef & recHitRef() const
void reset()
resets the CaloCluster (position, energy, hitsAndFractions)
Power< A, B >::type pow(const A &a, const B &b)