37 const std::vector<HcalGenericDetId>& allCells(
const HcalTopology& hcaltopology,
bool killHE =
false) {
38 static std::vector<HcalGenericDetId>
result;
42 std::cout << std::endl <<
"HcalHardcodeCalibrations: maxDepth = " <<
maxDepth << std::endl;
53 if (hcaltopology.
valid(cell)) {
56 std::cout <<
" HcalHardcodedCalibrations: det|eta|phi|depth = " << det <<
"|" <<
eta <<
"|" <<
phi
57 <<
"|" <<
depth << std::endl;
69 if (zdctopology.
valid(zcell))
72 if (zdctopology.
valid(zcell))
78 if (zdctopology.
valid(zcell))
81 if (zdctopology.
valid(zcell))
87 if (zdctopology.
valid(zcell))
90 if (zdctopology.
valid(zcell))
96 if (zdctopology.
valid(zcell))
99 if (zdctopology.
valid(zcell))
113 if (hcaltopology.
validHT(cell)) {
116 std::cout <<
" HcalHardcodedCalibrations: eta|phi|depth|vers = " <<
eta <<
"|" <<
phi <<
"|" <<
depth
117 <<
"|" << vers << std::endl;
131 : hb_recalibration(nullptr),
132 he_recalibration(nullptr),
133 hf_recalibration(nullptr),
136 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::HcalHardcodeCalibrations->...";
138 if (iConfig.
exists(
"GainWidthsForTrigPrims"))
167 bool hb_recalib = iConfig.
getParameter<
bool>(
"HBRecalibration");
168 bool he_recalib = iConfig.
getParameter<
bool>(
"HERecalibration");
169 bool hf_recalib = iConfig.
getParameter<
bool>(
"HFRecalibration");
172 std::make_unique<HBHERecalibration>(
iLumi,
178 std::make_unique<HBHERecalibration>(
iLumi,
187 std::cout <<
" HcalHardcodeCalibrations: iLumi = " <<
iLumi << std::endl;
199 findingRecord<HcalPedestalsRcd>();
203 findingRecord<HcalPedestalWidthsRcd>();
209 findingRecord<HcalPedestalsRcd>();
215 findingRecord<HcalPedestalWidthsRcd>();
219 findingRecord<HcalGainsRcd>();
223 findingRecord<HcalGainWidthsRcd>();
227 findingRecord<HcalQIEDataRcd>();
231 findingRecord<HcalQIETypesRcd>();
235 findingRecord<HcalChannelQualityRcd>();
239 findingRecord<HcalElectronicsMapRcd>();
243 findingRecord<HcalZSThresholdsRcd>();
254 findingRecord<HcalRespCorrsRcd>();
258 findingRecord<HcalLUTCorrsRcd>();
262 findingRecord<HcalPFCorrsRcd>();
266 findingRecord<HcalTimeCorrsRcd>();
271 findingRecord<HcalL1TriggerObjectsRcd>();
276 findingRecord<HcalValidationCorrsRcd>();
280 findingRecord<HcalLutMetadataRcd>();
284 findingRecord<HcalDcsRcd>();
288 findingRecord<HcalDcsMapRcd>();
292 findingRecord<HcalRecoParamsRcd>();
296 findingRecord<HcalLongRecoParamsRcd>();
301 findingRecord<HcalZDCLowGainFractionsRcd>();
305 findingRecord<HcalMCParamsRcd>();
310 findingRecord<HcalFlagHFDigiTimeParamsRcd>();
314 findingRecord<HcalFrontEndMapRcd>();
318 findingRecord<HcalSiPMParametersRcd>();
322 findingRecord<HcalSiPMCharacteristicsRcd>();
327 findingRecord<HcalTPChannelParametersRcd>();
331 findingRecord<HcalTPParametersRcd>();
353 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produce" << seff <<
"Pedestals-> ...";
356 auto result = std::make_unique<HcalPedestals>(&topo,
false);
358 for (
auto cell :
cells) {
368 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produce" << seff <<
"PedestalWidths-> ...";
370 auto result = std::make_unique<HcalPedestalWidths>(&topo,
false);
372 for (
auto cell :
cells) {
397 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceGains-> ...";
400 auto result = std::make_unique<HcalGains>(&topo);
402 for (
auto cell :
cells) {
410 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceGainWidths-> ...";
413 auto result = std::make_unique<HcalGainWidths>(&topo);
415 for (
auto cell :
cells) {
420 }
else if (!cell.isHcalTrigTowerDetId()) {
429 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceQIEData-> ...";
437 auto result = std::make_unique<HcalQIEData>(&topo);
439 for (
auto cell :
cells) {
447 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceQIETypes-> ...";
450 auto result = std::make_unique<HcalQIETypes>(&topo);
452 for (
auto cell :
cells) {
460 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceChannelQuality-> ...";
463 auto result = std::make_unique<HcalChannelQuality>(&topo);
465 for (
auto cell :
cells) {
474 if (!(cell.isHcalZDCDetId())) {
482 bool isHEP17 = (
iphi >= 63) && (
iphi <= 66) && (
ieta > 0);
484 bool is18d1 = (absieta == 18) && (
depth == 1);
499 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceRespCorrs-> ...";
504 std::vector<std::vector<int>> m_segmentation;
505 int maxEta = topo.lastHBHERing();
506 m_segmentation.resize(
maxEta);
508 topo.getDepthSegmentation(
i + 1, m_segmentation[
i]);
520 auto result = std::make_unique<HcalRespCorrs>(&topo);
522 for (
const auto& cell :
cells) {
544 std::cout <<
"HB ieta, depth = " << ieta_ <<
", " << depth_ <<
" corr = " <<
corr << std::endl;
551 std::cout <<
"HE ieta, depth = " << ieta_ <<
", " << depth_ <<
" corr = " <<
corr << std::endl;
558 std::cout <<
"HF ieta, depth = " << ieta_ <<
", " << depth_ <<
" corr = " <<
corr << std::endl;
569 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceLUTCorrs-> ...";
572 auto result = std::make_unique<HcalLUTCorrs>(&topo);
574 for (
auto cell :
cells) {
582 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::producePFCorrs-> ...";
585 auto result = std::make_unique<HcalPFCorrs>(&topo);
587 for (
auto cell :
cells) {
595 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceTimeCorrs-> ...";
598 auto result = std::make_unique<HcalTimeCorrs>(&topo);
600 for (
auto cell :
cells) {
608 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceZSThresholds-> ...";
611 auto result = std::make_unique<HcalZSThresholds>(&topo);
613 for (
auto cell :
cells) {
622 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceL1TriggerObjects-> ...";
625 auto result = std::make_unique<HcalL1TriggerObjects>(&topo);
627 for (
auto cell :
cells) {
632 result->setTagString(
"hardcoded");
633 result->setAlgoString(
"hardcoded");
638 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceElectronicsMap-> ...";
647 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceValidationCorrs-> ...";
650 auto result = std::make_unique<HcalValidationCorrs>(&topo);
652 for (
auto cell :
cells) {
660 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceLutMetadata-> ...";
663 auto result = std::make_unique<HcalLutMetadata>(&topo);
666 result->setNominalGain(0.177);
669 for (
const auto& cell :
cells) {
674 if (cell.isHcalTrigTowerDetId()) {
686 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceDcsValues-> ...";
687 auto result = std::make_unique<HcalDcsValues>();
692 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceDcsMap-> ...";
698 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceRecoParams-> ...";
701 auto result = std::make_unique<HcalRecoParams>(&topo);
703 for (
auto cell :
cells) {
711 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceTimingParams-> ...";
714 auto result = std::make_unique<HcalTimingParams>(&topo);
716 for (
auto cell :
cells) {
724 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceLongRecoParams-> ...";
727 auto result = std::make_unique<HcalLongRecoParams>(&topo);
729 std::vector<unsigned int> mSignal;
730 mSignal.push_back(4);
731 mSignal.push_back(5);
732 mSignal.push_back(6);
733 std::vector<unsigned int> mNoise;
737 for (
auto cell :
cells) {
738 if (cell.isHcalZDCDetId()) {
748 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceZDCLowGainFractions-> ...";
751 auto result = std::make_unique<HcalZDCLowGainFractions>(&topo);
753 for (
auto cell :
cells) {
763 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceMCParams-> ...";
765 auto result = std::make_unique<HcalMCParams>(&topo);
767 for (
auto cell :
cells) {
776 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceFlagHFDigiTimeParams-> ...";
779 auto result = std::make_unique<HcalFlagHFDigiTimeParams>(&topo);
782 std::vector<double> coef;
783 coef.push_back(0.93);
784 coef.push_back(-0.38275);
785 coef.push_back(-0.012667);
787 for (
auto cell :
cells) {
801 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceFrontEndMap-> ...";
810 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceSiPMParameters-> ...";
813 auto result = std::make_unique<HcalSiPMParameters>(&topo);
815 for (
auto cell :
cells) {
824 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceSiPMCharacteristics-> ...";
831 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceTPChannelParameters-> ...";
834 auto result = std::make_unique<HcalTPChannelParameters>(&topo);
836 for (
auto cell :
cells) {
844 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceTPParameters-> ...";
846 auto result = std::make_unique<HcalTPParameters>();
853 desc.add<
double>(
"iLumi", -1.);
854 desc.add<
bool>(
"HBRecalibration",
false);
855 desc.add<
double>(
"HBreCalibCutoff", 20.);
857 desc.add<
bool>(
"HERecalibration",
false);
858 desc.add<
double>(
"HEreCalibCutoff", 20.);
860 desc.add<
bool>(
"HFRecalibration",
false);
861 desc.add<
bool>(
"GainWidthsForTrigPrims",
false);
862 desc.add<
bool>(
"useHBUpgrade",
false);
863 desc.add<
bool>(
"useHEUpgrade",
false);
864 desc.add<
bool>(
"useHFUpgrade",
false);
865 desc.add<
bool>(
"useHOUpgrade",
true);
866 desc.add<
bool>(
"testHFQIE10",
false);
867 desc.add<
bool>(
"testHEPlan1",
false);
868 desc.add<
bool>(
"killHE",
false);
869 desc.add<
bool>(
"useLayer0Weight",
false);
870 desc.add<
bool>(
"useIeta18depth1",
true);
871 desc.addUntracked<std::vector<std::string>>(
"toGet", std::vector<std::string>());
872 desc.addUntracked<
bool>(
"fromDDD",
false);
875 desc_hb.
add<std::vector<double>>(
"gain", std::vector<double>({0.19}));
876 desc_hb.add<std::vector<double>>(
"gainWidth", std::vector<double>({0.0}));
877 desc_hb.add<
double>(
"pedestal", 3.0);
878 desc_hb.add<
double>(
"pedestalWidth", 0.55);
879 desc_hb.add<
int>(
"zsThreshold", 8);
880 desc_hb.add<std::vector<double>>(
"qieOffset", std::vector<double>({-0.49, 1.8, 7.2, 37.9}));
881 desc_hb.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.912, 0.917, 0.922, 0.923}));
882 desc_hb.add<
int>(
"qieType", 0);
883 desc_hb.add<
int>(
"mcShape", 125);
884 desc_hb.add<
int>(
"recoShape", 105);
885 desc_hb.add<
double>(
"photoelectronsToAnalog", 0.0);
886 desc_hb.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.0}));
887 desc_hb.add<std::vector<double>>(
"noiseCorrelation", 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<std::vector<double>>(
"noiseCorrelation", std::vector<double>({0.26}));
913 desc_hbUpgrade.add<
bool>(
"doRadiationDamage",
true);
918 desc_he.
add<std::vector<double>>(
"gain", std::vector<double>({0.23}));
919 desc_he.add<std::vector<double>>(
"gainWidth", std::vector<double>({0}));
920 desc_he.add<
double>(
"pedestal", 3.0);
921 desc_he.add<
double>(
"pedestalWidth", 0.79);
922 desc_he.add<
int>(
"zsThreshold", 9);
923 desc_he.add<std::vector<double>>(
"qieOffset", std::vector<double>({-0.38, 2.0, 7.6, 39.6}));
924 desc_he.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.912, 0.916, 0.92, 0.922}));
925 desc_he.add<
int>(
"qieType", 0);
926 desc_he.add<
int>(
"mcShape", 125);
927 desc_he.add<
int>(
"recoShape", 105);
928 desc_he.add<
double>(
"photoelectronsToAnalog", 0.0);
929 desc_he.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.0}));
930 desc_he.add<std::vector<double>>(
"noiseCorrelation", std::vector<double>({0.0}));
931 desc_he.add<
bool>(
"doRadiationDamage",
false);
935 desc_heRaddam.
add<
double>(
"temperatureBase", 20.0);
936 desc_heRaddam.add<
double>(
"temperatureNew", 5.0);
937 desc_heRaddam.add<
double>(
"intlumiOffset", 75);
938 desc_heRaddam.add<
double>(
"depVsTemp", 0.0631);
939 desc_heRaddam.add<
double>(
"intlumiToNeutrons", 2.92e8);
940 desc_heRaddam.add<std::vector<double>>(
"depVsNeutrons", {5.69e-11, 7.90e-11});
943 desc_heUpgrade.
add<std::vector<double>>(
"gain", std::vector<double>({0.00111111111111}));
944 desc_heUpgrade.add<std::vector<double>>(
"gainWidth", std::vector<double>({0}));
945 desc_heUpgrade.add<
double>(
"pedestal", 18.0);
946 desc_heUpgrade.add<
double>(
"pedestalWidth", 5.0);
947 desc_heUpgrade.add<
int>(
"zsThreshold", 3);
948 desc_heUpgrade.add<std::vector<double>>(
"qieOffset", std::vector<double>({0.0, 0.0, 0.0, 0.0}));
949 desc_heUpgrade.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.333, 0.333, 0.333, 0.333}));
950 desc_heUpgrade.add<
int>(
"qieType", 2);
951 desc_heUpgrade.add<
int>(
"mcShape", 206);
952 desc_heUpgrade.add<
int>(
"recoShape", 206);
953 desc_heUpgrade.add<
double>(
"photoelectronsToAnalog", 57.5);
954 desc_heUpgrade.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.055}));
955 desc_heUpgrade.add<std::vector<double>>(
"noiseCorrelation", std::vector<double>({0.26}));
956 desc_heUpgrade.add<
bool>(
"doRadiationDamage",
true);
961 desc_hf.
add<std::vector<double>>(
"gain", std::vector<double>({0.14, 0.135}));
962 desc_hf.add<std::vector<double>>(
"gainWidth", std::vector<double>({0.0, 0.0}));
963 desc_hf.add<
double>(
"pedestal", 3.0);
964 desc_hf.add<
double>(
"pedestalWidth", 0.84);
965 desc_hf.add<
int>(
"zsThreshold", -9999);
966 desc_hf.add<std::vector<double>>(
"qieOffset", std::vector<double>({-0.87, 1.4, 7.8, -29.6}));
967 desc_hf.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.359, 0.358, 0.36, 0.367}));
968 desc_hf.add<
int>(
"qieType", 0);
969 desc_hf.add<
int>(
"mcShape", 301);
970 desc_hf.add<
int>(
"recoShape", 301);
971 desc_hf.add<
double>(
"photoelectronsToAnalog", 0.0);
972 desc_hf.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.0}));
973 desc_hf.add<std::vector<double>>(
"noiseCorrelation", std::vector<double>({0.0}));
974 desc_hf.add<
bool>(
"doRadiationDamage",
false);
978 desc_hfUpgrade.
add<std::vector<double>>(
"gain", std::vector<double>({0.14, 0.135}));
979 desc_hfUpgrade.add<std::vector<double>>(
"gainWidth", std::vector<double>({0.0, 0.0}));
980 desc_hfUpgrade.add<
double>(
"pedestal", 13.33);
981 desc_hfUpgrade.add<
double>(
"pedestalWidth", 3.33);
982 desc_hfUpgrade.add<
int>(
"zsThreshold", -9999);
983 desc_hfUpgrade.add<std::vector<double>>(
"qieOffset", std::vector<double>({0.0697, -0.7405, 12.38, -671.9}));
984 desc_hfUpgrade.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.297, 0.298, 0.298, 0.313}));
985 desc_hfUpgrade.add<
int>(
"qieType", 1);
986 desc_hfUpgrade.add<
int>(
"mcShape", 301);
987 desc_hfUpgrade.add<
int>(
"recoShape", 301);
988 desc_hfUpgrade.add<
double>(
"photoelectronsToAnalog", 0.0);
989 desc_hfUpgrade.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.0}));
990 desc_hfUpgrade.add<std::vector<double>>(
"noiseCorrelation", std::vector<double>({0.0}));
991 desc_hfUpgrade.add<
bool>(
"doRadiationDamage",
false);
995 desc_hfrecal.
add<std::vector<double>>(
"HFdepthOneParameterA", std::vector<double>());
996 desc_hfrecal.add<std::vector<double>>(
"HFdepthOneParameterB", std::vector<double>());
997 desc_hfrecal.add<std::vector<double>>(
"HFdepthTwoParameterA", std::vector<double>());
998 desc_hfrecal.add<std::vector<double>>(
"HFdepthTwoParameterB", std::vector<double>());
1002 desc_ho.
add<std::vector<double>>(
"gain", std::vector<double>({0.006, 0.0087}));
1003 desc_ho.add<std::vector<double>>(
"gainWidth", std::vector<double>({0.0, 0.0}));
1004 desc_ho.add<
double>(
"pedestal", 11.0);
1005 desc_ho.add<
double>(
"pedestalWidth", 0.57);
1006 desc_ho.add<
int>(
"zsThreshold", 24);
1007 desc_ho.add<std::vector<double>>(
"qieOffset", std::vector<double>({-0.44, 1.4, 7.1, 38.5}));
1008 desc_ho.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.907, 0.915, 0.92, 0.921}));
1009 desc_ho.add<
int>(
"qieType", 0);
1010 desc_ho.add<
int>(
"mcShape", 201);
1011 desc_ho.add<
int>(
"recoShape", 201);
1012 desc_ho.add<
double>(
"photoelectronsToAnalog", 4.0);
1013 desc_ho.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.0}));
1014 desc_ho.add<std::vector<double>>(
"noiseCorrelation", std::vector<double>({0.0}));
1015 desc_ho.add<
bool>(
"doRadiationDamage",
false);
1019 validator_sipm.
add<
int>(
"pixels", 1);
1020 validator_sipm.add<
double>(
"crosstalk", 0);
1021 validator_sipm.add<
double>(
"nonlin1", 1);
1022 validator_sipm.add<
double>(
"nonlin2", 0);
1023 validator_sipm.add<
double>(
"nonlin3", 0);
1024 std::vector<edm::ParameterSet> default_sipm(1);
1025 desc.addVPSet(
"SiPMCharacteristics", validator_sipm, default_sipm);