38 const std::vector<HcalGenericDetId>& allCells(
const HcalTopology& hcaltopology,
bool killHE =
false) {
39 static std::vector<HcalGenericDetId>
result;
43 std::cout << std::endl <<
"HcalHardcodeCalibrations: maxDepth = " <<
maxDepth << std::endl;
54 if (hcaltopology.
valid(cell)) {
57 std::cout <<
" HcalHardcodedCalibrations: det|eta|phi|depth = " << det <<
"|" <<
eta <<
"|" <<
phi
58 <<
"|" <<
depth << std::endl;
70 if (zdctopology.
valid(zcell))
73 if (zdctopology.
valid(zcell))
79 if (zdctopology.
valid(zcell))
82 if (zdctopology.
valid(zcell))
88 if (zdctopology.
valid(zcell))
91 if (zdctopology.
valid(zcell))
97 if (zdctopology.
valid(zcell))
100 if (zdctopology.
valid(zcell))
114 if (hcaltopology.
validHT(cell)) {
117 std::cout <<
" HcalHardcodedCalibrations: eta|phi|depth|vers = " <<
eta <<
"|" <<
phi <<
"|" <<
depth
118 <<
"|" << vers << std::endl;
132 : hb_recalibration(nullptr),
133 he_recalibration(nullptr),
134 hf_recalibration(nullptr),
137 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::HcalHardcodeCalibrations->...";
139 if (iConfig.
exists(
"GainWidthsForTrigPrims"))
168 bool hb_recalib = iConfig.
getParameter<
bool>(
"HBRecalibration");
169 bool he_recalib = iConfig.
getParameter<
bool>(
"HERecalibration");
170 bool hf_recalib = iConfig.
getParameter<
bool>(
"HFRecalibration");
173 std::make_unique<HBHERecalibration>(
iLumi,
179 std::make_unique<HBHERecalibration>(
iLumi,
188 std::cout <<
" HcalHardcodeCalibrations: iLumi = " <<
iLumi << std::endl;
200 findingRecord<HcalPedestalsRcd>();
204 findingRecord<HcalPedestalWidthsRcd>();
210 findingRecord<HcalPedestalsRcd>();
216 findingRecord<HcalPedestalWidthsRcd>();
220 findingRecord<HcalGainsRcd>();
224 findingRecord<HcalGainWidthsRcd>();
228 findingRecord<HcalQIEDataRcd>();
232 findingRecord<HcalQIETypesRcd>();
236 findingRecord<HcalChannelQualityRcd>();
240 findingRecord<HcalElectronicsMapRcd>();
244 findingRecord<HcalZSThresholdsRcd>();
255 findingRecord<HcalRespCorrsRcd>();
259 findingRecord<HcalLUTCorrsRcd>();
263 findingRecord<HcalPFCorrsRcd>();
267 findingRecord<HcalTimeCorrsRcd>();
272 findingRecord<HcalL1TriggerObjectsRcd>();
277 findingRecord<HcalValidationCorrsRcd>();
281 findingRecord<HcalLutMetadataRcd>();
285 findingRecord<HcalDcsRcd>();
289 findingRecord<HcalDcsMapRcd>();
293 findingRecord<HcalRecoParamsRcd>();
297 findingRecord<HcalLongRecoParamsRcd>();
302 findingRecord<HcalZDCLowGainFractionsRcd>();
306 findingRecord<HcalMCParamsRcd>();
311 findingRecord<HcalFlagHFDigiTimeParamsRcd>();
315 findingRecord<HcalFrontEndMapRcd>();
319 findingRecord<HcalSiPMParametersRcd>();
323 findingRecord<HcalSiPMCharacteristicsRcd>();
328 findingRecord<HcalTPChannelParametersRcd>();
332 findingRecord<HcalTPParametersRcd>();
354 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produce" << seff <<
"Pedestals-> ...";
357 auto result = std::make_unique<HcalPedestals>(&topo,
false);
359 for (
auto cell :
cells) {
369 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produce" << seff <<
"PedestalWidths-> ...";
371 auto result = std::make_unique<HcalPedestalWidths>(&topo,
false);
373 for (
auto cell :
cells) {
398 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceGains-> ...";
401 auto result = std::make_unique<HcalGains>(&topo);
403 for (
auto cell :
cells) {
411 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceGainWidths-> ...";
414 auto result = std::make_unique<HcalGainWidths>(&topo);
416 for (
auto cell :
cells) {
421 }
else if (!cell.isHcalTrigTowerDetId()) {
430 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceQIEData-> ...";
438 auto result = std::make_unique<HcalQIEData>(&topo);
440 for (
auto cell :
cells) {
448 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceQIETypes-> ...";
451 auto result = std::make_unique<HcalQIETypes>(&topo);
453 for (
auto cell :
cells) {
461 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceChannelQuality-> ...";
464 auto result = std::make_unique<HcalChannelQuality>(&topo);
466 for (
auto cell :
cells) {
475 if (!(cell.isHcalZDCDetId())) {
483 bool isHEP17 = (
iphi >= 63) && (
iphi <= 66) && (
ieta > 0);
485 bool is18d1 = (absieta == 18) && (
depth == 1);
500 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceRespCorrs-> ...";
505 std::vector<std::vector<int>> m_segmentation;
506 int maxEta = topo.lastHBHERing();
507 m_segmentation.resize(
maxEta);
509 topo.getDepthSegmentation(
i + 1, m_segmentation[
i]);
521 auto result = std::make_unique<HcalRespCorrs>(&topo);
523 for (
const auto& cell :
cells) {
545 std::cout <<
"HB ieta, depth = " << ieta_ <<
", " << depth_ <<
" corr = " <<
corr << std::endl;
552 std::cout <<
"HE ieta, depth = " << ieta_ <<
", " << depth_ <<
" corr = " <<
corr << std::endl;
559 std::cout <<
"HF ieta, depth = " << ieta_ <<
", " << depth_ <<
" corr = " <<
corr << std::endl;
570 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceLUTCorrs-> ...";
573 auto result = std::make_unique<HcalLUTCorrs>(&topo);
575 for (
auto cell :
cells) {
583 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::producePFCorrs-> ...";
586 auto result = std::make_unique<HcalPFCorrs>(&topo);
588 for (
auto cell :
cells) {
596 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceTimeCorrs-> ...";
599 auto result = std::make_unique<HcalTimeCorrs>(&topo);
601 for (
auto cell :
cells) {
609 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceZSThresholds-> ...";
612 auto result = std::make_unique<HcalZSThresholds>(&topo);
614 for (
auto cell :
cells) {
623 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceL1TriggerObjects-> ...";
626 auto result = std::make_unique<HcalL1TriggerObjects>(&topo);
628 for (
auto cell :
cells) {
633 result->setTagString(
"hardcoded");
634 result->setAlgoString(
"hardcoded");
639 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceElectronicsMap-> ...";
648 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceValidationCorrs-> ...";
651 auto result = std::make_unique<HcalValidationCorrs>(&topo);
653 for (
auto cell :
cells) {
661 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceLutMetadata-> ...";
664 auto result = std::make_unique<HcalLutMetadata>(&topo);
667 result->setNominalGain(0.177);
670 for (
const auto& cell :
cells) {
675 if (cell.isHcalTrigTowerDetId()) {
687 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceDcsValues-> ...";
688 auto result = std::make_unique<HcalDcsValues>();
693 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceDcsMap-> ...";
699 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceRecoParams-> ...";
702 auto result = std::make_unique<HcalRecoParams>(&topo);
704 for (
auto cell :
cells) {
712 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceTimingParams-> ...";
715 auto result = std::make_unique<HcalTimingParams>(&topo);
717 for (
auto cell :
cells) {
725 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceLongRecoParams-> ...";
728 auto result = std::make_unique<HcalLongRecoParams>(&topo);
730 std::vector<unsigned int> mSignal;
731 mSignal.push_back(4);
732 mSignal.push_back(5);
733 mSignal.push_back(6);
734 std::vector<unsigned int> mNoise;
738 for (
auto cell :
cells) {
739 if (cell.isHcalZDCDetId()) {
749 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceZDCLowGainFractions-> ...";
752 auto result = std::make_unique<HcalZDCLowGainFractions>(&topo);
754 for (
auto cell :
cells) {
764 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceMCParams-> ...";
766 auto result = std::make_unique<HcalMCParams>(&topo);
768 for (
auto cell :
cells) {
777 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceFlagHFDigiTimeParams-> ...";
780 auto result = std::make_unique<HcalFlagHFDigiTimeParams>(&topo);
783 std::vector<double> coef;
784 coef.push_back(0.93);
785 coef.push_back(-0.38275);
786 coef.push_back(-0.012667);
788 for (
auto cell :
cells) {
802 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceFrontEndMap-> ...";
811 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceSiPMParameters-> ...";
814 auto result = std::make_unique<HcalSiPMParameters>(&topo);
816 for (
auto cell :
cells) {
825 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceSiPMCharacteristics-> ...";
832 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceTPChannelParameters-> ...";
835 auto result = std::make_unique<HcalTPChannelParameters>(&topo);
837 for (
auto cell :
cells) {
845 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceTPParameters-> ...";
847 auto result = std::make_unique<HcalTPParameters>();
854 desc.add<
double>(
"iLumi", -1.);
855 desc.add<
bool>(
"HBRecalibration",
false);
856 desc.add<
double>(
"HBreCalibCutoff", 20.);
858 desc.add<
bool>(
"HERecalibration",
false);
859 desc.add<
double>(
"HEreCalibCutoff", 20.);
861 desc.add<
bool>(
"HFRecalibration",
false);
862 desc.add<
bool>(
"GainWidthsForTrigPrims",
false);
863 desc.add<
bool>(
"useHBUpgrade",
false);
864 desc.add<
bool>(
"useHEUpgrade",
false);
865 desc.add<
bool>(
"useHFUpgrade",
false);
866 desc.add<
bool>(
"useHOUpgrade",
true);
867 desc.add<
bool>(
"testHFQIE10",
false);
868 desc.add<
bool>(
"testHEPlan1",
false);
869 desc.add<
bool>(
"killHE",
false);
870 desc.add<
bool>(
"useLayer0Weight",
false);
871 desc.add<
bool>(
"useIeta18depth1",
true);
872 desc.addUntracked<std::vector<std::string>>(
"toGet", std::vector<std::string>());
873 desc.addUntracked<
bool>(
"fromDDD",
false);
876 desc_hb.
add<std::vector<double>>(
"gain", std::vector<double>({0.19}));
877 desc_hb.add<std::vector<double>>(
"gainWidth", std::vector<double>({0.0}));
878 desc_hb.add<
double>(
"pedestal", 3.0);
879 desc_hb.add<
double>(
"pedestalWidth", 0.55);
880 desc_hb.add<
int>(
"zsThreshold", 8);
881 desc_hb.add<std::vector<double>>(
"qieOffset", std::vector<double>({-0.49, 1.8, 7.2, 37.9}));
882 desc_hb.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.912, 0.917, 0.922, 0.923}));
883 desc_hb.add<
int>(
"qieType", 0);
884 desc_hb.add<
int>(
"mcShape", 125);
885 desc_hb.add<
int>(
"recoShape", 105);
886 desc_hb.add<
double>(
"photoelectronsToAnalog", 0.0);
887 desc_hb.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.0}));
888 desc_hb.add<
bool>(
"doRadiationDamage",
false);
892 desc_hbRaddam.
add<
double>(
"temperatureBase", 20.0);
893 desc_hbRaddam.add<
double>(
"temperatureNew", -5.0);
894 desc_hbRaddam.add<
double>(
"intlumiOffset", 150);
895 desc_hbRaddam.add<
double>(
"depVsTemp", 0.0631);
896 desc_hbRaddam.add<
double>(
"intlumiToNeutrons", 3.67e8);
897 desc_hbRaddam.add<std::vector<double>>(
"depVsNeutrons", {5.69e-11, 7.90e-11});
900 desc_hbUpgrade.
add<std::vector<double>>(
"gain", std::vector<double>({0.00111111111111}));
901 desc_hbUpgrade.add<std::vector<double>>(
"gainWidth", std::vector<double>({0}));
902 desc_hbUpgrade.add<
double>(
"pedestal", 18.0);
903 desc_hbUpgrade.add<
double>(
"pedestalWidth", 5.0);
904 desc_hbUpgrade.add<
int>(
"zsThreshold", 3);
905 desc_hbUpgrade.add<std::vector<double>>(
"qieOffset", std::vector<double>({0.0, 0.0, 0.0, 0.0}));
906 desc_hbUpgrade.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.333, 0.333, 0.333, 0.333}));
907 desc_hbUpgrade.add<
int>(
"qieType", 2);
908 desc_hbUpgrade.add<
int>(
"mcShape", 206);
909 desc_hbUpgrade.add<
int>(
"recoShape", 206);
910 desc_hbUpgrade.add<
double>(
"photoelectronsToAnalog", 57.5);
911 desc_hbUpgrade.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.055}));
912 desc_hbUpgrade.add<
bool>(
"doRadiationDamage",
true);
917 desc_he.
add<std::vector<double>>(
"gain", std::vector<double>({0.23}));
918 desc_he.add<std::vector<double>>(
"gainWidth", std::vector<double>({0}));
919 desc_he.add<
double>(
"pedestal", 3.0);
920 desc_he.add<
double>(
"pedestalWidth", 0.79);
921 desc_he.add<
int>(
"zsThreshold", 9);
922 desc_he.add<std::vector<double>>(
"qieOffset", std::vector<double>({-0.38, 2.0, 7.6, 39.6}));
923 desc_he.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.912, 0.916, 0.92, 0.922}));
924 desc_he.add<
int>(
"qieType", 0);
925 desc_he.add<
int>(
"mcShape", 125);
926 desc_he.add<
int>(
"recoShape", 105);
927 desc_he.add<
double>(
"photoelectronsToAnalog", 0.0);
928 desc_he.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.0}));
929 desc_he.add<
bool>(
"doRadiationDamage",
false);
933 desc_heRaddam.
add<
double>(
"temperatureBase", 20.0);
934 desc_heRaddam.add<
double>(
"temperatureNew", 5.0);
935 desc_heRaddam.add<
double>(
"intlumiOffset", 75);
936 desc_heRaddam.add<
double>(
"depVsTemp", 0.0631);
937 desc_heRaddam.add<
double>(
"intlumiToNeutrons", 2.92e8);
938 desc_heRaddam.add<std::vector<double>>(
"depVsNeutrons", {5.69e-11, 7.90e-11});
941 desc_heUpgrade.
add<std::vector<double>>(
"gain", std::vector<double>({0.00111111111111}));
942 desc_heUpgrade.add<std::vector<double>>(
"gainWidth", std::vector<double>({0}));
943 desc_heUpgrade.add<
double>(
"pedestal", 18.0);
944 desc_heUpgrade.add<
double>(
"pedestalWidth", 5.0);
945 desc_heUpgrade.add<
int>(
"zsThreshold", 3);
946 desc_heUpgrade.add<std::vector<double>>(
"qieOffset", std::vector<double>({0.0, 0.0, 0.0, 0.0}));
947 desc_heUpgrade.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.333, 0.333, 0.333, 0.333}));
948 desc_heUpgrade.add<
int>(
"qieType", 2);
949 desc_heUpgrade.add<
int>(
"mcShape", 206);
950 desc_heUpgrade.add<
int>(
"recoShape", 206);
951 desc_heUpgrade.add<
double>(
"photoelectronsToAnalog", 57.5);
952 desc_heUpgrade.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.055}));
953 desc_heUpgrade.add<
bool>(
"doRadiationDamage",
true);
958 desc_hf.
add<std::vector<double>>(
"gain", std::vector<double>({0.14, 0.135}));
959 desc_hf.add<std::vector<double>>(
"gainWidth", std::vector<double>({0.0, 0.0}));
960 desc_hf.add<
double>(
"pedestal", 3.0);
961 desc_hf.add<
double>(
"pedestalWidth", 0.84);
962 desc_hf.add<
int>(
"zsThreshold", -9999);
963 desc_hf.add<std::vector<double>>(
"qieOffset", std::vector<double>({-0.87, 1.4, 7.8, -29.6}));
964 desc_hf.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.359, 0.358, 0.36, 0.367}));
965 desc_hf.add<
int>(
"qieType", 0);
966 desc_hf.add<
int>(
"mcShape", 301);
967 desc_hf.add<
int>(
"recoShape", 301);
968 desc_hf.add<
double>(
"photoelectronsToAnalog", 0.0);
969 desc_hf.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.0}));
970 desc_hf.add<
bool>(
"doRadiationDamage",
false);
974 desc_hfUpgrade.
add<std::vector<double>>(
"gain", std::vector<double>({0.14, 0.135}));
975 desc_hfUpgrade.add<std::vector<double>>(
"gainWidth", std::vector<double>({0.0, 0.0}));
976 desc_hfUpgrade.add<
double>(
"pedestal", 13.33);
977 desc_hfUpgrade.add<
double>(
"pedestalWidth", 3.33);
978 desc_hfUpgrade.add<
int>(
"zsThreshold", -9999);
979 desc_hfUpgrade.add<std::vector<double>>(
"qieOffset", std::vector<double>({0.0697, -0.7405, 12.38, -671.9}));
980 desc_hfUpgrade.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.297, 0.298, 0.298, 0.313}));
981 desc_hfUpgrade.add<
int>(
"qieType", 1);
982 desc_hfUpgrade.add<
int>(
"mcShape", 301);
983 desc_hfUpgrade.add<
int>(
"recoShape", 301);
984 desc_hfUpgrade.add<
double>(
"photoelectronsToAnalog", 0.0);
985 desc_hfUpgrade.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.0}));
986 desc_hfUpgrade.add<
bool>(
"doRadiationDamage",
false);
990 desc_hfrecal.
add<std::vector<double>>(
"HFdepthOneParameterA", std::vector<double>());
991 desc_hfrecal.add<std::vector<double>>(
"HFdepthOneParameterB", std::vector<double>());
992 desc_hfrecal.add<std::vector<double>>(
"HFdepthTwoParameterA", std::vector<double>());
993 desc_hfrecal.add<std::vector<double>>(
"HFdepthTwoParameterB", std::vector<double>());
997 desc_ho.
add<std::vector<double>>(
"gain", std::vector<double>({0.006, 0.0087}));
998 desc_ho.add<std::vector<double>>(
"gainWidth", std::vector<double>({0.0, 0.0}));
999 desc_ho.add<
double>(
"pedestal", 11.0);
1000 desc_ho.add<
double>(
"pedestalWidth", 0.57);
1001 desc_ho.add<
int>(
"zsThreshold", 24);
1002 desc_ho.add<std::vector<double>>(
"qieOffset", std::vector<double>({-0.44, 1.4, 7.1, 38.5}));
1003 desc_ho.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.907, 0.915, 0.92, 0.921}));
1004 desc_ho.add<
int>(
"qieType", 0);
1005 desc_ho.add<
int>(
"mcShape", 201);
1006 desc_ho.add<
int>(
"recoShape", 201);
1007 desc_ho.add<
double>(
"photoelectronsToAnalog", 4.0);
1008 desc_ho.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.0}));
1009 desc_ho.add<
bool>(
"doRadiationDamage",
false);
1013 validator_sipm.
add<
int>(
"pixels", 1);
1014 validator_sipm.add<
double>(
"crosstalk", 0);
1015 validator_sipm.add<
double>(
"nonlin1", 1);
1016 validator_sipm.add<
double>(
"nonlin2", 0);
1017 validator_sipm.add<
double>(
"nonlin3", 0);
1018 std::vector<edm::ParameterSet> default_sipm(1);
1019 desc.addVPSet(
"SiPMCharacteristics", validator_sipm, default_sipm);