Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
PhysicsTools
HepMCCandAlgos
src
pdgEntryReplace.cc
Go to the documentation of this file.
1
#include "
PhysicsTools/HepMCCandAlgos/interface/pdgEntryReplace.h
"
2
#include "
SimGeneral/HepPDTRecord/interface/PdtEntry.h
"
3
#include <sstream>
4
using namespace
std;
5
6
string
pdgEntryReplace
(
const
string
&
in
,
HepPDT::ParticleDataTable
const
& pdt) {
7
string
out
=
in
;
8
for
(;;) {
9
size_t
p1
= out.find_first_of(
'{'
);
10
if
(p1 == string::npos)
11
break
;
12
size_t
p2
= out.find_first_of(
'}'
, p1 + 1);
13
if
(p2 == string::npos)
14
break
;
15
size_t
n
= p2 - p1 - 1;
16
string
name
(out, p1 + 1, n);
17
PdtEntry
particle(name);
18
particle.
setup
(pdt);
19
ostringstream
o
;
20
o << particle.
pdgId
();
21
string
s
= o.str();
22
out.replace(p1, n + 2, s);
23
}
24
return
out
;
25
}
PdtEntry::setup
void setup(const HepPDT::ParticleDataTable &)
fill data from Event Setup
Definition:
PdtEntry.cc:26
fireworks::p2
const TString p2
Definition:
fwPaths.cc:13
ParticleDataTable
HepPDT::ParticleDataTable ParticleDataTable
Definition:
ParticleDataTable.h:8
pdgEntryReplace
std::string pdgEntryReplace(const std::string &, HepPDT::ParticleDataTable const &)
recoMuon::in
Definition:
RecoMuonEnumerators.h:6
mergeVDriftHistosByStation.name
string name
Definition:
mergeVDriftHistosByStation.py:78
PdtEntry
Definition:
PdtEntry.h:20
fireworks::p1
const TString p1
Definition:
fwPaths.cc:12
PdtEntry.h
pdgEntryReplace.h
alignCSCRings.s
list s
Definition:
alignCSCRings.py:92
class-composition.o
tuple o
Definition:
class-composition.py:65
dqmiodumpmetadata.n
int n
Definition:
dqmiodumpmetadata.py:28
PdtEntry::pdgId
int pdgId() const
PDG id.
Definition:
PdtEntry.cc:5
submitPVResolutionJobs.out
string out
Definition:
submitPVResolutionJobs.py:118
Generated for CMSSW Reference Manual by
1.8.5