From 44feef1e0544da07a43a9a0214e33663b7969e5c Mon Sep 17 00:00:00 2001 From: Samuel Webb Date: Tue, 19 Nov 2019 17:28:16 +0100 Subject: [PATCH 1/5] Update to allow different concentrator selections in the silicon CEE, CEH and Scintillator --- .../L1THGCal/interface/HGCalTriggerTools.h | 7 ++ .../HGCalConcentratorProcessorSelection.h | 8 +- .../HGCalConcentratorSuperTriggerCellImpl.h | 3 +- .../HGCalConcentratorProcessorSelection.cc | 76 +++++++++---------- .../python/customTriggerCellSelect.py | 21 ++--- .../python/hgcalConcentratorProducer_cfi.py | 31 ++++---- L1Trigger/L1THGCal/src/HGCalTriggerTools.cc | 12 +++ .../HGCalConcentratorSuperTriggerCellImpl.cc | 15 ++-- .../L1THGCalUtilities/python/concentrator.py | 44 +++++++++-- 9 files changed, 134 insertions(+), 83 deletions(-) diff --git a/L1Trigger/L1THGCal/interface/HGCalTriggerTools.h b/L1Trigger/L1THGCal/interface/HGCalTriggerTools.h index 30accd9d7fc34..474f66cfaec1a 100644 --- a/L1Trigger/L1THGCal/interface/HGCalTriggerTools.h +++ b/L1Trigger/L1THGCal/interface/HGCalTriggerTools.h @@ -85,6 +85,13 @@ class HGCalTriggerTools { static constexpr unsigned kScintillatorPseudoThicknessIndex_ = 3; + enum SubDetectorType { + hgcal_silicon_CEE, + hgcal_silicon_CEH, + hgcal_scintillator, + }; + SubDetectorType getSubDetectorType(const DetId& id) const; + private: const HGCalTriggerGeometryBase* geom_; unsigned eeLayers_; diff --git a/L1Trigger/L1THGCal/interface/concentrator/HGCalConcentratorProcessorSelection.h b/L1Trigger/L1THGCal/interface/concentrator/HGCalConcentratorProcessorSelection.h index 34fb445180788..bc1a8dcd17fa1 100644 --- a/L1Trigger/L1THGCal/interface/concentrator/HGCalConcentratorProcessorSelection.h +++ b/L1Trigger/L1THGCal/interface/concentrator/HGCalConcentratorProcessorSelection.h @@ -13,7 +13,7 @@ class HGCalConcentratorProcessorSelection : public HGCalConcentratorProcessorBase { private: - enum SelectionType { thresholdSelect, bestChoiceSelect, superTriggerCellSelect, mixedBestChoiceSuperTriggerCell }; + enum SelectionType { thresholdSelect, bestChoiceSelect, superTriggerCellSelect, noSelection }; public: HGCalConcentratorProcessorSelection(const edm::ParameterSet& conf); @@ -23,10 +23,12 @@ class HGCalConcentratorProcessorSelection : public HGCalConcentratorProcessorBas const edm::EventSetup& es) override; private: - SelectionType selectionType_; bool fixedDataSizePerHGCROC_; - bool coarsenTriggerCells_; + std::vector coarsenTriggerCells_; static constexpr int kHighDensityThickness_ = 0; + static constexpr int kNSubDetectors_ = 3; + + std::vector selectionType_; std::unique_ptr thresholdImpl_; std::unique_ptr bestChoiceImpl_; diff --git a/L1Trigger/L1THGCal/interface/concentrator/HGCalConcentratorSuperTriggerCellImpl.h b/L1Trigger/L1THGCal/interface/concentrator/HGCalConcentratorSuperTriggerCellImpl.h index 9c7d03644cc11..14bba82e1818a 100644 --- a/L1Trigger/L1THGCal/interface/concentrator/HGCalConcentratorSuperTriggerCellImpl.h +++ b/L1Trigger/L1THGCal/interface/concentrator/HGCalConcentratorSuperTriggerCellImpl.h @@ -29,13 +29,14 @@ class HGCalConcentratorSuperTriggerCellImpl { oneBitFraction, equalShare, }; + EnergyDivisionType energyDivisionType_; static constexpr int kHighDensityThickness_ = 0; static constexpr int kOddNumberMask_ = 1; HGCalTriggerTools triggerTools_; bool fixedDataSizePerHGCROC_; - bool coarsenTriggerCells_; + std::vector coarsenTriggerCells_; HGCalCoarseTriggerCellMapping coarseTCmapping_; HGCalCoarseTriggerCellMapping superTCmapping_; diff --git a/L1Trigger/L1THGCal/plugins/concentrator/HGCalConcentratorProcessorSelection.cc b/L1Trigger/L1THGCal/plugins/concentrator/HGCalConcentratorProcessorSelection.cc index aadd241be80f2..dab0986be4899 100644 --- a/L1Trigger/L1THGCal/plugins/concentrator/HGCalConcentratorProcessorSelection.cc +++ b/L1Trigger/L1THGCal/plugins/concentrator/HGCalConcentratorProcessorSelection.cc @@ -8,27 +8,37 @@ DEFINE_EDM_PLUGIN(HGCalConcentratorFactory, HGCalConcentratorProcessorSelection, HGCalConcentratorProcessorSelection::HGCalConcentratorProcessorSelection(const edm::ParameterSet& conf) : HGCalConcentratorProcessorBase(conf), fixedDataSizePerHGCROC_(conf.getParameter("fixedDataSizePerHGCROC")), - coarsenTriggerCells_(conf.getParameter("coarsenTriggerCells")) { - std::string selectionType(conf.getParameter("Method")); - if (selectionType == "thresholdSelect") { - selectionType_ = thresholdSelect; - thresholdImpl_ = std::make_unique(conf); - } else if (selectionType == "bestChoiceSelect") { - selectionType_ = bestChoiceSelect; - bestChoiceImpl_ = std::make_unique(conf); - } else if (selectionType == "superTriggerCellSelect") { - selectionType_ = superTriggerCellSelect; - superTriggerCellImpl_ = std::make_unique(conf); - } else if (selectionType == "mixedBestChoiceSuperTriggerCell") { - selectionType_ = mixedBestChoiceSuperTriggerCell; - bestChoiceImpl_ = std::make_unique(conf); - superTriggerCellImpl_ = std::make_unique(conf); - } else { + coarsenTriggerCells_(conf.getParameter>("coarsenTriggerCells")), + selectionType_(kNSubDetectors_) { + std::vector selectionType(conf.getParameter>("Method")); + if (selectionType.size() != kNSubDetectors_ || coarsenTriggerCells_.size() != kNSubDetectors_) { throw cms::Exception("HGCTriggerParameterError") - << "Unknown type of concentrator selection '" << selectionType << "'"; + << "Inconsistent number of sub-detectors (should be " << kNSubDetectors_ << ")"; } - if (coarsenTriggerCells_ || fixedDataSizePerHGCROC_) { + for (int subdet = 0; subdet < kNSubDetectors_; subdet++) { + if (selectionType[subdet] == "thresholdSelect") { + selectionType_[subdet] = thresholdSelect; + if (!thresholdImpl_) + thresholdImpl_ = std::make_unique(conf); + } else if (selectionType[subdet] == "bestChoiceSelect") { + selectionType_[subdet] = bestChoiceSelect; + if (!bestChoiceImpl_) + bestChoiceImpl_ = std::make_unique(conf); + } else if (selectionType[subdet] == "superTriggerCellSelect") { + selectionType_[subdet] = superTriggerCellSelect; + if (!superTriggerCellImpl_) + superTriggerCellImpl_ = std::make_unique(conf); + } else if (selectionType[subdet] == "noSelection") { + selectionType_[subdet] = noSelection; + } else { + throw cms::Exception("HGCTriggerParameterError") + << "Unknown type of concentrator selection '" << selectionType[subdet] << "'"; + } + } + + if (std::find(coarsenTriggerCells_.begin(), coarsenTriggerCells_.end(), true) != coarsenTriggerCells_.end() || + fixedDataSizePerHGCROC_) { coarsenerImpl_ = std::make_unique(conf); } } @@ -60,10 +70,12 @@ void HGCalConcentratorProcessorSelection::run(const edm::Handle kHighDensityThickness_)) { + HGCalTriggerTools::SubDetectorType subdet = triggerTools_.getSubDetectorType(module_trigcell.second.at(0).detId()); + + if (coarsenTriggerCells_[subdet] || (fixedDataSizePerHGCROC_ && thickness > kHighDensityThickness_)) { coarsenerImpl_->coarsen(module_trigcell.second, trigCellVecCoarsened); - switch (selectionType_) { + switch (selectionType_[subdet]) { case thresholdSelect: thresholdImpl_->select(trigCellVecCoarsened, trigCellVecOutput); break; @@ -83,15 +95,8 @@ void HGCalConcentratorProcessorSelection::run(const edm::Handleselect(trigCellVecCoarsened, trigCellVecOutput); break; - case mixedBestChoiceSuperTriggerCell: - if (triggerTools_.isEm(module_trigcell.first)) { - bestChoiceImpl_->select(geometry_->getLinksInModule(module_trigcell.first), - geometry_->getModuleSize(module_trigcell.first), - trigCellVecCoarsened, - trigCellVecOutput); - } else { - superTriggerCellImpl_->select(trigCellVecCoarsened, trigCellVecOutput); - } + case noSelection: + trigCellVecOutput = trigCellVecCoarsened; break; default: // Should not happen, selection type checked in constructor @@ -99,7 +104,7 @@ void HGCalConcentratorProcessorSelection::run(const edm::Handleselect(module_trigcell.second, trigCellVecOutput); break; @@ -112,15 +117,8 @@ void HGCalConcentratorProcessorSelection::run(const edm::Handleselect(module_trigcell.second, trigCellVecOutput); break; - case mixedBestChoiceSuperTriggerCell: - if (triggerTools_.isEm(module_trigcell.first)) { - bestChoiceImpl_->select(geometry_->getLinksInModule(module_trigcell.first), - geometry_->getModuleSize(module_trigcell.first), - module_trigcell.second, - trigCellVecOutput); - } else { - superTriggerCellImpl_->select(module_trigcell.second, trigCellVecOutput); - } + case noSelection: + trigCellVecOutput = module_trigcell.second; break; default: // Should not happen, selection type checked in constructor diff --git a/L1Trigger/L1THGCal/python/customTriggerCellSelect.py b/L1Trigger/L1THGCal/python/customTriggerCellSelect.py index 59ae05046f3d6..d30a16e848e6b 100644 --- a/L1Trigger/L1THGCal/python/customTriggerCellSelect.py +++ b/L1Trigger/L1THGCal/python/customTriggerCellSelect.py @@ -1,6 +1,6 @@ import FWCore.ParameterSet.Config as cms import SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi as digiparam -from L1Trigger.L1THGCal.hgcalConcentratorProducer_cfi import threshold_conc_proc, best_conc_proc, supertc_conc_proc, coarsetc_onebitfraction_proc, coarsetc_equalshare_proc, bestchoice_ndata_decentralized, mixedbcstc_conc_proc +from L1Trigger.L1THGCal.hgcalConcentratorProducer_cfi import threshold_conc_proc, best_conc_proc, supertc_conc_proc, coarsetc_onebitfraction_proc, coarsetc_equalshare_proc, bestchoice_ndata_decentralized, custom_conc_proc def custom_triggercellselect_supertriggercell(process, stcSize=supertc_conc_proc.stcSize, @@ -73,16 +73,17 @@ def custom_coarsetc_equalshare(process, return process def custom_triggercellselect_mixedBestChoiceSuperTriggerCell(process, - stcSize=mixedbcstc_conc_proc.stcSize, - type_energy_division=mixedbcstc_conc_proc.type_energy_division, - fixedDataSizePerHGCROC=mixedbcstc_conc_proc.fixedDataSizePerHGCROC, - triggercells=mixedbcstc_conc_proc.NData + stcSize=custom_conc_proc.stcSize, + type_energy_division=custom_conc_proc.type_energy_division, + fixedDataSizePerHGCROC=custom_conc_proc.fixedDataSizePerHGCROC, + triggercells=custom_conc_proc.NData ): - parameters = mixedbcstc_conc_proc.clone(stcSize = stcSize, - type_energy_division = type_energy_division, - fixedDataSizePerHGCROC = fixedDataSizePerHGCROC, - NData=triggercells - ) + parameters = custom_conc_proc.clone(stcSize = stcSize, + type_energy_division = type_energy_division, + fixedDataSizePerHGCROC = fixedDataSizePerHGCROC, + NData=triggercells, + Method = cms.vstring('bestChoiceSelect','superTriggerCellSelect','superTriggerCellSelect'), + ) process.hgcalConcentratorProducer.ProcessorParameters = parameters return process diff --git a/L1Trigger/L1THGCal/python/hgcalConcentratorProducer_cfi.py b/L1Trigger/L1THGCal/python/hgcalConcentratorProducer_cfi.py index 7b4569eae0459..08b7ed94e3fe1 100644 --- a/L1Trigger/L1THGCal/python/hgcalConcentratorProducer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalConcentratorProducer_cfi.py @@ -27,10 +27,10 @@ threshold_conc_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'), - Method = cms.string('thresholdSelect'), + Method = cms.vstring(['thresholdSelect']*3), threshold_silicon = cms.double(2.), # MipT threshold_scintillator = cms.double(2.), # MipT - coarsenTriggerCells = cms.bool(False), + coarsenTriggerCells = cms.vuint32(0,0,0), fixedDataSizePerHGCROC = cms.bool(False), ctcSize = cms.vuint32(CTC_SIZE), ) @@ -75,9 +75,9 @@ from L1Trigger.L1THGCal.hgcalVFEProducer_cfi import vfe_proc best_conc_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'), - Method = cms.string('bestChoiceSelect'), + Method = cms.vstring(['bestChoiceSelect']*3), NData = cms.vuint32(bestchoice_ndata_centralized), - coarsenTriggerCells = cms.bool(False), + coarsenTriggerCells = cms.vuint32(0,0,0), fixedDataSizePerHGCROC = cms.bool(False), coarseTCCompression = coarseTCCompression_proc.clone(), superTCCalibration = vfe_proc.clone(), @@ -85,39 +85,40 @@ ) supertc_conc_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'), - Method = cms.string('superTriggerCellSelect'), + Method = cms.vstring(['superTriggerCellSelect']*3), type_energy_division = cms.string('superTriggerCell'),# superTriggerCell,oneBitFraction,equalShare stcSize = cms.vuint32(STC_SIZE), ctcSize = cms.vuint32(CTC_SIZE), fixedDataSizePerHGCROC = cms.bool(False), - coarsenTriggerCells = cms.bool(False), + coarsenTriggerCells = cms.vuint32(0,0,0), superTCCompression = superTCCompression_proc.clone(), coarseTCCompression = coarseTCCompression_proc.clone(), superTCCalibration = vfe_proc.clone(), ) - -mixedbcstc_conc_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'), - Method = cms.string('mixedBestChoiceSuperTriggerCell'), +custom_conc_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'), + Method = cms.vstring('bestChoiceSelect','superTriggerCellSelect','superTriggerCellSelect'), NData = cms.vuint32(bestchoice_ndata_centralized), - coarsenTriggerCells = cms.bool(False), + threshold_silicon = cms.double(2.), # MipT + threshold_scintillator = cms.double(2.), # MipT + coarsenTriggerCells = cms.vuint32(0,0,0), fixedDataSizePerHGCROC = cms.bool(False), type_energy_division = cms.string('superTriggerCell'),# superTriggerCell,oneBitFraction,equalShare stcSize = cms.vuint32(STC_SIZE), ctcSize = cms.vuint32(CTC_SIZE), - supertccompression = superTCCompression_proc.clone(), + superTCCompression = superTCCompression_proc.clone(), coarseTCCompression = coarseTCCompression_proc.clone(), superTCCalibration = vfe_proc.clone(), ) coarsetc_onebitfraction_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'), - Method = cms.string('superTriggerCellSelect'), + Method = cms.vstring(['superTriggerCellSelect']*3), type_energy_division = cms.string('oneBitFraction'), stcSize = cms.vuint32([4]*(MAX_LAYERS+1)+ [8]*(MAX_LAYERS+1)*3), ctcSize = cms.vuint32(CTC_SIZE), fixedDataSizePerHGCROC = cms.bool(True), - coarsenTriggerCells = cms.bool(False), + coarsenTriggerCells = cms.vuint32(0,0,0), oneBitFractionThreshold = cms.double(0.125), oneBitFractionLowValue = cms.double(0.0625), oneBitFractionHighValue = cms.double(0.25), @@ -128,12 +129,12 @@ coarsetc_equalshare_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'), - Method = cms.string('superTriggerCellSelect'), + Method = cms.vstring(['superTriggerCellSelect']*3), type_energy_division = cms.string('equalShare'), stcSize = cms.vuint32([4]*(MAX_LAYERS+1)+ [8]*(MAX_LAYERS+1)*3), ctcSize = cms.vuint32(CTC_SIZE), fixedDataSizePerHGCROC = cms.bool(True), - coarsenTriggerCells = cms.bool(False), + coarsenTriggerCells = cms.vuint32(0,0,0), superTCCompression = superTCCompression_proc.clone(), coarseTCCompression = coarseTCCompression_proc.clone(), superTCCalibration = vfe_proc.clone(), diff --git a/L1Trigger/L1THGCal/src/HGCalTriggerTools.cc b/L1Trigger/L1THGCal/src/HGCalTriggerTools.cc index a2a67d07f7de9..51b98bd52139d 100644 --- a/L1Trigger/L1THGCal/src/HGCalTriggerTools.cc +++ b/L1Trigger/L1THGCal/src/HGCalTriggerTools.cc @@ -195,6 +195,18 @@ bool HGCalTriggerTools::isSilicon(const DetId& id) const { return silicon; } +HGCalTriggerTools::SubDetectorType HGCalTriggerTools::getSubDetectorType(const DetId& id) const { + SubDetectorType subdet; + if (!isScintillator(id)) { + if (isEm(id)) + subdet = HGCalTriggerTools::hgcal_silicon_CEE; + else + subdet = HGCalTriggerTools::hgcal_silicon_CEH; + } else + subdet = HGCalTriggerTools::hgcal_scintillator; + return subdet; +} + int HGCalTriggerTools::zside(const DetId& id) const { int zside = 0; if (id.det() == DetId::Forward && id.subdetId() != ForwardSubdetector::HFNose) { diff --git a/L1Trigger/L1THGCal/src/concentrator/HGCalConcentratorSuperTriggerCellImpl.cc b/L1Trigger/L1THGCal/src/concentrator/HGCalConcentratorSuperTriggerCellImpl.cc index b358bf2849feb..e58e5fffd50cd 100644 --- a/L1Trigger/L1THGCal/src/concentrator/HGCalConcentratorSuperTriggerCellImpl.cc +++ b/L1Trigger/L1THGCal/src/concentrator/HGCalConcentratorSuperTriggerCellImpl.cc @@ -2,7 +2,7 @@ HGCalConcentratorSuperTriggerCellImpl::HGCalConcentratorSuperTriggerCellImpl(const edm::ParameterSet& conf) : fixedDataSizePerHGCROC_(conf.getParameter("fixedDataSizePerHGCROC")), - coarsenTriggerCells_(conf.getParameter("coarsenTriggerCells")), + coarsenTriggerCells_(conf.getParameter>("coarsenTriggerCells")), coarseTCmapping_(conf.getParameter>("ctcSize")), superTCmapping_(conf.getParameter>("stcSize")), calibration_(conf.getParameterSet("superTCCalibration")), @@ -40,11 +40,12 @@ void HGCalConcentratorSuperTriggerCellImpl::createAllTriggerCells( if (output_ids.empty()) continue; + HGCalTriggerTools::SubDetectorType subdet = triggerTools_.getSubDetectorType(output_ids.at(0)); int thickness = (!output_ids.empty() ? triggerTools_.thicknessIndex(output_ids.at(0), true) : 0); for (const auto& id : output_ids) { - if (fixedDataSizePerHGCROC_ && thickness > kHighDensityThickness_ && - id != coarseTCmapping_.getRepresentativeDetId(id)) { + if (((fixedDataSizePerHGCROC_ && thickness > kHighDensityThickness_) || coarsenTriggerCells_[subdet]) && + (id != coarseTCmapping_.getRepresentativeDetId(id))) { continue; } @@ -72,9 +73,7 @@ void HGCalConcentratorSuperTriggerCellImpl::createAllTriggerCells( continue; } } - trigCellVecOutput.push_back(triggerCell); - if (energyDivisionType_ == oneBitFraction) { //Get the 1 bit fractions if (id != s.second.getMaxId()) { @@ -84,7 +83,6 @@ void HGCalConcentratorSuperTriggerCellImpl::createAllTriggerCells( } } } - // assign energy for (l1t::HGCalTriggerCell& tc : trigCellVecOutput) { const auto& stc = STCs[superTCmapping_.getCoarseTriggerCellId(tc.detId())]; @@ -97,10 +95,11 @@ void HGCalConcentratorSuperTriggerCellImpl::assignSuperTriggerCellEnergyAndPosit //Compress and recalibrate STC energy uint32_t compressed_value = getCompressedSTCEnergy(stc); + HGCalTriggerTools::SubDetectorType subdet = triggerTools_.getSubDetectorType(c.detId()); int thickness = triggerTools_.thicknessIndex(c.detId(), true); GlobalPoint point; - if ((fixedDataSizePerHGCROC_ && thickness > kHighDensityThickness_) || coarsenTriggerCells_) { + if ((fixedDataSizePerHGCROC_ && thickness > kHighDensityThickness_) || coarsenTriggerCells_[subdet]) { point = coarseTCmapping_.getCoarseTriggerCellPosition(coarseTCmapping_.getCoarseTriggerCellId(c.detId())); } else { point = triggerTools_.getTCPosition(c.detId()); @@ -120,7 +119,7 @@ void HGCalConcentratorSuperTriggerCellImpl::assignSuperTriggerCellEnergyAndPosit } } else if (energyDivisionType_ == equalShare) { double coarseTriggerCellSize = - coarsenTriggerCells_ + coarsenTriggerCells_[subdet] ? double( coarseTCmapping_.getConstituentTriggerCells(coarseTCmapping_.getCoarseTriggerCellId(stc.getMaxId())) .size()) diff --git a/L1Trigger/L1THGCalUtilities/python/concentrator.py b/L1Trigger/L1THGCalUtilities/python/concentrator.py index 4c24f176e89af..12af5cf7db8d6 100644 --- a/L1Trigger/L1THGCalUtilities/python/concentrator.py +++ b/L1Trigger/L1THGCalUtilities/python/concentrator.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms import SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi as digiparam -from L1Trigger.L1THGCal.hgcalConcentratorProducer_cfi import threshold_conc_proc, best_conc_proc, supertc_conc_proc, coarsetc_onebitfraction_proc, mixedbcstc_conc_proc +from L1Trigger.L1THGCal.hgcalConcentratorProducer_cfi import threshold_conc_proc, best_conc_proc, supertc_conc_proc, coarsetc_onebitfraction_proc, custom_conc_proc def create_supertriggercell(process, inputs, @@ -73,20 +73,50 @@ def create_onebitfraction(process, inputs, def create_mixedfeoptions(process, inputs, - stcSize=supertc_conc_proc.stcSize, - type_energy_division=supertc_conc_proc.type_energy_division, - fixedDataSizePerHGCROC=supertc_conc_proc.fixedDataSizePerHGCROC, - triggercells=best_conc_proc.NData + stcSize=custom_conc_proc.stcSize, + type_energy_division=custom_conc_proc.type_energy_division, + fixedDataSizePerHGCROC=custom_conc_proc.fixedDataSizePerHGCROC, + triggercells=custom_conc_proc.NData ): producer = process.hgcalConcentratorProducer.clone( InputTriggerCells = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs)), InputTriggerSums = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs)) ) - producer.ProcessorParameters = mixedbcstc_conc_proc.clone( + producer.ProcessorParameters = custom_conc_proc.clone( stcSize = stcSize, type_energy_division = type_energy_division, fixedDataSizePerHGCROC = fixedDataSizePerHGCROC, - NData = triggercells + NData = triggercells, + Method = cms.vstring('bestChoiceSelect','superTriggerCellSelect','superTriggerCellSelect'), + ) + return producer + + +def create_custom(process, inputs, + stcSize=custom_conc_proc.stcSize, + type_energy_division=custom_conc_proc.type_energy_division, + fixedDataSizePerHGCROC=custom_conc_proc.fixedDataSizePerHGCROC, + triggercells=custom_conc_proc.NData, + threshold_silicon=custom_conc_proc.threshold_silicon, # in mipT + threshold_scintillator=custom_conc_proc.threshold_scintillator, # in mipT + Method = custom_conc_proc.Method, + coarsenTriggerCells=custom_conc_proc.coarsenTriggerCells, + ctcSize=custom_conc_proc.ctcSize, + ): + producer = process.hgcalConcentratorProducer.clone( + InputTriggerCells = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs)), + InputTriggerSums = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs)) + ) + producer.ProcessorParameters = custom_conc_proc.clone( + stcSize = stcSize, + type_energy_division = type_energy_division, + fixedDataSizePerHGCROC = fixedDataSizePerHGCROC, + NData = triggercells, + threshold_silicon = threshold_silicon, # MipT + threshold_scintillator = threshold_scintillator, # MipT + Method = Method, + coarsenTriggerCells=coarsenTriggerCells, + ctcSize = ctcSize, ) return producer From 3798292eedd2a0d329816e97b9676e8a2cd559dc Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Mon, 2 Dec 2019 10:03:45 +0100 Subject: [PATCH 2/5] Add OOT correction --- .../veryfrontend/HGCalVFELinearizationImpl.h | 1 + L1Trigger/L1THGCal/python/customVFE.py | 10 +++++ .../L1THGCal/python/hgcalVFEProducer_cfi.py | 1 + .../veryfrontend/HGCalVFELinearizationImpl.cc | 28 ++++++++++-- .../ntuples/HGCalTriggerNtupleHGCDigis.cc | 45 ++++++++++++------- L1Trigger/L1THGCalUtilities/python/vfe.py | 17 ++++--- 6 files changed, 78 insertions(+), 24 deletions(-) create mode 100644 L1Trigger/L1THGCal/python/customVFE.py diff --git a/L1Trigger/L1THGCal/interface/veryfrontend/HGCalVFELinearizationImpl.h b/L1Trigger/L1THGCal/interface/veryfrontend/HGCalVFELinearizationImpl.h index dce314ec28378..e3f0ce2d26d64 100644 --- a/L1Trigger/L1THGCal/interface/veryfrontend/HGCalVFELinearizationImpl.h +++ b/L1Trigger/L1THGCal/interface/veryfrontend/HGCalVFELinearizationImpl.h @@ -39,6 +39,7 @@ class HGCalVFELinearizationImpl { // uint32_t linMax_; uint32_t linnBits_; + std::vector oot_coefficients_; }; #endif diff --git a/L1Trigger/L1THGCal/python/customVFE.py b/L1Trigger/L1THGCal/python/customVFE.py new file mode 100644 index 0000000000000..53805ea905fb7 --- /dev/null +++ b/L1Trigger/L1THGCal/python/customVFE.py @@ -0,0 +1,10 @@ +import FWCore.ParameterSet.Config as cms +import SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi as digiparam +from L1Trigger.L1THGCal.hgcalVFEProducer_cfi import vfe_proc + +def custom_hgcroc_oot(process, + oot_coefficients=vfe_proc.oot_coefficients + ): + parameters = vfe_proc.clone(oot_coefficients = oot_coefficients) + process.hgcalVFEProducer.ProcessorParameters = parameters + return process diff --git a/L1Trigger/L1THGCal/python/hgcalVFEProducer_cfi.py b/L1Trigger/L1THGCal/python/hgcalVFEProducer_cfi.py index 4c6fc3981ce90..2aadfeb9d442e 100644 --- a/L1Trigger/L1THGCal/python/hgcalVFEProducer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalVFEProducer_cfi.py @@ -59,6 +59,7 @@ adcnBits_sc = adcNbits_sc, tdcsaturation_sc = tdcSaturation_sc, linnBits = cms.uint32(16), + oot_coefficients = cms.vdouble(0., 0.), # (bx-2, bx-1) siliconCellLSB_fC = cms.double( triggerCellLsbBeforeCompression*(2**triggerCellTruncationBits) ), scintillatorCellLSB_MIP = cms.double(float(adcSaturation_sc.value())/(2**float(adcNbits_sc.value()))), noiseSilicon = cms.PSet(), diff --git a/L1Trigger/L1THGCal/src/veryfrontend/HGCalVFELinearizationImpl.cc b/L1Trigger/L1THGCal/src/veryfrontend/HGCalVFELinearizationImpl.cc index b309273d38b5f..cc8a024b1ca90 100644 --- a/L1Trigger/L1THGCal/src/veryfrontend/HGCalVFELinearizationImpl.cc +++ b/L1Trigger/L1THGCal/src/veryfrontend/HGCalVFELinearizationImpl.cc @@ -13,7 +13,12 @@ HGCalVFELinearizationImpl::HGCalVFELinearizationImpl(const edm::ParameterSet& co tdcOnset_sc_(conf.getParameter("tdcOnset_sc")), adcnBits_sc_(conf.getParameter("adcnBits_sc")), tdcsaturation_sc_(conf.getParameter("tdcsaturation_sc")), - linnBits_(conf.getParameter("linnBits")) { + linnBits_(conf.getParameter("linnBits")), + oot_coefficients_(conf.getParameter>("oot_coefficients")) { + const int kOot_order = 2; + if (oot_coefficients_.size() != kOot_order) { + throw cms::Exception("BadConfiguration") << "OOT subtraction needs " << kOot_order << " coefficients"; + } adcLSB_si_ = adcsaturation_si_ / pow(2., adcnBits_si_); tdcLSB_si_ = tdcsaturation_si_ / pow(2., tdcnBits_si_); adcLSB_sc_ = adcsaturation_sc_ / pow(2., adcnBits_sc_); @@ -23,11 +28,11 @@ HGCalVFELinearizationImpl::HGCalVFELinearizationImpl(const edm::ParameterSet& co void HGCalVFELinearizationImpl::linearize(const std::vector>& dataframes, std::vector>& linearized_dataframes) { - double amplitude = 0.; - uint32_t amplitude_int = 0; const int kIntimeSample = 2; for (const auto& frame : dataframes) { //loop on DIGI + double amplitude = 0.; + uint32_t amplitude_int = 0; unsigned det = frame.id().det(); double adcLSB = 0.; double tdcLSB = 0.; @@ -38,6 +43,21 @@ void HGCalVFELinearizationImpl::linearize(const std::vector linMax_) amplitude_int = linMax_; diff --git a/L1Trigger/L1THGCalUtilities/plugins/ntuples/HGCalTriggerNtupleHGCDigis.cc b/L1Trigger/L1THGCalUtilities/plugins/ntuples/HGCalTriggerNtupleHGCDigis.cc index 33b138cf03409..0e9fe69b79df3 100644 --- a/L1Trigger/L1THGCalUtilities/plugins/ntuples/HGCalTriggerNtupleHGCDigis.cc +++ b/L1Trigger/L1THGCalUtilities/plugins/ntuples/HGCalTriggerNtupleHGCDigis.cc @@ -42,8 +42,8 @@ class HGCalTriggerNtupleHGCDigis : public HGCalTriggerNtupleBase { std::vector hgcdigi_eta_; std::vector hgcdigi_phi_; std::vector hgcdigi_z_; - std::vector hgcdigi_data_; - std::vector hgcdigi_isadc_; + std::vector> hgcdigi_data_; + std::vector> hgcdigi_isadc_; std::vector hgcdigi_simenergy_; // V8 detid scheme std::vector hgcdigi_wafer_; @@ -64,7 +64,8 @@ class HGCalTriggerNtupleHGCDigis : public HGCalTriggerNtupleBase { std::vector bhdigi_eta_; std::vector bhdigi_phi_; std::vector bhdigi_z_; - std::vector bhdigi_data_; + std::vector> bhdigi_data_; + std::vector> bhdigi_isadc_; std::vector bhdigi_simenergy_; edm::ESHandle triggerGeometry_; @@ -120,6 +121,7 @@ void HGCalTriggerNtupleHGCDigis::initialize(TTree& tree, tree.Branch("bhdigi_phi", &bhdigi_phi_); tree.Branch("bhdigi_z", &bhdigi_z_); tree.Branch("bhdigi_data", &bhdigi_data_); + tree.Branch("bhdigi_isadc", &bhdigi_isadc_); if (is_Simhit_comp_) tree.Branch("bhdigi_simenergy", &bhdigi_simenergy_); } @@ -183,7 +185,6 @@ void HGCalTriggerNtupleHGCDigis::fill(const edm::Event& e, const edm::EventSetup if (is_Simhit_comp_) bhdigi_simenergy_.reserve(bhdigi_n_); - const int kIntimeSample = 2; for (const auto& digi : ee_digis) { const DetId id(digi.id()); hgcdigi_id_.emplace_back(id.rawId()); @@ -194,7 +195,14 @@ void HGCalTriggerNtupleHGCDigis::fill(const edm::Event& e, const edm::EventSetup hgcdigi_eta_.emplace_back(cellpos.eta()); hgcdigi_phi_.emplace_back(cellpos.phi()); hgcdigi_z_.emplace_back(cellpos.z()); - hgcdigi_data_.emplace_back(digi[kIntimeSample].data()); + vector hgcdigi_data(digi.size()); + vector hgcdigi_isadc(digi.size()); + for (int i = 0; i < digi.size(); i++) { + hgcdigi_data[i] = digi[i].data(); + hgcdigi_isadc[i] = (digi[i].mode() ? 0 : 1); + } + hgcdigi_data_.emplace_back(hgcdigi_data); + hgcdigi_isadc_.emplace_back(hgcdigi_isadc); if (triggerGeometry_->isV9Geometry()) { const HGCSiliconDetId idv9(digi.id()); hgcdigi_waferu_.emplace_back(idv9.waferU()); @@ -208,10 +216,6 @@ void HGCalTriggerNtupleHGCDigis::fill(const edm::Event& e, const edm::EventSetup hgcdigi_wafertype_.emplace_back(idv8.waferType()); hgcdigi_cell_.emplace_back(idv8.cell()); } - int is_adc = 0; - if (!(digi[kIntimeSample].mode())) - is_adc = 1; - hgcdigi_isadc_.emplace_back(is_adc); if (is_Simhit_comp_) { double hit_energy = 0; auto itr = simhits_ee.find(id); @@ -231,7 +235,14 @@ void HGCalTriggerNtupleHGCDigis::fill(const edm::Event& e, const edm::EventSetup hgcdigi_eta_.emplace_back(cellpos.eta()); hgcdigi_phi_.emplace_back(cellpos.phi()); hgcdigi_z_.emplace_back(cellpos.z()); - hgcdigi_data_.emplace_back(digi[kIntimeSample].data()); + vector hgcdigi_data(digi.size()); + vector hgcdigi_isadc(digi.size()); + for (int i = 0; i < digi.size(); i++) { + hgcdigi_data[i] = digi[i].data(); + hgcdigi_isadc[i] = (digi[i].mode() ? 0 : 1); + } + hgcdigi_data_.emplace_back(hgcdigi_data); + hgcdigi_isadc_.emplace_back(hgcdigi_isadc); if (triggerGeometry_->isV9Geometry()) { const HGCSiliconDetId idv9(digi.id()); hgcdigi_waferu_.emplace_back(idv9.waferU()); @@ -245,10 +256,6 @@ void HGCalTriggerNtupleHGCDigis::fill(const edm::Event& e, const edm::EventSetup hgcdigi_wafertype_.emplace_back(idv8.waferType()); hgcdigi_cell_.emplace_back(idv8.cell()); } - int is_adc = 0; - if (!(digi[kIntimeSample].mode())) - is_adc = 1; - hgcdigi_isadc_.emplace_back(is_adc); if (is_Simhit_comp_) { double hit_energy = 0; auto itr = simhits_fh.find(id); @@ -269,7 +276,14 @@ void HGCalTriggerNtupleHGCDigis::fill(const edm::Event& e, const edm::EventSetup bhdigi_eta_.emplace_back(cellpos.eta()); bhdigi_phi_.emplace_back(cellpos.phi()); bhdigi_z_.emplace_back(cellpos.z()); - bhdigi_data_.emplace_back(digi[kIntimeSample].data()); + vector bhdigi_data(digi.size()); + vector bhdigi_isadc(digi.size()); + for (int i = 0; i < digi.size(); i++) { + bhdigi_data[i] = digi[i].data(); + bhdigi_isadc[i] = (digi[i].mode() ? 0 : 1); + } + bhdigi_data_.emplace_back(bhdigi_data); + bhdigi_isadc_.emplace_back(bhdigi_isadc); if (triggerGeometry_->isV9Geometry()) { const HGCScintillatorDetId idv9(digi.id()); bhdigi_ieta_.emplace_back(idv9.ietaAbs()); @@ -363,6 +377,7 @@ void HGCalTriggerNtupleHGCDigis::clear() { bhdigi_phi_.clear(); bhdigi_z_.clear(); bhdigi_data_.clear(); + bhdigi_isadc_.clear(); if (is_Simhit_comp_) bhdigi_simenergy_.clear(); } diff --git a/L1Trigger/L1THGCalUtilities/python/vfe.py b/L1Trigger/L1THGCalUtilities/python/vfe.py index 6c3913b3c4eb1..41a88d7e97522 100644 --- a/L1Trigger/L1THGCalUtilities/python/vfe.py +++ b/L1Trigger/L1THGCalUtilities/python/vfe.py @@ -1,13 +1,18 @@ import FWCore.ParameterSet.Config as cms +from L1Trigger.L1THGCal.hgcalVFEProducer_cfi import vfe_proc def create_compression(process, - exponent=4, - mantissa=4, - rounding=True + exponent=vfe_proc.exponentBits, + mantissa=vfe_proc.mantissaBits, + rounding=vfe_proc.rounding, + oot_coefficients=vfe_proc.oot_coefficients ): producer = process.hgcalVFEProducer.clone() - producer.ProcessorParameters.exponentBits = cms.uint32(exponent) - producer.ProcessorParameters.mantissaBits = cms.uint32(mantissa) - producer.ProcessorParameters.rounding = cms.bool(rounding) + producer.ProcessorParameters = vfe_proc.clone( + exponentBits = exponent, + mantissaBits = mantissa, + rounding = rounding, + oot_coefficients = oot_coefficients + ) return producer From 50d45df7905a6b6155ea50f488346d3505972227 Mon Sep 17 00:00:00 2001 From: maria Date: Tue, 14 Jan 2020 21:37:04 +0100 Subject: [PATCH 3/5] separate HFNose and HGCal --- .../L1THGCal/plugins/HFNoseVFEProducer.cc | 71 +++++++++++++++++++ .../L1THGCal/plugins/HGCalVFEProducer.cc | 30 ++++---- .../python/hgcalBackEndLayer1Producer_cfi.py | 3 + .../L1THGCal/python/hgcalBackEndLayer1_cff.py | 2 + .../python/hgcalBackEndLayer2Producer_cfi.py | 31 ++++---- .../L1THGCal/python/hgcalBackEndLayer2_cff.py | 2 + .../python/hgcalConcentratorProducer_cfi.py | 6 ++ .../L1THGCal/python/hgcalConcentrator_cff.py | 1 + .../python/hgcalTowerMapProducer_cfi.py | 3 + .../L1THGCal/python/hgcalTowerMap_cff.py | 2 + .../L1THGCal/python/hgcalTowerProducer_cfi.py | 5 ++ L1Trigger/L1THGCal/python/hgcalTower_cff.py | 2 + .../python/hgcalTriggerPrimitives_cff.py | 8 ++- .../L1THGCal/python/hgcalVFEProducer_cfi.py | 7 ++ L1Trigger/L1THGCal/python/hgcalVFE_cff.py | 1 + .../testHGCalL1TGeometryV9Imp2_Nose_cfg.py | 4 +- 16 files changed, 142 insertions(+), 36 deletions(-) create mode 100644 L1Trigger/L1THGCal/plugins/HFNoseVFEProducer.cc diff --git a/L1Trigger/L1THGCal/plugins/HFNoseVFEProducer.cc b/L1Trigger/L1THGCal/plugins/HFNoseVFEProducer.cc new file mode 100644 index 0000000000000..9845d1166afe6 --- /dev/null +++ b/L1Trigger/L1THGCal/plugins/HFNoseVFEProducer.cc @@ -0,0 +1,71 @@ +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "DataFormats/HGCDigi/interface/HGCDigiCollections.h" +#include "DataFormats/L1THGCal/interface/HGCalTriggerCell.h" +#include "DataFormats/L1THGCal/interface/HGCalTriggerSums.h" + +#include "Geometry/Records/interface/CaloGeometryRecord.h" +#include "L1Trigger/L1THGCal/interface/HGCalTriggerGeometryBase.h" + +#include "L1Trigger/L1THGCal/interface/HGCalProcessorBase.h" + +#include + +class HFNoseVFEProducer : public edm::stream::EDProducer<> { +public: + HFNoseVFEProducer(const edm::ParameterSet&); + ~HFNoseVFEProducer() override {} + + void beginRun(const edm::Run&, const edm::EventSetup&) override; + void produce(edm::Event&, const edm::EventSetup&) override; + +private: + // inputs + edm::EDGetToken inputnose_; + edm::ESHandle triggerGeometry_; + + std::unique_ptr vfeProcess_; +}; + +DEFINE_FWK_MODULE(HFNoseVFEProducer); + +HFNoseVFEProducer::HFNoseVFEProducer(const edm::ParameterSet& conf) + : inputnose_(consumes(conf.getParameter("noseDigis"))) { + // setup VFE parameters + const edm::ParameterSet& vfeParamConfig = conf.getParameterSet("ProcessorParameters"); + const std::string& vfeProcessorName = vfeParamConfig.getParameter("ProcessorName"); + vfeProcess_ = std::unique_ptr{ + HGCalVFEProcessorBaseFactory::get()->create(vfeProcessorName, vfeParamConfig)}; + + produces(vfeProcess_->name()); + produces(vfeProcess_->name()); +} + +void HFNoseVFEProducer::beginRun(const edm::Run& /*run*/, const edm::EventSetup& es) { + es.get().get(triggerGeometry_); + vfeProcess_->setGeometry(triggerGeometry_.product()); +} + +void HFNoseVFEProducer::produce(edm::Event& e, const edm::EventSetup& es) { + // Output collections + auto vfe_trigcell_output = std::make_unique(); + auto vfe_trigsums_output = std::make_unique(); + + edm::Handle nose_digis_h; + e.getByToken(inputnose_, nose_digis_h); + + if (nose_digis_h.isValid()) { + const HGCalDigiCollection& nose_digis = *nose_digis_h; + vfeProcess_->run(nose_digis, *vfe_trigcell_output, es); + } + + // Put in the event + e.put(std::move(vfe_trigcell_output), vfeProcess_->name()); + // At the moment the HGCalTriggerSumsBxCollection is empty + e.put(std::move(vfe_trigsums_output), vfeProcess_->name()); +} diff --git a/L1Trigger/L1THGCal/plugins/HGCalVFEProducer.cc b/L1Trigger/L1THGCal/plugins/HGCalVFEProducer.cc index db560f4a36b3a..c38ebe73804d0 100644 --- a/L1Trigger/L1THGCal/plugins/HGCalVFEProducer.cc +++ b/L1Trigger/L1THGCal/plugins/HGCalVFEProducer.cc @@ -26,7 +26,7 @@ class HGCalVFEProducer : public edm::stream::EDProducer<> { private: // inputs - edm::EDGetToken inputee_, inputfh_, inputbh_, inputnose_; + edm::EDGetToken inputee_, inputfh_, inputbh_; edm::ESHandle triggerGeometry_; std::unique_ptr vfeProcess_; @@ -37,8 +37,7 @@ DEFINE_FWK_MODULE(HGCalVFEProducer); HGCalVFEProducer::HGCalVFEProducer(const edm::ParameterSet& conf) : inputee_(consumes(conf.getParameter("eeDigis"))), inputfh_(consumes(conf.getParameter("fhDigis"))), - inputbh_(consumes(conf.getParameter("bhDigis"))), - inputnose_(consumes(conf.getParameter("noseDigis"))) { + inputbh_(consumes(conf.getParameter("bhDigis"))) { // setup VFE parameters const edm::ParameterSet& vfeParamConfig = conf.getParameterSet("ProcessorParameters"); const std::string& vfeProcessorName = vfeParamConfig.getParameter("ProcessorName"); @@ -68,21 +67,20 @@ void HGCalVFEProducer::produce(edm::Event& e, const edm::EventSetup& es) { e.getByToken(inputfh_, fh_digis_h); e.getByToken(inputbh_, bh_digis_h); - const HGCalDigiCollection& ee_digis = *ee_digis_h; - const HGCalDigiCollection& fh_digis = *fh_digis_h; - const HGCalDigiCollection& bh_digis = *bh_digis_h; - - // Processing DigiCollections and putting the results into the HGCalTriggerCellBxCollection - vfeProcess_->run(ee_digis, *vfe_trigcell_output, es); - vfeProcess_->run(fh_digis, *vfe_trigcell_output, es); - vfeProcess_->run(bh_digis, *vfe_trigcell_output, es); + // Processing DigiCollections and putting the results into the HGCalTriggerCellBxCollectio + if (ee_digis_h.isValid()) { + const HGCalDigiCollection& ee_digis = *ee_digis_h; + vfeProcess_->run(ee_digis, *vfe_trigcell_output, es); + } - edm::Handle nose_digis_h; - e.getByToken(inputnose_, nose_digis_h); + if (fh_digis_h.isValid()) { + const HGCalDigiCollection& fh_digis = *fh_digis_h; + vfeProcess_->run(fh_digis, *vfe_trigcell_output, es); + } - if (nose_digis_h.isValid()) { - const HGCalDigiCollection& nose_digis = *nose_digis_h; - vfeProcess_->run(nose_digis, *vfe_trigcell_output, es); + if (bh_digis_h.isValid()) { + const HGCalDigiCollection& bh_digis = *bh_digis_h; + vfeProcess_->run(bh_digis, *vfe_trigcell_output, es); } // Put in the event diff --git a/L1Trigger/L1THGCal/python/hgcalBackEndLayer1Producer_cfi.py b/L1Trigger/L1THGCal/python/hgcalBackEndLayer1Producer_cfi.py index 1b44d5b81257f..efa3a9916f797 100644 --- a/L1Trigger/L1THGCal/python/hgcalBackEndLayer1Producer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalBackEndLayer1Producer_cfi.py @@ -67,3 +67,6 @@ InputTriggerCells = cms.InputTag('hgcalConcentratorProducer:HGCalConcentratorProcessorSelection'), ProcessorParameters = be_proc.clone() ) + +hgcalBackEndLayer1ProducerHFNose = hgcalBackEndLayer1Producer.clone() +hgcalBackEndLayer1ProducerHFNose.InputTriggerCells = cms.InputTag('hgcalConcentratorProducerHFNose:HGCalConcentratorProcessorSelection') diff --git a/L1Trigger/L1THGCal/python/hgcalBackEndLayer1_cff.py b/L1Trigger/L1THGCal/python/hgcalBackEndLayer1_cff.py index b93d9ef86ed01..3c5cb10f82480 100644 --- a/L1Trigger/L1THGCal/python/hgcalBackEndLayer1_cff.py +++ b/L1Trigger/L1THGCal/python/hgcalBackEndLayer1_cff.py @@ -6,3 +6,5 @@ hgcalBackEndLayer1 = cms.Task(hgcalBackEndLayer1Producer) +hgcalBackEndLayer1HFNose = cms.Task(hgcalBackEndLayer1ProducerHFNose) + diff --git a/L1Trigger/L1THGCal/python/hgcalBackEndLayer2Producer_cfi.py b/L1Trigger/L1THGCal/python/hgcalBackEndLayer2Producer_cfi.py index 043c9e26ce2a0..97a30a5cb8d8b 100644 --- a/L1Trigger/L1THGCal/python/hgcalBackEndLayer2Producer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalBackEndLayer2Producer_cfi.py @@ -17,15 +17,6 @@ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 # 28 - 41 ) -binSumsNose = cms.vuint32(13, # 0 - 13, # 1 - 11, 11, 11, # 2 - 4 - 9, 9, 9, # 5 - 7 - 7, 7, 7, 7, 7, 7, # 8 - 13 - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, # 14 - 28 - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 # 29 - 42 -) - EE_DR_GROUP = 7 FH_DR_GROUP = 6 BH_DR_GROUP = 12 @@ -98,14 +89,6 @@ seed_smoothing_hcal=seed_smoothing_hcal, ) -## Note: this customization change both HGC and HFnose, to be revised -phase2_hfnose.toModify(histoMax_C3d_seeding_params, - nBins_X1_histo_multicluster=cms.uint32(43), - binSumsHisto=binSumsNose, - kROverZMin=cms.double(0.025), - kROverZMax=cms.double(0.58), - ) - histoMax_C3d_clustering_params = cms.PSet(dR_multicluster=cms.double(0.03), dR_multicluster_byLayer_coefficientA=cms.vdouble(), dR_multicluster_byLayer_coefficientB=cms.vdouble(), @@ -184,3 +167,17 @@ InputCluster = cms.InputTag('hgcalBackEndLayer1Producer:HGCalBackendLayer1Processor2DClustering'), ProcessorParameters = be_proc.clone() ) + + +hgcalBackEndLayer2ProducerHFNose = hgcalBackEndLayer2Producer.clone() +hgcalBackEndLayer2ProducerHFNose.InputCluster = cms.InputTag('hgcalBackEndLayer1ProducerHFNose:HGCalBackendLayer1Processor2DClustering') + +binSumsNose = cms.vuint32(13,11,9,9) + +hgcalBackEndLayer2ProducerHFNose.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = dict( + ## note in #Phi same bin size for HGCAL and HFNose + nBins_X1_histo_multicluster = 4, # R bin size: 5 FullModules * 8 TP + binSumsHisto = binSumsNose, + kROverZMin = 0.025, + kROverZMax = 0.1 +) diff --git a/L1Trigger/L1THGCal/python/hgcalBackEndLayer2_cff.py b/L1Trigger/L1THGCal/python/hgcalBackEndLayer2_cff.py index e8578130e05fc..152994d21f51f 100644 --- a/L1Trigger/L1THGCal/python/hgcalBackEndLayer2_cff.py +++ b/L1Trigger/L1THGCal/python/hgcalBackEndLayer2_cff.py @@ -6,3 +6,5 @@ hgcalBackEndLayer2 = cms.Task(hgcalBackEndLayer2Producer) +hgcalBackEndLayer2HFNose = cms.Task(hgcalBackEndLayer2ProducerHFNose) + diff --git a/L1Trigger/L1THGCal/python/hgcalConcentratorProducer_cfi.py b/L1Trigger/L1THGCal/python/hgcalConcentratorProducer_cfi.py index 08b7ed94e3fe1..d23a5a625d06d 100644 --- a/L1Trigger/L1THGCal/python/hgcalConcentratorProducer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalConcentratorProducer_cfi.py @@ -161,3 +161,9 @@ InputTriggerSums = cms.InputTag('hgcalVFEProducer:HGCalVFEProcessorSums'), ProcessorParameters = threshold_conc_proc.clone() ) + + +hgcalConcentratorProducerHFNose = hgcalConcentratorProducer.clone() +hgcalConcentratorProducerHFNose.InputTriggerCells = cms.InputTag('hfnoseVFEProducer:HGCalVFEProcessorSums') +hgcalConcentratorProducerHFNose.InputTriggerSums = cms.InputTag('hfnoseVFEProducer:HGCalVFEProcessorSums') + diff --git a/L1Trigger/L1THGCal/python/hgcalConcentrator_cff.py b/L1Trigger/L1THGCal/python/hgcalConcentrator_cff.py index 6626e48c64ee2..26c25bc79d125 100644 --- a/L1Trigger/L1THGCal/python/hgcalConcentrator_cff.py +++ b/L1Trigger/L1THGCal/python/hgcalConcentrator_cff.py @@ -5,4 +5,5 @@ hgcalConcentrator = cms.Task(hgcalConcentratorProducer) +hgcalConcentratorHFNose = cms.Task(hgcalConcentratorProducerHFNose) diff --git a/L1Trigger/L1THGCal/python/hgcalTowerMapProducer_cfi.py b/L1Trigger/L1THGCal/python/hgcalTowerMapProducer_cfi.py index 4070a93f90c00..e3a9ebc91322d 100644 --- a/L1Trigger/L1THGCal/python/hgcalTowerMapProducer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalTowerMapProducer_cfi.py @@ -25,3 +25,6 @@ InputTriggerCells = cms.InputTag('hgcalVFEProducer:HGCalVFEProcessorSums'), ProcessorParameters = tower_map.clone() ) + +hgcalTowerMapProducerHFNose = hgcalTowerMapProducer.clone() +hgcalTowerMapProducerHFNose.InputTriggerCells = cms.InputTag('hfnoseVFEProducer:HFNoseVFEProcessorSums') diff --git a/L1Trigger/L1THGCal/python/hgcalTowerMap_cff.py b/L1Trigger/L1THGCal/python/hgcalTowerMap_cff.py index 48037134dd8ea..4c377ceeb4f77 100644 --- a/L1Trigger/L1THGCal/python/hgcalTowerMap_cff.py +++ b/L1Trigger/L1THGCal/python/hgcalTowerMap_cff.py @@ -6,3 +6,5 @@ hgcalTowerMap = cms.Task(hgcalTowerMapProducer) +hgcalTowerMapHFNose = cms.Task(hgcalTowerMapProducerHFNose) + diff --git a/L1Trigger/L1THGCal/python/hgcalTowerProducer_cfi.py b/L1Trigger/L1THGCal/python/hgcalTowerProducer_cfi.py index 28df24747f430..2771d649dedfc 100644 --- a/L1Trigger/L1THGCal/python/hgcalTowerProducer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalTowerProducer_cfi.py @@ -8,3 +8,8 @@ InputTowerMaps = cms.InputTag('hgcalTowerMapProducer:HGCalTowerMapProcessor'), ProcessorParameters = tower.clone() ) + + +hgcalTowerProducerHFNose = hgcalTowerProducer.clone() +hgcalTowerProducerHFNose.InputTowerMaps = cms.InputTag('hgcalTowerMapProducerHFNose:HGCalTowerMapProcessor') + diff --git a/L1Trigger/L1THGCal/python/hgcalTower_cff.py b/L1Trigger/L1THGCal/python/hgcalTower_cff.py index ca1faadb6523b..0b9a1704bfc6f 100644 --- a/L1Trigger/L1THGCal/python/hgcalTower_cff.py +++ b/L1Trigger/L1THGCal/python/hgcalTower_cff.py @@ -6,3 +6,5 @@ hgcalTower = cms.Task(hgcalTowerProducer) +hgcalTowerHFNose = cms.Task(hgcalTowerProducerHFNose) + diff --git a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitives_cff.py b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitives_cff.py index 32f3e3b3e25de..8e9fa1545df50 100644 --- a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitives_cff.py +++ b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitives_cff.py @@ -8,10 +8,16 @@ from L1Trigger.L1THGCal.hgcalTowerMap_cff import * from L1Trigger.L1THGCal.hgcalTower_cff import * - hgcalTriggerPrimitivesTask = cms.Task(hgcalVFE, hgcalConcentrator, hgcalBackEndLayer1, hgcalBackEndLayer2, hgcalTowerMap, hgcalTower) hgcalTriggerPrimitives = cms.Sequence(hgcalTriggerPrimitivesTask) +_hfnose_hgcalTriggerPrimitivesTask = hgcalTriggerPrimitivesTask.copy() +_hfnose_hgcalTriggerPrimitivesTask.add(hfnoseVFE, hgcalConcentratorHFNose, hgcalBackEndLayer1HFNose, hgcalBackEndLayer2HFNose, hgcalTowerMapHFNose, hgcalTowerHFNose) + +from Configuration.Eras.Modifier_phase2_hfnose_cff import phase2_hfnose +phase2_hfnose.toReplaceWith( + hgcalTriggerPrimitivesTask, _hfnose_hgcalTriggerPrimitivesTask ) + from Configuration.Eras.Modifier_phase2_hgcalV9_cff import phase2_hgcalV9 from Configuration.Eras.Modifier_phase2_hgcalV11_cff import phase2_hgcalV11 from L1Trigger.L1THGCal.customTriggerGeometry import custom_geometry_decentralized_V9, custom_geometry_decentralized_V11 diff --git a/L1Trigger/L1THGCal/python/hgcalVFEProducer_cfi.py b/L1Trigger/L1THGCal/python/hgcalVFEProducer_cfi.py index 2aadfeb9d442e..0c9f2b918178c 100644 --- a/L1Trigger/L1THGCal/python/hgcalVFEProducer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalVFEProducer_cfi.py @@ -93,7 +93,14 @@ eeDigis = cms.InputTag('simHGCalUnsuppressedDigis:EE'), fhDigis = cms.InputTag('simHGCalUnsuppressedDigis:HEfront'), bhDigis = cms.InputTag('simHGCalUnsuppressedDigis:HEback'), + ProcessorParameters = vfe_proc.clone() + ) + +hfnoseVFEProducer = cms.EDProducer( + "HFNoseVFEProducer", noseDigis = cms.InputTag('simHFNoseUnsuppressedDigis:HFNose'), ProcessorParameters = vfe_proc.clone() ) + + diff --git a/L1Trigger/L1THGCal/python/hgcalVFE_cff.py b/L1Trigger/L1THGCal/python/hgcalVFE_cff.py index b8380c01cf50b..8d56b1ffe5856 100644 --- a/L1Trigger/L1THGCal/python/hgcalVFE_cff.py +++ b/L1Trigger/L1THGCal/python/hgcalVFE_cff.py @@ -4,4 +4,5 @@ from L1Trigger.L1THGCal.hgcalVFEProducer_cfi import * hgcalVFE = cms.Task(hgcalVFEProducer) +hfnoseVFE = cms.Task(hfnoseVFEProducer) diff --git a/L1Trigger/L1THGCal/test/testHGCalL1TGeometryV9Imp2_Nose_cfg.py b/L1Trigger/L1THGCal/test/testHGCalL1TGeometryV9Imp2_Nose_cfg.py index be0507d749948..5c3c4f97819f8 100644 --- a/L1Trigger/L1THGCal/test/testHGCalL1TGeometryV9Imp2_Nose_cfg.py +++ b/L1Trigger/L1THGCal/test/testHGCalL1TGeometryV9Imp2_Nose_cfg.py @@ -68,8 +68,8 @@ eventAutoFlushCompressedSize = cms.untracked.int32(5242880), outputCommands = cms.untracked.vstring( 'keep *_genParticles_*_*', - 'keep *_hgcalBackEndLayer1Producer_*_*', - 'keep *_hgcalBackEndLayer2Producer_*_*', + 'keep *_*hgcalBackEndLayer1Producer*_*_*', + 'keep *_*hgcalBackEndLayer2Producer*_*_*', 'keep *_hgcalTowerProducer_*_*', ), fileName = cms.untracked.string('file:/tmp/dalfonso/test.root') From 8074ea13ab4ea0d6ac9595985575613e5b23cf08 Mon Sep 17 00:00:00 2001 From: Imran Yusuff Date: Sat, 25 Apr 2020 20:42:21 +0200 Subject: [PATCH 4/5] Optimized power-of-2 FP division --- .../src/veryfrontend/HGCalVFELinearizationImpl.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/L1Trigger/L1THGCal/src/veryfrontend/HGCalVFELinearizationImpl.cc b/L1Trigger/L1THGCal/src/veryfrontend/HGCalVFELinearizationImpl.cc index cc8a024b1ca90..29db3afd85c40 100644 --- a/L1Trigger/L1THGCal/src/veryfrontend/HGCalVFELinearizationImpl.cc +++ b/L1Trigger/L1THGCal/src/veryfrontend/HGCalVFELinearizationImpl.cc @@ -19,10 +19,10 @@ HGCalVFELinearizationImpl::HGCalVFELinearizationImpl(const edm::ParameterSet& co if (oot_coefficients_.size() != kOot_order) { throw cms::Exception("BadConfiguration") << "OOT subtraction needs " << kOot_order << " coefficients"; } - adcLSB_si_ = adcsaturation_si_ / pow(2., adcnBits_si_); - tdcLSB_si_ = tdcsaturation_si_ / pow(2., tdcnBits_si_); - adcLSB_sc_ = adcsaturation_sc_ / pow(2., adcnBits_sc_); - tdcLSB_sc_ = tdcsaturation_sc_ / pow(2., tdcnBits_sc_); + adcLSB_si_ = ldexp(adcsaturation_si_, -adcnBits_si_); + tdcLSB_si_ = ldexp(tdcsaturation_si_, -tdcnBits_si_); + adcLSB_sc_ = ldexp(adcsaturation_sc_, -adcnBits_sc_); + tdcLSB_sc_ = ldexp(tdcsaturation_sc_, -tdcnBits_sc_); linMax_ = (0x1 << linnBits_) - 1; } From f63610f94730c9d1ee8200589119eb5ded09b8f1 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Sun, 10 May 2020 10:44:12 +0200 Subject: [PATCH 5/5] Comments #29762 --- .../python/hgcalBackEndLayer1Producer_cfi.py | 5 ++-- .../python/hgcalBackEndLayer2Producer_cfi.py | 24 ++++++++++--------- .../python/hgcalConcentratorProducer_cfi.py | 7 +++--- .../python/hgcalTowerMapProducer_cfi.py | 5 ++-- .../L1THGCal/python/hgcalTowerProducer_cfi.py | 5 ++-- .../L1THGCal/python/hgcalVFEProducer_cfi.py | 2 +- .../veryfrontend/HGCalVFELinearizationImpl.cc | 14 ++++++----- .../ntuples/HGCalTriggerNtupleHGCDigis.cc | 6 ++--- L1Trigger/L1THGCalUtilities/python/vfe.py | 7 +++--- 9 files changed, 42 insertions(+), 33 deletions(-) diff --git a/L1Trigger/L1THGCal/python/hgcalBackEndLayer1Producer_cfi.py b/L1Trigger/L1THGCal/python/hgcalBackEndLayer1Producer_cfi.py index efa3a9916f797..2739c9ddee251 100644 --- a/L1Trigger/L1THGCal/python/hgcalBackEndLayer1Producer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalBackEndLayer1Producer_cfi.py @@ -68,5 +68,6 @@ ProcessorParameters = be_proc.clone() ) -hgcalBackEndLayer1ProducerHFNose = hgcalBackEndLayer1Producer.clone() -hgcalBackEndLayer1ProducerHFNose.InputTriggerCells = cms.InputTag('hgcalConcentratorProducerHFNose:HGCalConcentratorProcessorSelection') +hgcalBackEndLayer1ProducerHFNose = hgcalBackEndLayer1Producer.clone( + InputTriggerCells = cms.InputTag('hgcalConcentratorProducerHFNose:HGCalConcentratorProcessorSelection') +) diff --git a/L1Trigger/L1THGCal/python/hgcalBackEndLayer2Producer_cfi.py b/L1Trigger/L1THGCal/python/hgcalBackEndLayer2Producer_cfi.py index 97a30a5cb8d8b..70729f0b7f3cd 100644 --- a/L1Trigger/L1THGCal/python/hgcalBackEndLayer2Producer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalBackEndLayer2Producer_cfi.py @@ -169,15 +169,17 @@ ) -hgcalBackEndLayer2ProducerHFNose = hgcalBackEndLayer2Producer.clone() -hgcalBackEndLayer2ProducerHFNose.InputCluster = cms.InputTag('hgcalBackEndLayer1ProducerHFNose:HGCalBackendLayer1Processor2DClustering') - -binSumsNose = cms.vuint32(13,11,9,9) - -hgcalBackEndLayer2ProducerHFNose.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = dict( - ## note in #Phi same bin size for HGCAL and HFNose - nBins_X1_histo_multicluster = 4, # R bin size: 5 FullModules * 8 TP - binSumsHisto = binSumsNose, - kROverZMin = 0.025, - kROverZMax = 0.1 +hgcalBackEndLayer2ProducerHFNose = hgcalBackEndLayer2Producer.clone( + InputCluster = cms.InputTag('hgcalBackEndLayer1ProducerHFNose:HGCalBackendLayer1Processor2DClustering'), + ProcessorParameters = dict( + C3d_parameters = dict( + histoMax_C3d_seeding_parameters = dict( + ## note in #Phi same bin size for HGCAL and HFNose + nBins_X1_histo_multicluster = 4, # R bin size: 5 FullModules * 8 TP + binSumsHisto = cms.vuint32(13,11,9,9), + kROverZMin = 0.025, + kROverZMax = 0.1 + ) + ) + ) ) diff --git a/L1Trigger/L1THGCal/python/hgcalConcentratorProducer_cfi.py b/L1Trigger/L1THGCal/python/hgcalConcentratorProducer_cfi.py index d23a5a625d06d..94c9a61722673 100644 --- a/L1Trigger/L1THGCal/python/hgcalConcentratorProducer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalConcentratorProducer_cfi.py @@ -163,7 +163,8 @@ ) -hgcalConcentratorProducerHFNose = hgcalConcentratorProducer.clone() -hgcalConcentratorProducerHFNose.InputTriggerCells = cms.InputTag('hfnoseVFEProducer:HGCalVFEProcessorSums') -hgcalConcentratorProducerHFNose.InputTriggerSums = cms.InputTag('hfnoseVFEProducer:HGCalVFEProcessorSums') +hgcalConcentratorProducerHFNose = hgcalConcentratorProducer.clone( + InputTriggerCells = cms.InputTag('hfnoseVFEProducer:HGCalVFEProcessorSums'), + InputTriggerSums = cms.InputTag('hfnoseVFEProducer:HGCalVFEProcessorSums') +) diff --git a/L1Trigger/L1THGCal/python/hgcalTowerMapProducer_cfi.py b/L1Trigger/L1THGCal/python/hgcalTowerMapProducer_cfi.py index e3a9ebc91322d..be296d19d60e0 100644 --- a/L1Trigger/L1THGCal/python/hgcalTowerMapProducer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalTowerMapProducer_cfi.py @@ -26,5 +26,6 @@ ProcessorParameters = tower_map.clone() ) -hgcalTowerMapProducerHFNose = hgcalTowerMapProducer.clone() -hgcalTowerMapProducerHFNose.InputTriggerCells = cms.InputTag('hfnoseVFEProducer:HFNoseVFEProcessorSums') +hgcalTowerMapProducerHFNose = hgcalTowerMapProducer.clone( + InputTriggerCells = cms.InputTag('hfnoseVFEProducer:HFNoseVFEProcessorSums') +) diff --git a/L1Trigger/L1THGCal/python/hgcalTowerProducer_cfi.py b/L1Trigger/L1THGCal/python/hgcalTowerProducer_cfi.py index 2771d649dedfc..2c2ab2056383e 100644 --- a/L1Trigger/L1THGCal/python/hgcalTowerProducer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalTowerProducer_cfi.py @@ -10,6 +10,7 @@ ) -hgcalTowerProducerHFNose = hgcalTowerProducer.clone() -hgcalTowerProducerHFNose.InputTowerMaps = cms.InputTag('hgcalTowerMapProducerHFNose:HGCalTowerMapProcessor') +hgcalTowerProducerHFNose = hgcalTowerProducer.clone( + InputTowerMaps = cms.InputTag('hgcalTowerMapProducerHFNose:HGCalTowerMapProcessor') +) diff --git a/L1Trigger/L1THGCal/python/hgcalVFEProducer_cfi.py b/L1Trigger/L1THGCal/python/hgcalVFEProducer_cfi.py index 0c9f2b918178c..57c6847a335db 100644 --- a/L1Trigger/L1THGCal/python/hgcalVFEProducer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalVFEProducer_cfi.py @@ -59,7 +59,7 @@ adcnBits_sc = adcNbits_sc, tdcsaturation_sc = tdcSaturation_sc, linnBits = cms.uint32(16), - oot_coefficients = cms.vdouble(0., 0.), # (bx-2, bx-1) + oot_coefficients = cms.vdouble(0., 0.), # OOT PU subtraction coeffs for samples (bx-2, bx-1). (0,0) = no OOT PU subtraction siliconCellLSB_fC = cms.double( triggerCellLsbBeforeCompression*(2**triggerCellTruncationBits) ), scintillatorCellLSB_MIP = cms.double(float(adcSaturation_sc.value())/(2**float(adcNbits_sc.value()))), noiseSilicon = cms.PSet(), diff --git a/L1Trigger/L1THGCal/src/veryfrontend/HGCalVFELinearizationImpl.cc b/L1Trigger/L1THGCal/src/veryfrontend/HGCalVFELinearizationImpl.cc index 29db3afd85c40..b504bc8048cb4 100644 --- a/L1Trigger/L1THGCal/src/veryfrontend/HGCalVFELinearizationImpl.cc +++ b/L1Trigger/L1THGCal/src/veryfrontend/HGCalVFELinearizationImpl.cc @@ -15,7 +15,7 @@ HGCalVFELinearizationImpl::HGCalVFELinearizationImpl(const edm::ParameterSet& co tdcsaturation_sc_(conf.getParameter("tdcsaturation_sc")), linnBits_(conf.getParameter("linnBits")), oot_coefficients_(conf.getParameter>("oot_coefficients")) { - const int kOot_order = 2; + constexpr int kOot_order = 2; if (oot_coefficients_.size() != kOot_order) { throw cms::Exception("BadConfiguration") << "OOT subtraction needs " << kOot_order << " coefficients"; } @@ -28,7 +28,9 @@ HGCalVFELinearizationImpl::HGCalVFELinearizationImpl(const edm::ParameterSet& co void HGCalVFELinearizationImpl::linearize(const std::vector>& dataframes, std::vector>& linearized_dataframes) { - const int kIntimeSample = 2; + constexpr int kIntimeSample = 2; + constexpr int kOuttime1Sample = 1; // in time - 1; + constexpr int kOuttime2Sample = 0; // in time - 2; for (const auto& frame : dataframes) { //loop on DIGI double amplitude = 0.; @@ -48,10 +50,10 @@ void HGCalVFELinearizationImpl::linearize(const std::vector hgcdigi_isadc(digi.size()); for (int i = 0; i < digi.size(); i++) { hgcdigi_data[i] = digi[i].data(); - hgcdigi_isadc[i] = (digi[i].mode() ? 0 : 1); + hgcdigi_isadc[i] = !digi[i].mode(); } hgcdigi_data_.emplace_back(hgcdigi_data); hgcdigi_isadc_.emplace_back(hgcdigi_isadc); @@ -239,7 +239,7 @@ void HGCalTriggerNtupleHGCDigis::fill(const edm::Event& e, const edm::EventSetup vector hgcdigi_isadc(digi.size()); for (int i = 0; i < digi.size(); i++) { hgcdigi_data[i] = digi[i].data(); - hgcdigi_isadc[i] = (digi[i].mode() ? 0 : 1); + hgcdigi_isadc[i] = !digi[i].mode(); } hgcdigi_data_.emplace_back(hgcdigi_data); hgcdigi_isadc_.emplace_back(hgcdigi_isadc); @@ -280,7 +280,7 @@ void HGCalTriggerNtupleHGCDigis::fill(const edm::Event& e, const edm::EventSetup vector bhdigi_isadc(digi.size()); for (int i = 0; i < digi.size(); i++) { bhdigi_data[i] = digi[i].data(); - bhdigi_isadc[i] = (digi[i].mode() ? 0 : 1); + bhdigi_isadc[i] = !digi[i].mode(); } bhdigi_data_.emplace_back(bhdigi_data); bhdigi_isadc_.emplace_back(bhdigi_isadc); diff --git a/L1Trigger/L1THGCalUtilities/python/vfe.py b/L1Trigger/L1THGCalUtilities/python/vfe.py index 41a88d7e97522..8a4e6bceb4b01 100644 --- a/L1Trigger/L1THGCalUtilities/python/vfe.py +++ b/L1Trigger/L1THGCalUtilities/python/vfe.py @@ -8,11 +8,12 @@ def create_compression(process, rounding=vfe_proc.rounding, oot_coefficients=vfe_proc.oot_coefficients ): - producer = process.hgcalVFEProducer.clone() - producer.ProcessorParameters = vfe_proc.clone( + producer = process.hgcalVFEProducer.clone( + ProcessorParameters = vfe_proc.clone( exponentBits = exponent, mantissaBits = mantissa, rounding = rounding, oot_coefficients = oot_coefficients - ) + ) + ) return producer