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 Attributes | Private Attributes
LMFColoredTable Class Referenceabstract

#include <LMFColoredTable.h>

Inheritance diagram for LMFColoredTable:
LMFDat LMFUnique IUniqueDBObject IDBObject LMFClsDat LMFLaserPulseDat LMFPnPrimDat LMFPrimDat

Public Member Functions

std::string getColor () const
 
virtual std::string getSystem () const
 
virtual std::string getTableName () const =0
 
int getVmax (EcalLogicID &id)
 
int getVmin (EcalLogicID &id)
 
 LMFColoredTable ()
 
 LMFColoredTable (EcalDBConnection *c)
 
 LMFColoredTable (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
LMFColoredTablesetColor (int color)
 
LMFColoredTablesetColor (std::string color)
 
virtual LMFColoredTablesetSystem (int system)
 
virtual LMFColoredTablesetSystem (std::string s)
 
LMFColoredTablesetVersions (EcalLogicID &id, int vmin, int vmax)
 
LMFColoredTablesetVmax (EcalLogicID &id, int v)
 
LMFColoredTablesetVmin (EcalLogicID &id, int v)
 
int writeDB () throw (std::runtime_error)
 
 ~LMFColoredTable ()
 
- Public Member Functions inherited from LMFDat
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 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 Attributes

int m_color
 
int m_system
 
- Protected Attributes inherited from LMFDat
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
 

Private Attributes

std::map< int, std::string > COLOR
 
std::map< int, std::string > SYSTEM
 

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
 
- Protected Member Functions inherited from LMFDat
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)
 

Detailed Description

LMF_YYYY_XXX_ZZZ interface ^ ^ ^ | | | | | - table | _____ color -------— system

Definition at line 20 of file LMFColoredTable.h.

Constructor & Destructor Documentation

LMFColoredTable::LMFColoredTable ( )

Definition at line 3 of file LMFColoredTable.cc.

References COLOR, LMFUnique::m_className, m_color, m_system, and SYSTEM.

3  : LMFDat() {
4  m_className = "LMFColoredTable";
5  m_system = 0;
6  m_color = 0;
7  COLOR[0] = "BLUE";
8  COLOR[1] = "GREEN";
9  COLOR[2] = "ORANGE";
10  COLOR[3] = "IR";
11  SYSTEM[0] = "LASER";
12  SYSTEM[1] = "LED";
13 }
std::string m_className
Definition: LMFUnique.h:99
std::map< int, std::string > COLOR
LMFDat()
Definition: LMFDat.cc:9
std::map< int, std::string > SYSTEM
LMFColoredTable::LMFColoredTable ( EcalDBConnection c)

Definition at line 15 of file LMFColoredTable.cc.

References COLOR, LMFUnique::m_className, m_color, m_system, and SYSTEM.

15  : LMFDat(c) {
16  m_className = "LMFColoredTable";
17  m_system = 0;
18  m_color = 0;
19  COLOR[0] = "BLUE";
20  COLOR[1] = "GREEN";
21  COLOR[2] = "ORANGE";
22  COLOR[3] = "IR";
23  SYSTEM[0] = "LASER";
24  SYSTEM[1] = "LED";
25 }
std::string m_className
Definition: LMFUnique.h:99
std::map< int, std::string > COLOR
LMFDat()
Definition: LMFDat.cc:9
std::map< int, std::string > SYSTEM
LMFColoredTable::LMFColoredTable ( oracle::occi::Environment *  env,
oracle::occi::Connection *  conn 
)

Definition at line 27 of file LMFColoredTable.cc.

References COLOR, LMFUnique::m_className, m_color, m_system, and SYSTEM.

28  :
29  LMFDat(env, conn) {
30  m_className = "LMFColoredTable";
31  m_system = 0;
32  m_color = 0;
33  COLOR[0] = "BLUE";
34  COLOR[1] = "GREEN";
35  COLOR[2] = "ORANGE";
36  COLOR[3] = "IR";
37  SYSTEM[0] = "LASER";
38  SYSTEM[1] = "LED";
39 }
std::string m_className
Definition: LMFUnique.h:99
std::map< int, std::string > COLOR
LMFDat()
Definition: LMFDat.cc:9
std::map< int, std::string > SYSTEM
tuple conn
Definition: results_mgr.py:53
LMFColoredTable::~LMFColoredTable ( )
inline

Definition at line 26 of file LMFColoredTable.h.

26 {}

Member Function Documentation

