src
SimDataFormats
CaloAnalysis
src
MtdCaloParticle.cc
Go to the documentation of this file.
1
#include "
SimDataFormats/CaloAnalysis/interface/MtdCaloParticle.h
"
2
3
#include "
DataFormats/HepMCCandidate/interface/GenParticle.h
"
4
5
#include <
FWCore/MessageLogger/interface/MessageLogger.h
>
6
7
#include "
SimDataFormats/CaloAnalysis/interface/SimCluster.h
"
8
9
MtdCaloParticle::MtdCaloParticle
() {
10
// No operation
11
}
12
13
MtdCaloParticle::MtdCaloParticle
(
const
SimTrack
&simtrk) {
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
21
MtdCaloParticle::MtdCaloParticle
(
EncodedEventId
eventID, uint32_t
particleID
) {
22
event_
= eventID;
23
particleId_
=
particleID
;
24
}
25
26
MtdCaloParticle::~MtdCaloParticle
() {}
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
}
SimCluster.h
MessageLogger.h
GenParticle.h
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
CaloParticle::addG4Track
void addG4Track(const SimTrack &t)
Definition:
CaloParticle.h:61
EgammaObjectsElectrons_cfi.particleID
particleID
Definition:
EgammaObjectsElectrons_cfi.py:4
SimTrack
Definition:
SimTrack.h:9
cmsswSequenceInfo.tp
tp
Definition:
cmsswSequenceInfo.py:17
CaloParticle::event_
EncodedEventId event_
Definition:
CaloParticle.h:194
MtdCaloParticle
Definition:
MtdCaloParticle.h:13
CaloParticle::g4t_iterator
std::vector< SimTrack >::const_iterator g4t_iterator
Definition:
CaloParticle.h:28
CoreSimTrack::momentum
const math::XYZTLorentzVectorD & momentum() const
Definition:
CoreSimTrack.h:19
CaloParticle::theMomentum_
math::XYZTLorentzVectorF theMomentum_
Definition:
CaloParticle.h:201
MtdCaloParticle::~MtdCaloParticle
~MtdCaloParticle()
Definition:
MtdCaloParticle.cc:26
CoreSimTrack::eventId
EncodedEventId eventId() const
Definition:
CoreSimTrack.h:28
CaloParticle::particleId_
uint32_t particleId_
Definition:
CaloParticle.h:196
MtdCaloParticle::MtdCaloParticle
MtdCaloParticle()
Definition:
MtdCaloParticle.cc:9
operator<<
std::ostream & operator<<(std::ostream &s, MtdCaloParticle const &tp)
Definition:
MtdCaloParticle.cc:28
EncodedEventId
Definition:
EncodedEventId.h:11
CoreSimTrack::trackId
unsigned int trackId() const
Definition:
CoreSimTrack.h:31
edm::RefVectorIterator
Definition:
EDProductfwd.h:33
MtdCaloParticle.h
Generated for CMSSW Reference Manual by
1.8.14