66 std::cout <<
"object Key " << objectKey << std::endl;
68 if (objectKey ==
"NULL" || objectKey.empty()) {
69 return std::make_unique<L1CaloEcalScale>(0);
71 if (objectKey ==
"IDENTITY") {
72 return std::make_unique<L1CaloEcalScale>(1);
78 std::vector<std::string> mainStrings;
82 std::vector<std::string> paramStrings;
83 paramStrings.push_back(
"LOGIC_ID");
84 paramStrings.push_back(
"ETSAT");
86 std::vector<std::string> IDStrings;
87 IDStrings.push_back(
"NAME");
88 IDStrings.push_back(
"ID1");
89 IDStrings.push_back(
"ID2");
90 IDStrings.push_back(
"maps_to");
94 "FE_CONFIG_LUTPARAM_DAT",
95 "FE_CONFIG_LUTPARAM_DAT.LUT_CONF_ID",
100 edm::LogError(
"L1-O2O") <<
"Problem with L1CaloEcalScale key. Unable to find lutparam dat table";
101 return std::unique_ptr<L1CaloEcalScale>();
118 if (ecid_name ==
"EB")
119 eb_lsb = etSat / 1024;
120 else if (
"EE" == ecid_name)
121 ee_lsb = etSat / 1024;
124 <<
"Problem with L1CaloEcalScale LOGIC_ID. unable to find channel view with appropiate logic id";
125 return std::unique_ptr<L1CaloEcalScale>();
130 std::vector<std::string> grpLUT;
131 grpLUT.push_back(
"GROUP_ID");
132 grpLUT.push_back(
"LUT_ID");
133 grpLUT.push_back(
"LUT_VALUE");
137 "FE_LUT_PER_GROUP_DAT",
138 "FE_LUT_PER_GROUP_DAT.LUT_CONF_ID",
143 edm::LogError(
"L1-O2O") <<
"Problem with L1CaloEcalScale key. No group info";
144 return std::unique_ptr<L1CaloEcalScale>();
148 for (
int i = 0;
i < nEntries;
i++) {
163 std::map<int, std::vector<int> > tpgValueMap;
165 std::map<int, std::vector<int>*>::iterator grpIt;
167 const std::vector<int>* lut_ = grpIt->second;
169 std::vector<int> tpgValue;
170 tpgValue.resize(256);
172 for (
int tpg = 0; tpg < 256; tpg++) {
173 for (
int i = 0;
i < 1024;
i++) {
174 if (tpg == (0xff & (lut_->at(
i)))) {
182 tpgValueMap[grpIt->first] = tpgValue;
185 std::vector<std::string> groupMap;
186 groupMap.push_back(
"LOGIC_ID");
187 groupMap.push_back(
"GROUP_ID");
192 "FE_CONFIG_LUT_DAT.LUT_CONF_ID",
196 edm::LogError(
"L1-O2O") <<
"Problem with L1CaloEcalScale key. No fe_config_lut_dat info";
197 return std::unique_ptr<L1CaloEcalScale>();
201 for (
int i = 0;
i < nEntries; ++
i) {
213 edm::LogError(
"L1-O2O") <<
"Problem with L1CaloEcalScale key. Unable to find logic_id channel view";
214 return std::unique_ptr<L1CaloEcalScale>();
221 if (logic_id >= 2100001901 && logic_id <= 2100001916)
223 if (ecid_name != maps_to) {
226 if (ecid_name ==
"EB_trigger_tower" || ecid_name ==
"EE_trigger_tower") {
231 if (ecid_name ==
"EB_trigger_tower")
261 auto ecalScale = std::make_unique<L1CaloEcalScale>(0);
265 double et_lsb = (ieta <= 17) ? eb_lsb : ee_lsb;
266 for (
int pos = 0; pos <= 1; pos++) {
270 for (
int iphi = 1; iphi <= 72; iphi++) {
275 if (itLut != gMap.end()) {
277 std::vector<int> tpgValue = tpgValueMap[itLut->second];
280 ecalScale->setBin(irank, ieta, zside, et_lsb * tpgValue[irank]);
const EcalTPGGroupsMap & getMap() const
bool fillVariable(const std::string &columnName, T &outputVariable) const
const QueryResults singleAttribute(const T &data) const
std::map< uint32_t, uint32_t >::const_iterator EcalTPGGroupsMapItr
std::map< int, std::vector< int > * > groupInfo
~L1CaloEcalScaleConfigOnlineProd() override
EcalTrigTowerDetId getTrigTowerDetId(int TCCid, int iTT) const
Builds a EcalTrigTowerDetID from the TCCid & TriggerTower index in TCC.
Log< level::Error, false > LogError
EcalTPGGroups * lutGrpMap
bool fillVariableFromRow(const std::string &columnName, int rowNumber, T &outputVariable) const
L1CaloEcalScaleConfigOnlineProd(const edm::ParameterSet &)
const QueryResults basicQuery(const std::vector< std::string > &columnNames, const std::string &schemaName, const std::string &tableName, const std::string &conditionLHS="", const QueryResults conditionRHS=QueryResults(), const std::string &conditionRHSName="")
void setValue(const uint32_t &rawId, const uint32_t &ObjectId)
l1t::OMDSReader m_omdsReader
const EcalElectronicsMapping * theMapping_
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
static bool validDetId(int iz, EcalSubdetector sd, int i, int j)
check if a valid index combination
static const unsigned short nBinRank
static const unsigned short nBinEta
std::map< uint32_t, uint32_t > EcalTPGGroupsMap
Power< A, B >::type pow(const A &a, const B &b)
std::unique_ptr< L1CaloEcalScale > newObject(const std::string &objectKey) override