CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
LMFDefFabric Class Reference

#include <LMFDefFabric.h>

Inheritance diagram for LMFDefFabric:
IDBObject

Public Member Functions

void debug ()
 
void dump ()
 
LMFColor getColor (int color_index) const
 
LMFColor getColor (std::string name) 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 () noexcept(false)
 
 LMFDefFabric ()
 
 LMFDefFabric (EcalDBConnection *c)
 
 LMFDefFabric (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
void noDebug ()
 
 ~LMFDefFabric () 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

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
 
- Protected Attributes inherited from IDBObject
oracle::occi::Connection * m_conn
 
oracle::occi::Environment * m_env
 

Additional Inherited Members

- Static Public Attributes inherited from IDBObject
static const int ECALDB_NROWS = 1024
 
- Protected Member Functions inherited from IDBObject
void checkConnection () const noexcept(false)
 

Detailed Description

Definition at line 25 of file LMFDefFabric.h.

Constructor & Destructor Documentation

◆ LMFDefFabric() [1/3]

LMFDefFabric::LMFDefFabric ( )

Definition at line 10 of file LMFDefFabric.cc.

10 { noDebug(); }

References noDebug().

◆ LMFDefFabric() [2/3]

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

◆ LMFDefFabric() [3/3]

LMFDefFabric::LMFDefFabric ( EcalDBConnection c)

Definition at line 18 of file LMFDefFabric.cc.

18  {
19  noDebug();
20  setConnection(c->getEnv(), c->getConn());
21  initialize();
22 }

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

◆ ~LMFDefFabric()

LMFDefFabric::~LMFDefFabric ( )
override

Definition at line 24 of file LMFDefFabric.cc.

24 {}

Member Function Documentation

◆ debug()

void LMFDefFabric::debug ( )

Definition at line 26 of file LMFDefFabric.cc.

26 { _debug = true; }

References _debug.

Referenced by LMFRunIOV::operator=().

◆ dump()

void LMFDefFabric::dump ( void  )

Definition at line 228 of file LMFDefFabric.cc.

228  {
229  std::cout << "========= Fabric dump @ address " << this << " ============" << std::endl;
230  std::list<LMFColor>::const_iterator i1 = _lmfColors.begin();
231  std::list<LMFTrigType>::const_iterator i2 = _lmfTrigTypes.begin();
232  std::list<LMFRunTag>::const_iterator i3 = _lmfRunTags.begin();
233  std::list<LMFPrimVers>::const_iterator i4 = _lmfPrimVersions.begin();
234  std::list<LMFSeqVers>::const_iterator i5 = _lmfSeqVersions.begin();
235  std::list<LMFCorrVers>::const_iterator i6 = _lmfCorrVersions.begin();
236  std::list<LMFColor>::const_iterator e1 = _lmfColors.end();
237  std::list<LMFTrigType>::const_iterator e2 = _lmfTrigTypes.end();
238  std::list<LMFRunTag>::const_iterator e3 = _lmfRunTags.end();
239  std::list<LMFPrimVers>::const_iterator e4 = _lmfPrimVersions.end();
240  std::list<LMFSeqVers>::const_iterator e5 = _lmfSeqVersions.end();
241  std::list<LMFCorrVers>::const_iterator e6 = _lmfCorrVersions.end();
242  std::cout << "=== Colors" << std::endl;
243  while (i1 != e1) {
244  i1++->dump();
245  }
246  std::cout << "=== Trigger Types" << std::endl;
247  while (i2 != e2) {
248  i2++->dump();
249  }
250  std::cout << "=== Run Tags" << std::endl;
251  while (i3 != e3) {
252  i3++->dump();
253  }
254  std::cout << "=== Prim. Vers." << std::endl;
255  while (i4 != e4) {
256  i4++->dump();
257  }
258  std::cout << "=== Seq. Vers." << std::endl;
259  while (i5 != e5) {
260  i5++->dump();
261  }
262  std::cout << "=== Corr. Vers." << std::endl;
263  while (i6 != e6) {
264  i6++->dump();
265  }
266 }

References _lmfColors, _lmfCorrVersions, _lmfPrimVersions, _lmfRunTags, _lmfSeqVersions, _lmfTrigTypes, gather_cfg::cout, StorageManager_cfg::e1, SiPixelPhase1Clusters_cfi::e3, vertexPlots::e4, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, and testProducerWithPsetDescEmpty_cfi::i3.

Referenced by LMFRunIOV::dump().

◆ getColor() [1/2]

LMFColor LMFDefFabric::getColor ( int  color_index) const

Definition at line 66 of file LMFDefFabric.cc.

66  {
67  std::list<LMFColor>::const_iterator i = _lmfColors.begin();
68  std::list<LMFColor>::const_iterator e = _lmfColors.end();
69  LMFColor ret;
70  bool loop = true;
71  while ((loop) && (i != e)) {
72  if (i->getColorIndex() == index) {
73  ret = *i;
74  loop = false;
75  }
76  i++;
77  }
78  return ret;
79 }

References _lmfColors, MillePedeFileConverter_cfg::e, mps_fire::i, heppy_loop::loop, and runTheMatrix::ret.

◆ getColor() [2/2]

LMFColor LMFDefFabric::getColor ( std::string  name) const

Definition at line 36 of file LMFDefFabric.cc.

36  {
37  std::list<LMFColor>::const_iterator i = _lmfColors.begin();
38  std::list<LMFColor>::const_iterator e = _lmfColors.end();
39  LMFColor ret;
40  bool loop = true;
41  while ((loop) && (i != e)) {
42  if (i->getShortName() == name) {
43  ret = *i;
44  loop = false;
45  }
46  i++;
47  }
48  return ret;
49 }

References _lmfColors, MillePedeFileConverter_cfg::e, mps_fire::i, heppy_loop::loop, Skims_PA_cff::name, and runTheMatrix::ret.

Referenced by getColorID().

◆ getColorFromID()

LMFColor LMFDefFabric::getColorFromID ( int  color_id) const

Definition at line 51 of file LMFDefFabric.cc.

51  {
52  std::list<LMFColor>::const_iterator i = _lmfColors.begin();
53  std::list<LMFColor>::const_iterator e = _lmfColors.end();
54  LMFColor ret;
55  bool loop = true;
56  while ((loop) && (i != e)) {
57  if (i->getID() == id) {
58  ret = *i;
59  loop = false;
60  }
61  i++;
62  }
63  return ret;
64 }

References _lmfColors, MillePedeFileConverter_cfg::e, mps_fire::i, triggerObjects_cff::id, heppy_loop::loop, and runTheMatrix::ret.

◆ getColorID() [1/2]

int LMFDefFabric::getColorID ( int  color_index) const

Definition at line 83 of file LMFDefFabric.cc.

83 { return getColor(index).getID(); }

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

◆ getColorID() [2/2]

int LMFDefFabric::getColorID ( std::string  name) const

Definition at line 81 of file LMFDefFabric.cc.

81 { return getColor(sname).getID(); }

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

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

◆ getColors()

std::list< LMFColor > LMFDefFabric::getColors ( ) const

Definition at line 30 of file LMFDefFabric.cc.

30 { return _lmfColors; }

References _lmfColors.

◆ getRunTag()

LMFRunTag LMFDefFabric::getRunTag ( std::string  tag,
int  version 
) const

Definition at line 117 of file LMFDefFabric.cc.

117  {
118  std::list<LMFRunTag>::const_iterator i = _lmfRunTags.begin();
119  std::list<LMFRunTag>::const_iterator e = _lmfRunTags.end();
120  LMFRunTag rt;
121  bool loop = true;
122  while ((loop) && (i != e)) {
123  if ((i->getGeneralTag()) == tag && (i->getVersion() == version)) {
124  rt = *i;
125  }
126  i++;
127  }
128  return rt;
129 }

References _lmfRunTags, MillePedeFileConverter_cfg::e, mps_fire::i, heppy_loop::loop, hcal_runs::rt, GlobalPosition_Frontier_DevDB_cff::tag, and BeamSplash_cfg::version.

Referenced by getRunTagID().

◆ getRunTagFromID()

LMFRunTag LMFDefFabric::getRunTagFromID ( int  runTag_id) const

Definition at line 131 of file LMFDefFabric.cc.

131  {
132  std::list<LMFRunTag>::const_iterator i = _lmfRunTags.begin();
133  std::list<LMFRunTag>::const_iterator e = _lmfRunTags.end();
134  LMFRunTag rt;
135  bool loop = true;
136  while ((loop) && (i != e)) {
137  if (i->getID() == id) {
138  rt = *i;
139  }
140  i++;
141  }
142  return rt;
143 }

References _lmfRunTags, MillePedeFileConverter_cfg::e, mps_fire::i, triggerObjects_cff::id, heppy_loop::loop, and hcal_runs::rt.

◆ getRunTagID()

int LMFDefFabric::getRunTagID ( std::string  tag,
int  version 
) const

◆ getRunTags()

std::list< LMFRunTag > LMFDefFabric::getRunTags ( ) const

Definition at line 34 of file LMFDefFabric.cc.

34 { return _lmfRunTags; }

References _lmfRunTags.

◆ getTriggerTypes()

std::list< LMFTrigType > LMFDefFabric::getTriggerTypes ( ) const

Definition at line 32 of file LMFDefFabric.cc.

32 { return _lmfTrigTypes; }

References _lmfTrigTypes.

◆ getTrigType()

LMFTrigType LMFDefFabric::getTrigType ( std::string  sname) const

Definition at line 87 of file LMFDefFabric.cc.

87  {
88  std::list<LMFTrigType>::const_iterator i = _lmfTrigTypes.begin();
89  std::list<LMFTrigType>::const_iterator e = _lmfTrigTypes.end();
91  bool loop = true;
92  while ((loop) && (i != e)) {
93  if (i->getShortName() == sname) {
94  tt = *i;
95  loop = false;
96  }
97  i++;
98  }
99  return tt;
100 }

References _lmfTrigTypes, MillePedeFileConverter_cfg::e, mps_fire::i, heppy_loop::loop, and groupFilesInBlocks::tt.

Referenced by getTrigTypeID().

◆ getTrigTypeFromID()

LMFTrigType LMFDefFabric::getTrigTypeFromID ( int  trigType_id) const

Definition at line 102 of file LMFDefFabric.cc.

102  {
103  std::list<LMFTrigType>::const_iterator i = _lmfTrigTypes.begin();
104  std::list<LMFTrigType>::const_iterator e = _lmfTrigTypes.end();
105  LMFTrigType tt;
106  bool loop = true;
107  while ((loop) && (i != e)) {
108  if (i->getID() == id) {
109  tt = *i;
110  loop = false;
111  }
112  i++;
113  }
114  return tt;
115 }

References _lmfTrigTypes, MillePedeFileConverter_cfg::e, mps_fire::i, triggerObjects_cff::id, heppy_loop::loop, and groupFilesInBlocks::tt.

◆ getTrigTypeID()

int LMFDefFabric::getTrigTypeID ( std::string  sname) const

Definition at line 85 of file LMFDefFabric.cc.

85 { return getTrigType(sname).getID(); }

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

Referenced by LMFRunIOV::setTriggerType().

◆ initialize()

void LMFDefFabric::initialize ( void  )
noexcept

Definition at line 152 of file LMFDefFabric.cc.

152  {
153  _lmfColors.clear();
154  _lmfTrigTypes.clear();
155  _lmfRunTags.clear();
156  _lmfPrimVersions.clear();
157  _lmfSeqVersions.clear();
158  _lmfCorrVersions.clear();
159  if ((m_env != nullptr) && (m_conn != nullptr)) {
160  auto listOfObjects = LMFColor(m_env, m_conn).fetchAll();
161  auto i = listOfObjects.begin();
162  auto e = listOfObjects.end();
163 
164  while (i != e) {
165  const LMFColor &c = unique_static_cast<const LMFColor>(*i);
166  _lmfColors.push_back(c);
167  i++;
168  }
169  listOfObjects.clear();
170  listOfObjects = LMFTrigType(m_env, m_conn).fetchAll();
171  i = listOfObjects.begin();
172  e = listOfObjects.end();
173  while (i != e) {
174  const LMFTrigType &c = unique_static_cast<const LMFTrigType>(*i);
175  _lmfTrigTypes.push_back(c);
176  i++;
177  }
178  listOfObjects.clear();
179  listOfObjects = LMFRunTag(m_env, m_conn).fetchAll();
180  i = listOfObjects.begin();
181  e = listOfObjects.end();
182  while (i != e) {
183  const LMFRunTag &c = unique_static_cast<const LMFRunTag>(*i);
184  _lmfRunTags.push_back(c);
185  i++;
186  }
187  listOfObjects.clear();
188  listOfObjects = LMFPrimVers(m_env, m_conn).fetchAll();
189  i = listOfObjects.begin();
190  e = listOfObjects.end();
191  while (i != e) {
192  const LMFPrimVers &c = unique_static_cast<const LMFPrimVers>(*i);
193  _lmfPrimVersions.push_back(c);
194  i++;
195  }
196  listOfObjects.clear();
197  listOfObjects = LMFCorrVers(m_env, m_conn).fetchAll();
198  i = listOfObjects.begin();
199  e = listOfObjects.end();
200  while (i != e) {
201  const LMFCorrVers &c = unique_static_cast<const LMFCorrVers>(*i);
202  _lmfCorrVersions.push_back(c);
203  i++;
204  }
205  listOfObjects.clear();
206  listOfObjects = LMFSeqVers(m_env, m_conn).fetchAll();
207  i = listOfObjects.begin();
208  e = listOfObjects.end();
209  while (i != e) {
210  const LMFSeqVers &c = unique_static_cast<const LMFSeqVers>(*i);
211  _lmfSeqVersions.push_back(c);
212  i++;
213  }
214  listOfObjects.clear();
215  _lmfColors.sort();
216  _lmfTrigTypes.sort();
217  _lmfRunTags.sort();
218  _lmfPrimVersions.sort();
219  _lmfSeqVersions.sort();
220  _lmfCorrVersions.sort();
221  } else {
222  throw(
223  std::runtime_error("LMFDefFabric: cannot initialize since connection not"
224  "set"));
225  }
226 }

References _lmfColors, _lmfCorrVersions, _lmfPrimVersions, _lmfRunTags, _lmfSeqVersions, _lmfTrigTypes, HltBtagPostValidation_cff::c, MillePedeFileConverter_cfg::e, LMFUnique::fetchAll(), mps_fire::i, IDBObject::m_conn, and IDBObject::m_env.

Referenced by LMFDefFabric().

◆ noDebug()

void LMFDefFabric::noDebug ( )

Definition at line 28 of file LMFDefFabric.cc.

28 { _debug = false; }

References _debug.

Referenced by LMFDefFabric().

Member Data Documentation

◆ _debug

bool LMFDefFabric::_debug
protected

Definition at line 55 of file LMFDefFabric.h.

Referenced by debug(), and noDebug().

◆ _lmfColors

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

Definition at line 57 of file LMFDefFabric.h.

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

◆ _lmfCorrVersions

std::list<LMFCorrVers> LMFDefFabric::_lmfCorrVersions
protected

Definition at line 62 of file LMFDefFabric.h.

Referenced by dump(), and initialize().

◆ _lmfPrimVersions

std::list<LMFPrimVers> LMFDefFabric::_lmfPrimVersions
protected

Definition at line 60 of file LMFDefFabric.h.

Referenced by dump(), and initialize().

◆ _lmfRunTags

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

Definition at line 59 of file LMFDefFabric.h.

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

◆ _lmfSeqVersions

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

Definition at line 61 of file LMFDefFabric.h.

Referenced by dump(), and initialize().

◆ _lmfTrigTypes

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

Definition at line 58 of file LMFDefFabric.h.

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

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:373
LMFCorrVers
Definition: LMFCorrVers.h:17
LMFTrigType
Definition: LMFTrigType.h:10
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
testProducerWithPsetDescEmpty_cfi.i3
i3
Definition: testProducerWithPsetDescEmpty_cfi.py:47
mps_fire.i
i
Definition: mps_fire.py:428
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
LMFRunTag
Definition: LMFRunTag.h:16
gather_cfg.cout
cout
Definition: gather_cfg.py:144
hcal_runs.rt
rt
Definition: hcal_runs.py:76
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
LMFDefFabric::getRunTag
LMFRunTag getRunTag(std::string tag, int version) const
Definition: LMFDefFabric.cc:117
SiStripCommissioningClient_cfg.conn
conn
Definition: SiStripCommissioningClient_cfg.py:5
LMFColor
Definition: LMFColor.h:12
LMFDefFabric::_lmfCorrVersions
std::list< LMFCorrVers > _lmfCorrVersions
Definition: LMFDefFabric.h:62
IDBObject::m_conn
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
LMFPrimVers
Definition: LMFPrimVers.h:22
LMFDefFabric::getTrigType
LMFTrigType getTrigType(std::string sname) const
Definition: LMFDefFabric.cc:87
LMFSeqVers
Definition: LMFSeqVers.h:17
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
LMFDefFabric::initialize
void initialize() noexcept(false)
Definition: LMFDefFabric.cc:152
LMFDefFabric::_lmfColors
std::list< LMFColor > _lmfColors
Definition: LMFDefFabric.h:57
web.browse_db.env
env
Definition: browse_db.py:18
LMFDefFabric::getColor
LMFColor getColor(std::string name) const
Definition: LMFDefFabric.cc:36
LMFDefFabric::_lmfPrimVersions
std::list< LMFPrimVers > _lmfPrimVersions
Definition: LMFDefFabric.h:60
heppy_loop.loop
loop
Definition: heppy_loop.py:28
StorageManager_cfg.e1
e1
Definition: StorageManager_cfg.py:16
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
SiPixelPhase1Clusters_cfi.e3
e3
Definition: SiPixelPhase1Clusters_cfi.py:9
LMFDefFabric::_lmfSeqVersions
std::list< LMFSeqVers > _lmfSeqVersions
Definition: LMFDefFabric.h:61
LMFUnique::fetchAll
virtual std::list< std::unique_ptr< LMFUnique > > fetchAll() const noexcept(false)
Definition: LMFUnique.cc:61
LMFUnique::getID
int getID() const
Definition: LMFUnique.h:58
IDBObject::setConnection
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
LMFDefFabric::_lmfTrigTypes
std::list< LMFTrigType > _lmfTrigTypes
Definition: LMFDefFabric.h:58
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
LMFDefFabric::_debug
bool _debug
Definition: LMFDefFabric.h:55
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
IDBObject::m_env
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
LMFDefFabric::_lmfRunTags
std::list< LMFRunTag > _lmfRunTags
Definition: LMFDefFabric.h:59
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
vertexPlots.e4
e4
Definition: vertexPlots.py:64
LMFDefFabric::noDebug
void noDebug()
Definition: LMFDefFabric.cc:28
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37