CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Attributes
SLHAReaderBase Class Referenceabstract

#include <SLHAReaderBase.h>

Inheritance diagram for SLHAReaderBase:
SLHAReaderpMSSM

Public Member Functions

virtual std::string getSLHA (const std::string &configDesc)=0
 
 SLHAReaderBase (const edm::ParameterSet &conf)
 
virtual ~SLHAReaderBase ()
 

Static Public Member Functions

static std::vector< std::string > splitline (const std::string &line, char delim)
 

Protected Attributes

TFile * file_
 
TTree * tree_
 

Detailed Description

Definition at line 12 of file SLHAReaderBase.h.

Constructor & Destructor Documentation

◆ SLHAReaderBase()

SLHAReaderBase::SLHAReaderBase ( const edm::ParameterSet conf)

Definition at line 9 of file SLHAReaderBase.cc.

9  {
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 }

References Exception, file_, corrVsCorr::filename, edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and tree_.

◆ ~SLHAReaderBase()

SLHAReaderBase::~SLHAReaderBase ( )
virtual

Definition at line 21 of file SLHAReaderBase.cc.

21 { file_->Close(); }

References file_.

Member Function Documentation

◆ getSLHA()

virtual std::string SLHAReaderBase::getSLHA ( const std::string &  configDesc)
pure virtual

Implemented in SLHAReaderpMSSM.

◆ splitline()

std::vector< std::string > SLHAReaderBase::splitline ( const std::string &  line,
char  delim 
)
static

Definition at line 23 of file SLHAReaderBase.cc.

23  {
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 }

References l1GtPatternGenerator_cfi::fields, mps_splice::line, contentValuesCheck::ss, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by SLHAReaderpMSSM::getSLHA().

Member Data Documentation

◆ file_

TFile* SLHAReaderBase::file_
protected

Definition at line 25 of file SLHAReaderBase.h.

Referenced by SLHAReaderBase(), and ~SLHAReaderBase().

◆ tree_

TTree* SLHAReaderBase::tree_
protected

Definition at line 26 of file SLHAReaderBase.h.

Referenced by SLHAReaderpMSSM::getSLHA(), and SLHAReaderBase().

SLHAReaderBase::file_
TFile * file_
Definition: SLHAReaderBase.h:25
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
SLHAReaderBase::tree_
TTree * tree_
Definition: SLHAReaderBase.h:26
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Exception
Definition: hltDiff.cc:245
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
l1GtPatternGenerator_cfi.fields
fields
Definition: l1GtPatternGenerator_cfi.py:91
mps_splice.line
line
Definition: mps_splice.py:76