CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes | Private Attributes | Friends
CaloParticle Class Reference

#include <CaloParticle.h>

Public Types

typedef int Charge
 electric charge type More...
 
typedef std::vector< SimTrack >::const_iterator g4t_iterator
 
typedef reco::GenParticleRefVector::iterator genp_iterator
 reference to reco::GenParticle More...
 
typedef math::XYZTLorentzVectorD LorentzVector
 Lorentz vector. More...
 
typedef math::XYZPointD Point
 point in the space More...
 
typedef math::PtEtaPhiMLorentzVector PolarLorentzVector
 Lorentz vector. More...
 
typedef SimClusterRefVector::iterator sc_iterator
 
typedef math::XYZVectorD Vector
 point in the space More...
 

Public Member Functions

void addG4Track (const SimTrack &t)
 
void addGenParticle (const reco::GenParticleRef &ref)
 
void addRecHitAndFraction (uint32_t hit, float fraction)
 add rechit with fraction More...
 
void addSimCluster (const SimClusterRef &ref)
 
void addSimHit (const PCaloHit &hit)
 add simhit's energy to cluster More...
 
math::XYZVectorF boostToCM () const
 Vector to boost to the particle centre of mass frame. More...
 
 CaloParticle ()
 
 CaloParticle (const SimTrack &simtrk)
 
 CaloParticle (EncodedEventId eventID, uint32_t particleID)
 
float charge () const
 Electric charge. Note this is taken from the first SimTrack only. More...
 
void clearSimClusters ()
 
float energy () const
 Energy. Note this is taken from the first SimTrack only. More...
 
float et () const
 Transverse energy. Note this is taken from the first SimTrack only. More...
 
float eta () const
 Momentum pseudorapidity. Note this is taken from the simtrack before the calorimeter. More...
 
EncodedEventId eventId () const
 Signal source, crossing number. More...
 
g4t_iterator g4Track_begin () const
 
g4t_iterator g4Track_end () const
 
const std::vector< SimTrack > & g4Tracks () const
 
genp_iterator genParticle_begin () const
 iterators More...
 
genp_iterator genParticle_end () const
 
const reco::GenParticleRefVectorgenParticles () const
 
std::vector< std::pair< uint32_t, float > > hits_and_fractions () const
 Returns list of rechit IDs and fractions for this CaloParticle. More...
 
bool longLived () const
 is long lived? More...
 
float mass () const
 Mass. Note this is taken from the first SimTrack only. More...
 
float massSqr () const
 Mass squared. Note this is taken from the first SimTrack only. More...
 
math::XYZVectorF momentum () const
 spatial momentum vector More...
 
float mt () const
 Transverse mass. Note this is taken from the first SimTrack only. More...
 
float mtSqr () const
 Transverse mass squared. Note this is taken from the first SimTrack only. More...
 
int numberOfRecHits () const
 Gives the total number of SimHits, in the cluster. More...
 
int numberOfSimHits () const
 Gives the total number of SimHits, in the cluster. More...
 
float p () const
 Magnitude of momentum vector. Note this is taken from the first SimTrack only. More...
 
const math::XYZTLorentzVectorFp4 () const
 Four-momentum Lorentz vector. Note this is taken from the first SimTrack only. More...
 
uint64_t particleId () const
 
int pdgId () const
 PDG ID. More...
 
float phi () const
 Momentum azimuthal angle. Note this is taken from the first SimTrack only. More...
 
float pt () const
 Transverse momentum. Note this is taken from the first SimTrack only. More...
 
float px () const
 x coordinate of momentum vector. Note this is taken from the first SimTrack only. More...
 
float py () const
 y coordinate of momentum vector. Note this is taken from the first SimTrack only. More...
 
float pz () const
 z coordinate of momentum vector. Note this is taken from the first SimTrack only. More...
 
float rapidity () const
 Rapidity. Note this is taken from the simtrack before the calorimeter. More...
 
sc_iterator simCluster_begin () const
 
sc_iterator simCluster_end () const
 
const SimClusterRefVectorsimClusters () const
 
float simEnergy () const
 returns the accumulated sim energy in the cluster More...
 
int status () const
 Status word. More...
 
float theta () const
 Momentum polar angle. Note this is taken from the first SimTrack only. More...
 
int threeCharge () const
 Gives charge in unit of quark charge (should be 3 times "charge()") More...
 
float y () const
 Same as rapidity(). More...
 
 ~CaloParticle ()
 

