CMS 3D CMS Logo

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
 
std::string getTableName () const override=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 () noexcept(false) override
 
 ~LMFColoredTable () override
 
- Public Member Functions inherited from LMFDat
void dump () const override
 
void dump (int n) const override
 
virtual void dump (int n, int max) const
 
void fetch () noexcept(false)
 
void fetch (int logic_id) noexcept(false)
 
void fetch (int logic_id, const Tm &tm) noexcept(false)
 
void fetch (int logic_id, const Tm *timestamp, int dir) noexcept(false)
 
void fetch (const EcalLogicID &id, const Tm &tm) noexcept(false)
 
void fetch (const EcalLogicID &id, const Tm &tm, int dir) noexcept(false)
 
void fetch (const EcalLogicID &id) noexcept(false)
 
std::map< int, std::vector< float > > fetchData () noexcept(false)
 
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) noexcept(false)
 
void getPrevious (LMFDat *dat) noexcept(false)
 
std::map< unsigned int, std::string > getReverseMap () const
 
Tm getSubrunStart () const
 
bool isValid () override
 
 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 () override
 
- Public Member Functions inherited from LMFUnique
void attach (std::string name, LMFUnique *u)
 
void debug ()
 
virtual bool exists ()
 
virtual boost::ptr_list< LMFUniquefetchAll () const noexcept(false)
 
int fetchID () noexcept(false) override
 
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) noexcept(false) override
 
LMFUniquesetInt (std::string key, int value)
 
LMFUniquesetString (std::string key, std::string value)
 
void startProfiling ()
 
void stopProfiling ()
 
 ~LMFUnique () override
 
- 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 () noexcept(false)
 
void getNeighbour (LMFDat *dat, int which) noexcept(false)
 
int writeDB () noexcept(false) override
 
- Protected Member Functions inherited from LMFUnique
virtual void getParameters (ResultSet *rset)
 
virtual void setClassName (std::string s)
 
virtual int writeForeignKeys () noexcept(false)
 
- Protected Member Functions inherited from IDBObject
void checkConnection () const noexcept(false)
 

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:98
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:98
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:98
std::map< int, std::string > COLOR
LMFDat()
Definition: LMFDat.cc:9
std::map< int, std::string > SYSTEM
LMFColoredTable::~LMFColoredTable ( )
inlineoverride

Member Function Documentation

std::string LMFColoredTable::getColor ( ) const

Definition at line 41 of file LMFColoredTable.cc.

References COLOR, mps_fire::i, m_color, and AlCaHLTBitMon_QueryRunRegistry::string.

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

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 }
std::map< int, std::string > COLOR
std::string LMFColoredTable::getSystem ( ) const
virtual

Reimplemented in LMFClsDat.

Definition at line 50 of file LMFColoredTable.cc.

References mps_fire::i, m_system, AlCaHLTBitMon_QueryRunRegistry::string, and SYSTEM.

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

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 }
std::map< int, std::string > SYSTEM
std::string LMFColoredTable::getTableName ( ) const
overridepure virtual

Reimplemented from LMFDat.

Implemented in LMFPnPrimDat, LMFClsDat, LMFPrimDat, and LMFLaserPulseDat.

Referenced by ~LMFColoredTable().

int LMFColoredTable::getVmax ( EcalLogicID id)
inline

Definition at line 68 of file LMFColoredTable.h.

References LMFDat::getData(), noexcept, and writeDB().

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
LMFColoredTable & LMFColoredTable::setColor ( std::string  color)

Definition at line 59 of file LMFColoredTable.cc.

References COLOR, MillePedeFileConverter_cfg::e, mps_fire::i, heppy_loop::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 }
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, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, 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:98
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 MillePedeFileConverter_cfg::e, mps_fire::i, heppy_loop::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 }
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 ( )
overridevirtualnoexcept

Reimplemented from LMFUnique.

Definition at line 89 of file LMFColoredTable.cc.

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

Referenced by getVmax().

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 }
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
int writeDB() noexcept(false) override
Definition: LMFDat.cc:398
std::map< int, std::vector< float > > m_data
Definition: LMFDat.h:152

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().