CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

ScaleRecordHelper Class Reference

#include <ScaleRecordHelper.h>

List of all members.

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 23 of file ScaleRecordHelper.h.


Constructor & Destructor Documentation

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

Definition at line 7 of file ScaleRecordHelper.cc.

                                                                                    {
  binPrefix_ = binPrefix;
  maxBin_ = 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.

                                                           {
  ostringstream name;
  name << binPrefix_ << '_' << bin ;
  return name.str();
}
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().

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

Member Data Documentation

std::string ScaleRecordHelper::binPrefix_ [private]

Definition at line 36 of file ScaleRecordHelper.h.

unsigned int ScaleRecordHelper::maxBin_ [private]

Definition at line 37 of file ScaleRecordHelper.h.