CMS 3D CMS Logo

PFCluster.cc
Go to the documentation of this file.
2 
3 #include "Math/GenVector/etaMax.h"
4 
5 using namespace std;
6 using namespace reco;
7 
8 const math::XYZPoint PFCluster::dummyVtx_(0, 0, 0);
9 
10 PFCluster::PFCluster(PFLayer::Layer layer, double energy, double x, double y, double z)
12  posrep_(position_.Rho(), position_.Eta(), position_.Phi()),
13  time_(-99.),
14  depth_(0.),
15  layer_(layer) {}
16 
18  energy_ = 0;
19  position_ *= 0;
20  posrep_ *= 0;
21  time_ = -99.;
23  rechits_.clear();
24 
26 }
27 
29  rechits_.clear();
30  hitsAndFractions_.clear();
31 }
32 
34  rechits_.push_back(frac);
35 
36  addHitAndFraction(frac.recHitRef()->detId(), frac.fraction());
37 }
38 
39 double PFCluster::getDepthCorrection(double energy, bool isBelowPS, bool isHadron) {
40  double corrA = depthCorA_;
41  double corrB = depthCorB_;
42  if (isBelowPS) {
43  corrA = depthCorAp_;
44  corrB = depthCorBp_;
45  }
46  return isHadron ? corrA : corrA * (corrB + log(energy));
47 }
48 
50  // cout<<"calling PFCluster::setLayer "<<layer<<endl;
51  layer_ = layer;
53  // cout<<"done "<<caloID_<<endl;
54 }
55 
57  // cout<<"calling PFCluster::layer "<<caloID()<<" "<<PFLayer::fromCaloID( caloID() )<<endl;
58  if (layer_ != PFLayer::NONE)
59  return layer_;
60  return PFLayer::fromCaloID(caloID());
61 }
62 
64  CaloCluster::operator=(other);
65  rechits_ = other.rechits_;
66  energy_ = other.energy_;
67  position_ = other.position_;
68  posrep_ = other.posrep_;
69 
70  return *this;
71 }
72 
73 std::ostream& reco::operator<<(std::ostream& out, const PFCluster& cluster) {
74  if (!out)
75  return out;
76 
77  const math::XYZPoint& pos = cluster.position();
78  const PFCluster::REPPoint& posrep = cluster.positionREP();
79  const std::vector<reco::PFRecHitFraction>& fracs = cluster.recHitFractions();
80 
81  out << "PFcluster "
82  << ", layer: " << cluster.layer() << "\tE = " << cluster.energy() << "\tXYZ: " << pos.X() << "," << pos.Y() << ","
83  << pos.Z() << " | "
84  << "\tREP: " << posrep.Rho() << "," << posrep.Eta() << "," << posrep.Phi() << " | " << fracs.size() << " rechits";
85 
86  for (unsigned i = 0; i < fracs.size(); i++) {
87  // PFRecHit is not available, print the detID
88  if (!fracs[i].recHitRef().isAvailable())
89  out << cluster.printHitAndFraction(i) << ", ";
90  else
91  out << fracs[i] << ", ";
92  }
93 
94  return out;
95 }
mps_fire.i
i
Definition: mps_fire.py:428
reco::PFRecHitFraction
Fraction of a PFRecHit (rechits can be shared between several PFCluster's)
Definition: PFRecHitFraction.h:18
reco::PFCluster::layer
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
Definition: PFCluster.cc:56
PFLayer::toCaloID
static reco::CaloID toCaloID(Layer layer)
Definition: PFLayer.cc:11
pos
Definition: PixelAliasList.h:18
reco::PFCluster::setLayer
void setLayer(PFLayer::Layer layer)
set layer
Definition: PFCluster.cc:49
reco::PFCluster::recHitFractions
const std::vector< reco::PFRecHitFraction > & recHitFractions() const
vector of rechit fractions
Definition: PFCluster.h:65
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::CaloCluster::hitsAndFractions_
std::vector< std::pair< DetId, float > > hitsAndFractions_
Definition: CaloCluster.h:234
reco::PFCluster::layer_
PFLayer::Layer layer_
transient layer
Definition: PFCluster.h:153
reco::CaloCluster::position_
math::XYZPoint position_
cluster centroid position
Definition: CaloCluster.h:228
reco::PFCluster::energy
double energy() const
cluster energy
Definition: PFCluster.h:74
reco::CaloCluster::caloID_
CaloID caloID_
bitmask for detector information
Definition: CaloCluster.h:231
DivergingColor.frac
float frac
Definition: DivergingColor.py:175
reco::PFCluster::depthCorAp_
static const constexpr double depthCorAp_
Definition: PFCluster.h:158
reco::PFCluster::operator=
PFCluster & operator=(const PFCluster &)
Definition: PFCluster.cc:63
reco::CaloCluster
Definition: CaloCluster.h:31
PFCluster.h
reco::CaloCluster::reset
void reset()
resets the CaloCluster (position, energy, hitsAndFractions)
Definition: CaloCluster.cc:9
trackingPlots.other
other
Definition: trackingPlots.py:1460
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
reco::PFCluster::resetHitsAndFractions
void resetHitsAndFractions()
reset only hits and fractions
Definition: PFCluster.cc:28
VtxSmearedParameters_cfi.Phi
Phi
Definition: VtxSmearedParameters_cfi.py:112
PFLayer::NONE
Definition: PFLayer.h:34
pfLinker_cff.particleFlow
particleFlow
Definition: pfLinker_cff.py:5
reco::PFCluster::positionREP
const REPPoint & positionREP() const
cluster position: rho, eta, phi
Definition: PFCluster.h:92
reco::PFCluster::rechits_
std::vector< reco::PFRecHitFraction > rechits_
vector of rechit fractions (transient)
Definition: PFCluster.h:143
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
PFLayer::Layer
Layer
layer definition
Definition: PFLayer.h:29
reco::PFCluster::depthCorB_
static const constexpr double depthCorB_
Definition: PFCluster.h:157
reco::PFCluster::depthCorA_
static const constexpr double depthCorA_
depth corrections
Definition: PFCluster.h:156
reco::PFCluster::reset
void reset()
resets clusters parameters
Definition: PFCluster.cc:17
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
reco::CaloCluster::printHitAndFraction
std::string printHitAndFraction(unsigned i) const
print hitAndFraction
Definition: CaloCluster.cc:15
reco::CaloCluster::addHitAndFraction
void addHitAndFraction(DetId id, float fraction)
Definition: CaloCluster.h:203
reco::PFCluster::getDepthCorrection
static double getDepthCorrection(double energy, bool isBelowPS=false, bool isHadron=false)
Definition: PFCluster.cc:39
reco::operator<<
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:66
PFLayer
layer definition for PFRecHit and PFCluster
Definition: PFLayer.h:20
reco::PFCluster::depthCorBp_
static const constexpr double depthCorBp_
Definition: PFCluster.h:159
reco::CaloCluster::position
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:154
reco::PFCluster::addRecHitFraction
void addRecHitFraction(const reco::PFRecHitFraction &frac)
add a given fraction of the rechit
Definition: PFCluster.cc:33
std
Definition: JetResolutionObject.h:76
reco::PFCluster::time_
float time_
Michalis: add timing and depth information.
Definition: PFCluster.h:149
math
Definition: choleskyInversion.h:19
reco::CaloCluster::energy_
double energy_
cluster energy
Definition: CaloCluster.h:223
reco::PFCluster
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
reco::CaloCluster::caloID
const CaloID & caloID() const
Definition: CaloCluster.h:201
reco::PFCluster::posrep_
REPPoint posrep_
cluster position: rho, eta, phi (transient)
Definition: PFCluster.h:146
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
reco::PFCluster::REPPoint
ROOT::Math::PositionVector3D< ROOT::Math::CylindricalEta3D< double > > REPPoint
Definition: PFCluster.h:48
sistrip::layer_
static const char layer_[]
Definition: ConstantsForGranularity.h:30
PFLayer::fromCaloID
static Layer fromCaloID(const reco::CaloID &id)
Definition: PFLayer.cc:38