Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
GeneratorInterface
Pythia8Interface
src
SLHAReaderBase.cc
Go to the documentation of this file.
1
#include "
GeneratorInterface/Pythia8Interface/interface/SLHAReaderBase.h
"
2
#include "
FWCore/Utilities/interface/Exception.h
"
3
4
#include <sstream>
5
6
#include "TFile.h"
7
#include "TTree.h"
8
9
SLHAReaderBase::SLHAReaderBase
(
const
edm::ParameterSet
& conf) {
10
auto
filename
= conf.
getParameter
<
std::string
>(
"file"
);
11
file_
= TFile::Open(
filename
.c_str());
12
if
(!file_)
13
throw
cms::Exception
(
"MissingFile"
) <<
"Could not open file "
<<
filename
;
14
15
auto
treename = conf.
getParameter
<
std::string
>(
"tree"
);
16
tree_
= (TTree*)file_->Get(treename.c_str());
17
if
(!tree_)
18
throw
cms::Exception
(
"MissingTree"
) <<
"Could not get tree "
<< treename <<
" from file "
<<
filename
;
19
}
20
21
SLHAReaderBase::~SLHAReaderBase
() {
file_
->Close(); }
22
23
std::vector<std::string>
SLHAReaderBase::splitline
(
const
std::string
&
line
,
char
delim) {
24
std::stringstream
ss
(line);
25
std::string
field;
26
std::vector<std::string>
fields
;
27
while
(getline(ss, field, delim)) {
28
fields.push_back(field);
29
}
30
return
fields
;
31
}
32
33
EDM_REGISTER_PLUGINFACTORY
(
SLHAReaderFactory
,
"SLHAReaderFactory"
);
l1GtPatternGenerator_cfi.fields
fields
Definition:
l1GtPatternGenerator_cfi.py:91
Exception
Definition:
hltDiff.cc:245
SLHAReaderBase::~SLHAReaderBase
virtual ~SLHAReaderBase()
Definition:
SLHAReaderBase.cc:21
SLHAReaderBase.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
geometryCSVtoXML.line
tuple line
Definition:
geometryCSVtoXML.py:16
SLHAReaderBase::splitline
static std::vector< std::string > splitline(const std::string &line, char delim)
Definition:
SLHAReaderBase.cc:23
SLHAReaderBase::tree_
TTree * tree_
Definition:
SLHAReaderBase.h:26
edmplugin::PluginFactory
Definition:
PluginFactory.h:34
SLHAReaderBase::SLHAReaderBase
SLHAReaderBase(const edm::ParameterSet &conf)
Definition:
SLHAReaderBase.cc:9
EDM_REGISTER_PLUGINFACTORY
#define EDM_REGISTER_PLUGINFACTORY(_factory_, _category_)
Definition:
PluginFactory.h:89
Exception.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
contentValuesCheck.ss
list ss
Definition:
contentValuesCheck.py:33
lut2db_cfg.filename
tuple filename
Definition:
lut2db_cfg.py:20
edm::ParameterSet
Definition:
ParameterSet.h:47
SLHAReaderBase::file_
TFile * file_
Definition:
SLHAReaderBase.h:25
Generated for CMSSW Reference Manual by
1.8.5