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
PhysicsTools::TreeReader::Value Class Reference

Public Member Functions

void fill (AtomicId name, TreeReader *reader) const
 
void setBranchName (const TString &name)
 
void setOpt (bool opt, double optVal)
 
void setPtr (const void *ptr)
 
void update (TreeReader *reader) const
 
 Value ()
 
 Value (int index, bool multiple, bool optional, char type)
 
 ~Value ()
 

Private Attributes

int index
 
bool multiple
 
TString name
 
bool optional
 
double optVal
 
const void * ptr
 
char type
 

Detailed Description

Definition at line 78 of file TreeReader.h.

Constructor & Destructor Documentation

PhysicsTools::TreeReader::Value::Value ( )
inline

Definition at line 80 of file TreeReader.h.

80 {}
PhysicsTools::TreeReader::Value::Value ( int  index,
bool  multiple,
bool  optional,
char  type 
)
inline
PhysicsTools::TreeReader::Value::~Value ( )
inline

Definition at line 84 of file TreeReader.h.

84 {}

Member Function Documentation

void PhysicsTools::TreeReader::Value::fill ( AtomicId  name,
TreeReader reader 
) const

Definition at line 401 of file TreeReader.cc.

References PhysicsTools::Variable::ValueList::add(), getHLTprescales::index, PhysicsTools::TreeReader::multiBool, PhysicsTools::TreeReader::multiDouble, PhysicsTools::TreeReader::multiFloat, PhysicsTools::TreeReader::multiInt, PhysicsTools::TreeReader::singleBool, PhysicsTools::TreeReader::singleDouble, PhysicsTools::TreeReader::singleFloat, PhysicsTools::TreeReader::singleInt, relativeConstraints::value, and PhysicsTools::TreeReader::values.

402 {
403  if (multiple) {
404  switch(type) {
405  case 'D': {
406  const std::vector<Double_t> *values =
407  static_cast<const std::vector<Double_t>*>(ptr);
408  if (!values)
409  values = &reader->multiDouble[index].second;
410  for(std::vector<Double_t>::const_iterator iter =
411  values->begin(); iter != values->end(); iter++)
412  reader->values.add(name, *iter);
413  break;
414  }
415  case 'F': {
416  const std::vector<Float_t> *values =
417  static_cast<const std::vector<Float_t>*>(ptr);
418  if (!values)
419  values = &reader->multiFloat[index].second;
420  for(std::vector<Float_t>::const_iterator iter =
421  values->begin(); iter != values->end(); iter++)
422  reader->values.add(name, *iter);
423  break;
424  }
425  case 'I': {
426  const std::vector<Int_t> *values =
427  static_cast<const std::vector<Int_t>*>(ptr);
428  if (!values)
429  values = &reader->multiInt[index].second;
430  for(std::vector<Int_t>::const_iterator iter =
431  values->begin(); iter != values->end(); iter++)
432  reader->values.add(name, *iter);
433  break;
434  }
435  case 'B': {
436  const std::vector<Bool_t> *values =
437  static_cast<const std::vector<Bool_t>*>(ptr);
438  if (!values)
439  values = &reader->multiBool[index].second;
440  for(std::vector<Bool_t>::const_iterator iter =
441  values->begin(); iter != values->end(); iter++)
442  reader->values.add(name, *iter);
443  break;
444  }
445  }
446  } else {
447  double value = 0.0;
448 
449  switch(type) {
450  case 'D':
451  value = ptr ? *(const Double_t*)ptr
452  : reader->singleDouble[index];
453  break;
454  case 'F':
455  value = ptr ? *(const Float_t*)ptr
456  : reader->singleFloat[index];
457  break;
458  case 'I':
459  value = ptr ? *(const Int_t*)ptr
460  : reader->singleInt[index];
461  break;
462  case 'B':
463  value = ptr ? *(const Bool_t*)ptr
464  : reader->singleBool[index];
465  break;
466  }
467 
468  if (!optional || value != optVal)
469  reader->values.add(name, value);
470  }
471 }
type
Definition: HCALResponse.h:22
Variable::ValueList values
Definition: TreeReader.h:109
void PhysicsTools::TreeReader::Value::setBranchName ( const TString &  name)
inline

Definition at line 88 of file TreeReader.h.

References name.

89  { this->name = name; }
void PhysicsTools::TreeReader::Value::setOpt ( bool  opt,
double  optVal 
)
inline

Definition at line 86 of file TreeReader.h.

References optional, and optVal.

void PhysicsTools::TreeReader::Value::setPtr ( const void *  ptr)
inline

Definition at line 90 of file TreeReader.h.

References ptr.

91  { this->ptr = ptr; }
void PhysicsTools::TreeReader::Value::update ( TreeReader reader) const

Definition at line 352 of file TreeReader.cc.

References index, PhysicsTools::TreeReader::multiBool, PhysicsTools::TreeReader::multiDouble, PhysicsTools::TreeReader::multiFloat, PhysicsTools::TreeReader::multiInt, multiple, name, ptr, PhysicsTools::TreeReader::singleBool, PhysicsTools::TreeReader::singleDouble, PhysicsTools::TreeReader::singleFloat, PhysicsTools::TreeReader::singleInt, PhysicsTools::TreeReader::tree, and relativeConstraints::value.

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

353 {
354  if (ptr)
355  return;
356 
357  void *value = 0;
358  if (multiple) {
359  switch(type) {
360  case 'D':
361  reader->multiDouble[index].first =
362  &reader->multiDouble[index].second;
363  value = &reader->multiDouble[index].first;
364  break;
365  case 'F':
366  reader->multiFloat[index].first =
367  &reader->multiFloat[index].second;
368  value = &reader->multiFloat[index].first;
369  break;
370  case 'I':
371  reader->multiInt[index].first =
372  &reader->multiInt[index].second;
373  value = &reader->multiInt[index].first;
374  break;
375  case 'B':
376  reader->multiBool[index].first = value;
377  &reader->multiBool[index].second;
378  value = &reader->multiBool[index].first;
379  break;
380  }
381  } else {
382  switch(type) {
383  case 'D':
384  value = &reader->singleDouble[index];
385  break;
386  case 'F':
387  value = &reader->singleFloat[index];
388  break;
389  case 'I':
390  value = &reader->singleInt[index];
391  break;
392  case 'B':
393  value = &reader->singleBool[index];
394  break;
395  }
396  }
397 
398  reader->tree->SetBranchAddress(name, value);
399 }
type
Definition: HCALResponse.h:22

Member Data Documentation

int PhysicsTools::TreeReader::Value::index
private

Definition at line 98 of file TreeReader.h.

Referenced by BeautifulSoup.PageElement::_invert(), and update().

bool PhysicsTools::TreeReader::Value::multiple
private

Definition at line 100 of file TreeReader.h.

Referenced by iovInspector.WhatDescription::describe(), and update().

TString PhysicsTools::TreeReader::Value::name
private
bool PhysicsTools::TreeReader::Value::optional
private

Definition at line 99 of file TreeReader.h.

Referenced by setOpt().

double PhysicsTools::TreeReader::Value::optVal
private

Definition at line 101 of file TreeReader.h.

Referenced by setOpt().

const void* PhysicsTools::TreeReader::Value::ptr
private

Definition at line 103 of file TreeReader.h.

Referenced by setPtr(), and update().

char PhysicsTools::TreeReader::Value::type
private