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 | Protected Attributes | Friends
LMFDat Class Reference

#include <LMFDat.h>

Inheritance diagram for LMFDat:
LMFUnique IUniqueDBObject IDBObject LMFColoredTable LMFCorrCoefDatComponent LMFLaserConfigDat LMFRunDat LMFTestPulseConfigDat LMFClsDat LMFLaserPulseDat LMFPnPrimDat LMFPrimDat

Public Member Functions

void dump () const
 
void dump (int n) const
 
virtual void dump (int n, int max) const
 
void fetch () throw (std::runtime_error)
 
void fetch (int logic_id) throw (std::runtime_error)
 
void fetch (int logic_id, const Tm &tm) throw (std::runtime_error)
 
void fetch (int logic_id, const Tm *timestamp, int dir) throw (std::runtime_error)
 
void fetch (const EcalLogicID &id, const Tm &tm) throw (std::runtime_error)
 
void fetch (const EcalLogicID &id, const Tm &tm, int dir) throw (std::runtime_error)
 
void fetch (const EcalLogicID &id) throw (std::runtime_error)
 
std::map< int, std::vector
< float > > 
fetchData () throw (std::runtime_error)
 
virtual std::string foreignKeyName () const
 
std::vector< float > getData (int id)
 
std::vector< float > getData (const EcalLogicID &id)
 
bool getData (int id, std::vector< float > &ret)
 
bool getData (const EcalLogicID &id, std::vector< float > &ret)
 
std::map< int, std::vector
< float > > 
getData ()
 
float getData (int id, unsigned int k)
 
float getData (const EcalLogicID &id, unsigned int k)
 
float getData (const EcalLogicID &id, const std::string &key)
 
float getData (int id, const std::string &key)
 
bool getData (int id, unsigned int k, float &ret)
 
bool getData (const EcalLogicID &id, unsigned int k, float &ret)
 
bool getData (int id, const std::string &key, float &ret)
 
bool getData (const EcalLogicID &id, const std::string &key, float &ret)
 
virtual std::string getIovIdFieldName () const
 
std::list< std::string > getKeyList ()
 
std::map< std::string,
unsigned int > 
getKeys ()
 
LMFRunIOV getLMFRunIOV () const
 
int getLMFRunIOVID ()
 
std::list< int > getLogicIds ()
 
void getNext (LMFDat *dat) throw (std::runtime_error)
 
void getPrevious (LMFDat *dat) throw (std::runtime_error)
 
std::map< unsigned int,
std::string > 
getReverseMap () const
 
Tm getSubrunStart () const
 
virtual std::string getTableName () const
 
