CMS 3D CMS Logo

LMFDefFabric.cc
Go to the documentation of this file.
7 
8 #include <iostream>
9 
11 
12 LMFDefFabric::LMFDefFabric(oracle::occi::Environment *env, oracle::occi::Connection *conn) {
13  noDebug();
15  initialize();
16 }
17 
19  noDebug();
20  setConnection(c->getEnv(), c->getConn());
21  initialize();
22 }
23 
25 
26 void LMFDefFabric::debug() { _debug = true; }
27 
28 void LMFDefFabric::noDebug() { _debug = false; }
29 
30 std::list<LMFColor> LMFDefFabric::getColors() const { return _lmfColors; }
31 
32 std::list<LMFTrigType> LMFDefFabric::getTriggerTypes() const { return _lmfTrigTypes; }
33 
34 std::list<LMFRunTag> LMFDefFabric::getRunTags() const { return _lmfRunTags; }
35 
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 }
50 
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 }
65 
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 }
80 
81 int LMFDefFabric::getColorID(std::string sname) const { return getColor(sname).getID(); }
82 
83 int LMFDefFabric::getColorID(int index) const { return getColor(index).getID(); }
84 
85 int LMFDefFabric::getTrigTypeID(std::string sname) const { return getTrigType(sname).getID(); }
86 
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 }
101 
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 }
116 
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 }
130 
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 }
144 
146 
147 void LMFDefFabric::initialize() noexcept(false) {
148  _lmfColors.clear();
149  _lmfTrigTypes.clear();
150  _lmfRunTags.clear();
151  _lmfPrimVersions.clear();
152  _lmfSeqVersions.clear();
153  _lmfCorrVersions.clear();
154  if ((m_env != nullptr) && (m_conn != nullptr)) {
155  boost::ptr_list<LMFUnique> listOfObjects;
156  boost::ptr_list<LMFUnique>::const_iterator i;
157  boost::ptr_list<LMFUnique>::const_iterator e;
158  listOfObjects = LMFColor(m_env, m_conn).fetchAll();
159  i = listOfObjects.begin();
160  e = listOfObjects.end();
161  while (i != e) {
162  const LMFColor *c = static_cast<const LMFColor *>(&(*i));
163  _lmfColors.push_back(*c);
164  i++;
165  }
166  listOfObjects.clear();
167  listOfObjects = LMFTrigType(m_env, m_conn).fetchAll();
168  i = listOfObjects.begin();
169  e = listOfObjects.end();
170  while (i != e) {
171  const LMFTrigType *c = static_cast<const LMFTrigType *>(&(*i));
172  _lmfTrigTypes.push_back(*c);
173  i++;
174  }
175  listOfObjects.clear();
176  listOfObjects = LMFRunTag(m_env, m_conn).fetchAll();
177  i = listOfObjects.begin();
178  e = listOfObjects.end();
179  while (i != e) {
180  const LMFRunTag *c = static_cast<const LMFRunTag *>(&(*i));
181  _lmfRunTags.push_back(*c);
182  i++;
183  }
184  listOfObjects.clear();
185  listOfObjects = LMFPrimVers(m_env, m_conn).fetchAll();
186  i = listOfObjects.begin();
187  e = listOfObjects.end();
188  while (i != e) {
189  const LMFPrimVers *c = static_cast<const LMFPrimVers *>(&(*i));
190  _lmfPrimVersions.push_back(*c);
191  i++;
192  }
193  listOfObjects.clear();
194  listOfObjects = LMFCorrVers(m_env, m_conn).fetchAll();
195  i = listOfObjects.begin();
196  e = listOfObjects.end();
197  while (i != e) {
198  const LMFCorrVers *c = static_cast<const LMFCorrVers *>(&(*i));
199  _lmfCorrVersions.push_back(*c);
200  i++;
201  }
202  listOfObjects.clear();
203  listOfObjects = LMFSeqVers(m_env, m_conn).fetchAll();
204  i = listOfObjects.begin();
205  e = listOfObjects.end();
206  while (i != e) {
207  const LMFSeqVers *c = static_cast<const LMFSeqVers *>(&(*i));
208  _lmfSeqVersions.push_back(*c);
209  i++;
210  }
211  listOfObjects.clear();
212  _lmfColors.sort();
213  _lmfTrigTypes.sort();
214  _lmfRunTags.sort();
215  _lmfPrimVersions.sort();
216  _lmfSeqVersions.sort();
217  _lmfCorrVersions.sort();
218  } else {
219  throw(
220  std::runtime_error("LMFDefFabric: cannot initialize since connection not"
221  "set"));
222  }
223 }
224 
226  std::cout << "========= Fabric dump @ address " << this << " ============" << std::endl;
227  std::list<LMFColor>::const_iterator i1 = _lmfColors.begin();
228  std::list<LMFTrigType>::const_iterator i2 = _lmfTrigTypes.begin();
229  std::list<LMFRunTag>::const_iterator i3 = _lmfRunTags.begin();
230  std::list<LMFPrimVers>::const_iterator i4 = _lmfPrimVersions.begin();
231  std::list<LMFSeqVers>::const_iterator i5 = _lmfSeqVersions.begin();
232  std::list<LMFCorrVers>::const_iterator i6 = _lmfCorrVersions.begin();
233  std::list<LMFColor>::const_iterator e1 = _lmfColors.end();
234  std::list<LMFTrigType>::const_iterator e2 = _lmfTrigTypes.end();
235  std::list<LMFRunTag>::const_iterator e3 = _lmfRunTags.end();
236  std::list<LMFPrimVers>::const_iterator e4 = _lmfPrimVersions.end();
237  std::list<LMFSeqVers>::const_iterator e5 = _lmfSeqVersions.end();
238  std::list<LMFCorrVers>::const_iterator e6 = _lmfCorrVersions.end();
239  std::cout << "=== Colors" << std::endl;
240  while (i1 != e1) {
241  i1++->dump();
242  }
243  std::cout << "=== Trigger Types" << std::endl;
244  while (i2 != e2) {
245  i2++->dump();
246  }
247  std::cout << "=== Run Tags" << std::endl;
248  while (i3 != e3) {
249  i3++->dump();
250  }
251  std::cout << "=== Prim. Vers." << std::endl;
252  while (i4 != e4) {
253  i4++->dump();
254  }
255  std::cout << "=== Seq. Vers." << std::endl;
256  while (i5 != e5) {
257  i5++->dump();
258  }
259  std::cout << "=== Corr. Vers." << std::endl;
260  while (i6 != e6) {
261  i6++->dump();
262  }
263 }
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
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:355
LMFTrigType.h
funct::false
false
Definition: Factorize.h:34
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
LMFDefFabric::getColors
std::list< LMFColor > getColors() const
Definition: LMFDefFabric.cc:30
SiStripCommissioningClient_cfg.conn
conn
Definition: SiStripCommissioningClient_cfg.py:5
LMFColor
Definition: LMFColor.h:12
LMFDefFabric::getTrigTypeID
int getTrigTypeID(std::string sname) const
Definition: LMFDefFabric.cc:85
LMFUnique::fetchAll
virtual boost::ptr_list< LMFUnique > fetchAll() const noexcept(false)
Definition: LMFUnique.cc:61
LMFDefFabric::getRunTags
std::list< LMFRunTag > getRunTags() const
Definition: LMFDefFabric.cc:34
LMFDefFabric::getTrigTypeFromID
LMFTrigType getTrigTypeFromID(int trigType_id) const
Definition: LMFDefFabric.cc:102
LMFDefFabric::getColorID
int getColorID(std::string name) const
Definition: LMFDefFabric.cc:81
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:147
LMFSeqVers.h
LMFDefFabric::_lmfColors
std::list< LMFColor > _lmfColors
Definition: LMFDefFabric.h:57
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
web.browse_db.env
env
Definition: browse_db.py:18
LMFDefFabric::getColor
LMFColor getColor(std::string name) const
Definition: LMFDefFabric.cc:36
LMFRunTag.h
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
LMFColor.h
LMFDefFabric::getRunTagFromID
LMFRunTag getRunTagFromID(int runTag_id) const
Definition: LMFDefFabric.cc:131
LMFDefFabric::debug
void debug()
Definition: LMFDefFabric.cc:26
SiPixelPhase1Clusters_cfi.e3
e3
Definition: SiPixelPhase1Clusters_cfi.py:9
LMFDefFabric::_lmfSeqVersions
std::list< LMFSeqVers > _lmfSeqVersions
Definition: LMFDefFabric.h:61
LMFDefFabric.h
LMFUnique::getID
int getID() const
Definition: LMFUnique.h:54
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::dump
void dump()
Definition: LMFDefFabric.cc:225
LMFDefFabric::_debug
bool _debug
Definition: LMFDefFabric.h:55
LMFPrimVers.h
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::LMFDefFabric
LMFDefFabric()
Definition: LMFDefFabric.cc:10
LMFDefFabric::getColorFromID
LMFColor getColorFromID(int color_id) const
Definition: LMFDefFabric.cc:51
LMFDefFabric::getTriggerTypes
std::list< LMFTrigType > getTriggerTypes() const
Definition: LMFDefFabric.cc:32
LMFDefFabric::_lmfRunTags
std::list< LMFRunTag > _lmfRunTags
Definition: LMFDefFabric.h:59
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
LMFDefFabric::getRunTagID
int getRunTagID(std::string tag, int version) const
Definition: LMFDefFabric.cc:145
LMFDefFabric::~LMFDefFabric
~LMFDefFabric() override
Definition: LMFDefFabric.cc:24
vertexPlots.e4
e4
Definition: vertexPlots.py:64
LMFDefFabric::noDebug
void noDebug()
Definition: LMFDefFabric.cc:28
EcalDBConnection
Definition: EcalDBConnection.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37