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 (std::string name) const
 
LMFColor getColor (int color_index) const
 
LMFColor getColorFromID (int color_id) const
 
int getColorID (std::string name) const
 
int getColorID (int color_index) 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 (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
 LMFDefFabric (EcalDBConnection *c)
 
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 int const 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.

References noDebug().

10 { noDebug(); }
void noDebug()
Definition: LMFDefFabric.cc:28

◆ LMFDefFabric() [2/3]

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

Definition at line 12 of file LMFDefFabric.cc.

References getInfo::conn, web.browse_db::env, initialize(), noDebug(), and IDBObject::setConnection().

12  {
13  noDebug();
15  initialize();
16 }
void initialize() noexcept(false)
void noDebug()
Definition: LMFDefFabric.cc:28
conn
Definition: getInfo.py:9
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23

◆ LMFDefFabric() [3/3]

LMFDefFabric::LMFDefFabric ( EcalDBConnection c)

Definition at line 18 of file LMFDefFabric.cc.

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

18  {
19  noDebug();
20  setConnection(c->getEnv(), c->getConn());
21  initialize();
22 }
void initialize() noexcept(false)
void noDebug()
Definition: LMFDefFabric.cc:28
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23

◆ ~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.

References _debug.

Referenced by LMFRunIOV::operator=().

26 { _debug = true; }

◆ dump()

void LMFDefFabric::dump ( void  )

Definition at line 228 of file LMFDefFabric.cc.

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

Referenced by LMFRunIOV::dump().

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 }
std::list< LMFPrimVers > _lmfPrimVersions
Definition: LMFDefFabric.h:60
std::list< LMFTrigType > _lmfTrigTypes
Definition: LMFDefFabric.h:58
std::list< LMFSeqVers > _lmfSeqVersions
Definition: LMFDefFabric.h:61
std::list< LMFCorrVers > _lmfCorrVersions
Definition: LMFDefFabric.h:62
std::list< LMFColor > _lmfColors
Definition: LMFDefFabric.h:57
std::list< LMFRunTag > _lmfRunTags
Definition: LMFDefFabric.h:59

◆ getColor() [1/2]

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

Definition at line 36 of file LMFDefFabric.cc.

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

Referenced by getColorID().

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 }
ret
prodAgent to be discontinued
std::list< LMFColor > _lmfColors
Definition: LMFDefFabric.h:57

◆ getColor() [2/2]

LMFColor LMFDefFabric::getColor ( int  color_index) const

Definition at line 66 of file LMFDefFabric.cc.

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

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 }
ret
prodAgent to be discontinued
std::list< LMFColor > _lmfColors
Definition: LMFDefFabric.h:57

◆ getColorFromID()

LMFColor LMFDefFabric::getColorFromID ( int  color_id) const

Definition at line 51 of file LMFDefFabric.cc.

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

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 }
ret
prodAgent to be discontinued
std::list< LMFColor > _lmfColors
Definition: LMFDefFabric.h:57

◆ getColorID() [1/2]

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

Definition at line 81 of file LMFDefFabric.cc.

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

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

81 { return getColor(sname).getID(); }
int getID() const
Definition: LMFUnique.h:58
LMFColor getColor(std::string name) const
Definition: LMFDefFabric.cc:36

◆ getColorID() [2/2]

int LMFDefFabric::getColorID ( int  color_index) const

Definition at line 83 of file LMFDefFabric.cc.

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

83 { return getColor(index).getID(); }
int getID() const
Definition: LMFUnique.h:58
LMFColor getColor(std::string name) const
Definition: LMFDefFabric.cc:36

◆ getColors()

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

Definition at line 30 of file LMFDefFabric.cc.

References _lmfColors.

30 { return _lmfColors; }
std::list< LMFColor > _lmfColors
Definition: LMFDefFabric.h:57

◆ getRunTag()

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

Definition at line 117 of file LMFDefFabric.cc.

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

Referenced by getRunTagID().

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 }
std::list< LMFRunTag > _lmfRunTags
Definition: LMFDefFabric.h:59

◆ getRunTagFromID()

LMFRunTag LMFDefFabric::getRunTagFromID ( int  runTag_id) const

Definition at line 131 of file LMFDefFabric.cc.

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

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 }
std::list< LMFRunTag > _lmfRunTags
Definition: LMFDefFabric.h:59

◆ getRunTagID()

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

Definition at line 145 of file LMFDefFabric.cc.

References LMFUnique::getID(), getRunTag(), makeGlobalPositionRcd_cfg::tag, and BeamSplash_cfg::version.

145 { return getRunTag(tag, version).getID(); }
int getID() const
Definition: LMFUnique.h:58
LMFRunTag getRunTag(std::string tag, int version) const

◆ getRunTags()

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

Definition at line 34 of file LMFDefFabric.cc.

References _lmfRunTags.

34 { return _lmfRunTags; }
std::list< LMFRunTag > _lmfRunTags
Definition: LMFDefFabric.h:59

◆ getTriggerTypes()

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

Definition at line 32 of file LMFDefFabric.cc.

References _lmfTrigTypes.

32 { return _lmfTrigTypes; }
std::list< LMFTrigType > _lmfTrigTypes
Definition: LMFDefFabric.h:58

◆ getTrigType()

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

Definition at line 87 of file LMFDefFabric.cc.

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

Referenced by getTrigTypeID().

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 }
Definition: TTTypes.h:54
std::list< LMFTrigType > _lmfTrigTypes
Definition: LMFDefFabric.h:58

◆ getTrigTypeFromID()

LMFTrigType LMFDefFabric::getTrigTypeFromID ( int  trigType_id) const

Definition at line 102 of file LMFDefFabric.cc.

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

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 }
Definition: TTTypes.h:54
std::list< LMFTrigType > _lmfTrigTypes
Definition: LMFDefFabric.h:58

◆ getTrigTypeID()

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

Definition at line 85 of file LMFDefFabric.cc.

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

Referenced by LMFRunIOV::setTriggerType().

85 { return getTrigType(sname).getID(); }
int getID() const
Definition: LMFUnique.h:58
LMFTrigType getTrigType(std::string sname) const
Definition: LMFDefFabric.cc:87

◆ initialize()

void LMFDefFabric::initialize ( void  )
noexcept

Definition at line 152 of file LMFDefFabric.cc.

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

Referenced by LMFDefFabric().

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 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
virtual std::list< std::unique_ptr< LMFUnique > > fetchAll() const noexcept(false)
Definition: LMFUnique.cc:61
T & unique_static_cast(U &i)
std::list< LMFPrimVers > _lmfPrimVersions
Definition: LMFDefFabric.h:60
std::list< LMFTrigType > _lmfTrigTypes
Definition: LMFDefFabric.h:58
std::list< LMFSeqVers > _lmfSeqVersions
Definition: LMFDefFabric.h:61
std::list< LMFCorrVers > _lmfCorrVersions
Definition: LMFDefFabric.h:62
std::list< LMFColor > _lmfColors
Definition: LMFDefFabric.h:57
std::list< LMFRunTag > _lmfRunTags
Definition: LMFDefFabric.h:59

◆ noDebug()

void LMFDefFabric::noDebug ( )

Definition at line 28 of file LMFDefFabric.cc.

References _debug.

Referenced by LMFDefFabric().

28 { _debug = false; }

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