virtual bool isValid ()
 
 LMFDat ()
 
 LMFDat (EcalDBConnection *c)
 
 LMFDat (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
std::vector< float > operator[] (int id)
 
LMFDatsetData (int logic_id, const std::vector< float > &data)
 
LMFDatsetData (const EcalLogicID &logic_id, const std::vector< float > &data)
 
LMFDatsetData (const EcalLogicID &logic_id, const std::string &key, float v)
 
LMFDatsetLMFRunIOV (const LMFRunIOV &iov)
 
LMFDatsetMaxDataToDump (int n)
 
void setWhereClause (std::string w)
 
void setWhereClause (std::string w, const std::vector< std::string > &p)
 
int size () const
 
 ~LMFDat ()
 
- Public Member Functions inherited from LMFUnique
void attach (std::string name, LMFUnique *u)
 
void debug ()
 
virtual bool exists ()
 
virtual boost::ptr_list
< LMFUnique
fetchAll () const throw (std::runtime_error)
 
int fetchID () throw (std::runtime_error)
 
std::string getClassName ()
 
std::string getClassName () const
 
int getID () const
 
int getInt (std::string fieldname) const
 
std::string getString (std::string fieldname) const
 
virtual bool isValid () const
 
 LMFUnique ()
 
 LMFUnique (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
 LMFUnique (EcalDBConnection *c)
 
void nodebug ()
 
virtual bool operator< (const LMFUnique &r)
 
virtual bool operator<= (const LMFUnique &r)
 
std::string sequencePostfix (const Tm &t)
 
void setByID (int id) throw (std::runtime_error)
 
LMFUniquesetInt (std::string key, int value)
 
LMFUniquesetString (std::string key, std::string value)
 
void startProfiling ()
 
void stopProfiling ()
 
virtual ~LMFUnique ()
 
- Public Member Functions inherited from IDBObject
oracle::occi::Connection * getConn () const
 
oracle::occi::Environment * getEnv () const
 
void setConnection (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
virtual ~IDBObject ()
 

Protected Member Functions

void adjustParameters (int n, std::string &sql, Statement *stmt)
 
std::string buildInsertSql ()
 
std::string buildSelectSql (int logic_id=0, int direction=0)
 
bool check ()
 
void getKeyTypes () throw (std::runtime_error)
 
void getNeighbour (LMFDat *dat, int which) throw (std::runtime_error)
 
int writeDB () throw (std::runtime_error)
 
- Protected Member Functions inherited from LMFUnique
virtual void setClassName (std::string s)
 
virtual int writeForeignKeys () throw (std::runtime_error)
 
- Protected Member Functions inherited from IDBObject
void checkConnection () const throw (std::runtime_error)
 

Protected Attributes

std::string _where
 
std::vector< std::string > _wherePars
 
std::map< int, std::vector
< float > > 
m_data
 
std::string m_Error
 
std::map< std::string,
unsigned int > 
m_keys
 
int m_max
 
std::string m_tableName
 
std::vector< std::string > m_type
 
- Protected Attributes inherited from LMFUnique
bool _profiling
 
std::string m_className
 
char m_debug
 
std::map< std::string,
LMFUnique * > 
m_foreignKeys
 
std::map< std::string, int > m_intFields
 
std::map< std::string,
std::string > 
m_stringFields
 
- Protected Attributes inherited from IUniqueDBObject
int m_ID
 
- Protected Attributes inherited from IDBObject
oracle::occi::Connection * m_conn
 
oracle::occi::Environment * m_env
 

Friends

class EcalCondDBInterface
 

Additional Inherited Members

- Public Types inherited from LMFUnique
typedef oracle::occi::ResultSet ResultSet
 
typedef oracle::occi::Statement Statement
 
- Static Public Attributes inherited from IDBObject
static int const ECALDB_NROWS =1024
 

Detailed Description

Data Tables for LMF Runs

Definition at line 19 of file LMFDat.h.

Constructor & Destructor Documentation

LMFDat::LMFDat ( )

Definition at line 9 of file LMFDat.cc.

LMFDat::LMFDat ( EcalDBConnection c)

Definition at line 16 of file LMFDat.cc.

LMFDat::LMFDat ( oracle::occi::Environment *  env,
oracle::occi::Connection *  conn 
)

Definition at line 23 of file LMFDat.cc.

LMFDat::~LMFDat ( )
inline

Definition at line 27 of file LMFDat.h.

27 { }

Member Function Documentation

void LMFDat::adjustParameters ( int  n,
std::string &  sql,
Statement stmt 
)
protected

Definition at line 255 of file LMFDat.cc.

std::string LMFDat::buildInsertSql ( )
protected

Definition at line 103 of file LMFDat.cc.

std::string LMFDat::buildSelectSql ( int  logic_id = 0,
int  direction = 0 
)
protected

Definition at line 139 of file LMFDat.cc.

bool LMFDat::check ( void  )
protected

Definition at line 576 of file LMFDat.cc.

void LMFDat::dump ( void  ) const
virtual

Reimplemented from LMFUnique.

Definition at line 68 of file LMFDat.cc.

void LMFDat::dump ( int  n) const
virtual

Reimplemented from LMFUnique.

Definition at line 72 of file LMFDat.cc.

void LMFDat::dump ( int  n,
int  max 
) const
virtual

Definition at line 76 of file LMFDat.cc.

void LMFDat::fetch ( )
throw (std::runtime_error
)

Definition at line 237 of file LMFDat.cc.

void LMFDat::fetch ( int  logic_id)
throw (std::runtime_error
)

Definition at line 243 of file LMFDat.cc.

void LMFDat::fetch ( int  logic_id,
const Tm tm 
)
throw (std::runtime_error
)

Definition at line 249 of file LMFDat.cc.

void LMFDat::fetch ( int  logic_id,
const Tm timestamp,
int  dir 
)
throw (std::runtime_error
)

Definition at line 281 of file LMFDat.cc.

void LMFDat::fetch ( const EcalLogicID id,
const Tm tm 
)
throw (std::runtime_error
)

Definition at line 224 of file LMFDat.cc.

void LMFDat::fetch ( const EcalLogicID id,
const Tm tm,
int  dir 
)
throw (std::runtime_error
)

Definition at line 230 of file LMFDat.cc.

void LMFDat::fetch ( const EcalLogicID id)
throw (std::runtime_error
)

Definition at line 218 of file LMFDat.cc.

std::map< int, std::vector< float > > LMFDat::fetchData ( )
throw (std::runtime_error
)

Definition at line 352 of file LMFDat.cc.

std::string LMFDat::foreignKeyName ( ) const
virtual

Reimplemented in LMFCorrCoefDatComponent.

Definition at line 31 of file LMFDat.cc.

Referenced by getLMFRunIOV(), and setLMFRunIOV().

std::vector< float > LMFDat::getData ( int  id)

Definition at line 603 of file LMFDat.cc.

std::vector< float > LMFDat::getData ( const EcalLogicID id)

Definition at line 615 of file LMFDat.cc.

bool LMFDat::getData ( int  id,
std::vector< float > &  ret 
)

Definition at line 621 of file LMFDat.cc.

bool LMFDat::getData ( const EcalLogicID id,
std::vector< float > &  ret 
)

Definition at line 630 of file LMFDat.cc.

std::map< int, std::vector< float > > LMFDat::getData ( void  )
float LMFDat::getData ( int  id,
unsigned int  k 
)

Definition at line 642 of file LMFDat.cc.

float LMFDat::getData ( const EcalLogicID id,
unsigned int  k 
)

Definition at line 646 of file LMFDat.cc.

float LMFDat::getData ( const EcalLogicID id,
const std::string &  key 
)

Definition at line 650 of file LMFDat.cc.

float LMFDat::getData ( int  id,
const std::string &  key 
)

Definition at line 654 of file LMFDat.cc.

bool LMFDat::getData ( int  id,
unsigned int  k,
float &  ret 
)

Definition at line 660 of file LMFDat.cc.

bool LMFDat::getData ( const EcalLogicID id,
unsigned int  k,
float &  ret 
)

Definition at line 673 of file LMFDat.cc.

bool LMFDat::getData ( int  id,
const std::string &  key,
float &  ret 
)

Definition at line 677 of file LMFDat.cc.

bool LMFDat::getData ( const EcalLogicID id,
const std::string &  key,
float &  ret 
)

Definition at line 685 of file LMFDat.cc.

std::string LMFDat::getIovIdFieldName ( ) const
virtual

Reimplemented in LMFCorrCoefDatComponent.

Definition at line 119 of file LMFDat.cc.

std::list<std::string> LMFDat::getKeyList ( )
inline

Definition at line 113 of file LMFDat.h.

References alignCSCRings::e, i, cmsLHEtoEOSManager::l, and m_keys.

113  {
114  std::list<std::string> l;
115  std::map<std::string, unsigned int>::const_iterator i = m_keys.begin();
116  std::map<std::string, unsigned int>::const_iterator e = m_keys.end();
117  while (i != e) {
118  l.push_back(i->first);
119  i++;
120  }
121  return l;
122  }
int i
Definition: DBlmapReader.cc:9
std::map< std::string, unsigned int > m_keys
Definition: LMFDat.h:155
std::map<std::string, unsigned int> LMFDat::getKeys ( )
inline

Definition at line 110 of file LMFDat.h.

References m_keys.

110  {
111  return m_keys;
112  }
std::map< std::string, unsigned int > m_keys
Definition: LMFDat.h:155
void LMFDat::getKeyTypes ( )
throw (std::runtime_error
)
protected

Definition at line 542 of file LMFDat.cc.

LMFRunIOV LMFDat::getLMFRunIOV ( ) const
inline

Definition at line 36 of file LMFDat.h.

References foreignKeyName(), LMFUnique::getInt(), IDBObject::m_conn, IDBObject::m_env, and LMFUnique::setByID().

Referenced by getSubrunStart().

36  {
37  LMFRunIOV runiov(m_env, m_conn);
38  runiov.setByID(getInt(foreignKeyName()));
39  return runiov;
40  }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:203
virtual std::string foreignKeyName() const
Definition: LMFDat.cc:31
int LMFDat::getLMFRunIOVID ( )

Definition at line 35 of file LMFDat.cc.

std::list<int> LMFDat::getLogicIds ( )
inline

Definition at line 99 of file LMFDat.h.

References alignCSCRings::e, i, cmsLHEtoEOSManager::l, and m_data.

99  {
100  std::list<int> l;
101  std::map<int, std::vector<float> >::const_iterator i = m_data.begin();
102  std::map<int, std::vector<float> >::const_iterator e = m_data.end();
103  while (i != e) {
104  l.push_back(i->first);
105  i++;
106  }
107  return l;
108  }
int i
Definition: DBlmapReader.cc:9
std::map< int, std::vector< float > > m_data
Definition: LMFDat.h:153
void LMFDat::getNeighbour ( LMFDat dat,
int  which 
)
throw (std::runtime_error
)
protected

Definition at line 200 of file LMFDat.cc.

void LMFDat::getNext ( LMFDat dat)
throw (std::runtime_error
)

Definition at line 194 of file LMFDat.cc.

void LMFDat::getPrevious ( LMFDat dat)
throw (std::runtime_error
)

Definition at line 188 of file LMFDat.cc.

std::map< unsigned int, std::string > LMFDat::getReverseMap ( ) const

Definition at line 57 of file LMFDat.cc.

Tm LMFDat::getSubrunStart ( ) const
inline

Definition at line 42 of file LMFDat.h.

References getLMFRunIOV(), and LMFRunIOV::getSubRunStart().

42  {
43  return getLMFRunIOV().getSubRunStart();
44  }
Tm getSubRunStart() const
Definition: LMFRunIOV.cc:161
LMFRunIOV getLMFRunIOV() const
Definition: LMFDat.h:36
virtual std::string LMFDat::getTableName ( ) const
inlinevirtual

Reimplemented in LMFCorrCoefDatComponent, LMFPnPrimDat, LMFClsDat, LMFPrimDat, LMFLaserPulseDat, and LMFColoredTable.

Definition at line 49 of file LMFDat.h.

References m_tableName.

49  {
50  return m_tableName;
51  }
std::string m_tableName
Definition: LMFDat.h:156
bool LMFDat::isValid ( void  )
virtual

Reimplemented from LMFUnique.

Reimplemented in LMFPrimDat, LMFPnPrimDat, LMFLaserPulseDat, and LMFClsDat.

Definition at line 339 of file LMFDat.cc.

Referenced by LMFLaserPulseDat::isValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

std::vector< float > LMFDat::operator[] ( int  id)

Definition at line 611 of file LMFDat.cc.

LMFDat& LMFDat::setData ( int  logic_id,
const std::vector< float > &  data 
)
inline

Definition at line 55 of file LMFDat.h.

References data, and m_data.

Referenced by LMFRunDat::Data(), LMFTestPulseConfigDat::setDACMGPA(), LMFRunDat::setData(), LMFTestPulseConfigDat::setData(), LMFLaserConfigDat::setData(), LMFClsDat::setENorm(), LMFRunDat::setEvents(), LMFLaserPulseDat::setFitMethod(), LMFCorrCoefDatComponent::setFlag(), LMFClsDat::setFlag(), LMFClsDat::setFlagNorm(), LMFClsDat::setLMFRefRunIOVID(), LMFLaserConfigDat::setLSRAttenuator(), LMFLaserConfigDat::setLSRCurrent(), LMFLaserConfigDat::setLSRDelay1(), LMFLaserConfigDat::setLSRDelay2(), LMFLaserConfigDat::setLSRPower(), LMFClsDat::setMean(), LMFLaserPulseDat::setMTQAmplification(), LMFLaserPulseDat::setMTQFW20(), LMFLaserPulseDat::setMTQFW80(), LMFLaserPulseDat::setMTQFWHM(), LMFLaserPulseDat::setMTQRise(), LMFLaserPulseDat::setMTQSliding(), LMFLaserPulseDat::setMTQTime(), LMFClsDat::setNevt(), LMFClsDat::setNorm(), LMFCorrCoefDatComponent::setP123(), LMFCorrCoefDatComponent::setP123Errors(), LMFTestPulseConfigDat::setPNGain(), LMFLaserConfigDat::setPNGain(), LMFTestPulseConfigDat::setPNVinj(), LMFRunDat::setQualityFlag(), LMFClsDat::setRMS(), LMFCorrCoefDatComponent::setSequence(), LMFColoredTable::setVersions(), LMFTestPulseConfigDat::setVFEGain(), LMFLaserConfigDat::setVFEGain(), LMFColoredTable::setVmax(), LMFColoredTable::setVmin(), and LMFLaserConfigDat::setWavelength().

55  {
56  m_data[logic_id] = data;
57  return *this;
58  }
std::map< int, std::vector< float > > m_data
Definition: LMFDat.h:153
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
LMFDat& LMFDat::setData ( const EcalLogicID logic_id,
const std::vector< float > &  data 
)
inline

Definition at line 59 of file LMFDat.h.

References data, EcalLogicID::getLogicID(), and m_data.

60  {
61  m_data[logic_id.getLogicID()] = data;
62  return *this;
63  }
std::map< int, std::vector< float > > m_data
Definition: LMFDat.h:153
int getLogicID() const
Definition: EcalLogicID.cc:41
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
LMFDat& LMFDat::setData ( const EcalLogicID logic_id,
const std::string &  key,
float  v 
)
inline

Definition at line 64 of file LMFDat.h.

References EcalLogicID::getLogicID(), relval_steps::key, m_data, m_keys, and findQualityFiles::v.

65  {
66  int id = logic_id.getLogicID();
67  m_data[id].resize(m_keys.size());
68  m_data[id][m_keys[key]] = v;
69  return *this;
70  }
std::map< int, std::vector< float > > m_data
Definition: LMFDat.h:153
int getLogicID() const
Definition: EcalLogicID.cc:41
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
std::map< std::string, unsigned int > m_keys
Definition: LMFDat.h:155
LMFDat& LMFDat::setLMFRunIOV ( const LMFRunIOV iov)
inline

Definition at line 31 of file LMFDat.h.

References LMFUnique::attach(), foreignKeyName(), LMFUnique::getID(), and LMFUnique::setInt().

31  {
32  setInt(foreignKeyName(), iov.getID());
33  attach(foreignKeyName(), (LMFUnique*)&iov);
34  return *this;
35  }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:33
int getID() const
Definition: LMFUnique.h:52
virtual std::string foreignKeyName() const
Definition: LMFDat.cc:31
void attach(std::string name, LMFUnique *u)
Definition: LMFUnique.cc:50
LMFDat & LMFDat::setMaxDataToDump ( int  n)

Definition at line 52 of file LMFDat.cc.

void LMFDat::setWhereClause ( std::string  w)

Definition at line 123 of file LMFDat.cc.

void LMFDat::setWhereClause ( std::string  w,
const std::vector< std::string > &  p 
)

Definition at line 128 of file LMFDat.cc.

int LMFDat::size ( void  ) const
inline

Definition at line 71 of file LMFDat.h.

References m_data.

71 { return m_data.size(); }
std::map< int, std::vector< float > > m_data
Definition: LMFDat.h:153
int LMFDat::writeDB ( )
throw (std::runtime_error
)
protectedvirtual

Reimplemented from LMFUnique.

Definition at line 398 of file LMFDat.cc.

Referenced by LMFCorrCoefDatComponent::writeDB(), and LMFColoredTable::writeDB().

Friends And Related Function Documentation

friend class EcalCondDBInterface
friend

Definition at line 21 of file LMFDat.h.

Member Data Documentation

std::string LMFDat::_where
protected

Definition at line 159 of file LMFDat.h.

std::vector<std::string> LMFDat::_wherePars
protected

Definition at line 160 of file LMFDat.h.

std::map<int, std::vector<float> > LMFDat::m_data
protected

Definition at line 153 of file LMFDat.h.

Referenced by getLogicIds(), setData(), size(), and LMFColoredTable::writeDB().

std::string LMFDat::m_Error
protected

Definition at line 157 of file LMFDat.h.

Referenced by LMFClsDat::isValid(), and LMFLaserPulseDat::isValid().

std::map<std::string, unsigned int> LMFDat::m_keys
protected
int LMFDat::m_max
protected

Definition at line 149 of file LMFDat.h.

std::string LMFDat::m_tableName
protected
std::vector<std::string> LMFDat::m_type
protected