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
JetCorrectorParameters::Definitions Class Reference

#include <JetCorrectorParameters.h>

Public Member Functions

std::vector< std::string > binVar () const
 
std::string binVar (unsigned fIndex) const
 
 Definitions ()
 
 Definitions (const std::vector< std::string > &fBinVar, const std::vector< std::string > &fParVar, const std::string &fFormula, bool fIsResponse)
 
 Definitions (const std::string &fLine)
 
std::string formula () const
 
bool isResponse () const
 
std::string level () const
 
unsigned nBinVar () const
 
unsigned nParVar () const
 
std::vector< std::string > parVar () const
 
std::string parVar (unsigned fIndex) const
 

Private Attributes

std::vector< std::string > mBinVar
 
std::string mFormula
 
bool mIsResponse
 
std::string mLevel
 
std::vector< std::string > mParVar
 

Detailed Description

Definition at line 23 of file JetCorrectorParameters.h.

Constructor & Destructor Documentation

JetCorrectorParameters::Definitions::Definitions ( )
inline

Definition at line 27 of file JetCorrectorParameters.h.

27 {}
JetCorrectorParameters::Definitions::Definitions ( const std::vector< std::string > &  fBinVar,
const std::vector< std::string > &  fParVar,
const std::string &  fFormula,
bool  fIsResponse 
)

Definition at line 22 of file JetCorrectorParameters.cc.

References i, mBinVar, mFormula, mIsResponse, mLevel, and mParVar.

23 {
24  for(unsigned i=0;i<fBinVar.size();i++)
25  mBinVar.push_back(fBinVar[i]);
26  for(unsigned i=0;i<fParVar.size();i++)
27  mParVar.push_back(fParVar[i]);
28  mFormula = fFormula;
29  mIsResponse = fIsResponse;
30  mLevel = "";
31 }
int i
Definition: DBlmapReader.cc:9
JetCorrectorParameters::Definitions::Definitions ( const std::string &  fLine)

Definition at line 36 of file JetCorrectorParameters.cc.

References i.

37 {
38  std::vector<std::string> tokens = getTokens(fLine);
39  if (!tokens.empty())
40  {
41  if (tokens.size() < 6)
42  {
43  std::stringstream sserr;
44  sserr<<"(line "<<fLine<<"): less than 6 expected tokens:"<<tokens.size();
45  handleError("JetCorrectorParameters::Definitions",sserr.str());
46  }
47  unsigned nvar = getUnsigned(tokens[0]);
48  unsigned npar = getUnsigned(tokens[nvar+1]);
49  for(unsigned i=0;i<nvar;i++)
50  mBinVar.push_back(tokens[i+1]);
51  for(unsigned i=0;i<npar;i++)
52  mParVar.push_back(tokens[nvar+2+i]);
53  mFormula = tokens[npar+nvar+2];
54  std::string ss = tokens[npar+nvar+3];
55  if (ss == "Response")
56  mIsResponse = true;
57  else if (ss == "Correction")
58  mIsResponse = false;
59  else if (ss == "Resolution")
60  mIsResponse = false;
61  else if (ss.find("PAR")==0)
62  mIsResponse = false;
63  else
64  {
65  std::stringstream sserr;
66  sserr<<"unknown option ("<<ss<<")";
67  handleError("JetCorrectorParameters::Definitions",sserr.str());
68  }
69  mLevel = tokens[npar+nvar+4];
70  }
71 }
int i
Definition: DBlmapReader.cc:9

Member Function Documentation

std::vector<std::string> JetCorrectorParameters::Definitions::binVar ( ) const
inline
std::string JetCorrectorParameters::Definitions::binVar ( unsigned  fIndex) const
inline

Definition at line 36 of file JetCorrectorParameters.h.

References mBinVar.

36 {return mBinVar[fIndex];}
std::string JetCorrectorParameters::Definitions::formula ( ) const
inline
bool JetCorrectorParameters::Definitions::isResponse ( ) const
inline
std::string JetCorrectorParameters::Definitions::level ( ) const
inline
unsigned JetCorrectorParameters::Definitions::nBinVar ( ) const
inline
unsigned JetCorrectorParameters::Definitions::nParVar ( ) const
inline

Definition at line 32 of file JetCorrectorParameters.h.

References mParVar.

Referenced by JetCorrectorParameters::printFile(), and JetCorrectorParameters::printScreen().

32 {return mParVar.size(); }
std::vector<std::string> JetCorrectorParameters::Definitions::parVar ( ) const
inline
std::string JetCorrectorParameters::Definitions::parVar ( unsigned  fIndex) const
inline

Definition at line 35 of file JetCorrectorParameters.h.

References mParVar.

35 {return mParVar[fIndex];}

Member Data Documentation

std::vector<std::string> JetCorrectorParameters::Definitions::mBinVar
private

Definition at line 46 of file JetCorrectorParameters.h.

Referenced by binVar(), Definitions(), and nBinVar().

std::string JetCorrectorParameters::Definitions::mFormula
private

Definition at line 44 of file JetCorrectorParameters.h.

Referenced by Definitions(), and formula().

bool JetCorrectorParameters::Definitions::mIsResponse
private

Definition at line 42 of file JetCorrectorParameters.h.

Referenced by Definitions(), and isResponse().

std::string JetCorrectorParameters::Definitions::mLevel
private

Definition at line 43 of file JetCorrectorParameters.h.

Referenced by Definitions(), and level().

std::vector<std::string> JetCorrectorParameters::Definitions::mParVar
private

Definition at line 45 of file JetCorrectorParameters.h.

Referenced by Definitions(), nParVar(), and parVar().