Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
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
}
PdgEntryReplacer::replace
std::string replace(const std::string &) const
Definition:
PdgEntryReplacer.cc:6
connectstrParser.o
string o
Definition:
connectstrParser.py:70
recoMuon::in
Definition:
RecoMuonEnumerators.h:6
PdgEntryReplacer.h
mergeVDriftHistosByStation.name
string name
Definition:
mergeVDriftHistosByStation.py:77
PdtEntry
Definition:
PdtEntry.h:15
PdtEntry.h
p2
double p2[4]
Definition:
TauolaWrapper.h:90
dbtoconf.out
tuple out
Definition:
dbtoconf.py:99
PdtEntry::setup
void setup(const edm::EventSetup &)
fill data from Event Setup
Definition:
PdtEntry.cc:31
n
int n
Definition:
DTDataIntegrityTask.cc:32
p1
double p1[4]
Definition:
TauolaWrapper.h:89
asciidump.s
string s
Definition:
asciidump.py:422
PdtEntry::pdgId
int pdgId() const
PDG id.
Definition:
PdtEntry.cc:7
Generated for CMSSW Reference Manual by
1.8.5