CMS 3D CMS Logo

MtdSimTrackster.cc
Go to the documentation of this file.
2 
4 
6  // No operation
7 }
8 
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 }
18 
20  event_ = eventID;
22 }
23 
25  const std::vector<uint32_t> SCs,
26  const float time,
27  const GlobalPoint pos) {
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 }
40 
42 
43 std::ostream &operator<<(std::ostream &s, MtdSimTrackster const &tp) {
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 }
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< SimTrack >::const_iterator g4t_iterator
Definition: SimCluster.h:41
std::ostream & operator<<(std::ostream &s, MtdSimTrackster const &tp)
Monte Carlo truth information used for tracking validation.
Definition: SimCluster.h:29
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