CMS 3D CMS Logo

Public Member Functions | Private Member Functions

LMFPnPrimDat Class Reference

#include <LMFPnPrimDat.h>

Inheritance diagram for LMFPnPrimDat:
LMFColoredTable LMFDat LMFUnique IUniqueDBObject IDBObject

List of all members.

Public Member Functions

int getFlag (EcalLogicID &id)
int getFlag (int id)
float getM3 (int id)
float getM3 (EcalLogicID &id)
float getMean (int id)
float getMean (EcalLogicID &id)
float getPNAoverBM3 (int id)
float getPNAoverBM3 (EcalLogicID &id)
float getPNAoverBMean (int id)
float getPNAoverBMean (EcalLogicID &id)
float getPNAoverBRMS (int id)
float getPNAoverBRMS (EcalLogicID &id)
float getRMS (int id)
float getRMS (EcalLogicID &id)
float getShapeCor (int id)
float getShapeCor (EcalLogicID &id)
std::string getTableName () const
bool isValid ()
 LMFPnPrimDat (int color, std::string system)
 LMFPnPrimDat (std::string color, std::string system)
 LMFPnPrimDat (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 LMFPnPrimDat (oracle::occi::Environment *env, oracle::occi::Connection *conn, int color, std::string system)
 LMFPnPrimDat (oracle::occi::Environment *env, oracle::occi::Connection *conn, std::string color, std::string system)
 LMFPnPrimDat (EcalDBConnection *c, int color, std::string system)
 LMFPnPrimDat (EcalDBConnection *c)
 LMFPnPrimDat ()
 LMFPnPrimDat (EcalDBConnection *c, std::string color, std::string system)
 LMFPnPrimDat (EcalDBConnection *c, std::string color, std::string system, bool debug)
LMFPnPrimDatsetFlag (EcalLogicID &id, int v)
LMFPnPrimDatsetM3 (EcalLogicID &id, float v)
LMFPnPrimDatsetMean (EcalLogicID &id, float v)
LMFPnPrimDatsetPN (EcalLogicID &id, float mean, float rms, float m3)
LMFPnPrimDatsetPNAoverB (EcalLogicID &id, float mean, float rms, float m3)
LMFPnPrimDatsetPNAoverBM3 (EcalLogicID &id, float v)
LMFPnPrimDatsetPNAoverBMean (EcalLogicID &id, float v)
LMFPnPrimDatsetPNAoverBRMS (EcalLogicID &id, float v)
LMFPnPrimDatsetRMS (EcalLogicID &id, float v)
LMFPnPrimDatsetShapeCorr (EcalLogicID &id, float mean)
LMFPnPrimDatsetSystem (std::string s)
 ~LMFPnPrimDat ()

Private Member Functions

void init ()

Detailed Description

LMF_YYYY_XXX_PN_PRIM_DAT interface ^ ^ | | | color \---------- system

Definition at line 19 of file LMFPnPrimDat.h.


Constructor & Destructor Documentation

LMFPnPrimDat::LMFPnPrimDat ( )

Definition at line 3 of file LMFPnPrimDat.cc.

References init().

                           : LMFColoredTable() {
  init();
}
LMFPnPrimDat::LMFPnPrimDat ( oracle::occi::Environment *  env,
oracle::occi::Connection *  conn 
)

Definition at line 7 of file LMFPnPrimDat.cc.

References init().

                                                     : 
  LMFColoredTable(env, conn) {
  init();
}
LMFPnPrimDat::LMFPnPrimDat ( EcalDBConnection c)

Definition at line 13 of file LMFPnPrimDat.cc.

References init().

                                              : LMFColoredTable(c) {
  init();
}
LMFPnPrimDat::LMFPnPrimDat ( std::string  color,
std::string  system 
)

Definition at line 17 of file LMFPnPrimDat.cc.

References init(), LMFColoredTable::setColor(), and setSystem().

                                                            : 
  LMFColoredTable() {
  init();
  setColor(color);
  setSystem(system);
}
LMFPnPrimDat::LMFPnPrimDat ( oracle::occi::Environment *  env,
oracle::occi::Connection *  conn,
std::string  color,
std::string  system 
)

Definition at line 24 of file LMFPnPrimDat.cc.

References init(), LMFColoredTable::setColor(), and setSystem().

                                                            : 
  LMFColoredTable(env, conn) {
  init();
  setColor(color);
  setSystem(system);
}
LMFPnPrimDat::LMFPnPrimDat ( EcalDBConnection c,
std::string  color,
std::string  system 
)

Definition at line 43 of file LMFPnPrimDat.cc.

References init(), LMFColoredTable::setColor(), and setSystem().

                                             : LMFColoredTable(c) {
  init();
  setColor(color);
  setSystem(system);
}
LMFPnPrimDat::LMFPnPrimDat ( EcalDBConnection c,
std::string  color,
std::string  system,
bool  debug 
)

Definition at line 33 of file LMFPnPrimDat.cc.

References LMFUnique::debug(), init(), LMFColoredTable::setColor(), and setSystem().

                                                     : LMFColoredTable(c) {
  if (d) {
    debug();
  }
  init();
  setColor(color);
  setSystem(system);
}
LMFPnPrimDat::LMFPnPrimDat ( int  color,
std::string  system 
)

Definition at line 50 of file LMFPnPrimDat.cc.

References init(), LMFColoredTable::setColor(), and setSystem().

                                                      : 
  LMFColoredTable() {
  init();
  setColor(color);
  setSystem(system);
}
LMFPnPrimDat::LMFPnPrimDat ( oracle::occi::Environment *  env,
oracle::occi::Connection *  conn,
int  color,
std::string  system 
)

Definition at line 57 of file LMFPnPrimDat.cc.

References init(), LMFColoredTable::setColor(), and setSystem().

                                                      : 
  LMFColoredTable(env, conn) {
  init();
  setColor(color);
  setSystem(system);
}
LMFPnPrimDat::LMFPnPrimDat ( EcalDBConnection c,
int  color,
std::string  system 
)

Definition at line 66 of file LMFPnPrimDat.cc.

References init(), LMFColoredTable::setColor(), and setSystem().

                                           : LMFColoredTable(c) {
  init();
  setColor(color);
  setSystem(system);
}
LMFPnPrimDat::~LMFPnPrimDat ( ) [inline]

Definition at line 37 of file LMFPnPrimDat.h.

{}

Member Function Documentation

int LMFPnPrimDat::getFlag ( EcalLogicID id)

Definition at line 267 of file LMFPnPrimDat.cc.

References LMFDat::getData().

                                         {
  return getData(id, "FLAG");
}
int LMFPnPrimDat::getFlag ( int  id)

Definition at line 231 of file LMFPnPrimDat.cc.

References LMFDat::getData().

                                {
  return getData(id, "FLAG");
}
float LMFPnPrimDat::getM3 ( EcalLogicID id)

Definition at line 251 of file LMFPnPrimDat.cc.

References LMFDat::getData().

                                         {
  return getData(id, "M3");
}
float LMFPnPrimDat::getM3 ( int  id)

Definition at line 215 of file LMFPnPrimDat.cc.

References LMFDat::getData().

                                {
  return getData(id, "M3");
}
float LMFPnPrimDat::getMean ( int  id)

Definition at line 199 of file LMFPnPrimDat.cc.

References LMFDat::getData().

                                  {
  return getData(id, "MEAN");
}
float LMFPnPrimDat::getMean ( EcalLogicID id)

Definition at line 235 of file LMFPnPrimDat.cc.

References LMFDat::getData().

                                           {
  return getData(id, "MEAN");
}
float LMFPnPrimDat::getPNAoverBM3 ( EcalLogicID id)

Definition at line 255 of file LMFPnPrimDat.cc.

References LMFDat::getData().

                                                 {
  return getData(id, "PNABM3");
}
float LMFPnPrimDat::getPNAoverBM3 ( int  id)

Definition at line 219 of file LMFPnPrimDat.cc.

References LMFDat::getData().

                                        {
  return getData(id, "PNABM3");
}
float LMFPnPrimDat::getPNAoverBMean ( EcalLogicID id)

Definition at line 259 of file LMFPnPrimDat.cc.

References LMFDat::getData().

                                                   {
  return getData(id, "PNABMEAN");
}
float LMFPnPrimDat::getPNAoverBMean ( int  id)

Definition at line 223 of file LMFPnPrimDat.cc.

References LMFDat::getData().

                                          {
  return getData(id, "PNABMEAN");
}
float LMFPnPrimDat::getPNAoverBRMS ( EcalLogicID id)

Definition at line 263 of file LMFPnPrimDat.cc.

References LMFDat::getData().

                                                  {
  return getData(id, "PNABRMS");
}
float LMFPnPrimDat::getPNAoverBRMS ( int  id)

Definition at line 227 of file LMFPnPrimDat.cc.

References LMFDat::getData().

                                         {
  return getData(id, "PNABRMS");
}
float LMFPnPrimDat::getRMS ( int  id)

Definition at line 211 of file LMFPnPrimDat.cc.

References LMFDat::getData().

                                 {
  return getData(id, "RMS");
}
float LMFPnPrimDat::getRMS ( EcalLogicID id)

Definition at line 247 of file LMFPnPrimDat.cc.

References LMFDat::getData().

                                          {
  return getData(id, "RMS");
}
float LMFPnPrimDat::getShapeCor ( EcalLogicID id)

Definition at line 239 of file LMFPnPrimDat.cc.

References LMFDat::getData(), LMFColoredTable::getSystem(), and x.

                                               {
  float x = 0.;
  if (getSystem() != "LED") {
    x = getData(id, "SHAPECORRPN");
  }
  return x;
}
float LMFPnPrimDat::getShapeCor ( int  id)

Definition at line 203 of file LMFPnPrimDat.cc.

References LMFDat::getData(), LMFColoredTable::getSystem(), and x.

                                      {
  float x = 0;
  if (getSystem() != "LED") {
    x = getData(id, "SHAPECORRPN");
  }
  return x;
}
std::string LMFPnPrimDat::getTableName ( ) const [inline, virtual]

Implements LMFColoredTable.

Definition at line 39 of file LMFPnPrimDat.h.

References LMFColoredTable::getColor(), and LMFColoredTable::getSystem().

                                 {
    return "LMF_" + getSystem() + "_" + getColor() + "_PN_PRIM_DAT";
  }
void LMFPnPrimDat::init ( void  ) [private]

Definition at line 101 of file LMFPnPrimDat.cc.

References i, LMFUnique::m_className, LMFColoredTable::m_color, LMFDat::m_keys, LMFColoredTable::m_system, and LMFDat::m_type.

Referenced by LMFPnPrimDat().

                        {
  m_className = "LMFPnPrimDat";

  m_keys["SHAPECORRPN"] = 0;
  m_keys["MEAN"] = 1;
  m_keys["RMS"] = 2;
  m_keys["M3"] = 3;
  m_keys["PNABMEAN"] = 4;
  m_keys["PNABRMS"] = 5;
  m_keys["PNABM3"] = 6;
  m_keys["FLAG"] = 7;
  m_keys["VMIN"] = 8;
  m_keys["VMAX"] = 9;

  m_type.resize(10);
  for (int i = 0; i < 10; i++) {
    m_type[i] = "NUMBER";
  }

  m_system = 0;
  m_color = 0;
}
bool LMFPnPrimDat::isValid ( void  ) [virtual]

Reimplemented from LMFDat.

Definition at line 124 of file LMFPnPrimDat.cc.

References LMFColoredTable::getColor(), LMFColoredTable::getSystem(), LMFDat::m_Error, and runTheMatrix::ret.

                           {
  bool ret = true;
  if ((getSystem() != "LASER") && (getSystem() != "LED")) {
    m_Error += " System name not properly set [" + getSystem() + "]";
    ret = false;
  }
  if ((getSystem() == "LASER") && 
      (getColor() != "BLUE") && (getColor() != "IR")) {
    m_Error += " Color not properly set [" + getColor() + "]";
    ret = false;
  }
  if ((getSystem() == "LED") && 
      (getColor() != "BLUE") && (getColor() != "ORANGE")) {
    m_Error += " Color not properly set [" + getColor() + "]";
    ret = false;
  }
  return ret;
}
LMFPnPrimDat & LMFPnPrimDat::setFlag ( EcalLogicID id,
int  v 
)

Definition at line 194 of file LMFPnPrimDat.cc.

References LMFDat::setData().

                                                          {
  LMFDat::setData(id, "FLAG", v);
  return *this;
}
LMFPnPrimDat & LMFPnPrimDat::setM3 ( EcalLogicID id,
float  v 
)

Definition at line 153 of file LMFPnPrimDat.cc.

References LMFDat::setData().

Referenced by setPN().

                                                          {
  LMFDat::setData(id, "M3", v);
  return *this;
}
LMFPnPrimDat & LMFPnPrimDat::setMean ( EcalLogicID id,
float  v 
)

Definition at line 143 of file LMFPnPrimDat.cc.

References LMFDat::setData().

Referenced by setPN().

                                                            {
  LMFDat::setData(id, "MEAN", v);
  return *this;
}
LMFPnPrimDat & LMFPnPrimDat::setPN ( EcalLogicID id,
float  mean,
float  rms,
float  m3 
)

Definition at line 158 of file LMFPnPrimDat.cc.

References setM3(), setMean(), and setRMS().

                                            {
  setMean(id, mean);
  setRMS(id, rms);
  setM3(id, m3);
  return *this;
}
LMFPnPrimDat & LMFPnPrimDat::setPNAoverB ( EcalLogicID id,
float  mean,
float  rms,
float  m3 
)

Definition at line 187 of file LMFPnPrimDat.cc.

References setPNAoverBM3(), setPNAoverBMean(), and setPNAoverBRMS().

                                                                         {
  setPNAoverBMean(id, mean);
  setPNAoverBRMS(id, rms);
  setPNAoverBM3(id, m3);
  return *this;
}
LMFPnPrimDat & LMFPnPrimDat::setPNAoverBM3 ( EcalLogicID id,
float  v 
)

Definition at line 172 of file LMFPnPrimDat.cc.

References LMFDat::setData().

Referenced by setPNAoverB().

                                                                  {
  LMFDat::setData(id, "PNABM3", v);
  return *this;
}
LMFPnPrimDat & LMFPnPrimDat::setPNAoverBMean ( EcalLogicID id,
float  v 
)

Definition at line 177 of file LMFPnPrimDat.cc.

References LMFDat::setData().

Referenced by setPNAoverB().

                                                                    {
  LMFDat::setData(id, "PNABMEAN", v);
  return *this;
}
LMFPnPrimDat & LMFPnPrimDat::setPNAoverBRMS ( EcalLogicID id,
float  v 
)

Definition at line 182 of file LMFPnPrimDat.cc.

References LMFDat::setData().

Referenced by setPNAoverB().

                                                                   {
  LMFDat::setData(id, "PNABRMS", v);
  return *this;
}
LMFPnPrimDat & LMFPnPrimDat::setRMS ( EcalLogicID id,
float  v 
)

Definition at line 148 of file LMFPnPrimDat.cc.

References LMFDat::setData().

Referenced by setPN().

                                                           {
  LMFDat::setData(id, "RMS", v);
  return *this;
}
LMFPnPrimDat & LMFPnPrimDat::setShapeCorr ( EcalLogicID id,
float  mean 
)

Definition at line 165 of file LMFPnPrimDat.cc.

References LMFColoredTable::getSystem(), and LMFDat::setData().

                                                                  {
  if (getSystem() != "LED") {
    LMFDat::setData(id, "SHAPECORRPN", v);
  }
  return *this;
}
LMFPnPrimDat & LMFPnPrimDat::setSystem ( std::string  s) [virtual]

Reimplemented from LMFColoredTable.

Definition at line 73 of file LMFPnPrimDat.cc.

References gather_cfg::cout, alignCSCRings::e, i, LMFDat::m_data, LMFUnique::m_debug, LMFDat::m_keys, and LMFDat::m_type.

Referenced by LMFPnPrimDat().

                                                 {
  // LED tables do not hold the shapecorr column. Drop it.
  std::transform(s.begin(), s.end(), s.begin(), toupper);
  if (s == "LED") {
    if (m_debug) {
      std::cout << "Erasing unwanted data" << std::endl;
    }
    m_type.erase(m_type.begin());
    m_keys.erase("SHAPECORRPN");
    if (m_debug) {
      std::cout << "Data: " << m_data.size() << " Keys: " <<  m_keys.size()
                << " Type: " << m_type.size() << std::endl;
    }
    std::map<std::string, unsigned int>::iterator i = m_keys.begin();
    std::map<std::string, unsigned int>::iterator e = m_keys.end();
    while (i != e) {
      // modify indexes
      (i->second)--;
      if (m_debug) {
        std::cout << "Key " << i->first << " = " << i->second << std::endl;
      }
      i++;
    }
  }
  LMFColoredTable::setSystem(s);
  return *this;
}