CMS 3D CMS Logo

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

#include <CaloParticle.h>

Inheritance diagram for CaloParticle:
MtdCaloParticle

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...
 

Protected 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_ {0}
 
uint32_t particleId_ {0}
 
SimClusterRefVector simClusters_
 
float simhit_energy_ {0.f}
 
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

◆ Charge

typedef int CaloParticle::Charge

electric charge type

Definition at line 20 of file CaloParticle.h.

◆ g4t_iterator

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

Definition at line 28 of file CaloParticle.h.

◆ genp_iterator

reference to reco::GenParticle

Definition at line 27 of file CaloParticle.h.

◆ LorentzVector

Lorentz vector.

Definition at line 21 of file CaloParticle.h.

◆ Point

point in the space

Definition at line 23 of file CaloParticle.h.

◆ PolarLorentzVector

Lorentz vector.

Definition at line 22 of file CaloParticle.h.

◆ sc_iterator

Definition at line 29 of file CaloParticle.h.

◆ Vector

point in the space

Definition at line 24 of file CaloParticle.h.

Constructor & Destructor Documentation

◆ CaloParticle() [1/3]

CaloParticle::CaloParticle ( )

Definition at line 11 of file CaloParticle.cc.

11  {
12  // No operation
13 }

◆ CaloParticle() [2/3]

CaloParticle::CaloParticle ( const SimTrack simtrk)

Definition at line 15 of file CaloParticle.cc.

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

15  {
16  addG4Track(simtrk);
17  event_ = simtrk.eventId();
18  particleId_ = simtrk.trackId();
19  theMomentum_.SetPxPyPzE(
20  simtrk.momentum().px(), simtrk.momentum().py(), simtrk.momentum().pz(), simtrk.momentum().E());
21 }
void addG4Track(const SimTrack &t)
Definition: CaloParticle.h:61
EncodedEventId event_
Definition: CaloParticle.h:194
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:19
math::XYZTLorentzVectorF theMomentum_
Definition: CaloParticle.h:201
EncodedEventId eventId() const
Definition: CoreSimTrack.h:28
uint32_t particleId_
Definition: CaloParticle.h:196
unsigned int trackId() const
Definition: CoreSimTrack.h:31

◆ CaloParticle() [3/3]

CaloParticle::CaloParticle ( EncodedEventId  eventID,
uint32_t  particleID 
)

Definition at line 23 of file CaloParticle.cc.

References event_, EgammaObjectsElectrons_cfi::particleID, and particleId_.

23  {
24  event_ = eventID;
26 }
EncodedEventId event_
Definition: CaloParticle.h:194
uint32_t particleId_
Definition: CaloParticle.h:196

◆ ~CaloParticle()

CaloParticle::~CaloParticle ( )

Definition at line 28 of file CaloParticle.cc.

28 {}

Member Function Documentation

◆ addG4Track()

void CaloParticle::addG4Track ( const SimTrack t)
inline

Definition at line 61 of file CaloParticle.h.

References g4Tracks_, and submitPVValidationJobs::t.

Referenced by CaloParticle(), and MtdCaloParticle::MtdCaloParticle().

61 { g4Tracks_.push_back(t); }
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
Definition: CaloParticle.h:204

◆ addGenParticle()

void CaloParticle::addGenParticle ( const reco::GenParticleRef ref)
inline

Definition at line 59 of file CaloParticle.h.

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

59 { genParticles_.push_back(ref); }
reco::GenParticleRefVector genParticles_
Definition: CaloParticle.h:205
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67

◆ addRecHitAndFraction()

void CaloParticle::addRecHitAndFraction ( uint32_t  hit,
float  fraction 
)
inline

add rechit with fraction

Definition at line 169 of file CaloParticle.h.

References HLT_2024v13_cff::fraction, fractions_, and hits_.

169  {
170  hits_.emplace_back(hit);
171  fractions_.emplace_back(fraction);
172  }
std::vector< uint32_t > hits_
Definition: CaloParticle.h:198
std::vector< float > fractions_
Definition: CaloParticle.h:199

◆ addSimCluster()

void CaloParticle::addSimCluster ( const SimClusterRef ref)
inline

Definition at line 60 of file CaloParticle.h.

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

60 { simClusters_.push_back(ref); }
SimClusterRefVector simClusters_
Definition: CaloParticle.h:207
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67

◆ addSimHit()

