CMS 3D CMS Logo

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

Builds the SiStripDetVOff object for transfer by O2O. More...

#include <SiStripDetVOffBuilder.h>

Classes

struct  DetIdListTimeAndStatus
 
struct  TimesAndValues
 

Public Member Functions

void BuildDetVOffObj ()
 
void discardIOVs (std::vector< std::pair< SiStripDetVOff *, cond::Time_t > >::iterator &it, std::vector< std::pair< SiStripDetVOff *, cond::Time_t > >::iterator &initialIt, std::vector< std::pair< SiStripDetVOff *, cond::Time_t > > &resultVec, const bool last, const unsigned int first)
 Removes IOVs as dictated by reduction. More...
 
bool FileExists (std::string filename)
 
std::vector< std::pair
< SiStripDetVOff
*, cond::Time_t > > 
getModulesVOff ()
 
std::vector< std::vector
< uint32_t > > 
getPayloadStats ()
 
void reduce (std::vector< std::pair< SiStripDetVOff *, cond::Time_t > >::iterator &it, std::vector< std::pair< SiStripDetVOff *, cond::Time_t > >::iterator &initialIt, std::vector< std::pair< SiStripDetVOff *, cond::Time_t > > &resultVec, const bool last=false)
 Operates the reduction of the fast sequences of ramping up and down of the voltages. More...
 
void reduction (const uint32_t deltaTmin, const uint32_t maxIOVlength)
 
void setLastSiStripDetVOff (SiStripDetVOff *lastPayload, cond::Time_t lastTimeStamp)
 
 SiStripDetVOffBuilder (const edm::ParameterSet &, const edm::ActivityRegistry &)
 
 ~SiStripDetVOffBuilder ()
 

Private Types

typedef std::vector< std::pair
< std::vector< uint32_t >
, coral::TimeStamp > > 
DetIdTimeStampVector
 

Private Member Functions

void buildPSUdetIdMap (TimesAndValues &tStruct, DetIdListTimeAndStatus &dStruct)
 
std::pair< int, int > extractDetIdVector (const unsigned int i, SiStripDetVOff *modV, DetIdListTimeAndStatus &detIdStruct)
 
cond::Time_t findMostRecentTimeStamp (const std::vector< coral::TimeStamp > &coralDate)
 
int findSetting (uint32_t id, const coral::TimeStamp &changeDate, const std::vector< uint32_t > &settingID, const std::vector< coral::TimeStamp > &settingDate)
 
int findSetting (std::string dpname, const coral::TimeStamp &changeDate, const std::vector< std::string > &settingDpname, const std::vector< coral::TimeStamp > &settingDate)
 
cond::Time_t getCondTime (const coral::TimeStamp &coralTime)
 
coral::TimeStamp getCoralTime (cond::Time_t iovTime)
 
void lastValue (TimesAndValues &tStruct)
 
void lastValueFromFile (TimesAndValues &tStruct)
 
void printPar (std::stringstream &ss, const std::vector< int > &par)
 
void readLastValueFromFile (std::vector< uint32_t > &dpIDs, std::vector< float > &vmonValues, std::vector< coral::TimeStamp > &dateChange)
 
void removeDuplicates (std::vector< uint32_t > &vec)
 
void setPayloadStats (const uint32_t afterV, const uint32_t numAdded, const uint32_t numRemoved)
 
void statusChange (cond::Time_t &lastTime, TimesAndValues &tStruct)
 
std::string timeToStream (const coral::TimeStamp &coralTime, const string &comment="")
 
std::string timeToStream (const cond::Time_t &condTime, const string &comment="")
 

Private Attributes

std::string authenticationPath
 
std::auto_ptr< SiStripCoralIfacecoralInterface
 
bool debug_
 
uint32_t deltaTmin_
 
std::string detIdListFile_
 
std::string excludedDetIdListFile_
 
bool fromFile
 
double highVoltageOnThreshold_
 
