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);
188 for (CIfeped
p = dataset_TpgBadTT.begin();
p != dataset_TpgBadTT.end();
p++) {
192 int tt_num = rd_badTT.
getTTId();
194 std::cout <<
" tcc/tt" << tcc_num <<
"/" << tt_num << std::endl;
196 if (tcc_num > 36 && tcc_num <= 72) {
198 int smid = tcc_num - 54;
202 int towerid = tt_num;
204 int tow_eta = (towerid - 1) / 4;
205 int tow_phi = ((towerid - 1) - tow_eta * 4);
206 int axt = (tow_eta * 5) * 20 + tow_phi * 5 + 1;
218 int towerid = tt_num;
220 bool set_the_tower =
false;
222 for (
size_t itower = 0; itower < my_TTEcalLogicId_EE.size(); itower++) {
223 if (!set_the_tower) {
224 if (my_TTEcalLogicId_EE[itower].getID1() == tccid &&
225 my_TTEcalLogicId_EE[itower].getID2() == towerid) {
226 towid = my_TTEcalLogicId_EE[itower].getLogicID();
227 set_the_tower =
true;
237 std::cout <<
" these may be the additional towers TCC/TT " << tccid <<
"/" << towerid << std::endl;
242 edm::LogInfo(
"EcalTPGBadTTHandler") <<
"Finished badTT reading.";
253 writeFile(
"last_tpg_badTT_settings.txt");
260 writeFile(
"last_tpg_badTT_settings.txt");
268 std::cout <<
"ERROR: THIS CONFIG DOES NOT EXIST: tag=" << the_config_tag <<
" version=" << the_config_version
274 }
else if (
nr == 0) {
282 writeFile(
"last_tpg_badTT_settings.txt");
289 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)