432 std::ostringstream
ss;
433 ss <<
"EcalLaserDbAnalyzer::analyze\n";
435 ss <<
"EcalLaserDbAnalyzer::analyze-> got EcalLaserDbRecord: \n";
442 for (italpha = laserAlphaMap.barrelItems().begin(); italpha != laserAlphaMap.barrelItems().end(); ++italpha) {
443 if (cnt % 1000 == 0) {
445 ss <<
" Barrel ALPHA = " << (*italpha) <<
" cmsswId " << ebdetid.
rawId() <<
"\n";
449 ss <<
"Number of barrel Alpha parameters : " << cnt <<
"\n";
452 for (italpha = laserAlphaMap.endcapItems().begin(); italpha != laserAlphaMap.endcapItems().end(); ++italpha) {
453 if (cnt % 1000 == 0) {
455 ss <<
"EndCap ALPHA = " << (*italpha) <<
" cmsswId " << eedetid.
rawId() <<
"\n";
459 ss <<
"Number of Endcap Alpha parameters : " << cnt <<
"\n";
468 edm::LogInfo(
"TopInfo") <<
"INFO: READING transparency correction files"
470 ss <<
"INFO: READING transparency correction files\n";
477 transparency.getline(buf,
sizeof(buf),
'\n');
479 while (transparency) {
480 std::stringstream
sin(buf);
485 double xtal_trans_corr;
486 sin >> xtal_trans_corr;
489 ss << raw_xtal_id <<
" " << xtal_trans_corr <<
"\n";
494 transparency.getline(buf,
sizeof(buf),
'\n');
496 transparency.close();
497 ss <<
"INFO: DONE transparency correction files " << xtalcounter <<
"\n";
502 edm::LogInfo(
"TopInfo") <<
"INFO: READING transparency correction tag"
510 for (
int ib = 0;
ib < 61200;
ib++) {
517 for (
int ie = 0; ie < 14648; ie++) {
523 ss <<
"INFO: DONE transparency correction tag\n";
530 TFile saving(
"EcalTPGParam.root",
"recreate");
532 TH2F* ICEB =
new TH2F(
"ICEB",
"IC: Barrel", 360, 1, 361, 172, -86, 86);
533 ICEB->GetYaxis()->SetTitle(
"eta index");
534 ICEB->GetXaxis()->SetTitle(
"phi index");
535 TH2F* tpgFactorEB =
new TH2F(
"tpgFactorEB",
"tpgFactor: Barrel", 360, 1, 361, 172, -86, 86);
536 tpgFactorEB->GetYaxis()->SetTitle(
"eta index");
537 tpgFactorEB->GetXaxis()->SetTitle(
"phi index");
539 TH2F* ICEEPlus =
new TH2F(
"ICEEPlus",
"IC: Plus Endcap", 120, -9, 111, 120, -9, 111);
540 ICEEPlus->GetYaxis()->SetTitle(
"y index");
541 ICEEPlus->GetXaxis()->SetTitle(
"x index");
542 TH2F* tpgFactorEEPlus =
new TH2F(
"tpgFactorEEPlus",
"tpgFactor: Plus Endcap", 120, -9, 111, 120, -9, 111);
543 tpgFactorEEPlus->GetYaxis()->SetTitle(
"y index");
544 tpgFactorEEPlus->GetXaxis()->SetTitle(
"x index");
545 TH2F* ICEEMinus =
new TH2F(
"ICEEMinus",
"IC: Minus Endcap", 120, -9, 111, 120, -9, 111);
546 ICEEMinus->GetYaxis()->SetTitle(
"y index");
547 ICEEMinus->GetXaxis()->SetTitle(
"x index");
548 TH2F* tpgFactorEEMinus =
new TH2F(
"tpgFactorEEMinus",
"tpgFactor: Minus Endcap", 120, -9, 111, 120, -9, 111);
549 tpgFactorEEMinus->GetYaxis()->SetTitle(
"y index");
550 tpgFactorEEMinus->GetXaxis()->SetTitle(
"x index");
552 TH2F* IC =
new TH2F(
"IC",
"IC", 720, -acos(-1.), acos(-1.), 600, -3., 3.);
553 IC->GetYaxis()->SetTitle(
"eta");
554 IC->GetXaxis()->SetTitle(
"phi");
555 TH2F* tpgFactor =
new TH2F(
"tpgFactor",
"tpgFactor", 720, -acos(-1.), acos(-1.), 600, -3., 3.);
556 tpgFactor->GetYaxis()->SetTitle(
"eta");
557 tpgFactor->GetXaxis()->SetTitle(
"phi");
559 TH1F* hshapeEB =
new TH1F(
"shapeEB",
"shapeEB", 250, 0., 10.);
560 TH1F* hshapeEE =
new TH1F(
"shapeEE",
"shapeEE", 250, 0., 10.);
562 TTree* ntuple =
new TTree(
"tpgmap",
"TPG geometry map");
564 "fed",
"tcc",
"tower",
"stripInTower",
"xtalInStrip",
"CCU",
"VFE",
"xtalInVFE",
"xtalInCCU",
565 "ieta",
"iphi",
"ix",
"iy",
"iz",
"hashedId",
"ic",
"cmsswId",
"dbId",
566 "ietaTT",
"iphiTT",
"TCCch",
"TCCslot",
"SLBch",
"SLBslot",
"ietaGCT",
"iphiGCT"};
568 for (
int i = 0;
i < 26;
i++)
569 ntuple->Branch(branchFloat[
i].c_str(), &
ntupleInts_[
i], (branchFloat[
i] +
string(
"/I")).c_str());
573 TNtuple* ntupleSpike =
new TNtuple(
"spikeParam",
"Spike parameters",
"gainId:theta:G:g:ped:pedLin");
578 list<uint32_t> towerListEB;
579 list<uint32_t> stripListEB;
580 list<uint32_t> towerListEE;
581 list<uint32_t> stripListEE;
582 list<uint32_t>::iterator itList;
584 map<int, uint32_t> stripMapEB;
585 map<int, uint32_t> stripMapEE;
586 map<uint32_t, uint32_t> stripMapEBsintheta;
593 ss <<
"Getting the pedestals from offline DB...\n";
597 const auto& pedMapEB = pedMap.barrelItems();
598 const auto& pedMapEE = pedMap.endcapItems();
601 for (pedIter = pedMapEB.begin(); pedIter != pedMapEB.end() && nPed < 10; ++pedIter, ++nPed) {
602 const auto aped = (*pedIter);
603 ss << aped.mean_x12 <<
", " << aped.mean_x6 <<
", " << aped.mean_x1 <<
"\n";
605 for (pedIter = pedMapEE.begin(); pedIter != pedMapEE.end() && nPed < 10; ++pedIter, ++nPed) {
606 const auto aped = (*pedIter);
607 ss << aped.mean_x12 <<
", " << aped.mean_x6 <<
", " << aped.mean_x1 <<
"\n";
610 ss <<
"Getting the pedestals from previous configuration\n";
616 ss <<
"trying to read previous tag if it exists tag=" <<
tag_ <<
".version" <<
version_ <<
"\n";
624 std::map<EcalLogicID, FEConfigPedDat> dataset_TpgPed;
627 typedef std::map<EcalLogicID, FEConfigPedDat>::const_iterator CIfeped;
631 for (CIfeped
p = dataset_TpgPed.begin();
p != dataset_TpgPed.end();
p++) {
638 if (ecid_name ==
"EB_crystal_number") {
639 int sm_num = ecid_xt.
getID1();
640 int xt_num = ecid_xt.
getID2();
652 ss <<
" copy the EB data "
653 <<
" ped = " << item.mean_x12 <<
"\n";
658 }
else if (ecid_name ==
"EE_crystal_number") {
680 const auto& pedMapEE = pedMap.endcapItems();
683 for (pedIter = pedMapEB.begin(); pedIter != pedMapEB.end() && nPed < 10; ++pedIter, ++nPed) {
684 const auto aped = (*pedIter);
685 ss << aped.mean_x12 <<
", " << aped.mean_x6 <<
", " << aped.mean_x1 <<
"\n";
687 for (pedIter = pedMapEE.begin(); pedIter != pedMapEE.end() && nPed < 10; ++pedIter, ++nPed) {
688 const auto aped = (*pedIter);
689 ss << aped.mean_x12 <<
", " << aped.mean_x6 <<
", " << aped.mean_x1 <<
"\n";
693 ss <<
"Getting the pedestals from configuration number" <<
m_write_ped <<
"\n";
698 fe_ped_info.
setId(m_write_ped);
700 std::map<EcalLogicID, FEConfigPedDat> dataset_TpgPed;
703 typedef std::map<EcalLogicID, FEConfigPedDat>::const_iterator CIfeped;
707 for (CIfeped
p = dataset_TpgPed.begin();
p != dataset_TpgPed.end();
p++) {
714 if (ecid_name ==
"EB_crystal_number") {
717 <<
" icells = " << icells <<
"\n";
718 int sm_num = ecid_xt.
getID1();
719 int xt_num = ecid_xt.
getID2();
732 }
else if (ecid_name ==
"EE_crystal_number") {
754 const auto& pedMapEE = pedMap.endcapItems();
757 for (pedIter = pedMapEB.begin(); pedIter != pedMapEB.end() && nPed < 10; ++pedIter, ++nPed) {
758 const auto aped = (*pedIter);
759 ss << aped.mean_x12 <<
", " << aped.mean_x6 <<
", " << aped.mean_x1 <<
"\n";
761 for (pedIter = pedMapEE.begin(); pedIter != pedMapEE.end() && nPed < 10; ++pedIter, ++nPed) {
762 const auto aped = (*pedIter);
763 ss << aped.mean_x12 <<
", " << aped.mean_x6 <<
", " << aped.mean_x1 <<
"\n";
771 ss <<
"Getting intercalib from offline DB...\n";
775 const auto& calibMapEE = calibMap.endcapItems();
778 for (calIter = calibMapEB.begin(); calIter != calibMapEB.end() && nCal < 10; ++calIter, ++nCal) {
779 ss << (*calIter) <<
"\n";
781 for (calIter = calibMapEE.begin(); calIter != calibMapEE.end() && nCal < 10; ++calIter, ++nCal) {
782 ss << (*calIter) <<
"\n";
786 float calibvec[1700];
788 edm::LogInfo(
"TopInfo") <<
"H2: overwriting IC coef with file"
794 if (calibfile.is_open()) {
795 calibfile >> strdata >> strdata >> strdata >> strdata >> strdata;
796 while (!calibfile.eof()) {
797 calibfile >> idata >> icry >> fcali >> fdata >> fdata;
798 calibvec[icry - 1] = fcali;
799 if (calibfile.eof()) {
807 ss <<
"Getting the gain ratios from offline DB...\n";
809 const auto& gainMapEB = gainMap.barrelItems();
810 const auto& gainMapEE = gainMap.endcapItems();
813 for (gainIter = gainMapEB.begin(); gainIter != gainMapEB.end() && nGain < 10; ++gainIter, ++nGain) {
814 const auto aGain = (*gainIter);
815 ss << aGain.gain12Over6() <<
", " << aGain.gain6Over1() * aGain.gain12Over6() <<
"\n";
817 for (gainIter = gainMapEE.begin(); gainIter != gainMapEE.end() && nGain < 10; ++gainIter, ++nGain) {
818 const auto aGain = (*gainIter);
819 ss << aGain.gain12Over6() <<
", " << aGain.gain6Over1() * aGain.gain12Over6() <<
"\n";
825 ss <<
"Getting the ADC to GeV from offline DB...\n";
832 vector<EcalLogicID> my_EcalLogicId;
833 vector<EcalLogicID> my_TTEcalLogicId;
834 vector<EcalLogicID> my_StripEcalLogicId;
838 vector<EcalLogicID> my_TTEcalLogicId_EE;
839 vector<EcalLogicID> my_RTEcalLogicId_EE;
840 vector<EcalLogicID> my_StripEcalLogicId1_EE;
841 vector<EcalLogicID> my_StripEcalLogicId2_EE;
842 vector<EcalLogicID> my_CrystalEcalLogicId_EE;
843 vector<EcalLogicID> my_TTEcalLogicId_EB_by_TCC;
844 vector<EcalLogicID> my_StripEcalLogicId_EE_strips_by_TCC;
853 "EB_VFE", 1, 36, 1, 68, 1, 5,
"EB_VFE", 123);
854 ss <<
"got the 3 ecal barrel logic id set\n";
857 my_CrystalEcalLogicId_EE =
862 my_StripEcalLogicId1_EE =
866 my_StripEcalLogicId2_EE =
871 my_StripEcalLogicId_EE_strips_by_TCC =
893 ss <<
"Getting the latest ids for this tag (latest version) "
899 ss <<
"trying to read previous tag if it exists tag=" <<
tag_ <<
".version" << version_ <<
"\n";
927 map<EcalLogicID, FEConfigPedDat> pedset;
928 map<EcalLogicID, FEConfigLinDat> linset;
929 map<EcalLogicID, FEConfigLinParamDat> linparamset;
930 map<EcalLogicID, FEConfigLUTParamDat> lutparamset;
931 map<EcalLogicID, FEConfigFgrParamDat> fgrparamset;
933 map<int, linStruc> linEtaSlice;
937 int NbOfStripPerTCC[108][68];
938 for (
int i = 0;
i < 108;
i++)
939 for (
int j = 0;
j < 68;
j++)
940 NbOfStripPerTCC[
i][
j] = 0;
943 for (vector<DetId>::const_iterator it = ebCells.begin(); it != ebCells.end(); ++it) {
950 if (stripInTower > NbOfStripPerTCC[tccNb - 1][towerInTCC - 1])
951 NbOfStripPerTCC[tccNb - 1][towerInTCC - 1] = stripInTower;
953 for (vector<DetId>::const_iterator it = eeCells.begin(); it != eeCells.end(); ++it) {
960 if (stripInTower > NbOfStripPerTCC[tccNb - 1][towerInTCC - 1])
961 NbOfStripPerTCC[tccNb - 1][towerInTCC - 1] = stripInTower;
966 (*out_file_) <<
"COMMENT ====== barrel crystals ====== " << std::endl;
969 for (vector<DetId>::const_iterator it = ebCells.begin(); it != ebCells.end(); ++it) {
984 int xtalInVFE = Id.
xtalId();
985 int xtalWithinCCUid = 5 * (VFEid - 1) + xtalInVFE - 1;
987 (*geomFile_) <<
"dccNb = " << dccNb <<
" tccNb = " << tccNb <<
" towerInTCC = " << towerInTCC
988 <<
" stripInTower = " << stripInTower <<
" xtalInStrip = " << xtalInStrip <<
" CCUid = " << CCUid
989 <<
" VFEid = " << VFEid <<
" xtalInVFE = " << xtalInVFE <<
" xtalWithinCCUid = " << xtalWithinCCUid
990 <<
" ieta = " <<
id.ieta() <<
" iphi = " <<
id.iphi() <<
" xtalhashedId = " <<
id.hashedIndex()
991 <<
" xtalNb = " <<
id.ic() <<
" ietaTT = " << towid.
ieta() <<
" iphiTT = " << towid.
iphi()
994 int TCCch = towerInTCC;
995 int SLBslot = int((towerInTCC - 1) / 8.) + 1;
996 int SLBch = (towerInTCC - 1) % 8 + 1;
997 int cmsswId =
id.rawId();
998 int ixtal = (
id.ism() - 1) * 1700 + (
id.ic() - 1);
1001 int val[] = {dccNb + 600,
1027 for (
int i = 0;
i < 26;
i++)
1034 if (tccNb == 37 && stripInTower == 3 && xtalInStrip == 3 && (towerInTCC - 1) % 4 == 0) {
1035 int etaSlice = towid.
ietaAbs();
1040 getCoeff(coeff, calibMap, laserAlphaMap,
id.rawId(), str);
1042 getCoeff(coeff, gainMap,
id.rawId());
1043 getCoeff(coeff, pedMap,
id.rawId());
1045 for (
int i = 0;
i < 3;
i++) {
1055 edm::LogError(
"TopInfo") <<
"ByEtaSlice: unable to compute the parameters for SM=" <<
id.ism()
1056 <<
" xt=" <<
id.ic() <<
" " <<
dec <<
id.rawId() <<
" gainId=" <<
i
1057 <<
", mult too large! forced to mult=255, shift=0\n";
1060 }
else if (mult < 128) {
1061 edm::LogError(
"TopInfo") <<
"ByEtaSlice: unable to compute the parameters for SM=" <<
id.ism()
1062 <<
" xt=" <<
id.ic() <<
" " <<
dec <<
id.rawId() <<
" gainId=" <<
i
1063 <<
", mult too small! forced to mult=128, shift=15\n";
1078 ss <<
"SM=" <<
id.ism() <<
" xt=" <<
id.ic() <<
" " <<
dec <<
id.rawId() <<
"\n";
1079 linEtaSlice[etaSlice] = lin;
1084 for (vector<DetId>::const_iterator it = ebCells.begin(); it != ebCells.end(); ++it) {
1090 towerListEB.push_back(towid.
rawId());
1092 stripListEB.push_back(elId.
rawId() & 0xfffffff8);
1101 int xtalInVFE = Id.
xtalId();
1102 int xtalWithinCCUid = 5 * (VFEid - 1) + xtalInVFE - 1;
1103 int etaSlice = towid.
ietaAbs();
1106 int hashedStripLogicID = 68 * 5 * (
id.ism() - 1) + 5 * (towerInTCC - 1) + (VFEid - 1);
1107 stripMapEB[hashedStripLogicID] = elId.
rawId() & 0xfffffff8;
1125 (*out_file_) <<
"CRYSTAL " <<
dec <<
id.rawId() << std::endl;
1132 getCoeff(coeff, calibMap, laserAlphaMap,
id.rawId(), str);
1137 getCoeff(coeff, gainMap,
id.rawId());
1138 getCoeff(coeff, pedMap,
id.rawId());
1139 ICEB->Fill(
id.iphi(),
id.ieta(), coeff.
calibCoeff_);
1144 vector<int> xtalCCU;
1145 xtalCCU.push_back(dccNb + 600);
1146 xtalCCU.push_back(CCUid);
1147 xtalCCU.push_back(xtalWithinCCUid);
1148 xtalCCU.push_back(
id.rawId());
1153 map<int, linStruc>::const_iterator itLin = linEtaSlice.find(etaSlice);
1154 if (itLin != linEtaSlice.end()) {
1155 linMap[xtalCCU] = itLin->second;
1157 for (
int i = 0;
i < 3;
i++)
1158 (*
out_file_) << hex <<
" 0x" << itLin->second.pedestal_[
i] <<
" 0x" << itLin->second.mult_[
i] <<
" 0x"
1159 << itLin->second.shift_[
i] << std::endl;
1162 for (
int i = 0;
i < 3;
i++) {
1167 }
else if (
i == 1) {
1171 }
else if (
i == 2) {
1178 float factor = float(itLin->second.mult_[0]) *
pow(2., -itLin->second.shift_[0]) /
xtal_LSB_EB_;
1179 tpgFactorEB->Fill(
id.iphi(),
id.ieta(), factor);
1184 ss <<
"current EtaSlice = " << etaSlice <<
" not found in the EtaSlice map"
1189 int forceBase12 = 0;
1190 double invSinTheta = 1. /
sin(theta);
1191 for (
int i = 0;
i < 3;
i++) {
1201 edm::LogError(
"TopInfo") <<
"unable to compute the parameters for " <<
dec <<
id.rawId()
1202 <<
", EB, gainId=" <<
i <<
", mult too large! forced to mult=255, shift=0\n";
1205 }
else if (mult < 128) {
1206 edm::LogError(
"TopInfo") <<
"unable to compute the parameters for " <<
dec <<
id.rawId()
1207 <<
", EB, gainId=" <<
i <<
", mult too small! forced to mult=128, shift=15\n";
1217 double G = mult *
pow(2.0, -(shift + 2));
1218 double g = G * invSinTheta;
1222 forceBase12 = int(base);
1232 ss <<
"SM=" <<
id.ism() <<
" xt=" <<
id.ic() <<
" " <<
dec <<
id.rawId() <<
"\n";
1234 for (
int i = 0;
i < 3;
i++) {
1243 }
else if (
i == 1) {
1247 }
else if (
i == 2) {
1255 tpgFactorEB->Fill(
id.iphi(),
id.ieta(), factor);
1261 double g = G * invSinTheta;
1262 float val[] = {float(
i),
1268 ntupleSpike->Fill(val);
1270 linMap[xtalCCU] = lin;
1274 int ixtal = (
id.ism() - 1) * 1700 + (
id.ic() - 1);
1276 pedset[logicId] = pedDB;
1277 linset[logicId] = linDB;
1285 linparamset[my_EcalLogicId_EB] = linparam;
1292 fgrparamset[my_EcalLogicId_EB] = fgrparam;
1298 lutparamset[my_EcalLogicId_EB] = lutparam;
1303 (*out_file_) <<
"COMMENT ====== endcap crystals ====== " << std::endl;
1306 for (vector<DetId>::const_iterator it = eeCells.begin(); it != eeCells.end(); ++it) {
1314 int dccNb = Id.
dccId();
1321 int xtalInVFE = Id.
xtalId();
1322 int xtalWithinCCUid = 5 * (VFEid - 1) + xtalInVFE - 1;
1325 bool foundStripLogic =
false;
1326 for (
EcalLogicID& stripLogicId : my_StripEcalLogicId1_EE) {
1327 if (stripLogicId.getID1() == 600 + dccNb && stripLogicId.getID2() == CCUid && stripLogicId.getID3() == VFEid) {
1328 stripMapEE[stripLogicId.getLogicID()] = elId.
rawId() & 0xfffffff8;
1329 foundStripLogic =
true;
1333 if (!foundStripLogic) {
1334 for (
EcalLogicID& stripLogicId : my_StripEcalLogicId2_EE) {
1335 if (stripLogicId.getID1() == 600 + dccNb && stripLogicId.getID2() == CCUid && stripLogicId.getID3() == VFEid) {
1336 stripMapEE[stripLogicId.getLogicID()] = elId.
rawId() & 0xfffffff8;
1337 foundStripLogic =
true;
1342 if (!foundStripLogic) {
1343 edm::LogWarning(
"TopInfo") <<
"Strip ID not found for DCC: " << 600 + dccNb <<
" CCU: " << CCUid
1344 <<
" VFEid: " << VFEid;
1347 (*geomFile_) <<
"dccNb = " << dccNb <<
" tccNb = " << tccNb <<
" towerInTCC = " << towerInTCC
1348 <<
" stripInTower = " << stripInTower <<
" xtalInStrip = " << xtalInStrip <<
" CCUid = " << CCUid
1349 <<
" VFEid = " << VFEid <<
" xtalInVFE = " << xtalInVFE <<
" xtalWithinCCUid = " << xtalWithinCCUid
1350 <<
" ix = " <<
id.ix() <<
" iy = " <<
id.iy() <<
" xtalhashedId = " <<
id.hashedIndex()
1351 <<
" xtalNb = " <<
id.isc() <<
" ietaTT = " << towid.
ieta() <<
" iphiTT = " << towid.
iphi()
1354 int TCCch = stripInTower;
1356 if (towerInTCC < 5) {
1358 SLBch = 4 + towerInTCC;
1360 SLBslot = int((towerInTCC - 5) / 8.) + 2;
1361 SLBch = (towerInTCC - 5) % 8 + 1;
1363 for (
int j = 0;
j < towerInTCC - 1;
j++)
1364 TCCch += NbOfStripPerTCC[tccNb - 1][
j];
1366 int cmsswId =
id.rawId();
1368 int iz =
id.positiveZ();
1371 for (
int k = 0;
k < (int)my_CrystalEcalLogicId_EE.size();
k++) {
1372 int z = my_CrystalEcalLogicId_EE[
k].
getID1();
1373 int x = my_CrystalEcalLogicId_EE[
k].getID2();
1374 int y = my_CrystalEcalLogicId_EE[
k].getID3();
1375 if (
id.ix() == x &&
id.iy() == y && iz == z)
1376 logicId = my_CrystalEcalLogicId_EE[
k];
1380 int val[] = {dccNb + 600,
1406 for (
int i = 0;
i < 26;
i++)
1412 if ((tccNb == 76 || tccNb == 94) && stripInTower == 1 && xtalInStrip == 3 && (towerInTCC - 1) % 4 == 0) {
1413 int etaSlice = towid.
ietaAbs();
1418 getCoeff(coeff, calibMap, laserAlphaMap,
id.rawId(), str);
1420 getCoeff(coeff, gainMap,
id.rawId());
1421 getCoeff(coeff, pedMap,
id.rawId());
1423 for (
int i = 0;
i < 3;
i++) {
1433 edm::LogError(
"TopInfo") <<
"ByEtaSlice: unable to compute the parameters for Quadrant=" <<
id.iquadrant()
1434 <<
" xt=" <<
id.ic() <<
" " <<
dec <<
id.rawId() <<
" gainId=" <<
i
1435 <<
", mult too large! forced to mult=255, shift=0\n";
1438 }
else if (mult < 128) {
1439 edm::LogError(
"TopInfo") <<
"ByEtaSlice: unable to compute the parameters for Quadrant=" <<
id.iquadrant()
1440 <<
" xt=" <<
id.ic() <<
" " <<
dec <<
id.rawId() <<
" gainId=" <<
i
1441 <<
", mult too small! forced to mult=128, shift=15\n";
1456 ss <<
"Quadrant=" <<
id.iquadrant() <<
" xt=" <<
id.ic() <<
" " <<
dec <<
id.rawId() <<
"\n";
1458 linEtaSlice[etaSlice] = lin;
1463 for (vector<DetId>::const_iterator it = eeCells.begin(); it != eeCells.end(); ++it) {
1471 towerListEE.push_back(towid.
rawId());
1475 towerListEE.push_back(additionalTower.rawId());
1477 stripListEE.push_back(elId.
rawId() & 0xfffffff8);
1479 int dccNb = Id.
dccId();
1486 int xtalInVFE = Id.
xtalId();
1487 int xtalWithinCCUid = 5 * (VFEid - 1) + xtalInVFE - 1;
1488 int etaSlice = towid.
ietaAbs();
1494 (*out_file_) <<
"CRYSTAL " <<
dec <<
id.rawId() << std::endl;
1496 int iz =
id.positiveZ();
1499 for (
int k = 0;
k < (int)my_CrystalEcalLogicId_EE.size();
k++) {
1500 int z = my_CrystalEcalLogicId_EE[
k].getID1();
1501 int x = my_CrystalEcalLogicId_EE[
k].getID2();
1502 int y = my_CrystalEcalLogicId_EE[
k].getID3();
1503 if (
id.ix() == x &&
id.iy() == y && iz == z) {
1504 logicId = my_CrystalEcalLogicId_EE[
k];
1513 getCoeff(coeff, calibMap, laserAlphaMap,
id.rawId(), str);
1515 getCoeff(coeff, gainMap,
id.rawId());
1516 getCoeff(coeff, pedMap,
id.rawId());
1518 ICEEPlus->Fill(
id.ix(),
id.iy(), coeff.
calibCoeff_);
1520 ICEEMinus->Fill(
id.ix(),
id.iy(), coeff.
calibCoeff_);
1525 vector<int> xtalCCU;
1526 xtalCCU.push_back(dccNb + 600);
1527 xtalCCU.push_back(CCUid);
1528 xtalCCU.push_back(xtalWithinCCUid);
1529 xtalCCU.push_back(
id.rawId());
1534 map<int, linStruc>::const_iterator itLin = linEtaSlice.find(etaSlice);
1535 if (itLin != linEtaSlice.end()) {
1536 linMap[xtalCCU] = itLin->second;
1538 for (
int i = 0;
i < 3;
i++)
1539 (*
out_file_) << hex <<
" 0x" << itLin->second.pedestal_[
i] <<
" 0x" << itLin->second.mult_[
i] <<
" 0x"
1540 << itLin->second.shift_[
i] << std::endl;
1543 for (
int i = 0;
i < 3;
i++) {
1548 }
else if (
i == 1) {
1552 }
else if (
i == 2) {
1559 float factor = float(itLin->second.mult_[0]) *
pow(2., -itLin->second.shift_[0]) /
xtal_LSB_EE_;
1561 tpgFactorEEPlus->Fill(
id.ix(),
id.iy(), factor);
1563 tpgFactorEEMinus->Fill(
id.ix(),
id.iy(), factor);
1568 ss <<
"current EtaSlice = " << etaSlice <<
" not found in the EtaSlice map"
1573 for (
int i = 0;
i < 3;
i++) {
1583 edm::LogError(
"TopInfo") <<
"unable to compute the parameters for " <<
dec <<
id.rawId()
1584 <<
", EE, gainId=" <<
i <<
", mult too large! forced to mult=255, shift=0\n";
1587 }
else if (mult < 128) {
1588 edm::LogError(
"TopInfo") <<
"unable to compute the parameters for " <<
dec <<
id.rawId()
1589 <<
", EE, gainId=" <<
i <<
", mult too small! forced to mult=128, shift=15\n";
1603 ss <<
"Quadrant=" <<
id.iquadrant() <<
" xt=" <<
id.ic() <<
" " <<
dec <<
id.rawId() <<
"\n";
1605 for (
int i = 0;
i < 3;
i++) {
1614 }
else if (
i == 1) {
1618 }
else if (
i == 2) {
1627 tpgFactorEEPlus->Fill(
id.ix(),
id.iy(), factor);
1629 tpgFactorEEMinus->Fill(
id.ix(),
id.iy(), factor);
1635 linMap[xtalCCU] = lin;
1638 pedset[logicId] = pedDB;
1639 linset[logicId] = linDB;
1649 linparamset[my_EcalLogicId_EE] = linparam;
1655 lutparamset[my_EcalLogicId_EE] = lutparam;
1660 fgrparamset[my_EcalLogicId_EE] = fgrparam;
1668 ss <<
" LIN tag " << lin_tag <<
"\n";
1670 if (m_write_ped == 1) {
1673 ss <<
"the ped id =" <<
ped_conf_id_ <<
" will be used for the pedestals "
1685 evgueni <<
"void getLinParamTPG_hardcoded(int fed, int ccu, int xtal," << std::endl;
1686 evgueni <<
" int & mult12, int & shift12, int & base12," << std::endl;
1687 evgueni <<
" int & mult6, int & shift6, int & base6," << std::endl;
1688 evgueni <<
" int & mult1, int & shift1, int & base1)" << std::endl;
1689 evgueni <<
"{" << std::endl;
1690 evgueni <<
" mult12 = 0 ; shift12 = 0 ; base12 = 0 ; mult6 = 0 ; shift6 = 0 ; base6 = 0 ; mult1 = 0 ; shift1 = 0 ; "
1693 map<vector<int>,
linStruc>::const_iterator itLinMap;
1694 for (itLinMap = linMap.begin(); itLinMap != linMap.end(); itLinMap++) {
1695 vector<int> xtalInCCU = itLinMap->first;
1696 evgueni <<
" if (fed==" << xtalInCCU[0] <<
" && ccu==" << xtalInCCU[1] <<
" && xtal==" << xtalInCCU[2] <<
") {";
1697 evgueni <<
" mult12 = " << itLinMap->second.
mult_[0] <<
" ; shift12 = " << itLinMap->second.shift_[0]
1698 <<
" ; base12 = " << itLinMap->second.pedestal_[0] <<
" ; ";
1699 evgueni <<
" mult6 = " << itLinMap->second.mult_[1] <<
" ; shift6 = " << itLinMap->second.shift_[1]
1700 <<
" ; base6 = " << itLinMap->second.pedestal_[1] <<
" ; ";
1701 evgueni <<
" mult1 = " << itLinMap->second.mult_[2] <<
" ; shift1 = " << itLinMap->second.shift_[2]
1702 <<
" ; base1 = " << itLinMap->second.pedestal_[2] <<
" ; ";
1703 evgueni <<
" return ;}" << std::endl;
1705 evgueni <<
"}" << std::endl;
1712 std::map<int, int> weights_map_even;
1713 std::map<int, int> weights_map_odd;
1719 const int NWEIGROUPS = 2;
1720 std::vector<unsigned int>
weights[NWEIGROUPS];
1724 map<EcalLogicID, FEConfigWeightGroupDat>
dataset;
1726 for (
int igrp = 0; igrp < NWEIGROUPS; igrp++) {
1729 (*out_file_) << std::endl;
1730 (*out_file_) <<
"WEIGHT " <<
dec << igrp << std::endl;
1733 (*out_file_) << std::endl;
1734 (*out_file_) << std::endl;
1737 ss <<
"going to write the weights for group:" << igrp <<
"\n";
1749 dataset[ecid] = gut;
1754 map<EcalLogicID, FEConfigWeightDat> dataset2;
1756 for (
int ich = 0; ich < (int)my_StripEcalLogicId.size(); ich++) {
1759 weights_map_even[stripMapEB[ich]] = 0;
1761 dataset2[my_StripEcalLogicId[ich]] = wut;
1765 for (
EcalLogicID& stripLogicId : my_StripEcalLogicId1_EE) {
1768 weights_map_even[stripMapEE[stripLogicId.getLogicID()]] = 1;
1771 dataset2[stripLogicId] = wut;
1774 for (
EcalLogicID& stripLogicId : my_StripEcalLogicId2_EE) {
1777 weights_map_even[stripMapEE[stripLogicId.getLogicID()]] = 1;
1780 dataset2[stripLogicId] = wut;
1787 wtag <<
"Shape_NGroups_" << NWEIGROUPS;
1789 ss <<
" weight tag " << weight_tag <<
"\n";
1796 std::vector<std::vector<unsigned int>> weights_even;
1800 while (std::getline(
file, line)) {
1801 std::istringstream iss(line);
1802 std::vector<unsigned int> wei_group_even;
1804 wei_group_even.push_back(stoi(s));
1805 weights_even.push_back(wei_group_even);
1807 int nweigroups_even = weights_even.size();
1811 while (std::getline(file2, line2)) {
1812 std::istringstream iss(line2);
1816 int wei_group = wei_gr;
1817 if (wei_group > nweigroups_even - 1) {
1818 edm::LogError(
"TopInfo") <<
"Associating strip: " << ch_id <<
" to non-existing weight group: " << wei_gr
1821 weights_map_even[ch_id] = wei_group;
1824 map<EcalLogicID, FEConfigWeightGroupDat> dataset_even;
1826 for (
int igrp = 0; igrp < nweigroups_even; igrp++) {
1827 if (weights_even[igrp].
size() == EcalTPGParamBuilder::NWEIGHTS) {
1829 (*out_file_) << std::endl;
1830 (*out_file_) <<
"WEIGHT " <<
dec << igrp << std::endl;
1833 (*out_file_) << std::endl;
1834 (*out_file_) << std::endl;
1837 ss <<
"going to write the weights for group:" << igrp <<
"\n";
1849 dataset_even[ecid] = gut;
1855 map<EcalLogicID, FEConfigWeightDat> dataset_even_idmap;
1857 for (
int ich = 0; ich < (int)my_StripEcalLogicId.size(); ich++) {
1859 int igroup = weights_map_even[stripMapEB[ich]];
1861 dataset_even_idmap[my_StripEcalLogicId[ich]] = wut;
1864 for (
EcalLogicID& stripLogicId : my_StripEcalLogicId1_EE) {
1866 int igroup = weights_map_even[stripMapEE[stripLogicId.getLogicID()]];
1869 dataset_even_idmap[stripLogicId] = wut;
1872 for (
EcalLogicID& stripLogicId : my_StripEcalLogicId2_EE) {
1874 int igroup = weights_map_even[stripMapEE[stripLogicId.getLogicID()]];
1877 dataset_even_idmap[stripLogicId] = wut;
1882 wtag <<
"Shape_even_NGroups_" << nweigroups_even;
1884 ss <<
" weight tag " << weight_tag <<
"\n";
1893 std::vector<std::vector<unsigned int>> weights_odd;
1896 while (std::getline(file3, line3)) {
1897 std::istringstream iss(line3);
1898 std::vector<unsigned int> wei_group_odd;
1900 wei_group_odd.push_back(stoi(s));
1901 weights_odd.push_back(wei_group_odd);
1903 int nweigroups_odd = weights_odd.size();
1907 while (std::getline(file4, line4)) {
1908 std::istringstream iss(line4);
1912 int wei_group = wei_gr;
1913 if (wei_group > nweigroups_odd - 1) {
1914 edm::LogError(
"TopInfo") <<
"Associating strip: " << ch_id <<
" to non-existing weight group: " << wei_gr
1917 weights_map_odd[ch_id] = wei_group;
1920 map<EcalLogicID, FEConfigOddWeightGroupDat> dataset_odd;
1922 for (
int igrp = 0; igrp < nweigroups_odd; igrp++) {
1923 if (weights_odd[igrp].
size() == EcalTPGParamBuilder::NWEIGHTS) {
1925 (*out_file_) << std::endl;
1926 (*out_file_) <<
"WEIGHT_ODD " <<
dec << igrp << std::endl;
1929 (*out_file_) << std::endl;
1930 (*out_file_) << std::endl;
1933 ss <<
"going to write the weights for group:" << igrp <<
"\n";
1945 dataset_odd[ecid] = gut;
1951 (*out_file_) << std::endl;
1952 (*out_file_) <<
"TP_MODE " << std::endl;
1967 (*out_file_) << 0 << std::endl;
1968 (*out_file_) << 0 << std::endl;
1969 (*out_file_) << 0 << std::endl;
1970 (*out_file_) << 0 << std::endl;
1971 (*out_file_) << std::endl;
1976 map<EcalLogicID, FEConfigOddWeightDat> dataset_odd_idmap;
1979 for (
int ich = 0; ich < (int)my_StripEcalLogicId.size(); ich++) {
1981 int igroup = weights_map_odd[stripMapEB[ich]];
1983 dataset_odd_idmap[my_StripEcalLogicId[ich]] = wut;
1986 for (
auto& stripLogicId : my_StripEcalLogicId1_EE) {
1988 int igroup = weights_map_odd[stripMapEE[stripLogicId.getLogicID()]];
1991 dataset_odd_idmap[stripLogicId] = wut;
1994 for (
auto& stripLogicId : my_StripEcalLogicId2_EE) {
1996 int igroup = weights_map_odd[stripMapEE[stripLogicId.getLogicID()]];
1999 dataset_odd_idmap[stripLogicId] = wut;
2002 map<EcalLogicID, FEConfigOddWeightModeDat> dataset_tpmode;
2018 dataset_tpmode[my_StripEcalLogicId[0]] = tp_mode;
2023 wtag <<
"Shape_odd_NGroups_" << nweigroups_odd;
2025 ss <<
" weight tag " << weight_tag <<
"\n";
2028 dataset_odd, dataset_odd_idmap, dataset_tpmode, nweigroups_odd, weight_tag);
2036 (*out_file_) <<
"WEIGHT_ODD " <<
dec << 0 << std::endl;
2040 (*out_file_) << std::endl << std::endl;
2043 (*out_file_) <<
"TP_MODE " << std::endl;
2044 for (
int m = 0;
m < 18;
m++)
2046 (*out_file_) << std::endl;
2059 unsigned int lowRatio, highRatio, lowThreshold, highThreshold, lutFG;
2062 (*out_file_) << std::endl;
2063 (*out_file_) <<
"FG 0" << std::endl;
2064 (*out_file_) << hex <<
"0x" << lowThreshold <<
" 0x" << highThreshold <<
" 0x" << lowRatio <<
" 0x" << highRatio
2065 <<
" 0x" << lutFG << std::endl;
2070 unsigned int lut_strip;
2076 ss <<
"going to write the fgr "
2078 map<EcalLogicID, FEConfigFgrGroupDat>
dataset;
2081 for (
int ich = 0; ich < NFGRGROUPS; ich++) {
2091 dataset[ecid] = gut;
2095 map<EcalLogicID, FEConfigFgrDat> dataset2;
2096 for (
auto&
id : my_TTEcalLogicId) {
2106 for (
auto&
id : my_RTEcalLogicId_EE) {
2118 map<EcalLogicID, FEConfigFgrEETowerDat> dataset3;
2119 for (
auto&
id : my_TTEcalLogicId_EE) {
2122 dataset3[
id] = fgreett;
2127 map<EcalLogicID, FEConfigFgrEEStripDat> dataset4;
2128 for (
auto&
id : my_StripEcalLogicId1_EE) {
2134 for (
auto&
id : my_StripEcalLogicId2_EE) {
2141 for (
int ich = 0; ich < (int)my_StripEcalLogicId.size(); ich++) {
2145 uint32_t elStripId = stripMapEB[ich];
2146 map<uint32_t, uint32_t>::const_iterator it = stripMapEBsintheta.find(elStripId);
2147 if (it != stripMapEBsintheta.end())
2150 edm::LogError(
"TopInfo") <<
"ERROR: strip SFGVB threshold parameter not found for that strip:"
2151 << thestrip.
getID1() <<
" " << thestrip.
getID3() <<
" " << thestrip.
getID3() <<
"\n";
2157 dataset4[thestrip] = zut;
2165 ss <<
" weight tag " << weight_tag <<
"\n";
2171 map<EcalLogicID, FEConfigSpikeDat> datasetspike;
2172 for (
auto&
id : my_TTEcalLogicId) {
2175 datasetspike[
id] = spiketh;
2183 ss <<
" spike tag " << spike_tag <<
"\n";
2189 map<EcalLogicID, FEConfigTimingDat>
2191 for (
int ich = 0; ich < (int)my_TTEcalLogicId_EB_by_TCC.size(); ich++) {
2194 EcalLogicID logiciddelay = my_TTEcalLogicId_EB_by_TCC[ich];
2195 int id1_tcc = logiciddelay.
getID1();
2196 int id2_tt = logiciddelay.
getID2();
2197 std::map<int, vector<int>>::const_iterator ittEB =
delays_EB_.find(id1_tcc);
2198 std::vector<int> TimingDelaysEB = ittEB->second;
2201 if (TimingDelaysEB[id2_tt - 1] == -1) {
2202 edm::LogError(
"TopInfo") <<
"ERROR: Barrel timing delay not specified, check file, putting default value 1"
2208 edm::LogError(
"TopInfo") <<
"ERROR:Barrel Could not find delay parameter for that trigger tower "
2215 std::map<int, vector<int>>::const_iterator ittpEB =
phases_EB_.find(id1_tcc);
2216 std::vector<int> TimingPhasesEB = ittpEB->second;
2219 if (TimingPhasesEB[id2_tt - 1] == -1) {
2220 edm::LogError(
"TopInfo") <<
"ERROR: Barrel timing phase not specified, check file, putting default value 0"
2226 edm::LogError(
"TopInfo") <<
"ERROR:Barrel Could not find phase parameter for that trigger tower "
2233 ss << ich <<
" tcc=" << id1_tcc <<
" TT=" << id2_tt <<
" logicId=" << logiciddelay.
getLogicID()
2234 <<
" delay=" << TimingDelaysEB[id2_tt - 1] <<
" phase=" << TimingPhasesEB[id2_tt - 1] <<
"\n";
2238 datasetdelay[logiciddelay] = delay;
2244 for (
int ich = 0; ich < (int)my_StripEcalLogicId_EE_strips_by_TCC.size(); ich++) {
2247 EcalLogicID logiciddelay = my_StripEcalLogicId_EE_strips_by_TCC[ich];
2248 int id1_tcc = logiciddelay.
getID1();
2249 int id2_tt = logiciddelay.
getID2();
2250 int id3_st = logiciddelay.
getID3();
2253 if (id1_tcc != tccin) {
2258 std::map<int, vector<int>>::const_iterator ittEE =
delays_EE_.find(id1_tcc);
2259 std::vector<int> TimingDelaysEE = ittEE->second;
2262 if (TimingDelaysEE[stripindex] == -1) {
2263 edm::LogError(
"TopInfo") <<
"ERROR: Endcap timing delay not specified, check file, putting default value 1"
2269 edm::LogError(
"TopInfo") <<
"ERROR:Endcap Could not find delay parameter for that trigger tower "
2276 std::map<int, vector<int>>::const_iterator ittpEE =
phases_EE_.find(id1_tcc);
2277 std::vector<int> TimingPhasesEE = ittpEE->second;
2280 if (TimingPhasesEE[stripindex] == -1) {
2281 edm::LogError(
"TopInfo") <<
"ERROR: Endcap timing phase not specified, check file, putting default value 0"
2287 edm::LogError(
"TopInfo") <<
"ERROR:Endcap Could not find phase parameter for that trigger tower "
2294 ss << ich <<
" stripindex=" << stripindex <<
" tcc=" << id1_tcc <<
" TT=" << id2_tt <<
" id3_st=" << id3_st
2295 <<
" logicId=" << logiciddelay.
getLogicID() <<
" delay=" << TimingDelaysEE[stripindex]
2296 <<
" phase=" << TimingPhasesEE[stripindex] <<
"\n";
2300 datasetdelay[logiciddelay] = delay;
2304 ostringstream de_tag;
2306 de_tag <<
"DelaysFromFile";
2308 ss <<
" delay tag " << delay_tag <<
"\n";
2315 ss <<
"going to write the sliding "
2317 map<EcalLogicID, FEConfigSlidingDat>
dataset;
2318 for (
auto&
id : my_StripEcalLogicId) {
2327 for (
auto&
id : my_StripEcalLogicId1_EE) {
2332 for (
auto&
id : my_StripEcalLogicId2_EE) {
2343 ss <<
" sliding tag " << justatag <<
"\n";
2353 int lut_EB[1024], lut_EE[1024];
2358 (*out_file_) << std::endl;
2359 (*out_file_) <<
"LUT 0" << std::endl;
2360 for (
int i = 0;
i < 1024;
i++)
2361 (*
out_file_) <<
"0x" << hex << lut_EB[
i] << std::endl;
2362 (*out_file_) << std::endl;
2369 for (
int i = 0;
i < 1024;
i++)
2370 if (lut_EE[
i] != lut_EB[
i])
2373 (*out_file_) << std::endl;
2374 (*out_file_) <<
"LUT 1" << std::endl;
2375 for (
int i = 0; i < 1024; i++)
2376 (*
out_file_) <<
"0x" << hex << lut_EE[
i] << std::endl;
2377 (*out_file_) << std::endl;
2381 map<EcalLogicID, FEConfigLUTGroupDat>
dataset;
2387 for (
int i = 0; i < 1024; i++) {
2392 dataset[ecid] = lut;
2398 for (
int i = 0; i < 1024; i++) {
2403 dataset[ecide] = lute;
2410 map<EcalLogicID, FEConfigLUTDat> dataset2;
2412 for (
auto&
id : my_TTEcalLogicId) {
2422 for (
auto&
id : my_TTEcalLogicId_EE) {
2436 ss <<
" LUT tag " << lut_tag <<
"\n";
2461 ss <<
"\n Conf ID = " << conf_id_ <<
"\n";
2470 stripListEB.unique();
2471 ss <<
"Number of EB strips=" <<
dec << stripListEB.size() <<
"\n";
2473 (*out_file_) << std::endl;
2474 for (itList = stripListEB.begin(); itList != stripListEB.end(); itList++) {
2475 (*out_file_) <<
"STRIP_EB " <<
dec << (*itList) << std::endl;
2476 (*out_file_) << hex <<
"0x" << sliding_ << std::endl;
2477 (*out_file_) << hex <<
"0x" << weights_map_even[(*itList)] <<
" ";
2479 (*out_file_) << hex <<
"0x" << weights_map_odd[(*itList)] << std::endl;
2482 (*out_file_) <<
"0x" << stripMapEBsintheta[(*itList)] <<
" 0x" <<
SFGVB_lut_ << std::endl;
2488 stripListEE.unique();
2489 ss <<
"Number of EE strips=" <<
dec << stripListEE.size() <<
"\n";
2491 (*out_file_) << std::endl;
2492 for (itList = stripListEE.begin(); itList != stripListEE.end(); itList++) {
2493 (*out_file_) <<
"STRIP_EE " <<
dec << (*itList) << std::endl;
2494 (*out_file_) << hex <<
"0x" << sliding_ << std::endl;
2495 (*out_file_) << hex <<
"0x" << weights_map_even[(*itList)] <<
" ";
2497 (*out_file_) << hex <<
"0x" << weights_map_odd[(*itList)] << std::endl;
2500 (*out_file_) << hex <<
"0x" << threshold <<
" 0x" << lut_strip << std::endl;
2512 towerListEB.unique();
2513 ss <<
"Number of EB towers=" <<
dec << towerListEB.size() <<
"\n";
2515 (*out_file_) << std::endl;
2516 for (itList = towerListEB.begin(); itList != towerListEB.end(); itList++) {
2517 (*out_file_) <<
"TOWER_EB " <<
dec << (*itList) << std::endl;
2518 (*out_file_) <<
" 0\n 0\n";
2519 (*out_file_) <<
" " << SFGVB_SpikeKillingThreshold_ << std::endl;
2525 towerListEE.unique();
2526 ss <<
"Number of EE towers=" <<
dec << towerListEE.size() <<
"\n";
2528 (*out_file_) << std::endl;
2529 for (itList = towerListEE.begin(); itList != towerListEE.end(); itList++) {
2530 (*out_file_) <<
"TOWER_EE " <<
dec << (*itList) << std::endl;
2532 (*out_file_) <<
" 1\n";
2535 (*out_file_) << hex <<
"0x" << lut_tower << std::endl;
2545 tpgFactorEB->Write();
2547 tpgFactorEEPlus->Write();
2549 tpgFactorEEMinus->Write();
2555 ntupleSpike->Write();
unsigned int TPmode_FenixEBStripOutput_
std::string weight_even_idMapFile_
int writeToConfDB_TPGLinearCoef(const std::map< EcalLogicID, FEConfigLinDat > &linset, const std::map< EcalLogicID, FEConfigLinParamDat > &linparamset, int iovId, std::string tag)
bool TPmode_DisableEBEvenPeakFinder_
std::map< int, std::vector< int > > phases_EB_
void setDisableEEEvenPeakFinder(int x)
bool useTransparencyCorr_
unsigned int TPmode_FenixEBStripInfobit2_
void setThreshLow(float x)
bool TPmode_EnableEEOddFilter_
int xtalId() const
get the channel id
unsigned int TPmode_FenixEBTcpInfobit1_
edm::ESGetToken< EcalIntercalibConstants, EcalIntercalibConstantsRcd > ecalIntercalibConstantsToken_
uint16_t *__restrict__ id
unsigned int TPmode_FenixEBTcpOutput_
void setLUTGroupId(int x)
static constexpr uint NWEIGHTS
bool TPmode_EnableEBOddFilter_
int stripId() const
get the tower id
void setFGhighratio(float x)
void setFenixEBTcpInfoBit1(int x)
bool TPmode_EnableEBOddPeakFinder_
const self & getMap() const
void setFenixEBTcpOutput(int x)
EcalLogicID getEcalLogicID(std::string name, int id1=EcalLogicID::NULLID, int id2=EcalLogicID::NULLID, int id3=EcalLogicID::NULLID, std::string mapsTo="") noexcept(false)
float getPedMeanG1() const
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcd > ecalmappingToken_
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
double TTF_highThreshold_EB_
void setTimingPar2(int x)
unsigned int SFGVB_Threshold_
std::pair< std::string, int > getCrate(int tcc)
const Items & barrelItems() const
int getGCTRegionPhi(int ttphi)
Sin< T >::type sin(const T &t)
constexpr uint32_t rawId() const
get the raw id
std::string getDet(int tcc)
Geom::Theta< T > theta() const
void setFenixEBStripInfobit2(int x)
std::string Transparency_Corr_
void setFGlowthresh(float x)
int towerId() const
get the tower id
void setRatioHigh(float x)
int iTT(const EcalTrigTowerDetId &id) const
returns the index of a Trigger Tower within its TCC.
edm::ESGetToken< EcalLaserAPDPNRatios, EcalLaserAPDPNRatiosRcd > ecalLaserAPDPNRatiosToken_
int writeToConfDB_TPGSliding(const std::map< EcalLogicID, FEConfigSlidingDat > &sliset, int iovId, std::string tag)
std::string weight_even_weightGroupFile_
void fetchConfigSet(ICONF *iconf) noexcept(false)
unsigned int TPmode_FenixEEStripOutput_
Log< level::Error, false > LogError
static EEDetId unhashIndex(int hi)
edm::ESGetToken< CaloSubdetectorGeometry, EcalBarrelGeometryRecord > theBarrelGeometryToken_
int writeToConfDB_Delay(const std::map< EcalLogicID, FEConfigTimingDat > &delaygroupset, std::string tag)
const CaloSubdetectorGeometry * theEndcapGeometry_
double FG_lowThreshold_EB_
void setFenixEETcpInfoBit1(int x)
std::ofstream * out_file_
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
void setEnableEEOddPeakFinder(int x)
std::map< int, std::vector< int > > delays_EB_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
int channelId() const
get the channel id
int ieta() const
get the tower ieta
void setPedMeanG6(float mean)
int zside() const
get the z-side of the tower (1/-1)
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
edm::ESGetToken< EcalLaserAlphas, EcalLaserAlphasRcd > ecalLaserAlphasToken_
bool getData(T &iHolder) const
int TCCid(const EBDetId &id) const
returns the TCCid of an EBDetId
int SFGVB_SpikeKillingThreshold_
edm::ESGetToken< EcalGainRatios, EcalGainRatiosRcd > ecalGainRatiosToken_
std::vector< unsigned int > computeWeights(EcalShapeBase &shape, TH1F *histo)
int hashedIndex(int ieta, int iphi)
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
void setWeightGroupId(int x)
double TTF_lowThreshold_EE_
std::string getName() const
const EcalLaserAPDPNRatiosMap & getLaserMap() const
void setThreshold(unsigned int mean)
void setPedMeanG1(float mean)
void setThreshHigh(float x)
std::map< int, std::vector< int > > delays_EE_
EcalPedestalsMap::const_iterator EcalPedestalsMapIterator
void setLutFgr(unsigned int mean)
int ietaAbs() const
get the absolute value of the tower ieta
const EcalElectronicsMapping * theMapping_
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 computeLUT(int *lut, std::string det="EB")
void setDisableEBEvenPeakFinder(int x)
bool useTransverseEnergy_
edm::ESGetToken< EcalADCToGeVConstant, EcalADCToGeVConstantRcd > ecalADCToGeVConstantToken_
void setLUTValue(int i, int x)
bool weight_even_computeFromShape_
Abs< T >::type abs(const T &t)
void setEnableEBOddPeakFinder(int x)
EcalTriggerElectronicsId getTriggerElectronicsId(const DetId &id) const
Get the trigger electronics id for this det id.
unsigned int TPmode_FenixEEStripInfobit2_
void setLUTGroupId(int x)
void setFgrGroupId(int x)
int pseudoStripId() const
get the tower id
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
void setSpikeThreshold(int x)
void setEnableEEOddFilter(int x)
float getPedMeanG12() const
void setTimingPar1(int x)
void insert(std::pair< uint32_t, Item > const &a)
bool TPmode_DisableEEEvenPeakFinder_
void setRatioLow(float x)
void setFgrGroupId(int x)
int writeToConfDB_Spike(const std::map< EcalLogicID, FEConfigSpikeDat > &spikegroupset, std::string tag)
void computeFineGrainEEParameters(uint &threshold, uint &lut_strip, uint &lut_tower)
const EcalTrigTowerConstituentsMap * eTTmap_
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecord > eTTmapToken_
Log< level::Info, false > LogInfo
bool computeLinearizerParam(double theta, double gainRatio, double calibCoeff, std::string subdet, int &mult, int &shift)
unsigned int pedestal_offset_
int iphi() const
get the tower iphi
const CaloSubdetectorGeometry * theBarrelGeometry_
bool TPmode_EnableEEOddPeakFinder_
int writeToConfDB_TPGPedestals(const std::map< EcalLogicID, FEConfigPedDat > &pedset, int iovId, std::string tag)
void setPedMeanG12(float mean)
void setFenixEETcpOutput(int x)
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
unsigned int TPmode_FenixEETcpInfobit1_
bool weight_useDoubleWeights_
bool realignBaseline(linStruc &lin, float forceBase12, int cmsswid)
std::vector< Item >::const_iterator const_iterator
int DCCid(const EBDetId &id) const
returns the DCC of an EBDetId
unsigned int TPmode_FenixEETcpOutput_
void setFenixEEStripInfobit2(int x)
edm::ESGetToken< EcalPedestals, EcalPedestalsRcd > ecalPedestalsToken_
void setWeightGroupId(int x)
float getPedMeanG6() const
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
EcalSubdetector subDet() const
get the subDetector associated to the Trigger Tower
void setConfigTag(std::string x)
void setFGlowratio(float x)
double TTF_highThreshold_EE_
void setSliding(float mean)
std::string weight_odd_idMapFile_
void setTTThreshhigh(float x)
int writeToConfDB_TPGLUT(const std::map< EcalLogicID, FEConfigLUTGroupDat > &lutgroup, const std::map< EcalLogicID, FEConfigLUTDat > &lutdat, const std::map< EcalLogicID, FEConfigLUTParamDat > &lutparamset, int iovId, std::string tag)
void setEventSetup(const edm::EventSetup &evtSetup)
edm::ESGetToken< CaloSubdetectorGeometry, EcalEndcapGeometryRecord > theEndcapGeometryToken_
const_iterator find(uint32_t rawId) const
static unsigned int const shift
void setEnableEBOddFilter(int x)
void setWeightGroupId(int x)
std::string weight_odd_weightGroupFile_
int writeToConfDB_TPGFgr(const std::map< EcalLogicID, FEConfigFgrGroupDat > &lutgroup, const std::map< EcalLogicID, FEConfigFgrDat > &lutdat, const std::map< EcalLogicID, FEConfigFgrParamDat > &fgrparamset, const std::map< EcalLogicID, FEConfigFgrEETowerDat > &dataset3, const std::map< EcalLogicID, FEConfigFgrEEStripDat > &dataset4, int iovId, std::string tag)
int writeToConfDB_TPGWeight(const std::map< EcalLogicID, FEConfigWeightGroupDat > &lutgroup, const std::map< EcalLogicID, FEConfigWeightDat > &lutdat, int iovId, std::string tag)
int getGCTRegionEta(int tteta)
int writeToConfDB_TPGWeight_doubleWeights(const std::map< EcalLogicID, FEConfigOddWeightGroupDat > &lutgroupset, const std::map< EcalLogicID, FEConfigOddWeightDat > &lutset, const std::map< EcalLogicID, FEConfigOddWeightModeDat > &tpmode, int ngr, std::string tag)
Log< level::Warning, false > LogWarning
std::map< int, double > Transparency_Correction_
void setTTThreshlow(float x)
static const int SMCRYSTALMODE
void setWeightGroupId(int x)
double FG_highThreshold_EB_
void setFenixEBStripOutput(int x)
void setLutValue(int mean)
int writeToConfDB_TPGMain(int ped, int lin, int lut, int fgr, int sli, int wei, int wei2, int spi, int tim, int bxt, int btt, int bst, int cok, std::string tag, int ver)
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
void setFGhighthresh(float x)
tuple size
Write out results.
Power< A, B >::type pow(const A &a, const B &b)
std::map< int, std::vector< int > > phases_EE_
double TTF_lowThreshold_EB_
void computeFineGrainEBParameters(uint &lowRatio, uint &highRatio, uint &lowThreshold, uint &highThreshold, uint &lut)
void setFenixEEStripOutput(int x)
void getCoeff(coeffStruc &coeff, const EcalGainRatioMap &gainMap, uint rawId)