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");
185 std::cout <<
" HcalHardcodeCalibrations: iLumi = " <<
iLumi << std::endl;
197 findingRecord<HcalPedestalsRcd>();
201 findingRecord<HcalPedestalWidthsRcd>();
206 findingRecord<HcalPedestalsRcd>();
211 findingRecord<HcalPedestalWidthsRcd>();
215 findingRecord<HcalGainsRcd>();
219 findingRecord<HcalGainWidthsRcd>();
223 findingRecord<HcalQIEDataRcd>();
227 findingRecord<HcalQIETypesRcd>();
231 findingRecord<HcalChannelQualityRcd>();
235 findingRecord<HcalElectronicsMapRcd>();
239 findingRecord<HcalZSThresholdsRcd>();
250 findingRecord<HcalRespCorrsRcd>();
254 findingRecord<HcalLUTCorrsRcd>();
258 findingRecord<HcalPFCorrsRcd>();
262 findingRecord<HcalTimeCorrsRcd>();
267 findingRecord<HcalL1TriggerObjectsRcd>();
272 findingRecord<HcalValidationCorrsRcd>();
276 findingRecord<HcalLutMetadataRcd>();
280 findingRecord<HcalDcsRcd>();
284 findingRecord<HcalDcsMapRcd>();
288 findingRecord<HcalRecoParamsRcd>();
292 findingRecord<HcalLongRecoParamsRcd>();
297 findingRecord<HcalZDCLowGainFractionsRcd>();
301 findingRecord<HcalMCParamsRcd>();
306 findingRecord<HcalFlagHFDigiTimeParamsRcd>();
310 findingRecord<HcalFrontEndMapRcd>();
314 findingRecord<HcalSiPMParametersRcd>();
318 findingRecord<HcalSiPMCharacteristicsRcd>();
323 findingRecord<HcalTPChannelParametersRcd>();
327 findingRecord<HcalTPParametersRcd>();
349 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produce" << seff <<
"Pedestals-> ...";
352 auto result = std::make_unique<HcalPedestals>(&topo,
false);
354 for (
auto cell :
cells) {
364 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produce" << seff <<
"PedestalWidths-> ...";
366 auto result = std::make_unique<HcalPedestalWidths>(&topo,
false);
368 for (
auto cell :
cells) {
393 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceGains-> ...";
396 auto result = std::make_unique<HcalGains>(&topo);
398 for (
auto cell :
cells) {
406 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceGainWidths-> ...";
409 auto result = std::make_unique<HcalGainWidths>(&topo);
411 for (
auto cell :
cells) {
416 }
else if (!cell.isHcalTrigTowerDetId()) {
425 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceQIEData-> ...";
433 auto result = std::make_unique<HcalQIEData>(&topo);
435 for (
auto cell :
cells) {
443 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceQIETypes-> ...";
446 auto result = std::make_unique<HcalQIETypes>(&topo);
448 for (
auto cell :
cells) {
456 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceChannelQuality-> ...";
459 auto result = std::make_unique<HcalChannelQuality>(&topo);
461 for (
auto cell :
cells) {
470 if (!(cell.isHcalZDCDetId())) {
478 bool isHEP17 = (
iphi >= 63) && (
iphi <= 66) && (
ieta > 0);
480 bool is18d1 = (absieta == 18) && (
depth == 1);
495 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceRespCorrs-> ...";
500 std::vector<std::vector<int>> m_segmentation;
501 int maxEta = topo.lastHBHERing();
502 m_segmentation.resize(
maxEta);
504 topo.getDepthSegmentation(
i + 1, m_segmentation[
i]);
516 auto result = std::make_unique<HcalRespCorrs>(&topo);
518 for (
const auto& cell :
cells) {
540 std::cout <<
"HB ieta, depth = " << ieta_ <<
", " << depth_ <<
" corr = " <<
corr << std::endl;
547 std::cout <<
"HE ieta, depth = " << ieta_ <<
", " << depth_ <<
" corr = " <<
corr << std::endl;
554 std::cout <<
"HF ieta, depth = " << ieta_ <<
", " << depth_ <<
" corr = " <<
corr << std::endl;
565 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceLUTCorrs-> ...";
568 auto result = std::make_unique<HcalLUTCorrs>(&topo);
570 for (
auto cell :
cells) {
578 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::producePFCorrs-> ...";
581 auto result = std::make_unique<HcalPFCorrs>(&topo);
583 for (
auto cell :
cells) {
591 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceTimeCorrs-> ...";
594 auto result = std::make_unique<HcalTimeCorrs>(&topo);
596 for (
auto cell :
cells) {
604 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceZSThresholds-> ...";
607 auto result = std::make_unique<HcalZSThresholds>(&topo);
609 for (
auto cell :
cells) {
618 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceL1TriggerObjects-> ...";
621 auto result = std::make_unique<HcalL1TriggerObjects>(&topo);
623 for (
auto cell :
cells) {
628 result->setTagString(
"hardcoded");
629 result->setAlgoString(
"hardcoded");
634 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceElectronicsMap-> ...";
643 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceValidationCorrs-> ...";
646 auto result = std::make_unique<HcalValidationCorrs>(&topo);
648 for (
auto cell :
cells) {
656 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceLutMetadata-> ...";
659 auto result = std::make_unique<HcalLutMetadata>(&topo);
662 result->setNominalGain(0.177);
665 for (
const auto& cell :
cells) {
670 if (cell.isHcalTrigTowerDetId()) {
682 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceDcsValues-> ...";
683 auto result = std::make_unique<HcalDcsValues>();
688 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceDcsMap-> ...";
694 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceRecoParams-> ...";
697 auto result = std::make_unique<HcalRecoParams>(&topo);
699 for (
auto cell :
cells) {
707 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceTimingParams-> ...";
710 auto result = std::make_unique<HcalTimingParams>(&topo);
712 for (
auto cell :
cells) {
720 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceLongRecoParams-> ...";
723 auto result = std::make_unique<HcalLongRecoParams>(&topo);
725 std::vector<unsigned int> mSignal;
726 mSignal.push_back(4);
727 mSignal.push_back(5);
728 mSignal.push_back(6);
729 std::vector<unsigned int> mNoise;
733 for (
auto cell :
cells) {
734 if (cell.isHcalZDCDetId()) {
744 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceZDCLowGainFractions-> ...";
747 auto result = std::make_unique<HcalZDCLowGainFractions>(&topo);
749 for (
auto cell :
cells) {
759 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceMCParams-> ...";
761 auto result = std::make_unique<HcalMCParams>(&topo);
763 for (
auto cell :
cells) {
772 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceFlagHFDigiTimeParams-> ...";
775 auto result = std::make_unique<HcalFlagHFDigiTimeParams>(&topo);
778 std::vector<double> coef;
779 coef.push_back(0.93);
780 coef.push_back(-0.38275);
781 coef.push_back(-0.012667);
783 for (
auto cell :
cells) {
797 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceFrontEndMap-> ...";
806 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceSiPMParameters-> ...";
809 auto result = std::make_unique<HcalSiPMParameters>(&topo);
811 for (
auto cell :
cells) {
820 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceSiPMCharacteristics-> ...";
827 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceTPChannelParameters-> ...";
830 auto result = std::make_unique<HcalTPChannelParameters>(&topo);
832 for (
auto cell :
cells) {
840 edm::LogInfo(
"HCAL") <<
"HcalHardcodeCalibrations::produceTPParameters-> ...";
842 auto result = std::make_unique<HcalTPParameters>();
849 desc.
add<
double>(
"iLumi", -1.);
850 desc.
add<
bool>(
"HBRecalibration",
false);
851 desc.
add<
double>(
"HBreCalibCutoff", 20.);
853 desc.
add<
bool>(
"HERecalibration",
false);
854 desc.
add<
double>(
"HEreCalibCutoff", 20.);
856 desc.
add<
bool>(
"HFRecalibration",
false);
857 desc.
add<
bool>(
"GainWidthsForTrigPrims",
false);
858 desc.
add<
bool>(
"useHBUpgrade",
false);
859 desc.
add<
bool>(
"useHEUpgrade",
false);
860 desc.
add<
bool>(
"useHFUpgrade",
false);
861 desc.
add<
bool>(
"useHOUpgrade",
true);
862 desc.
add<
bool>(
"testHFQIE10",
false);
863 desc.
add<
bool>(
"testHEPlan1",
false);
864 desc.
add<
bool>(
"killHE",
false);
865 desc.
add<
bool>(
"useLayer0Weight",
false);
866 desc.
add<
bool>(
"useIeta18depth1",
true);
867 desc.
addUntracked<std::vector<std::string>>(
"toGet", std::vector<std::string>());
871 desc_hb.
add<std::vector<double>>(
"gain", std::vector<double>({0.19}));
872 desc_hb.add<std::vector<double>>(
"gainWidth", std::vector<double>({0.0}));
873 desc_hb.add<
double>(
"pedestal", 3.0);
874 desc_hb.add<
double>(
"pedestalWidth", 0.55);
875 desc_hb.add<
int>(
"zsThreshold", 8);
876 desc_hb.add<std::vector<double>>(
"qieOffset", std::vector<double>({-0.49, 1.8, 7.2, 37.9}));
877 desc_hb.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.912, 0.917, 0.922, 0.923}));
878 desc_hb.add<
int>(
"qieType", 0);
879 desc_hb.add<
int>(
"mcShape", 125);
880 desc_hb.add<
int>(
"recoShape", 105);
881 desc_hb.add<
double>(
"photoelectronsToAnalog", 0.0);
882 desc_hb.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.0}));
883 desc_hb.add<
bool>(
"doRadiationDamage",
false);
887 desc_hbRaddam.
add<
double>(
"temperatureBase", 20.0);
888 desc_hbRaddam.add<
double>(
"temperatureNew", -5.0);
889 desc_hbRaddam.add<
double>(
"intlumiOffset", 150);
890 desc_hbRaddam.add<
double>(
"depVsTemp", 0.0631);
891 desc_hbRaddam.add<
double>(
"intlumiToNeutrons", 3.67e8);
892 desc_hbRaddam.add<std::vector<double>>(
"depVsNeutrons", {5.69e-11, 7.90e-11});
895 desc_hbUpgrade.
add<std::vector<double>>(
"gain", std::vector<double>({0.00111111111111}));
896 desc_hbUpgrade.add<std::vector<double>>(
"gainWidth", std::vector<double>({0}));
897 desc_hbUpgrade.add<
double>(
"pedestal", 18.0);
898 desc_hbUpgrade.add<
double>(
"pedestalWidth", 5.0);
899 desc_hbUpgrade.add<
int>(
"zsThreshold", 3);
900 desc_hbUpgrade.add<std::vector<double>>(
"qieOffset", std::vector<double>({0.0, 0.0, 0.0, 0.0}));
901 desc_hbUpgrade.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.333, 0.333, 0.333, 0.333}));
902 desc_hbUpgrade.add<
int>(
"qieType", 2);
903 desc_hbUpgrade.add<
int>(
"mcShape", 206);
904 desc_hbUpgrade.add<
int>(
"recoShape", 206);
905 desc_hbUpgrade.add<
double>(
"photoelectronsToAnalog", 57.5);
906 desc_hbUpgrade.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.055}));
907 desc_hbUpgrade.add<
bool>(
"doRadiationDamage",
true);
912 desc_he.
add<std::vector<double>>(
"gain", std::vector<double>({0.23}));
913 desc_he.add<std::vector<double>>(
"gainWidth", std::vector<double>({0}));
914 desc_he.add<
double>(
"pedestal", 3.0);
915 desc_he.add<
double>(
"pedestalWidth", 0.79);
916 desc_he.add<
int>(
"zsThreshold", 9);
917 desc_he.add<std::vector<double>>(
"qieOffset", std::vector<double>({-0.38, 2.0, 7.6, 39.6}));
918 desc_he.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.912, 0.916, 0.92, 0.922}));
919 desc_he.add<
int>(
"qieType", 0);
920 desc_he.add<
int>(
"mcShape", 125);
921 desc_he.add<
int>(
"recoShape", 105);
922 desc_he.add<
double>(
"photoelectronsToAnalog", 0.0);
923 desc_he.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.0}));
924 desc_he.add<
bool>(
"doRadiationDamage",
false);
928 desc_heRaddam.
add<
double>(
"temperatureBase", 20.0);
929 desc_heRaddam.add<
double>(
"temperatureNew", 5.0);
930 desc_heRaddam.add<
double>(
"intlumiOffset", 75);
931 desc_heRaddam.add<
double>(
"depVsTemp", 0.0631);
932 desc_heRaddam.add<
double>(
"intlumiToNeutrons", 2.92e8);
933 desc_heRaddam.add<std::vector<double>>(
"depVsNeutrons", {5.69e-11, 7.90e-11});
936 desc_heUpgrade.
add<std::vector<double>>(
"gain", std::vector<double>({0.00111111111111}));
937 desc_heUpgrade.add<std::vector<double>>(
"gainWidth", std::vector<double>({0}));
938 desc_heUpgrade.add<
double>(
"pedestal", 18.0);
939 desc_heUpgrade.add<
double>(
"pedestalWidth", 5.0);
940 desc_heUpgrade.add<
int>(
"zsThreshold", 3);
941 desc_heUpgrade.add<std::vector<double>>(
"qieOffset", std::vector<double>({0.0, 0.0, 0.0, 0.0}));
942 desc_heUpgrade.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.333, 0.333, 0.333, 0.333}));
943 desc_heUpgrade.add<
int>(
"qieType", 2);
944 desc_heUpgrade.add<
int>(
"mcShape", 206);
945 desc_heUpgrade.add<
int>(
"recoShape", 206);
946 desc_heUpgrade.add<
double>(
"photoelectronsToAnalog", 57.5);
947 desc_heUpgrade.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.055}));
948 desc_heUpgrade.add<
bool>(
"doRadiationDamage",
true);
953 desc_hf.
add<std::vector<double>>(
"gain", std::vector<double>({0.14, 0.135}));
954 desc_hf.add<std::vector<double>>(
"gainWidth", std::vector<double>({0.0, 0.0}));
955 desc_hf.add<
double>(
"pedestal", 3.0);
956 desc_hf.add<
double>(
"pedestalWidth", 0.84);
957 desc_hf.add<
int>(
"zsThreshold", -9999);
958 desc_hf.add<std::vector<double>>(
"qieOffset", std::vector<double>({-0.87, 1.4, 7.8, -29.6}));
959 desc_hf.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.359, 0.358, 0.36, 0.367}));
960 desc_hf.add<
int>(
"qieType", 0);
961 desc_hf.add<
int>(
"mcShape", 301);
962 desc_hf.add<
int>(
"recoShape", 301);
963 desc_hf.add<
double>(
"photoelectronsToAnalog", 0.0);
964 desc_hf.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.0}));
965 desc_hf.add<
bool>(
"doRadiationDamage",
false);
969 desc_hfUpgrade.
add<std::vector<double>>(
"gain", std::vector<double>({0.14, 0.135}));
970 desc_hfUpgrade.add<std::vector<double>>(
"gainWidth", std::vector<double>({0.0, 0.0}));
971 desc_hfUpgrade.add<
double>(
"pedestal", 13.33);
972 desc_hfUpgrade.add<
double>(
"pedestalWidth", 3.33);
973 desc_hfUpgrade.add<
int>(
"zsThreshold", -9999);
974 desc_hfUpgrade.add<std::vector<double>>(
"qieOffset", std::vector<double>({0.0697, -0.7405, 12.38, -671.9}));
975 desc_hfUpgrade.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.297, 0.298, 0.298, 0.313}));
976 desc_hfUpgrade.add<
int>(
"qieType", 1);
977 desc_hfUpgrade.add<
int>(
"mcShape", 301);
978 desc_hfUpgrade.add<
int>(
"recoShape", 301);
979 desc_hfUpgrade.add<
double>(
"photoelectronsToAnalog", 0.0);
980 desc_hfUpgrade.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.0}));
981 desc_hfUpgrade.add<
bool>(
"doRadiationDamage",
false);
985 desc_hfrecal.
add<std::vector<double>>(
"HFdepthOneParameterA", std::vector<double>());
986 desc_hfrecal.add<std::vector<double>>(
"HFdepthOneParameterB", std::vector<double>());
987 desc_hfrecal.add<std::vector<double>>(
"HFdepthTwoParameterA", std::vector<double>());
988 desc_hfrecal.add<std::vector<double>>(
"HFdepthTwoParameterB", std::vector<double>());
992 desc_ho.
add<std::vector<double>>(
"gain", std::vector<double>({0.006, 0.0087}));
993 desc_ho.add<std::vector<double>>(
"gainWidth", std::vector<double>({0.0, 0.0}));
994 desc_ho.add<
double>(
"pedestal", 11.0);
995 desc_ho.add<
double>(
"pedestalWidth", 0.57);
996 desc_ho.add<
int>(
"zsThreshold", 24);
997 desc_ho.add<std::vector<double>>(
"qieOffset", std::vector<double>({-0.44, 1.4, 7.1, 38.5}));
998 desc_ho.add<std::vector<double>>(
"qieSlope", std::vector<double>({0.907, 0.915, 0.92, 0.921}));
999 desc_ho.add<
int>(
"qieType", 0);
1000 desc_ho.add<
int>(
"mcShape", 201);
1001 desc_ho.add<
int>(
"recoShape", 201);
1002 desc_ho.add<
double>(
"photoelectronsToAnalog", 4.0);
1003 desc_ho.add<std::vector<double>>(
"darkCurrent", std::vector<double>({0.0}));
1004 desc_ho.add<
bool>(
"doRadiationDamage",
false);
1008 validator_sipm.
add<
int>(
"pixels", 1);
1009 validator_sipm.add<
double>(
"crosstalk", 0);
1010 validator_sipm.add<
double>(
"nonlin1", 1);
1011 validator_sipm.add<
double>(
"nonlin2", 0);
1012 validator_sipm.add<
double>(
"nonlin3", 0);
1013 std::vector<edm::ParameterSet> default_sipm(1);
1014 desc.
addVPSet(
"SiPMCharacteristics", validator_sipm, default_sipm);