CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
popcon::EcalTPGTPModeHandler Class Reference

#include <EcalTPGTPModeHandler.h>

Inheritance diagram for popcon::EcalTPGTPModeHandler:
popcon::PopConSourceHandler< EcalTPGTPMode >

Public Member Functions

 EcalTPGTPModeHandler (edm::ParameterSet const &)
 
void getNewObjects () override
 
std::string id () const override
 
void readFromFile (const char *inputFile)
 
void readtxtFile ()
 
void writeFile (const char *inputFile)
 
 ~EcalTPGTPModeHandler () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< EcalTPGTPMode >
void initialize (const cond::persistency::Session &dbSession, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry_t const & logDBEntry () const
 
std::pair< Container const *, std::string const > operator() (const cond::persistency::Session &session, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
cond::TagInfo_t const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Public Attributes

EcalCondDBInterfaceeconn
 

Private Member Functions

std::string to_string (char value[])
 

Private Attributes

std::string m_file_name
 
std::string m_file_type
 
unsigned int m_firstRun
 
std::string m_gentag
 
unsigned int m_i_run_number
 
std::string m_i_tag
 
int m_i_TPMode
 
int m_i_version
 
unsigned int m_lastRun
 
std::string m_location
 
std::string m_locationsource
 
std::string m_name
 
std::string m_pass
 
unsigned int m_runnr
 
std::string m_runtype
 
std::string m_sid
 
std::string m_user
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< EcalTPGTPMode >
typedef std::map< Time_t, std::shared_ptr< EcalTPGTPMode > > Container
 
typedef std::unique_ptr< EcalTPGTPModeRef
 
typedef PopConSourceHandler< EcalTPGTPModeself
 
typedef cond::Time_t Time_t
 
typedef EcalTPGTPMode value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< EcalTPGTPMode >
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< EcalTPGTPMode >
Container m_iovs
 
std::vector< std::pair< EcalTPGTPMode *, Time_t > > m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 44 of file EcalTPGTPModeHandler.h.

Constructor & Destructor Documentation

◆ EcalTPGTPModeHandler()

popcon::EcalTPGTPModeHandler::EcalTPGTPModeHandler ( edm::ParameterSet const &  ps)

Definition at line 26 of file EcalTPGTPModeHandler.cc.

References edm::ParameterSet::getParameter(), m_file_name, m_file_type, m_firstRun, m_gentag, m_lastRun, m_location, m_locationsource, m_pass, m_runtype, m_sid, m_user, and AlCaHLTBitMon_QueryRunRegistry::string.

27  : m_name(ps.getUntrackedParameter<std::string>("name", "EcalTPGTPModeHandler")) {
28  edm::LogInfo("EcalTPGTPModeHandler") << "Ecal TPG TPMode Source handler constructor.";
29  m_firstRun = static_cast<unsigned int>(atoi(ps.getParameter<std::string>("firstRun").c_str()));
30  m_lastRun = static_cast<unsigned int>(atoi(ps.getParameter<std::string>("lastRun").c_str()));
31  m_sid = ps.getParameter<std::string>("OnlineDBSID");
32  m_user = ps.getParameter<std::string>("OnlineDBUser");
33  m_pass = ps.getParameter<std::string>("OnlineDBPassword");
34  m_locationsource = ps.getParameter<std::string>("LocationSource");
35  m_location = ps.getParameter<std::string>("Location");
36  m_gentag = ps.getParameter<std::string>("GenTag");
37  m_runtype = ps.getParameter<std::string>("RunType");
38  m_file_type = ps.getParameter<std::string>("fileType"); // xml/txt
39  m_file_name = ps.getParameter<std::string>("fileName");
40 
41  edm::LogInfo("EcalTPGTPModeHandler") << m_sid << "/" << m_user << "/" << m_location << "/" << m_gentag;
42 }
Log< level::Info, false > LogInfo

◆ ~EcalTPGTPModeHandler()

popcon::EcalTPGTPModeHandler::~EcalTPGTPModeHandler ( )
override

Definition at line 44 of file EcalTPGTPModeHandler.cc.

44 {}

Member Function Documentation

◆ getNewObjects()

void popcon::EcalTPGTPModeHandler::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< EcalTPGTPMode >.

Definition at line 46 of file EcalTPGTPModeHandler.cc.

References writedatasetfile::dataset, EcalTPGTPMode::DisableEBEvenPeakFinder, EcalTPGTPMode::DisableEEEvenPeakFinder, MillePedeFileConverter_cfg::e, EcalTPGTPMode::EBFenixTcpInfobit1, EcalTPGTPMode::EBFenixTcpOutput, test_db_connect::econn, EcalTPGTPMode::EEFenixTcpInfobit1, EcalTPGTPMode::EEFenixTcpOutput, EcalTPGTPMode::EnableEBOddFilter, EcalTPGTPMode::EnableEBOddPeakFinder, EcalTPGTPMode::EnableEEOddFilter, EcalTPGTPMode::EnableEEOddPeakFinder, cppFunctionSkipper::exception, Exception, EcalTPGTPMode::FenixEBStripInfobit2, EcalTPGTPMode::FenixEBStripOutput, EcalTPGTPMode::FenixEEStripInfobit2, EcalTPGTPMode::FenixEEStripOutput, EcalTPGTPMode::FenixPar15, EcalTPGTPMode::FenixPar16, EcalTPGTPMode::FenixPar17, EcalTPGTPMode::FenixPar18, RunTPGConfigDat::getConfigTag(), FEConfigOddWeightModeDat::getDisableEBEvenPeakFinder(), FEConfigOddWeightModeDat::getDisableEEEvenPeakFinder(), FEConfigOddWeightModeDat::getEnableEBOddFilter(), FEConfigOddWeightModeDat::getEnableEBOddPeakFinder(), FEConfigOddWeightModeDat::getEnableEEOddFilter(), FEConfigOddWeightModeDat::getEnableEEOddPeakFinder(), FEConfigOddWeightModeDat::getFenixEBStripInfobit2(), FEConfigOddWeightModeDat::getFenixEBStripOutput(), FEConfigOddWeightModeDat::getFenixEBTcpInfobit1(), FEConfigOddWeightModeDat::getFenixEBTcpOutput(), FEConfigOddWeightModeDat::getFenixEEStripInfobit2(), FEConfigOddWeightModeDat::getFenixEEStripOutput(), FEConfigOddWeightModeDat::getFenixEETcpInfobit1(), FEConfigOddWeightModeDat::getFenixEETcpOutput(), RunList::getRuns(), RunTPGConfigDat::getVersion(), FEConfigMainInfo::getWei2Id(), dqmdumpme::k, test_db_connect::my_locdef, test_db_connect::my_rundef, EgHLTOffHistBins_cfi::nr, AlCaHLTBitMon_ParallelJobs::p, IODConfig::setConfigTag(), RunTag::setGeneralTag(), FEConfigOddWeightInfo::setId(), RunTag::setLocationDef(), RunTag::setRunTypeDef(), FEConfigMainInfo::setVersion(), findQualityFiles::size, AlCaHLTBitMon_QueryRunRegistry::string, and dumpRecoGeometry_cfg::tagInfo.

46  {
47  if (m_file_type == "txt") {
48  readtxtFile();
49  } else {
50  edm::LogVerbatim("EcalTPGTPModeHandler") << "Started GetNewObjects!!!";
51 
52  //check whats already inside of database
53  if (tagInfo().size) {
54  //check whats already inside of database
55  edm::LogVerbatim("EcalTPGTPModeHandler") << "got offlineInfo = ";
56  edm::LogVerbatim("EcalTPGTPModeHandler") << "tag name = " << tagInfo().name;
57  edm::LogVerbatim("EcalTPGTPModeHandler") << "size = " << tagInfo().size;
58  } else {
59  edm::LogVerbatim("EcalTPGTPModeHandler") << " First object for this tag ";
60  }
61 
62  unsigned int max_since = 0;
63  max_since = static_cast<unsigned int>(tagInfo().lastInterval.since);
64  edm::LogVerbatim("EcalTPGTPModeHandler") << "max_since : " << max_since;
65 
66  edm::LogVerbatim("EcalTPGTPModeHandler") << "retrieved last payload ";
67 
68  // here we retrieve all the runs after the last from online DB
69 
70  edm::LogVerbatim("EcalTPGTPModeHandler") << "Retrieving run list from ONLINE DB ... ";
71 
72  edm::LogVerbatim("EcalTPGTPModeHandler") << "Making connection...";
73  auto econn = std::make_shared<EcalCondDBInterface>(m_sid, m_user, m_pass);
74  edm::LogVerbatim("EcalTPGTPModeHandler") << "Done.";
75 
76  if (!econn) {
77  throw cms::Exception("OMDS not available") << " connection parameters " << m_sid << "/" << m_user;
78  }
79 
81  my_locdef.setLocation(m_location);
82 
84  my_rundef.setRunType(m_runtype);
85 
86  RunTag my_runtag;
87  my_runtag.setLocationDef(my_locdef);
88  my_runtag.setRunTypeDef(my_rundef);
89  my_runtag.setGeneralTag(m_gentag);
90 
91  readFromFile("last_tpg_TPMode_settings.txt");
92 
93  unsigned int min_run;
94 
95  if (m_firstRun < m_i_run_number) {
96  min_run = m_i_run_number + 1;
97  } else {
98  min_run = m_firstRun;
99  }
100 
101  if (min_run < max_since) {
102  min_run = max_since + 1; // we have to add 1 to the last transferred one
103  }
104 
105  edm::LogVerbatim("EcalTPGTPModeHandler")
106  << "m_i_run_number" << m_i_run_number << "m_firstRun " << m_firstRun << "max_since " << max_since;
107 
108  unsigned int max_run = m_lastRun;
109  edm::LogVerbatim("EcalTPGTPModeHandler") << "min_run= " << min_run << " max_run= " << max_run;
110 
111  RunList my_list;
112  my_list = econn->fetchGlobalRunListByLocation(my_runtag, min_run, max_run, my_locdef);
113 
114  std::vector<RunIOV> run_vec = my_list.getRuns();
115  size_t num_runs = run_vec.size();
116 
117  edm::LogVerbatim("EcalTPGTPModeHandler") << "number of runs is : " << num_runs;
118 
119  unsigned int irun = 0;
120  if (num_runs > 0) {
121  for (size_t kr = 0; kr < run_vec.size(); kr++) {
122  irun = static_cast<unsigned int>(run_vec[kr].getRunNumber());
123  edm::LogVerbatim("EcalTPGTPModeHandler") << " **************** ";
124  edm::LogVerbatim("EcalTPGTPModeHandler") << " **************** ";
125  edm::LogVerbatim("EcalTPGTPModeHandler") << " run= " << irun;
126 
127  // retrieve the data :
128  std::map<EcalLogicID, RunTPGConfigDat> dataset;
129  econn->fetchDataSet(&dataset, &run_vec[kr]);
130 
131  std::string the_config_tag = "";
132  int the_config_version = 0;
133 
134  std::map<EcalLogicID, RunTPGConfigDat>::const_iterator it;
135 
136  int nr = 0;
137  for (it = dataset.begin(); it != dataset.end(); it++) {
138  ++nr;
139  EcalLogicID ecalid = it->first;
140  RunTPGConfigDat dat = it->second;
141  the_config_tag = dat.getConfigTag();
142  the_config_version = dat.getVersion();
143  }
144 
145  // it is all the same for all SM... get the last one
146  edm::LogVerbatim("EcalTPGTPModeHandler")
147  << " run= " << irun << " tag " << the_config_tag << " version=" << the_config_version;
148 
149  // here we should check if it is the same as previous run.
150 
151  if ((the_config_tag != m_i_tag || the_config_version != m_i_version) && nr > 0) {
152  edm::LogVerbatim("EcalTPGTPModeHandler")
153  << "the tag is different from last transferred run ... retrieving last config set from DB";
154 
155  FEConfigMainInfo fe_main_info;
156  fe_main_info.setConfigTag(the_config_tag);
157  fe_main_info.setVersion(the_config_version);
158 
159  try {
160  edm::LogVerbatim("EcalTPGTPModeHandler") << " before fetch config set";
161  econn->fetchConfigSet(&fe_main_info);
162  edm::LogVerbatim("EcalTPGTPModeHandler") << " after fetch config set";
163 
164  // now get TPGTPMode
165  int wId = fe_main_info.getWei2Id();
166  if (wId != m_i_TPMode) {
167  FEConfigOddWeightInfo fe_odd_weight_info;
168  fe_odd_weight_info.setId(wId);
169  econn->fetchConfigSet(&fe_odd_weight_info);
170  std::map<EcalLogicID, FEConfigOddWeightModeDat> dataset_mode;
171  econn->fetchDataSet(&dataset_mode, &fe_odd_weight_info);
172 
173  typedef std::map<EcalLogicID, FEConfigOddWeightModeDat>::const_iterator CIfem;
174  FEConfigOddWeightModeDat rd_mode;
175 
176  int rd_modev[19] = {0};
177  int k = 0;
178  for (CIfem p = dataset_mode.begin(); p != dataset_mode.end(); p++) {
179  rd_mode = p->second;
180  rd_modev[0] = rd_mode.getEnableEBOddFilter();
181  rd_modev[1] = rd_mode.getEnableEEOddFilter();
182  rd_modev[2] = rd_mode.getEnableEBOddPeakFinder();
183  rd_modev[3] = rd_mode.getEnableEEOddPeakFinder();
184  rd_modev[4] = rd_mode.getDisableEBEvenPeakFinder();
185  rd_modev[5] = rd_mode.getDisableEEEvenPeakFinder();
186  rd_modev[6] = rd_mode.getFenixEBStripOutput();
187  rd_modev[7] = rd_mode.getFenixEEStripOutput();
188  rd_modev[8] = rd_mode.getFenixEBStripInfobit2();
189  rd_modev[9] = rd_mode.getFenixEEStripInfobit2();
190  rd_modev[10] = rd_mode.getFenixEBTcpOutput();
191  rd_modev[11] = rd_mode.getFenixEBTcpInfobit1();
192  rd_modev[12] = rd_mode.getFenixEETcpOutput();
193  rd_modev[13] = rd_mode.getFenixEETcpInfobit1();
194 
195  edm::LogVerbatim("EcalTPGTPModeHandler") << "here is the value for the weight mode: ";
196  edm::LogVerbatim("EcalTPGTPModeHandler") << " EnableEBOddFilter:" << rd_modev[0];
197  edm::LogVerbatim("EcalTPGTPModeHandler") << " EnableEEOddFilter:" << rd_modev[1];
198  edm::LogVerbatim("EcalTPGTPModeHandler") << " EnableEBOddPeakFinder:" << rd_modev[2];
199  edm::LogVerbatim("EcalTPGTPModeHandler") << " EnableEEOddPeakFinder:" << rd_modev[3];
200  edm::LogVerbatim("EcalTPGTPModeHandler") << " DisableEBEvenPeakFinder:" << rd_modev[4];
201  edm::LogVerbatim("EcalTPGTPModeHandler") << " DisableEEEvenPeakFinder:" << rd_modev[5];
202  edm::LogVerbatim("EcalTPGTPModeHandler") << " FenixEBStripOutput:" << rd_modev[6];
203  edm::LogVerbatim("EcalTPGTPModeHandler") << " FenixEEStripOutput:" << rd_modev[7];
204  edm::LogVerbatim("EcalTPGTPModeHandler") << " FenixEBStripInfobit2:" << rd_modev[8];
205  edm::LogVerbatim("EcalTPGTPModeHandler") << " FenixEEStripInfobit2:" << rd_modev[9];
206  edm::LogVerbatim("EcalTPGTPModeHandler") << " FenixEBTcpOutput:" << rd_modev[10];
207  edm::LogVerbatim("EcalTPGTPModeHandler") << " FenixEBTcpinfobit1:" << rd_modev[11];
208  edm::LogVerbatim("EcalTPGTPModeHandler") << " FenixEETcpOutput:" << rd_modev[12];
209  edm::LogVerbatim("EcalTPGTPModeHandler") << " FenixEETcpinfobit1:" << rd_modev[13];
210  k = k + 1;
211  }
212 
213  edm::LogVerbatim("EcalTPGTPModeHandler") << "*****************************************";
214  edm::LogVerbatim("EcalTPGTPModeHandler") << "read done " << wId;
215  edm::LogVerbatim("EcalTPGTPModeHandler") << "*****************************************";
216 
217  EcalTPGTPMode* tpMode = new EcalTPGTPMode;
218  tpMode->EnableEBOddFilter = rd_modev[0];
219  tpMode->EnableEEOddFilter = rd_modev[1];
220  tpMode->EnableEBOddPeakFinder = rd_modev[2];
221  tpMode->EnableEEOddPeakFinder = rd_modev[3];
222  tpMode->DisableEBEvenPeakFinder = rd_modev[4];
223  tpMode->DisableEEEvenPeakFinder = rd_modev[5];
224  tpMode->FenixEBStripOutput = rd_modev[6];
225  tpMode->FenixEEStripOutput = rd_modev[7];
226  tpMode->FenixEBStripInfobit2 = rd_modev[8];
227  tpMode->FenixEEStripInfobit2 = rd_modev[9];
228  tpMode->EBFenixTcpOutput = rd_modev[10];
229  tpMode->EBFenixTcpInfobit1 = rd_modev[11];
230  tpMode->EEFenixTcpOutput = rd_modev[12];
231  tpMode->EEFenixTcpInfobit1 = rd_modev[13];
232  tpMode->FenixPar15 = 0;
233  tpMode->FenixPar16 = 0;
234  tpMode->FenixPar17 = 0;
235  tpMode->FenixPar18 = 0;
236  Time_t snc = (Time_t)irun;
237  m_to_transfer.push_back(std::make_pair((EcalTPGTPMode*)tpMode, snc));
238 
239  m_i_run_number = irun;
240  m_i_tag = the_config_tag;
241  m_i_version = the_config_version;
242  m_i_TPMode = wId;
243 
244  writeFile("last_tpg_TPMode_settings.txt");
245 
246  } else {
247  m_i_run_number = irun;
248  m_i_tag = the_config_tag;
249  m_i_version = the_config_version;
250 
251  writeFile("last_tpg_TPMode_settings.txt");
252 
253  edm::LogVerbatim("EcalTPGTPModeHandler")
254  << " even if the tag/version is not the same, the weight group id is the same -> no transfer needed ";
255  }
256 
257  }
258 
259  catch (std::exception& e) {
260  throw cms::Exception("FileReadError") << "ERROR: THIS CONFIG DOES NOT EXIST: tag=" << the_config_tag
261  << " version=" << the_config_version << "\n"
262  << e.what();
263  }
264  edm::LogVerbatim("EcalTPGTPModeHandler") << " **************** ";
265 
266  } else if (nr == 0) {
267  m_i_run_number = irun;
268  edm::LogVerbatim("EcalTPGTPModeHandler")
269  << " no tag saved to RUN_TPGCONFIG_DAT by EcalSupervisor -> no transfer needed ";
270  edm::LogVerbatim("EcalTPGTPModeHandler") << " **************** ";
271  } else {
272  m_i_run_number = irun;
273  m_i_tag = the_config_tag;
274  m_i_version = the_config_version;
275  edm::LogVerbatim("EcalTPGTPModeHandler") << " the tag/version is the same -> no transfer needed ";
276  edm::LogVerbatim("EcalTPGTPModeHandler") << " **************** ";
277  writeFile("last_tpg_TPMode_settings.txt");
278  }
279  }
280  }
281 
282  } // usual way
283  edm::LogVerbatim("EcalTPGTPModeHandler") << "Ecal - > end of getNewObjects -----------";
284 }
Log< level::Info, true > LogVerbatim
uint16_t FenixPar15
Definition: EcalTPGTPMode.h:32
void setRunTypeDef(const RunTypeDef &runTypeDef)
Definition: RunTag.cc:42
void readFromFile(const char *inputFile)
uint16_t EBFenixTcpInfobit1
Definition: EcalTPGTPMode.h:28
std::vector< RunIOV > getRuns()
Definition: RunList.cc:25
RunList fetchGlobalRunListByLocation(const RunTag &tag, int min_run, int max_run, const LocationDef &locDef) noexcept(false)
uint16_t FenixEBStripOutput
Definition: EcalTPGTPMode.h:23
Iov_t lastInterval
Definition: Types.h:73
uint16_t FenixEEStripInfobit2
Definition: EcalTPGTPMode.h:26
uint16_t EBFenixTcpOutput
Definition: EcalTPGTPMode.h:27
uint16_t FenixPar16
Definition: EcalTPGTPMode.h:33
uint16_t EEFenixTcpInfobit1
Definition: EcalTPGTPMode.h:30
Definition: RunTag.h:13
bool EnableEEOddFilter
Definition: EcalTPGTPMode.h:18
uint16_t FenixEBStripInfobit2
Definition: EcalTPGTPMode.h:25
Time_t since
Definition: Types.h:53
size_t size
Definition: Types.h:74
int getVersion() const
uint16_t FenixPar17
Definition: EcalTPGTPMode.h:34
void fetchConfigSet(ICONF *iconf) noexcept(false)
void setVersion(int id)
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
std::string name
Definition: Types.h:72
uint16_t EEFenixTcpOutput
Definition: EcalTPGTPMode.h:29
uint16_t FenixEEStripOutput
Definition: EcalTPGTPMode.h:24
bool DisableEBEvenPeakFinder
Definition: EcalTPGTPMode.h:21
std::vector< std::pair< EcalTPGTPMode *, Time_t > > m_to_transfer
bool EnableEBOddPeakFinder
Definition: EcalTPGTPMode.h:19
bool EnableEEOddPeakFinder
Definition: EcalTPGTPMode.h:20
void setLocationDef(const LocationDef &locDef)
Definition: RunTag.cc:33
void writeFile(const char *inputFile)
bool DisableEEEvenPeakFinder
Definition: EcalTPGTPMode.h:22
std::string getConfigTag() const
void setConfigTag(std::string x)
Definition: IODConfig.h:29
void setGeneralTag(std::string tag)
Definition: RunTag.cc:24
uint16_t FenixPar18
Definition: EcalTPGTPMode.h:35
int getWei2Id() const
bool EnableEBOddFilter
Definition: EcalTPGTPMode.h:17

◆ id()

std::string popcon::EcalTPGTPModeHandler::id ( ) const
inlineoverridevirtual

Implements popcon::PopConSourceHandler< EcalTPGTPMode >.

Definition at line 51 of file EcalTPGTPModeHandler.h.

References m_name.

51 { return m_name; }

◆ readFromFile()

void popcon::EcalTPGTPModeHandler::readFromFile ( const char *  inputFile)

Definition at line 328 of file EcalTPGTPModeHandler.cc.

References makeListRunsInFiles::inputFile, mps_splice::line, str, and to_string().

328  {
329  m_i_tag = "";
330  m_i_version = 0;
331  m_i_run_number = 0;
332  m_i_TPMode = 0;
333 
334  FILE* inpFile; // input file
335  inpFile = fopen(inputFile, "r");
336  if (!inpFile) {
337  edm::LogError("EcalTPGTPModeHandler") << "*** Can not open file: " << inputFile;
338  return;
339  }
340 
341  char line[256];
342 
343  std::ostringstream str;
344 
345  fgets(line, 255, inpFile);
347  str << "gen tag " << m_i_tag << std::endl;
348 
349  fgets(line, 255, inpFile);
350  m_i_version = atoi(line);
351  str << "version= " << m_i_version << std::endl;
352 
353  fgets(line, 255, inpFile);
354  m_i_run_number = atoi(line);
355  str << "run_number= " << m_i_run_number << std::endl;
356 
357  fgets(line, 255, inpFile);
358  m_i_TPMode = atoi(line);
359  str << "TPMode_config= " << m_i_TPMode << std::endl;
360 
361  fclose(inpFile); // close inp. file
362 }
std::string to_string(char value[])
Log< level::Error, false > LogError
#define str(s)

◆ readtxtFile()

void popcon::EcalTPGTPModeHandler::readtxtFile ( )

Definition at line 286 of file EcalTPGTPModeHandler.cc.

References EcalTPGTPMode::DisableEBEvenPeakFinder, EcalTPGTPMode::DisableEEEvenPeakFinder, MillePedeFileConverter_cfg::e, EcalTPGTPMode::EBFenixTcpInfobit1, EcalTPGTPMode::EBFenixTcpOutput, EcalTPGTPMode::EEFenixTcpInfobit1, EcalTPGTPMode::EEFenixTcpOutput, EcalTPGTPMode::EnableEBOddFilter, EcalTPGTPMode::EnableEBOddPeakFinder, EcalTPGTPMode::EnableEEOddFilter, EcalTPGTPMode::EnableEEOddPeakFinder, cppFunctionSkipper::exception, Exception, EcalTPGTPMode::FenixEBStripInfobit2, EcalTPGTPMode::FenixEBStripOutput, EcalTPGTPMode::FenixEEStripInfobit2, EcalTPGTPMode::FenixEEStripOutput, submitPVResolutionJobs::key, AlCaHLTBitMon_QueryRunRegistry::string, relativeConstraints::value, and contentValuesCheck::values.

286  {
287  edm::LogVerbatim("EcalTPGTPModeHandler") << " reading the input file " << m_file_name;
288  std::ifstream fInput;
289  fInput.open(m_file_name);
290  if (!fInput.is_open()) {
291  throw cms::Exception("FileOpenError") << "ERROR : cannot open file " << m_file_name;
292  }
293  std::map<std::string, int> values;
294  EcalTPGTPMode* tpMode = new EcalTPGTPMode;
295 
297  int value;
298  while (fInput.good()) {
299  fInput >> key >> value;
300  values[key] = value;
301  }
302 
303  try {
304  tpMode->EnableEBOddFilter = values["EnableEBOddFilter"];
305  tpMode->EnableEEOddFilter = values["EnableEEOddFilter"];
306  tpMode->EnableEBOddPeakFinder = values["EnableEBOddPeakFinder"];
307  tpMode->EnableEEOddPeakFinder = values["EnableEEOddPeakFinder"];
308  tpMode->DisableEBEvenPeakFinder = values["DisableEBEvenPeakFinder"];
309  tpMode->DisableEEEvenPeakFinder = values["DisableEEEvenPeakFinder"];
310  tpMode->FenixEBStripOutput = values["FenixEBStripOutput"];
311  tpMode->FenixEEStripOutput = values["FenixEEStripOutput"];
312  tpMode->FenixEBStripInfobit2 = values["FenixEBStripInfobit2"];
313  tpMode->FenixEEStripInfobit2 = values["FenixEEStripInfobit2"];
314  tpMode->EBFenixTcpOutput = values["EBFenixTcpOutput"];
315  tpMode->EBFenixTcpInfobit1 = values["EBFenixTcpInfobit1"];
316  tpMode->EEFenixTcpOutput = values["EEFenixTcpOutput"];
317  tpMode->EEFenixTcpInfobit1 = values["EEFenixTcpInfobit1"];
318 
319  Time_t snc = (Time_t)m_firstRun;
320  m_to_transfer.push_back(std::make_pair((EcalTPGTPMode*)tpMode, snc));
321 
322  } catch (std::exception& e) {
323  throw cms::Exception("FileReadError") << "EcalTPGTPModeHandler::readtxtFile error : " << e.what();
324  }
325  edm::LogVerbatim("EcalTPGTPModeHandler") << " **************** ";
326 }
Log< level::Info, true > LogVerbatim
uint16_t EBFenixTcpInfobit1
Definition: EcalTPGTPMode.h:28
uint16_t FenixEBStripOutput
Definition: EcalTPGTPMode.h:23
uint16_t FenixEEStripInfobit2
Definition: EcalTPGTPMode.h:26
uint16_t EBFenixTcpOutput
Definition: EcalTPGTPMode.h:27
uint16_t EEFenixTcpInfobit1
Definition: EcalTPGTPMode.h:30
bool EnableEEOddFilter
Definition: EcalTPGTPMode.h:18
uint16_t FenixEBStripInfobit2
Definition: EcalTPGTPMode.h:25
uint16_t EEFenixTcpOutput
Definition: EcalTPGTPMode.h:29
uint16_t FenixEEStripOutput
Definition: EcalTPGTPMode.h:24
bool DisableEBEvenPeakFinder
Definition: EcalTPGTPMode.h:21
std::vector< std::pair< EcalTPGTPMode *, Time_t > > m_to_transfer
bool EnableEBOddPeakFinder
Definition: EcalTPGTPMode.h:19
bool EnableEEOddPeakFinder
Definition: EcalTPGTPMode.h:20
key
prepare the HTCondor submission files and eventually submit them
bool DisableEEEvenPeakFinder
Definition: EcalTPGTPMode.h:22
bool EnableEBOddFilter
Definition: EcalTPGTPMode.h:17

◆ to_string()

std::string popcon::EcalTPGTPModeHandler::to_string ( char  value[])
inlineprivate

Definition at line 62 of file EcalTPGTPModeHandler.h.

References relativeConstraints::value.

62  {
63  std::ostringstream streamOut;
64  streamOut << value;
65  return streamOut.str();
66  }

◆ writeFile()

void popcon::EcalTPGTPModeHandler::writeFile ( const char *  inputFile)

Definition at line 364 of file EcalTPGTPModeHandler.cc.

References makeListRunsInFiles::inputFile.

364  {
365  std::ofstream myfile;
366  myfile.open(inputFile);
367  myfile << m_i_tag << std::endl;
368  myfile << m_i_version << std::endl;
369  myfile << m_i_run_number << std::endl;
370  myfile << m_i_TPMode << std::endl;
371 
372  myfile.close();
373 }

Member Data Documentation

◆ econn

EcalCondDBInterface* popcon::EcalTPGTPModeHandler::econn

Definition at line 59 of file EcalTPGTPModeHandler.h.

◆ m_file_name

std::string popcon::EcalTPGTPModeHandler::m_file_name
private

Definition at line 82 of file EcalTPGTPModeHandler.h.

Referenced by EcalTPGTPModeHandler().

◆ m_file_type

std::string popcon::EcalTPGTPModeHandler::m_file_type
private

Definition at line 81 of file EcalTPGTPModeHandler.h.

Referenced by EcalTPGTPModeHandler().

◆ m_firstRun

unsigned int popcon::EcalTPGTPModeHandler::m_firstRun
private

Definition at line 68 of file EcalTPGTPModeHandler.h.

Referenced by EcalTPGTPModeHandler().

◆ m_gentag

std::string popcon::EcalTPGTPModeHandler::m_gentag
private

Definition at line 72 of file EcalTPGTPModeHandler.h.

Referenced by EcalTPGTPModeHandler().

◆ m_i_run_number

unsigned int popcon::EcalTPGTPModeHandler::m_i_run_number
private

Definition at line 84 of file EcalTPGTPModeHandler.h.

◆ m_i_tag

std::string popcon::EcalTPGTPModeHandler::m_i_tag
private

Definition at line 80 of file EcalTPGTPModeHandler.h.

◆ m_i_TPMode

int popcon::EcalTPGTPModeHandler::m_i_TPMode
private

Definition at line 85 of file EcalTPGTPModeHandler.h.

◆ m_i_version

int popcon::EcalTPGTPModeHandler::m_i_version
private

Definition at line 83 of file EcalTPGTPModeHandler.h.

◆ m_lastRun

unsigned int popcon::EcalTPGTPModeHandler::m_lastRun
private

Definition at line 69 of file EcalTPGTPModeHandler.h.

Referenced by EcalTPGTPModeHandler().

◆ m_location

std::string popcon::EcalTPGTPModeHandler::m_location
private

Definition at line 71 of file EcalTPGTPModeHandler.h.

Referenced by EcalTPGTPModeHandler().

◆ m_locationsource

std::string popcon::EcalTPGTPModeHandler::m_locationsource
private

Definition at line 76 of file EcalTPGTPModeHandler.h.

Referenced by EcalTPGTPModeHandler().

◆ m_name

std::string popcon::EcalTPGTPModeHandler::m_name
private

Definition at line 77 of file EcalTPGTPModeHandler.h.

Referenced by id().

◆ m_pass

std::string popcon::EcalTPGTPModeHandler::m_pass
private

Definition at line 75 of file EcalTPGTPModeHandler.h.

Referenced by EcalTPGTPModeHandler().

◆ m_runnr

unsigned int popcon::EcalTPGTPModeHandler::m_runnr
private

Definition at line 78 of file EcalTPGTPModeHandler.h.

◆ m_runtype

std::string popcon::EcalTPGTPModeHandler::m_runtype
private

Definition at line 79 of file EcalTPGTPModeHandler.h.

Referenced by EcalTPGTPModeHandler().

◆ m_sid

std::string popcon::EcalTPGTPModeHandler::m_sid
private

Definition at line 73 of file EcalTPGTPModeHandler.h.

Referenced by EcalTPGTPModeHandler().

◆ m_user

std::string popcon::EcalTPGTPModeHandler::m_user
private

Definition at line 74 of file EcalTPGTPModeHandler.h.

Referenced by EcalTPGTPModeHandler().