Static Public Attributes

static const unsigned int longLivedTag = 65536
 long lived flag More...
 

Private Attributes

EncodedEventId event_
 
std::vector< float > fractions_
 
std::vector< SimTrackg4Tracks_
 references to G4 and reco::GenParticle tracks More...
 
reco::GenParticleRefVector genParticles_
 
std::vector< uint32_t > hits_
 
uint64_t nsimhits_
 
uint32_t particleId_
 
SimClusterRefVector simClusters_
 
float simhit_energy_
 
math::XYZTLorentzVectorF theMomentum_
 

Friends

std::ostream & operator<< (std::ostream &s, CaloParticle const &tp)
 

Detailed Description

Definition at line 16 of file CaloParticle.h.

Member Typedef Documentation

typedef int CaloParticle::Charge

electric charge type

Definition at line 20 of file CaloParticle.h.

typedef std::vector<SimTrack>::const_iterator CaloParticle::g4t_iterator

Definition at line 28 of file CaloParticle.h.

reference to reco::GenParticle

Definition at line 27 of file CaloParticle.h.

Lorentz vector.

Definition at line 21 of file CaloParticle.h.

point in the space

Definition at line 23 of file CaloParticle.h.

Lorentz vector.

Definition at line 22 of file CaloParticle.h.

Definition at line 29 of file CaloParticle.h.

point in the space

Definition at line 24 of file CaloParticle.h.

Constructor & Destructor Documentation

CaloParticle::CaloParticle ( )

Definition at line 11 of file CaloParticle.cc.

12 {
13  // No operation
14 }
CaloParticle::CaloParticle ( const SimTrack simtrk)

Definition at line 16 of file CaloParticle.cc.

References addG4Track(), event_, CoreSimTrack::eventId(), CoreSimTrack::momentum(), particleId_, theMomentum_, and CoreSimTrack::trackId().

17 {
18  addG4Track( simtrk );
19  event_ = simtrk.eventId();
20  particleId_ = simtrk.trackId();
21  theMomentum_.SetPxPyPzE(simtrk.momentum().px(),
22  simtrk.momentum().py(),
23  simtrk.momentum().pz(),
24  simtrk.momentum().E());
25 }
EncodedEventId eventId() const
Definition: CoreSimTrack.h:31
void addG4Track(const SimTrack &t)
Definition: CaloParticle.h:63
EncodedEventId event_
Definition: CaloParticle.h:221
math::XYZTLorentzVectorF theMomentum_
Definition: CaloParticle.h:228
uint32_t particleId_
Definition: CaloParticle.h:223
unsigned int trackId() const
Definition: CoreSimTrack.h:34
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:22
CaloParticle::CaloParticle ( EncodedEventId  eventID,
uint32_t  particleID 
)

Definition at line 27 of file CaloParticle.cc.

References event_, EgammaObjectsElectrons_cfi::particleID, and particleId_.

28 {
29  event_ = eventID;
31 }
EncodedEventId event_
Definition: CaloParticle.h:221
uint32_t particleId_
Definition: CaloParticle.h:223
CaloParticle::~CaloParticle ( )

Definition at line 33 of file CaloParticle.cc.

34 {
35 }

Member Function Documentation

void CaloParticle::addG4Track ( const SimTrack t)
inline

Definition at line 63 of file CaloParticle.h.

References g4Tracks_.

Referenced by CaloParticle().

63 { g4Tracks_.push_back(t); }
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
Definition: CaloParticle.h:231
void CaloParticle::addGenParticle ( const reco::GenParticleRef ref)
inline

Definition at line 61 of file CaloParticle.h.

References genParticles_, and edm::RefVector< C, T, F >::push_back().

61 { genParticles_.push_back( ref ); }
reco::GenParticleRefVector genParticles_
Definition: CaloParticle.h:232
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:69
void CaloParticle::addRecHitAndFraction ( uint32_t  hit,
float  fraction 
)
inline

add rechit with fraction

Definition at line 199 of file CaloParticle.h.

References fractions_, and hits_.

199  {
200  hits_.emplace_back(hit);
201  fractions_.emplace_back(fraction);
202  }
std::vector< uint32_t > hits_
Definition: CaloParticle.h:225
std::vector< float > fractions_
Definition: CaloParticle.h:226
void CaloParticle::addSimCluster ( const SimClusterRef ref)
inline

Definition at line 62 of file CaloParticle.h.

