CMS 3D CMS Logo

MtdCaloParticle.cc
Go to the documentation of this file.
2 
4 
6 
8 
10  // No operation
11 }
12 
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 }
20 
22  event_ = eventID;
24 }
25 
27 
28 std::ostream &operator<<(std::ostream &s, MtdCaloParticle const &tp) {
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 }
void addG4Track(const SimTrack &t)
Definition: CaloParticle.h:61
EncodedEventId event_
Definition: CaloParticle.h:194
std::vector< SimTrack >::const_iterator g4t_iterator
Definition: CaloParticle.h:28
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
std::ostream & operator<<(std::ostream &s, MtdCaloParticle const &tp)
unsigned int trackId() const
Definition: CoreSimTrack.h:31