std::pair< SiStripDetVOff
*, cond::Time_t
lastStoredCondObj
 
std::string lastValueFileName
 
uint32_t maxIOVlength_
 
std::vector< std::pair
< SiStripDetVOff
*, cond::Time_t > > 
modulesOff
 
std::string onlineDbConnectionString
 
std::vector< std::vector
< uint32_t > > 
payloadStats
 
std::string psuDetIdMapFile_
 
std::vector< int > tDefault
 
coral::TimeStamp tmax
 
std::vector< int > tmax_par
 
coral::TimeStamp tmin
 
std::vector< int > tmin_par
 
std::vector< int > tset_par
 
coral::TimeStamp tsetmin
 
bool whichQuery
 
std::string whichTable
 

Friends

class TestSiStripDetVOffBuilder
 

Detailed Description

Builds the SiStripDetVOff object for transfer by O2O.

Author
J.Cole modified by Marco De Mattia

Definition at line 39 of file SiStripDetVOffBuilder.h.

Member Typedef Documentation

typedef std::vector< std::pair< std::vector<uint32_t>,coral::TimeStamp> > SiStripDetVOffBuilder::DetIdTimeStampVector
private

Definition at line 77 of file SiStripDetVOffBuilder.h.

Constructor & Destructor Documentation

SiStripDetVOffBuilder::~SiStripDetVOffBuilder ( )

Destructor.

Definition at line 80 of file SiStripDetVOffBuilder.cc.

SiStripDetVOffBuilder::SiStripDetVOffBuilder ( const edm::ParameterSet pset,
const edm::ActivityRegistry  
)

Default constructor.

Definition at line 6 of file SiStripDetVOffBuilder.cc.

Member Function Documentation

void SiStripDetVOffBuilder::BuildDetVOffObj ( )

Build the SiStripDetVOff object for transfer.

Definition at line 90 of file SiStripDetVOffBuilder.cc.

void SiStripDetVOffBuilder::buildPSUdetIdMap ( TimesAndValues tStruct,
DetIdListTimeAndStatus dStruct 
)
private

Definition at line 717 of file SiStripDetVOffBuilder.cc.

void SiStripDetVOffBuilder::discardIOVs ( std::vector< std::pair< SiStripDetVOff *, cond::Time_t > >::iterator &  it,
std::vector< std::pair< SiStripDetVOff *, cond::Time_t > >::iterator &  initialIt,
std::vector< std::pair< SiStripDetVOff *, cond::Time_t > > &  resultVec,
const bool  last,
const unsigned int  first 
)

Removes IOVs as dictated by reduction.

Definition at line 519 of file SiStripDetVOffBuilder.cc.

pair< int, int > SiStripDetVOffBuilder::extractDetIdVector ( const unsigned int  i,
SiStripDetVOff modV,
DetIdListTimeAndStatus detIdStruct 
)
private

Definition at line 1189 of file SiStripDetVOffBuilder.cc.

bool SiStripDetVOffBuilder::FileExists ( std::string  filename)

Definition at line 701 of file SiStripDetVOffBuilder.cc.

cond::Time_t SiStripDetVOffBuilder::findMostRecentTimeStamp ( const std::vector< coral::TimeStamp > &  coralDate)
private

Definition at line 465 of file SiStripDetVOffBuilder.cc.

int SiStripDetVOffBuilder::findSetting ( uint32_t  id,
const coral::TimeStamp &  changeDate,
const std::vector< uint32_t > &  settingID,
const std::vector< coral::TimeStamp > &  settingDate 
)
private

Returns the PSU channel setting, based on date. Works from DP ID.

Definition at line 309 of file SiStripDetVOffBuilder.cc.

int SiStripDetVOffBuilder::findSetting ( std::string  dpname,
const coral::TimeStamp &  changeDate,
const std::vector< std::string > &  settingDpname,
const std::vector< coral::TimeStamp > &  settingDate 
)
private

