CMS 3D CMS Logo

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

#include <MtdCaloParticle.h>

Inheritance diagram for MtdCaloParticle:
CaloParticle

Public Types

typedef MtdSimClusterRefVector::iterator mtdsc_iterator
 
- Public Types inherited from CaloParticle
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 addSimCluster (const MtdSimClusterRef &ref)
 
void addSimHit (PSimHit &hit)
 add simhit's energy to cluster More...
 
void addSimTime (const float time)
 
void clearSimClusters ()
 
 MtdCaloParticle ()
 
 MtdCaloParticle (const SimTrack &simtrk)
 
 MtdCaloParticle (EncodedEventId eventID, uint32_t particleID)
 
mtdsc_iterator simCluster_begin () const
 iterators More...
 
mtdsc_iterator simCluster_end () const
 
const MtdSimClusterRefVectorsimClusters () const
 
float simTime () const
 returns the time of the caloparticle More...
 
 ~MtdCaloParticle ()
 
- Public Member Functions inherited from CaloParticle
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 ()
 

Private Attributes

MtdSimClusterRefVector mtdsimClusters_
 
float simhit_time_ {-99.f}
 

Friends

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

Additional Inherited Members

- Static Public Attributes inherited from CaloParticle
static const unsigned int longLivedTag = 65536
 long lived flag More...
 
- Protected Attributes inherited from CaloParticle
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_
 

Detailed Description

Definition at line 13 of file MtdCaloParticle.h.

Member Typedef Documentation

◆ mtdsc_iterator

Definition at line 17 of file MtdCaloParticle.h.

Constructor & Destructor Documentation

◆ MtdCaloParticle() [1/3]

MtdCaloParticle::MtdCaloParticle ( )

Definition at line 9 of file MtdCaloParticle.cc.

9  {
10  // No operation
11 }

◆ MtdCaloParticle() [2/3]

MtdCaloParticle::MtdCaloParticle ( const SimTrack simtrk)

Definition at line 13 of file MtdCaloParticle.cc.

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

13  {
14  addG4Track(simtrk);
15  event_ = simtrk.eventId();
16  particleId_ = simtrk.trackId();
17  theMomentum_.SetPxPyPzE(
18  simtrk.momentum().px(), simtrk.momentum().py(), simtrk.momentum().pz(), simtrk.momentum().E());
19 }
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

◆ MtdCaloParticle() [3/3]

MtdCaloParticle::MtdCaloParticle ( EncodedEventId  eventID,
uint32_t  particleID 
)

◆ ~MtdCaloParticle()

MtdCaloParticle::~MtdCaloParticle ( )

Definition at line 26 of file MtdCaloParticle.cc.

26 {}

Member Function Documentation

◆ addSimCluster()

void MtdCaloParticle::addSimCluster ( const MtdSimClusterRef ref)
inline

Definition at line 27 of file MtdCaloParticle.h.

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

27 { mtdsimClusters_.push_back(ref); }
MtdSimClusterRefVector mtdsimClusters_
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67

◆ addSimHit()

void MtdCaloParticle::addSimHit ( PSimHit hit)
inline

add simhit's energy to cluster

Definition at line 42 of file MtdCaloParticle.h.

References CaloParticle::nsimhits_, and CaloParticle::simhit_energy_.

42  {
43  simhit_energy_ += hit.energyLoss();
44  ++nsimhits_;
45  }
uint64_t nsimhits_
Definition: CaloParticle.h:193
float simhit_energy_
Definition: CaloParticle.h:197

◆ addSimTime()

void MtdCaloParticle::addSimTime ( const float  time)
inline

◆ clearSimClusters()

void MtdCaloParticle::clearSimClusters ( )
inline

Definition at line 34 of file MtdCaloParticle.h.

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

MtdSimClusterRefVector mtdsimClusters_
void clear()
Clear the vector.
Definition: RefVector.h:142

◆ simCluster_begin()

mtdsc_iterator MtdCaloParticle::simCluster_begin ( ) const
inline

iterators

Definition at line 30 of file MtdCaloParticle.h.

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

30 { return mtdsimClusters_.begin(); }
MtdSimClusterRefVector mtdsimClusters_
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:223

◆ simCluster_end()

mtdsc_iterator MtdCaloParticle::simCluster_end ( ) const
inline

Definition at line 31 of file MtdCaloParticle.h.

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

31 { return mtdsimClusters_.end(); }
MtdSimClusterRefVector mtdsimClusters_
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:228

◆ simClusters()

const MtdSimClusterRefVector& MtdCaloParticle::simClusters ( ) const
inline

Definition at line 33 of file MtdCaloParticle.h.

References mtdsimClusters_.

33 { return mtdsimClusters_; }
MtdSimClusterRefVector mtdsimClusters_

◆ simTime()

float MtdCaloParticle::simTime ( ) const
inline

returns the time of the caloparticle

Definition at line 37 of file MtdCaloParticle.h.

References simhit_time_.

37 { return simhit_time_; }

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 28 of file MtdCaloParticle.cc.

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

Member Data Documentation

◆ mtdsimClusters_

MtdSimClusterRefVector MtdCaloParticle::mtdsimClusters_
private

◆ simhit_time_

float MtdCaloParticle::simhit_time_ {-99.f}
private

Definition at line 48 of file MtdCaloParticle.h.

Referenced by addSimTime(), and simTime().