CMS 3D CMS Logo

Public Member Functions | Protected Attributes

LMFDefFabric Class Reference

#include <LMFDefFabric.h>

Inheritance diagram for LMFDefFabric:
IDBObject

List of all members.

Public Member Functions

void debug ()
void dump ()
LMFColor getColor (std::string name) const
LMFColor getColor (int color_index) const
LMFColor getColorFromID (int color_id) const
int getColorID (int color_index) const
int getColorID (std::string name) const
std::list< LMFColorgetColors () const
LMFRunTag getRunTag (std::string tag, int version) const
LMFRunTag getRunTagFromID (int runTag_id) const
int getRunTagID (std::string tag, int version) const
std::list< LMFRunTaggetRunTags () const
std::list< LMFTrigTypegetTriggerTypes () const
LMFTrigType getTrigType (std::string sname) const
LMFTrigType getTrigTypeFromID (int trigType_id) const
int getTrigTypeID (std::string sname) const
void initialize () throw (std::runtime_error)
 LMFDefFabric (EcalDBConnection *c)
 LMFDefFabric ()
 LMFDefFabric (oracle::occi::Environment *env, oracle::occi::Connection *conn)
void noDebug ()
 ~LMFDefFabric ()

Protected Attributes

bool _debug
std::list< LMFColor_lmfColors
std::list< LMFCorrVers_lmfCorrVersions
std::list< LMFPrimVers_lmfPrimVersions
std::list< LMFRunTag_lmfRunTags
std::list< LMFSeqVers_lmfSeqVersions
std::list< LMFTrigType_lmfTrigTypes

Detailed Description

Definition at line 25 of file LMFDefFabric.h.


Constructor & Destructor Documentation

LMFDefFabric::LMFDefFabric ( )

Definition at line 10 of file LMFDefFabric.cc.

References noDebug().

                           {
  noDebug();
}
LMFDefFabric::LMFDefFabric ( oracle::occi::Environment *  env,
oracle::occi::Connection *  conn 
)

Definition at line 14 of file LMFDefFabric.cc.

References initialize(), noDebug(), and IDBObject::setConnection().

LMFDefFabric::LMFDefFabric ( EcalDBConnection c)
LMFDefFabric::~LMFDefFabric ( )

Definition at line 27 of file LMFDefFabric.cc.

                            {
}

Member Function Documentation

void LMFDefFabric::debug ( )

Definition at line 30 of file LMFDefFabric.cc.

References _debug.

Referenced by LMFRunIOV::operator=().

                         {
  _debug = true;
}
void LMFDefFabric::dump ( void  )

Definition at line 247 of file LMFDefFabric.cc.

References _lmfColors, _lmfCorrVersions, _lmfPrimVersions, _lmfRunTags, _lmfSeqVersions, _lmfTrigTypes, and gather_cfg::cout.

Referenced by LMFRunIOV::dump().

                        {
  std::cout << "========= Fabric dump @ address " << this << " ============"
            << std::endl;
  std::list<LMFColor>::const_iterator    i1 = _lmfColors.begin();
  std::list<LMFTrigType>::const_iterator i2 = _lmfTrigTypes.begin();
  std::list<LMFRunTag>::const_iterator   i3 = _lmfRunTags.begin();
  std::list<LMFPrimVers>::const_iterator i4 = _lmfPrimVersions.begin();
  std::list<LMFSeqVers>::const_iterator  i5 = _lmfSeqVersions.begin();
  std::list<LMFCorrVers>::const_iterator i6 = _lmfCorrVersions.begin();
  std::list<LMFColor>::const_iterator    e1 = _lmfColors.end();
  std::list<LMFTrigType>::const_iterator e2 = _lmfTrigTypes.end();
  std::list<LMFRunTag>::const_iterator   e3 = _lmfRunTags.end();
  std::list<LMFPrimVers>::const_iterator e4 = _lmfPrimVersions.end();
  std::list<LMFSeqVers>::const_iterator  e5 = _lmfSeqVersions.end();
  std::list<LMFCorrVers>::const_iterator e6 = _lmfCorrVersions.end();
  std::cout << "=== Colors" << std::endl;
  while (i1 != e1) {
    i1++->dump();
  }
  std::cout << "=== Trigger Types" << std::endl;
  while (i2 != e2) {
    i2++->dump();
  }
  std::cout << "=== Run Tags" << std::endl;
  while (i3 != e3) {
    i3++->dump();
  }
  std::cout << "=== Prim. Vers." << std::endl;
  while (i4 != e4) {
    i4++->dump();
  }
  std::cout << "=== Seq. Vers." << std::endl;
  while (i5 != e5) {
    i5++->dump();
  }
  std::cout << "=== Corr. Vers." << std::endl;
  while (i6 != e6) {
    i6++->dump();
  }
}
LMFColor LMFDefFabric::getColor ( std::string  name) const