Returns the PSU channel setting, based on date. Works from PSU channel name. Overloaded.

Definition at line 335 of file SiStripDetVOffBuilder.cc.

cond::Time_t SiStripDetVOffBuilder::getCondTime ( const coral::TimeStamp &  coralTime)
private

Utility code to convert a coral timestamp to the correct time format for O2O timestamp.

Definition at line 423 of file SiStripDetVOffBuilder.cc.

coral::TimeStamp SiStripDetVOffBuilder::getCoralTime ( cond::Time_t  iovTime)
private

Utility code to convert an O2O timestamp into a coral timestamp.

Definition at line 434 of file SiStripDetVOffBuilder.cc.

std::vector< std::pair<SiStripDetVOff*,cond::Time_t> > SiStripDetVOffBuilder::getModulesVOff ( )
inline

Return modules Off vector of objects.

Definition at line 51 of file SiStripDetVOffBuilder.h.

std::vector< std::vector<uint32_t> > SiStripDetVOffBuilder::getPayloadStats ( )
inline

Return statistics about payloads transferred for storage in logDB.

Definition at line 56 of file SiStripDetVOffBuilder.h.

void SiStripDetVOffBuilder::lastValue ( TimesAndValues tStruct)
private

Definition at line 607 of file SiStripDetVOffBuilder.cc.

void SiStripDetVOffBuilder::lastValueFromFile ( TimesAndValues tStruct)
private

Definition at line 642 of file SiStripDetVOffBuilder.cc.

void SiStripDetVOffBuilder::printPar ( std::stringstream &  ss,
const std::vector< int > &  par 
)
private

Definition at line 84 of file SiStripDetVOffBuilder.cc.

void SiStripDetVOffBuilder::readLastValueFromFile ( std::vector< uint32_t > &  dpIDs,
std::vector< float > &  vmonValues,
std::vector< coral::TimeStamp > &  dateChange 
)
private

Extract the lastValue values from file rather than from the PVSS cond DB.

Definition at line 361 of file SiStripDetVOffBuilder.cc.

void SiStripDetVOffBuilder::reduce ( std::vector< std::pair< SiStripDetVOff *, cond::Time_t > >::iterator &  it,
std::vector< std::pair< SiStripDetVOff *, cond::Time_t > >::iterator &  initialIt,
std::vector< std::pair< SiStripDetVOff *, cond::Time_t > > &  resultVec,
const bool  last = false 
)

Operates the reduction of the fast sequences of ramping up and down of the voltages.

Definition at line 486 of file SiStripDetVOffBuilder.cc.

void SiStripDetVOffBuilder::reduction ( const uint32_t  deltaTmin,
const uint32_t  maxIOVlength 
)

Definition at line 540 of file SiStripDetVOffBuilder.cc.

void SiStripDetVOffBuilder::removeDuplicates ( std::vector< uint32_t > &  vec)
private

Utility code to remove all the duplicates from a vector of uint32_t.

Definition at line 454 of file SiStripDetVOffBuilder.cc.

void SiStripDetVOffBuilder::setLastSiStripDetVOff ( SiStripDetVOff lastPayload,
cond::Time_t  lastTimeStamp 
)

Store the last payload transferred to DB as starting point for creation of new object list. ONLY WORKS FOR STATUSCHANGE OPTION.

Definition at line 460 of file SiStripDetVOffBuilder.cc.

void SiStripDetVOffBuilder::setPayloadStats ( const uint32_t  afterV,
const uint32_t  numAdded,
const uint32_t  numRemoved 
)
private

Definition at line 1180 of file SiStripDetVOffBuilder.cc.

void SiStripDetVOffBuilder::statusChange ( cond::Time_t lastTime,
TimesAndValues tStruct 
)
private

Definition at line 584 of file SiStripDetVOffBuilder.cc.

string SiStripDetVOffBuilder::timeToStream ( const coral::TimeStamp &  coralTime,
const string &  comment = "" 
)
private

