CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes | Friends
PhysicsTools::VarProcessor::ValueIterator Struct Reference

#include <VarProcessor.h>

Public Member Functions

double * begin () const
 begin of value array for current input variable More...
 
bool empty () const
 checks for existence of values for current input variable More...
 
double * end () const
 end of value array for current input variable More...
 
LoopCtxloopCtx ()
 
 operator bool () const
 test for end of input variable iterator More...
 
void operator() ()
 finish current output variable, move to next slot More...
 
void operator() (double value)
 add value as output variable and move to next slot More...
 
double operator* ()
 the (first or only) value for the current input variable More...
 
ValueIteratoroperator++ ()
 move to next input variable More...
 
ValueIterator operator++ (int dummy)
 move to next input variable More...
 
ValueIteratoroperator<< (double value)
 add computed value to current output variable More...
 
double operator[] (unsigned int idx)
 value idx of current input variable More...
 
unsigned int size () const
 number of values for current input variable More...
 

Protected Member Functions

 ValueIterator (BitSet::Iterator cur, double *values, int *conf, double *output, int *outConf, int *loop, LoopCtx &ctx, unsigned int offset)
 

Private Attributes

const int * conf
 
LoopCtxctx
 
BitSet::Iterator cur
 
const int * loop
 
const unsigned int offset
 
int * outConf
 
double * output
 
double *const start
 
double * values
 

Friends

class VarProcessor
 

Detailed Description

Definition at line 200 of file VarProcessor.h.

Constructor & Destructor Documentation

PhysicsTools::VarProcessor::ValueIterator::ValueIterator ( BitSet::Iterator  cur,
double *  values,
int *  conf,
double *  output,
int *  outConf,
int *  loop,
LoopCtx ctx,
unsigned int  offset 
)
inlineprotected

Member Function Documentation

double* PhysicsTools::VarProcessor::ValueIterator::begin ( void  ) const
inline

begin of value array for current input variable

Definition at line 207 of file VarProcessor.h.

References MuonErrorMatrixValues_cff::values.

Referenced by PhysicsTools::Interceptor::eval().

bool PhysicsTools::VarProcessor::ValueIterator::empty ( void  ) const
inline

checks for existence of values for current input variable

Definition at line 213 of file VarProcessor.h.

References begin, and end.

213 { return begin() == end(); }
double * end() const
end of value array for current input variable
Definition: VarProcessor.h:210
double * begin() const
begin of value array for current input variable
Definition: VarProcessor.h:207
double* PhysicsTools::VarProcessor::ValueIterator::end ( void  ) const
inline

end of value array for current input variable

Definition at line 210 of file VarProcessor.h.

References findQualityFiles::size, and MuonErrorMatrixValues_cff::values.

Referenced by PhysicsTools::Interceptor::eval().

210 { return values + size(); }
unsigned int size() const
number of values for current input variable
Definition: VarProcessor.h:203
LoopCtx& PhysicsTools::VarProcessor::ValueIterator::loopCtx ( )
inline

Definition at line 244 of file VarProcessor.h.

PhysicsTools::VarProcessor::ValueIterator::operator bool ( ) const
inline

test for end of input variable iterator

Definition at line 242 of file VarProcessor.h.

242 { return cur; }
void PhysicsTools::VarProcessor::ValueIterator::operator() ( )
inline

finish current output variable, move to next slot

Definition at line 228 of file VarProcessor.h.

References command_line::start.

229  {
230  int pos = output - start;
231  if (*++outConf > pos)
232  output = start + *outConf;
233  else
234  *outConf = pos;
235  }
void PhysicsTools::VarProcessor::ValueIterator::operator() ( double  value)
inline

add value as output variable and move to next slot

Definition at line 238 of file VarProcessor.h.

References relativeConstraints::value.

239  { *this << value; (*this)(); }
double PhysicsTools::VarProcessor::ValueIterator::operator* ( void  )
inline

the (first or only) value for the current input variable

Definition at line 216 of file VarProcessor.h.

References MuonErrorMatrixValues_cff::values.

ValueIterator& PhysicsTools::VarProcessor::ValueIterator::operator++ ( void  )
inline

move to next input variable

Definition at line 247 of file VarProcessor.h.

References PFRecoTauDiscriminationByIsolation_cfi::offset, and MuonErrorMatrixValues_cff::values.

248  {
249  BitSet::size_t orig = cur();
250  if (++cur) {
251  unsigned int prev = *conf;
252  conf += cur() - orig;
253  values += *conf - prev;
254  if (loop && conf >= loop) {
255  values += offset;
256  loop = nullptr;
257  }
258  }
259  return *this;
260  }
std::size_t size_t
Definition: BitSet.h:31
ValueIterator PhysicsTools::VarProcessor::ValueIterator::operator++ ( int  dummy)
inline

move to next input variable

Definition at line 263 of file VarProcessor.h.

264  { ValueIterator orig = *this; operator ++ (); return orig; }
ValueIterator(BitSet::Iterator cur, double *values, int *conf, double *output, int *outConf, int *loop, LoopCtx &ctx, unsigned int offset)
Definition: VarProcessor.h:269
ValueIterator & operator++()
move to next input variable
Definition: VarProcessor.h:247
ValueIterator& PhysicsTools::VarProcessor::ValueIterator::operator<< ( double  value)
inline

add computed value to current output variable

Definition at line 224 of file VarProcessor.h.

References relativeConstraints::value.

double PhysicsTools::VarProcessor::ValueIterator::operator[] ( unsigned int  idx)
inline

value idx of current input variable

Definition at line 220 of file VarProcessor.h.

References training_settings::idx, and MuonErrorMatrixValues_cff::values.

unsigned int PhysicsTools::VarProcessor::ValueIterator::size ( void  ) const
inline

number of values for current input variable

Definition at line 203 of file VarProcessor.h.

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), and PhysicsTools::Interceptor::eval().

204  { return loop ? (conf[1] - conf[0]) : 1; }

Friends And Related Function Documentation

friend class VarProcessor
friend

Definition at line 267 of file VarProcessor.h.

Member Data Documentation

const int* PhysicsTools::VarProcessor::ValueIterator::conf
private

Definition at line 290 of file VarProcessor.h.

LoopCtx& PhysicsTools::VarProcessor::ValueIterator::ctx
private

Definition at line 286 of file VarProcessor.h.

BitSet::Iterator PhysicsTools::VarProcessor::ValueIterator::cur
private

Definition at line 285 of file VarProcessor.h.

const int* PhysicsTools::VarProcessor::ValueIterator::loop
private

Definition at line 291 of file VarProcessor.h.

const unsigned int PhysicsTools::VarProcessor::ValueIterator::offset
private

Definition at line 287 of file VarProcessor.h.

int* PhysicsTools::VarProcessor::ValueIterator::outConf
private

Definition at line 293 of file VarProcessor.h.

double* PhysicsTools::VarProcessor::ValueIterator::output
private

Definition at line 292 of file VarProcessor.h.

double* const PhysicsTools::VarProcessor::ValueIterator::start
private
double* PhysicsTools::VarProcessor::ValueIterator::values
private