CMS 3D CMS Logo

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

#include <MtdSimTrackster.h>

Inheritance diagram for MtdSimTrackster:
MtdSimCluster SimCluster

Public Member Functions

void addCluster (const uint32_t sc)
 add simhit's energy to cluster More...
 
std::vector< uint32_t > clusters () const
 returns the layer clusters indexes in the sim trackster More...
 
 MtdSimTrackster ()
 
 MtdSimTrackster (const SimCluster &sc)
 
 MtdSimTrackster (EncodedEventId eventID, uint32_t particleID)
 
 MtdSimTrackster (const SimCluster &sc, const std::vector< uint32_t > SCs, const float time, const GlobalPoint pos)
 
int numberOfClusters () const
 Gives the total number of SimHits, in the cluster. More...
 
GlobalPoint position () const
 returns the position of the cluster More...
 
float time () const
 returns the time of the cluster More...
 
 ~MtdSimTrackster ()
 
- Public Member Functions inherited from MtdSimCluster
void addHitAndFraction (uint64_t hit, float fraction)
 add hit with fraction More...
 
void addHitPosition (LocalPoint pos)
 add hit position More...
 
void addHitTime (float time)
 add hit time More...
 
void addSimHit (const PSimHit &hit)
 add simhit's energy to cluster More...
 
void clear ()
 
void clearHitsAndFractions ()
 clear the hits and fractions list More...
 
void clearHitsPosition ()
 clear the positions list More...
 
void clearHitsTime ()
 clear the times list More...
 
std::vector< std::pair< uint32_t, std::pair< uint8_t, uint8_t > > > detIds_and_rows () const
 Returns list of detIds, rows and columns for this SimCluster. More...
 
std::vector< std::pair< uint64_t, float > > hits_and_energies () const
 Returns list of hit IDs and energies for this SimCluster. More...
 
std::vector< std::pair< uint64_t, float > > hits_and_fractions () const
 Returns list of hit IDs and fractions for this SimCluster. More...
 
std::vector< std::pair< uint64_t, LocalPoint > > hits_and_positions () const
 Returns list of hit IDs and times for this SimCluster. More...
 
std::vector< std::pair< uint64_t, float > > hits_and_times () const
 Returns list of hit IDs and times for this SimCluster. More...
 
 MtdSimCluster ()
 
 MtdSimCluster (const SimTrack &simtrk)
 
 MtdSimCluster (EncodedEventId eventID, uint32_t particleID)
 
void setTrackIdOffset (unsigned int offset)
 
unsigned int trackIdOffset () const
 
 ~MtdSimCluster ()
 
- Public Member Functions inherited from SimCluster
void addG4Track (const SimTrack &t)
 
void addGenParticle (const reco::GenParticleRef &ref)
 
void addHitEnergy (float energy)
 add rechit energy More...
 
void addRecHitAndFraction (uint32_t hit, float fraction)
 add rechit with fraction More...
 
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...
 
float charge () const
 Electric charge. Note this is taken from the first SimTrack only. More...
 
void clearHitsAndFractions ()
 clear the hits and fractions list More...
 
void clearHitsEnergy ()
 clear the energies list More...
 
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_energies () const
 Returns list of rechit IDs and energies for this SimCluster. More...
 
std::vector< std::pair< uint32_t, float > > hits_and_fractions () const
 Returns list of rechit IDs and fractions for this SimCluster. 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...
 
 SimCluster ()
 
 SimCluster (const SimTrack &simtrk)
 
 SimCluster (EncodedEventId eventID, uint32_t particleID)
 
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...
 
 ~SimCluster ()
 

Private Attributes

std::vector< uint32_t > clusters_
 
GlobalPoint posAtEntrance_
 
float timeAtEntrance_ {0.f}
 

Friends

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

Additional Inherited Members

- Public Types inherited from SimCluster
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 math::XYZVectorD Vector
 point in the space More...
 
- Static Public Attributes inherited from SimCluster
static const unsigned int longLivedTag = 65536
 long lived flag More...
 
- Protected Attributes inherited from MtdSimCluster
unsigned int idOffset_ {0}
 
std::vector< uint64_t > mtdHits_
 
std::vector< LocalPointpositions_
 
std::vector< float > times_
 
- Protected Attributes inherited from SimCluster
std::vector< float > energies_
 
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}
 
float simhit_energy_ {0.f}
 
math::XYZTLorentzVectorF theMomentum_
 

Detailed Description

Definition at line 11 of file MtdSimTrackster.h.

Constructor & Destructor Documentation

◆ MtdSimTrackster() [1/4]

MtdSimTrackster::MtdSimTrackster ( )

Definition at line 5 of file MtdSimTrackster.cc.

5  {
6  // No operation
7 }

◆ MtdSimTrackster() [2/4]

MtdSimTrackster::MtdSimTrackster ( const SimCluster sc)

Definition at line 9 of file MtdSimTrackster.cc.

References SimCluster::addG4Track(), SimCluster::event_, SimCluster::g4Tracks(), SimCluster::particleId_, and SimCluster::theMomentum_.

9  {
10  auto simtrk = sc.g4Tracks()[0];
11  addG4Track(simtrk);
12  event_ = simtrk.eventId();
13  particleId_ = simtrk.trackId();
14 
15  theMomentum_.SetPxPyPzE(
16  simtrk.momentum().px(), simtrk.momentum().py(), simtrk.momentum().pz(), simtrk.momentum().E());
17 }
void addG4Track(const SimTrack &t)
Definition: SimCluster.h:72
EncodedEventId event_
Definition: SimCluster.h:223
uint32_t particleId_
Definition: SimCluster.h:225
const std::vector< SimTrack > & g4Tracks() const
Definition: SimCluster.h:82
math::XYZTLorentzVectorF theMomentum_
Definition: SimCluster.h:231