References edm::RefVector< C, T, F >::push_back(), and simClusters_.

Referenced by CaloTruthAccumulator::finalizeEvent().

62 { simClusters_.push_back( ref ); }
SimClusterRefVector simClusters_
Definition: CaloParticle.h:234
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:69
void CaloParticle::addSimHit ( const PCaloHit hit)
inline

add simhit's energy to cluster

Definition at line 217 of file CaloParticle.h.

References PCaloHit::energy(), and simhit_energy_.

217 { simhit_energy_ += hit.energy(); }
double energy() const
Definition: PCaloHit.h:29
float simhit_energy_
Definition: CaloParticle.h:224
math::XYZVectorF CaloParticle::boostToCM ( ) const
inline

Vector to boost to the particle centre of mass frame.

Definition at line 96 of file CaloParticle.h.

References p4().

96  {
97  return p4().BoostToCM();
98  }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:86
float CaloParticle::charge ( void  ) const
inline

Electric charge. Note this is taken from the first SimTrack only.

Definition at line 81 of file CaloParticle.h.

References g4Tracks_.

Referenced by operator<<(), and threeCharge().

81 { return g4Tracks_[0].charge(); }
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
Definition: CaloParticle.h:231
void CaloParticle::clearSimClusters ( )
inline

Definition at line 78 of file CaloParticle.h.

References edm::RefVector< C, T, F >::clear(), and simClusters_.

78 { simClusters_.clear(); }
SimClusterRefVector simClusters_
Definition: CaloParticle.h:234
void clear()
Clear the vector.
Definition: RefVector.h:147
float CaloParticle::energy ( void  ) const
inline

Energy. Note this is taken from the first SimTrack only.

Definition at line 106 of file CaloParticle.h.

References p4().

Referenced by CaloParticleDebugger::analyze(), PreshowerClusterAlgo::makeOneCluster(), and Jet.Jet::rawEnergy().

106  {
107  return p4().E();
108  }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:86
float CaloParticle::et ( ) const
inline

Transverse energy. Note this is taken from the first SimTrack only.

Definition at line 111 of file CaloParticle.h.

References p4().

111  {
112  return p4().Et();
113  }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:86
float CaloParticle::eta ( void  ) const
inline

Momentum pseudorapidity. Note this is taken from the simtrack before the calorimeter.

Definition at line 166 of file CaloParticle.h.

References p4().

Referenced by Particle.Particle::__str__(), Jet.Jet::jetID(), and Jet.Jet::puJetId().

166  {
167  return p4().Eta();
168  }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:86
EncodedEventId CaloParticle::eventId ( ) const
inline

Signal source, crossing number.

Note this is taken from the first SimTrack only, but there shouldn't be any SimTracks from different crossings in the CaloParticle.

Definition at line 52 of file CaloParticle.h.

References event_.

Referenced by ntupleDataFormat.Event::eventIdStr(), and operator<<().

52  {
53  return event_;
54  }
EncodedEventId event_
Definition: CaloParticle.h:221
g4t_iterator CaloParticle::g4Track_begin ( ) const
inline

Definition at line 67 of file CaloParticle.h.

References g4Tracks_.

Referenced by operator<<().

67 { return g4Tracks_.begin(); }
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
Definition: CaloParticle.h:231
g4t_iterator CaloParticle::g4Track_end ( ) const
inline

Definition at line 68 of file CaloParticle.h.

References g4Tracks_.

Referenced by operator<<().

68 { return g4Tracks_.end(); }
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
Definition: CaloParticle.h:231
const std::vector<SimTrack>& CaloParticle::g4Tracks ( ) const
inline

Definition at line 76 of file CaloParticle.h.

References g4Tracks_.

Referenced by CaloParticleDebugger::analyze().

76 { return g4Tracks_; }
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
Definition: CaloParticle.h:231
genp_iterator CaloParticle::genParticle_begin ( ) const
inline

iterators

Definition at line 65 of file CaloParticle.h.

References edm::RefVector< C, T, F >::begin(), and genParticles_.

Referenced by operator<<().

65 { return genParticles_.begin(); }
reco::GenParticleRefVector genParticles_
Definition: CaloParticle.h:232
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:248
genp_iterator CaloParticle::genParticle_end ( ) const
inline

Definition at line 66 of file CaloParticle.h.

References edm::RefVector< C, T, F >::end(), and genParticles_.

Referenced by operator<<().