std::string LMFColoredTable::getColor ( ) const

Definition at line 41 of file LMFColoredTable.cc.

References COLOR, i, m_color, run_regression::ret, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by LMFLaserPulseDat::getTableName(), LMFClsDat::getTableName(), LMFPrimDat::getTableName(), LMFPnPrimDat::getTableName(), LMFClsDat::isValid(), LMFLaserPulseDat::isValid(), LMFPnPrimDat::isValid(), and LMFPrimDat::isValid().

41  {
42  std::string ret = "";
43  std::map<int, std::string>::const_iterator i = COLOR.find(m_color);
44  if (i != COLOR.end()) {
45  ret = i->second;
46  }
47  return ret;
48 }
int i
Definition: DBlmapReader.cc:9
std::map< int, std::string > COLOR
std::string LMFColoredTable::getSystem ( ) const
virtual

Reimplemented in LMFClsDat.

Definition at line 50 of file LMFColoredTable.cc.

References i, m_system, run_regression::ret, AlCaHLTBitMon_QueryRunRegistry::string, and SYSTEM.

Referenced by LMFPnPrimDat::getShapeCor(), LMFPrimDat::getTableName(), LMFPnPrimDat::getTableName(), LMFPnPrimDat::isValid(), LMFPrimDat::isValid(), and LMFPnPrimDat::setShapeCorr().

50  {
51  std::string ret = "";
52  std::map<int, std::string>::const_iterator i = SYSTEM.find(m_system);
53  if (i != SYSTEM.end()) {
54  ret = i->second;
55  }
56  return ret;
57 }
int i
Definition: DBlmapReader.cc:9
std::map< int, std::string > SYSTEM
virtual std::string LMFColoredTable::getTableName ( ) const
pure virtual

Reimplemented from LMFDat.

Implemented in LMFPnPrimDat, LMFClsDat, LMFPrimDat, and LMFLaserPulseDat.

int LMFColoredTable::getVmax ( EcalLogicID id)
inline

Definition at line 68 of file LMFColoredTable.h.

References LMFDat::getData().

68  {
69  return getData(id, "VMAX");
70  }
std::map< int, std::vector< float > > getData()
Definition: LMFDat.cc:636
int LMFColoredTable::getVmin ( EcalLogicID id)
inline

Definition at line 64 of file LMFColoredTable.h.

References LMFDat::getData().

64  {
65  return getData(id, "VMIN");
66  }
std::map< int, std::vector< float > > getData()
Definition: LMFDat.cc:636
LMFColoredTable& LMFColoredTable::setColor ( int  color)
inline

Definition at line 33 of file LMFColoredTable.h.

References COLOR, create_public_lumi_plots::color, LMFUnique::m_className, and m_color.

Referenced by LMFClsDat::LMFClsDat(), LMFLaserPulseDat::LMFLaserPulseDat(), LMFPnPrimDat::LMFPnPrimDat(), LMFPrimDat::LMFPrimDat(), and setColor().

33  {
34  if (COLOR.find(color) != COLOR.end()) {
35  m_color = color;
36  m_className += "/C=" + COLOR[color];
37  }
38  return *this;
39  }
std::string m_className
Definition: LMFUnique.h:99
std::map< int, std::string > COLOR
LMFColoredTable & LMFColoredTable::setColor ( std::string  color)

Definition at line 59 of file LMFColoredTable.cc.

References COLOR, alignCSCRings::e, i, cmsHarvester::loop, setColor(), and create_public_lumi_plots::transform.

59  {
60  std::transform(color.begin(), color.end(), color.begin(), toupper);
61  std::map<int, std::string>::const_iterator i = COLOR.begin();
62  std::map<int, std::string>::const_iterator e = COLOR.end();
63  bool loop = true;
64  while ((loop) && (i != e)) {
65  if (i->second == color) {
66  loop = false;
67  setColor(i->first);
68  }
69  i++;
70  }
71  return *this;
72 }
int i
Definition: DBlmapReader.cc:9
int loop
CMSSW
std::map< int, std::string > COLOR
LMFColoredTable & setColor(int color)
virtual LMFColoredTable& LMFColoredTable::setSystem ( int  system)
inlinevirtual

Reimplemented in LMFClsDat.

Definition at line 41 of file LMFColoredTable.h.

References LMFUnique::m_className, m_system, and SYSTEM.

Referenced by LMFLaserPulseDat::init(), LMFPrimDat::LMFPrimDat(), setSystem(), and LMFPnPrimDat::setSystem().