Definition at line 50 of file LMFDefFabric.cc.

References _lmfColors, alignCSCRings::e, i, python::cmstools::loop(), mergeVDriftHistosByStation::name, and run_regression::ret.

Referenced by getColorID().

                                                    {
  std::list<LMFColor>::const_iterator i = _lmfColors.begin();
  std::list<LMFColor>::const_iterator e = _lmfColors.end();
  LMFColor ret;
  bool loop = true;
  while ((loop) && (i != e)) {
    if (i->getShortName() == name) {
      ret = *i;
      loop = false;
    }
    i++;
  }
  return ret;
}
LMFColor LMFDefFabric::getColor ( int  color_index) const

Definition at line 80 of file LMFDefFabric.cc.

References _lmfColors, alignCSCRings::e, i, getHLTprescales::index, python::cmstools::loop(), and run_regression::ret.

                                               {
  std::list<LMFColor>::const_iterator i = _lmfColors.begin();
  std::list<LMFColor>::const_iterator e = _lmfColors.end();
  LMFColor ret;
  bool loop = true;
  while ((loop) && (i != e)) {
    if (i->getColorIndex() == index) {
      ret = *i;
      loop = false;
    }
    i++;
  }
  return ret;
}
LMFColor LMFDefFabric::getColorFromID ( int  color_id) const

Definition at line 65 of file LMFDefFabric.cc.

References _lmfColors, alignCSCRings::e, i, errorMatrix2Lands_multiChannel::id, python::cmstools::loop(), and run_regression::ret.

                                                  {
  std::list<LMFColor>::const_iterator i = _lmfColors.begin();
  std::list<LMFColor>::const_iterator e = _lmfColors.end();
  LMFColor ret;
  bool loop = true;
  while ((loop) && (i != e)) {
    if (i->getID() == id) {
      ret = *i;
      loop = false;
    }
    i++;
  }
  return ret;
}
int LMFDefFabric::getColorID ( std::string  name) const

Definition at line 95 of file LMFDefFabric.cc.

References getColor(), and LMFUnique::getID().

Referenced by LMFRunIOV::setColor(), and LMFRunIOV::setColorIndex().

                                                  {
  return getColor(sname).getID();
}
int LMFDefFabric::getColorID ( int  color_index) const

Definition at line 99 of file LMFDefFabric.cc.

References getColor(), and LMFUnique::getID().

                                            {
  return getColor(index).getID();
}
std::list< LMFColor > LMFDefFabric::getColors ( ) const

Definition at line 38 of file LMFDefFabric.cc.

References _lmfColors.

                                                {
  return _lmfColors;
}
LMFRunTag LMFDefFabric::getRunTag ( std::string  tag,
int  version 
) const

Definition at line 137 of file LMFDefFabric.cc.

References _lmfRunTags, alignCSCRings::e, i, python::cmstools::loop(), and BeamSplash_cfg::version.

Referenced by getRunTagID().

                                                                  {
  std::list<LMFRunTag>::const_iterator i = _lmfRunTags.begin();
  std::list<LMFRunTag>::const_iterator e = _lmfRunTags.end();
  LMFRunTag rt;
  bool loop = true;
  while ((loop) && (i != e)) {
    if ((i->getGeneralTag()) == tag && (i->getVersion() == version)) {
      rt = *i;
    }
    i++;
  }
  return rt;
}
LMFRunTag LMFDefFabric::getRunTagFromID ( int  runTag_id) const