66 { return genParticles_.end(); }
reco::GenParticleRefVector genParticles_
Definition: CaloParticle.h:232
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:253
const reco::GenParticleRefVector& CaloParticle::genParticles ( ) const
inline

Definition at line 73 of file CaloParticle.h.

References genParticles_.

73 { return genParticles_; }
reco::GenParticleRefVector genParticles_
Definition: CaloParticle.h:232
std::vector<std::pair<uint32_t,float> > CaloParticle::hits_and_fractions ( ) const
inline

Returns list of rechit IDs and fractions for this CaloParticle.

Definition at line 205 of file CaloParticle.h.

References fractions_, hits_, mps_fire::i, and mps_fire::result.

205  {
206  std::vector<std::pair<uint32_t,float> > result;
207  for(size_t i = 0; i < hits_.size(); ++i) {
208  result.emplace_back(hits_[i],fractions_[i]);
209  }
210  return result;
211  }
std::vector< uint32_t > hits_
Definition: CaloParticle.h:225
std::vector< float > fractions_
Definition: CaloParticle.h:226
bool CaloParticle::longLived ( ) const
inline

is long lived?

Definition at line 190 of file CaloParticle.h.

References longLivedTag, and status().

190 { return status()&longLivedTag;}
int status() const
Status word.
Definition: CaloParticle.h:183
static const unsigned int longLivedTag
long lived flag
Definition: CaloParticle.h:187
float CaloParticle::mass ( ) const
inline

Mass. Note this is taken from the first SimTrack only.

Definition at line 116 of file CaloParticle.h.

References p4().

Referenced by Particle.Particle::__str__(), DiObject.DiMuon::__str__(), and massSqr().

116  {
117  return p4().M();
118  }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:86
float CaloParticle::massSqr ( ) const
inline

Mass squared. Note this is taken from the first SimTrack only.

Definition at line 121 of file CaloParticle.h.

References mass(), and funct::pow().

121  {
122  return pow( mass(), 2 );
123  }
float mass() const
Mass. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:116
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
math::XYZVectorF CaloParticle::momentum ( ) const
inline

spatial momentum vector

Definition at line 91 of file CaloParticle.h.

References p4().

Referenced by CaloParticleDebugger::analyze().

91  {
92  return p4().Vect();
93  }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:86
float CaloParticle::mt ( ) const
inline

Transverse mass. Note this is taken from the first SimTrack only.

Definition at line 126 of file CaloParticle.h.

References p4().

126  {
127  return p4().Mt();
128  }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:86
float CaloParticle::mtSqr ( ) const
inline

Transverse mass squared. Note this is taken from the first SimTrack only.

Definition at line 131 of file CaloParticle.h.

References p4().

131  {
132  return p4().Mt2();
133  }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:86
int CaloParticle::numberOfRecHits ( void  ) const
inline

Gives the total number of SimHits, in the cluster.

Definition at line 196 of file CaloParticle.h.

References hits_.

196 {return hits_.size();}
std::vector< uint32_t > hits_
Definition: CaloParticle.h:225
int CaloParticle::numberOfSimHits ( ) const
inline

Gives the total number of SimHits, in the cluster.

Definition at line 193 of file CaloParticle.h.

References nsimhits_.

193 {return nsimhits_;}
uint64_t nsimhits_
Definition: CaloParticle.h:220
float CaloParticle::p ( ) const
inline

Magnitude of momentum vector. Note this is taken from the first SimTrack only.

Definition at line 101 of file CaloParticle.h.

References p4().

Referenced by Electron.Electron::ptErr().

101  {
102  return p4().P();
103  }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:86
const math::XYZTLorentzVectorF& CaloParticle::p4 ( ) const
inline

Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.

Definition at line 86 of file CaloParticle.h.

References theMomentum_.

Referenced by boostToCM(), Tau.Tau::dxy_approx(), Tau.Tau::dz(), energy(), et(), eta(), mass(), momentum(), mt(), mtSqr(), operator<<(), p(), Lepton.Lepton::p4WithFSR(), phi(), pt(), px(), py(), pz(), rapidity(), and theta().

86  {
87  return theMomentum_;
88  }
math::XYZTLorentzVectorF theMomentum_
Definition: CaloParticle.h:228
uint64_t CaloParticle::particleId ( ) const
inline

Definition at line 56 of file CaloParticle.h.

References particleId_.

56  {
57  return particleId_;
58  }
uint32_t particleId_
Definition: CaloParticle.h:223
int CaloParticle::pdgId ( ) const
inline