void CaloParticle::addSimHit ( const PCaloHit hit)
inline

add simhit's energy to cluster

Definition at line 187 of file CaloParticle.h.

References nsimhits_, and simhit_energy_.

187  {
188  simhit_energy_ += hit.energy();
189  ++nsimhits_;
190  }
uint64_t nsimhits_
Definition: CaloParticle.h:193
float simhit_energy_
Definition: CaloParticle.h:197

◆ boostToCM()

math::XYZVectorF CaloParticle::boostToCM ( ) const
inline

Vector to boost to the particle centre of mass frame.

Definition at line 91 of file CaloParticle.h.

References p4().

91 { return p4().BoostToCM(); }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:85

◆ charge()

float CaloParticle::charge ( void  ) const
inline

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

Definition at line 79 of file CaloParticle.h.

References g4Tracks_.

Referenced by threeCharge().

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

◆ clearSimClusters()

void CaloParticle::clearSimClusters ( )
inline

Definition at line 76 of file CaloParticle.h.

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

76 { simClusters_.clear(); }
SimClusterRefVector simClusters_
Definition: CaloParticle.h:207
void clear()
Clear the vector.
Definition: RefVector.h:142

◆ energy()

float CaloParticle::energy ( void  ) const
inline

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

Definition at line 98 of file CaloParticle.h.

References p4().

Referenced by HGVHistoProducerAlgo::fill_caloparticle_histos(), and Jet.Jet::rawEnergy().

98 { return p4().E(); }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:85

◆ et()

float CaloParticle::et ( ) const
inline

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

Definition at line 101 of file CaloParticle.h.

References p4().

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

◆ eta()

float CaloParticle::eta ( void  ) const
inline

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

Definition at line 142 of file CaloParticle.h.

References p4().

Referenced by Particle.Particle::__str__(), datamodel.Object::DeltaR(), HGVHistoProducerAlgo::fill_caloparticle_histos(), Jet.Jet::jetID(), datamodel.Object::p4(), and Jet.Jet::puJetId().

142 { return p4().Eta(); }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:85

◆ eventId()

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 54 of file CaloParticle.h.

References event_.

Referenced by ntupleDataFormat.Event::eventIdStr().

54 { return event_; }
EncodedEventId event_
Definition: CaloParticle.h:194

◆ g4Track_begin()

g4t_iterator CaloParticle::g4Track_begin ( ) const
inline

Definition at line 65 of file CaloParticle.h.

References g4Tracks_.

65 { return g4Tracks_.begin(); }
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
Definition: CaloParticle.h:204

◆ g4Track_end()

g4t_iterator CaloParticle::g4Track_end ( ) const
inline

Definition at line 66 of file CaloParticle.h.

References g4Tracks_.

66 { return g4Tracks_.end(); }
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
Definition: CaloParticle.h:204

◆ g4Tracks()

const std::vector<SimTrack>& CaloParticle::g4Tracks ( ) const
inline

Definition at line 74 of file CaloParticle.h.

References g4Tracks_.

Referenced by HGVHistoProducerAlgo::fill_caloparticle_histos().

74 { return g4Tracks_; }
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
Definition: CaloParticle.h:204

◆ genParticle_begin()

genp_iterator CaloParticle::genParticle_begin ( ) const
inline

iterators

Definition at line 63 of file CaloParticle.h.

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

63 { return genParticles_.begin(); }
reco::GenParticleRefVector genParticles_
Definition: CaloParticle.h:205
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:223

◆ genParticle_end()

genp_iterator CaloParticle::genParticle_end ( ) const
inline

Definition at line 64 of file CaloParticle.h.

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

64 { return genParticles_.end(); }
reco::GenParticleRefVector genParticles_
Definition: CaloParticle.h:205
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:228

◆ genParticles()

const reco::GenParticleRefVector& CaloParticle::genParticles ( ) const
inline

Definition at line 71 of file CaloParticle.h.

References genParticles_.

71 { return genParticles_; }
reco::GenParticleRefVector genParticles_
Definition: CaloParticle.h:205

◆ hits_and_fractions()

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 175 of file CaloParticle.h.

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

175  {
176  std::vector<std::pair<uint32_t, float>> result;
177  for (size_t i = 0; i < hits_.size(); ++i) {
178  result.emplace_back(hits_[i], fractions_[i]);
179  }
180  return result;
181  }
std::vector< uint32_t > hits_
Definition: CaloParticle.h:198
std::vector< float > fractions_
Definition: CaloParticle.h:199

