Main Page
Namespaces
Classes
Package Documentation
PhysicsTools
HepMCCandAlgos
src
PdgEntryReplacer.cc
Go to the documentation of this file.
1
#include "
PhysicsTools/HepMCCandAlgos/interface/PdgEntryReplacer.h
"
2
#include "
SimGeneral/HepPDTRecord/interface/PdtEntry.h
"
3
#include <sstream>
4
using namespace
std
;
5
6
string
PdgEntryReplacer::replace
(
const
string
&
in
)
const
{
7
string
out
=
in
;
8
for
(;;) {
9
size_t
p1
= out.find_first_of(
'{'
);
10
if
(p1 == string::npos)
break
;
11
size_t
p2
= out.find_first_of(
'}'
, p1 + 1);
12
if
(p2 == string::npos)
break
;
13
size_t
n
= p2 - p1 - 1;
14
string
name
(out, p1 + 1, n);
15
PdtEntry
particle(name);
16
particle.
setup
(*es_);
17
ostringstream
o
;
18
o << particle.
pdgId
();
19
string
s
= o.str();
20
out.replace(p1, n + 2, s);
21
}
22
return
out
;
23
}
alignCSCRings.s
s
Definition:
alignCSCRings.py:91
PdgEntryReplacer::replace
std::string replace(const std::string &) const
Definition:
PdgEntryReplacer.cc:6
std
Definition:
JetResolutionObject.h:76
recoMuon::in
Definition:
RecoMuonEnumerators.h:6
PdgEntryReplacer.h
PdtEntry
Definition:
PdtEntry.h:15
PdtEntry.h
p2
double p2[4]
Definition:
TauolaWrapper.h:90
connectstrParser.o
o
Definition:
connectstrParser.py:70
PdtEntry::setup
void setup(const edm::EventSetup &)
fill data from Event Setup
Definition:
PdtEntry.cc:31
MillePedeFileConverter_cfg.out
out
Definition:
MillePedeFileConverter_cfg.py:31
gen::n
int n
Definition:
Cascade2Hadronizer.cc:79
p1
double p1[4]
Definition:
TauolaWrapper.h:89
dataset.name
name
Definition:
dataset.py:45
PdtEntry::pdgId
int pdgId() const
PDG id.
Definition:
PdtEntry.cc:7
Generated for CMSSW Reference Manual by
1.8.11