PDG ID.

Returns the PDG ID of the first associated gen particle. If there are no gen particles associated then it returns type() from the first SimTrack.

Definition at line 43 of file CaloParticle.h.

References edm::RefVector< C, T, F >::begin(), edm::RefVector< C, T, F >::empty(), g4Tracks_, and genParticles_.

Referenced by Particle.Particle::__str__(), CaloParticleDebugger::analyze(), and operator<<().

43  {
44  if( genParticles_.empty() ) return g4Tracks_[0].type();
45  else return (*genParticles_.begin())->pdgId();
46  }
type
Definition: HCALResponse.h:21
reco::GenParticleRefVector genParticles_
Definition: CaloParticle.h:232
bool empty() const
Is the RefVector empty.
Definition: RefVector.h:104
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:248
int pdgId() const
PDG ID.
Definition: CaloParticle.h:43
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
Definition: CaloParticle.h:231
float CaloParticle::phi ( void  ) const
inline

Momentum azimuthal angle. Note this is taken from the first SimTrack only.

Definition at line 156 of file CaloParticle.h.

References p4().

Referenced by Particle.Particle::__str__(), and ntupleDataFormat.Track::phiPull().

156  {
157  return p4().Phi();
158  }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:86
float CaloParticle::pt ( ) const
inline

Transverse momentum. Note this is taken from the first SimTrack only.

Definition at line 151 of file CaloParticle.h.

References p4().

Referenced by Particle.Particle::__str__(), DiObject.DiMuon::__str__(), Photon.Photon::calScaledIsoValueExp(), Photon.Photon::calScaledIsoValueLin(), Photon.Photon::calScaledIsoValueQuadr(), Electron.Electron::mvaIDLoose(), Electron.Electron::mvaIDRun2(), Electron.Electron::mvaIDTight(), Electron.Electron::ptErr(), ntupleDataFormat.Track::ptPull(), Lepton.Lepton::relIso(), Lepton.Lepton::relIsoFromEA(), Lepton.Lepton::relIsoR(), and Jet.Jet::setCorrP4().

151  {
152  return p4().Pt();
153  }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:86
float CaloParticle::px ( ) const
inline

x coordinate of momentum vector. Note this is taken from the first SimTrack only.

Definition at line 136 of file CaloParticle.h.

References p4().

136  {
137  return p4().Px();
138  }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:86
float CaloParticle::py ( ) const
inline

y coordinate of momentum vector. Note this is taken from the first SimTrack only.

Definition at line 141 of file CaloParticle.h.

References p4().

141  {
142  return p4().Py();
143  }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:86
float CaloParticle::pz ( ) const
inline

z coordinate of momentum vector. Note this is taken from the first SimTrack only.

Definition at line 146 of file CaloParticle.h.

References p4().

146  {
147  return p4().Pz();
148  }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:86
float CaloParticle::rapidity ( ) const
inline

Rapidity. Note this is taken from the simtrack before the calorimeter.

Definition at line 171 of file CaloParticle.h.

References p4().

Referenced by y().

171  {
172  return p4().Rapidity();
173  }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:86
sc_iterator CaloParticle::simCluster_begin ( ) const
inline

Definition at line 69 of file CaloParticle.h.

References edm::RefVector< C, T, F >::begin(), and simClusters_.

69 { return simClusters_.begin(); }
SimClusterRefVector simClusters_
Definition: CaloParticle.h:234
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:248
sc_iterator CaloParticle::simCluster_end ( ) const
inline

Definition at line 70 of file CaloParticle.h.

References edm::RefVector< C, T, F >::end(), and simClusters_.

70 { return simClusters_.end(); }
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:253
SimClusterRefVector simClusters_
Definition: CaloParticle.h:234
const SimClusterRefVector& CaloParticle::simClusters ( ) const
inline

Definition at line 74 of file CaloParticle.h.

References simClusters_.

Referenced by CaloParticleDebugger::analyze().

74 { return simClusters_; }
SimClusterRefVector simClusters_
Definition: CaloParticle.h:234
float CaloParticle::simEnergy ( ) const
inline

returns the accumulated sim energy in the cluster

Definition at line 214 of file CaloParticle.h.

References simhit_energy_.

214 { return simhit_energy_; }
float simhit_energy_
Definition: CaloParticle.h:224
int CaloParticle::status ( void  ) const
inline

Status word.

