test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
PdgEntryReplacer Class Reference

#include <PdgEntryReplacer.h>

Public Member Functions

 PdgEntryReplacer (const edm::EventSetup &es)
 
std::string replace (const std::string &) const
 

Private Attributes

const edm::EventSetupes_
 

Detailed Description

Definition at line 9 of file PdgEntryReplacer.h.

Constructor & Destructor Documentation

PdgEntryReplacer::PdgEntryReplacer ( const edm::EventSetup es)
inlineexplicit

Definition at line 11 of file PdgEntryReplacer.h.

11  :
12  es_(& es) { }
const edm::EventSetup * es_

Member Function Documentation

string PdgEntryReplacer::replace ( const std::string &  ) const

Definition at line 6 of file PdgEntryReplacer.cc.

References recoMuon::in, gen::n, mergeVDriftHistosByStation::name, connectstrParser::o, GenerateHcalLaserBadRunList::out, p1, p2, PdtEntry::pdgId(), alignCSCRings::s, and PdtEntry::setup().

Referenced by GenParticlePruner::produce().

6  {
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 }
double p2[4]
Definition: TauolaWrapper.h:90
const edm::EventSetup * es_
double p1[4]
Definition: TauolaWrapper.h:89

Member Data Documentation

const edm::EventSetup* PdgEntryReplacer::es_
private

Definition at line 15 of file PdgEntryReplacer.h.