◆ longLived()

bool CaloParticle::longLived ( ) const
inline

is long lived?

Definition at line 160 of file CaloParticle.h.

References longLivedTag, and status().

160 { return status() & longLivedTag; }
int status() const
Status word.
Definition: CaloParticle.h:155
static const unsigned int longLivedTag
long lived flag
Definition: CaloParticle.h:157

◆ mass()

float CaloParticle::mass ( ) const
inline

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

Definition at line 104 of file CaloParticle.h.

References p4().

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

104 { return p4().M(); }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:85

◆ massSqr()

float CaloParticle::massSqr ( ) const
inline

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

Definition at line 107 of file CaloParticle.h.

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

107 { return pow(mass(), 2); }
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
float mass() const
Mass. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:104

◆ momentum()

math::XYZVectorF CaloParticle::momentum ( ) const
inline

spatial momentum vector

Definition at line 88 of file CaloParticle.h.

References p4().

88 { return p4().Vect(); }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:85

◆ mt()

float CaloParticle::mt ( ) const
inline

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

Definition at line 110 of file CaloParticle.h.

References p4().

110 { return p4().Mt(); }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:85

◆ mtSqr()

float CaloParticle::mtSqr ( ) const
inline

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

Definition at line 114 of file CaloParticle.h.

References p4().

114 { return p4().Mt2(); }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:85

◆ numberOfRecHits()

int CaloParticle::numberOfRecHits ( void  ) const
inline

Gives the total number of SimHits, in the cluster.

Definition at line 166 of file CaloParticle.h.

References hits_.

166 { return hits_.size(); }
std::vector< uint32_t > hits_
Definition: CaloParticle.h:198

◆ numberOfSimHits()

int CaloParticle::numberOfSimHits ( ) const
inline

Gives the total number of SimHits, in the cluster.

Definition at line 163 of file CaloParticle.h.

References nsimhits_.

163 { return nsimhits_; }
uint64_t nsimhits_
Definition: CaloParticle.h:193

◆ p()

float CaloParticle::p ( ) const
inline

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

Definition at line 95 of file CaloParticle.h.

References p4().

Referenced by Electron.Electron::ptErr().

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

◆ p4()

const math::XYZTLorentzVectorF& CaloParticle::p4 ( void  ) const
inline

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

Definition at line 85 of file CaloParticle.h.

References theMomentum_.

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

85 { return theMomentum_; }
math::XYZTLorentzVectorF theMomentum_
Definition: CaloParticle.h:201

◆ particleId()

uint64_t CaloParticle::particleId ( ) const
inline

Definition at line 56 of file CaloParticle.h.

References particleId_.

56 { return particleId_; }
uint32_t particleId_
Definition: CaloParticle.h:196

◆ pdgId()

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__().

43  {
44  if (genParticles_.empty())
45  return g4Tracks_[0].type();
46  else
47  return (*genParticles_.begin())->pdgId();
48  }
bool empty() const
Is the RefVector empty.
Definition: RefVector.h:99
reco::GenParticleRefVector genParticles_
Definition: CaloParticle.h:205
int pdgId() const
PDG ID.
Definition: CaloParticle.h:43
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
Definition: CaloParticle.h:204
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:223

◆ phi()

float CaloParticle::phi ( void  ) const
inline

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

Definition at line 134 of file CaloParticle.h.

References p4().

Referenced by Particle.Particle::__str__(), datamodel.Object::DeltaR(), HGVHistoProducerAlgo::fill_caloparticle_histos(), datamodel.Object::p4(), and ntupleDataFormat.Track::phiPull().

134 { return p4().Phi(); }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:85

◆ pt()

float CaloParticle::pt ( ) const
inline

◆ px()

float CaloParticle::px ( ) const
inline

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

Definition at line 118 of file CaloParticle.h.

References p4().

118 { return p4().Px(); }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:85

◆ py()

float CaloParticle::py ( ) const
inline

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

Definition at line 122 of file CaloParticle.h.

References p4().

122 { return p4().Py(); }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:85

◆ pz()

float CaloParticle::pz ( ) const
inline

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

Definition at line 126 of file CaloParticle.h.

References p4().

126 { return p4().Pz(); }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:85

◆ rapidity()

float CaloParticle::rapidity ( ) const
inline

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

Definition at line 146 of file CaloParticle.h.