Returns status() from the first gen particle, or -99 if there are no gen particles attached.

Definition at line 183 of file CaloParticle.h.

References edm::RefVector< C, T, F >::empty(), and genParticles_.

Referenced by longLived().

183  {
184  return genParticles_.empty() ? -99 : (*genParticles_[0]).status();
185  }
reco::GenParticleRefVector genParticles_
Definition: CaloParticle.h:232
int status() const
Status word.
Definition: CaloParticle.h:183
bool empty() const
Is the RefVector empty.
Definition: RefVector.h:104
float CaloParticle::theta ( void  ) const
inline

Momentum polar angle. Note this is taken from the first SimTrack only.

Definition at line 161 of file CaloParticle.h.

References p4().

Referenced by Tau.Tau::zImpact().

161  {
162  return p4().Theta();
163  }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:86
int CaloParticle::threeCharge ( ) const
inline

Gives charge in unit of quark charge (should be 3 times "charge()")

Definition at line 83 of file CaloParticle.h.

References charge(), and f.

83 { return lrintf(3.f*charge()); }
float charge() const
Electric charge. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:81
double f[11][100]
float CaloParticle::y ( ) const
inline

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
CaloParticle const &  tp 
)
friend

Definition at line 37 of file CaloParticle.cc.

38 {
39  s << "Calo Particle:" << std::endl;
40  s << "CP momentum, q, ID, & Event #: "
41  << tp.p4() << " " << tp.charge() << " " << tp.pdgId() << " "
42  << tp.eventId().bunchCrossing() << "." << tp.eventId().event() << std::endl;
43 
44  for (CaloParticle::genp_iterator hepT = tp.genParticle_begin(); hepT != tp.genParticle_end(); ++hepT)
45  {
46  s << " HepMC Track Momentum " << (*hepT)->momentum().rho() << std::endl;
47  }
48 
49  for (CaloParticle::g4t_iterator g4T = tp.g4Track_begin(); g4T != tp.g4Track_end(); ++g4T)
50  {
51  s << " Geant Track Momentum " << g4T->momentum() << std::endl;
52  s << " Geant Track ID & type " << g4T->trackId() << " " << g4T->type() << std::endl;
53  if (g4T->type() != tp.pdgId())
54  {
55  s << " Mismatch b/t CaloParticle and Geant types" << std::endl;
56  }
57  }
58  s << "SimClusters in this CaloParticle: " << std::endl;
59  for( auto itr = tp.simClusters_.begin(); itr != tp.simClusters_.end(); ++itr ) {
60  s << **itr;
61  }
62  s << std::endl;
63  return s;
64 }
std::vector< SimTrack >::const_iterator g4t_iterator
Definition: CaloParticle.h:28

Member Data Documentation

EncodedEventId CaloParticle::event_
private

Definition at line 221 of file CaloParticle.h.

Referenced by CaloParticle(), and eventId().

std::vector<float> CaloParticle::fractions_
private

Definition at line 226 of file CaloParticle.h.

Referenced by addRecHitAndFraction(), and hits_and_fractions().

std::vector<SimTrack> CaloParticle::g4Tracks_
private

references to G4 and reco::GenParticle tracks

Definition at line 231 of file CaloParticle.h.

Referenced by addG4Track(), charge(), g4Track_begin(), g4Track_end(), g4Tracks(), and pdgId().

reco::GenParticleRefVector CaloParticle::genParticles_
private
std::vector<uint32_t> CaloParticle::hits_
private

Definition at line 225 of file CaloParticle.h.

Referenced by addRecHitAndFraction(), hits_and_fractions(), and numberOfRecHits().

const unsigned int CaloParticle::longLivedTag = 65536
static

long lived flag

Definition at line 187 of file CaloParticle.h.

Referenced by longLived().

uint64_t CaloParticle::nsimhits_
private

Definition at line 220 of file CaloParticle.h.

Referenced by numberOfSimHits().

uint32_t CaloParticle::particleId_
private

Definition at line 223 of file CaloParticle.h.

Referenced by CaloParticle(), and particleId().

SimClusterRefVector CaloParticle::simClusters_
private
float CaloParticle::simhit_energy_
private

Definition at line 224 of file CaloParticle.h.

Referenced by addSimHit(), and simEnergy().

math::XYZTLorentzVectorF CaloParticle::theMomentum_
private

Definition at line 228 of file CaloParticle.h.

Referenced by CaloParticle(), and p4().