41  {
42  if (SYSTEM.find(system) != SYSTEM.end()) {
43  m_system = system;
44  m_className += "/S=" + SYSTEM[system];
45  }
46  return *this;
47  }
std::string m_className
Definition: LMFUnique.h:99
std::map< int, std::string > SYSTEM
LMFColoredTable & LMFColoredTable::setSystem ( std::string  s)
virtual

Reimplemented in LMFPnPrimDat, and LMFClsDat.

Definition at line 74 of file LMFColoredTable.cc.

References alignCSCRings::e, i, cmsHarvester::loop, setSystem(), SYSTEM, and create_public_lumi_plots::transform.

74  {
75  std::transform(system.begin(), system.end(), system.begin(), toupper);
76  std::map<int, std::string>::const_iterator i = SYSTEM.begin();
77  std::map<int, std::string>::const_iterator e = SYSTEM.end();
78  bool loop = true;
79  while ((loop) && (i != e)) {
80  if (i->second == system) {
81  loop = false;
82  setSystem(i->first);
83  }
84  i++;
85  }
86  return *this;
87 }
int i
Definition: DBlmapReader.cc:9
int loop
CMSSW
virtual LMFColoredTable & setSystem(int system)
std::map< int, std::string > SYSTEM
LMFColoredTable& LMFColoredTable::setVersions ( EcalLogicID id,
int  vmin,
int  vmax 
)
inline

Definition at line 58 of file LMFColoredTable.h.

References LMFDat::setData().

58  {
59  setData(id, "VMIN", vmin);
60  setData(id, "VMAX", vmax);
61  return *this;
62  }
LMFDat & setData(int logic_id, const std::vector< float > &data)
Definition: LMFDat.h:55
LMFColoredTable& LMFColoredTable::setVmax ( EcalLogicID id,
int  v 
)
inline

Definition at line 53 of file LMFColoredTable.h.

References LMFDat::setData().

53  {
54  setData(id, "VMAX", v);
55  return *this;
56  }
LMFDat & setData(int logic_id, const std::vector< float > &data)
Definition: LMFDat.h:55
LMFColoredTable& LMFColoredTable::setVmin ( EcalLogicID id,
int  v 
)
inline

Definition at line 49 of file LMFColoredTable.h.

References LMFDat::setData().

49  {
50  setData(id, "VMIN", v);
51  return *this;
52  }
LMFDat & setData(int logic_id, const std::vector< float > &data)
Definition: LMFDat.h:55
int LMFColoredTable::writeDB ( )
throw (std::runtime_error
)
virtual

Reimplemented from LMFUnique.

Definition at line 89 of file LMFColoredTable.cc.

References alignCSCRings::e, i, IDBObject::m_conn, LMFDat::m_data, run_regression::ret, alignCSCRings::s, and LMFDat::writeDB().

90  {
91  // check if the VMIN version has been properly set, otherwise
92  // change it to the default value
93  std::map<int, std::vector<float> >::iterator i = m_data.begin();
94  std::map<int, std::vector<float> >::iterator e = m_data.end();
95  std::list<int> versions; // the list of different versions
96  while (i != e) {
97  int s = i->second.size();
98  if (i->second[s - 2] == 0) { // VMIN cannot be NULL
99  i->second[s - 2] = 1;
100  }
101  versions.push_back(i->second[s - 1]);
102  versions.push_back(i->second[s - 2]);
103  versions.unique();
104  i++;
105  }
106  // checkVesrions(versions); // not yet used, in fact...
107  int ret = 0;
108  try {
109  ret = LMFDat::writeDB();
110  }
111  catch (std::runtime_error &e) {
112  m_conn->rollback();
113  throw(e);
114  }
115  return ret;
116 }
int i
Definition: DBlmapReader.cc:9
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
std::map< int, std::vector< float > > m_data
Definition: LMFDat.h:153
int writeDB()
Definition: LMFDat.cc:398

Member Data Documentation

std::map<int, std::string> LMFColoredTable::COLOR
private

Definition at line 80 of file LMFColoredTable.h.

Referenced by getColor(), LMFColoredTable(), and setColor().

int LMFColoredTable::m_color
protected
int LMFColoredTable::m_system
protected
std::map<int, std::string> LMFColoredTable::SYSTEM
private

Definition at line 81 of file LMFColoredTable.h.

Referenced by getSystem(), LMFColoredTable(), and setSystem().