CMS 3D CMS Logo

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

#include <CachingVariable.h>

Inheritance diagram for Splitter:
CachingVariable VarSplitter

Public Member Functions

CachingVariable::evalType eval (const edm::Event &iEvent) const override=0
 
const std::string & label (unsigned int i) const
 
unsigned int maxIndex () const
 
virtual unsigned int maxSlots () const
 
const std::string shortLabel (unsigned int i) const
 
 Splitter (std::string method, std::string n, const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 
- Public Member Functions inherited from CachingVariable
void addDescriptionLine (const std::string &s)
 
 CachingVariable (std::string m, std::string n, const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 
bool compute (const edm::Event &iEvent) const
 
const Descriptiondescription () const
 
const std::string & holderName () const
 
const std::string & method () const
 
const std::string & name () const
 
valueType operator() (const edm::Event &iEvent) const
 
void print () const
 
void setHolder (std::string hn) const
 
virtual ~CachingVariable ()
 

Protected Attributes

std::vector< std::string > labels_
 
std::vector< std::string > short_labels_
 
- Protected Attributes inherited from CachingVariable
evalType cache_
 
edm::ParameterSet conf_
 
Description d_
 
edm::Event::CacheIdentifier_t eventCacheID_ = 0
 
std::string holderName_
 
std::string method_
 
std::string name_
 

Additional Inherited Members

- Public Types inherited from CachingVariable
typedef std::pair< bool, valueTypeevalType
 
typedef double valueType
 
typedef std::map< std::string, const CachingVariable * > vMap
 
- Protected Member Functions inherited from CachingVariable
evalTypebaseEval (const edm::Event &iEvent) const
 
bool notSeenThisEventAlready (const edm::Event &iEvent) const
 
void setCache (valueType &v) const
 
void setNotCompute () const
 

Detailed Description

Definition at line 182 of file CachingVariable.h.

Constructor & Destructor Documentation

◆ Splitter()

Splitter::Splitter ( std::string  method,
std::string  n,
const edm::ParameterSet iConfig,
edm::ConsumesCollector iC 
)
inline

Definition at line 184 of file CachingVariable.h.

185  : CachingVariable(method, n, iConfig, iC) {}
CachingVariable(std::string m, std::string n, const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
const std::string & method() const

Member Function Documentation

◆ eval()

CachingVariable::evalType Splitter::eval ( const edm::Event iEvent) const
overridepure virtual

Reimplemented from CachingVariable.

Implemented in VarSplitter.

◆ label()

const std::string& Splitter::label ( unsigned int  i) const
inline

Definition at line 205 of file CachingVariable.h.

References CachingVariable::conf_, edm::ParameterSet::dump(), mps_fire::i, and labels_.

Referenced by SplittingConfigurableHisto::complete(), and SplittingConfigurableHisto::SplittingConfigurableHisto().

205  {
206  if (i >= labels_.size()) {
207  edm::LogError("Splitter") << "trying to access slots label at index: " << i << "while of size: " << labels_.size()
208  << "\n"
209  << conf_.dump();
210  return labels_.back();
211  } else
212  return labels_[i];
213  }
Log< level::Error, false > LogError
edm::ParameterSet conf_
std::vector< std::string > labels_
std::string dump(unsigned int indent=0) const

◆ maxIndex()

unsigned int Splitter::maxIndex ( ) const
inline

Definition at line 190 of file CachingVariable.h.

References maxSlots().

Referenced by VarSplitter::eval().

190 { return maxSlots() - 1; }
virtual unsigned int maxSlots() const

◆ maxSlots()

virtual unsigned int Splitter::maxSlots ( ) const
inlinevirtual

Reimplemented in VarSplitter.

Definition at line 193 of file CachingVariable.h.

References labels_.

Referenced by maxIndex(), and SplittingConfigurableHisto::SplittingConfigurableHisto().

193 { return labels_.size(); }
std::vector< std::string > labels_

◆ shortLabel()

const std::string Splitter::shortLabel ( unsigned int  i) const
inline

Definition at line 195 of file CachingVariable.h.

References CachingVariable::conf_, edm::ParameterSet::dump(), mps_fire::i, and short_labels_.

Referenced by SplittingConfigurableHisto::SplittingConfigurableHisto().

195  {
196  if (i >= short_labels_.size()) {
197  edm::LogError("Splitter") << "trying to access slots short_label at index: " << i
198  << "while of size: " << short_labels_.size() << "\n"
199  << conf_.dump();
200  return short_labels_.back();
201  } else
202  return short_labels_[i];
203  }
std::vector< std::string > short_labels_
Log< level::Error, false > LogError
edm::ParameterSet conf_
std::string dump(unsigned int indent=0) const

Member Data Documentation

◆ labels_

std::vector<std::string> Splitter::labels_
protected

Definition at line 216 of file CachingVariable.h.

Referenced by label(), maxSlots(), and VarSplitter::VarSplitter().

◆ short_labels_

std::vector<std::string> Splitter::short_labels_
protected

Definition at line 217 of file CachingVariable.h.

Referenced by shortLabel(), and VarSplitter::VarSplitter().