SimDataFormats
CaloAnalysis
src
CaloParticle.cc
Go to the documentation of this file.
1
#include "
SimDataFormats/CaloAnalysis/interface/CaloParticle.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
const
unsigned
int
CaloParticle::longLivedTag
= 65536;
10
11
CaloParticle::CaloParticle
() {
12
// No operation
13
}
14
15
CaloParticle::CaloParticle
(
const
SimTrack
&simtrk) {
16
addG4Track
(simtrk);
17
event_
= simtrk.
eventId
();
18
particleId_
= simtrk.
trackId
();
19
theMomentum_
.SetPxPyPzE(
20
simtrk.
momentum
().px(), simtrk.
momentum
().py(), simtrk.
momentum
().pz(), simtrk.
momentum
().E());
21
}
22
23
CaloParticle::CaloParticle
(
EncodedEventId
eventID, uint32_t
particleID
) {
24
event_
= eventID;
25
particleId_
=
particleID
;
26
}
27
28
CaloParticle::~CaloParticle
() {}
29
30
std::ostream &
operator<<
(std::ostream &
s
,
CaloParticle
const
&
tp
) {
31
s
<<
"Calo Particle:"
<< std::endl;
32
s
<<
"CP momentum, q, ID, & Event #: "
<<
tp
.p4() <<
" "
<<
tp
.charge() <<
" "
<<
tp
.pdgId() <<
" "
33
<<
tp
.eventId().bunchCrossing() <<
"."
<<
tp
.eventId().event() << std::endl;
34
35
for
(
CaloParticle::genp_iterator
hepT =
tp
.genParticle_begin(); hepT !=
tp
.genParticle_end(); ++hepT) {
36
s
<<
" HepMC Track Momentum "
<< (*hepT)->momentum().rho() << std::endl;
37
}
38
39
for
(
CaloParticle::g4t_iterator
g4T =
tp
.g4Track_begin(); g4T !=
tp
.g4Track_end(); ++g4T) {
40
s
<<
" Geant Track Momentum "
<< g4T->momentum() << std::endl;
41
s
<<
" Geant Track ID & type "
<< g4T->trackId() <<
" "
<< g4T->type() << std::endl;
42
if
(g4T->type() !=
tp
.pdgId()) {
43
s
<<
" Mismatch b/t CaloParticle and Geant types"
<< std::endl;
44
}
45
}
46
s
<<
"SimClusters in this CaloParticle: "
<< std::endl;
47
for
(
auto
itr
=
tp
.simClusters_.begin();
itr
!=
tp
.simClusters_.end(); ++
itr
) {
48
s
<< **
itr
;
49
}
50
s
<< std::endl;
51
return
s
;
52
}
CoreSimTrack::momentum
const math::XYZTLorentzVectorD & momentum() const
Definition:
CoreSimTrack.h:19
CoreSimTrack::eventId
EncodedEventId eventId() const
Definition:
CoreSimTrack.h:28
MessageLogger.h
operator<<
std::ostream & operator<<(std::ostream &s, CaloParticle const &tp)
Definition:
CaloParticle.cc:30
CaloParticle::theMomentum_
math::XYZTLorentzVectorF theMomentum_
Definition:
CaloParticle.h:198
CaloParticle::~CaloParticle
~CaloParticle()
Definition:
CaloParticle.cc:28
CaloParticle::particleId_
uint32_t particleId_
Definition:
CaloParticle.h:193
CaloParticle::CaloParticle
CaloParticle()
Definition:
CaloParticle.cc:11
CaloParticle::longLivedTag
static const unsigned int longLivedTag
long lived flag
Definition:
CaloParticle.h:157
GenParticle.h
EncodedEventId
Definition:
EncodedEventId.h:11
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
SimCluster.h
EgammaObjectsElectrons_cfi.particleID
particleID
Definition:
EgammaObjectsElectrons_cfi.py:4
CaloParticle::event_
EncodedEventId event_
Definition:
CaloParticle.h:191
CaloParticle::g4t_iterator
std::vector< SimTrack >::const_iterator g4t_iterator
Definition:
CaloParticle.h:28
cmsswSequenceInfo.tp
tp
Definition:
cmsswSequenceInfo.py:17
CaloParticle
Definition:
CaloParticle.h:16
CaloParticle.h
itr
std::vector< std::pair< float, float > >::iterator itr
Definition:
HGCDigitizer.cc:29
CoreSimTrack::trackId
unsigned int trackId() const
Definition:
CoreSimTrack.h:31
SimTrack
Definition:
SimTrack.h:6
edm::RefVectorIterator
Definition:
EDProductfwd.h:33
CaloParticle::addG4Track
void addG4Track(const SimTrack &t)
Definition:
CaloParticle.h:61
Generated for CMSSW Reference Manual by
1.8.16