CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
ScaleRecordHelper Class Reference

#include <ScaleRecordHelper.h>

Public Member Functions

void extractScales (l1t::OMDSReader::QueryResults &record, std::vector< double > &destScales)
 
void pushColumnNames (std::vector< std::string > &columns)
 
 ScaleRecordHelper (const std::string &binPrefix, unsigned int maxBin)
 

Protected Member Functions

const std::string columnName (unsigned int bin)
 

Private Attributes

std::string binPrefix_
 
unsigned int maxBin_
 

Detailed Description

Definition at line 21 of file ScaleRecordHelper.h.

Constructor & Destructor Documentation

ScaleRecordHelper::ScaleRecordHelper ( const std::string &  binPrefix,
unsigned int  maxBin 
)

Definition at line 7 of file ScaleRecordHelper.cc.

7  {
8  binPrefix_ = binPrefix;
9  maxBin_ = maxBin;
10 }
std::string binPrefix_
unsigned int maxBin_

Member Function Documentation

const string ScaleRecordHelper::columnName ( unsigned int  bin)
protected

Definition at line 34 of file ScaleRecordHelper.cc.

References newFWLiteAna::bin, and mergeVDriftHistosByStation::name.

34  {
35  ostringstream name;
36  name << binPrefix_ << '_' << bin ;
37  return name.str();
38 }
std::string binPrefix_
void ScaleRecordHelper::extractScales ( l1t::OMDSReader::QueryResults record,
std::vector< double > &  destScales 
)

Definition at line 12 of file ScaleRecordHelper.cc.

References l1t::OMDSReader::QueryResults::attributeLists(), and i.

Referenced by L1MuTriggerPtScaleOnlineProducer::newObject(), and L1MuTriggerScalesOnlineProducer::newObject().

12  {
13  const coral::AttributeList& row = record.attributeLists()[0];
14  /* The <= in the next line is of crucial importance, since putting the intuitive <
15  there will lead to a world of pain (because the scale then has a max entry of 0,
16  and very bad things happen). See RFC968.
17  */
18  for(unsigned int i=0;i<=maxBin_;++i) {
19  /* We actually would like double values, but CORAL thinks that the DB contains
20  float, so we have to eat that.
21  Also: This assumes that there are no other columns than the ones we added,
22  maybe this should be made more explicit by handling the whole query in here? */
23  destScales.push_back(row[i].data<float>());
24  }
25 }
int i
Definition: DBlmapReader.cc:9
const std::vector< coral::AttributeList > & attributeLists() const
Definition: OMDSReader.h:65
unsigned int maxBin_
void ScaleRecordHelper::pushColumnNames ( std::vector< std::string > &  columns)

Definition at line 28 of file ScaleRecordHelper.cc.

References i.

Referenced by L1MuTriggerPtScaleOnlineProducer::newObject(), and L1MuTriggerScalesOnlineProducer::newObject().

28  {
29  for(unsigned int i = 0; i <= maxBin_ ; ++i) {
30  columns.push_back(columnName(i));
31  }
32 }
int i
Definition: DBlmapReader.cc:9
const std::string columnName(unsigned int bin)
tuple columns
Definition: mps_check.py:210
unsigned int maxBin_

Member Data Documentation

std::string ScaleRecordHelper::binPrefix_
private

Definition at line 34 of file ScaleRecordHelper.h.

unsigned int ScaleRecordHelper::maxBin_
private

Definition at line 35 of file ScaleRecordHelper.h.