Definition at line 689 of file SiStripDetVOffBuilder.cc.

string SiStripDetVOffBuilder::timeToStream ( const cond::Time_t condTime,
const string &  comment = "" 
)
private

Definition at line 682 of file SiStripDetVOffBuilder.cc.

Friends And Related Function Documentation

friend class TestSiStripDetVOffBuilder
friend

Definition at line 41 of file SiStripDetVOffBuilder.h.

Member Data Documentation

std::string SiStripDetVOffBuilder::authenticationPath
private

Definition at line 123 of file SiStripDetVOffBuilder.h.

std::auto_ptr<SiStripCoralIface> SiStripDetVOffBuilder::coralInterface
private

Definition at line 173 of file SiStripDetVOffBuilder.h.

bool SiStripDetVOffBuilder::debug_
private

Definition at line 128 of file SiStripDetVOffBuilder.h.

uint32_t SiStripDetVOffBuilder::deltaTmin_
private

Definition at line 131 of file SiStripDetVOffBuilder.h.

std::string SiStripDetVOffBuilder::detIdListFile_
private

Definition at line 133 of file SiStripDetVOffBuilder.h.

std::string SiStripDetVOffBuilder::excludedDetIdListFile_
private

Definition at line 134 of file SiStripDetVOffBuilder.h.

bool SiStripDetVOffBuilder::fromFile
private

Definition at line 126 of file SiStripDetVOffBuilder.h.

double SiStripDetVOffBuilder::highVoltageOnThreshold_
private

Definition at line 136 of file SiStripDetVOffBuilder.h.

std::pair<SiStripDetVOff *, cond::Time_t> SiStripDetVOffBuilder::lastStoredCondObj
private

Definition at line 119 of file SiStripDetVOffBuilder.h.

std::string SiStripDetVOffBuilder::lastValueFileName
private

Definition at line 125 of file SiStripDetVOffBuilder.h.

uint32_t SiStripDetVOffBuilder::maxIOVlength_
private

Definition at line 131 of file SiStripDetVOffBuilder.h.

std::vector< std::pair<SiStripDetVOff*,cond::Time_t> > SiStripDetVOffBuilder::modulesOff
private

Definition at line 118 of file SiStripDetVOffBuilder.h.

std::string SiStripDetVOffBuilder::onlineDbConnectionString
private

Definition at line 122 of file SiStripDetVOffBuilder.h.

std::vector< std::vector<uint32_t> > SiStripDetVOffBuilder::payloadStats
private

Definition at line 117 of file SiStripDetVOffBuilder.h.

std::string SiStripDetVOffBuilder::psuDetIdMapFile_
private

Definition at line 127 of file SiStripDetVOffBuilder.h.

std::vector<int> SiStripDetVOffBuilder::tDefault
private

Definition at line 130 of file SiStripDetVOffBuilder.h.

coral::TimeStamp SiStripDetVOffBuilder::tmax
private

Definition at line 129 of file SiStripDetVOffBuilder.h.

std::vector<int> SiStripDetVOffBuilder::tmax_par
private

Definition at line 130 of file SiStripDetVOffBuilder.h.

coral::TimeStamp SiStripDetVOffBuilder::tmin
private

Definition at line 129 of file SiStripDetVOffBuilder.h.

std::vector<int> SiStripDetVOffBuilder::tmin_par
private

Definition at line 130 of file SiStripDetVOffBuilder.h.

std::vector<int> SiStripDetVOffBuilder::tset_par
private

Definition at line 130 of file SiStripDetVOffBuilder.h.

coral::TimeStamp SiStripDetVOffBuilder::tsetmin
private

Definition at line 129 of file SiStripDetVOffBuilder.h.

bool SiStripDetVOffBuilder::whichQuery
private

Definition at line 80 of file SiStripDetVOffBuilder.h.

std::string SiStripDetVOffBuilder::whichTable
private

Definition at line 124 of file SiStripDetVOffBuilder.h.