◆ MtdSimTrackster() [3/4]

MtdSimTrackster::MtdSimTrackster ( EncodedEventId  eventID,
uint32_t  particleID 
)

Definition at line 19 of file MtdSimTrackster.cc.

References SimCluster::event_, EgammaObjectsElectrons_cfi::particleID, and SimCluster::particleId_.

19  {
20  event_ = eventID;
22 }
EncodedEventId event_
Definition: SimCluster.h:223
uint32_t particleId_
Definition: SimCluster.h:225

◆ MtdSimTrackster() [4/4]

MtdSimTrackster::MtdSimTrackster ( const SimCluster sc,
const std::vector< uint32_t >  SCs,
const float  time,
const GlobalPoint  pos 
)

Definition at line 24 of file MtdSimTrackster.cc.

References SimCluster::addG4Track(), clusters_, SimCluster::event_, SimCluster::g4Tracks(), SimCluster::particleId_, posAtEntrance_, SimCluster::theMomentum_, time(), and timeAtEntrance_.

27  {
28  auto simtrk = sc.g4Tracks()[0];
29  addG4Track(simtrk);
30  event_ = simtrk.eventId();
31  particleId_ = simtrk.trackId();
32 
33  theMomentum_.SetPxPyPzE(
34  simtrk.momentum().px(), simtrk.momentum().py(), simtrk.momentum().pz(), simtrk.momentum().E());
35 
36  clusters_ = SCs;
39 }
void addG4Track(const SimTrack &t)
Definition: SimCluster.h:72
float time() const
returns the time of the cluster
EncodedEventId event_
Definition: SimCluster.h:223
std::vector< uint32_t > clusters_
GlobalPoint posAtEntrance_
uint32_t particleId_
Definition: SimCluster.h:225
const std::vector< SimTrack > & g4Tracks() const
Definition: SimCluster.h:82
math::XYZTLorentzVectorF theMomentum_
Definition: SimCluster.h:231

◆ ~MtdSimTrackster()

MtdSimTrackster::~MtdSimTrackster ( )

Definition at line 41 of file MtdSimTrackster.cc.

41 {}

Member Function Documentation

◆ addCluster()

void MtdSimTrackster::addCluster ( const uint32_t  sc)
inline

add simhit's energy to cluster

Definition at line 34 of file MtdSimTrackster.h.

References clusters_.

34 { clusters_.push_back(sc); }
std::vector< uint32_t > clusters_

◆ clusters()

std::vector<uint32_t> MtdSimTrackster::clusters ( ) const
inline

returns the layer clusters indexes in the sim trackster

Definition at line 31 of file MtdSimTrackster.h.

References clusters_.

31 { return clusters_; }
std::vector< uint32_t > clusters_

◆ numberOfClusters()

int MtdSimTrackster::numberOfClusters ( ) const
inline

Gives the total number of SimHits, in the cluster.

Definition at line 37 of file MtdSimTrackster.h.

References clusters_.

37 { return clusters_.size(); }
std::vector< uint32_t > clusters_

◆ position()

GlobalPoint MtdSimTrackster::position ( ) const
inline

returns the position of the cluster

Definition at line 25 of file MtdSimTrackster.h.

References posAtEntrance_.

25 { return posAtEntrance_; }
GlobalPoint posAtEntrance_

◆ time()

float MtdSimTrackster::time ( ) const
inline

returns the time of the cluster

Definition at line 28 of file MtdSimTrackster.h.

References timeAtEntrance_.

Referenced by MtdSimTrackster().

28 { return timeAtEntrance_; }

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 43 of file MtdSimTrackster.cc.

43  {
44  s << "CP momentum, q, ID, & Event #: " << tp.p4() << " " << tp.charge() << " " << tp.pdgId() << " "
45  << tp.eventId().bunchCrossing() << "." << tp.eventId().event() << std::endl;
46 
47  for (MtdSimTrackster::genp_iterator hepT = tp.genParticle_begin(); hepT != tp.genParticle_end(); ++hepT) {
48  s << " HepMC Track Momentum " << (*hepT)->momentum().rho() << std::endl;
49  }
50 
51  for (MtdSimTrackster::g4t_iterator g4T = tp.g4Track_begin(); g4T != tp.g4Track_end(); ++g4T) {
52  s << " Geant Track Momentum " << g4T->momentum() << std::endl;
53  s << " Geant Track ID & type " << g4T->trackId() << " " << g4T->type() << std::endl;
54  if (g4T->type() != tp.pdgId()) {
55  s << " Mismatch b/t MtdSimTrackster and Geant types" << std::endl;
56  }
57  }
58  s << " # of clusters = " << tp.clusters_.size() << std::endl;
59  return s;
60 }
std::vector< SimTrack >::const_iterator g4t_iterator
Definition: SimCluster.h:41

Member Data Documentation

◆ clusters_

std::vector<uint32_t> MtdSimTrackster::clusters_
private

Definition at line 43 of file MtdSimTrackster.h.

Referenced by addCluster(), clusters(), MtdSimTrackster(), and numberOfClusters().

◆ posAtEntrance_

GlobalPoint MtdSimTrackster::posAtEntrance_
private

Definition at line 41 of file MtdSimTrackster.h.

Referenced by MtdSimTrackster(), and position().

◆ timeAtEntrance_

float MtdSimTrackster::timeAtEntrance_ {0.f}
private

Definition at line 40 of file MtdSimTrackster.h.

Referenced by MtdSimTrackster(), and time().