43 edm::LogInfo(
"EcalTPGBadTTHandler") <<
"Started GetNewObjects!!!";
45 unsigned int max_since = 0;
47 edm::LogInfo(
"EcalTPGBadTTHandler") <<
"max_since : " << max_since;
48 edm::LogInfo(
"EcalTPGBadTTHandler") <<
"retrieved last payload ";
51 edm::LogInfo(
"EcalTPGBadTTHandler") <<
"Retrieving run list from ONLINE DB ... ";
53 edm::LogInfo(
"EcalTPGBadTTHandler") <<
"Making connection...";
82 if (min_run < max_since) {
83 min_run = max_since + 1;
90 edm::LogInfo(
"EcalTPGBadTTHandler") <<
"min_run= " << min_run <<
"max_run= " << max_run;
96 std::vector<RunIOV> run_vec = my_list.
getRuns();
97 size_t num_runs = run_vec.size();
99 std::cout <<
"number of runs is : " << num_runs << std::endl;
103 unsigned int irun = 0;
106 std::vector<EcalLogicID> my_TTEcalLogicId_EE;
109 std::cout <<
" GOT the logic ID for the EE trigger towers " << std::endl;
111 for (
size_t kr = 0; kr < run_vec.size(); kr++) {
112 irun =
static_cast<unsigned int>(run_vec[kr].getRunNumber());
115 std::map<EcalLogicID, RunTPGConfigDat>
dataset;
119 int the_config_version = 0;
121 std::map<EcalLogicID, RunTPGConfigDat>::const_iterator it;
138 std::cout <<
" run= " << irun <<
" tag " << the_config_tag <<
" version=" << the_config_version << std::endl;
139 std::cout <<
"the tag is different from last transferred run ... retrieving last config set from DB" 150 int badttId = fe_main_info.
getBttId();
154 fe_badTT_info.
setId(badttId);
158 std::vector<FEConfigBadTTDat> dataset_TpgBadTT;
163 typedef std::vector<FEConfigBadTTDat>::const_iterator CIfeped;
170 for (
int ito = 1; ito <= 68; ito++) {
171 int tow_eta = (ito - 1) / 4;
172 int tow_phi = ((ito - 1) - tow_eta * 4);
173 int axt = (tow_eta * 5) * 20 + tow_phi * 5 + 1;
176 int tower_status = 0;
181 for (
size_t itower = 0; itower < my_TTEcalLogicId_EE.size(); itower++) {
182 int towid = my_TTEcalLogicId_EE[itower].getLogicID();
183 int tower_status = 0;
184 towerStatus->
setValue(towid, tower_status);
189 for (CIfeped
p = dataset_TpgBadTT.begin();
p != dataset_TpgBadTT.end();
p++) {
193 int tt_num = rd_badTT.
getTTId();
195 std::cout <<
" tcc/tt" << tcc_num <<
"/" << tt_num << std::endl;
197 if (tcc_num > 36 && tcc_num <= 72) {
199 int smid = tcc_num - 54;
203 int towerid = tt_num;
205 int tow_eta = (towerid - 1) / 4;
206 int tow_phi = ((towerid - 1) - tow_eta * 4);
207 int axt = (tow_eta * 5) * 20 + tow_phi * 5 + 1;
220 int towerid = tt_num;
222 bool set_the_tower =
false;
224 for (
size_t itower = 0; itower < my_TTEcalLogicId_EE.size(); itower++) {
225 if (!set_the_tower) {
226 if (my_TTEcalLogicId_EE[itower].getID1() == tccid &&
227 my_TTEcalLogicId_EE[itower].getID2() == towerid) {
228 towid = my_TTEcalLogicId_EE[itower].getLogicID();
229 set_the_tower =
true;
239 std::cout <<
" these may be the additional towers TCC/TT " << tccid <<
"/" << towerid << std::endl;
246 edm::LogInfo(
"EcalTPGBadTTHandler") <<
"Finished badTT reading.";
257 writeFile(
"last_tpg_badTT_settings.txt");
264 writeFile(
"last_tpg_badTT_settings.txt");
272 std::cout <<
"ERROR: THIS CONFIG DOES NOT EXIST: tag=" << the_config_tag <<
" version=" << the_config_version
278 }
else if (
nr == 0) {
286 writeFile(
"last_tpg_badTT_settings.txt");
293 edm::LogInfo(
"EcalTPGBadTTHandler") <<
"Ecal - > end of getNewObjects -----------";
void setRunTypeDef(const RunTypeDef &runTypeDef)
std::vector< RunIOV > getRuns()
RunList fetchGlobalRunListByLocation(const RunTag &tag, int min_run, int max_run, const LocationDef &locDef) noexcept(false)
unsigned int m_i_run_number
void fetchConfigSet(ICONF *iconf) noexcept(false)
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
cond::TagInfo_t const & tagInfo() const
std::vector< EcalLogicID > getEcalLogicIDSetOrdered(std::string name, int fromId1, int toId1, int fromId2=EcalLogicID::NULLID, int toId2=EcalLogicID::NULLID, int fromId3=EcalLogicID::NULLID, int toId3=EcalLogicID::NULLID, std::string mapsTo="", int orderedBy=EcalLogicID::NULLID) noexcept(false)
void writeFile(const char *inputFile)
std::vector< std::pair< EcalTPGTowerStatus *, Time_t > > m_to_transfer
void setLocationDef(const LocationDef &locDef)
Log< level::Info, false > LogInfo
std::string id() const override
EcalCondDBInterface * econn
constexpr uint32_t rawId() const
get the raw id
void readFromFile(const char *inputFile)
std::string getConfigTag() const
void setConfigTag(std::string x)
void setValue(const uint32_t &id, const uint16_t &val)
void fetchConfigDataSet(std::vector< DATT > *fillMap, ICONF *iconf) noexcept(false)
void setGeneralTag(std::string tag)
static const int SMCRYSTALMODE
int ism(int ieta, int iphi)