Definition at line 151 of file LMFDefFabric.cc.

References _lmfRunTags, alignCSCRings::e, i, errorMatrix2Lands_multiChannel::id, and python::cmstools::loop().

                                                    {
  std::list<LMFRunTag>::const_iterator i = _lmfRunTags.begin();
  std::list<LMFRunTag>::const_iterator e = _lmfRunTags.end();
  LMFRunTag rt;
  bool loop = true;
  while ((loop) && (i != e)) {
    if (i->getID() == id) {
      rt = *i;
    }
    i++;
  }
  return rt;
}
int LMFDefFabric::getRunTagID ( std::string  tag,
int  version 
) const

Definition at line 165 of file LMFDefFabric.cc.

References LMFUnique::getID(), and getRunTag().

                                                              {
  return getRunTag(tag, version).getID();
}
std::list< LMFRunTag > LMFDefFabric::getRunTags ( ) const

Definition at line 46 of file LMFDefFabric.cc.

References _lmfRunTags.

                                                  {
  return _lmfRunTags;
}
std::list< LMFTrigType > LMFDefFabric::getTriggerTypes ( ) const

Definition at line 42 of file LMFDefFabric.cc.

References _lmfTrigTypes.

                                                         {
  return _lmfTrigTypes;
}
LMFTrigType LMFDefFabric::getTrigType ( std::string  sname) const

Definition at line 107 of file LMFDefFabric.cc.

References _lmfTrigTypes, alignCSCRings::e, i, python::cmstools::loop(), lumiContext::sname, and groupFilesInBlocks::tt.

Referenced by getTrigTypeID().

                                                           {
  std::list<LMFTrigType>::const_iterator i = _lmfTrigTypes.begin();
  std::list<LMFTrigType>::const_iterator e = _lmfTrigTypes.end();
  LMFTrigType tt;
  bool loop = true;
  while ((loop) && (i != e)) {
    if (i->getShortName() == sname) {
      tt = *i;
      loop = false;
    }
    i++;
  }
  return tt;
}
LMFTrigType LMFDefFabric::getTrigTypeFromID ( int  trigType_id) const

Definition at line 122 of file LMFDefFabric.cc.

References _lmfTrigTypes, alignCSCRings::e, i, errorMatrix2Lands_multiChannel::id, python::cmstools::loop(), and groupFilesInBlocks::tt.

                                                        {
  std::list<LMFTrigType>::const_iterator i = _lmfTrigTypes.begin();
  std::list<LMFTrigType>::const_iterator e = _lmfTrigTypes.end();
  LMFTrigType tt;
  bool loop = true;
  while ((loop) && (i != e)) {
    if (i->getID() == id) {
      tt = *i;
      loop = false;
    }
    i++;
  }
  return tt;
}
int LMFDefFabric::getTrigTypeID ( std::string  sname) const

Definition at line 103 of file LMFDefFabric.cc.

References LMFUnique::getID(), and getTrigType().

Referenced by LMFRunIOV::setTriggerType().

                                                     {
  return getTrigType(sname).getID();
}
void LMFDefFabric::initialize ( ) throw (std::runtime_error)

Definition at line 169 of file LMFDefFabric.cc.

References _lmfColors, _lmfCorrVersions, _lmfPrimVersions, _lmfRunTags, _lmfSeqVersions, _lmfTrigTypes, trackerHits::c, alignCSCRings::e, LMFUnique::fetchAll(), i, IDBObject::m_conn, IDBObject::m_env, and NULL.

