CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloParticle.cc
Go to the documentation of this file.
2 
4 
6 
8 
9 const unsigned int CaloParticle::longLivedTag = 65536;
10 
12 {
13  // No operation
14 }
15 
17 {
18  addG4Track( simtrk );
19  event_ = simtrk.eventId();
20  particleId_ = simtrk.trackId();
21  theMomentum_.SetPxPyPzE(simtrk.momentum().px(),
22  simtrk.momentum().py(),
23  simtrk.momentum().pz(),
24  simtrk.momentum().E());
25 }
26 
27 CaloParticle::CaloParticle( EncodedEventId eventID, uint32_t particleID )
28 {
29  event_ = eventID;
30  particleId_ = particleID;
31 }
32 
34 {
35 }
36 
37 std::ostream& operator<< (std::ostream& s, CaloParticle const & tp)
38 {
39  s << "Calo Particle:" << std::endl;
40  s << "CP momentum, q, ID, & Event #: "
41  << tp.p4() << " " << tp.charge() << " " << tp.pdgId() << " "
42  << tp.eventId().bunchCrossing() << "." << tp.eventId().event() << std::endl;
43 
44  for (CaloParticle::genp_iterator hepT = tp.genParticle_begin(); hepT != tp.genParticle_end(); ++hepT)
45  {
46  s << " HepMC Track Momentum " << (*hepT)->momentum().rho() << std::endl;
47  }
48 
49  for (CaloParticle::g4t_iterator g4T = tp.g4Track_begin(); g4T != tp.g4Track_end(); ++g4T)
50  {
51  s << " Geant Track Momentum " << g4T->momentum() << std::endl;
52  s << " Geant Track ID & type " << g4T->trackId() << " " << g4T->type() << std::endl;
53  if (g4T->type() != tp.pdgId())
54  {
55  s << " Mismatch b/t CaloParticle and Geant types" << std::endl;
56  }
57  }
58  s << "SimClusters in this CaloParticle: " << std::endl;
59  for( auto itr = tp.simClusters_.begin(); itr != tp.simClusters_.end(); ++itr ) {
60  s << **itr;
61  }
62  s << std::endl;
63  return s;
64 }
EncodedEventId eventId() const
Definition: CoreSimTrack.h:31
int event() const
get the contents of the subdetector field (should be protected?)
void addG4Track(const SimTrack &t)
Definition: CaloParticle.h:63
EncodedEventId eventId() const
Signal source, crossing number.
Definition: CaloParticle.h:52
float charge() const
Electric charge. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:79
EncodedEventId event_
Definition: CaloParticle.h:219
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:253
SimClusterRefVector simClusters_
Definition: CaloParticle.h:232
std::vector< SimTrack >::const_iterator g4t_iterator
Definition: CaloParticle.h:28
genp_iterator genParticle_begin() const
iterators
Definition: CaloParticle.h:65
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:248
math::XYZTLorentzVectorF theMomentum_
Definition: CaloParticle.h:226
const math::XYZTLorentzVectorF & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:84
static const unsigned int longLivedTag
long lived flag
Definition: CaloParticle.h:185
uint32_t particleId_
Definition: CaloParticle.h:221
int bunchCrossing() const
get the detector field from this detid
unsigned int trackId() const
Definition: CoreSimTrack.h:34
int pdgId() const
PDG ID.
Definition: CaloParticle.h:43
g4t_iterator g4Track_end() const
Definition: CaloParticle.h:68
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:22
g4t_iterator g4Track_begin() const
Definition: CaloParticle.h:67
genp_iterator genParticle_end() const
Definition: CaloParticle.h:66