CMS 3D CMS Logo

MtdSimLayerCluster.cc
Go to the documentation of this file.
2 
4 
5 #include <numeric>
6 
8  // No operation
9 }
10 
12  addG4Track(simtrk);
13  event_ = simtrk.eventId();
14  particleId_ = simtrk.trackId();
15 
16  theMomentum_.SetPxPyPzE(
17  simtrk.momentum().px(), simtrk.momentum().py(), simtrk.momentum().pz(), simtrk.momentum().E());
18 }
19 
21  event_ = eventID;
23 }
24 
26 
27 std::ostream &operator<<(std::ostream &s, MtdSimLayerCluster const &tp) {
28  s << "CP momentum, q, ID, & Event #: " << tp.p4() << " " << tp.charge() << " " << tp.pdgId() << " "
29  << tp.eventId().bunchCrossing() << "." << tp.eventId().event() << std::endl;
30  s << " Offset " << tp.trackIdOffset() << " "
31  << " LC time " << tp.simLCTime() << " LC energy " << tp.simLCEnergy() << std::endl;
32 
33  for (MtdSimLayerCluster::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 (MtdSimLayerCluster::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 MtdSimLayerCluster and Geant types" << std::endl;
42  }
43  }
44  s << " # of cells = " << tp.mtdHits_.size()
45  << ", effective cells = " << std::accumulate(tp.fractions_.begin(), tp.fractions_.end(), 0.f) << std::endl;
46  return s;
47 }
void addG4Track(const SimTrack &t)
Definition: SimCluster.h:76
EncodedEventId event_
Definition: SimCluster.h:251
std::vector< SimTrack >::const_iterator g4t_iterator
Definition: SimCluster.h:45
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:19
EncodedEventId eventId() const
Definition: CoreSimTrack.h:28
unsigned int trackId() const
Definition: CoreSimTrack.h:31
uint32_t particleId_
Definition: SimCluster.h:253
std::ostream & operator<<(std::ostream &s, MtdSimLayerCluster const &tp)
math::XYZTLorentzVectorF theMomentum_
Definition: SimCluster.h:259