Referenced by LMFDefFabric().

                           {
  _lmfColors.clear();
  _lmfTrigTypes.clear();
  _lmfRunTags.clear();
  _lmfPrimVersions.clear();
  _lmfSeqVersions.clear();
  _lmfCorrVersions.clear();
  if ((m_env != NULL) && (m_conn != NULL)) {
    boost::ptr_list<LMFUnique> listOfObjects;
    boost::ptr_list<LMFUnique>::const_iterator i;
    boost::ptr_list<LMFUnique>::const_iterator e;
    listOfObjects = LMFColor(m_env, m_conn).fetchAll();
    i = listOfObjects.begin();
    e = listOfObjects.end();
    while (i != e) {
      LMFColor *c = (LMFColor*)&(*i);
      _lmfColors.push_back(*c);
      i++;
    }
    listOfObjects.clear();
    listOfObjects = LMFTrigType(m_env, m_conn).fetchAll();
    i = listOfObjects.begin();
    e = listOfObjects.end();
    while (i != e) {
      LMFTrigType *c = (LMFTrigType*)&(*i);
      _lmfTrigTypes.push_back(*c);
      i++;
    }
    listOfObjects.clear();
    listOfObjects = LMFRunTag(m_env, m_conn).fetchAll();
    i = listOfObjects.begin();
    e = listOfObjects.end();
    while (i != e) {
      LMFRunTag *c = (LMFRunTag*)&(*i);
      _lmfRunTags.push_back(*c);
      i++;
    }
    listOfObjects.clear();
    listOfObjects = LMFPrimVers(m_env, m_conn).fetchAll();
    i = listOfObjects.begin();
    e = listOfObjects.end();
    while (i != e) {
      LMFPrimVers *c = (LMFPrimVers*)&(*i);
      _lmfPrimVersions.push_back(*c);
      i++;
    }
    listOfObjects.clear();
    listOfObjects = LMFCorrVers(m_env, m_conn).fetchAll();
    i = listOfObjects.begin();
    e = listOfObjects.end();
    while (i != e) {
      LMFCorrVers *c = (LMFCorrVers*)&(*i);
      _lmfCorrVersions.push_back(*c);
      i++;
    }
    listOfObjects.clear();
    listOfObjects = LMFSeqVers(m_env, m_conn).fetchAll();
    i = listOfObjects.begin();
    e = listOfObjects.end();
    while (i != e) {
      LMFSeqVers *c = (LMFSeqVers*)&(*i);
      _lmfSeqVersions.push_back(*c);
      i++;
    }
    listOfObjects.clear();
    _lmfColors.sort();
    _lmfTrigTypes.sort();
    _lmfRunTags.sort();
    _lmfPrimVersions.sort();
    _lmfSeqVersions.sort();
    _lmfCorrVersions.sort();
  } else {
    throw(std::runtime_error("LMFDefFabric: cannot initialize since connection not"
                        "set"));
  }
}
void LMFDefFabric::noDebug ( )

Definition at line 34 of file LMFDefFabric.cc.

References _debug.

Referenced by LMFDefFabric().

                           {
  _debug = false;
}

Member Data Documentation

bool LMFDefFabric::_debug [protected]

Definition at line 57 of file LMFDefFabric.h.

Referenced by debug(), and noDebug().

std::list<LMFColor> LMFDefFabric::_lmfColors [protected]

Definition at line 59 of file LMFDefFabric.h.

Referenced by dump(), getColor(), getColorFromID(), getColors(), and initialize().

Definition at line 64 of file LMFDefFabric.h.

Referenced by dump(), and initialize().

Definition at line 62 of file LMFDefFabric.h.

Referenced by dump(), and initialize().

std::list<LMFRunTag> LMFDefFabric::_lmfRunTags [protected]

Definition at line 61 of file LMFDefFabric.h.

Referenced by dump(), getRunTag(), getRunTagFromID(), getRunTags(), and initialize().

std::list<LMFSeqVers> LMFDefFabric::_lmfSeqVersions [protected]

Definition at line 63 of file LMFDefFabric.h.

Referenced by dump(), and initialize().

std::list<LMFTrigType> LMFDefFabric::_lmfTrigTypes [protected]

Definition at line 60 of file LMFDefFabric.h.

Referenced by dump(), getTriggerTypes(), getTrigType(), getTrigTypeFromID(), and initialize().