References p4().

Referenced by y().

146 { return p4().Rapidity(); }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:85

◆ simCluster_begin()

sc_iterator CaloParticle::simCluster_begin ( ) const
inline

Definition at line 67 of file CaloParticle.h.

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

67 { return simClusters_.begin(); }
SimClusterRefVector simClusters_
Definition: CaloParticle.h:207
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:223

◆ simCluster_end()

sc_iterator CaloParticle::simCluster_end ( ) const
inline

Definition at line 68 of file CaloParticle.h.

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

68 { return simClusters_.end(); }
SimClusterRefVector simClusters_
Definition: CaloParticle.h:207
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:228

◆ simClusters()

const SimClusterRefVector& CaloParticle::simClusters ( ) const
inline

◆ simEnergy()

float CaloParticle::simEnergy ( ) const
inline

returns the accumulated sim energy in the cluster

Definition at line 184 of file CaloParticle.h.

References simhit_energy_.

184 { return simhit_energy_; }
float simhit_energy_
Definition: CaloParticle.h:197

◆ status()

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 155 of file CaloParticle.h.

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

Referenced by longLived(), and status().

155 { return genParticles_.empty() ? -99 : (*genParticles_[0]).status(); }
bool empty() const
Is the RefVector empty.
Definition: RefVector.h:99
int status() const
Status word.
Definition: CaloParticle.h:155
reco::GenParticleRefVector genParticles_
Definition: CaloParticle.h:205

◆ theta()

float CaloParticle::theta ( void  ) const
inline

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

Definition at line 138 of file CaloParticle.h.

References p4().

Referenced by Tau.Tau::zImpact().

138 { return p4().Theta(); }
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:85

◆ threeCharge()

int CaloParticle::threeCharge ( ) const
inline

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

Definition at line 81 of file CaloParticle.h.

References charge(), and f.

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

◆ y()

float CaloParticle::y ( ) const
inline

Same as rapidity().

Definition at line 149 of file CaloParticle.h.

References rapidity().

Referenced by svgfig.Ellipse::__repr__(), geometryXMLparser.Alignable::pos(), ntupleDataFormat._HitObject::r(), and ntupleDataFormat._HitObject::r3D().

149 { return rapidity(); }
float rapidity() const
Rapidity. Note this is taken from the simtrack before the calorimeter.
Definition: CaloParticle.h:146

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 30 of file CaloParticle.cc.

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

Member Data Documentation

◆ event_

EncodedEventId CaloParticle::event_
protected

Definition at line 194 of file CaloParticle.h.

Referenced by CaloParticle(), eventId(), and MtdCaloParticle::MtdCaloParticle().

◆ fractions_

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

Definition at line 199 of file CaloParticle.h.

Referenced by addRecHitAndFraction(), and hits_and_fractions().

◆ g4Tracks_

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

references to G4 and reco::GenParticle tracks

Definition at line 204 of file CaloParticle.h.

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

◆ genParticles_

reco::GenParticleRefVector CaloParticle::genParticles_
protected

◆ hits_

std::vector<uint32_t> CaloParticle::hits_
protected

Definition at line 198 of file CaloParticle.h.

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

◆ longLivedTag

const unsigned int CaloParticle::longLivedTag = 65536
static

long lived flag

Definition at line 157 of file CaloParticle.h.

Referenced by longLived().

◆ nsimhits_

uint64_t CaloParticle::nsimhits_ {0}
protected

Definition at line 193 of file CaloParticle.h.

Referenced by MtdCaloParticle::addSimHit(), addSimHit(), and numberOfSimHits().

◆ particleId_

uint32_t CaloParticle::particleId_ {0}
protected

Definition at line 196 of file CaloParticle.h.

Referenced by CaloParticle(), MtdCaloParticle::MtdCaloParticle(), and particleId().

◆ simClusters_

SimClusterRefVector CaloParticle::simClusters_
protected

◆ simhit_energy_

float CaloParticle::simhit_energy_ {0.f}
protected

Definition at line 197 of file CaloParticle.h.

Referenced by MtdCaloParticle::addSimHit(), addSimHit(), and simEnergy().

◆ theMomentum_

math::XYZTLorentzVectorF CaloParticle::theMomentum_
protected

Definition at line 201 of file CaloParticle.h.

Referenced by CaloParticle(), MtdCaloParticle::MtdCaloParticle(), and p4().