From a88350f55765f6f5bae2937258755c4b112ee8d6 Mon Sep 17 00:00:00 2001 From: Stephanie Date: Mon, 2 May 2016 16:52:34 +0200 Subject: [PATCH 01/43] linearisation --- .../src/fe_codecs/HGCalBestChoiceCodecImpl.cc | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc b/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc index d6e08b79de5cc..1ddf6a75f30a9 100644 --- a/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc +++ b/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc @@ -1,3 +1,4 @@ + #include "L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h" #include "DataFormats/ForwardDetId/interface/HGCTriggerDetId.h" @@ -6,7 +7,13 @@ HGCalBestChoiceCodecImpl::HGCalBestChoiceCodecImpl(const edm::ParameterSet& conf) : nData_(conf.getParameter("NData")), dataLength_(conf.getParameter("DataLength")), - nCellsInModule_(data_type::size) + nCellsInModule_(data_type::size), + linLSB_(conf.getParameter("linLSB")), + adcsaturation_(conf.getParameter("adcsaturation")), + adcnBits_(conf.getParameter("adcnBits")), + tdcsaturation_(conf.getParameter("tdcsaturation")), + tdcnBits_(conf.getParameter("tdcnBits")), + tdcOnsetfC_(conf.getParameter("tdcOnsetfC")) /*****************************************************************/ { } @@ -80,6 +87,33 @@ HGCalBestChoiceCodecImpl::data_type HGCalBestChoiceCodecImpl::decode(const std:: return result; } +/*****************************************************************/ +void HGCalBestChoiceCodecImpl::linearize(const HGCalTriggerGeometry::Module& mod, const std::vector& dataframes, std::vector >& linearized_dataframes) +/*****************************************************************/ +{ + double amplitude; uint32_t amplitude_int; + double adcLSB_ = adcsaturation_/pow(2.,adcnBits_); + double tdcLSB_ = tdcsaturation_/pow(2.,tdcnBits_); + + for(const auto& frame : dataframes) {//loop on DIGI + for(const auto& tc_c : mod.triggerCellComponents()) { //treat only the HG cells in the considered module + if(tc_c.second==frame.id()) { //treat if the DIGI detID is the same of the considered GC cell + if (frame[2].mode()) {//TOT mode + amplitude =( floor(tdcOnsetfC_/adcLSB_) + 1.0 )* adcLSB_ + double(frame[2].data()) * tdcLSB_; + } + else {//ADC mode + amplitude = double(frame[2].data()) * adcLSB_; + } + + amplitude_int = uint32_t (floor(amplitude/linLSB_+0.5)); + if (amplitude_int>65535) amplitude_int = 65535; + + linearized_dataframes.push_back(std::make_pair (frame.id(), amplitude_int)); + } + } + } +} + /*****************************************************************/ void HGCalBestChoiceCodecImpl::triggerCellSums(const HGCalTriggerGeometry::Module& mod, const std::vector& dataframes, data_type& data) From 4bf0ace651e6920a8387930b0c0277464d4f3bb3 Mon Sep 17 00:00:00 2001 From: Stephanie Date: Mon, 2 May 2016 16:53:04 +0200 Subject: [PATCH 02/43] linearisation --- .../interface/fe_codecs/HGCalBestChoiceCodecImpl.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h index cfabc0a08cc5f..b4d9c978d229c 100644 --- a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h +++ b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h @@ -34,13 +34,21 @@ class HGCalBestChoiceCodecImpl std::vector encode(const data_type&) const ; data_type decode(const std::vector&) const; + void linearize(const HGCalTriggerGeometry::Module& , const std::vector&, std::vector >&); + void triggerCellSums(const HGCalTriggerGeometry::Module& , const std::vector&, data_type&); void bestChoiceSelect(data_type&); private: - size_t nData_; - size_t dataLength_; - size_t nCellsInModule_; + size_t nData_; + size_t dataLength_; + size_t nCellsInModule_; + double linLSB_; + double adcsaturation_; + uint32_t adcnBits_; + double tdcsaturation_ ; + uint32_t tdcnBits_ ; + double tdcOnsetfC_ ; }; From 563e31480d827e2086ca1574cf046fc13423f9a5 Mon Sep 17 00:00:00 2001 From: Stephanie Date: Mon, 2 May 2016 16:53:22 +0200 Subject: [PATCH 03/43] linearisation --- L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc index a05763d19beb5..dbc585cf2a994 100644 --- a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc +++ b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc @@ -33,6 +33,8 @@ void HGCalBestChoiceCodec::setDataPayloadImpl(const Module& mod, dataframes.push_back(eedata); } } + std::vector > linearized_dataframes; + codecImpl_.linearize(mod, dataframes, linearized_dataframes); // sum energy in trigger cells codecImpl_.triggerCellSums(mod, dataframes, data_); // choose best trigger cells in the module From aeb3054d255a944613b29dcca9221b3d581203cf Mon Sep 17 00:00:00 2001 From: Stephanie Date: Mon, 2 May 2016 16:54:21 +0200 Subject: [PATCH 04/43] linearisation --- .../python/hgcalTriggerPrimitiveDigiProducer_cfi.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py index 9569355a44688..3872af0360315 100644 --- a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py @@ -3,7 +3,13 @@ fe_codec = cms.PSet( CodecName = cms.string('HGCalBestChoiceCodec'), CodecIndex = cms.uint32(1), NData = cms.uint32(12), - DataLength = cms.uint32(8) + DataLength = cms.uint32(8), + linLSB = cms.double(100./1024.), + adcsaturation = cms.double(100), + adcnBits = cms.uint32(10), + tdcsaturation = cms.double(10000), + tdcnBits = cms.uint32(12), + tdcOnsetfC = cms.double(60) ) cluster_algo = cms.PSet( AlgorithmName = cms.string('FullModuleSumAlgo'), From 42877707d7966f821b86f6231d6364cf1b6f8bfb Mon Sep 17 00:00:00 2001 From: Stephanie Date: Mon, 2 May 2016 16:55:02 +0200 Subject: [PATCH 05/43] linearisation --- .../test/HGCalTriggerBestChoiceTester.cc | 126 ++++++++++-------- 1 file changed, 73 insertions(+), 53 deletions(-) diff --git a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc index 979d11373276d..46f95ba313798 100644 --- a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc +++ b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc @@ -30,7 +30,11 @@ #include "L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h" #include +#include "TH2.h" +//steph +#include "DataFormats/ForwardDetId/interface/HGCEEDetId.h" +using namespace std; class HGCalTriggerBestChoiceTester : public edm::EDAnalyzer { @@ -43,7 +47,7 @@ class HGCalTriggerBestChoiceTester : public edm::EDAnalyzer private: - void fillModule(const std::vector&, const HGCalBestChoiceDataPayload&); + void fillModule(const std::vector&, const HGCalBestChoiceDataPayload&, vector >& ); // inputs edm::EDGetToken inputee_, inputfh_, inputbh_; // @@ -53,6 +57,9 @@ class HGCalTriggerBestChoiceTester : public edm::EDAnalyzer // histos TH1F* hgcCellsPerModule_; TH1F* hgcCellData_; + //steph + TH1F* hgcCellData_linampl_; + // TH1F* hgcCellModuleSum_; TH1F* triggerCellsPerModule_; TH1F* triggerCellData_; @@ -79,12 +86,15 @@ HGCalTriggerBestChoiceTester::HGCalTriggerBestChoiceTester(const edm::ParameterS codec_.reset( new HGCalBestChoiceCodecImpl(feCodecConfig) ); // initialize output trees - hgcCellsPerModule_ = fs_->make("hgcCellsPerModule","Number of cells per module", 64, 0., 64.); - hgcCellData_ = fs_->make("hgcCellData","Cell values", 500, 0., 500.); - hgcCellModuleSum_ = fs_->make("hgcCellModuleSum","Cell sum in modules", 1000, 0., 1000.); - triggerCellsPerModule_ = fs_->make("TriggerCellsPerModule","Number of trigger cells per module", 64, 0., 64.); - triggerCellData_ = fs_->make("TriggerCellData","Trigger cell values", 500, 0., 500.); - triggerCellModuleSum_ = fs_->make("TriggerCellModuleSum","Trigger cell sum in modules", 1000, 0., 1000.); + hgcCellsPerModule_ = fs_->make("hgcCellsPerModule","Number of cells per module", 64, 0., 64.); + hgcCellData_ = fs_->make("hgcCellData","Cell values", 500, 0., 500.); + // + hgcCellData_linampl_ = fs_->make("hgcCellData_linampl_","Cell linearized amplitudes values All", 1250, 0, 25000); + // + hgcCellModuleSum_ = fs_->make("hgcCellModuleSum","Cell sum in modules", 1000, 0., 1000.); + triggerCellsPerModule_ = fs_->make("TriggerCellsPerModule","Number of trigger cells per module", 64, 0., 64.); + triggerCellData_ = fs_->make("TriggerCellData","Trigger cell values", 500, 0., 500.); + triggerCellModuleSum_ = fs_->make("TriggerCellModuleSum","Trigger cell sum in modules", 1000, 0., 1000.); } @@ -125,67 +135,77 @@ void HGCalTriggerBestChoiceTester::analyze(const edm::Event& e, e.getByToken(inputee_,ee_digis_h); const HGCEEDigiCollection& ee_digis = *ee_digis_h; - + HGCalBestChoiceDataPayload data; - for( const auto& module : triggerGeometry_->modules() ) - { - // prepare input data - std::vector dataframes; - for(const auto& eedata : ee_digis) - { - if(module.second->containsCell(eedata.id())) - { - dataframes.push_back(eedata); - } - } - // Best choice encoding - data.reset(); - codec_->triggerCellSums(*(module.second), dataframes, data); - codec_->bestChoiceSelect(data); - std::vector dataword = codec_->encode(data); - HGCalBestChoiceDataPayload datadecoded = codec_->decode(dataword); - fillModule(dataframes, datadecoded); - } + + + //loop on modules + for( const auto& module : triggerGeometry_->modules() ) { + // prepare input data + std::vector dataframes; + vector > linearized_dataframes; + + for(const auto& eedata : ee_digis) { + if(module.second->containsCell(eedata.id())) { + dataframes.push_back(eedata); + } + } + + // Best choice encoding + data.reset(); + codec_->linearize(*(module.second), dataframes, linearized_dataframes); + codec_->triggerCellSums(*(module.second), dataframes, data); + codec_->bestChoiceSelect(data); + std::vector dataword = codec_->encode(data); + HGCalBestChoiceDataPayload datadecoded = codec_->decode(dataword); + fillModule(dataframes, datadecoded, linearized_dataframes); + } //end loop on modules + } /*****************************************************************/ -void HGCalTriggerBestChoiceTester::fillModule( const std::vector& dataframes, const HGCalBestChoiceDataPayload& fe_payload) +void HGCalTriggerBestChoiceTester::fillModule( const std::vector& dataframes, const HGCalBestChoiceDataPayload& fe_payload, vector >& linearized_dataframes) /*****************************************************************/ { - // HGC cells part - size_t nHGCDigi = 0; - unsigned hgcCellModuleSum = 0; - for(const auto& frame : dataframes) + // HGC cells part + size_t nHGCDigi = 0; + unsigned hgcCellModuleSum = 0; + for(const auto& frame : dataframes) { - uint32_t value = frame[2].data(); - if(value>0) + uint32_t value = frame[2].data(); + if(value>0) { - nHGCDigi++; - hgcCellModuleSum += value; - hgcCellData_->Fill(value); + nHGCDigi++; + hgcCellModuleSum += value; + hgcCellData_->Fill(value); } } - hgcCellsPerModule_->Fill(nHGCDigi); - hgcCellModuleSum_->Fill(hgcCellModuleSum); - - // trigger cells part - size_t nFEDigi = 0; - unsigned triggerCellModuleSum = 0; - for(const auto& tc : fe_payload.payload) + hgcCellsPerModule_->Fill(nHGCDigi); + hgcCellModuleSum_->Fill(hgcCellModuleSum); + + for(const auto& frame : linearized_dataframes){ + hgcCellData_linampl_-> Fill(frame.second); + } + + // trigger cells part + + size_t nFEDigi = 0; + unsigned triggerCellModuleSum = 0; + for(const auto& tc : fe_payload.payload) { - uint32_t tcShifted = (tc<<2); - if(tcShifted>0) + uint32_t tcShifted = (tc<<2); + if(tcShifted>0) { - nFEDigi++; - triggerCellModuleSum += tcShifted; - triggerCellData_->Fill(tcShifted); + nFEDigi++; + triggerCellModuleSum += tcShifted; + triggerCellData_->Fill(tcShifted); } } - triggerCellsPerModule_->Fill(nFEDigi); - triggerCellModuleSum_->Fill(triggerCellModuleSum); -} - + triggerCellsPerModule_->Fill(nFEDigi); + triggerCellModuleSum_->Fill(triggerCellModuleSum); + } + //define this as a plug-in DEFINE_FWK_MODULE(HGCalTriggerBestChoiceTester); From 409eecd16bc6c5580e16245f6f3ac5bad2a5be1e Mon Sep 17 00:00:00 2001 From: Stephanie Date: Wed, 4 May 2016 09:59:17 +0200 Subject: [PATCH 06/43] linearized frames as input to trigger sum --- .../src/fe_codecs/HGCalBestChoiceCodecImpl.cc | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc b/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc index 1ddf6a75f30a9..6a109edffa488 100644 --- a/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc +++ b/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc @@ -116,48 +116,48 @@ void HGCalBestChoiceCodecImpl::linearize(const HGCalTriggerGeometry::Module& mod /*****************************************************************/ -void HGCalBestChoiceCodecImpl::triggerCellSums(const HGCalTriggerGeometry::Module& mod, const std::vector& dataframes, data_type& data) +void HGCalBestChoiceCodecImpl::triggerCellSums(const HGCalTriggerGeometry::Module& mod, std::vector >& linearized_dataframes, data_type& data) /*****************************************************************/ { std::map payload; // sum energies in trigger cells - for(const auto& frame : dataframes) - { + for(const auto& frame : linearized_dataframes) + { // FIXME: only EE - HGCEEDetId cellid(frame.id()); + HGCEEDetId cellid(frame.first); // find trigger cell associated to cell uint32_t tcid(0); for(const auto& tc_c : mod.triggerCellComponents()) - { + { if(tc_c.second==cellid) { - tcid = tc_c.first; + tcid = tc_c.first; break; } - } + } if(!tcid) - { + { throw cms::Exception("BadGeometry") - << "Cannot find trigger cell corresponding to HGC cell "<nCellsInModule_) // cell number starts at 1 - { + { throw cms::Exception("BadGeometry") - << "Number of trigger cells in module too large for available data payload\n"; - } + << "Number of trigger cells in module too large for available data payload\n"; + } data.payload.at(id-1) = id_value.second; - } + } } From 802d8378dbffe17510481e67e8a2c2c5cb2f9553 Mon Sep 17 00:00:00 2001 From: Stephanie Date: Wed, 4 May 2016 09:59:50 +0200 Subject: [PATCH 07/43] linearized frames as input to trigger sum + editing spaces --- .../interface/fe_codecs/HGCalBestChoiceCodecImpl.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h index b4d9c978d229c..e76c193a3d576 100644 --- a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h +++ b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h @@ -36,19 +36,19 @@ class HGCalBestChoiceCodecImpl void linearize(const HGCalTriggerGeometry::Module& , const std::vector&, std::vector >&); - void triggerCellSums(const HGCalTriggerGeometry::Module& , const std::vector&, data_type&); + void triggerCellSums(const HGCalTriggerGeometry::Module& , std::vector >&, data_type&); void bestChoiceSelect(data_type&); private: size_t nData_; size_t dataLength_; size_t nCellsInModule_; - double linLSB_; - double adcsaturation_; - uint32_t adcnBits_; - double tdcsaturation_ ; - uint32_t tdcnBits_ ; - double tdcOnsetfC_ ; + double linLSB_; + double adcsaturation_; + uint32_t adcnBits_; + double tdcsaturation_ ; + uint32_t tdcnBits_ ; + double tdcOnsetfC_ ; }; From 7c1af612a79f5bb6e9a221243ea9642b20929939 Mon Sep 17 00:00:00 2001 From: Stephanie Date: Wed, 4 May 2016 10:00:18 +0200 Subject: [PATCH 08/43] linearized frames as input to trigger sum --- L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc index dbc585cf2a994..e8f4c1c7da0e7 100644 --- a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc +++ b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc @@ -36,7 +36,7 @@ void HGCalBestChoiceCodec::setDataPayloadImpl(const Module& mod, std::vector > linearized_dataframes; codecImpl_.linearize(mod, dataframes, linearized_dataframes); // sum energy in trigger cells - codecImpl_.triggerCellSums(mod, dataframes, data_); + codecImpl_.triggerCellSums(mod, linearized_dataframes, data_); // choose best trigger cells in the module codecImpl_.bestChoiceSelect(data_); From 4c5376341e31fbdebf5ff180ea91834521ff3030 Mon Sep 17 00:00:00 2001 From: Stephanie Date: Wed, 4 May 2016 10:00:35 +0200 Subject: [PATCH 09/43] linearized frames as input to trigger sum + editing spaces --- L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc index 46f95ba313798..fd4890580147f 100644 --- a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc +++ b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc @@ -57,9 +57,7 @@ class HGCalTriggerBestChoiceTester : public edm::EDAnalyzer // histos TH1F* hgcCellsPerModule_; TH1F* hgcCellData_; - //steph TH1F* hgcCellData_linampl_; - // TH1F* hgcCellModuleSum_; TH1F* triggerCellsPerModule_; TH1F* triggerCellData_; @@ -150,12 +148,13 @@ void HGCalTriggerBestChoiceTester::analyze(const edm::Event& e, if(module.second->containsCell(eedata.id())) { dataframes.push_back(eedata); } - } + } + // Best choice encoding data.reset(); codec_->linearize(*(module.second), dataframes, linearized_dataframes); - codec_->triggerCellSums(*(module.second), dataframes, data); + codec_->triggerCellSums(*(module.second), linearized_dataframes, data); codec_->bestChoiceSelect(data); std::vector dataword = codec_->encode(data); HGCalBestChoiceDataPayload datadecoded = codec_->decode(dataword); From 40206df743062b4749403ab66911f283535c63c2 Mon Sep 17 00:00:00 2001 From: Stephanie Date: Mon, 9 May 2016 16:26:43 +0200 Subject: [PATCH 10/43] parameters taken from digitization --- .../hgcalTriggerPrimitiveDigiProducer_cfi.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py index 3872af0360315..78d85b66adee4 100644 --- a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py @@ -1,17 +1,21 @@ import FWCore.ParameterSet.Config as cms +import SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi as digiparam + fe_codec = cms.PSet( CodecName = cms.string('HGCalBestChoiceCodec'), CodecIndex = cms.uint32(1), NData = cms.uint32(12), DataLength = cms.uint32(8), linLSB = cms.double(100./1024.), - adcsaturation = cms.double(100), - adcnBits = cms.uint32(10), - tdcsaturation = cms.double(10000), - tdcnBits = cms.uint32(12), - tdcOnsetfC = cms.double(60) + #take the following parameters from the digitization config file + adcsaturation = digiparam.hgceeDigitizer.digiCfg.feCfg.adcSaturation_fC, + adcnBits = digiparam.hgceeDigitizer.digiCfg.feCfg.adcNbits, + tdcsaturation = digiparam.hgceeDigitizer.digiCfg.feCfg.tdcSaturation_fC, + tdcnBits = digiparam.hgceeDigitizer.digiCfg.feCfg.tdcNbits, + tdcOnsetfC = digiparam.hgceeDigitizer.digiCfg.feCfg.tdcOnset_fC ) + cluster_algo = cms.PSet( AlgorithmName = cms.string('FullModuleSumAlgo'), FECodec = fe_codec ) From 6d7d1f323f9b9082f852c390a97d38ccefab21c0 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Tue, 10 May 2016 18:27:02 +0200 Subject: [PATCH 11/43] Removing tabs --- .../fe_codecs/HGCalBestChoiceCodecImpl.h | 2 +- .../src/fe_codecs/HGCalBestChoiceCodecImpl.cc | 68 +++++------ .../test/HGCalTriggerBestChoiceTester.cc | 110 +++++++++--------- 3 files changed, 90 insertions(+), 90 deletions(-) diff --git a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h index e76c193a3d576..a8862254f7a59 100644 --- a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h +++ b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h @@ -34,7 +34,7 @@ class HGCalBestChoiceCodecImpl std::vector encode(const data_type&) const ; data_type decode(const std::vector&) const; - void linearize(const HGCalTriggerGeometry::Module& , const std::vector&, std::vector >&); + void linearize(const HGCalTriggerGeometry::Module& , const std::vector&, std::vector >&); void triggerCellSums(const HGCalTriggerGeometry::Module& , std::vector >&, data_type&); void bestChoiceSelect(data_type&); diff --git a/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc b/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc index 6a109edffa488..73a0041814e8e 100644 --- a/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc +++ b/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc @@ -91,27 +91,27 @@ HGCalBestChoiceCodecImpl::data_type HGCalBestChoiceCodecImpl::decode(const std:: void HGCalBestChoiceCodecImpl::linearize(const HGCalTriggerGeometry::Module& mod, const std::vector& dataframes, std::vector >& linearized_dataframes) /*****************************************************************/ { - double amplitude; uint32_t amplitude_int; - double adcLSB_ = adcsaturation_/pow(2.,adcnBits_); - double tdcLSB_ = tdcsaturation_/pow(2.,tdcnBits_); - - for(const auto& frame : dataframes) {//loop on DIGI - for(const auto& tc_c : mod.triggerCellComponents()) { //treat only the HG cells in the considered module - if(tc_c.second==frame.id()) { //treat if the DIGI detID is the same of the considered GC cell - if (frame[2].mode()) {//TOT mode - amplitude =( floor(tdcOnsetfC_/adcLSB_) + 1.0 )* adcLSB_ + double(frame[2].data()) * tdcLSB_; - } - else {//ADC mode - amplitude = double(frame[2].data()) * adcLSB_; - } - - amplitude_int = uint32_t (floor(amplitude/linLSB_+0.5)); - if (amplitude_int>65535) amplitude_int = 65535; - - linearized_dataframes.push_back(std::make_pair (frame.id(), amplitude_int)); - } + double amplitude; uint32_t amplitude_int; + double adcLSB_ = adcsaturation_/pow(2.,adcnBits_); + double tdcLSB_ = tdcsaturation_/pow(2.,tdcnBits_); + + for(const auto& frame : dataframes) {//loop on DIGI + for(const auto& tc_c : mod.triggerCellComponents()) { //treat only the HG cells in the considered module + if(tc_c.second==frame.id()) { //treat if the DIGI detID is the same of the considered GC cell + if (frame[2].mode()) {//TOT mode + amplitude =( floor(tdcOnsetfC_/adcLSB_) + 1.0 )* adcLSB_ + double(frame[2].data()) * tdcLSB_; + } + else {//ADC mode + amplitude = double(frame[2].data()) * adcLSB_; + } + + amplitude_int = uint32_t (floor(amplitude/linLSB_+0.5)); + if (amplitude_int>65535) amplitude_int = 65535; + + linearized_dataframes.push_back(std::make_pair (frame.id(), amplitude_int)); + } + } } - } } @@ -122,42 +122,42 @@ void HGCalBestChoiceCodecImpl::triggerCellSums(const HGCalTriggerGeometry::Modul std::map payload; // sum energies in trigger cells for(const auto& frame : linearized_dataframes) - { + { // FIXME: only EE HGCEEDetId cellid(frame.first); // find trigger cell associated to cell uint32_t tcid(0); for(const auto& tc_c : mod.triggerCellComponents()) - { + { if(tc_c.second==cellid) { - tcid = tc_c.first; + tcid = tc_c.first; break; } - } + } if(!tcid) - { + { throw cms::Exception("BadGeometry") - << "Cannot find trigger cell corresponding to HGC cell "<nCellsInModule_) // cell number starts at 1 - { + { throw cms::Exception("BadGeometry") - << "Number of trigger cells in module too large for available data payload\n"; - } + << "Number of trigger cells in module too large for available data payload\n"; + } data.payload.at(id-1) = id_value.second; - } + } } diff --git a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc index fd4890580147f..cc7398d84d2b8 100644 --- a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc +++ b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc @@ -126,41 +126,41 @@ void HGCalTriggerBestChoiceTester::beginRun(const edm::Run& /*run*/, /*****************************************************************/ void HGCalTriggerBestChoiceTester::analyze(const edm::Event& e, - const edm::EventSetup& es) + const edm::EventSetup& es) /*****************************************************************/ { edm::Handle ee_digis_h; e.getByToken(inputee_,ee_digis_h); const HGCEEDigiCollection& ee_digis = *ee_digis_h; - + HGCalBestChoiceDataPayload data; - - + + //loop on modules - for( const auto& module : triggerGeometry_->modules() ) { - // prepare input data - std::vector dataframes; - vector > linearized_dataframes; - - for(const auto& eedata : ee_digis) { - if(module.second->containsCell(eedata.id())) { - dataframes.push_back(eedata); - } - } - - - // Best choice encoding - data.reset(); - codec_->linearize(*(module.second), dataframes, linearized_dataframes); - codec_->triggerCellSums(*(module.second), linearized_dataframes, data); - codec_->bestChoiceSelect(data); - std::vector dataword = codec_->encode(data); - HGCalBestChoiceDataPayload datadecoded = codec_->decode(dataword); - fillModule(dataframes, datadecoded, linearized_dataframes); + for( const auto& module : triggerGeometry_->modules() ) { + // prepare input data + std::vector dataframes; + vector > linearized_dataframes; + + for(const auto& eedata : ee_digis) { + if(module.second->containsCell(eedata.id())) { + dataframes.push_back(eedata); + } + } + + + // Best choice encoding + data.reset(); + codec_->linearize(*(module.second), dataframes, linearized_dataframes); + codec_->triggerCellSums(*(module.second), linearized_dataframes, data); + codec_->bestChoiceSelect(data); + std::vector dataword = codec_->encode(data); + HGCalBestChoiceDataPayload datadecoded = codec_->decode(dataword); + fillModule(dataframes, datadecoded, linearized_dataframes); } //end loop on modules - + } @@ -168,43 +168,43 @@ void HGCalTriggerBestChoiceTester::analyze(const edm::Event& e, void HGCalTriggerBestChoiceTester::fillModule( const std::vector& dataframes, const HGCalBestChoiceDataPayload& fe_payload, vector >& linearized_dataframes) /*****************************************************************/ { - // HGC cells part - size_t nHGCDigi = 0; - unsigned hgcCellModuleSum = 0; - for(const auto& frame : dataframes) + // HGC cells part + size_t nHGCDigi = 0; + unsigned hgcCellModuleSum = 0; + for(const auto& frame : dataframes) { - uint32_t value = frame[2].data(); - if(value>0) + uint32_t value = frame[2].data(); + if(value>0) { - nHGCDigi++; - hgcCellModuleSum += value; - hgcCellData_->Fill(value); + nHGCDigi++; + hgcCellModuleSum += value; + hgcCellData_->Fill(value); } } - hgcCellsPerModule_->Fill(nHGCDigi); - hgcCellModuleSum_->Fill(hgcCellModuleSum); - - for(const auto& frame : linearized_dataframes){ - hgcCellData_linampl_-> Fill(frame.second); - } - - // trigger cells part - - size_t nFEDigi = 0; - unsigned triggerCellModuleSum = 0; - for(const auto& tc : fe_payload.payload) + hgcCellsPerModule_->Fill(nHGCDigi); + hgcCellModuleSum_->Fill(hgcCellModuleSum); + + for(const auto& frame : linearized_dataframes){ + hgcCellData_linampl_-> Fill(frame.second); + } + + // trigger cells part + + size_t nFEDigi = 0; + unsigned triggerCellModuleSum = 0; + for(const auto& tc : fe_payload.payload) { - uint32_t tcShifted = (tc<<2); - if(tcShifted>0) + uint32_t tcShifted = (tc<<2); + if(tcShifted>0) { - nFEDigi++; - triggerCellModuleSum += tcShifted; - triggerCellData_->Fill(tcShifted); + nFEDigi++; + triggerCellModuleSum += tcShifted; + triggerCellData_->Fill(tcShifted); } } - triggerCellsPerModule_->Fill(nFEDigi); - triggerCellModuleSum_->Fill(triggerCellModuleSum); - } - + triggerCellsPerModule_->Fill(nFEDigi); + triggerCellModuleSum_->Fill(triggerCellModuleSum); +} + //define this as a plug-in DEFINE_FWK_MODULE(HGCalTriggerBestChoiceTester); From 8608223170443644f74718ac5d7e17e161163e92 Mon Sep 17 00:00:00 2001 From: Stephanie Date: Wed, 11 May 2016 15:13:47 +0200 Subject: [PATCH 12/43] updates for 810_pre3 --- .../test/testHGCalL1TBestChoice_cfg.py | 42 +++++++++++++------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py b/L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py index 8f79f81a7ca6d..141b90b3c1fec 100644 --- a/L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py +++ b/L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py @@ -1,17 +1,16 @@ import FWCore.ParameterSet.Config as cms -process = cms.Process('SIMDIGI') +from Configuration.StandardSequences.Eras import eras + +process = cms.Process('DIGI',eras.Phase2) # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') -process.load('FWCore.MessageService.MessageLogger_cfi') -process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.Geometry.GeometryExtended2023HGCalMuonReco_cff') -process.load('Configuration.Geometry.GeometryExtended2023HGCalMuon_cff') +process.load('Configuration.Geometry.GeometryExtended2023LRecoReco_cff') process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedGauss_cfi') @@ -43,14 +42,22 @@ # Output definition -process.FEVTDEBUGHLToutput = cms.OutputModule("PoolOutputModule", +process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", splitLevel = cms.untracked.int32(0), eventAutoFlushCompressedSize = cms.untracked.int32(5242880), - outputCommands = process.FEVTDEBUGHLTEventContent.outputCommands, + # outputCommands = process.FEVTDEBUGEventContent.outputCommands, fileName = cms.untracked.string('file:junk.root'), dataset = cms.untracked.PSet( filterName = cms.untracked.string(''), dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW') + ), + outputCommands = cms.untracked.vstring( + 'drop *', + 'keep *_*_HGCHitsEE_*', + 'keep *_*_HGCHitsHEback_*', + 'keep *_*_HGCHitsHEfront_*', + 'keep *_mix_*_*', + 'keep *_genParticles_*_*' ), SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('generation_step') @@ -68,7 +75,7 @@ # Other statements process.genstepfilter.triggerConditions=cms.vstring("generation_step") from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgradePLS3', '') +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '') process.generator = cms.EDProducer("FlatRandomPtGunProducer", PGunParameters = cms.PSet( @@ -96,6 +103,8 @@ process.digitisation_step = cms.Path(process.pdigi_valid) process.L1simulation_step = cms.Path(process.SimL1Emulator) process.digi2raw_step = cms.Path(process.DigiToRaw) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) process.hgcaltriggerbestchoicetester = cms.EDAnalyzer( "HGCalTriggerBestChoiceTester", @@ -112,13 +121,20 @@ FECodec = cms.PSet( CodecName = cms.string('HGCalBestChoiceCodec'), CodecIndex = cms.uint32(1), NData = cms.uint32(12), - DataLength = cms.uint32(8) + DataLength = cms.uint32(8), + linLSB = cms.double(100./1024.), + adcsaturation = cms.double(100), + adcnBits = cms.uint32(10), + tdcsaturation = cms.double(10000), + tdcnBits = cms.uint32(12), + tdcOnsetfC = cms.double(60) ) ) process.test_step = cms.Path(process.hgcaltriggerbestchoicetester) # Schedule definition -process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.digitisation_step,process.L1simulation_step,process.digi2raw_step,process.test_step) +process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.digitisation_step,process.L1simulation_step,process.digi2raw_step,process.test_step,process.endjob_step,process.FEVTDEBUGoutput_step) + # filter all path with the production filter sequence for path in process.paths: getattr(process,path)._seq = process.generator * getattr(process,path)._seq @@ -126,12 +142,12 @@ # customisation of the process. # Automatic addition of the customisation function from SLHCUpgradeSimulations.Configuration.combinedCustoms -from SLHCUpgradeSimulations.Configuration.combinedCustoms import cust_2023HGCalMuon +from SLHCUpgradeSimulations.Configuration.combinedCustoms import cust_2023LReco #call to customisation function cust_2023HGCalMuon imported from SLHCUpgradeSimulations.Configuration.combinedCustoms -process = cust_2023HGCalMuon(process) +process = cust_2023LReco(process) # End of customisation functions -process.ProfilerService = cms.Service("ProfilerService", firstEvent=cms.untracked.int32(0), lastEvent=cms.untracked.int32(2), paths=cms.untracked.vstring(["test_step"])) +#process.ProfilerService = cms.Service("ProfilerService", firstEvent=cms.untracked.int32(0), lastEvent=cms.untracked.int32(2), paths=cms.untracked.vstring(["test_step"])) From 14b2e9102cd788ccd34a4577e0afa9b3f802f507 Mon Sep 17 00:00:00 2001 From: Stephanie Date: Thu, 12 May 2016 11:11:43 +0200 Subject: [PATCH 13/43] cleaning details --- .../L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc b/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc index 73a0041814e8e..c458514aab149 100644 --- a/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc +++ b/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc @@ -16,6 +16,8 @@ HGCalBestChoiceCodecImpl::HGCalBestChoiceCodecImpl(const edm::ParameterSet& conf tdcOnsetfC_(conf.getParameter("tdcOnsetfC")) /*****************************************************************/ { + adcLSB_ = adcsaturation_/pow(2.,adcnBits_); + tdcLSB_ = tdcsaturation_/pow(2.,tdcnBits_); } @@ -92,8 +94,7 @@ void HGCalBestChoiceCodecImpl::linearize(const HGCalTriggerGeometry::Module& mod /*****************************************************************/ { double amplitude; uint32_t amplitude_int; - double adcLSB_ = adcsaturation_/pow(2.,adcnBits_); - double tdcLSB_ = tdcsaturation_/pow(2.,tdcnBits_); + for(const auto& frame : dataframes) {//loop on DIGI for(const auto& tc_c : mod.triggerCellComponents()) { //treat only the HG cells in the considered module @@ -116,7 +117,7 @@ void HGCalBestChoiceCodecImpl::linearize(const HGCalTriggerGeometry::Module& mod /*****************************************************************/ -void HGCalBestChoiceCodecImpl::triggerCellSums(const HGCalTriggerGeometry::Module& mod, std::vector >& linearized_dataframes, data_type& data) +void HGCalBestChoiceCodecImpl::triggerCellSums(const HGCalTriggerGeometry::Module& mod, const std::vector >& linearized_dataframes, data_type& data) /*****************************************************************/ { std::map payload; From 8a3db57ec1bb0ca45c91052a6688739a5602eb07 Mon Sep 17 00:00:00 2001 From: Stephanie Date: Thu, 12 May 2016 11:11:58 +0200 Subject: [PATCH 14/43] cleaning details --- .../L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h index a8862254f7a59..b92788afd0bb2 100644 --- a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h +++ b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h @@ -36,7 +36,7 @@ class HGCalBestChoiceCodecImpl void linearize(const HGCalTriggerGeometry::Module& , const std::vector&, std::vector >&); - void triggerCellSums(const HGCalTriggerGeometry::Module& , std::vector >&, data_type&); + void triggerCellSums(const HGCalTriggerGeometry::Module& , const std::vector >&, data_type&); void bestChoiceSelect(data_type&); private: @@ -49,6 +49,8 @@ class HGCalBestChoiceCodecImpl double tdcsaturation_ ; uint32_t tdcnBits_ ; double tdcOnsetfC_ ; + double adcLSB_; + double tdcLSB_; }; From 03f93c88fdac3cf98eed87bebfc5b3c683b4458b Mon Sep 17 00:00:00 2001 From: Stephanie Date: Thu, 12 May 2016 11:12:57 +0200 Subject: [PATCH 15/43] cleaning details --- L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc index cc7398d84d2b8..0a008f95fca39 100644 --- a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc +++ b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc @@ -47,7 +47,7 @@ class HGCalTriggerBestChoiceTester : public edm::EDAnalyzer private: - void fillModule(const std::vector&, const HGCalBestChoiceDataPayload&, vector >& ); + void fillModule(const std::vector&, const HGCalBestChoiceDataPayload&, const vector >& ); // inputs edm::EDGetToken inputee_, inputfh_, inputbh_; // @@ -165,7 +165,7 @@ void HGCalTriggerBestChoiceTester::analyze(const edm::Event& e, /*****************************************************************/ -void HGCalTriggerBestChoiceTester::fillModule( const std::vector& dataframes, const HGCalBestChoiceDataPayload& fe_payload, vector >& linearized_dataframes) +void HGCalTriggerBestChoiceTester::fillModule( const std::vector& dataframes, const HGCalBestChoiceDataPayload& fe_payload, const vector >& linearized_dataframes) /*****************************************************************/ { // HGC cells part From 30cf5a3efcd09d863d3c31a626a19f403586bf8a Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Mon, 9 May 2016 15:19:48 +0200 Subject: [PATCH 16/43] Add hex trigger geometry --- .../geometries/HGCalTriggerGeometryHexImp1.cc | 156 ++++++++++++++++++ .../L1THGCal/test/HGCalTriggerGeomTester.cc | 112 ++++++------- .../L1THGCal/test/testHGCalL1TGeometry_cfg.py | 35 ++-- 3 files changed, 228 insertions(+), 75 deletions(-) create mode 100644 L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc diff --git a/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc b/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc new file mode 100644 index 0000000000000..785d44cc54eb6 --- /dev/null +++ b/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc @@ -0,0 +1,156 @@ +#include "FWCore/ParameterSet/interface/FileInPath.h" + +#include "L1Trigger/L1THGCal/interface/HGCalTriggerGeometryBase.h" +#include "DataFormats/ForwardDetId/interface/HGCTriggerDetId.h" + +#include +#include +#include + + +class HGCalTriggerGeometryHexImp1 : public HGCalTriggerGeometryBase +{ + public: + HGCalTriggerGeometryHexImp1(const edm::ParameterSet& conf); + + virtual void initialize(const es_info& ) override final; + + private: + edm::FileInPath l1tCellsMapping_; + edm::FileInPath l1tModulesMapping_; +}; + + +/*****************************************************************/ +HGCalTriggerGeometryHexImp1::HGCalTriggerGeometryHexImp1(const edm::ParameterSet& conf): + HGCalTriggerGeometryBase(conf), + l1tCellsMapping_(conf.getParameter("L1TCellsMapping")), + l1tModulesMapping_(conf.getParameter("L1TModulesMapping")) +/*****************************************************************/ +{ +} + + +/*****************************************************************/ +void HGCalTriggerGeometryHexImp1::initialize(const es_info& esInfo) +/*****************************************************************/ +{ + // FIXME: !!!Only for HGCEE for the moment!!! + edm::LogWarning("HGCalTriggerGeometry") << "WARNING: This HGCal trigger geometry is incomplete.\n"\ + << "WARNING: Only the EE part is covered.\n"\ + << "WARNING: There is no neighbor information.\n"; + // + // read module mapping file + std::map wafer_to_module; + std::ifstream l1tModulesMappingStream(l1tModulesMapping_.fullPath()); + if(!l1tModulesMappingStream.is_open()) edm::LogError("HGCalTriggerGeometry") << "Cannot open L1TModulesMapping file\n"; + short wafer = 0; + short module = 0; + for(; l1tModulesMappingStream>>wafer>>module; ) + { + wafer_to_module[wafer] = module; + } + l1tModulesMappingStream.close(); + // + // read trigger cell mapping file + std::map, short> cells_to_trigger_cells; + std::ifstream l1tCellsMappingStream(l1tCellsMapping_.fullPath()); + if(!l1tCellsMappingStream.is_open()) edm::LogError("HGCalTriggerGeometry") << "Cannot open L1TCellsMapping file\n"; + short wafertype = 0; + short cell = 0; + short triggercell = 0; + for(; l1tCellsMappingStream>>wafertype>>cell>>triggercell; ) + { + cells_to_trigger_cells[std::make_pair((wafertype?1:-1),cell)] = triggercell; + } + //if(!l1tCellsMappingStream.eof()) edm::LogWarning("HGCalTriggerGeometry") << "Error reading L1TCellsMapping'"<getValidGeomDetIds()) + { + if(id.rawId()==0) continue; + HGCalDetId waferid(id); + short module = wafer_to_module[waferid.wafer()]; + int nCells = esInfo.topo_ee->dddConstants().numberCellsHexagon(waferid.wafer()); + for(int i=0;i trigger cell mapping + HGCalDetId cellid(ForwardSubdetector(waferid.subdetId()), waferid.zside(), waferid.layer(), waferid.waferType(), waferid.wafer(), i); + HGCalDetId triggerDetid(ForwardSubdetector(waferid.subdetId()), waferid.zside(), waferid.layer(), waferid.waferType(), waferid.wafer(), triggercell); + cells_to_trigger_cells_.insert( std::make_pair(cellid, triggerDetid) ); + // Fill trigger cell -> module mapping + HGCalDetId moduleDetid(ForwardSubdetector(waferid.subdetId()), waferid.zside(), waferid.layer(), waferid.waferType(), module, HGCalDetId::kHGCalCellMask); + trigger_cells_to_modules_.insert( std::make_pair(triggerDetid, moduleDetid) ); // do nothing if trigger cell has already been inserted + } + } + // + // Build trigger cells and fill map + typedef HGCalTriggerGeometry::TriggerCell::list_type list_cells; + // make list of cells in trigger cells + std::map trigger_cells_to_cells; + for(const auto& cell_triggercell : cells_to_trigger_cells_) + { + unsigned cell = cell_triggercell.first; + unsigned triggercell = cell_triggercell.second; + trigger_cells_to_cells.insert( std::make_pair(triggercell, list_cells()) ); + trigger_cells_to_cells.at(triggercell).insert(cell); + } + for(const auto& triggercell_cells : trigger_cells_to_cells) + { + unsigned triggercellId = triggercell_cells.first; + list_cells cellIds = triggercell_cells.second; + // Position: for the moment, barycenter of the trigger cell. + Basic3DVector triggercellVector(0.,0.,0.); + for(const auto& cell : cellIds) + { + HGCalDetId cellId(cell); + triggercellVector += esInfo.geom_ee->getPosition(cellId).basicVector(); + } + GlobalPoint triggercellPoint( triggercellVector/cellIds.size() ); + const auto& tc2mItr = trigger_cells_to_modules_.find(triggercellId); + unsigned moduleId = (tc2mItr!=trigger_cells_to_modules_.end() ? tc2mItr->second : 0); // 0 if the trigger cell doesn't belong to a module + //unsigned moduleId = trigger_cells_to_modules_.at(triggercellId); + // FIXME: empty neighbours + std::unique_ptr triggercellPtr(new HGCalTriggerGeometry::TriggerCell(triggercellId, moduleId, triggercellPoint, list_cells(), cellIds)); + trigger_cells_.insert( std::make_pair(triggercellId, std::move(triggercellPtr)) ); + } + // + // Build modules and fill map + typedef HGCalTriggerGeometry::Module::list_type list_triggercells; + typedef HGCalTriggerGeometry::Module::tc_map_type tc_map_to_cells; + // make list of trigger cells in modules + std::map modules_to_trigger_cells; + for(const auto& triggercell_module : trigger_cells_to_modules_) + { + unsigned triggercell = triggercell_module.first; + unsigned module = triggercell_module.second; + modules_to_trigger_cells.insert( std::make_pair(module, list_triggercells()) ); + modules_to_trigger_cells.at(module).insert(triggercell); + } + for(const auto& module_triggercell : modules_to_trigger_cells) + { + unsigned moduleId = module_triggercell.first; + list_triggercells triggercellIds = module_triggercell.second; + tc_map_to_cells cellsInTriggerCells; + // Position: for the moment, barycenter of the module, from trigger cell positions + Basic3DVector moduleVector(0.,0.,0.); + for(const auto& triggercell : triggercellIds) + { + const auto& cells_in_tc = trigger_cells_to_cells.at(triggercell); + for( const unsigned cell : cells_in_tc ) + { + cellsInTriggerCells.emplace(triggercell,cell); + } + moduleVector += trigger_cells_.at(triggercell)->position().basicVector(); + } + GlobalPoint modulePoint( moduleVector/triggercellIds.size() ); + // FIXME: empty neighbours + std::unique_ptr modulePtr(new HGCalTriggerGeometry::Module(moduleId, modulePoint, list_triggercells(), triggercellIds, cellsInTriggerCells)); + modules_.insert( std::make_pair(moduleId, std::move(modulePtr)) ); + } +} + + +DEFINE_EDM_PLUGIN(HGCalTriggerGeometryFactory, + HGCalTriggerGeometryHexImp1, + "HGCalTriggerGeometryHexImp1"); diff --git a/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc b/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc index e9278ea12eed7..6a5864764420c 100644 --- a/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc +++ b/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc @@ -60,7 +60,6 @@ class HGCalTriggerGeomTester : public edm::EDAnalyzer int moduleId_ ; int moduleSide_ ; int moduleLayer_ ; - int moduleSector_ ; int module_ ; float moduleX_ ; float moduleY_ ; @@ -69,7 +68,7 @@ class HGCalTriggerGeomTester : public edm::EDAnalyzer std::shared_ptr moduleTC_id_ ; std::shared_ptr moduleTC_zside_ ; std::shared_ptr moduleTC_layer_ ; - std::shared_ptr moduleTC_sector_; + std::shared_ptr moduleTC_wafer_; std::shared_ptr moduleTC_cell_ ; std::shared_ptr moduleTC_x_ ; std::shared_ptr moduleTC_y_ ; @@ -77,8 +76,7 @@ class HGCalTriggerGeomTester : public edm::EDAnalyzer int triggerCellId_ ; int triggerCellSide_ ; int triggerCellLayer_ ; - int triggerCellSector_ ; - int triggerCellModule_ ; + int triggerCellWafer_ ; int triggerCell_ ; float triggerCellX_ ; float triggerCellY_ ; @@ -87,7 +85,7 @@ class HGCalTriggerGeomTester : public edm::EDAnalyzer std::shared_ptr triggerCellCell_id_ ; std::shared_ptr triggerCellCell_zside_ ; std::shared_ptr triggerCellCell_layer_ ; - std::shared_ptr triggerCellCell_sector_; + std::shared_ptr triggerCellCell_wafer_; std::shared_ptr triggerCellCell_cell_ ; std::shared_ptr triggerCellCell_x_ ; std::shared_ptr triggerCellCell_y_ ; @@ -95,7 +93,7 @@ class HGCalTriggerGeomTester : public edm::EDAnalyzer int cellId_ ; int cellSide_ ; int cellLayer_ ; - int cellSector_ ; + int cellWafer_ ; int cell_ ; float cellX_ ; float cellY_ ; @@ -108,7 +106,7 @@ class HGCalTriggerGeomTester : public edm::EDAnalyzer float cellY3_ ; float cellX4_ ; float cellY4_ ; - // + }; @@ -127,7 +125,6 @@ HGCalTriggerGeomTester::HGCalTriggerGeomTester(const edm::ParameterSet& conf) treeModules_->Branch("id" , &moduleId_ , "id/I"); treeModules_->Branch("zside" , &moduleSide_ , "zside/I"); treeModules_->Branch("layer" , &moduleLayer_ , "layer/I"); - treeModules_->Branch("sector" , &moduleSector_ , "sector/I"); treeModules_->Branch("module" , &module_ , "module/I"); treeModules_->Branch("x" , &moduleX_ , "x/F"); treeModules_->Branch("y" , &moduleY_ , "y/F"); @@ -136,7 +133,7 @@ HGCalTriggerGeomTester::HGCalTriggerGeomTester(const edm::ParameterSet& conf) moduleTC_id_ .reset(new int[1], array_deleter()); moduleTC_zside_ .reset(new int[1], array_deleter()); moduleTC_layer_ .reset(new int[1], array_deleter()); - moduleTC_sector_.reset(new int[1], array_deleter()); + moduleTC_wafer_ .reset(new int[1], array_deleter()); moduleTC_cell_ .reset(new int[1], array_deleter()); moduleTC_x_ .reset(new float[1], array_deleter()); moduleTC_y_ .reset(new float[1], array_deleter()); @@ -144,7 +141,7 @@ HGCalTriggerGeomTester::HGCalTriggerGeomTester(const edm::ParameterSet& conf) treeModules_->Branch("tc_id" , moduleTC_id_.get() , "tc_id[tc_n]/I"); treeModules_->Branch("tc_zside" , moduleTC_zside_.get() , "tc_zside[tc_n]/I"); treeModules_->Branch("tc_layer" , moduleTC_layer_.get() , "tc_layer[tc_n]/I"); - treeModules_->Branch("tc_sector" , moduleTC_sector_.get() , "tc_sector[tc_n]/I"); + treeModules_->Branch("tc_wafer" , moduleTC_wafer_.get() , "tc_wafer[tc_n]/I"); treeModules_->Branch("tc_cell" , moduleTC_cell_.get() , "tc_cell[tc_n]/I"); treeModules_->Branch("tc_x" , moduleTC_x_.get() , "tc_x[tc_n]/F"); treeModules_->Branch("tc_y" , moduleTC_y_.get() , "tc_y[tc_n]/F"); @@ -154,7 +151,7 @@ HGCalTriggerGeomTester::HGCalTriggerGeomTester(const edm::ParameterSet& conf) treeTriggerCells_->Branch("id" , &triggerCellId_ , "id/I"); treeTriggerCells_->Branch("zside" , &triggerCellSide_ , "zside/I"); treeTriggerCells_->Branch("layer" , &triggerCellLayer_ , "layer/I"); - treeTriggerCells_->Branch("sector" , &triggerCellSector_ , "sector/I"); + treeTriggerCells_->Branch("wafer" , &triggerCellWafer_ , "wafer/I"); treeTriggerCells_->Branch("module" , &triggerCellModule_ , "module/I"); treeTriggerCells_->Branch("triggercell" , &triggerCell_ , "triggercell/I"); treeTriggerCells_->Branch("x" , &triggerCellX_ , "x/F"); @@ -164,7 +161,7 @@ HGCalTriggerGeomTester::HGCalTriggerGeomTester(const edm::ParameterSet& conf) triggerCellCell_id_ .reset(new int[1], array_deleter()); triggerCellCell_zside_ .reset(new int[1], array_deleter()); triggerCellCell_layer_ .reset(new int[1], array_deleter()); - triggerCellCell_sector_.reset(new int[1], array_deleter()); + triggerCellCell_wafer_ .reset(new int[1], array_deleter()); triggerCellCell_cell_ .reset(new int[1], array_deleter()); triggerCellCell_x_ .reset(new float[1], array_deleter()); triggerCellCell_y_ .reset(new float[1], array_deleter()); @@ -172,7 +169,7 @@ HGCalTriggerGeomTester::HGCalTriggerGeomTester(const edm::ParameterSet& conf) treeTriggerCells_->Branch("c_id" , triggerCellCell_id_.get() , "c_id[c_n]/I"); treeTriggerCells_->Branch("c_zside" , triggerCellCell_zside_.get() , "c_zside[c_n]/I"); treeTriggerCells_->Branch("c_layer" , triggerCellCell_layer_.get() , "c_layer[c_n]/I"); - treeTriggerCells_->Branch("c_sector" , triggerCellCell_sector_.get() , "c_sector[c_n]/I"); + treeTriggerCells_->Branch("c_wafer" , triggerCellCell_wafer_.get() , "c_wafer[c_n]/I"); treeTriggerCells_->Branch("c_cell" , triggerCellCell_cell_.get() , "c_cell[c_n]/I"); treeTriggerCells_->Branch("c_x" , triggerCellCell_x_.get() , "c_x[c_n]/F"); treeTriggerCells_->Branch("c_y" , triggerCellCell_y_.get() , "c_y[c_n]/F"); @@ -182,7 +179,7 @@ HGCalTriggerGeomTester::HGCalTriggerGeomTester(const edm::ParameterSet& conf) treeCells_->Branch("id" , &cellId_ , "id/I"); treeCells_->Branch("zside" , &cellSide_ , "zside/I"); treeCells_->Branch("layer" , &cellLayer_ , "layer/I"); - treeCells_->Branch("sector" , &cellSector_ , "sector/I"); + treeCells_->Branch("wafer" , &cellWafer_ , "wafer/I"); treeCells_->Branch("cell" , &cell_ , "cell/I"); treeCells_->Branch("x" , &cellX_ , "x/F"); treeCells_->Branch("y" , &cellY_ , "y/F"); @@ -235,13 +232,12 @@ void HGCalTriggerGeomTester::fillTriggerGeometry(const HGCalTriggerGeometryBase: std::cout<<"Filling modules tree\n"; for( const auto& id_module : triggerGeometry_->modules() ) { - HGCTriggerDetId id(id_module.first); + HGCalDetId id(id_module.first); const auto& modulePtr = id_module.second; moduleId_ = id.rawId(); moduleSide_ = id.zside(); moduleLayer_ = id.layer(); - moduleSector_ = id.sector(); - module_ = id.module(); + module_ = id.wafer(); moduleX_ = modulePtr->position().x(); moduleY_ = modulePtr->position().y(); moduleZ_ = modulePtr->position().z(); @@ -251,12 +247,12 @@ void HGCalTriggerGeomTester::fillTriggerGeometry(const HGCalTriggerGeometryBase: size_t itc = 0; for(const auto& tc : modulePtr->components()) { - HGCTriggerDetId tcId(tc); + HGCalDetId tcId(tc); const auto& triggerCell = triggerGeometry_->triggerCells().at(tc); moduleTC_id_ .get()[itc] = tc; moduleTC_zside_ .get()[itc] = tcId.zside(); moduleTC_layer_ .get()[itc] = tcId.layer(); - moduleTC_sector_.get()[itc] = tcId.sector(); + moduleTC_wafer_ .get()[itc] = tcId.wafer(); moduleTC_cell_ .get()[itc] = tcId.cell(); moduleTC_x_ .get()[itc] = triggerCell->position().x(); moduleTC_y_ .get()[itc] = triggerCell->position().y(); @@ -270,12 +266,12 @@ void HGCalTriggerGeomTester::fillTriggerGeometry(const HGCalTriggerGeometryBase: std::cout<<"Filling trigger cells tree\n"; for( const auto& id_triggercell : triggerGeometry_->triggerCells() ) { - HGCTriggerDetId id(id_triggercell.first); + HGCalDetId id(id_triggercell.first); const auto& triggerCellPtr = id_triggercell.second; triggerCellId_ = id.rawId(); triggerCellSide_ = id.zside(); triggerCellLayer_ = id.layer(); - triggerCellSector_ = id.sector(); + triggerCellWafer_ = id.wafer(); triggerCellModule_ = id.module(); triggerCell_ = id.cell(); triggerCellX_ = triggerCellPtr->position().x(); @@ -287,12 +283,12 @@ void HGCalTriggerGeomTester::fillTriggerGeometry(const HGCalTriggerGeometryBase: size_t ic = 0; for(const auto& c : triggerCellPtr->components()) { - HGCEEDetId cId(c); + HGCalDetId cId(c); GlobalPoint position = info.geom_ee->getPosition(cId); triggerCellCell_id_ .get()[ic] = c; triggerCellCell_zside_ .get()[ic] = cId.zside(); triggerCellCell_layer_ .get()[ic] = cId.layer(); - triggerCellCell_sector_.get()[ic] = cId.sector(); + triggerCellCell_wafer_ .get()[ic] = cId.wafer(); triggerCellCell_cell_ .get()[ic] = cId.cell(); triggerCellCell_x_ .get()[ic] = position.x(); triggerCellCell_y_ .get()[ic] = position.y(); @@ -320,7 +316,7 @@ void HGCalTriggerGeomTester::fillTriggerGeometry(const HGCalTriggerGeometryBase: cellId_ = id.rawId(); cellSide_ = id.zside(); cellLayer_ = id.layer(); - cellSector_ = id.sector(); + cellWafer_ = id.wafer(); cell_ = id.cell(); GlobalPoint center = info.geom_ee->getPosition(id); cellX_ = center.x(); @@ -361,46 +357,46 @@ void HGCalTriggerGeomTester::analyze(const edm::Event& e, void HGCalTriggerGeomTester::setTreeModuleSize(const size_t n) /*****************************************************************/ { - moduleTC_id_ .reset(new int[n], array_deleter()); - moduleTC_zside_ .reset(new int[n], array_deleter()); - moduleTC_layer_ .reset(new int[n], array_deleter()); - moduleTC_sector_.reset(new int[n], array_deleter()); - moduleTC_cell_ .reset(new int[n], array_deleter()); - moduleTC_x_ .reset(new float[n], array_deleter()); - moduleTC_y_ .reset(new float[n], array_deleter()); - moduleTC_z_ .reset(new float[n], array_deleter()); - - treeModules_->GetBranch("tc_id") ->SetAddress(moduleTC_id_ .get()); - treeModules_->GetBranch("tc_zside") ->SetAddress(moduleTC_zside_ .get()); - treeModules_->GetBranch("tc_layer") ->SetAddress(moduleTC_layer_ .get()); - treeModules_->GetBranch("tc_sector") ->SetAddress(moduleTC_sector_.get()); - treeModules_->GetBranch("tc_cell") ->SetAddress(moduleTC_cell_ .get()); - treeModules_->GetBranch("tc_x") ->SetAddress(moduleTC_x_ .get()); - treeModules_->GetBranch("tc_y") ->SetAddress(moduleTC_y_ .get()); - treeModules_->GetBranch("tc_z") ->SetAddress(moduleTC_z_ .get()); + //moduleTC_id_ .reset(new int[n], array_deleter()); + //moduleTC_zside_ .reset(new int[n], array_deleter()); + //moduleTC_layer_ .reset(new int[n], array_deleter()); + //moduleTC_sector_.reset(new int[n], array_deleter()); + //moduleTC_cell_ .reset(new int[n], array_deleter()); + //moduleTC_x_ .reset(new float[n], array_deleter()); + //moduleTC_y_ .reset(new float[n], array_deleter()); + //moduleTC_z_ .reset(new float[n], array_deleter()); + + //treeModules_->GetBranch("tc_id") ->SetAddress(moduleTC_id_ .get()); + //treeModules_->GetBranch("tc_zside") ->SetAddress(moduleTC_zside_ .get()); + //treeModules_->GetBranch("tc_layer") ->SetAddress(moduleTC_layer_ .get()); + //treeModules_->GetBranch("tc_sector") ->SetAddress(moduleTC_sector_.get()); + //treeModules_->GetBranch("tc_cell") ->SetAddress(moduleTC_cell_ .get()); + //treeModules_->GetBranch("tc_x") ->SetAddress(moduleTC_x_ .get()); + //treeModules_->GetBranch("tc_y") ->SetAddress(moduleTC_y_ .get()); + //treeModules_->GetBranch("tc_z") ->SetAddress(moduleTC_z_ .get()); } /*****************************************************************/ void HGCalTriggerGeomTester::setTreeTriggerCellSize(const size_t n) /*****************************************************************/ { - triggerCellCell_id_ .reset(new int[n], array_deleter()); - triggerCellCell_zside_ .reset(new int[n], array_deleter()); - triggerCellCell_layer_ .reset(new int[n], array_deleter()); - triggerCellCell_sector_.reset(new int[n], array_deleter()); - triggerCellCell_cell_ .reset(new int[n], array_deleter()); - triggerCellCell_x_ .reset(new float[n], array_deleter()); - triggerCellCell_y_ .reset(new float[n], array_deleter()); - triggerCellCell_z_ .reset(new float[n], array_deleter()); - - treeTriggerCells_->GetBranch("c_id") ->SetAddress(triggerCellCell_id_ .get()); - treeTriggerCells_->GetBranch("c_zside") ->SetAddress(triggerCellCell_zside_ .get()); - treeTriggerCells_->GetBranch("c_layer") ->SetAddress(triggerCellCell_layer_ .get()); - treeTriggerCells_->GetBranch("c_sector") ->SetAddress(triggerCellCell_sector_.get()); - treeTriggerCells_->GetBranch("c_cell") ->SetAddress(triggerCellCell_cell_ .get()); - treeTriggerCells_->GetBranch("c_x") ->SetAddress(triggerCellCell_x_ .get()); - treeTriggerCells_->GetBranch("c_y") ->SetAddress(triggerCellCell_y_ .get()); - treeTriggerCells_->GetBranch("c_z") ->SetAddress(triggerCellCell_z_ .get()); + //triggerCellCell_id_ .reset(new int[n], array_deleter()); + //triggerCellCell_zside_ .reset(new int[n], array_deleter()); + //triggerCellCell_layer_ .reset(new int[n], array_deleter()); + //triggerCellCell_sector_.reset(new int[n], array_deleter()); + //triggerCellCell_cell_ .reset(new int[n], array_deleter()); + //triggerCellCell_x_ .reset(new float[n], array_deleter()); + //triggerCellCell_y_ .reset(new float[n], array_deleter()); + //triggerCellCell_z_ .reset(new float[n], array_deleter()); + + //treeTriggerCells_->GetBranch("c_id") ->SetAddress(triggerCellCell_id_ .get()); + //treeTriggerCells_->GetBranch("c_zside") ->SetAddress(triggerCellCell_zside_ .get()); + //treeTriggerCells_->GetBranch("c_layer") ->SetAddress(triggerCellCell_layer_ .get()); + //treeTriggerCells_->GetBranch("c_sector") ->SetAddress(triggerCellCell_sector_.get()); + //treeTriggerCells_->GetBranch("c_cell") ->SetAddress(triggerCellCell_cell_ .get()); + //treeTriggerCells_->GetBranch("c_x") ->SetAddress(triggerCellCell_x_ .get()); + //treeTriggerCells_->GetBranch("c_y") ->SetAddress(triggerCellCell_y_ .get()); + //treeTriggerCells_->GetBranch("c_z") ->SetAddress(triggerCellCell_z_ .get()); } diff --git a/L1Trigger/L1THGCal/test/testHGCalL1TGeometry_cfg.py b/L1Trigger/L1THGCal/test/testHGCalL1TGeometry_cfg.py index cdd77d46a6401..7b26ca84fdb4d 100644 --- a/L1Trigger/L1THGCal/test/testHGCalL1TGeometry_cfg.py +++ b/L1Trigger/L1THGCal/test/testHGCalL1TGeometry_cfg.py @@ -1,20 +1,19 @@ import FWCore.ParameterSet.Config as cms -process = cms.Process('SIMDIGI') +from Configuration.StandardSequences.Eras import eras + +process = cms.Process('DIGI',eras.Phase2) # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') -process.load('FWCore.MessageService.MessageLogger_cfi') -process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.Geometry.GeometryExtended2023HGCalMuonReco_cff') -process.load('Configuration.Geometry.GeometryExtended2023HGCalMuon_cff') +process.load('Configuration.Geometry.GeometryExtended2023LRecoReco_cff') process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') process.load('Configuration.StandardSequences.Generator_cff') -process.load('IOMC.EventVertexGenerators.VtxSmearedGauss_cfi') +process.load('Configuration.StandardSequences.VtxSmearedNoSmear_cff') process.load('GeneratorInterface.Core.genFilterSummary_cff') process.load('Configuration.StandardSequences.SimIdeal_cff') process.load('Configuration.StandardSequences.Digi_cff') @@ -23,6 +22,7 @@ process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) ) @@ -43,7 +43,7 @@ # Output definition -process.FEVTDEBUGHLToutput = cms.OutputModule("PoolOutputModule", +process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", splitLevel = cms.untracked.int32(0), eventAutoFlushCompressedSize = cms.untracked.int32(5242880), outputCommands = process.FEVTDEBUGHLTEventContent.outputCommands, @@ -68,7 +68,7 @@ # Other statements process.genstepfilter.triggerConditions=cms.vstring("generation_step") from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgradePLS3', '') +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '') process.generator = cms.EDProducer("FlatRandomPtGunProducer", PGunParameters = cms.PSet( @@ -96,12 +96,15 @@ process.digitisation_step = cms.Path(process.pdigi_valid) process.L1simulation_step = cms.Path(process.SimL1Emulator) process.digi2raw_step = cms.Path(process.DigiToRaw) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) process.hgcaltriggergeomtester = cms.EDAnalyzer( "HGCalTriggerGeomTester", TriggerGeometry = cms.PSet( - TriggerGeometryName = cms.string('HGCalTriggerGeometryImp1'), - L1TCellsMapping = cms.FileInPath("L1Trigger/L1THGCal/data/cellsToTriggerCellsMap.txt"), + TriggerGeometryName = cms.string('HGCalTriggerGeometryHexImp1'), + L1TCellsMapping = cms.FileInPath("L1Trigger/L1THGCal/data/triggercell_mapping.txt"), + L1TModulesMapping = cms.FileInPath("L1Trigger/L1THGCal/data/module_mapping.txt"), eeSDName = cms.string('HGCalEESensitive'), fhSDName = cms.string('HGCalHESiliconSensitive'), bhSDName = cms.string('HGCalHEScintillatorSensitive'), @@ -110,20 +113,18 @@ process.test_step = cms.Path(process.hgcaltriggergeomtester) # Schedule definition -process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.digitisation_step,process.L1simulation_step,process.digi2raw_step,process.test_step) +process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.digitisation_step,process.L1simulation_step,process.digi2raw_step,process.test_step,process.endjob_step,process.FEVTDEBUGoutput_step) +#process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.digitisation_step,process.L1simulation_step,process.digi2raw_step,process.endjob_step,process.FEVTDEBUGoutput_step) # filter all path with the production filter sequence for path in process.paths: - getattr(process,path)._seq = process.generator * getattr(process,path)._seq + getattr(process,path)._seq = process.generator * getattr(process,path)._seq # customisation of the process. # Automatic addition of the customisation function from SLHCUpgradeSimulations.Configuration.combinedCustoms -from SLHCUpgradeSimulations.Configuration.combinedCustoms import cust_2023HGCalMuon +from SLHCUpgradeSimulations.Configuration.combinedCustoms import cust_2023LReco #call to customisation function cust_2023HGCalMuon imported from SLHCUpgradeSimulations.Configuration.combinedCustoms -process = cust_2023HGCalMuon(process) - -# End of customisation functions -process.ProfilerService = cms.Service("ProfilerService", firstEvent=cms.untracked.int32(0), lastEvent=cms.untracked.int32(2), paths=cms.untracked.vstring(["test_step"])) +process = cust_2023LReco(process) From 09c841dfd59c9832606aef45ff9d7b4e0016a667 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Thu, 12 May 2016 14:07:28 +0200 Subject: [PATCH 17/43] Fixed and cleaning of the HGC trigger geometry --- .../geometries/HGCalTriggerGeometryHexImp1.cc | 129 +++++++++------- .../L1THGCal/test/HGCalTriggerGeomTester.cc | 139 +++++++++--------- .../L1THGCal/test/testHGCalL1TGeometry_cfg.py | 2 +- 3 files changed, 145 insertions(+), 125 deletions(-) diff --git a/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc b/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc index 785d44cc54eb6..1682869553858 100644 --- a/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc +++ b/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc @@ -18,6 +18,9 @@ class HGCalTriggerGeometryHexImp1 : public HGCalTriggerGeometryBase private: edm::FileInPath l1tCellsMapping_; edm::FileInPath l1tModulesMapping_; + + void fillMaps(const es_info&); + void buildTriggerCellsAndModules(const es_info&); }; @@ -39,6 +42,18 @@ void HGCalTriggerGeometryHexImp1::initialize(const es_info& esInfo) edm::LogWarning("HGCalTriggerGeometry") << "WARNING: This HGCal trigger geometry is incomplete.\n"\ << "WARNING: Only the EE part is covered.\n"\ << "WARNING: There is no neighbor information.\n"; + + fillMaps(esInfo); + buildTriggerCellsAndModules(esInfo); + +} + + + +/*****************************************************************/ +void HGCalTriggerGeometryHexImp1::fillMaps(const es_info& esInfo) +/*****************************************************************/ +{ // // read module mapping file std::map wafer_to_module; @@ -48,105 +63,115 @@ void HGCalTriggerGeometryHexImp1::initialize(const es_info& esInfo) short module = 0; for(; l1tModulesMappingStream>>wafer>>module; ) { - wafer_to_module[wafer] = module; + wafer_to_module.emplace(wafer,module); } + if(!l1tModulesMappingStream.eof()) edm::LogWarning("HGCalTriggerGeometry") << "Error reading L1TModulesMapping '"<, short> cells_to_trigger_cells; std::ifstream l1tCellsMappingStream(l1tCellsMapping_.fullPath()); if(!l1tCellsMappingStream.is_open()) edm::LogError("HGCalTriggerGeometry") << "Cannot open L1TCellsMapping file\n"; - short wafertype = 0; + short waferType = 0; short cell = 0; - short triggercell = 0; - for(; l1tCellsMappingStream>>wafertype>>cell>>triggercell; ) + short triggerCell = 0; + for(; l1tCellsMappingStream>>waferType>>cell>>triggerCell; ) { - cells_to_trigger_cells[std::make_pair((wafertype?1:-1),cell)] = triggercell; + cells_to_trigger_cells.emplace(std::make_pair((waferType?1:-1),cell), triggerCell); } - //if(!l1tCellsMappingStream.eof()) edm::LogWarning("HGCalTriggerGeometry") << "Error reading L1TCellsMapping'"<getValidGeomDetIds()) { if(id.rawId()==0) continue; - HGCalDetId waferid(id); - short module = wafer_to_module[waferid.wafer()]; - int nCells = esInfo.topo_ee->dddConstants().numberCellsHexagon(waferid.wafer()); - for(int i=0;idddConstants().numberCellsHexagon(waferDetId.wafer()); + for(int c=0;c trigger cell mapping - HGCalDetId cellid(ForwardSubdetector(waferid.subdetId()), waferid.zside(), waferid.layer(), waferid.waferType(), waferid.wafer(), i); - HGCalDetId triggerDetid(ForwardSubdetector(waferid.subdetId()), waferid.zside(), waferid.layer(), waferid.waferType(), waferid.wafer(), triggercell); - cells_to_trigger_cells_.insert( std::make_pair(cellid, triggerDetid) ); + HGCalDetId cellDetId(ForwardSubdetector(waferDetId.subdetId()), waferDetId.zside(), waferDetId.layer(), waferDetId.waferType(), waferDetId.wafer(), c); + HGCalDetId triggerCellDetId(ForwardSubdetector(waferDetId.subdetId()), waferDetId.zside(), waferDetId.layer(), waferDetId.waferType(), waferDetId.wafer(), triggerCellId); + cells_to_trigger_cells_.emplace(cellDetId, triggerCellDetId); // Fill trigger cell -> module mapping - HGCalDetId moduleDetid(ForwardSubdetector(waferid.subdetId()), waferid.zside(), waferid.layer(), waferid.waferType(), module, HGCalDetId::kHGCalCellMask); - trigger_cells_to_modules_.insert( std::make_pair(triggerDetid, moduleDetid) ); // do nothing if trigger cell has already been inserted + HGCalDetId moduleDetId(ForwardSubdetector(waferDetId.subdetId()), waferDetId.zside(), waferDetId.layer(), waferDetId.waferType(), module, HGCalDetId::kHGCalCellMask); + trigger_cells_to_modules_.emplace(triggerCellDetId, moduleDetId); } } +} + + + +/*****************************************************************/ +void HGCalTriggerGeometryHexImp1::buildTriggerCellsAndModules(const es_info& esInfo) +/*****************************************************************/ +{ // // Build trigger cells and fill map typedef HGCalTriggerGeometry::TriggerCell::list_type list_cells; // make list of cells in trigger cells std::map trigger_cells_to_cells; - for(const auto& cell_triggercell : cells_to_trigger_cells_) + for(const auto& cell_triggerCell : cells_to_trigger_cells_) { - unsigned cell = cell_triggercell.first; - unsigned triggercell = cell_triggercell.second; - trigger_cells_to_cells.insert( std::make_pair(triggercell, list_cells()) ); - trigger_cells_to_cells.at(triggercell).insert(cell); + unsigned cell = cell_triggerCell.first; + unsigned triggerCell = cell_triggerCell.second; + auto itr_exist = trigger_cells_to_cells.emplace(triggerCell, list_cells()); + itr_exist.first->second.emplace(cell); + //trigger_cells_to_cells.at(triggerCell).emplace(cell); } - for(const auto& triggercell_cells : trigger_cells_to_cells) + for(const auto& triggerCell_cells : trigger_cells_to_cells) { - unsigned triggercellId = triggercell_cells.first; - list_cells cellIds = triggercell_cells.second; - // Position: for the moment, barycenter of the trigger cell. - Basic3DVector triggercellVector(0.,0.,0.); + unsigned triggerCellId = triggerCell_cells.first; + list_cells cellIds = triggerCell_cells.second; + // Position: barycenter of the trigger cell. + Basic3DVector triggerCellVector(0.,0.,0.); for(const auto& cell : cellIds) { - HGCalDetId cellId(cell); - triggercellVector += esInfo.geom_ee->getPosition(cellId).basicVector(); + HGCalDetId cellDetId(cell); + triggerCellVector += esInfo.geom_ee->getPosition(cellDetId).basicVector(); } - GlobalPoint triggercellPoint( triggercellVector/cellIds.size() ); - const auto& tc2mItr = trigger_cells_to_modules_.find(triggercellId); - unsigned moduleId = (tc2mItr!=trigger_cells_to_modules_.end() ? tc2mItr->second : 0); // 0 if the trigger cell doesn't belong to a module + GlobalPoint triggerCellPoint( triggerCellVector/cellIds.size() ); + const auto& triggerCellToModuleItr = trigger_cells_to_modules_.find(triggerCellId); + unsigned moduleId = (triggerCellToModuleItr!=trigger_cells_to_modules_.end() ? triggerCellToModuleItr->second : 0); // 0 if the trigger cell doesn't belong to a module //unsigned moduleId = trigger_cells_to_modules_.at(triggercellId); // FIXME: empty neighbours - std::unique_ptr triggercellPtr(new HGCalTriggerGeometry::TriggerCell(triggercellId, moduleId, triggercellPoint, list_cells(), cellIds)); - trigger_cells_.insert( std::make_pair(triggercellId, std::move(triggercellPtr)) ); + trigger_cells_.emplace(triggerCellId, std::make_unique(triggerCellId, moduleId, triggerCellPoint, list_cells(), cellIds)); } // // Build modules and fill map - typedef HGCalTriggerGeometry::Module::list_type list_triggercells; + typedef HGCalTriggerGeometry::Module::list_type list_triggerCells; typedef HGCalTriggerGeometry::Module::tc_map_type tc_map_to_cells; // make list of trigger cells in modules - std::map modules_to_trigger_cells; - for(const auto& triggercell_module : trigger_cells_to_modules_) + std::map modules_to_trigger_cells; + for(const auto& triggerCell_module : trigger_cells_to_modules_) { - unsigned triggercell = triggercell_module.first; - unsigned module = triggercell_module.second; - modules_to_trigger_cells.insert( std::make_pair(module, list_triggercells()) ); - modules_to_trigger_cells.at(module).insert(triggercell); + unsigned triggerCell = triggerCell_module.first; + unsigned module = triggerCell_module.second; + auto itr_exist = modules_to_trigger_cells.emplace(module, list_triggerCells()); + itr_exist.first->second.emplace(triggerCell); + //modules_to_trigger_cells.at(module).emplace(triggerCell); } - for(const auto& module_triggercell : modules_to_trigger_cells) + for(const auto& module_triggerCell : modules_to_trigger_cells) { - unsigned moduleId = module_triggercell.first; - list_triggercells triggercellIds = module_triggercell.second; + unsigned moduleId = module_triggerCell.first; + list_triggerCells triggerCellIds = module_triggerCell.second; tc_map_to_cells cellsInTriggerCells; - // Position: for the moment, barycenter of the module, from trigger cell positions + // Position: barycenter of the module, from trigger cell positions Basic3DVector moduleVector(0.,0.,0.); - for(const auto& triggercell : triggercellIds) + for(const auto& triggerCell : triggerCellIds) { - const auto& cells_in_tc = trigger_cells_to_cells.at(triggercell); + const auto& cells_in_tc = trigger_cells_to_cells.at(triggerCell); for( const unsigned cell : cells_in_tc ) { - cellsInTriggerCells.emplace(triggercell,cell); + cellsInTriggerCells.emplace(triggerCell,cell); } - moduleVector += trigger_cells_.at(triggercell)->position().basicVector(); + moduleVector += trigger_cells_.at(triggerCell)->position().basicVector(); } - GlobalPoint modulePoint( moduleVector/triggercellIds.size() ); + GlobalPoint modulePoint( moduleVector/triggerCellIds.size() ); // FIXME: empty neighbours - std::unique_ptr modulePtr(new HGCalTriggerGeometry::Module(moduleId, modulePoint, list_triggercells(), triggercellIds, cellsInTriggerCells)); - modules_.insert( std::make_pair(moduleId, std::move(modulePtr)) ); + modules_.emplace(moduleId, std::make_unique(moduleId, modulePoint, list_triggerCells(), triggerCellIds, cellsInTriggerCells)); } } diff --git a/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc b/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc index 6a5864764420c..10cdb1f2d8396 100644 --- a/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc +++ b/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc @@ -94,6 +94,7 @@ class HGCalTriggerGeomTester : public edm::EDAnalyzer int cellSide_ ; int cellLayer_ ; int cellWafer_ ; + int cellWaferType_ ; int cell_ ; float cellX_ ; float cellY_ ; @@ -151,8 +152,7 @@ HGCalTriggerGeomTester::HGCalTriggerGeomTester(const edm::ParameterSet& conf) treeTriggerCells_->Branch("id" , &triggerCellId_ , "id/I"); treeTriggerCells_->Branch("zside" , &triggerCellSide_ , "zside/I"); treeTriggerCells_->Branch("layer" , &triggerCellLayer_ , "layer/I"); - treeTriggerCells_->Branch("wafer" , &triggerCellWafer_ , "wafer/I"); - treeTriggerCells_->Branch("module" , &triggerCellModule_ , "module/I"); + treeTriggerCells_->Branch("wafer" , &triggerCellWafer_ , "wafer/I"); treeTriggerCells_->Branch("triggercell" , &triggerCell_ , "triggercell/I"); treeTriggerCells_->Branch("x" , &triggerCellX_ , "x/F"); treeTriggerCells_->Branch("y" , &triggerCellY_ , "y/F"); @@ -180,6 +180,7 @@ HGCalTriggerGeomTester::HGCalTriggerGeomTester(const edm::ParameterSet& conf) treeCells_->Branch("zside" , &cellSide_ , "zside/I"); treeCells_->Branch("layer" , &cellLayer_ , "layer/I"); treeCells_->Branch("wafer" , &cellWafer_ , "wafer/I"); + treeCells_->Branch("wafertype" , &cellWaferType_ , "wafertype/I"); treeCells_->Branch("cell" , &cell_ , "cell/I"); treeCells_->Branch("x" , &cellX_ , "x/F"); treeCells_->Branch("y" , &cellY_ , "y/F"); @@ -272,7 +273,6 @@ void HGCalTriggerGeomTester::fillTriggerGeometry(const HGCalTriggerGeometryBase: triggerCellSide_ = id.zside(); triggerCellLayer_ = id.layer(); triggerCellWafer_ = id.wafer(); - triggerCellModule_ = id.module(); triggerCell_ = id.cell(); triggerCellX_ = triggerCellPtr->position().x(); triggerCellY_ = triggerCellPtr->position().y(); @@ -300,45 +300,40 @@ void HGCalTriggerGeomTester::fillTriggerGeometry(const HGCalTriggerGeometryBase: } // Loop over cells std::cout<<"Filling cells tree\n"; - for (int izz=0; izz<=1; izz++) + for(const auto& id : info.geom_ee->getValidGeomDetIds()) { - int iz = (2*izz-1); - for (int subsec=0; subsec<=1; ++subsec) + if(id.rawId()==0) continue; + HGCalDetId waferid(id); + int nCells = info.topo_ee->dddConstants().numberCellsHexagon(waferid.wafer()); + for(int i=0;ivalid(id)) continue; + cellId_ = id.rawId(); + cellSide_ = id.zside(); + cellLayer_ = id.layer(); + cellWafer_ = id.wafer(); + cellWaferType_ = id.waferType(); + cell_ = id.cell(); + // + GlobalPoint center = info.geom_ee->getPosition(id); + cellX_ = center.x(); + cellY_ = center.y(); + cellZ_ = center.z(); + std::vector corners = info.geom_ee->getCorners(id); + if(corners.size()<4) std::cout<<"#corners < 4\n"; + else { - for (int lay=1; lay<=30; ++lay) - { - for (int cell=0; cell<8000; ++cell) - { - const HGCEEDetId id(HGCEE,iz,lay,sec,subsec,cell); - if(!info.topo_ee->valid(id)) continue; - cellId_ = id.rawId(); - cellSide_ = id.zside(); - cellLayer_ = id.layer(); - cellWafer_ = id.wafer(); - cell_ = id.cell(); - GlobalPoint center = info.geom_ee->getPosition(id); - cellX_ = center.x(); - cellY_ = center.y(); - cellZ_ = center.z(); - std::vector corners = info.geom_ee->getCorners(id); - if(corners.size()<4) std::cout<<"#corners < 4\n"; - else - { - cellX1_ = corners.at(0).x(); - cellY1_ = corners.at(0).y(); - cellX2_ = corners.at(1).x(); - cellY2_ = corners.at(1).y(); - cellX3_ = corners.at(2).x(); - cellY3_ = corners.at(2).y(); - cellX4_ = corners.at(3).x(); - cellY4_ = corners.at(3).y(); - } - treeCells_->Fill(); - } - } + cellX1_ = corners.at(0).x(); + cellY1_ = corners.at(0).y(); + cellX2_ = corners.at(1).x(); + cellY2_ = corners.at(1).y(); + cellX3_ = corners.at(2).x(); + cellY3_ = corners.at(2).y(); + cellX4_ = corners.at(3).x(); + cellY4_ = corners.at(3).y(); } + treeCells_->Fill(); } } } @@ -357,46 +352,46 @@ void HGCalTriggerGeomTester::analyze(const edm::Event& e, void HGCalTriggerGeomTester::setTreeModuleSize(const size_t n) /*****************************************************************/ { - //moduleTC_id_ .reset(new int[n], array_deleter()); - //moduleTC_zside_ .reset(new int[n], array_deleter()); - //moduleTC_layer_ .reset(new int[n], array_deleter()); - //moduleTC_sector_.reset(new int[n], array_deleter()); - //moduleTC_cell_ .reset(new int[n], array_deleter()); - //moduleTC_x_ .reset(new float[n], array_deleter()); - //moduleTC_y_ .reset(new float[n], array_deleter()); - //moduleTC_z_ .reset(new float[n], array_deleter()); - - //treeModules_->GetBranch("tc_id") ->SetAddress(moduleTC_id_ .get()); - //treeModules_->GetBranch("tc_zside") ->SetAddress(moduleTC_zside_ .get()); - //treeModules_->GetBranch("tc_layer") ->SetAddress(moduleTC_layer_ .get()); - //treeModules_->GetBranch("tc_sector") ->SetAddress(moduleTC_sector_.get()); - //treeModules_->GetBranch("tc_cell") ->SetAddress(moduleTC_cell_ .get()); - //treeModules_->GetBranch("tc_x") ->SetAddress(moduleTC_x_ .get()); - //treeModules_->GetBranch("tc_y") ->SetAddress(moduleTC_y_ .get()); - //treeModules_->GetBranch("tc_z") ->SetAddress(moduleTC_z_ .get()); + moduleTC_id_ .reset(new int[n], array_deleter()); + moduleTC_zside_ .reset(new int[n], array_deleter()); + moduleTC_layer_ .reset(new int[n], array_deleter()); + moduleTC_wafer_ .reset(new int[n], array_deleter()); + moduleTC_cell_ .reset(new int[n], array_deleter()); + moduleTC_x_ .reset(new float[n], array_deleter()); + moduleTC_y_ .reset(new float[n], array_deleter()); + moduleTC_z_ .reset(new float[n], array_deleter()); + + treeModules_->GetBranch("tc_id") ->SetAddress(moduleTC_id_ .get()); + treeModules_->GetBranch("tc_zside") ->SetAddress(moduleTC_zside_ .get()); + treeModules_->GetBranch("tc_layer") ->SetAddress(moduleTC_layer_ .get()); + treeModules_->GetBranch("tc_wafer") ->SetAddress(moduleTC_wafer_ .get()); + treeModules_->GetBranch("tc_cell") ->SetAddress(moduleTC_cell_ .get()); + treeModules_->GetBranch("tc_x") ->SetAddress(moduleTC_x_ .get()); + treeModules_->GetBranch("tc_y") ->SetAddress(moduleTC_y_ .get()); + treeModules_->GetBranch("tc_z") ->SetAddress(moduleTC_z_ .get()); } /*****************************************************************/ void HGCalTriggerGeomTester::setTreeTriggerCellSize(const size_t n) /*****************************************************************/ { - //triggerCellCell_id_ .reset(new int[n], array_deleter()); - //triggerCellCell_zside_ .reset(new int[n], array_deleter()); - //triggerCellCell_layer_ .reset(new int[n], array_deleter()); - //triggerCellCell_sector_.reset(new int[n], array_deleter()); - //triggerCellCell_cell_ .reset(new int[n], array_deleter()); - //triggerCellCell_x_ .reset(new float[n], array_deleter()); - //triggerCellCell_y_ .reset(new float[n], array_deleter()); - //triggerCellCell_z_ .reset(new float[n], array_deleter()); - - //treeTriggerCells_->GetBranch("c_id") ->SetAddress(triggerCellCell_id_ .get()); - //treeTriggerCells_->GetBranch("c_zside") ->SetAddress(triggerCellCell_zside_ .get()); - //treeTriggerCells_->GetBranch("c_layer") ->SetAddress(triggerCellCell_layer_ .get()); - //treeTriggerCells_->GetBranch("c_sector") ->SetAddress(triggerCellCell_sector_.get()); - //treeTriggerCells_->GetBranch("c_cell") ->SetAddress(triggerCellCell_cell_ .get()); - //treeTriggerCells_->GetBranch("c_x") ->SetAddress(triggerCellCell_x_ .get()); - //treeTriggerCells_->GetBranch("c_y") ->SetAddress(triggerCellCell_y_ .get()); - //treeTriggerCells_->GetBranch("c_z") ->SetAddress(triggerCellCell_z_ .get()); + triggerCellCell_id_ .reset(new int[n], array_deleter()); + triggerCellCell_zside_ .reset(new int[n], array_deleter()); + triggerCellCell_layer_ .reset(new int[n], array_deleter()); + triggerCellCell_wafer_ .reset(new int[n], array_deleter()); + triggerCellCell_cell_ .reset(new int[n], array_deleter()); + triggerCellCell_x_ .reset(new float[n], array_deleter()); + triggerCellCell_y_ .reset(new float[n], array_deleter()); + triggerCellCell_z_ .reset(new float[n], array_deleter()); + + treeTriggerCells_->GetBranch("c_id") ->SetAddress(triggerCellCell_id_ .get()); + treeTriggerCells_->GetBranch("c_zside") ->SetAddress(triggerCellCell_zside_ .get()); + treeTriggerCells_->GetBranch("c_layer") ->SetAddress(triggerCellCell_layer_ .get()); + treeTriggerCells_->GetBranch("c_wafer") ->SetAddress(triggerCellCell_wafer_ .get()); + treeTriggerCells_->GetBranch("c_cell") ->SetAddress(triggerCellCell_cell_ .get()); + treeTriggerCells_->GetBranch("c_x") ->SetAddress(triggerCellCell_x_ .get()); + treeTriggerCells_->GetBranch("c_y") ->SetAddress(triggerCellCell_y_ .get()); + treeTriggerCells_->GetBranch("c_z") ->SetAddress(triggerCellCell_z_ .get()); } diff --git a/L1Trigger/L1THGCal/test/testHGCalL1TGeometry_cfg.py b/L1Trigger/L1THGCal/test/testHGCalL1TGeometry_cfg.py index 7b26ca84fdb4d..b2722c5a9a7b8 100644 --- a/L1Trigger/L1THGCal/test/testHGCalL1TGeometry_cfg.py +++ b/L1Trigger/L1THGCal/test/testHGCalL1TGeometry_cfg.py @@ -60,7 +60,7 @@ # Additional output definition process.TFileService = cms.Service( "TFileService", - fileName = cms.string("test.root") + fileName = cms.string("test_triggergeom.root") ) From 45761648a78338538d92de7bdbfcc027384784cb Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Thu, 12 May 2016 14:08:09 +0200 Subject: [PATCH 18/43] Add HGC trigger cell and module mappings --- L1Trigger/L1THGCal/data/module_mapping.txt | 564 ++++++++++++++++++ .../L1THGCal/data/triggercell_mapping.txt | 373 ++++++++++++ 2 files changed, 937 insertions(+) create mode 100644 L1Trigger/L1THGCal/data/module_mapping.txt create mode 100644 L1Trigger/L1THGCal/data/triggercell_mapping.txt diff --git a/L1Trigger/L1THGCal/data/module_mapping.txt b/L1Trigger/L1THGCal/data/module_mapping.txt new file mode 100644 index 0000000000000..d59260e873117 --- /dev/null +++ b/L1Trigger/L1THGCal/data/module_mapping.txt @@ -0,0 +1,564 @@ +0 0 +1 0 +2 1 +3 1 +4 2 +5 2 +6 3 +7 3 +8 4 +9 4 +10 5 +11 5 +12 6 +13 6 +14 7 +15 7 +16 8 +17 8 +18 9 +19 10 +20 11 +21 12 +22 12 +23 13 +24 13 +25 14 +26 14 +27 15 +28 15 +29 16 +30 16 +31 17 +32 18 +33 19 +34 20 +35 11 +36 21 +37 21 +38 22 +39 22 +40 23 +41 23 +42 24 +43 24 +44 25 +45 25 +46 26 +47 17 +48 18 +49 27 +50 19 +51 20 +52 28 +53 29 +54 30 +55 30 +56 31 +57 31 +58 32 +59 32 +60 33 +61 33 +62 34 +63 34 +64 26 +65 35 +66 36 +67 27 +68 37 +69 38 +70 28 +71 29 +72 39 +73 40 +74 41 +75 41 +76 42 +77 42 +78 43 +79 43 +80 44 +81 44 +82 45 +83 46 +84 35 +85 36 +86 47 +87 37 +88 38 +89 48 +90 49 +91 39 +92 40 +93 50 +94 51 +95 51 +96 52 +97 52 +98 53 +99 53 +100 54 +101 55 +102 45 +103 46 +104 56 +105 57 +106 47 +107 58 +108 59 +109 48 +110 49 +111 60 +112 61 +113 50 +114 62 +115 62 +116 63 +117 63 +118 64 +119 64 +120 65 +121 54 +122 55 +123 66 +124 67 +125 56 +126 57 +127 68 +128 58 +129 59 +130 69 +131 70 +132 60 +133 61 +134 71 +135 72 +136 73 +137 73 +138 74 +139 74 +140 75 +141 76 +142 65 +143 77 +144 78 +145 66 +146 67 +147 79 +148 80 +149 68 +150 81 +151 82 +152 69 +153 70 +154 83 +155 84 +156 71 +157 72 +158 85 +159 85 +160 86 +161 86 +162 87 +163 75 +164 76 +165 88 +166 77 +167 78 +168 89 +169 90 +170 79 +171 80 +172 91 +173 81 +174 82 +175 92 +176 93 +177 83 +178 84 +179 94 +180 95 +181 96 +182 97 +183 97 +184 98 +185 98 +186 87 +187 99 +188 100 +189 88 +190 101 +191 102 +192 89 +193 90 +194 103 +195 104 +196 91 +197 105 +198 92 +199 93 +200 106 +201 107 +202 94 +203 95 +204 96 +205 108 +206 109 +207 110 +208 99 +209 100 +210 111 +211 101 +212 102 +213 112 +214 113 +215 103 +216 104 +217 105 +218 114 +219 115 +220 106 +221 107 +222 116 +223 117 +224 118 +225 108 +226 109 +227 110 +228 119 +229 120 +230 111 +231 121 +232 122 +233 112 +234 113 +235 123 +236 124 +237 114 +238 115 +239 125 +240 126 +241 116 +242 117 +243 118 +244 127 +245 128 +246 119 +247 120 +248 129 +249 130 +250 121 +251 122 +252 131 +253 132 +254 123 +255 133 +256 134 +257 135 +258 125 +259 126 +260 136 +261 137 +262 127 +263 128 +264 138 +265 139 +266 140 +267 129 +268 130 +269 141 +270 142 +271 131 +272 132 +273 143 +274 144 +275 145 +276 134 +277 135 +278 146 +279 147 +280 136 +281 137 +282 148 +283 149 +284 138 +285 139 +286 140 +287 150 +288 151 +289 141 +290 142 +291 152 +292 153 +293 143 +294 144 +295 154 +296 145 +297 155 +298 156 +299 146 +300 147 +301 157 +302 158 +303 148 +304 149 +305 159 +306 160 +307 160 +308 161 +309 161 +310 150 +311 151 +312 162 +313 163 +314 152 +315 153 +316 164 +317 165 +318 166 +319 154 +320 167 +321 155 +322 156 +323 168 +324 169 +325 157 +326 158 +327 170 +328 171 +329 159 +330 172 +331 172 +332 173 +333 173 +334 174 +335 162 +336 163 +337 175 +338 176 +339 164 +340 165 +341 166 +342 177 +343 167 +344 178 +345 179 +346 168 +347 169 +348 180 +349 181 +350 170 +351 171 +352 182 +353 182 +354 183 +355 183 +356 174 +357 184 +358 185 +359 175 +360 176 +361 186 +362 187 +363 188 +364 177 +365 189 +366 178 +367 179 +368 190 +369 191 +370 180 +371 181 +372 192 +373 192 +374 193 +375 193 +376 194 +377 194 +378 184 +379 185 +380 195 +381 196 +382 186 +383 187 +384 188 +385 197 +386 189 +387 198 +388 199 +389 190 +390 191 +391 200 +392 200 +393 201 +394 201 +395 202 +396 202 +397 203 +398 203 +399 204 +400 195 +401 196 +402 205 +403 206 +404 207 +405 197 +406 208 +407 198 +408 199 +409 209 +410 210 +411 210 +412 211 +413 211 +414 212 +415 212 +416 213 +417 213 +418 204 +419 214 +420 215 +421 205 +422 206 +423 207 +424 216 +425 208 +426 217 +427 218 +428 209 +429 219 +430 219 +431 220 +432 220 +433 221 +434 221 +435 222 +436 222 +437 214 +438 215 +439 223 +440 224 +441 225 +442 216 +443 226 +444 217 +445 218 +446 227 +447 227 +448 228 +449 228 +450 229 +451 229 +452 230 +453 230 +454 231 +455 231 +456 223 +457 224 +458 225 +459 226 +460 232 +461 232 +462 233 +463 233 +464 234 +465 234 +466 235 +467 235 +468 236 +469 236 +470 237 +471 237 +472 238 +473 239 +474 240 +475 240 +476 241 +477 241 +478 242 +479 242 +480 243 +481 243 +482 244 +483 244 +484 245 +485 245 +486 246 +487 246 +488 247 +489 247 +490 248 +491 248 +492 10 +493 9 +494 133 +495 124 +496 239 +497 238 +498 249 +499 250 +500 251 +501 252 +502 253 +503 254 +504 255 +505 256 +506 257 +507 258 +508 259 +509 260 +510 261 +511 262 +512 263 +513 264 +514 265 +515 266 +516 267 +517 249 +518 254 +519 268 +520 269 +521 255 +522 260 +523 270 +524 271 +525 261 +526 266 +527 272 +528 267 +529 273 +530 274 +531 268 +532 269 +533 275 +534 276 +535 270 +536 271 +537 277 +538 278 +539 272 +540 279 +541 273 +542 274 +543 280 +544 281 +545 275 +546 276 +547 282 +548 283 +549 277 +550 278 +551 284 +552 250 +553 251 +554 252 +555 253 +556 256 +557 257 +558 258 +559 259 +560 262 +561 263 +562 264 +563 265 diff --git a/L1Trigger/L1THGCal/data/triggercell_mapping.txt b/L1Trigger/L1THGCal/data/triggercell_mapping.txt new file mode 100644 index 0000000000000..34a931647330a --- /dev/null +++ b/L1Trigger/L1THGCal/data/triggercell_mapping.txt @@ -0,0 +1,373 @@ +0 0 0 +0 1 0 +0 2 1 +0 3 1 +0 4 0 +0 5 2 +0 6 2 +0 7 1 +0 8 1 +0 9 1 +0 10 0 +0 11 0 +0 12 2 +0 13 2 +0 14 2 +0 15 3 +0 16 3 +0 17 4 +0 18 4 +0 19 5 +0 20 5 +0 21 6 +0 22 6 +0 23 7 +0 24 7 +0 25 7 +0 26 3 +0 27 3 +0 28 3 +0 29 4 +0 30 4 +0 31 5 +0 32 5 +0 33 6 +0 34 6 +0 35 7 +0 36 7 +0 37 8 +0 38 9 +0 39 9 +0 40 10 +0 41 10 +0 42 11 +0 43 11 +0 44 12 +0 45 12 +0 46 13 +0 47 13 +0 48 8 +0 49 9 +0 50 9 +0 51 9 +0 52 10 +0 53 10 +0 54 11 +0 55 11 +0 56 12 +0 57 12 +0 58 13 +0 59 13 +0 60 8 +0 61 14 +0 62 14 +0 63 15 +0 64 15 +0 65 16 +0 66 16 +0 67 17 +0 68 17 +0 69 18 +0 70 18 +0 71 8 +0 72 19 +0 73 14 +0 74 14 +0 75 15 +0 76 15 +0 77 16 +0 78 16 +0 79 17 +0 80 17 +0 81 18 +0 82 18 +0 83 18 +0 84 19 +0 85 20 +0 86 20 +0 87 21 +0 88 21 +0 89 22 +0 90 22 +0 91 23 +0 92 23 +0 93 24 +0 94 24 +0 95 19 +0 96 19 +0 97 20 +0 98 20 +0 99 21 +0 100 21 +0 101 22 +0 102 22 +0 103 23 +0 104 23 +0 105 24 +0 106 24 +0 107 19 +0 108 25 +0 109 25 +0 110 26 +0 111 26 +0 112 27 +0 113 27 +0 114 28 +0 115 28 +0 116 24 +0 117 24 +0 118 25 +0 119 25 +0 120 26 +0 121 26 +0 122 27 +0 123 27 +0 124 28 +0 125 28 +0 126 25 +0 127 29 +0 128 29 +0 129 29 +0 130 28 +0 131 29 +0 132 29 +1 0 0 +1 1 0 +1 2 1 +1 3 0 +1 4 0 +1 5 0 +1 6 1 +1 7 1 +1 8 1 +1 9 2 +1 10 2 +1 11 3 +1 12 3 +1 13 4 +1 14 4 +1 15 5 +1 16 5 +1 17 6 +1 18 7 +1 19 7 +1 20 2 +1 21 2 +1 22 3 +1 23 3 +1 24 4 +1 25 4 +1 26 5 +1 27 5 +1 28 6 +1 29 6 +1 30 8 +1 31 8 +1 32 7 +1 33 9 +1 34 9 +1 35 10 +1 36 10 +1 37 11 +1 38 11 +1 39 12 +1 40 12 +1 41 13 +1 42 13 +1 43 14 +1 44 14 +1 45 8 +1 46 8 +1 47 7 +1 48 7 +1 49 9 +1 50 9 +1 51 10 +1 52 10 +1 53 11 +1 54 11 +1 55 12 +1 56 12 +1 57 13 +1 58 13 +1 59 14 +1 60 14 +1 61 8 +1 62 15 +1 63 15 +1 64 16 +1 65 16 +1 66 17 +1 67 17 +1 68 18 +1 69 18 +1 70 19 +1 71 19 +1 72 20 +1 73 20 +1 74 21 +1 75 21 +1 76 22 +1 77 22 +1 78 15 +1 79 15 +1 80 16 +1 81 16 +1 82 17 +1 83 17 +1 84 18 +1 85 18 +1 86 19 +1 87 19 +1 88 20 +1 89 20 +1 90 21 +1 91 21 +1 92 22 +1 93 23 +1 94 23 +1 95 24 +1 96 24 +1 97 25 +1 98 25 +1 99 26 +1 100 26 +1 101 27 +1 102 27 +1 103 28 +1 104 28 +1 105 29 +1 106 29 +1 107 22 +1 108 22 +1 109 23 +1 110 23 +1 111 24 +1 112 24 +1 113 25 +1 114 25 +1 115 26 +1 116 26 +1 117 27 +1 118 27 +1 119 28 +1 120 28 +1 121 29 +1 122 29 +1 123 30 +1 124 31 +1 125 31 +1 126 32 +1 127 32 +1 128 33 +1 129 33 +1 130 34 +1 131 34 +1 132 35 +1 133 35 +1 134 36 +1 135 36 +1 136 37 +1 137 37 +1 138 30 +1 139 30 +1 140 31 +1 141 31 +1 142 32 +1 143 32 +1 144 33 +1 145 33 +1 146 34 +1 147 34 +1 148 35 +1 149 35 +1 150 36 +1 151 36 +1 152 37 +1 153 37 +1 154 30 +1 155 38 +1 156 38 +1 157 39 +1 158 39 +1 159 40 +1 160 40 +1 161 41 +1 162 41 +1 163 42 +1 164 42 +1 165 43 +1 166 43 +1 167 44 +1 168 44 +1 169 45 +1 170 45 +1 171 38 +1 172 38 +1 173 39 +1 174 39 +1 175 40 +1 176 40 +1 177 41 +1 178 41 +1 179 42 +1 180 42 +1 181 43 +1 182 43 +1 183 44 +1 184 44 +1 185 45 +1 186 46 +1 187 46 +1 188 47 +1 189 47 +1 190 48 +1 191 48 +1 192 49 +1 193 49 +1 194 50 +1 195 50 +1 196 51 +1 197 51 +1 198 52 +1 199 52 +1 200 45 +1 201 46 +1 202 46 +1 203 47 +1 204 47 +1 205 48 +1 206 48 +1 207 49 +1 208 49 +1 209 50 +1 210 50 +1 211 51 +1 212 52 +1 213 52 +1 214 46 +1 215 53 +1 216 53 +1 217 54 +1 218 54 +1 219 55 +1 220 55 +1 221 56 +1 222 56 +1 223 56 +1 224 51 +1 225 53 +1 226 53 +1 227 54 +1 228 54 +1 229 55 +1 230 55 +1 231 56 +1 232 56 +1 233 53 +1 234 57 +1 235 57 +1 236 57 +1 237 57 +1 238 57 +1 239 57 From 1a01631a14123b03adc6de300008ca889937973d Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Thu, 12 May 2016 14:10:30 +0200 Subject: [PATCH 19/43] Add test drawing scripts for the HGC trigger hex geometry --- .../L1THGCal/test/macros/DrawingUtilities.py | 197 ++++++++++++++++++ .../test/macros/drawTriggerModulesHex.py | 164 +++++++++++++++ .../L1THGCal/test/macros/waferGeometry.py | 20 ++ 3 files changed, 381 insertions(+) create mode 100644 L1Trigger/L1THGCal/test/macros/DrawingUtilities.py create mode 100644 L1Trigger/L1THGCal/test/macros/drawTriggerModulesHex.py create mode 100644 L1Trigger/L1THGCal/test/macros/waferGeometry.py diff --git a/L1Trigger/L1THGCal/test/macros/DrawingUtilities.py b/L1Trigger/L1THGCal/test/macros/DrawingUtilities.py new file mode 100644 index 0000000000000..37f427cdb3a65 --- /dev/null +++ b/L1Trigger/L1THGCal/test/macros/DrawingUtilities.py @@ -0,0 +1,197 @@ +import ROOT +import waferGeometry +import math +from array import array + +def float_equal(a, b, rel_tol=1e-4, abs_tol=1e-2): + return abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol) + +def compare_lines(line1, line2): + xy11 = (line1.GetX1(), line1.GetY1()) + xy12 = (line1.GetX2(), line1.GetY2()) + xy21 = (line2.GetX1(), line2.GetY1()) + xy22 = (line2.GetX2(), line2.GetY2()) + samecorner1 = (float_equal(xy11[0],xy21[0]) and float_equal(xy11[1],xy21[1])) or (float_equal(xy11[0],xy22[0]) and float_equal(xy11[1],xy22[1])) + samecorner2 = (float_equal(xy12[0],xy21[0]) and float_equal(xy12[1],xy21[1])) or (float_equal(xy12[0],xy22[0]) and float_equal(xy12[1],xy22[1])) + #if prt: print "[",xy11,xy12,"]","[",xy21,xy22,"]",(samecorner1 and samecorner2) + return samecorner1 and samecorner2 + +def boxlines(box): + lines = [] + lines.append(ROOT.TLine(box.GetX1(), box.GetY1(), box.GetX1(), box.GetY2())) + lines.append(ROOT.TLine(box.GetX1(), box.GetY1(), box.GetX2(), box.GetY1())) + lines.append(ROOT.TLine(box.GetX1(), box.GetY2(), box.GetX2(), box.GetY2())) + lines.append(ROOT.TLine(box.GetX2(), box.GetY1(), box.GetX2(), box.GetY2())) + return lines + +## remove duplicated lines from a list of lines +def merge_lines(lines): + copylines = [] + n = len(lines) + for line1 in lines: + duplicate = False + for line2 in lines: + if line1 is line2: continue + sameline = compare_lines(line1, line2) + if sameline: duplicate = True + if not duplicate: + copylines.append(line1) + return copylines + +def merge_lines(lines1, lines2): + rm1 = [] + rm2 = [] + copylines = [] + for i1,line1 in enumerate(lines1): + sameline = False + for i2,line2 in enumerate(lines2): + sameline = compare_lines(line1, line2) + if sameline: + rm2.append(i2) + break + if not sameline: + copylines.append(line1) + for i,line in enumerate(lines2): + if i not in rm2: + copylines.append(line) + return copylines + + +class Position: + def __init__(self): + self.x = 0. + self.y = 0. + self.z = 0. + +class Cell: + def __init__(self): + self.id = 0 + self.zside = 0 + self.layer = 0 + self.wafer = 0 + self.wafertype = 0 + self.cell = 0 + self.center = Position() + self.corners = [Position(), Position(), Position(), Position()] + self.lines = [] + self.edge = 0. + + def point(self): + return ROOT.TMarker(self.center.x, self.center.y, 1) + + def box(self): + return ROOT.TBox(self.corners[0].x, self.corners[0].y, self.corners[2].x, self.corners[2].y) + + def hexagon_points(self): + wafer_geometry = waferGeometry.smallCellWafer if self.wafertype==1 else waferGeometry.largeCellWafer + self.edge = wafer_geometry['cell_corner_size'] + xs = [] + ys = [] + diameter = self.edge/math.tan(math.radians(30)) + centerx = self.center.x + centery = self.center.y + # Shift center for half cells or corner cells + if self.cell in wafer_geometry['half_cells_edge_left']: + centerx -= 2.*math.sqrt(3)*self.edge/9. + elif self.cell in wafer_geometry['half_cells_edge_topleft']: + centerx -= 2.*math.sqrt(3)*self.edge/9.*math.cos(math.radians(60)) + centery += 2.*math.sqrt(3)*self.edge/9.*math.sin(math.radians(60)) + elif self.cell in wafer_geometry['half_cells_edge_topright']: + centerx += 2.*math.sqrt(3)*self.edge/9.*math.cos(math.radians(60)) + centery += 2.*math.sqrt(3)*self.edge/9.*math.sin(math.radians(60)) + elif self.cell in wafer_geometry['half_cells_edge_bottomright']: + centerx += 2.*math.sqrt(3)*self.edge/9.*math.cos(math.radians(60)) + centery -= 2.*math.sqrt(3)*self.edge/9.*math.sin(math.radians(60)) + elif self.cell in wafer_geometry['half_cells_edge_bottomleft']: + centerx -= 2.*math.sqrt(3)*self.edge/9.*math.cos(math.radians(60)) + centery -= 2.*math.sqrt(3)*self.edge/9.*math.sin(math.radians(60)) + elif self.cell in wafer_geometry['half_cells_edge_right']: + centerx += 2.*math.sqrt(3)*self.edge/9. + x = centerx - diameter/2. + y = centery - self.edge/2. + for angle in range(0, 360, 60): + y += math.cos(math.radians(angle)) * self.edge + x += math.sin(math.radians(angle)) * self.edge + xs.append(x) + ys.append(y) + # Remove corners for half cells and corner cells + if self.cell in wafer_geometry['half_cells_edge_left']: + del xs[0]; del ys[0] + del xs[-1]; del ys[-1] + elif self.cell in wafer_geometry['half_cells_edge_topleft']: + del xs[0]; del ys[0] + del xs[0]; del ys[0] + elif self.cell in wafer_geometry['half_cells_edge_topright']: + del xs[1]; del ys[1] + del xs[1]; del ys[1] + elif self.cell in wafer_geometry['half_cells_edge_bottomright']: + del xs[3]; del ys[3] + del xs[3]; del ys[3] + elif self.cell in wafer_geometry['half_cells_edge_bottomleft']: + del xs[4]; del ys[4] + del xs[4]; del ys[4] + elif self.cell in wafer_geometry['half_cells_edge_right']: + del xs[2]; del ys[2] + del xs[2]; del ys[2] + # Close the cell + xs.append(xs[0]) + ys.append(ys[0]) + return xs,ys + + def hexagon(self): + xs,ys = self.hexagon_points() + return ROOT.TPolyLine(len(xs), array('f',xs), array('f',ys)) + + def hexagon_lines(self): + xs,ys = self.hexagon_points() + lines = [] + for i in xrange(len(xs)-1): + lines.append(ROOT.TLine(xs[i], ys[i], xs[i+1], ys[i+1])) + self.lines = lines + return lines + + + def __eq__(self, other): + return self.id==other.id + + +class TriggerCell: + def __init__(self): + self.id = 0 + self.zside = 0 + self.layer = 0 + self.wafer = 0 + self.triggercell = 0 + self.center = Position() + self.cells = [] + self.lines = [] + self.color = -1 + + def trigger_lines(self): + lines = [] + for cell in self.cells: + lines = merge_lines(lines, cell.lines) + self.lines = lines + return lines + + + def __eq__(self, other): + return self.id==other.id + + +class Module: + def __init__(self): + self.id = 0 + self.zside = 0 + self.layer = 0 + self.module = 0 + self.center = Position() + self.cells = [] + self.lines = [] + + def module_lines(self): + lines = [] + for cell in self.cells: + lines = merge_lines(lines, cell.lines) + self.lines = lines + return lines diff --git a/L1Trigger/L1THGCal/test/macros/drawTriggerModulesHex.py b/L1Trigger/L1THGCal/test/macros/drawTriggerModulesHex.py new file mode 100644 index 0000000000000..1063fa97a03f1 --- /dev/null +++ b/L1Trigger/L1THGCal/test/macros/drawTriggerModulesHex.py @@ -0,0 +1,164 @@ +import ROOT +from DrawingUtilities import Cell, TriggerCell, Module + +### PARAMETERS ##### +layer = 1 +zside = 1 +inputFileName = "../test_triggergeom.root" +outputFileName = "moduleMap.root" +#################### + + + +inputFile = ROOT.TFile.Open(inputFileName) +treeModules = inputFile.Get("hgcaltriggergeomtester/TreeModules") +treeTriggerCells = inputFile.Get("hgcaltriggergeomtester/TreeTriggerCells") +treeCells = inputFile.Get("hgcaltriggergeomtester/TreeCells") + +## filling cell map +cells = {} +cut = "layer=={0} && zside=={1}".format(layer,zside) +treeCells.Draw(">>elist1", cut, "entrylist") +entryList1 = ROOT.gDirectory.Get("elist1") +entryList1.__class__ = ROOT.TEntryList +nentry = entryList1.GetN() +treeCells.SetEntryList(entryList1) +print '>> Reading cell tree' +for ie in xrange(nentry): + if ie%10000==0: print " Entry {0}/{1}".format(ie, nentry) + entry = entryList1.GetEntry(ie) + treeCells.GetEntry(entry) + cell = Cell() + cell.id = treeCells.id + cell.zside = treeCells.zside + cell.layer = treeCells.layer + cell.wafer = treeCells.wafer + cell.wafertype = treeCells.wafertype + cell.cell = treeCells.cell + cell.center.x = treeCells.x + cell.center.y = treeCells.y + cell.center.z = treeCells.z + cell.corners[0].x = treeCells.x1 + cell.corners[0].y = treeCells.y1 + cell.corners[1].x = treeCells.x2 + cell.corners[1].y = treeCells.y2 + cell.corners[2].x = treeCells.x3 + cell.corners[2].y = treeCells.y3 + cell.corners[3].x = treeCells.x4 + cell.corners[3].y = treeCells.y4 + if cell.id not in cells: cells[cell.id] = cell + +## filling trigger cell map +triggercells = {} +treeTriggerCells.Draw(">>elist2", cut, "entrylist") +entryList2 = ROOT.gDirectory.Get("elist2") +entryList2.__class__ = ROOT.TEntryList +nentry = entryList2.GetN() +treeTriggerCells.SetEntryList(entryList2) +print '>> Reading trigger cell tree' +for ie in xrange(nentry): + if ie%10000==0: print " Entry {0}/{1}".format(ie, nentry) + entry = entryList2.GetEntry(ie) + treeTriggerCells.GetEntry(entry) + triggercell = TriggerCell() + triggercell.id = treeTriggerCells.id + triggercell.zside = treeTriggerCells.zside + triggercell.layer = treeTriggerCells.layer + triggercell.wafer = treeTriggerCells.wafer + triggercell.triggercell = treeTriggerCells.triggercell + triggercell.center.x = treeTriggerCells.x + triggercell.center.y = treeTriggerCells.y + triggercell.center.z = treeTriggerCells.z + for cellid in treeTriggerCells.c_id: + if not cellid in cells: raise StandardError("Cannot find cell {0} in trigger cell".format(cellid)) + cell = cells[cellid] + triggercell.cells.append(cell) + triggercells[triggercell.id] = triggercell + +## filling module map +modules = {} +treeModules.Draw(">>elist3", cut, "entrylist") +entryList3 = ROOT.gDirectory.Get("elist3") +entryList3.__class__ = ROOT.TEntryList +nentry = entryList3.GetN() +treeModules.SetEntryList(entryList3) +print '>> Reading module tree' +for ie in xrange(nentry): + if ie%10000==0: print " Entry {0}/{1}".format(ie, nentry) + entry = entryList3.GetEntry(ie) + treeModules.GetEntry(entry) + module = Module() + module.id = treeModules.id + module.zside = treeModules.zside + module.layer = treeModules.layer + module.module = treeModules.module + module.center.x = treeModules.x + module.center.y = treeModules.y + module.center.z = treeModules.z + for cellid in treeModules.tc_id: + if not cellid in triggercells: raise StandardError("Cannot find trigger cell {0} in module".format(cellid)) + cell = triggercells[cellid] + module.cells.append(cell) + modules[module.id] = module + +## create output canvas +outputFile = ROOT.TFile.Open(outputFileName, "RECREATE") +maxx = -99999. +minx = 99999. +maxy = -99999. +miny = 99999. +for id,triggercell in triggercells.items(): + x = triggercell.center.x + y = triggercell.center.y + if x>maxx: maxx=x + if xmaxy: maxy=y + if y0 else minx*1.2 +miny = miny*0.8 if miny>0 else miny*1.2 +maxx = maxx*1.1 if maxx>0 else maxx*0.9 +maxy = maxy*1.2 if maxy>0 else maxy*0.8 +canvas = ROOT.TCanvas("moduleMap", "moduleMap", 10000, int(10000*(maxy-miny)/(maxx-minx))) +canvas.Range(minx, miny, maxx, maxy) + +## Print trigger cells +imod = 0 +hexagons = [] +print '' +print '>> Drawing layer', layer, 'zside', zside +print ' Trigger cells are not drawn for all the modules, to reduce the (long) drawing time' +for id,module in modules.items(): + if imod%10==0: print " Drawing module {0}/{1}".format(imod, len(modules)) + imod+=1 + modulelines = [] + for triggercell in module.cells: + for cell in triggercell.cells: + hexagon = cell.hexagon() + cell.hexagon_lines() + hexagon.SetFillColor(0) + hexagon.SetLineColor(ROOT.kGray) + hexagon.Draw() + hexagons.append(hexagon) + triggercell.trigger_lines() + ## only draw trigger cells in some of the modules to save time + if module.module<100: + for line in triggercell.lines: + line.SetLineColor(ROOT.kBlack) + line.SetLineWidth(2) + line.Draw() + module.module_lines() + for line in module.lines: + line.SetLineColor(ROOT.kRed) + line.SetLineWidth(4) + line.Draw() + + +canvas.Write() +canvas.Print("moduleMap.png") + + +inputFile.Close() + + + + diff --git a/L1Trigger/L1THGCal/test/macros/waferGeometry.py b/L1Trigger/L1THGCal/test/macros/waferGeometry.py new file mode 100644 index 0000000000000..2e0f556e899f6 --- /dev/null +++ b/L1Trigger/L1THGCal/test/macros/waferGeometry.py @@ -0,0 +1,20 @@ + +largeCellWafer = { + 'cell_corner_size':0.649, + 'half_cells_edge_topleft':[107,118,126,131], + 'half_cells_edge_topright':[132,130,125,117], + 'half_cells_edge_right':[106,83,60,37], + 'half_cells_edge_bottomright':[25,14,6,1], + 'half_cells_edge_bottomleft':[0,2,7,15], + 'half_cells_edge_left':[26,49,72,95], +} + +smallCellWafer = { + 'cell_corner_size':0.476, + 'half_cells_edge_topleft':[200,214,225,233,238], + 'half_cells_edge_topright':[239,237,232,224,213], + 'half_cells_edge_right':[184,153,122,91,60], + 'half_cells_edge_bottomright':[44,29,17,8,2], + 'half_cells_edge_bottomleft':[0,3,9,18,30], + 'half_cells_edge_left':[45,76,107,138,169], +} From 8b0e83f52c4e3e89b4a2580ccfb7c13cdbbea6e5 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Thu, 12 May 2016 15:49:00 +0200 Subject: [PATCH 20/43] Compatibility updates for the hex geometry --- .../interface/fe_codecs/HGCalBestChoiceCodecImpl.h | 4 ++-- L1Trigger/L1THGCal/plugins/HGCalTriggerDigiProducer.cc | 2 +- .../L1THGCal/plugins/be_algorithms/FullModuleSumAlgo.cc | 2 +- .../python/hgcalTriggerPrimitiveDigiProducer_cfi.py | 5 +++-- .../L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc | 8 ++++---- L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc | 2 -- L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py | 5 +++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h index b92788afd0bb2..da10b90253144 100644 --- a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h +++ b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h @@ -12,8 +12,8 @@ struct HGCalBestChoiceDataPayload { - static const size_t size = 64; - typedef std::array trigger_cell_list; // list of data in 64 trigger cells + static const size_t size = 128; + typedef std::array trigger_cell_list; // list of data in 128 trigger cells trigger_cell_list payload; void reset() diff --git a/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiProducer.cc b/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiProducer.cc index 3a4ee54836876..f06fd66bc3d62 100644 --- a/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiProducer.cc +++ b/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiProducer.cc @@ -105,7 +105,7 @@ void HGCalTriggerDigiProducer::produce(edm::Event& e, const edm::EventSetup& es) l1t::HGCFETriggerDigi& digi = fe_output->back(); codec_->setDataPayload(*(module.second),ee_digis,fh_digis,bh_digis); codec_->encode(digi); - digi.setDetId( HGCTriggerDetId(module.first) ); + digi.setDetId( HGCalDetId(module.first) ); std::stringstream output; codec_->print(digi,output); edm::LogInfo("HGCalTriggerDigiProducer") diff --git a/L1Trigger/L1THGCal/plugins/be_algorithms/FullModuleSumAlgo.cc b/L1Trigger/L1THGCal/plugins/be_algorithms/FullModuleSumAlgo.cc index c3ac0590c9b58..f67b63f34ba26 100644 --- a/L1Trigger/L1THGCal/plugins/be_algorithms/FullModuleSumAlgo.cc +++ b/L1Trigger/L1THGCal/plugins/be_algorithms/FullModuleSumAlgo.cc @@ -46,7 +46,7 @@ void FullModuleSumAlgo::run(const l1t::HGCFETriggerDigiCollection& coll, { HGCalBestChoiceCodec::data_type data; data.reset(); - const HGCTriggerDetId& moduleId = digi.getDetId(); + const HGCalDetId& moduleId = digi.getDetId(); digi.decode(codec_, data); // Sum of trigger cells inside the module diff --git a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py index 78d85b66adee4..61f87cb4fbe75 100644 --- a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py @@ -25,8 +25,9 @@ fhDigis = cms.InputTag('mix:HGCDigisHEfront'), bhDigis = cms.InputTag('mix:HGCDigisHEback'), TriggerGeometry = cms.PSet( - TriggerGeometryName = cms.string('HGCalTriggerGeometryImp1'), - L1TCellsMapping = cms.FileInPath("L1Trigger/L1THGCal/data/cellsToTriggerCellsMap.txt"), + TriggerGeometryName = cms.string('HGCalTriggerGeometryHexImp1'), + L1TCellsMapping = cms.FileInPath("L1Trigger/L1THGCal/data/triggercell_mapping.txt"), + L1TModulesMapping = cms.FileInPath("L1Trigger/L1THGCal/data/module_mapping.txt"), eeSDName = cms.string('HGCalEESensitive'), fhSDName = cms.string('HGCalHESiliconSensitive'), bhSDName = cms.string('HGCalHEScintillatorSensitive'), diff --git a/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc b/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc index c458514aab149..743d85e80463d 100644 --- a/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc +++ b/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc @@ -120,7 +120,7 @@ void HGCalBestChoiceCodecImpl::linearize(const HGCalTriggerGeometry::Module& mod void HGCalBestChoiceCodecImpl::triggerCellSums(const HGCalTriggerGeometry::Module& mod, const std::vector >& linearized_dataframes, data_type& data) /*****************************************************************/ { - std::map payload; + std::map payload; // sum energies in trigger cells for(const auto& frame : linearized_dataframes) { @@ -141,7 +141,7 @@ void HGCalBestChoiceCodecImpl::triggerCellSums(const HGCalTriggerGeometry::Modul throw cms::Exception("BadGeometry") << "Cannot find trigger cell corresponding to HGC cell "<nCellsInModule_) // cell number starts at 1 + if(id>=nCellsInModule_) { throw cms::Exception("BadGeometry") << "Number of trigger cells in module too large for available data payload\n"; } - data.payload.at(id-1) = id_value.second; + data.payload.at(id) = id_value.second; } } diff --git a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc index 0a008f95fca39..fc4ecdc39c406 100644 --- a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc +++ b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc @@ -31,8 +31,6 @@ #include #include "TH2.h" -//steph -#include "DataFormats/ForwardDetId/interface/HGCEEDetId.h" using namespace std; diff --git a/L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py b/L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py index 141b90b3c1fec..537de204e33b6 100644 --- a/L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py +++ b/L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py @@ -112,8 +112,9 @@ fhDigis = cms.InputTag('mix:HGCDigisHEfront'), bhDigis = cms.InputTag('mix:HGCDigisHEback'), TriggerGeometry = cms.PSet( - TriggerGeometryName = cms.string('HGCalTriggerGeometryImp1'), - L1TCellsMapping = cms.FileInPath("L1Trigger/L1THGCal/data/cellsToTriggerCellsMap.txt"), + TriggerGeometryName = cms.string('HGCalTriggerGeometryHexImp1'), + L1TCellsMapping = cms.FileInPath("L1Trigger/L1THGCal/data/triggercell_mapping.txt"), + L1TModulesMapping = cms.FileInPath("L1Trigger/L1THGCal/data/module_mapping.txt"), eeSDName = cms.string('HGCalEESensitive'), fhSDName = cms.string('HGCalHESiliconSensitive'), bhSDName = cms.string('HGCalHEScintillatorSensitive'), From ef48069849ae83e6905b7b1c006632ddbbdd93b5 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Thu, 12 May 2016 17:22:08 +0200 Subject: [PATCH 21/43] Update hgc tpg test config --- L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py | 26 +++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py b/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py index 0ed350856b2dd..20cee64960130 100644 --- a/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py +++ b/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py @@ -1,17 +1,16 @@ import FWCore.ParameterSet.Config as cms -process = cms.Process('SIMDIGI') +from Configuration.StandardSequences.Eras import eras + +process = cms.Process('DIGI',eras.Phase2) # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') -process.load('FWCore.MessageService.MessageLogger_cfi') -process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.Geometry.GeometryExtended2023HGCalMuonReco_cff') -process.load('Configuration.Geometry.GeometryExtended2023HGCalMuon_cff') +process.load('Configuration.Geometry.GeometryExtended2023LRecoReco_cff') process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedGauss_cfi') @@ -23,8 +22,9 @@ process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(10) + input = cms.untracked.int32(1) ) # Input source @@ -43,11 +43,11 @@ # Output definition -process.FEVTDEBUGHLToutput = cms.OutputModule("PoolOutputModule", +process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", splitLevel = cms.untracked.int32(0), eventAutoFlushCompressedSize = cms.untracked.int32(5242880), - outputCommands = process.FEVTDEBUGHLTEventContent.outputCommands, - fileName = cms.untracked.string('file:junk.root'), + outputCommands = process.FEVTDEBUGEventContent.outputCommands, + fileName = cms.untracked.string('file:test.root'), dataset = cms.untracked.PSet( filterName = cms.untracked.string(''), dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW') @@ -62,7 +62,7 @@ # Other statements process.genstepfilter.triggerConditions=cms.vstring("generation_step") from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgradePLS3', '') +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '') process.generator = cms.EDProducer("FlatRandomPtGunProducer", PGunParameters = cms.PSet( @@ -94,6 +94,8 @@ process.hgcl1tpg_step = cms.Path(process.hgcalTriggerPrimitives) process.digi2raw_step = cms.Path(process.DigiToRaw) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) # Schedule definition process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.digitisation_step,process.L1simulation_step,process.hgcl1tpg_step,process.digi2raw_step) @@ -104,10 +106,10 @@ # customisation of the process. # Automatic addition of the customisation function from SLHCUpgradeSimulations.Configuration.combinedCustoms -from SLHCUpgradeSimulations.Configuration.combinedCustoms import cust_2023HGCalMuon +from SLHCUpgradeSimulations.Configuration.combinedCustoms import cust_2023LReco #call to customisation function cust_2023HGCalMuon imported from SLHCUpgradeSimulations.Configuration.combinedCustoms -process = cust_2023HGCalMuon(process) +process = cust_2023LReco(process) # End of customisation functions From 1986abd95bb4b3d4f4c453655af1df4308a5a69f Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Thu, 26 May 2016 15:50:17 +0200 Subject: [PATCH 22/43] Add producer using HGC FEDigis as input --- .../interface/HGCalTriggerFECodecBase.h | 13 ++ .../fe_codecs/HGCal64BitRandomCodec.h | 3 + .../fe_codecs/HGCalBestChoiceCodec.h | 3 + .../plugins/HGCalTriggerDigiFEReproducer.cc | 117 ++++++++++++++++++ .../fe_codecs/HGCal64BitRandomCodec.cc | 6 + .../plugins/fe_codecs/HGCalBestChoiceCodec.cc | 12 ++ .../hgcalTriggerPrimitiveDigiProducer_cfi.py | 27 ++-- .../python/hgcalTriggerPrimitives_cff.py | 2 + L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py | 12 +- 9 files changed, 185 insertions(+), 10 deletions(-) create mode 100644 L1Trigger/L1THGCal/plugins/HGCalTriggerDigiFEReproducer.cc diff --git a/L1Trigger/L1THGCal/interface/HGCalTriggerFECodecBase.h b/L1Trigger/L1THGCal/interface/HGCalTriggerFECodecBase.h index 8a8add31ef6de..dee9231fd6440 100644 --- a/L1Trigger/L1THGCal/interface/HGCalTriggerFECodecBase.h +++ b/L1Trigger/L1THGCal/interface/HGCalTriggerFECodecBase.h @@ -43,6 +43,8 @@ class HGCalTriggerFECodecBase { const HGCEEDigiCollection&, const HGCHEDigiCollection&, const HGCHEDigiCollection& ) = 0; + virtual void setDataPayload(const Module& , + const l1t::HGCFETriggerDigi& ) = 0; virtual void unSetDataPayload() = 0; // get the set data out for your own enjoyment virtual std::vector getDataPayload() const = 0; @@ -103,6 +105,17 @@ namespace HGCalTriggerFE { dataIsSet_ = true; } + virtual void setDataPayload(const Module& mod, + const l1t::HGCFETriggerDigi& digi) override final { + if( dataIsSet_ ) { + edm::LogWarning("HGCalTriggerFECodec|OverwritePayload") + << "Data payload was already set for HGCTriggerFECodec: " + << this->name() << " overwriting current data!"; + } + static_cast(*this).setDataPayloadImpl(mod,digi); + dataIsSet_ = true; + } + virtual void unSetDataPayload() override final { data_.reset(); dataIsSet_ = false; diff --git a/L1Trigger/L1THGCal/interface/fe_codecs/HGCal64BitRandomCodec.h b/L1Trigger/L1THGCal/interface/fe_codecs/HGCal64BitRandomCodec.h index b1c1f34634748..a80a6f0c54c9b 100644 --- a/L1Trigger/L1THGCal/interface/fe_codecs/HGCal64BitRandomCodec.h +++ b/L1Trigger/L1THGCal/interface/fe_codecs/HGCal64BitRandomCodec.h @@ -26,6 +26,9 @@ class HGCal64BitRandomCodec : public HGCalTriggerFE::Codec encodeImpl(const data_type&) const ; data_type decodeImpl(const std::vector&) const; diff --git a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodec.h b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodec.h index c181b0308a23b..7e270b455d88f 100644 --- a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodec.h +++ b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodec.h @@ -28,6 +28,9 @@ class HGCalBestChoiceCodec : public HGCalTriggerFE::Codec encodeImpl(const data_type&) const ; data_type decodeImpl(const std::vector&) const; diff --git a/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiFEReproducer.cc b/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiFEReproducer.cc new file mode 100644 index 0000000000000..03ed70c5e8064 --- /dev/null +++ b/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiFEReproducer.cc @@ -0,0 +1,117 @@ +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDProducer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "DataFormats/L1THGCal/interface/HGCFETriggerDigi.h" +#include "DataFormats/L1THGCal/interface/HGCFETriggerDigiFwd.h" +#include "DataFormats/HGCDigi/interface/HGCDigiCollections.h" +#include "DataFormats/ForwardDetId/interface/HGCTriggerDetId.h" + +#include "L1Trigger/L1THGCal/interface/HGCalTriggerGeometryBase.h" +#include "L1Trigger/L1THGCal/interface/HGCalTriggerFECodecBase.h" +#include "L1Trigger/L1THGCal/interface/HGCalTriggerBackendProcessor.h" + +#include +#include + +class HGCalTriggerDigiFEReproducer : public edm::EDProducer +{ + public: + HGCalTriggerDigiFEReproducer(const edm::ParameterSet&); + ~HGCalTriggerDigiFEReproducer() { } + + virtual void beginRun(const edm::Run&, const edm::EventSetup&); + virtual void produce(edm::Event&, const edm::EventSetup&); + + private: + // inputs + edm::EDGetToken inputdigi_; + // algorithm containers + std::unique_ptr triggerGeometry_; + std::unique_ptr codec_; + HGCalTriggerBackendProcessor backEndProcessor_; +}; + +DEFINE_FWK_MODULE(HGCalTriggerDigiFEReproducer); + + +/*****************************************************************/ +HGCalTriggerDigiFEReproducer::HGCalTriggerDigiFEReproducer(const edm::ParameterSet& conf): + inputdigi_(consumes(conf.getParameter("feDigis"))), + backEndProcessor_(conf.getParameterSet("BEConfiguration")) +/*****************************************************************/ +{ + //setup geometry configuration + const edm::ParameterSet& geometryConfig = conf.getParameterSet("TriggerGeometry"); + const std::string& trigGeomName = geometryConfig.getParameter("TriggerGeometryName"); + HGCalTriggerGeometryBase* geometry = HGCalTriggerGeometryFactory::get()->create(trigGeomName,geometryConfig); + triggerGeometry_.reset(geometry); + + //setup FE codec + const edm::ParameterSet& feCodecConfig = conf.getParameterSet("FECodec"); + const std::string& feCodecName = feCodecConfig.getParameter("CodecName"); + HGCalTriggerFECodecBase* codec = HGCalTriggerFECodecFactory::get()->create(feCodecName,feCodecConfig); + codec_.reset(codec); + codec_->unSetDataPayload(); + + produces(); + // register backend processor products + backEndProcessor_.setProduces(*this); +} + +/*****************************************************************/ +void HGCalTriggerDigiFEReproducer::beginRun(const edm::Run& /*run*/, const edm::EventSetup& es) +/*****************************************************************/ +{ + triggerGeometry_->reset(); + HGCalTriggerGeometryBase::es_info info; + const std::string& ee_sd_name = triggerGeometry_->eeSDName(); + const std::string& fh_sd_name = triggerGeometry_->fhSDName(); + const std::string& bh_sd_name = triggerGeometry_->bhSDName(); + es.get().get(ee_sd_name,info.geom_ee); + es.get().get(fh_sd_name,info.geom_fh); + es.get().get(bh_sd_name,info.geom_bh); + es.get().get(ee_sd_name,info.topo_ee); + es.get().get(fh_sd_name,info.topo_fh); + es.get().get(bh_sd_name,info.topo_bh); + triggerGeometry_->initialize(info); +} + +/*****************************************************************/ +void HGCalTriggerDigiFEReproducer::produce(edm::Event& e, const edm::EventSetup& es) +/*****************************************************************/ +{ + std::auto_ptr fe_output( new l1t::HGCFETriggerDigiCollection ); + + edm::Handle digis_h; + + e.getByToken(inputdigi_,digis_h); + + const l1t::HGCFETriggerDigiCollection& digis = *digis_h; + + for( const auto& digi_in : digis ) + { + const auto& module = triggerGeometry_->modules().at(digi_in.id()); + fe_output->push_back(l1t::HGCFETriggerDigi()); + l1t::HGCFETriggerDigi& digi_out = fe_output->back(); + codec_->setDataPayload(*module, digi_in); + codec_->encode(digi_out); + digi_out.setDetId( digi_in.getDetId() ); + std::stringstream output; + codec_->print(digi_out,output); + edm::LogInfo("HGCalTriggerDigiFEReproducer") + << output.str(); + codec_->unSetDataPayload(); + } + + // get the orphan handle and fe digi collection + auto fe_digis_handle = e.put(fe_output); + auto fe_digis_coll = *fe_digis_handle; + + //now we run the emulation of the back-end processor + backEndProcessor_.run(fe_digis_coll,triggerGeometry_); + backEndProcessor_.putInEvent(e); + backEndProcessor_.reset(); +} diff --git a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCal64BitRandomCodec.cc b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCal64BitRandomCodec.cc index 0e16c11062797..e5276b95fa748 100644 --- a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCal64BitRandomCodec.cc +++ b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCal64BitRandomCodec.cc @@ -14,6 +14,12 @@ setDataPayloadImpl(const Module& , codecImpl_.setDataPayload(data_); } +void HGCal64BitRandomCodec:: +setDataPayloadImpl(const Module& mod, + const l1t::HGCFETriggerDigi& digi) { + codecImpl_.setDataPayload(data_); +} + std::vector HGCal64BitRandomCodec:: encodeImpl(const HGCal64BitRandomCodec::data_type& data) const { diff --git a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc index e8f4c1c7da0e7..91716855d6abb 100644 --- a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc +++ b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc @@ -42,6 +42,18 @@ void HGCalBestChoiceCodec::setDataPayloadImpl(const Module& mod, } +/*****************************************************************/ +void HGCalBestChoiceCodec::setDataPayloadImpl(const Module& mod, + const l1t::HGCFETriggerDigi& digi) +/*****************************************************************/ +{ + data_.reset(); + digi.decode(*this,data_); + // choose best trigger cells in the module + codecImpl_.bestChoiceSelect(data_); + +} + /*****************************************************************/ std::vector HGCalBestChoiceCodec::encodeImpl(const HGCalBestChoiceCodec::data_type& data) const diff --git a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py index 61f87cb4fbe75..b2eaaebab596e 100644 --- a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py @@ -15,6 +15,14 @@ tdcOnsetfC = digiparam.hgceeDigitizer.digiCfg.feCfg.tdcOnset_fC ) +geometry = cms.PSet( TriggerGeometryName = cms.string('HGCalTriggerGeometryHexImp1'), + L1TCellsMapping = cms.FileInPath("L1Trigger/L1THGCal/data/triggercell_mapping.txt"), + L1TModulesMapping = cms.FileInPath("L1Trigger/L1THGCal/data/module_mapping.txt"), + eeSDName = cms.string('HGCalEESensitive'), + fhSDName = cms.string('HGCalHESiliconSensitive'), + bhSDName = cms.string('HGCalHEScintillatorSensitive'), + ) + cluster_algo = cms.PSet( AlgorithmName = cms.string('FullModuleSumAlgo'), FECodec = fe_codec ) @@ -24,14 +32,17 @@ eeDigis = cms.InputTag('mix:HGCDigisEE'), fhDigis = cms.InputTag('mix:HGCDigisHEfront'), bhDigis = cms.InputTag('mix:HGCDigisHEback'), - TriggerGeometry = cms.PSet( - TriggerGeometryName = cms.string('HGCalTriggerGeometryHexImp1'), - L1TCellsMapping = cms.FileInPath("L1Trigger/L1THGCal/data/triggercell_mapping.txt"), - L1TModulesMapping = cms.FileInPath("L1Trigger/L1THGCal/data/module_mapping.txt"), - eeSDName = cms.string('HGCalEESensitive'), - fhSDName = cms.string('HGCalHESiliconSensitive'), - bhSDName = cms.string('HGCalHEScintillatorSensitive'), - ), + TriggerGeometry = geometry, + FECodec = fe_codec, + BEConfiguration = cms.PSet( + algorithms = cms.VPSet( cluster_algo ) + ) + ) + +hgcalTriggerPrimitiveDigiFEReproducer = cms.EDProducer( + "HGCalTriggerDigiFEReproducer", + feDigis = cms.InputTag('hgcalTriggerPrimitiveDigiProducer'), + TriggerGeometry = geometry, FECodec = fe_codec, BEConfiguration = cms.PSet( algorithms = cms.VPSet( cluster_algo ) diff --git a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitives_cff.py b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitives_cff.py index 24ebaba4da8b2..b7f05222833fa 100644 --- a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitives_cff.py +++ b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitives_cff.py @@ -3,3 +3,5 @@ from L1Trigger.L1THGCal.hgcalTriggerPrimitiveDigiProducer_cfi import * hgcalTriggerPrimitives = cms.Sequence(hgcalTriggerPrimitiveDigiProducer) + +hgcalTriggerPrimitives_reproduce = cms.Sequence(hgcalTriggerPrimitiveDigiFEReproducer) diff --git a/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py b/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py index 20cee64960130..974205f3df343 100644 --- a/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py +++ b/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py @@ -46,7 +46,15 @@ process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", splitLevel = cms.untracked.int32(0), eventAutoFlushCompressedSize = cms.untracked.int32(5242880), - outputCommands = process.FEVTDEBUGEventContent.outputCommands, + #outputCommands = process.FEVTDEBUGEventContent.outputCommands, + outputCommands = cms.untracked.vstring( + 'keep *_*_HGCHitsEE_*', + 'keep *_*_HGCHitsHEback_*', + 'keep *_*_HGCHitsHEfront_*', + 'keep *_mix_*_*', + 'keep *_genParticles_*_*', + 'keep *_hgcalTriggerPrimitiveDigiProducer_*_*' + ), fileName = cms.untracked.string('file:test.root'), dataset = cms.untracked.PSet( filterName = cms.untracked.string(''), @@ -98,7 +106,7 @@ process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) # Schedule definition -process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.digitisation_step,process.L1simulation_step,process.hgcl1tpg_step,process.digi2raw_step) +process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.digitisation_step,process.L1simulation_step,process.hgcl1tpg_step,process.digi2raw_step,process.endjob_step, process.FEVTDEBUGoutput_step) # filter all path with the production filter sequence for path in process.paths: getattr(process,path)._seq = process.generator * getattr(process,path)._seq From 5dfd6e797368f415c83f3b4496f5b6451d1439c0 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Thu, 26 May 2016 18:27:09 +0200 Subject: [PATCH 23/43] Add input FE digi decoding using alternative parameters in HGCalBestChoiceCodec --- .../fe_codecs/HGCalBestChoiceCodecImpl.h | 11 +++++++++++ .../plugins/fe_codecs/HGCalBestChoiceCodec.cc | 17 ++++++++++++++++- L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h index da10b90253144..bbaa253406bf6 100644 --- a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h +++ b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h @@ -39,6 +39,17 @@ class HGCalBestChoiceCodecImpl void triggerCellSums(const HGCalTriggerGeometry::Module& , const std::vector >&, data_type&); void bestChoiceSelect(data_type&); + // Retrieve parameters + size_t nData() const {return nData_;} + size_t dataLength() const {return dataLength_;} + double linLSB() const {return linLSB_;} + double adcsaturation() const {return adcsaturation_;} + uint32_t adcnBits() const {return adcnBits_;} + double tdcsaturation() const {return tdcsaturation_;} + uint32_t tdcnBits() const {return tdcnBits_;} + double tdcOnsetfC() const {return tdcOnsetfC_;} + + private: size_t nData_; size_t dataLength_; diff --git a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc index 91716855d6abb..cb68bfe24a1e4 100644 --- a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc +++ b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc @@ -48,7 +48,22 @@ void HGCalBestChoiceCodec::setDataPayloadImpl(const Module& mod, /*****************************************************************/ { data_.reset(); - digi.decode(*this,data_); + edm::ParameterSet conf; + conf.addParameter("CodecName", name()); + conf.addParameter ("CodecIndex", getCodecType()); + conf.addParameter ("NData", HGCalBestChoiceCodec::data_type::size); + conf.addParameter ("DataLength", codecImpl_.dataLength()); + conf.addParameter ("linLSB", codecImpl_.linLSB()); + conf.addParameter ("adcsaturation", codecImpl_.adcsaturation()); + conf.addParameter ("adcnBits", codecImpl_.adcnBits()); + conf.addParameter ("tdcsaturation", codecImpl_.tdcsaturation()); + conf.addParameter ("tdcnBits", codecImpl_.tdcnBits()); + conf.addParameter ("tdcOnsetfC", codecImpl_.tdcOnsetfC()); + // decode input data with different parameters + // (no selection, so NData=number of trigger cells in module) + // Not very clean to define an alternative codec within this codec + HGCalBestChoiceCodec codecInput(conf); + digi.decode(codecInput,data_); // choose best trigger cells in the module codecImpl_.bestChoiceSelect(data_); diff --git a/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py b/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py index 974205f3df343..90bbd528bc0db 100644 --- a/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py +++ b/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py @@ -99,6 +99,7 @@ process.L1simulation_step = cms.Path(process.SimL1Emulator) process.load('L1Trigger.L1THGCal.hgcalTriggerPrimitives_cff') +process.hgcalTriggerPrimitiveDigiProducer.FECodec.NData = cms.uint32(128) process.hgcl1tpg_step = cms.Path(process.hgcalTriggerPrimitives) process.digi2raw_step = cms.Path(process.DigiToRaw) From a6d58a7c0a4cedeb1f271e255bc26c097d3b7503 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Fri, 27 May 2016 09:55:26 +0200 Subject: [PATCH 24/43] Add const to decoded digi --- L1Trigger/L1THGCal/interface/HGCalTriggerFECodecBase.h | 6 +++--- .../L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/L1Trigger/L1THGCal/interface/HGCalTriggerFECodecBase.h b/L1Trigger/L1THGCal/interface/HGCalTriggerFECodecBase.h index dee9231fd6440..7845b1d38d5b7 100644 --- a/L1Trigger/L1THGCal/interface/HGCalTriggerFECodecBase.h +++ b/L1Trigger/L1THGCal/interface/HGCalTriggerFECodecBase.h @@ -44,7 +44,7 @@ class HGCalTriggerFECodecBase { const HGCHEDigiCollection&, const HGCHEDigiCollection& ) = 0; virtual void setDataPayload(const Module& , - const l1t::HGCFETriggerDigi& ) = 0; + const l1t::HGCFETriggerDigi&) = 0; virtual void unSetDataPayload() = 0; // get the set data out for your own enjoyment virtual std::vector getDataPayload() const = 0; @@ -52,7 +52,7 @@ class HGCalTriggerFECodecBase { // abstract interface to manipulating l1t::HGCFETriggerDigis // these will yell at you if you haven't set the data in the Codec class virtual void encode(l1t::HGCFETriggerDigi&) = 0; - virtual void decode(l1t::HGCFETriggerDigi&) = 0; + virtual void decode(const l1t::HGCFETriggerDigi&) = 0; virtual void print(const l1t::HGCFETriggerDigi& digi, std::ostream& out = std::cout) const = 0; @@ -82,7 +82,7 @@ namespace HGCalTriggerFE { } digi.encode(static_cast(*this),data_); } - virtual void decode(l1t::HGCFETriggerDigi& digi) override final { + virtual void decode(const l1t::HGCFETriggerDigi& digi) override final { if( dataIsSet_ ) { edm::LogWarning("HGCalTriggerFECodec|OverwritePayload") << "Data payload was already set for HGCTriggerFECodec: " diff --git a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc index cb68bfe24a1e4..7c155c347787d 100644 --- a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc +++ b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc @@ -61,7 +61,9 @@ void HGCalBestChoiceCodec::setDataPayloadImpl(const Module& mod, conf.addParameter ("tdcOnsetfC", codecImpl_.tdcOnsetfC()); // decode input data with different parameters // (no selection, so NData=number of trigger cells in module) + // FIXME: // Not very clean to define an alternative codec within this codec + // Also, the codec is built each time the method is called, which is not very efficient HGCalBestChoiceCodec codecInput(conf); digi.decode(codecInput,data_); // choose best trigger cells in the module From d73b6728bf06632a692dd123d29fa72bd740d55a Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Fri, 27 May 2016 10:00:42 +0200 Subject: [PATCH 25/43] Fix parameters in best choice unit test --- .../L1THGCal/test/unittest_bestchoicecodec.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/L1Trigger/L1THGCal/test/unittest_bestchoicecodec.cc b/L1Trigger/L1THGCal/test/unittest_bestchoicecodec.cc index 1bfbea496a561..77712d6439430 100644 --- a/L1Trigger/L1THGCal/test/unittest_bestchoicecodec.cc +++ b/L1Trigger/L1THGCal/test/unittest_bestchoicecodec.cc @@ -30,10 +30,16 @@ void TestBestChoiceCodec::setUp() /*****************************************************************/ { edm::ParameterSet params; - params.addParameter("CodecName", "HGCalBestChoiceCodec"); - params.addParameter("CodecIndex", 1); - params.addParameter("NData", 12); - params.addParameter("DataLength", 8); + params.addParameter("CodecName", "HGCalBestChoiceCodec"); + params.addParameter ("CodecIndex", 1); + params.addParameter ("NData", 12); + params.addParameter ("DataLength", 8); + params.addParameter ("linLSB", 100./1024. ); + params.addParameter ("adcsaturation", 100.); + params.addParameter ("adcnBits", 10); + params.addParameter ("tdcsaturation", 10000 ); + params.addParameter ("tdcnBits", 12); + params.addParameter ("tdcOnsetfC", 60); codec_.reset(new HGCalBestChoiceCodecImpl(params)); } From 74190ce4eb8ed34ffa750c49ccbb2e0d1761cfcf Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Wed, 1 Jun 2016 14:34:31 +0200 Subject: [PATCH 26/43] Add single trigger cell clustering algo --- DataFormats/L1THGCal/interface/HGCalCluster.h | 73 +++++--------- DataFormats/L1THGCal/src/HGCalCluster.cc | 95 +------------------ .../be_algorithms/SingleCellClusterAlgo.cc | 76 +++++++++++++++ 3 files changed, 100 insertions(+), 144 deletions(-) create mode 100644 L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc diff --git a/DataFormats/L1THGCal/interface/HGCalCluster.h b/DataFormats/L1THGCal/interface/HGCalCluster.h index 67f22bcd68adb..74cad31fe9e30 100644 --- a/DataFormats/L1THGCal/interface/HGCalCluster.h +++ b/DataFormats/L1THGCal/interface/HGCalCluster.h @@ -7,26 +7,6 @@ namespace l1t { class HGCalCluster : public L1Candidate { - public: - // FIXME: remnants of Stage-2 calo trigger to be removed - enum ClusterFlag{ - INCLUDE_SEED = 0, - INCLUDE_NW = 1, - INCLUDE_N = 2, - INCLUDE_NE = 3, - INCLUDE_E = 4, - INCLUDE_SE = 5, - INCLUDE_S = 6, - INCLUDE_SW = 7, - INCLUDE_W = 8, - INCLUDE_NN = 9, - INCLUDE_SS = 10, - TRIM_LEFT = 11, - IS_SECONDARY = 12, - MERGE_UPDOWN = 13, // 0=up, 1=down - MERGE_LEFTRIGHT = 14 // 0=left, 1=right - }; - public: HGCalCluster(){} HGCalCluster( const LorentzVector p4, @@ -37,28 +17,24 @@ namespace l1t { ~HGCalCluster(); + void setHwPtEm (uint32_t pt) {hwPtEm_= pt;} + void setHwPtHad (uint32_t pt) {hwPtHad_ = pt;} + void setHwSeedPt(uint32_t pt) {hwSeedPt_ = pt;} + void setSubDet (uint32_t subdet){subDet_ = subdet;} + void setLayer (uint32_t layer) {layer_ = layer;} + void setModule (uint32_t module) {module_ = module;} + void setHOverE (uint32_t hOverE){hOverE_ = hOverE;} + bool isValid() const {return true;} + uint32_t hwPtEm() const {return hwPtEm_;} + uint32_t hwPtHad() const {return hwPtHad_;} + uint32_t hwSeedPt() const {return hwSeedPt_;} + uint32_t subDet() const {return subDet_;} + uint32_t layer() const {return layer_;} + uint32_t module() const {return module_;} - void setClusterFlag(ClusterFlag flag, bool val=true); - void setHwPtEm( int pt ); - void setHwPtHad( int pt ); - void setHwSeedPt(int pt); - void setFgEta(int fgEta); - void setFgPhi(int fgPhi); - void setHOverE(int hOverE); - void setFgECAL(int fgECAL); - - bool checkClusterFlag(ClusterFlag flag) const; - bool isValid() const; - int hwPtEm() const; - int hwPtHad() const; - int hwSeedPt() const; - int fgEta() const; - int fgPhi() const; - int hOverE() const; - int fgECAL() const; - int clusterFlags() const{return m_clusterFlags;} + uint32_t hOverE() const {return hOverE_;} bool operator<(const HGCalCluster& cl) const; bool operator>(const HGCalCluster& cl) const {return cl<*this;}; @@ -66,21 +42,18 @@ namespace l1t { bool operator>=(const HGCalCluster& cl) const {return !(cl<*this);}; private: - // Summary of clustering outcomes - int m_clusterFlags; // see ClusterFlag bits (15 bits, will evolve) - // Energies - int m_hwPtEm; - int m_hwPtHad; - int m_hwSeedPt; + uint32_t hwPtEm_; + uint32_t hwPtHad_; + uint32_t hwSeedPt_; - // fine grained position - int m_fgEta; // 2 bits (to be defined in agreement with GT inputs) - int m_fgPhi; // 2 bits (to be defined in agreement with GT inputs) + // HGC specific information + uint32_t subDet_; + uint32_t layer_; + uint32_t module_; // identification variables - int m_hOverE; // 8 bits (between 0 and 1 -> resolution=1/256=0.39%). Number of bits is not definitive - int m_fgECAL; // FG bit of the seed tower + uint32_t hOverE_; }; typedef BXVector HGCalClusterBxCollection; diff --git a/DataFormats/L1THGCal/src/HGCalCluster.cc b/DataFormats/L1THGCal/src/HGCalCluster.cc index ed0f8bdc6c5c4..2b90c36fe3a93 100644 --- a/DataFormats/L1THGCal/src/HGCalCluster.cc +++ b/DataFormats/L1THGCal/src/HGCalCluster.cc @@ -6,8 +6,7 @@ HGCalCluster::HGCalCluster( const LorentzVector p4, int pt, int eta, int phi) - : L1Candidate(p4, pt, eta, phi), - m_clusterFlags(0x7FF) // first 11 flags at 1 + : L1Candidate(p4, pt, eta, phi) { } @@ -17,98 +16,6 @@ HGCalCluster::~HGCalCluster() } -void HGCalCluster::setClusterFlag(ClusterFlag flag, bool val) -{ - if(val) - { - m_clusterFlags |= (0x1< +{ + public: + + SingleCellClusterAlgo(const edm::ParameterSet& conf): + Algorithm(conf), + cluster_product( new l1t::HGCalClusterBxCollection ){} + + virtual void setProduces(edm::EDProducer& prod) const override final + { + prod.produces(name()); + } + + virtual void run(const l1t::HGCFETriggerDigiCollection& coll, + const std::unique_ptr& geom) override final; + + virtual void putInEvent(edm::Event& evt) override final + { + evt.put(cluster_product,name()); + } + + virtual void reset() override final + { + cluster_product.reset( new l1t::HGCalClusterBxCollection ); + } + + private: + std::auto_ptr cluster_product; + +}; + +/*****************************************************************/ +void SingleCellClusterAlgo::run(const l1t::HGCFETriggerDigiCollection& coll, + const std::unique_ptr& geom) +/*****************************************************************/ +{ + std::cout<<"####################################\n"; + for( const auto& digi : coll ) + { + HGCalBestChoiceCodec::data_type data; + data.reset(); + const HGCalDetId& moduleId = digi.getDetId(); + digi.decode(codec_, data); + std::cout<<"zside="<0) + { + // dummy cluster without position + // index in module stored as hwEta + l1t::HGCalCluster cluster( reco::LeafCandidate::LorentzVector(), + value, i, 0); + cluster.setModule(moduleId.wafer()); + cluster.setLayer(moduleId.layer()); + cluster.setSubDet(moduleId.zside()<0 ? 0 : 1); + cluster_product->push_back(0,cluster); + } + i++; + } + + } +} + +DEFINE_EDM_PLUGIN(HGCalTriggerBackendAlgorithmFactory, + SingleCellClusterAlgo, + "SingleCellClusterAlgo"); From e9f4c204a601ff0df99c8e2ae7c01d13f2de0815 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Thu, 2 Jun 2016 09:34:41 +0200 Subject: [PATCH 27/43] Add parameter for trigger cell value truncation. Update best choice tester. --- .../fe_codecs/HGCalBestChoiceCodecImpl.h | 4 + .../be_algorithms/SingleCellClusterAlgo.cc | 3 - .../plugins/fe_codecs/HGCalBestChoiceCodec.cc | 14 ++-- .../hgcalTriggerPrimitiveDigiProducer_cfi.py | 5 +- .../src/fe_codecs/HGCalBestChoiceCodecImpl.cc | 16 ++-- L1Trigger/L1THGCal/test/BuildFile.xml | 1 + .../test/HGCalTriggerBestChoiceTester.cc | 77 ++++++++++++++++++- .../test/testHGCalL1TBestChoice_cfg.py | 68 ++++++++++------ 8 files changed, 141 insertions(+), 47 deletions(-) diff --git a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h index bbaa253406bf6..c576232e77868 100644 --- a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h +++ b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h @@ -48,6 +48,8 @@ class HGCalBestChoiceCodecImpl double tdcsaturation() const {return tdcsaturation_;} uint32_t tdcnBits() const {return tdcnBits_;} double tdcOnsetfC() const {return tdcOnsetfC_;} + uint32_t triggerCellTruncationBits() const {return triggerCellTruncationBits_;} + uint32_t triggerCellSaturationBits() const {return triggerCellSaturationBits_;} private: @@ -62,6 +64,8 @@ class HGCalBestChoiceCodecImpl double tdcOnsetfC_ ; double adcLSB_; double tdcLSB_; + uint32_t triggerCellTruncationBits_; + uint32_t triggerCellSaturationBits_; }; diff --git a/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc b/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc index b6a30b10085f3..0996e913e1d4a 100644 --- a/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc +++ b/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc @@ -42,18 +42,15 @@ void SingleCellClusterAlgo::run(const l1t::HGCFETriggerDigiCollection& coll, const std::unique_ptr& geom) /*****************************************************************/ { - std::cout<<"####################################\n"; for( const auto& digi : coll ) { HGCalBestChoiceCodec::data_type data; data.reset(); const HGCalDetId& moduleId = digi.getDetId(); digi.decode(codec_, data); - std::cout<<"zside="<0) { // dummy cluster without position diff --git a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc index 7c155c347787d..768d8ff39f1ee 100644 --- a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc +++ b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc @@ -48,10 +48,17 @@ void HGCalBestChoiceCodec::setDataPayloadImpl(const Module& mod, /*****************************************************************/ { data_.reset(); + // decode input data with different parameters + // (no selection, so NData=number of trigger cells in module) + // FIXME: + // Not very clean to define an alternative codec within this codec + // Also, the codec is built each time the method is called, which is not very efficient + // This may need a restructuration of the FECodec edm::ParameterSet conf; conf.addParameter("CodecName", name()); conf.addParameter ("CodecIndex", getCodecType()); conf.addParameter ("NData", HGCalBestChoiceCodec::data_type::size); + // The data length should be the same for input and output, which is limiting conf.addParameter ("DataLength", codecImpl_.dataLength()); conf.addParameter ("linLSB", codecImpl_.linLSB()); conf.addParameter ("adcsaturation", codecImpl_.adcsaturation()); @@ -59,16 +66,11 @@ void HGCalBestChoiceCodec::setDataPayloadImpl(const Module& mod, conf.addParameter ("tdcsaturation", codecImpl_.tdcsaturation()); conf.addParameter ("tdcnBits", codecImpl_.tdcnBits()); conf.addParameter ("tdcOnsetfC", codecImpl_.tdcOnsetfC()); - // decode input data with different parameters - // (no selection, so NData=number of trigger cells in module) - // FIXME: - // Not very clean to define an alternative codec within this codec - // Also, the codec is built each time the method is called, which is not very efficient + conf.addParameter ("triggerCellTruncationBits", codecImpl_.triggerCellTruncationBits()); HGCalBestChoiceCodec codecInput(conf); digi.decode(codecInput,data_); // choose best trigger cells in the module codecImpl_.bestChoiceSelect(data_); - } diff --git a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py index b2eaaebab596e..84d8a6e55bec6 100644 --- a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py @@ -7,6 +7,7 @@ NData = cms.uint32(12), DataLength = cms.uint32(8), linLSB = cms.double(100./1024.), + triggerCellTruncationBits = cms.uint32(2), #take the following parameters from the digitization config file adcsaturation = digiparam.hgceeDigitizer.digiCfg.feCfg.adcSaturation_fC, adcnBits = digiparam.hgceeDigitizer.digiCfg.feCfg.adcNbits, @@ -33,7 +34,7 @@ fhDigis = cms.InputTag('mix:HGCDigisHEfront'), bhDigis = cms.InputTag('mix:HGCDigisHEback'), TriggerGeometry = geometry, - FECodec = fe_codec, + FECodec = fe_codec.clone(), BEConfiguration = cms.PSet( algorithms = cms.VPSet( cluster_algo ) ) @@ -43,7 +44,7 @@ "HGCalTriggerDigiFEReproducer", feDigis = cms.InputTag('hgcalTriggerPrimitiveDigiProducer'), TriggerGeometry = geometry, - FECodec = fe_codec, + FECodec = fe_codec.clone(), BEConfiguration = cms.PSet( algorithms = cms.VPSet( cluster_algo ) ) diff --git a/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc b/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc index 743d85e80463d..6b4d291ef9f58 100644 --- a/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc +++ b/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc @@ -13,11 +13,13 @@ HGCalBestChoiceCodecImpl::HGCalBestChoiceCodecImpl(const edm::ParameterSet& conf adcnBits_(conf.getParameter("adcnBits")), tdcsaturation_(conf.getParameter("tdcsaturation")), tdcnBits_(conf.getParameter("tdcnBits")), - tdcOnsetfC_(conf.getParameter("tdcOnsetfC")) + tdcOnsetfC_(conf.getParameter("tdcOnsetfC")), + triggerCellTruncationBits_(conf.getParameter("triggerCellTruncationBits")) /*****************************************************************/ { adcLSB_ = adcsaturation_/pow(2.,adcnBits_); tdcLSB_ = tdcsaturation_/pow(2.,tdcnBits_); + triggerCellSaturationBits_ = triggerCellTruncationBits_ + dataLength_; } @@ -43,13 +45,11 @@ std::vector HGCalBestChoiceCodecImpl::encode(const HGCalBestChoiceCodecImp << "encode: Number of non-zero trigger cells larger than codec parameter\n"\ << " : Number of energy values = "< 0x3FF are saturated to 0x3FF - if(value>0x3FF) value=0x3FF; // 10 bit saturation + // Saturate and truncate energy values + if(value+1>(0x1u<(value & (0x1<<(i+2)));// remove the two lowest bits + result[nCellsInModule_ + idata*dataLength_ + i] = static_cast(value & (0x1<<(i+triggerCellTruncationBits_)));// remove the lowest bits (=triggerCellTruncationBits_) } idata++; } @@ -186,14 +186,14 @@ void HGCalBestChoiceCodecImpl::bestChoiceSelect(data_type& data) return a > b; } ); - // keep only the 12 first trigger cells + // keep only the first trigger cells for(size_t i=nData_; inCellsInModule_) // cell number starts at 1 + if(value_id.second>=nCellsInModule_) { throw cms::Exception("BadGeometry") << "Number of trigger cells in module too large for available data payload\n"; diff --git a/L1Trigger/L1THGCal/test/BuildFile.xml b/L1Trigger/L1THGCal/test/BuildFile.xml index 3a4e8225712de..4dfe3d832a036 100644 --- a/L1Trigger/L1THGCal/test/BuildFile.xml +++ b/L1Trigger/L1THGCal/test/BuildFile.xml @@ -8,6 +8,7 @@ + diff --git a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc index fc4ecdc39c406..63eaa410b8288 100644 --- a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc +++ b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc @@ -17,6 +17,7 @@ #include "DataFormats/L1THGCal/interface/HGCFETriggerDigi.h" #include "DataFormats/L1THGCal/interface/HGCFETriggerDigiFwd.h" +#include "DataFormats/L1THGCal/interface/HGCalCluster.h" #include "DataFormats/HGCDigi/interface/HGCDigiCollections.h" #include "DataFormats/ForwardDetId/interface/HGCTriggerDetId.h" @@ -45,9 +46,11 @@ class HGCalTriggerBestChoiceTester : public edm::EDAnalyzer private: + void checkSelectedCells(const edm::Event&, const edm::EventSetup&); + void rerunBestChoiceFragments(const edm::Event&, const edm::EventSetup&); void fillModule(const std::vector&, const HGCalBestChoiceDataPayload&, const vector >& ); // inputs - edm::EDGetToken inputee_, inputfh_, inputbh_; + edm::EDGetToken inputee_, inputfh_, inputbh_, inputbeall_, inputbeselect_; // std::unique_ptr triggerGeometry_; std::unique_ptr codec_; @@ -60,6 +63,8 @@ class HGCalTriggerBestChoiceTester : public edm::EDAnalyzer TH1F* triggerCellsPerModule_; TH1F* triggerCellData_; TH1F* triggerCellModuleSum_; + TH2F* selectedCellsVsAllCells_; + TH2F* energyLossVsNCells_; }; @@ -68,7 +73,9 @@ class HGCalTriggerBestChoiceTester : public edm::EDAnalyzer HGCalTriggerBestChoiceTester::HGCalTriggerBestChoiceTester(const edm::ParameterSet& conf): inputee_(consumes(conf.getParameter("eeDigis"))), inputfh_(consumes(conf.getParameter("fhDigis"))), - inputbh_(consumes(conf.getParameter("bhDigis"))) + inputbh_(consumes(conf.getParameter("bhDigis"))), + inputbeall_(consumes(conf.getParameter("beClustersAll"))), + inputbeselect_(consumes(conf.getParameter("beClustersSelect"))) /*****************************************************************/ { //setup geometry @@ -85,12 +92,15 @@ HGCalTriggerBestChoiceTester::HGCalTriggerBestChoiceTester(const edm::ParameterS hgcCellsPerModule_ = fs_->make("hgcCellsPerModule","Number of cells per module", 64, 0., 64.); hgcCellData_ = fs_->make("hgcCellData","Cell values", 500, 0., 500.); // - hgcCellData_linampl_ = fs_->make("hgcCellData_linampl_","Cell linearized amplitudes values All", 1250, 0, 25000); + hgcCellData_linampl_ = fs_->make("hgcCellData_linampl_","Cell linearized amplitudes values All", 1250, 0, 25000); // hgcCellModuleSum_ = fs_->make("hgcCellModuleSum","Cell sum in modules", 1000, 0., 1000.); triggerCellsPerModule_ = fs_->make("TriggerCellsPerModule","Number of trigger cells per module", 64, 0., 64.); triggerCellData_ = fs_->make("TriggerCellData","Trigger cell values", 500, 0., 500.); triggerCellModuleSum_ = fs_->make("TriggerCellModuleSum","Trigger cell sum in modules", 1000, 0., 1000.); + // + selectedCellsVsAllCells_ = fs_->make("selectedCellsVsAllCells","Number of selected cells vs number of cell", 128, 0, 128, 128, 0., 128.); + energyLossVsNCells_ = fs_->make("energyLossVsNCells","Relative energy loss after selection vs number of cell", 128, 0., 128., 101, 0, 1.01); } @@ -120,10 +130,69 @@ void HGCalTriggerBestChoiceTester::beginRun(const edm::Run& /*run*/, triggerGeometry_->initialize(info); } +/*****************************************************************/ +void HGCalTriggerBestChoiceTester::analyze(const edm::Event& e, + const edm::EventSetup& es) +/*****************************************************************/ +{ + checkSelectedCells(e, es); + rerunBestChoice(e, es); +} /*****************************************************************/ -void HGCalTriggerBestChoiceTester::analyze(const edm::Event& e, +void HGCalTriggerBestChoiceTester::checkSelectedCells(const edm::Event& e, + const edm::EventSetup& es) +/*****************************************************************/ +{ + edm::Handle be_clusters_all_h; + edm::Handle be_clusters_select_h; + e.getByToken(inputbeall_,be_clusters_all_h); + e.getByToken(inputbeselect_,be_clusters_select_h); + + const l1t::HGCalClusterBxCollection& be_clusters_all = *be_clusters_all_h; + const l1t::HGCalClusterBxCollection& be_clusters_select = *be_clusters_select_h; + + // store trigger cells module by module + std::map, std::vector>> module_triggercells_all; + for(auto cl_itr=be_clusters_all.begin(0); cl_itr!=be_clusters_all.end(0); cl_itr++) + { + const l1t::HGCalCluster& cluster = *cl_itr; + auto itr_insert = module_triggercells_all.emplace( std::make_tuple(cluster.subDet(), cluster.layer(), cluster.module()), std::vector>()); + itr_insert.first->second.emplace_back(cluster.hwEta(), cluster.hwPt()); // FIXME: the index within the module has been stored in hwEta + } + std::map, std::vector>> module_triggercells_select; + for(auto cl_itr=be_clusters_select.begin(0); cl_itr!=be_clusters_select.end(0); cl_itr++) + { + const l1t::HGCalCluster& cluster = *cl_itr; + auto itr_insert = module_triggercells_select.emplace( std::make_tuple(cluster.subDet(), cluster.layer(), cluster.module()), std::vector>()); + itr_insert.first->second.emplace_back(cluster.hwEta(), cluster.hwPt()); // FIXME: the index within the module has been stored in hwEta + } + + // Compare 'all' and 'selected' trigger cells, module by module + for(const auto& module_cells : module_triggercells_all) + { + const auto& module_cells_select_itr = module_triggercells_select.find(module_cells.first); + if(module_cells_select_itr==module_triggercells_select.end()) + { + std::cout<<"ERROR: Cannot find module for selected cells\n"; + } + size_t ncells_all = module_cells.second.size(); + size_t ncells_select = module_cells_select_itr->second.size(); + uint32_t energy_all = 0; + uint32_t energy_select = 0; + for(const auto& id_energy : module_cells.second) energy_all += id_energy.second; + for(const auto& id_energy : module_cells_select_itr->second) energy_select += id_energy.second; + selectedCellsVsAllCells_->Fill(ncells_all, ncells_select); + if(energy_all>0) energyLossVsNCells_->Fill(ncells_all, (double)energy_select/(double)energy_all); + } + + //std::cout<<"All trigger cells = "< Date: Thu, 2 Jun 2016 17:16:28 +0200 Subject: [PATCH 28/43] Reduce maximum number of trigger cells per module --- .../L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h | 4 ++-- L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc | 2 ++ L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc | 2 +- L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h index c576232e77868..62d6fdcd650f0 100644 --- a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h +++ b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h @@ -12,8 +12,8 @@ struct HGCalBestChoiceDataPayload { - static const size_t size = 128; - typedef std::array trigger_cell_list; // list of data in 128 trigger cells + static const size_t size = 114; + typedef std::array trigger_cell_list; // list of trigger cell values trigger_cell_list payload; void reset() diff --git a/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc b/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc index 6b4d291ef9f58..3f259a5c44911 100644 --- a/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc +++ b/L1Trigger/L1THGCal/src/fe_codecs/HGCalBestChoiceCodecImpl.cc @@ -17,6 +17,8 @@ HGCalBestChoiceCodecImpl::HGCalBestChoiceCodecImpl(const edm::ParameterSet& conf triggerCellTruncationBits_(conf.getParameter("triggerCellTruncationBits")) /*****************************************************************/ { + // Cannot have more selected cells than the max number of cells + if(nData_>nCellsInModule_) nData_ = nCellsInModule_; adcLSB_ = adcsaturation_/pow(2.,adcnBits_); tdcLSB_ = tdcsaturation_/pow(2.,tdcnBits_); triggerCellSaturationBits_ = triggerCellTruncationBits_ + dataLength_; diff --git a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc index 63eaa410b8288..ab396aba3153a 100644 --- a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc +++ b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc @@ -136,7 +136,7 @@ void HGCalTriggerBestChoiceTester::analyze(const edm::Event& e, /*****************************************************************/ { checkSelectedCells(e, es); - rerunBestChoice(e, es); + rerunBestChoiceFragments(e, es); } diff --git a/L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py b/L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py index b7307fadda29e..d5510be240513 100644 --- a/L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py +++ b/L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py @@ -109,7 +109,7 @@ process.load('L1Trigger.L1THGCal.hgcalTriggerPrimitives_cff') ## define trigger emulator without trigger cell selection -process.hgcalTriggerPrimitiveDigiProducer.FECodec.NData = cms.uint32(128) +process.hgcalTriggerPrimitiveDigiProducer.FECodec.NData = cms.uint32(999) # put number larger than max number of trigger cells in module cluster_algo_all = cms.PSet( AlgorithmName = cms.string('SingleCellClusterAlgo'), FECodec = process.hgcalTriggerPrimitiveDigiProducer.FECodec ) process.hgcalTriggerPrimitiveDigiProducer.BEConfiguration.algorithms = cms.VPSet( cluster_algo_all ) From 86b636ceebe8d704bb4f6c2adcb12460178ec0d3 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Thu, 2 Jun 2016 18:30:48 +0200 Subject: [PATCH 29/43] Fix test config --- L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py b/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py index 90bbd528bc0db..5263bfe9de87e 100644 --- a/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py +++ b/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py @@ -99,7 +99,11 @@ process.L1simulation_step = cms.Path(process.SimL1Emulator) process.load('L1Trigger.L1THGCal.hgcalTriggerPrimitives_cff') -process.hgcalTriggerPrimitiveDigiProducer.FECodec.NData = cms.uint32(128) +# Remove best choice selection +process.hgcalTriggerPrimitiveDigiProducer.FECodec.NData = cms.uint32(999) +cluster_algo_all = cms.PSet( AlgorithmName = cms.string('SingleCellClusterAlgo'), + FECodec = process.hgcalTriggerPrimitiveDigiProducer.FECodec ) +process.hgcalTriggerPrimitiveDigiProducer.BEConfiguration.algorithms = cms.VPSet( cluster_algo_all ) process.hgcl1tpg_step = cms.Path(process.hgcalTriggerPrimitives) process.digi2raw_step = cms.Path(process.DigiToRaw) From 1c5197cbc5033ba91afa2959f313ec00000fa63e Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Mon, 6 Jun 2016 09:50:21 +0200 Subject: [PATCH 30/43] Add module definition in FH --- L1Trigger/L1THGCal/data/module_mapping.txt | 1788 +++++++++++------ .../geometries/HGCalTriggerGeometryHexImp1.cc | 34 +- 2 files changed, 1252 insertions(+), 570 deletions(-) diff --git a/L1Trigger/L1THGCal/data/module_mapping.txt b/L1Trigger/L1THGCal/data/module_mapping.txt index d59260e873117..57182cd7cd826 100644 --- a/L1Trigger/L1THGCal/data/module_mapping.txt +++ b/L1Trigger/L1THGCal/data/module_mapping.txt @@ -1,564 +1,1224 @@ -0 0 -1 0 -2 1 -3 1 -4 2 -5 2 -6 3 -7 3 -8 4 -9 4 -10 5 -11 5 -12 6 -13 6 -14 7 -15 7 -16 8 -17 8 -18 9 -19 10 -20 11 -21 12 -22 12 -23 13 -24 13 -25 14 -26 14 -27 15 -28 15 -29 16 -30 16 -31 17 -32 18 -33 19 -34 20 -35 11 -36 21 -37 21 -38 22 -39 22 -40 23 -41 23 -42 24 -43 24 -44 25 -45 25 -46 26 -47 17 -48 18 -49 27 -50 19 -51 20 -52 28 -53 29 -54 30 -55 30 -56 31 -57 31 -58 32 -59 32 -60 33 -61 33 -62 34 -63 34 -64 26 -65 35 -66 36 -67 27 -68 37 -69 38 -70 28 -71 29 -72 39 -73 40 -74 41 -75 41 -76 42 -77 42 -78 43 -79 43 -80 44 -81 44 -82 45 -83 46 -84 35 -85 36 -86 47 -87 37 -88 38 -89 48 -90 49 -91 39 -92 40 -93 50 -94 51 -95 51 -96 52 -97 52 -98 53 -99 53 -100 54 -101 55 -102 45 -103 46 -104 56 -105 57 -106 47 -107 58 -108 59 -109 48 -110 49 -111 60 -112 61 -113 50 -114 62 -115 62 -116 63 -117 63 -118 64 -119 64 -120 65 -121 54 -122 55 -123 66 -124 67 -125 56 -126 57 -127 68 -128 58 -129 59 -130 69 -131 70 -132 60 -133 61 -134 71 -135 72 -136 73 -137 73 -138 74 -139 74 -140 75 -141 76 -142 65 -143 77 -144 78 -145 66 -146 67 -147 79 -148 80 -149 68 -150 81 -151 82 -152 69 -153 70 -154 83 -155 84 -156 71 -157 72 -158 85 -159 85 -160 86 -161 86 -162 87 -163 75 -164 76 -165 88 -166 77 -167 78 -168 89 -169 90 -170 79 -171 80 -172 91 -173 81 -174 82 -175 92 -176 93 -177 83 -178 84 -179 94 -180 95 -181 96 -182 97 -183 97 -184 98 -185 98 -186 87 -187 99 -188 100 -189 88 -190 101 -191 102 -192 89 -193 90 -194 103 -195 104 -196 91 -197 105 -198 92 -199 93 -200 106 -201 107 -202 94 -203 95 -204 96 -205 108 -206 109 -207 110 -208 99 -209 100 -210 111 -211 101 -212 102 -213 112 -214 113 -215 103 -216 104 -217 105 -218 114 -219 115 -220 106 -221 107 -222 116 -223 117 -224 118 -225 108 -226 109 -227 110 -228 119 -229 120 -230 111 -231 121 -232 122 -233 112 -234 113 -235 123 -236 124 -237 114 -238 115 -239 125 -240 126 -241 116 -242 117 -243 118 -244 127 -245 128 -246 119 -247 120 -248 129 -249 130 -250 121 -251 122 -252 131 -253 132 -254 123 -255 133 -256 134 -257 135 -258 125 -259 126 -260 136 -261 137 -262 127 -263 128 -264 138 -265 139 -266 140 -267 129 -268 130 -269 141 -270 142 -271 131 -272 132 -273 143 -274 144 -275 145 -276 134 -277 135 -278 146 -279 147 -280 136 -281 137 -282 148 -283 149 -284 138 -285 139 -286 140 -287 150 -288 151 -289 141 -290 142 -291 152 -292 153 -293 143 -294 144 -295 154 -296 145 -297 155 -298 156 -299 146 -300 147 -301 157 -302 158 -303 148 -304 149 -305 159 -306 160 -307 160 -308 161 -309 161 -310 150 -311 151 -312 162 -313 163 -314 152 -315 153 -316 164 -317 165 -318 166 -319 154 -320 167 -321 155 -322 156 -323 168 -324 169 -325 157 -326 158 -327 170 -328 171 -329 159 -330 172 -331 172 -332 173 -333 173 -334 174 -335 162 -336 163 -337 175 -338 176 -339 164 -340 165 -341 166 -342 177 -343 167 -344 178 -345 179 -346 168 -347 169 -348 180 -349 181 -350 170 -351 171 -352 182 -353 182 -354 183 -355 183 -356 174 -357 184 -358 185 -359 175 -360 176 -361 186 -362 187 -363 188 -364 177 -365 189 -366 178 -367 179 -368 190 -369 191 -370 180 -371 181 -372 192 -373 192 -374 193 -375 193 -376 194 -377 194 -378 184 -379 185 -380 195 -381 196 -382 186 -383 187 -384 188 -385 197 -386 189 -387 198 -388 199 -389 190 -390 191 -391 200 -392 200 -393 201 -394 201 -395 202 -396 202 -397 203 -398 203 -399 204 -400 195 -401 196 -402 205 -403 206 -404 207 -405 197 -406 208 -407 198 -408 199 -409 209 -410 210 -411 210 -412 211 -413 211 -414 212 -415 212 -416 213 -417 213 -418 204 -419 214 -420 215 -421 205 -422 206 -423 207 -424 216 -425 208 -426 217 -427 218 -428 209 -429 219 -430 219 -431 220 -432 220 -433 221 -434 221 -435 222 -436 222 -437 214 -438 215 -439 223 -440 224 -441 225 -442 216 -443 226 -444 217 -445 218 -446 227 -447 227 -448 228 -449 228 -450 229 -451 229 -452 230 -453 230 -454 231 -455 231 -456 223 -457 224 -458 225 -459 226 -460 232 -461 232 -462 233 -463 233 -464 234 -465 234 -466 235 -467 235 -468 236 -469 236 -470 237 -471 237 -472 238 -473 239 -474 240 -475 240 -476 241 -477 241 -478 242 -479 242 -480 243 -481 243 -482 244 -483 244 -484 245 -485 245 -486 246 -487 246 -488 247 -489 247 -490 248 -491 248 -492 10 -493 9 -494 133 -495 124 -496 239 -497 238 -498 249 -499 250 -500 251 -501 252 -502 253 -503 254 -504 255 -505 256 -506 257 -507 258 -508 259 -509 260 -510 261 -511 262 -512 263 -513 264 -514 265 -515 266 -516 267 -517 249 -518 254 -519 268 -520 269 -521 255 -522 260 -523 270 -524 271 -525 261 -526 266 -527 272 -528 267 -529 273 -530 274 -531 268 -532 269 -533 275 -534 276 -535 270 -536 271 -537 277 -538 278 -539 272 -540 279 -541 273 -542 274 -543 280 -544 281 -545 275 -546 276 -547 282 -548 283 -549 277 -550 278 -551 284 -552 250 -553 251 -554 252 -555 253 -556 256 -557 257 -558 258 -559 259 -560 262 -561 263 -562 264 -563 265 +3 0 0 +3 1 0 +3 2 1 +3 3 1 +3 4 2 +3 5 2 +3 6 3 +3 7 3 +3 8 4 +3 9 4 +3 10 5 +3 11 5 +3 12 6 +3 13 6 +3 14 7 +3 15 7 +3 16 8 +3 17 8 +3 18 9 +3 19 10 +3 20 11 +3 21 12 +3 22 12 +3 23 13 +3 24 13 +3 25 14 +3 26 14 +3 27 15 +3 28 15 +3 29 16 +3 30 16 +3 31 17 +3 32 18 +3 33 19 +3 34 20 +3 35 11 +3 36 21 +3 37 21 +3 38 22 +3 39 22 +3 40 23 +3 41 23 +3 42 24 +3 43 24 +3 44 25 +3 45 25 +3 46 26 +3 47 17 +3 48 18 +3 49 27 +3 50 19 +3 51 20 +3 52 28 +3 53 29 +3 54 30 +3 55 30 +3 56 31 +3 57 31 +3 58 32 +3 59 32 +3 60 33 +3 61 33 +3 62 34 +3 63 34 +3 64 26 +3 65 35 +3 66 36 +3 67 27 +3 68 37 +3 69 38 +3 70 28 +3 71 29 +3 72 39 +3 73 40 +3 74 41 +3 75 41 +3 76 42 +3 77 42 +3 78 43 +3 79 43 +3 80 44 +3 81 44 +3 82 45 +3 83 46 +3 84 35 +3 85 36 +3 86 47 +3 87 37 +3 88 38 +3 89 48 +3 90 49 +3 91 39 +3 92 40 +3 93 50 +3 94 51 +3 95 51 +3 96 52 +3 97 52 +3 98 53 +3 99 53 +3 100 54 +3 101 55 +3 102 45 +3 103 46 +3 104 56 +3 105 57 +3 106 47 +3 107 58 +3 108 59 +3 109 48 +3 110 49 +3 111 60 +3 112 61 +3 113 50 +3 114 62 +3 115 62 +3 116 63 +3 117 63 +3 118 64 +3 119 64 +3 120 65 +3 121 54 +3 122 55 +3 123 66 +3 124 67 +3 125 56 +3 126 57 +3 127 68 +3 128 58 +3 129 59 +3 130 69 +3 131 70 +3 132 60 +3 133 61 +3 134 71 +3 135 72 +3 136 73 +3 137 73 +3 138 74 +3 139 74 +3 140 75 +3 141 76 +3 142 65 +3 143 77 +3 144 78 +3 145 66 +3 146 67 +3 147 79 +3 148 80 +3 149 68 +3 150 81 +3 151 82 +3 152 69 +3 153 70 +3 154 83 +3 155 84 +3 156 71 +3 157 72 +3 158 85 +3 159 85 +3 160 86 +3 161 86 +3 162 87 +3 163 75 +3 164 76 +3 165 88 +3 166 77 +3 167 78 +3 168 89 +3 169 90 +3 170 79 +3 171 80 +3 172 91 +3 173 81 +3 174 82 +3 175 92 +3 176 93 +3 177 83 +3 178 84 +3 179 94 +3 180 95 +3 181 96 +3 182 97 +3 183 97 +3 184 98 +3 185 98 +3 186 87 +3 187 99 +3 188 100 +3 189 88 +3 190 101 +3 191 102 +3 192 89 +3 193 90 +3 194 103 +3 195 104 +3 196 91 +3 197 105 +3 198 92 +3 199 93 +3 200 106 +3 201 107 +3 202 94 +3 203 95 +3 204 96 +3 205 108 +3 206 109 +3 207 110 +3 208 99 +3 209 100 +3 210 111 +3 211 101 +3 212 102 +3 213 112 +3 214 113 +3 215 103 +3 216 104 +3 217 105 +3 218 114 +3 219 115 +3 220 106 +3 221 107 +3 222 116 +3 223 117 +3 224 118 +3 225 108 +3 226 109 +3 227 110 +3 228 119 +3 229 120 +3 230 111 +3 231 121 +3 232 122 +3 233 112 +3 234 113 +3 235 123 +3 236 124 +3 237 114 +3 238 115 +3 239 125 +3 240 126 +3 241 116 +3 242 117 +3 243 118 +3 244 127 +3 245 128 +3 246 119 +3 247 120 +3 248 129 +3 249 130 +3 250 121 +3 251 122 +3 252 131 +3 253 132 +3 254 123 +3 255 133 +3 256 134 +3 257 135 +3 258 125 +3 259 126 +3 260 136 +3 261 137 +3 262 127 +3 263 128 +3 264 138 +3 265 139 +3 266 140 +3 267 129 +3 268 130 +3 269 141 +3 270 142 +3 271 131 +3 272 132 +3 273 143 +3 274 144 +3 275 145 +3 276 134 +3 277 135 +3 278 146 +3 279 147 +3 280 136 +3 281 137 +3 282 148 +3 283 149 +3 284 138 +3 285 139 +3 286 140 +3 287 150 +3 288 151 +3 289 141 +3 290 142 +3 291 152 +3 292 153 +3 293 143 +3 294 144 +3 295 154 +3 296 145 +3 297 155 +3 298 156 +3 299 146 +3 300 147 +3 301 157 +3 302 158 +3 303 148 +3 304 149 +3 305 159 +3 306 160 +3 307 160 +3 308 161 +3 309 161 +3 310 150 +3 311 151 +3 312 162 +3 313 163 +3 314 152 +3 315 153 +3 316 164 +3 317 165 +3 318 166 +3 319 154 +3 320 167 +3 321 155 +3 322 156 +3 323 168 +3 324 169 +3 325 157 +3 326 158 +3 327 170 +3 328 171 +3 329 159 +3 330 172 +3 331 172 +3 332 173 +3 333 173 +3 334 174 +3 335 162 +3 336 163 +3 337 175 +3 338 176 +3 339 164 +3 340 165 +3 341 166 +3 342 177 +3 343 167 +3 344 178 +3 345 179 +3 346 168 +3 347 169 +3 348 180 +3 349 181 +3 350 170 +3 351 171 +3 352 182 +3 353 182 +3 354 183 +3 355 183 +3 356 174 +3 357 184 +3 358 185 +3 359 175 +3 360 176 +3 361 186 +3 362 187 +3 363 188 +3 364 177 +3 365 189 +3 366 178 +3 367 179 +3 368 190 +3 369 191 +3 370 180 +3 371 181 +3 372 192 +3 373 192 +3 374 193 +3 375 193 +3 376 194 +3 377 194 +3 378 184 +3 379 185 +3 380 195 +3 381 196 +3 382 186 +3 383 187 +3 384 188 +3 385 197 +3 386 189 +3 387 198 +3 388 199 +3 389 190 +3 390 191 +3 391 200 +3 392 200 +3 393 201 +3 394 201 +3 395 202 +3 396 202 +3 397 203 +3 398 203 +3 399 204 +3 400 195 +3 401 196 +3 402 205 +3 403 206 +3 404 207 +3 405 197 +3 406 208 +3 407 198 +3 408 199 +3 409 209 +3 410 210 +3 411 210 +3 412 211 +3 413 211 +3 414 212 +3 415 212 +3 416 213 +3 417 213 +3 418 204 +3 419 214 +3 420 215 +3 421 205 +3 422 206 +3 423 207 +3 424 216 +3 425 208 +3 426 217 +3 427 218 +3 428 209 +3 429 219 +3 430 219 +3 431 220 +3 432 220 +3 433 221 +3 434 221 +3 435 222 +3 436 222 +3 437 214 +3 438 215 +3 439 223 +3 440 224 +3 441 225 +3 442 216 +3 443 226 +3 444 217 +3 445 218 +3 446 227 +3 447 227 +3 448 228 +3 449 228 +3 450 229 +3 451 229 +3 452 230 +3 453 230 +3 454 231 +3 455 231 +3 456 223 +3 457 224 +3 458 225 +3 459 226 +3 460 232 +3 461 232 +3 462 233 +3 463 233 +3 464 234 +3 465 234 +3 466 235 +3 467 235 +3 468 236 +3 469 236 +3 470 237 +3 471 237 +3 472 238 +3 473 239 +3 474 240 +3 475 240 +3 476 241 +3 477 241 +3 478 242 +3 479 242 +3 480 243 +3 481 243 +3 482 244 +3 483 244 +3 484 245 +3 485 245 +3 486 246 +3 487 246 +3 488 247 +3 489 247 +3 490 248 +3 491 248 +3 492 10 +3 493 9 +3 494 133 +3 495 124 +3 496 239 +3 497 238 +3 498 249 +3 499 250 +3 500 251 +3 501 252 +3 502 253 +3 503 254 +3 504 255 +3 505 256 +3 506 257 +3 507 258 +3 508 259 +3 509 260 +3 510 261 +3 511 262 +3 512 263 +3 513 264 +3 514 265 +3 515 266 +3 516 267 +3 517 249 +3 518 254 +3 519 268 +3 520 269 +3 521 255 +3 522 260 +3 523 270 +3 524 271 +3 525 261 +3 526 266 +3 527 272 +3 528 267 +3 529 273 +3 530 274 +3 531 268 +3 532 269 +3 533 275 +3 534 276 +3 535 270 +3 536 271 +3 537 277 +3 538 278 +3 539 272 +3 540 279 +3 541 273 +3 542 274 +3 543 280 +3 544 281 +3 545 275 +3 546 276 +3 547 282 +3 548 283 +3 549 277 +3 550 278 +3 551 284 +3 552 250 +3 553 251 +3 554 252 +3 555 253 +3 556 256 +3 557 257 +3 558 258 +3 559 259 +3 560 262 +3 561 263 +3 562 264 +3 563 265 +4 0 0 +4 1 1 +4 2 1 +4 3 2 +4 4 2 +4 5 3 +4 6 3 +4 7 4 +4 8 4 +4 9 5 +4 10 6 +4 11 6 +4 12 7 +4 13 7 +4 14 8 +4 15 8 +4 16 9 +4 17 9 +4 18 10 +4 19 10 +4 20 11 +4 21 12 +4 22 13 +4 23 13 +4 24 14 +4 25 14 +4 26 15 +4 27 15 +4 28 16 +4 29 16 +4 30 17 +4 31 17 +4 32 18 +4 33 18 +4 34 19 +4 35 20 +4 36 21 +4 37 12 +4 38 22 +4 39 23 +4 40 23 +4 41 24 +4 42 24 +4 43 25 +4 44 25 +4 45 26 +4 46 26 +4 47 27 +4 48 27 +4 49 28 +4 50 28 +4 51 19 +4 52 20 +4 53 29 +4 54 21 +4 55 30 +4 56 22 +4 57 31 +4 58 32 +4 59 32 +4 60 33 +4 61 33 +4 62 34 +4 63 34 +4 64 35 +4 65 35 +4 66 36 +4 67 36 +4 68 37 +4 69 38 +4 70 39 +4 71 40 +4 72 41 +4 73 42 +4 74 30 +4 75 43 +4 76 31 +4 77 44 +4 78 45 +4 79 45 +4 80 46 +4 81 46 +4 82 47 +4 83 47 +4 84 48 +4 85 48 +4 86 49 +4 87 49 +4 88 37 +4 89 38 +4 90 39 +4 91 40 +4 92 41 +4 93 42 +4 94 50 +4 95 43 +4 96 51 +4 97 44 +4 98 52 +4 99 53 +4 100 53 +4 101 54 +4 102 54 +4 103 55 +4 104 55 +4 105 56 +4 106 56 +4 107 57 +4 108 58 +4 109 59 +4 110 60 +4 111 61 +4 112 62 +4 113 63 +4 114 64 +4 115 50 +4 116 65 +4 117 51 +4 118 66 +4 119 52 +4 120 67 +4 121 68 +4 122 68 +4 123 69 +4 124 69 +4 125 70 +4 126 70 +4 127 71 +4 128 71 +4 129 57 +4 130 58 +4 131 59 +4 132 60 +4 133 61 +4 134 62 +4 135 63 +4 136 64 +4 137 72 +4 138 65 +4 139 73 +4 140 66 +4 141 74 +4 142 67 +4 143 75 +4 144 76 +4 145 77 +4 146 77 +4 147 78 +4 148 78 +4 149 79 +4 150 80 +4 151 81 +4 152 82 +4 153 83 +4 154 84 +4 155 85 +4 156 86 +4 157 87 +4 158 88 +4 159 89 +4 160 72 +4 161 90 +4 162 73 +4 163 91 +4 164 74 +4 165 92 +4 166 75 +4 167 93 +4 168 76 +4 169 94 +4 170 94 +4 171 95 +4 172 95 +4 173 79 +4 174 80 +4 175 81 +4 176 82 +4 177 83 +4 178 84 +4 179 85 +4 180 86 +4 181 87 +4 182 88 +4 183 89 +4 184 96 +4 185 90 +4 186 97 +4 187 91 +4 188 98 +4 189 92 +4 190 99 +4 191 93 +4 192 100 +4 193 101 +4 194 102 +4 195 102 +4 196 103 +4 197 103 +4 198 104 +4 199 105 +4 200 106 +4 201 107 +4 202 108 +4 203 109 +4 204 110 +4 205 111 +4 206 112 +4 207 113 +4 208 114 +4 209 96 +4 210 115 +4 211 97 +4 212 116 +4 213 98 +4 214 117 +4 215 99 +4 216 118 +4 217 100 +4 218 119 +4 219 101 +4 220 120 +4 221 120 +4 222 104 +4 223 105 +4 224 106 +4 225 107 +4 226 108 +4 227 109 +4 228 110 +4 229 111 +4 230 112 +4 231 113 +4 232 121 +4 233 115 +4 234 122 +4 235 116 +4 236 123 +4 237 117 +4 238 124 +4 239 118 +4 240 125 +4 241 119 +4 242 126 +4 243 127 +4 244 128 +4 245 129 +4 246 130 +4 247 131 +4 248 132 +4 249 133 +4 250 134 +4 251 135 +4 252 121 +4 253 136 +4 254 122 +4 255 137 +4 256 123 +4 257 138 +4 258 124 +4 259 139 +4 260 125 +4 261 140 +4 262 126 +4 263 127 +4 264 128 +4 265 129 +4 266 130 +4 267 131 +4 268 132 +4 269 133 +4 270 134 +4 271 135 +4 272 136 +4 273 141 +4 274 137 +4 275 142 +4 276 138 +4 277 143 +4 278 139 +4 279 144 +4 280 145 +4 281 140 +4 282 146 +4 283 146 +4 284 147 +4 285 147 +4 286 148 +4 287 149 +4 288 150 +4 289 151 +4 290 152 +4 291 153 +4 292 154 +4 293 155 +4 294 141 +4 295 156 +4 296 142 +4 297 157 +4 298 143 +4 299 144 +4 300 158 +4 301 145 +4 302 159 +4 303 160 +4 304 161 +4 305 148 +4 306 149 +4 307 150 +4 308 151 +4 309 152 +4 310 153 +4 311 162 +4 312 163 +4 313 155 +4 314 164 +4 315 156 +4 316 165 +4 317 157 +4 318 166 +4 319 167 +4 320 158 +4 321 168 +4 322 159 +4 323 160 +4 324 161 +4 325 169 +4 326 170 +4 327 171 +4 328 172 +4 329 173 +4 330 174 +4 331 175 +4 332 176 +4 333 163 +4 334 177 +4 335 164 +4 336 178 +4 337 165 +4 338 179 +4 339 166 +4 340 167 +4 341 180 +4 342 168 +4 343 181 +4 344 182 +4 345 183 +4 346 184 +4 347 185 +4 348 169 +4 349 170 +4 350 171 +4 351 172 +4 352 173 +4 353 174 +4 354 175 +4 355 186 +4 356 176 +4 357 187 +4 358 177 +4 359 188 +4 360 178 +4 361 189 +4 362 179 +4 363 190 +4 364 191 +4 365 180 +4 366 181 +4 367 192 +4 368 192 +4 369 182 +4 370 183 +4 371 184 +4 372 185 +4 373 193 +4 374 194 +4 375 195 +4 376 196 +4 377 197 +4 378 198 +4 379 199 +4 380 200 +4 381 201 +4 382 187 +4 383 202 +4 384 188 +4 385 203 +4 386 189 +4 387 204 +4 388 190 +4 389 191 +4 390 205 +4 391 206 +4 392 206 +4 393 207 +4 394 207 +4 395 208 +4 396 208 +4 397 193 +4 398 194 +4 399 195 +4 400 196 +4 401 197 +4 402 198 +4 403 199 +4 404 200 +4 405 201 +4 406 209 +4 407 202 +4 408 210 +4 409 203 +4 410 211 +4 411 204 +4 412 212 +4 413 205 +4 414 213 +4 415 213 +4 416 214 +4 417 214 +4 418 215 +4 419 215 +4 420 216 +4 421 217 +4 422 218 +4 423 219 +4 424 220 +4 425 221 +4 426 222 +4 427 223 +4 428 224 +4 429 209 +4 430 225 +4 431 210 +4 432 226 +4 433 211 +4 434 227 +4 435 212 +4 436 228 +4 437 228 +4 438 229 +4 439 229 +4 440 230 +4 441 230 +4 442 216 +4 443 217 +4 444 218 +4 445 219 +4 446 220 +4 447 221 +4 448 222 +4 449 223 +4 450 224 +4 451 231 +4 452 225 +4 453 232 +4 454 226 +4 455 233 +4 456 227 +4 457 234 +4 458 234 +4 459 235 +4 460 235 +4 461 236 +4 462 236 +4 463 237 +4 464 237 +4 465 238 +4 466 239 +4 467 240 +4 468 241 +4 469 242 +4 470 243 +4 471 244 +4 472 231 +4 473 245 +4 474 232 +4 475 246 +4 476 233 +4 477 247 +4 478 247 +4 479 248 +4 480 248 +4 481 249 +4 482 249 +4 483 250 +4 484 250 +4 485 238 +4 486 239 +4 487 240 +4 488 241 +4 489 242 +4 490 243 +4 491 244 +4 492 251 +4 493 245 +4 494 252 +4 495 246 +4 496 253 +4 497 253 +4 498 254 +4 499 254 +4 500 255 +4 501 255 +4 502 256 +4 503 256 +4 504 257 +4 505 257 +4 506 258 +4 507 259 +4 508 260 +4 509 261 +4 510 262 +4 511 251 +4 512 263 +4 513 252 +4 514 264 +4 515 264 +4 516 265 +4 517 265 +4 518 266 +4 519 266 +4 520 267 +4 521 267 +4 522 268 +4 523 268 +4 524 258 +4 525 259 +4 526 260 +4 527 261 +4 528 269 +4 529 263 +4 530 270 +4 531 270 +4 532 271 +4 533 271 +4 534 272 +4 535 272 +4 536 273 +4 537 273 +4 538 274 +4 539 274 +4 540 275 +4 541 275 +4 542 276 +4 543 277 +4 544 277 +4 545 278 +4 546 278 +4 547 279 +4 548 279 +4 549 280 +4 550 280 +4 551 281 +4 552 281 +4 553 282 +4 554 282 +4 555 283 +4 556 283 +4 557 284 +4 558 284 +4 559 285 +4 560 285 +4 561 286 +4 562 286 +4 563 287 +4 564 288 +4 565 288 +4 566 289 +4 567 290 +4 568 5 +4 569 11 +4 570 291 +4 571 292 +4 572 293 +4 573 292 +4 574 294 +4 575 295 +4 576 294 +4 577 296 +4 578 154 +4 579 162 +4 580 297 +4 581 298 +4 582 299 +4 583 298 +4 584 300 +4 585 301 +4 586 300 +4 587 302 +4 588 269 +4 589 276 +4 590 303 +4 591 304 +4 592 305 +4 593 305 +4 594 306 +4 595 307 +4 596 308 +4 597 309 +4 598 310 +4 599 311 +4 600 312 +4 601 313 +4 602 314 +4 603 315 +4 604 316 +4 605 317 +4 606 318 +4 607 290 +4 608 291 +4 609 319 +4 610 320 +4 611 296 +4 612 297 +4 613 321 +4 614 322 +4 615 302 +4 616 303 +4 617 323 +4 618 318 +4 619 324 +4 620 325 +4 621 319 +4 622 320 +4 623 326 +4 624 327 +4 625 321 +4 626 322 +4 627 328 +4 628 329 +4 629 323 +4 630 306 +4 631 307 +4 632 308 +4 633 309 +4 634 310 +4 635 311 +4 636 312 +4 637 313 +4 638 314 +4 639 315 +4 640 316 +4 641 317 +4 642 0 +4 643 324 +4 644 325 +4 645 29 +4 646 114 +4 647 326 +4 648 327 +4 649 186 +4 650 262 +4 651 328 +4 652 329 +4 653 287 +4 654 289 +4 655 293 +4 656 295 +4 657 299 +4 658 301 +4 659 304 diff --git a/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc b/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc index 1682869553858..1db136a59011d 100644 --- a/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc +++ b/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc @@ -38,9 +38,7 @@ HGCalTriggerGeometryHexImp1::HGCalTriggerGeometryHexImp1(const edm::ParameterSet void HGCalTriggerGeometryHexImp1::initialize(const es_info& esInfo) /*****************************************************************/ { - // FIXME: !!!Only for HGCEE for the moment!!! edm::LogWarning("HGCalTriggerGeometry") << "WARNING: This HGCal trigger geometry is incomplete.\n"\ - << "WARNING: Only the EE part is covered.\n"\ << "WARNING: There is no neighbor information.\n"; fillMaps(esInfo); @@ -56,14 +54,18 @@ void HGCalTriggerGeometryHexImp1::fillMaps(const es_info& esInfo) { // // read module mapping file - std::map wafer_to_module; + std::map wafer_to_module_ee; + std::map wafer_to_module_fh; std::ifstream l1tModulesMappingStream(l1tModulesMapping_.fullPath()); if(!l1tModulesMappingStream.is_open()) edm::LogError("HGCalTriggerGeometry") << "Cannot open L1TModulesMapping file\n"; + short subdet = 0; short wafer = 0; short module = 0; - for(; l1tModulesMappingStream>>wafer>>module; ) + for(; l1tModulesMappingStream>>subdet>>wafer>>module; ) { - wafer_to_module.emplace(wafer,module); + if(subdet==3) wafer_to_module_ee.emplace(wafer,module); + else if(subdet==4) wafer_to_module_fh.emplace(wafer,module); + else edm::LogWarning("HGCalTriggerGeometry") << "Unsupported subdetector number ("<getValidGeomDetIds()) { if(id.rawId()==0) continue; HGCalDetId waferDetId(id); - short module = wafer_to_module[waferDetId.wafer()]; + short module = wafer_to_module_ee[waferDetId.wafer()]; + int nCells = esInfo.topo_ee->dddConstants().numberCellsHexagon(waferDetId.wafer()); + for(int c=0;c trigger cell mapping + HGCalDetId cellDetId(ForwardSubdetector(waferDetId.subdetId()), waferDetId.zside(), waferDetId.layer(), waferDetId.waferType(), waferDetId.wafer(), c); + HGCalDetId triggerCellDetId(ForwardSubdetector(waferDetId.subdetId()), waferDetId.zside(), waferDetId.layer(), waferDetId.waferType(), waferDetId.wafer(), triggerCellId); + cells_to_trigger_cells_.emplace(cellDetId, triggerCellDetId); + // Fill trigger cell -> module mapping + HGCalDetId moduleDetId(ForwardSubdetector(waferDetId.subdetId()), waferDetId.zside(), waferDetId.layer(), waferDetId.waferType(), module, HGCalDetId::kHGCalCellMask); + trigger_cells_to_modules_.emplace(triggerCellDetId, moduleDetId); + } + } + // FH + for(const auto& id : esInfo.geom_fh->getValidGeomDetIds()) + { + if(id.rawId()==0) continue; + HGCalDetId waferDetId(id); + short module = wafer_to_module_fh[waferDetId.wafer()]; int nCells = esInfo.topo_ee->dddConstants().numberCellsHexagon(waferDetId.wafer()); for(int c=0;c Date: Mon, 6 Jun 2016 18:08:44 +0200 Subject: [PATCH 31/43] Add FHE in best choice selection --- .../fe_codecs/HGCalBestChoiceCodecImpl.h | 8 +- .../be_algorithms/SingleCellClusterAlgo.cc | 9 +- .../plugins/fe_codecs/HGCalBestChoiceCodec.cc | 39 ++++++-- .../src/fe_codecs/HGCalBestChoiceCodecImpl.cc | 8 +- .../test/HGCalTriggerBestChoiceTester.cc | 88 ++++++++++++++----- 5 files changed, 113 insertions(+), 39 deletions(-) diff --git a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h index 62d6fdcd650f0..194fb5387ce29 100644 --- a/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h +++ b/L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h @@ -34,9 +34,13 @@ class HGCalBestChoiceCodecImpl std::vector encode(const data_type&) const ; data_type decode(const std::vector&) const; - void linearize(const HGCalTriggerGeometry::Module& , const std::vector&, std::vector >&); + void linearize(const HGCalTriggerGeometry::Module& , + const std::vector>&, + std::vector >&); - void triggerCellSums(const HGCalTriggerGeometry::Module& , const std::vector >&, data_type&); + void triggerCellSums(const HGCalTriggerGeometry::Module& , + const std::vector >&, + data_type&); void bestChoiceSelect(data_type&); // Retrieve parameters diff --git a/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc b/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc index 0996e913e1d4a..ac4400ea5fca1 100644 --- a/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc +++ b/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc @@ -53,13 +53,16 @@ void SingleCellClusterAlgo::run(const l1t::HGCFETriggerDigiCollection& coll, { if(value>0) { - // dummy cluster without position + GlobalPoint point = geom->modules().at(moduleId)->position(); + math::PtEtaPhiMLorentzVector p4((double)value*cosh(point.eta()), point.eta(), point.phi(), 0.); // index in module stored as hwEta - l1t::HGCalCluster cluster( reco::LeafCandidate::LorentzVector(), + l1t::HGCalCluster cluster( + reco::LeafCandidate::LorentzVector(), value, i, 0); + cluster.setP4(p4); cluster.setModule(moduleId.wafer()); cluster.setLayer(moduleId.layer()); - cluster.setSubDet(moduleId.zside()<0 ? 0 : 1); + cluster.setSubDet(moduleId.subdetId()); cluster_product->push_back(0,cluster); } i++; diff --git a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc index 768d8ff39f1ee..3dc6c5c770096 100644 --- a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc +++ b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc @@ -19,21 +19,46 @@ HGCalBestChoiceCodec::HGCalBestChoiceCodec(const edm::ParameterSet& conf) : Code /*****************************************************************/ void HGCalBestChoiceCodec::setDataPayloadImpl(const Module& mod, const HGCEEDigiCollection& ee, - const HGCHEDigiCollection&, + const HGCHEDigiCollection& fh, const HGCHEDigiCollection& ) /*****************************************************************/ { data_.reset(); - std::vector dataframes; - // loop over EE digis and fill digis belonging to that module - for(const auto& eedata : ee) + HGCalDetId moduleId(mod.moduleId()); + std::vector> dataframes; + std::vector > linearized_dataframes; + // loop over EE or FH digis and fill digis belonging to that module + if(moduleId.subdetId()==ForwardSubdetector::HGCEE) { - if(mod.containsCell(eedata.id())) + for(const auto& eedata : ee) { - dataframes.push_back(eedata); + if(mod.containsCell(eedata.id())) + { + HGCDataFrame dataframe(eedata.id()); + for(int i=0; i > linearized_dataframes; + else if(moduleId.subdetId()==ForwardSubdetector::HGCHEF) + { + for(const auto& fhdata : fh) + { + if(mod.containsCell(fhdata.id())) + { + HGCDataFrame dataframe(fhdata.id()); + for(int i=0; i& dataframes, std::vector >& linearized_dataframes) +void HGCalBestChoiceCodecImpl::linearize(const HGCalTriggerGeometry::Module& mod, + const std::vector>& dataframes, + std::vector >& linearized_dataframes) /*****************************************************************/ { double amplitude; uint32_t amplitude_int; @@ -119,7 +121,7 @@ void HGCalBestChoiceCodecImpl::linearize(const HGCalTriggerGeometry::Module& mod /*****************************************************************/ -void HGCalBestChoiceCodecImpl::triggerCellSums(const HGCalTriggerGeometry::Module& mod, const std::vector >& linearized_dataframes, data_type& data) +void HGCalBestChoiceCodecImpl::triggerCellSums(const HGCalTriggerGeometry::Module& mod, const std::vector >& linearized_dataframes, data_type& data) /*****************************************************************/ { std::map payload; @@ -127,7 +129,7 @@ void HGCalBestChoiceCodecImpl::triggerCellSums(const HGCalTriggerGeometry::Modul for(const auto& frame : linearized_dataframes) { // FIXME: only EE - HGCEEDetId cellid(frame.first); + HGCalDetId cellid(frame.first); // find trigger cell associated to cell uint32_t tcid(0); for(const auto& tc_c : mod.triggerCellComponents()) diff --git a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc index ab396aba3153a..f7cb9a2d70ac3 100644 --- a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc +++ b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc @@ -48,7 +48,9 @@ class HGCalTriggerBestChoiceTester : public edm::EDAnalyzer private: void checkSelectedCells(const edm::Event&, const edm::EventSetup&); void rerunBestChoiceFragments(const edm::Event&, const edm::EventSetup&); - void fillModule(const std::vector&, const HGCalBestChoiceDataPayload&, const vector >& ); + void fillModule(const std::vector>&, + const HGCalBestChoiceDataPayload&, + const vector >& ); // inputs edm::EDGetToken inputee_, inputfh_, inputbh_, inputbeall_, inputbeselect_; // @@ -63,8 +65,10 @@ class HGCalTriggerBestChoiceTester : public edm::EDAnalyzer TH1F* triggerCellsPerModule_; TH1F* triggerCellData_; TH1F* triggerCellModuleSum_; - TH2F* selectedCellsVsAllCells_; - TH2F* energyLossVsNCells_; + TH2F* selectedCellsVsAllCells_ee_; + TH2F* energyLossVsNCells_ee_; + TH2F* selectedCellsVsAllCells_fh_; + TH2F* energyLossVsNCells_fh_; }; @@ -99,8 +103,10 @@ HGCalTriggerBestChoiceTester::HGCalTriggerBestChoiceTester(const edm::ParameterS triggerCellData_ = fs_->make("TriggerCellData","Trigger cell values", 500, 0., 500.); triggerCellModuleSum_ = fs_->make("TriggerCellModuleSum","Trigger cell sum in modules", 1000, 0., 1000.); // - selectedCellsVsAllCells_ = fs_->make("selectedCellsVsAllCells","Number of selected cells vs number of cell", 128, 0, 128, 128, 0., 128.); - energyLossVsNCells_ = fs_->make("energyLossVsNCells","Relative energy loss after selection vs number of cell", 128, 0., 128., 101, 0, 1.01); + selectedCellsVsAllCells_ee_ = fs_->make("selectedCellsVsAllCells_ee","Number of selected cells vs number of cell", 128, 0, 128, 128, 0., 128.); + energyLossVsNCells_ee_ = fs_->make("energyLossVsNCells_ee","Relative energy loss after selection vs number of cell", 128, 0., 128., 101, 0, 1.01); + selectedCellsVsAllCells_fh_ = fs_->make("selectedCellsVsAllCells_fh","Number of selected cells vs number of cell", 128, 0, 128, 128, 0., 128.); + energyLossVsNCells_fh_ = fs_->make("energyLossVsNCells_fh","Relative energy loss after selection vs number of cell", 128, 0., 128., 101, 0, 1.01); } @@ -153,19 +159,21 @@ void HGCalTriggerBestChoiceTester::checkSelectedCells(const edm::Event& e, const l1t::HGCalClusterBxCollection& be_clusters_all = *be_clusters_all_h; const l1t::HGCalClusterBxCollection& be_clusters_select = *be_clusters_select_h; - // store trigger cells module by module - std::map, std::vector>> module_triggercells_all; + // store trigger cells module by module. tuple = zside,subdet,layer,module + std::map, std::vector>> module_triggercells_all; for(auto cl_itr=be_clusters_all.begin(0); cl_itr!=be_clusters_all.end(0); cl_itr++) { const l1t::HGCalCluster& cluster = *cl_itr; - auto itr_insert = module_triggercells_all.emplace( std::make_tuple(cluster.subDet(), cluster.layer(), cluster.module()), std::vector>()); + uint32_t zside = cluster.eta()<0. ? 0 : 1; + auto itr_insert = module_triggercells_all.emplace( std::make_tuple(zside, cluster.subDet(), cluster.layer(), cluster.module()), std::vector>()); itr_insert.first->second.emplace_back(cluster.hwEta(), cluster.hwPt()); // FIXME: the index within the module has been stored in hwEta } - std::map, std::vector>> module_triggercells_select; + std::map, std::vector>> module_triggercells_select; for(auto cl_itr=be_clusters_select.begin(0); cl_itr!=be_clusters_select.end(0); cl_itr++) { const l1t::HGCalCluster& cluster = *cl_itr; - auto itr_insert = module_triggercells_select.emplace( std::make_tuple(cluster.subDet(), cluster.layer(), cluster.module()), std::vector>()); + uint32_t zside = cluster.eta()<0. ? 0 : 1; + auto itr_insert = module_triggercells_select.emplace( std::make_tuple(zside, cluster.subDet(), cluster.layer(), cluster.module()), std::vector>()); itr_insert.first->second.emplace_back(cluster.hwEta(), cluster.hwPt()); // FIXME: the index within the module has been stored in hwEta } @@ -183,8 +191,16 @@ void HGCalTriggerBestChoiceTester::checkSelectedCells(const edm::Event& e, uint32_t energy_select = 0; for(const auto& id_energy : module_cells.second) energy_all += id_energy.second; for(const auto& id_energy : module_cells_select_itr->second) energy_select += id_energy.second; - selectedCellsVsAllCells_->Fill(ncells_all, ncells_select); - if(energy_all>0) energyLossVsNCells_->Fill(ncells_all, (double)energy_select/(double)energy_all); + if(std::get<1>(module_cells.first)==3) // EE + { + selectedCellsVsAllCells_ee_->Fill(ncells_all, ncells_select); + if(energy_all>0) energyLossVsNCells_ee_->Fill(ncells_all, (double)energy_select/(double)energy_all); + } + else if(std::get<1>(module_cells.first)==4) // FH + { + selectedCellsVsAllCells_fh_->Fill(ncells_all, ncells_select); + if(energy_all>0) energyLossVsNCells_fh_->Fill(ncells_all, (double)energy_select/(double)energy_all); + } } //std::cout<<"All trigger cells = "< ee_digis_h; + edm::Handle fh_digis_h; e.getByToken(inputee_,ee_digis_h); + e.getByToken(inputfh_,fh_digis_h); const HGCEEDigiCollection& ee_digis = *ee_digis_h; + const HGCHEDigiCollection& fh_digis = *fh_digis_h; HGCalBestChoiceDataPayload data; - - //loop on modules for( const auto& module : triggerGeometry_->modules() ) { + HGCalDetId moduleId(module.first); // prepare input data - std::vector dataframes; - vector > linearized_dataframes; - - for(const auto& eedata : ee_digis) { - if(module.second->containsCell(eedata.id())) { - dataframes.push_back(eedata); - } - } - + std::vector> dataframes; + vector > linearized_dataframes; + + // loop over EE or FH digis and fill digis belonging to that module + if(moduleId.subdetId()==ForwardSubdetector::HGCEE) { + for(const auto& eedata : ee_digis) { + if(module.second->containsCell(eedata.id())) { + HGCDataFrame dataframe(eedata.id()); + for(int i=0; icontainsCell(fhdata.id())) { + HGCDataFrame dataframe(fhdata.id()); + for(int i=0; i& dataframes, const HGCalBestChoiceDataPayload& fe_payload, const vector >& linearized_dataframes) +void HGCalTriggerBestChoiceTester::fillModule( const std::vector>& dataframes, + const HGCalBestChoiceDataPayload& fe_payload, + const vector >& linearized_dataframes) /*****************************************************************/ { // HGC cells part From 0202815c34990f92ae963ae933b44b3fae12531f Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Tue, 7 Jun 2016 15:04:32 +0200 Subject: [PATCH 32/43] Update geometry tester with FH --- .../L1THGCal/test/HGCalTriggerGeomTester.cc | 62 ++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc b/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc index 10cdb1f2d8396..e8eff7f1913dc 100644 --- a/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc +++ b/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc @@ -59,6 +59,7 @@ class HGCalTriggerGeomTester : public edm::EDAnalyzer // tree variables int moduleId_ ; int moduleSide_ ; + int moduleSubdet_ ; int moduleLayer_ ; int module_ ; float moduleX_ ; @@ -67,6 +68,7 @@ class HGCalTriggerGeomTester : public edm::EDAnalyzer int moduleTC_N_ ; std::shared_ptr moduleTC_id_ ; std::shared_ptr moduleTC_zside_ ; + std::shared_ptr moduleTC_subdet_; std::shared_ptr moduleTC_layer_ ; std::shared_ptr moduleTC_wafer_; std::shared_ptr moduleTC_cell_ ; @@ -75,6 +77,7 @@ class HGCalTriggerGeomTester : public edm::EDAnalyzer std::shared_ptr moduleTC_z_ ; int triggerCellId_ ; int triggerCellSide_ ; + int triggerCellSubdet_ ; int triggerCellLayer_ ; int triggerCellWafer_ ; int triggerCell_ ; @@ -84,6 +87,7 @@ class HGCalTriggerGeomTester : public edm::EDAnalyzer int triggerCellCell_N_ ; std::shared_ptr triggerCellCell_id_ ; std::shared_ptr triggerCellCell_zside_ ; + std::shared_ptr triggerCellCell_subdet_; std::shared_ptr triggerCellCell_layer_ ; std::shared_ptr triggerCellCell_wafer_; std::shared_ptr triggerCellCell_cell_ ; @@ -92,6 +96,7 @@ class HGCalTriggerGeomTester : public edm::EDAnalyzer std::shared_ptr triggerCellCell_z_ ; int cellId_ ; int cellSide_ ; + int cellSubdet_ ; int cellLayer_ ; int cellWafer_ ; int cellWaferType_ ; @@ -125,6 +130,7 @@ HGCalTriggerGeomTester::HGCalTriggerGeomTester(const edm::ParameterSet& conf) treeModules_ = fs_->make("TreeModules","Tree of all HGC modules"); treeModules_->Branch("id" , &moduleId_ , "id/I"); treeModules_->Branch("zside" , &moduleSide_ , "zside/I"); + treeModules_->Branch("subdet" , &moduleSubdet_ , "subdet/I"); treeModules_->Branch("layer" , &moduleLayer_ , "layer/I"); treeModules_->Branch("module" , &module_ , "module/I"); treeModules_->Branch("x" , &moduleX_ , "x/F"); @@ -133,6 +139,7 @@ HGCalTriggerGeomTester::HGCalTriggerGeomTester(const edm::ParameterSet& conf) treeModules_->Branch("tc_n" , &moduleTC_N_ , "tc_n/I"); moduleTC_id_ .reset(new int[1], array_deleter()); moduleTC_zside_ .reset(new int[1], array_deleter()); + moduleTC_subdet_.reset(new int[1], array_deleter()); moduleTC_layer_ .reset(new int[1], array_deleter()); moduleTC_wafer_ .reset(new int[1], array_deleter()); moduleTC_cell_ .reset(new int[1], array_deleter()); @@ -141,6 +148,7 @@ HGCalTriggerGeomTester::HGCalTriggerGeomTester(const edm::ParameterSet& conf) moduleTC_z_ .reset(new float[1], array_deleter()); treeModules_->Branch("tc_id" , moduleTC_id_.get() , "tc_id[tc_n]/I"); treeModules_->Branch("tc_zside" , moduleTC_zside_.get() , "tc_zside[tc_n]/I"); + treeModules_->Branch("tc_subdet" , moduleTC_subdet_.get() , "tc_subdet[tc_n]/I"); treeModules_->Branch("tc_layer" , moduleTC_layer_.get() , "tc_layer[tc_n]/I"); treeModules_->Branch("tc_wafer" , moduleTC_wafer_.get() , "tc_wafer[tc_n]/I"); treeModules_->Branch("tc_cell" , moduleTC_cell_.get() , "tc_cell[tc_n]/I"); @@ -151,6 +159,7 @@ HGCalTriggerGeomTester::HGCalTriggerGeomTester(const edm::ParameterSet& conf) treeTriggerCells_ = fs_->make("TreeTriggerCells","Tree of all HGC trigger cells"); treeTriggerCells_->Branch("id" , &triggerCellId_ , "id/I"); treeTriggerCells_->Branch("zside" , &triggerCellSide_ , "zside/I"); + treeTriggerCells_->Branch("subdet" , &triggerCellSubdet_ , "subdet/I"); treeTriggerCells_->Branch("layer" , &triggerCellLayer_ , "layer/I"); treeTriggerCells_->Branch("wafer" , &triggerCellWafer_ , "wafer/I"); treeTriggerCells_->Branch("triggercell" , &triggerCell_ , "triggercell/I"); @@ -160,6 +169,7 @@ HGCalTriggerGeomTester::HGCalTriggerGeomTester(const edm::ParameterSet& conf) treeTriggerCells_->Branch("c_n" , &triggerCellCell_N_ , "c_n/I"); triggerCellCell_id_ .reset(new int[1], array_deleter()); triggerCellCell_zside_ .reset(new int[1], array_deleter()); + triggerCellCell_subdet_ .reset(new int[0], array_deleter()); triggerCellCell_layer_ .reset(new int[1], array_deleter()); triggerCellCell_wafer_ .reset(new int[1], array_deleter()); triggerCellCell_cell_ .reset(new int[1], array_deleter()); @@ -168,6 +178,7 @@ HGCalTriggerGeomTester::HGCalTriggerGeomTester(const edm::ParameterSet& conf) triggerCellCell_z_ .reset(new float[1], array_deleter()); treeTriggerCells_->Branch("c_id" , triggerCellCell_id_.get() , "c_id[c_n]/I"); treeTriggerCells_->Branch("c_zside" , triggerCellCell_zside_.get() , "c_zside[c_n]/I"); + treeTriggerCells_->Branch("c_subdet" , triggerCellCell_subdet_.get() , "c_subdet[c_n]/I"); treeTriggerCells_->Branch("c_layer" , triggerCellCell_layer_.get() , "c_layer[c_n]/I"); treeTriggerCells_->Branch("c_wafer" , triggerCellCell_wafer_.get() , "c_wafer[c_n]/I"); treeTriggerCells_->Branch("c_cell" , triggerCellCell_cell_.get() , "c_cell[c_n]/I"); @@ -178,6 +189,7 @@ HGCalTriggerGeomTester::HGCalTriggerGeomTester(const edm::ParameterSet& conf) treeCells_ = fs_->make("TreeCells","Tree of all HGC cells"); treeCells_->Branch("id" , &cellId_ , "id/I"); treeCells_->Branch("zside" , &cellSide_ , "zside/I"); + treeCells_->Branch("subdet" , &cellSubdet_ , "subdet/I"); treeCells_->Branch("layer" , &cellLayer_ , "layer/I"); treeCells_->Branch("wafer" , &cellWafer_ , "wafer/I"); treeCells_->Branch("wafertype" , &cellWaferType_ , "wafertype/I"); @@ -237,6 +249,7 @@ void HGCalTriggerGeomTester::fillTriggerGeometry(const HGCalTriggerGeometryBase: const auto& modulePtr = id_module.second; moduleId_ = id.rawId(); moduleSide_ = id.zside(); + moduleSubdet_ = id.subdetId(); moduleLayer_ = id.layer(); module_ = id.wafer(); moduleX_ = modulePtr->position().x(); @@ -252,6 +265,7 @@ void HGCalTriggerGeomTester::fillTriggerGeometry(const HGCalTriggerGeometryBase: const auto& triggerCell = triggerGeometry_->triggerCells().at(tc); moduleTC_id_ .get()[itc] = tc; moduleTC_zside_ .get()[itc] = tcId.zside(); + moduleTC_subdet_.get()[itc] = tcId.subdetId(); moduleTC_layer_ .get()[itc] = tcId.layer(); moduleTC_wafer_ .get()[itc] = tcId.wafer(); moduleTC_cell_ .get()[itc] = tcId.cell(); @@ -271,6 +285,7 @@ void HGCalTriggerGeomTester::fillTriggerGeometry(const HGCalTriggerGeometryBase: const auto& triggerCellPtr = id_triggercell.second; triggerCellId_ = id.rawId(); triggerCellSide_ = id.zside(); + triggerCellSubdet_ = id.subdetId(); triggerCellLayer_ = id.layer(); triggerCellWafer_ = id.wafer(); triggerCell_ = id.cell(); @@ -284,9 +299,10 @@ void HGCalTriggerGeomTester::fillTriggerGeometry(const HGCalTriggerGeometryBase: for(const auto& c : triggerCellPtr->components()) { HGCalDetId cId(c); - GlobalPoint position = info.geom_ee->getPosition(cId); + GlobalPoint position = (cId.subdetId()==3 ? info.geom_ee->getPosition(cId) : info.geom_fh->getPosition(cId)); triggerCellCell_id_ .get()[ic] = c; triggerCellCell_zside_ .get()[ic] = cId.zside(); + triggerCellCell_subdet_.get()[ic] = cId.subdetId(); triggerCellCell_layer_ .get()[ic] = cId.layer(); triggerCellCell_wafer_ .get()[ic] = cId.wafer(); triggerCellCell_cell_ .get()[ic] = cId.cell(); @@ -300,6 +316,7 @@ void HGCalTriggerGeomTester::fillTriggerGeometry(const HGCalTriggerGeometryBase: } // Loop over cells std::cout<<"Filling cells tree\n"; + // EE for(const auto& id : info.geom_ee->getValidGeomDetIds()) { if(id.rawId()==0) continue; @@ -311,6 +328,7 @@ void HGCalTriggerGeomTester::fillTriggerGeometry(const HGCalTriggerGeometryBase: if(!info.topo_ee->valid(id)) continue; cellId_ = id.rawId(); cellSide_ = id.zside(); + cellSubdet_ = id.subdetId(); cellLayer_ = id.layer(); cellWafer_ = id.wafer(); cellWaferType_ = id.waferType(); @@ -336,6 +354,44 @@ void HGCalTriggerGeomTester::fillTriggerGeometry(const HGCalTriggerGeometryBase: treeCells_->Fill(); } } + // FH + for(const auto& id : info.geom_fh->getValidGeomDetIds()) + { + if(id.rawId()==0) continue; + HGCalDetId waferid(id); + int nCells = info.topo_fh->dddConstants().numberCellsHexagon(waferid.wafer()); + for(int i=0;ivalid(id)) continue; + cellId_ = id.rawId(); + cellSide_ = id.zside(); + cellSubdet_ = id.subdetId(); + cellLayer_ = id.layer(); + cellWafer_ = id.wafer(); + cellWaferType_ = id.waferType(); + cell_ = id.cell(); + // + GlobalPoint center = info.geom_fh->getPosition(id); + cellX_ = center.x(); + cellY_ = center.y(); + cellZ_ = center.z(); + std::vector corners = info.geom_fh->getCorners(id); + if(corners.size()<4) std::cout<<"#corners < 4\n"; + else + { + cellX1_ = corners.at(0).x(); + cellY1_ = corners.at(0).y(); + cellX2_ = corners.at(1).x(); + cellY2_ = corners.at(1).y(); + cellX3_ = corners.at(2).x(); + cellY3_ = corners.at(2).y(); + cellX4_ = corners.at(3).x(); + cellY4_ = corners.at(3).y(); + } + treeCells_->Fill(); + } + } } @@ -354,6 +410,7 @@ void HGCalTriggerGeomTester::setTreeModuleSize(const size_t n) { moduleTC_id_ .reset(new int[n], array_deleter()); moduleTC_zside_ .reset(new int[n], array_deleter()); + moduleTC_subdet_.reset(new int[n], array_deleter()); moduleTC_layer_ .reset(new int[n], array_deleter()); moduleTC_wafer_ .reset(new int[n], array_deleter()); moduleTC_cell_ .reset(new int[n], array_deleter()); @@ -363,6 +420,7 @@ void HGCalTriggerGeomTester::setTreeModuleSize(const size_t n) treeModules_->GetBranch("tc_id") ->SetAddress(moduleTC_id_ .get()); treeModules_->GetBranch("tc_zside") ->SetAddress(moduleTC_zside_ .get()); + treeModules_->GetBranch("tc_subdet") ->SetAddress(moduleTC_subdet_.get()); treeModules_->GetBranch("tc_layer") ->SetAddress(moduleTC_layer_ .get()); treeModules_->GetBranch("tc_wafer") ->SetAddress(moduleTC_wafer_ .get()); treeModules_->GetBranch("tc_cell") ->SetAddress(moduleTC_cell_ .get()); @@ -377,6 +435,7 @@ void HGCalTriggerGeomTester::setTreeTriggerCellSize(const size_t n) { triggerCellCell_id_ .reset(new int[n], array_deleter()); triggerCellCell_zside_ .reset(new int[n], array_deleter()); + triggerCellCell_subdet_.reset(new int[n], array_deleter()); triggerCellCell_layer_ .reset(new int[n], array_deleter()); triggerCellCell_wafer_ .reset(new int[n], array_deleter()); triggerCellCell_cell_ .reset(new int[n], array_deleter()); @@ -386,6 +445,7 @@ void HGCalTriggerGeomTester::setTreeTriggerCellSize(const size_t n) treeTriggerCells_->GetBranch("c_id") ->SetAddress(triggerCellCell_id_ .get()); treeTriggerCells_->GetBranch("c_zside") ->SetAddress(triggerCellCell_zside_ .get()); + treeTriggerCells_->GetBranch("c_subdet") ->SetAddress(triggerCellCell_subdet_.get()); treeTriggerCells_->GetBranch("c_layer") ->SetAddress(triggerCellCell_layer_ .get()); treeTriggerCells_->GetBranch("c_wafer") ->SetAddress(triggerCellCell_wafer_ .get()); treeTriggerCells_->GetBranch("c_cell") ->SetAddress(triggerCellCell_cell_ .get()); From d516b292b0bb03d48c43ff69a640e11c80ea7a21 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Tue, 7 Jun 2016 15:54:14 +0200 Subject: [PATCH 33/43] Fix FH trigger geometry and update test script --- .../plugins/geometries/HGCalTriggerGeometryHexImp1.cc | 4 ++-- L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc | 2 +- L1Trigger/L1THGCal/test/macros/drawTriggerModulesHex.py | 9 +++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc b/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc index 1db136a59011d..63f1e2113c953 100644 --- a/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc +++ b/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc @@ -109,7 +109,7 @@ void HGCalTriggerGeometryHexImp1::fillMaps(const es_info& esInfo) if(id.rawId()==0) continue; HGCalDetId waferDetId(id); short module = wafer_to_module_fh[waferDetId.wafer()]; - int nCells = esInfo.topo_ee->dddConstants().numberCellsHexagon(waferDetId.wafer()); + int nCells = esInfo.topo_fh->dddConstants().numberCellsHexagon(waferDetId.wafer()); for(int c=0;cgetPosition(cellDetId).basicVector(); + triggerCellVector += (cellDetId.subdetId()==(int)ForwardSubdetector::HGCEE ? esInfo.geom_ee->getPosition(cellDetId) : esInfo.geom_fh->getPosition(cellDetId)).basicVector(); } GlobalPoint triggerCellPoint( triggerCellVector/cellIds.size() ); const auto& triggerCellToModuleItr = trigger_cells_to_modules_.find(triggerCellId); diff --git a/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc b/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc index e8eff7f1913dc..d0f94bc0bc233 100644 --- a/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc +++ b/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc @@ -299,7 +299,7 @@ void HGCalTriggerGeomTester::fillTriggerGeometry(const HGCalTriggerGeometryBase: for(const auto& c : triggerCellPtr->components()) { HGCalDetId cId(c); - GlobalPoint position = (cId.subdetId()==3 ? info.geom_ee->getPosition(cId) : info.geom_fh->getPosition(cId)); + GlobalPoint position = (cId.subdetId()==(int)ForwardSubdetector::HGCEE ? info.geom_ee->getPosition(cId) : info.geom_fh->getPosition(cId)); triggerCellCell_id_ .get()[ic] = c; triggerCellCell_zside_ .get()[ic] = cId.zside(); triggerCellCell_subdet_.get()[ic] = cId.subdetId(); diff --git a/L1Trigger/L1THGCal/test/macros/drawTriggerModulesHex.py b/L1Trigger/L1THGCal/test/macros/drawTriggerModulesHex.py index 1063fa97a03f1..1684e01f354f9 100644 --- a/L1Trigger/L1THGCal/test/macros/drawTriggerModulesHex.py +++ b/L1Trigger/L1THGCal/test/macros/drawTriggerModulesHex.py @@ -2,7 +2,8 @@ from DrawingUtilities import Cell, TriggerCell, Module ### PARAMETERS ##### -layer = 1 +subdet = 4 +layer = 12 zside = 1 inputFileName = "../test_triggergeom.root" outputFileName = "moduleMap.root" @@ -17,7 +18,7 @@ ## filling cell map cells = {} -cut = "layer=={0} && zside=={1}".format(layer,zside) +cut = "layer=={0} && zside=={1} && subdet=={2}".format(layer,zside,subdet) treeCells.Draw(">>elist1", cut, "entrylist") entryList1 = ROOT.gDirectory.Get("elist1") entryList1.__class__ = ROOT.TEntryList @@ -125,7 +126,7 @@ imod = 0 hexagons = [] print '' -print '>> Drawing layer', layer, 'zside', zside +print '>> Drawing subdet', subdet, 'layer', layer, 'zside', zside print ' Trigger cells are not drawn for all the modules, to reduce the (long) drawing time' for id,module in modules.items(): if imod%10==0: print " Drawing module {0}/{1}".format(imod, len(modules)) @@ -154,7 +155,7 @@ canvas.Write() -canvas.Print("moduleMap.png") +canvas.Print("moduleMap_{0}_{1}.png".format(subdet,layer)) inputFile.Close() From cbb5c0470b1a3a5027fce47afae79f60e313ad93 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Tue, 7 Jun 2016 15:56:20 +0200 Subject: [PATCH 34/43] Add test config to run on already produced HFCFETriggerDigi --- .../test/testHGCalL1T_reproduce_cfg.py | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 L1Trigger/L1THGCal/test/testHGCalL1T_reproduce_cfg.py diff --git a/L1Trigger/L1THGCal/test/testHGCalL1T_reproduce_cfg.py b/L1Trigger/L1THGCal/test/testHGCalL1T_reproduce_cfg.py new file mode 100644 index 0000000000000..037905c5762a1 --- /dev/null +++ b/L1Trigger/L1THGCal/test/testHGCalL1T_reproduce_cfg.py @@ -0,0 +1,91 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras + +process = cms.Process('L1THGC',eras.Phase2) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.Geometry.GeometryExtended2023LRecoReco_cff') +process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +process.load('Configuration.StandardSequences.Generator_cff') +process.load('IOMC.EventVertexGenerators.VtxSmearedGauss_cfi') +process.load('GeneratorInterface.Core.genFilterSummary_cff') +process.load('Configuration.StandardSequences.SimIdeal_cff') +process.load('Configuration.StandardSequences.Digi_cff') +process.load('Configuration.StandardSequences.SimL1Emulator_cff') +process.load('Configuration.StandardSequences.DigiToRaw_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) +files = ['file:test.root'] + +# Input source +process.source = cms.Source("PoolSource", + fileNames=cms.untracked.vstring() + ) +process.source.fileNames = cms.untracked.vstring(files) +#process.source.duplicateCheckMode = cms.untracked.string('noDuplicateCheck') + + +process.options = cms.untracked.PSet( + +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + version = cms.untracked.string('$Revision: 1.20 $'), + annotation = cms.untracked.string('SingleElectronPt10_cfi nevts:10'), + name = cms.untracked.string('Applications') +) + +# Output definition + +process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", + splitLevel = cms.untracked.int32(0), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + #outputCommands = process.FEVTDEBUGEventContent.outputCommands, + outputCommands = cms.untracked.vstring( + 'keep *_*_HGCHitsEE_*', + 'keep *_*_HGCHitsHEback_*', + 'keep *_*_HGCHitsHEfront_*', + 'keep *_mix_*_*', + 'keep *_genParticles_*_*', + 'keep *_hgcalTriggerPrimitiveDigiProducer_*_*', + 'keep *_hgcalTriggerPrimitiveDigiFEReproducer_*_*' + ), + fileName = cms.untracked.string('file:test_reproduce.root'), + dataset = cms.untracked.PSet( + filterName = cms.untracked.string(''), + dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW') + ) +) + +# Additional output definition + +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '') + + + +# Path and EndPath definitions +process.load('L1Trigger.L1THGCal.hgcalTriggerPrimitives_cff') +process.hgcl1tpg_step = cms.Path(process.hgcalTriggerPrimitives_reproduce) + +process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) + +# Schedule definition +process.schedule = cms.Schedule(process.hgcl1tpg_step, process.FEVTDEBUGoutput_step) + + + + From 51972c53a089e3b770bfbce17846dbbeceaac51d Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Wed, 8 Jun 2016 09:20:54 +0200 Subject: [PATCH 35/43] Fix E -> ET conversion --- .../L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc b/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc index ac4400ea5fca1..ccdd02cbcb6e5 100644 --- a/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc +++ b/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc @@ -54,7 +54,7 @@ void SingleCellClusterAlgo::run(const l1t::HGCFETriggerDigiCollection& coll, if(value>0) { GlobalPoint point = geom->modules().at(moduleId)->position(); - math::PtEtaPhiMLorentzVector p4((double)value*cosh(point.eta()), point.eta(), point.phi(), 0.); + math::PtEtaPhiMLorentzVector p4((double)value/cosh(point.eta()), point.eta(), point.phi(), 0.); // index in module stored as hwEta l1t::HGCalCluster cluster( reco::LeafCandidate::LorentzVector(), From 36e81f8ad6809fed887ef9e4553c6a84a6cc872b Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Wed, 8 Jun 2016 10:45:59 +0200 Subject: [PATCH 36/43] Shorten data frame emplace_back --- .../plugins/fe_codecs/HGCalBestChoiceCodec.cc | 11 ++++------- .../test/HGCalTriggerBestChoiceTester.cc | 16 ++++++---------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc index 3dc6c5c770096..34e41e042d875 100644 --- a/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc +++ b/L1Trigger/L1THGCal/plugins/fe_codecs/HGCalBestChoiceCodec.cc @@ -34,12 +34,11 @@ void HGCalBestChoiceCodec::setDataPayloadImpl(const Module& mod, { if(mod.containsCell(eedata.id())) { - HGCDataFrame dataframe(eedata.id()); + dataframes.emplace_back(eedata.id()); for(int i=0; i dataframe(fhdata.id()); + dataframes.emplace_back(fhdata.id()); for(int i=0; icontainsCell(eedata.id())) { - HGCDataFrame dataframe(eedata.id()); - for(int i=0; icontainsCell(fhdata.id())) { - HGCDataFrame dataframe(fhdata.id()); - for(int i=0; i Date: Wed, 8 Jun 2016 10:53:58 +0200 Subject: [PATCH 37/43] Use ForwardDetId instead of int --- .../plugins/geometries/HGCalTriggerGeometryHexImp1.cc | 2 +- L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc | 4 ++-- L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc b/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc index 63f1e2113c953..ad6ff6981213f 100644 --- a/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc +++ b/L1Trigger/L1THGCal/plugins/geometries/HGCalTriggerGeometryHexImp1.cc @@ -152,7 +152,7 @@ void HGCalTriggerGeometryHexImp1::buildTriggerCellsAndModules(const es_info& esI for(const auto& cell : cellIds) { HGCalDetId cellDetId(cell); - triggerCellVector += (cellDetId.subdetId()==(int)ForwardSubdetector::HGCEE ? esInfo.geom_ee->getPosition(cellDetId) : esInfo.geom_fh->getPosition(cellDetId)).basicVector(); + triggerCellVector += (cellDetId.subdetId()==ForwardSubdetector::HGCEE ? esInfo.geom_ee->getPosition(cellDetId) : esInfo.geom_fh->getPosition(cellDetId)).basicVector(); } GlobalPoint triggerCellPoint( triggerCellVector/cellIds.size() ); const auto& triggerCellToModuleItr = trigger_cells_to_modules_.find(triggerCellId); diff --git a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc index a5eac23944d9d..eb0bc4a2b96a7 100644 --- a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc +++ b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc @@ -191,12 +191,12 @@ void HGCalTriggerBestChoiceTester::checkSelectedCells(const edm::Event& e, uint32_t energy_select = 0; for(const auto& id_energy : module_cells.second) energy_all += id_energy.second; for(const auto& id_energy : module_cells_select_itr->second) energy_select += id_energy.second; - if(std::get<1>(module_cells.first)==3) // EE + if(std::get<1>(module_cells.first)==ForwardSubdetector::HGCEE) { selectedCellsVsAllCells_ee_->Fill(ncells_all, ncells_select); if(energy_all>0) energyLossVsNCells_ee_->Fill(ncells_all, (double)energy_select/(double)energy_all); } - else if(std::get<1>(module_cells.first)==4) // FH + else if(std::get<1>(module_cells.first)==ForwardSubdetector::HGCHEF) { selectedCellsVsAllCells_fh_->Fill(ncells_all, ncells_select); if(energy_all>0) energyLossVsNCells_fh_->Fill(ncells_all, (double)energy_select/(double)energy_all); diff --git a/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc b/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc index d0f94bc0bc233..cba195556fc01 100644 --- a/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc +++ b/L1Trigger/L1THGCal/test/HGCalTriggerGeomTester.cc @@ -299,7 +299,7 @@ void HGCalTriggerGeomTester::fillTriggerGeometry(const HGCalTriggerGeometryBase: for(const auto& c : triggerCellPtr->components()) { HGCalDetId cId(c); - GlobalPoint position = (cId.subdetId()==(int)ForwardSubdetector::HGCEE ? info.geom_ee->getPosition(cId) : info.geom_fh->getPosition(cId)); + GlobalPoint position = (cId.subdetId()==ForwardSubdetector::HGCEE ? info.geom_ee->getPosition(cId) : info.geom_fh->getPosition(cId)); triggerCellCell_id_ .get()[ic] = c; triggerCellCell_zside_ .get()[ic] = cId.zside(); triggerCellCell_subdet_.get()[ic] = cId.subdetId(); From 994a2901dbda3fc6ab05309b8dd31429a7b58e5e Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Wed, 8 Jun 2016 14:50:03 +0200 Subject: [PATCH 38/43] Update best choice unit test --- L1Trigger/L1THGCal/test/unittest_bestchoicecodec.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/L1Trigger/L1THGCal/test/unittest_bestchoicecodec.cc b/L1Trigger/L1THGCal/test/unittest_bestchoicecodec.cc index 77712d6439430..3868a09cd6897 100644 --- a/L1Trigger/L1THGCal/test/unittest_bestchoicecodec.cc +++ b/L1Trigger/L1THGCal/test/unittest_bestchoicecodec.cc @@ -40,6 +40,7 @@ void TestBestChoiceCodec::setUp() params.addParameter ("tdcsaturation", 10000 ); params.addParameter ("tdcnBits", 12); params.addParameter ("tdcOnsetfC", 60); + params.addParameter ("triggerCellTruncationBits", 2); codec_.reset(new HGCalBestChoiceCodecImpl(params)); } From da90dc07286b13dbd65ff100bd950f3a7422633f Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Thu, 9 Jun 2016 09:06:59 +0200 Subject: [PATCH 39/43] Update geometry config for pre6 and temporarily remove unused BH --- L1Trigger/L1THGCal/plugins/HGCalTriggerDigiProducer.cc | 4 ++-- .../L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py | 2 +- L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc | 2 +- L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py | 5 +++-- L1Trigger/L1THGCal/test/testHGCalL1TGeometry_cfg.py | 3 ++- L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py | 3 ++- L1Trigger/L1THGCal/test/testHGCalL1T_reproduce_cfg.py | 3 ++- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiProducer.cc b/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiProducer.cc index 1e947dedb3a93..54425bf5e06c6 100644 --- a/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiProducer.cc +++ b/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiProducer.cc @@ -40,7 +40,7 @@ HGCalTriggerDigiProducer:: HGCalTriggerDigiProducer(const edm::ParameterSet& conf): inputee_(consumes(conf.getParameter("eeDigis"))), inputfh_(consumes(conf.getParameter("fhDigis"))), - inputbh_(consumes(conf.getParameter("bhDigis"))), + //inputbh_(consumes(conf.getParameter("bhDigis"))), backEndProcessor_(conf.getParameterSet("BEConfiguration")) { //setup geometry configuration @@ -92,7 +92,7 @@ void HGCalTriggerDigiProducer::produce(edm::Event& e, const edm::EventSetup& es) e.getByToken(inputee_,ee_digis_h); e.getByToken(inputfh_,fh_digis_h); - e.getByToken(inputbh_,bh_digis_h); + //e.getByToken(inputbh_,bh_digis_h); const HGCEEDigiCollection& ee_digis = *ee_digis_h; const HGCHEDigiCollection& fh_digis = *fh_digis_h; diff --git a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py index 84d8a6e55bec6..407cdf782e42e 100644 --- a/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py +++ b/L1Trigger/L1THGCal/python/hgcalTriggerPrimitiveDigiProducer_cfi.py @@ -32,7 +32,7 @@ "HGCalTriggerDigiProducer", eeDigis = cms.InputTag('mix:HGCDigisEE'), fhDigis = cms.InputTag('mix:HGCDigisHEfront'), - bhDigis = cms.InputTag('mix:HGCDigisHEback'), + #bhDigis = cms.InputTag('mix:HGCDigisHEback'), TriggerGeometry = geometry, FECodec = fe_codec.clone(), BEConfiguration = cms.PSet( diff --git a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc index eb0bc4a2b96a7..69a9da7b1ab47 100644 --- a/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc +++ b/L1Trigger/L1THGCal/test/HGCalTriggerBestChoiceTester.cc @@ -77,7 +77,7 @@ class HGCalTriggerBestChoiceTester : public edm::EDAnalyzer HGCalTriggerBestChoiceTester::HGCalTriggerBestChoiceTester(const edm::ParameterSet& conf): inputee_(consumes(conf.getParameter("eeDigis"))), inputfh_(consumes(conf.getParameter("fhDigis"))), - inputbh_(consumes(conf.getParameter("bhDigis"))), + //inputbh_(consumes(conf.getParameter("bhDigis"))), inputbeall_(consumes(conf.getParameter("beClustersAll"))), inputbeselect_(consumes(conf.getParameter("beClustersSelect"))) /*****************************************************************/ diff --git a/L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py b/L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py index d5510be240513..c4903b211c9a2 100644 --- a/L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py +++ b/L1Trigger/L1THGCal/test/testHGCalL1TBestChoice_cfg.py @@ -10,7 +10,8 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.Geometry.GeometryExtended2023LRecoReco_cff') +process.load('Configuration.Geometry.GeometryExtended2023simReco_cff') +process.load('Configuration.Geometry.GeometryExtended2023sim_cff') process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedGauss_cfi') @@ -127,7 +128,7 @@ "HGCalTriggerBestChoiceTester", eeDigis = cms.InputTag('mix:HGCDigisEE'), fhDigis = cms.InputTag('mix:HGCDigisHEfront'), - bhDigis = cms.InputTag('mix:HGCDigisHEback'), + #bhDigis = cms.InputTag('mix:HGCDigisHEback'), beClustersAll = cms.InputTag('hgcalTriggerPrimitiveDigiProducer:SingleCellClusterAlgo'), beClustersSelect = cms.InputTag('hgcalTriggerPrimitiveDigiFEReproducer:SingleCellClusterAlgo'), TriggerGeometry = cms.PSet( diff --git a/L1Trigger/L1THGCal/test/testHGCalL1TGeometry_cfg.py b/L1Trigger/L1THGCal/test/testHGCalL1TGeometry_cfg.py index b2722c5a9a7b8..248ad4a3246f5 100644 --- a/L1Trigger/L1THGCal/test/testHGCalL1TGeometry_cfg.py +++ b/L1Trigger/L1THGCal/test/testHGCalL1TGeometry_cfg.py @@ -10,7 +10,8 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.Geometry.GeometryExtended2023LRecoReco_cff') +process.load('Configuration.Geometry.GeometryExtended2023simReco_cff') +process.load('Configuration.Geometry.GeometryExtended2023sim_cff') process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('Configuration.StandardSequences.VtxSmearedNoSmear_cff') diff --git a/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py b/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py index 5263bfe9de87e..7bc890c5b7528 100644 --- a/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py +++ b/L1Trigger/L1THGCal/test/testHGCalL1T_cfg.py @@ -10,7 +10,8 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.Geometry.GeometryExtended2023LRecoReco_cff') +process.load('Configuration.Geometry.GeometryExtended2023simReco_cff') +process.load('Configuration.Geometry.GeometryExtended2023sim_cff') process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedGauss_cfi') diff --git a/L1Trigger/L1THGCal/test/testHGCalL1T_reproduce_cfg.py b/L1Trigger/L1THGCal/test/testHGCalL1T_reproduce_cfg.py index 037905c5762a1..017b5d96c3b8f 100644 --- a/L1Trigger/L1THGCal/test/testHGCalL1T_reproduce_cfg.py +++ b/L1Trigger/L1THGCal/test/testHGCalL1T_reproduce_cfg.py @@ -10,7 +10,8 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.Geometry.GeometryExtended2023LRecoReco_cff') +process.load('Configuration.Geometry.GeometryExtended2023simReco_cff') +process.load('Configuration.Geometry.GeometryExtended2023sim_cff') process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedGauss_cfi') From a1a1ff773b370fa290672777af6bed408dd15dae Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Thu, 9 Jun 2016 09:24:51 +0200 Subject: [PATCH 40/43] Change auto_ptr to unique_ptr --- L1Trigger/L1THGCal/plugins/HGCalTriggerDigiFEReproducer.cc | 4 ++-- .../L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiFEReproducer.cc b/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiFEReproducer.cc index 03ed70c5e8064..b359f5ece802d 100644 --- a/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiFEReproducer.cc +++ b/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiFEReproducer.cc @@ -83,7 +83,7 @@ void HGCalTriggerDigiFEReproducer::beginRun(const edm::Run& /*run*/, const edm:: void HGCalTriggerDigiFEReproducer::produce(edm::Event& e, const edm::EventSetup& es) /*****************************************************************/ { - std::auto_ptr fe_output( new l1t::HGCFETriggerDigiCollection ); + std::unique_ptr fe_output( new l1t::HGCFETriggerDigiCollection ); edm::Handle digis_h; @@ -107,7 +107,7 @@ void HGCalTriggerDigiFEReproducer::produce(edm::Event& e, const edm::EventSetup& } // get the orphan handle and fe digi collection - auto fe_digis_handle = e.put(fe_output); + auto fe_digis_handle = e.put(std::move(fe_output)); auto fe_digis_coll = *fe_digis_handle; //now we run the emulation of the back-end processor diff --git a/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc b/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc index ccdd02cbcb6e5..32997944129f5 100644 --- a/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc +++ b/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc @@ -24,7 +24,7 @@ class SingleCellClusterAlgo : public Algorithm virtual void putInEvent(edm::Event& evt) override final { - evt.put(cluster_product,name()); + evt.put(std::move(cluster_product),name()); } virtual void reset() override final @@ -33,7 +33,7 @@ class SingleCellClusterAlgo : public Algorithm } private: - std::auto_ptr cluster_product; + std::unique_ptr cluster_product; }; From 3b166c6487169a4e902e8cffa6e1010da5bccc1d Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Thu, 9 Jun 2016 09:27:41 +0200 Subject: [PATCH 41/43] Update member name in BE algos --- .../plugins/be_algorithms/FullModuleSumAlgo.cc | 10 +++++----- .../plugins/be_algorithms/RandomClusterAlgo.cc | 10 +++++----- .../plugins/be_algorithms/SingleCellClusterAlgo.cc | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/L1Trigger/L1THGCal/plugins/be_algorithms/FullModuleSumAlgo.cc b/L1Trigger/L1THGCal/plugins/be_algorithms/FullModuleSumAlgo.cc index 43956af91e9af..0ef2579bc86c5 100644 --- a/L1Trigger/L1THGCal/plugins/be_algorithms/FullModuleSumAlgo.cc +++ b/L1Trigger/L1THGCal/plugins/be_algorithms/FullModuleSumAlgo.cc @@ -12,7 +12,7 @@ class FullModuleSumAlgo : public Algorithm FullModuleSumAlgo(const edm::ParameterSet& conf): Algorithm(conf), - cluster_product( new l1t::HGCalClusterBxCollection ){} + cluster_product_( new l1t::HGCalClusterBxCollection ){} virtual void setProduces(edm::EDProducer& prod) const override final { @@ -24,16 +24,16 @@ class FullModuleSumAlgo : public Algorithm virtual void putInEvent(edm::Event& evt) override final { - evt.put(std::move(cluster_product),name()); + evt.put(std::move(cluster_product_),name()); } virtual void reset() override final { - cluster_product.reset( new l1t::HGCalClusterBxCollection ); + cluster_product_.reset( new l1t::HGCalClusterBxCollection ); } private: - std::unique_ptr cluster_product; + std::unique_ptr cluster_product_; }; @@ -60,7 +60,7 @@ void FullModuleSumAlgo::run(const l1t::HGCFETriggerDigiCollection& coll, l1t::HGCalCluster cluster( reco::LeafCandidate::LorentzVector(), moduleSum, moduleId, 0); - cluster_product->push_back(0,cluster); + cluster_product_->push_back(0,cluster); } } diff --git a/L1Trigger/L1THGCal/plugins/be_algorithms/RandomClusterAlgo.cc b/L1Trigger/L1THGCal/plugins/be_algorithms/RandomClusterAlgo.cc index 7f11c58ca2896..dcceb29bfb208 100644 --- a/L1Trigger/L1THGCal/plugins/be_algorithms/RandomClusterAlgo.cc +++ b/L1Trigger/L1THGCal/plugins/be_algorithms/RandomClusterAlgo.cc @@ -10,7 +10,7 @@ class RandomClusterAlgo : public Algorithm { RandomClusterAlgo(const edm::ParameterSet& conf): Algorithm(conf), - cluster_product( new l1t::HGCalClusterBxCollection ){ + cluster_product_( new l1t::HGCalClusterBxCollection ){ } virtual void setProduces(edm::EDProducer& prod) const override final { @@ -21,15 +21,15 @@ class RandomClusterAlgo : public Algorithm { const std::unique_ptr& geom) override final; virtual void putInEvent(edm::Event& evt) override final { - evt.put(std::move(cluster_product),name()); + evt.put(std::move(cluster_product_),name()); } virtual void reset() override final { - cluster_product.reset( new l1t::HGCalClusterBxCollection ); + cluster_product_.reset( new l1t::HGCalClusterBxCollection ); } private: - std::unique_ptr cluster_product; + std::unique_ptr cluster_product_; }; @@ -47,7 +47,7 @@ void RandomClusterAlgo::run(const l1t::HGCFETriggerDigiCollection& coll, l1t::HGCalCluster cluster( reco::LeafCandidate::LorentzVector(), word1, word2, word3^word4 ); - cluster_product->push_back(0,cluster); + cluster_product_->push_back(0,cluster); } } diff --git a/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc b/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc index 32997944129f5..55e3ba4977e4f 100644 --- a/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc +++ b/L1Trigger/L1THGCal/plugins/be_algorithms/SingleCellClusterAlgo.cc @@ -12,7 +12,7 @@ class SingleCellClusterAlgo : public Algorithm SingleCellClusterAlgo(const edm::ParameterSet& conf): Algorithm(conf), - cluster_product( new l1t::HGCalClusterBxCollection ){} + cluster_product_( new l1t::HGCalClusterBxCollection ){} virtual void setProduces(edm::EDProducer& prod) const override final { @@ -24,16 +24,16 @@ class SingleCellClusterAlgo : public Algorithm virtual void putInEvent(edm::Event& evt) override final { - evt.put(std::move(cluster_product),name()); + evt.put(std::move(cluster_product_),name()); } virtual void reset() override final { - cluster_product.reset( new l1t::HGCalClusterBxCollection ); + cluster_product_.reset( new l1t::HGCalClusterBxCollection ); } private: - std::unique_ptr cluster_product; + std::unique_ptr cluster_product_; }; @@ -63,7 +63,7 @@ void SingleCellClusterAlgo::run(const l1t::HGCFETriggerDigiCollection& coll, cluster.setModule(moduleId.wafer()); cluster.setLayer(moduleId.layer()); cluster.setSubDet(moduleId.subdetId()); - cluster_product->push_back(0,cluster); + cluster_product_->push_back(0,cluster); } i++; } From 7951e28b58a15c1aff017459a2c63029f831c6d1 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Thu, 9 Jun 2016 14:36:53 +0200 Subject: [PATCH 42/43] Remove data files for integration --- L1Trigger/L1THGCal/data/module_mapping.txt | 1224 ----------------- .../L1THGCal/data/triggercell_mapping.txt | 373 ----- 2 files changed, 1597 deletions(-) delete mode 100644 L1Trigger/L1THGCal/data/module_mapping.txt delete mode 100644 L1Trigger/L1THGCal/data/triggercell_mapping.txt diff --git a/L1Trigger/L1THGCal/data/module_mapping.txt b/L1Trigger/L1THGCal/data/module_mapping.txt deleted file mode 100644 index 57182cd7cd826..0000000000000 --- a/L1Trigger/L1THGCal/data/module_mapping.txt +++ /dev/null @@ -1,1224 +0,0 @@ -3 0 0 -3 1 0 -3 2 1 -3 3 1 -3 4 2 -3 5 2 -3 6 3 -3 7 3 -3 8 4 -3 9 4 -3 10 5 -3 11 5 -3 12 6 -3 13 6 -3 14 7 -3 15 7 -3 16 8 -3 17 8 -3 18 9 -3 19 10 -3 20 11 -3 21 12 -3 22 12 -3 23 13 -3 24 13 -3 25 14 -3 26 14 -3 27 15 -3 28 15 -3 29 16 -3 30 16 -3 31 17 -3 32 18 -3 33 19 -3 34 20 -3 35 11 -3 36 21 -3 37 21 -3 38 22 -3 39 22 -3 40 23 -3 41 23 -3 42 24 -3 43 24 -3 44 25 -3 45 25 -3 46 26 -3 47 17 -3 48 18 -3 49 27 -3 50 19 -3 51 20 -3 52 28 -3 53 29 -3 54 30 -3 55 30 -3 56 31 -3 57 31 -3 58 32 -3 59 32 -3 60 33 -3 61 33 -3 62 34 -3 63 34 -3 64 26 -3 65 35 -3 66 36 -3 67 27 -3 68 37 -3 69 38 -3 70 28 -3 71 29 -3 72 39 -3 73 40 -3 74 41 -3 75 41 -3 76 42 -3 77 42 -3 78 43 -3 79 43 -3 80 44 -3 81 44 -3 82 45 -3 83 46 -3 84 35 -3 85 36 -3 86 47 -3 87 37 -3 88 38 -3 89 48 -3 90 49 -3 91 39 -3 92 40 -3 93 50 -3 94 51 -3 95 51 -3 96 52 -3 97 52 -3 98 53 -3 99 53 -3 100 54 -3 101 55 -3 102 45 -3 103 46 -3 104 56 -3 105 57 -3 106 47 -3 107 58 -3 108 59 -3 109 48 -3 110 49 -3 111 60 -3 112 61 -3 113 50 -3 114 62 -3 115 62 -3 116 63 -3 117 63 -3 118 64 -3 119 64 -3 120 65 -3 121 54 -3 122 55 -3 123 66 -3 124 67 -3 125 56 -3 126 57 -3 127 68 -3 128 58 -3 129 59 -3 130 69 -3 131 70 -3 132 60 -3 133 61 -3 134 71 -3 135 72 -3 136 73 -3 137 73 -3 138 74 -3 139 74 -3 140 75 -3 141 76 -3 142 65 -3 143 77 -3 144 78 -3 145 66 -3 146 67 -3 147 79 -3 148 80 -3 149 68 -3 150 81 -3 151 82 -3 152 69 -3 153 70 -3 154 83 -3 155 84 -3 156 71 -3 157 72 -3 158 85 -3 159 85 -3 160 86 -3 161 86 -3 162 87 -3 163 75 -3 164 76 -3 165 88 -3 166 77 -3 167 78 -3 168 89 -3 169 90 -3 170 79 -3 171 80 -3 172 91 -3 173 81 -3 174 82 -3 175 92 -3 176 93 -3 177 83 -3 178 84 -3 179 94 -3 180 95 -3 181 96 -3 182 97 -3 183 97 -3 184 98 -3 185 98 -3 186 87 -3 187 99 -3 188 100 -3 189 88 -3 190 101 -3 191 102 -3 192 89 -3 193 90 -3 194 103 -3 195 104 -3 196 91 -3 197 105 -3 198 92 -3 199 93 -3 200 106 -3 201 107 -3 202 94 -3 203 95 -3 204 96 -3 205 108 -3 206 109 -3 207 110 -3 208 99 -3 209 100 -3 210 111 -3 211 101 -3 212 102 -3 213 112 -3 214 113 -3 215 103 -3 216 104 -3 217 105 -3 218 114 -3 219 115 -3 220 106 -3 221 107 -3 222 116 -3 223 117 -3 224 118 -3 225 108 -3 226 109 -3 227 110 -3 228 119 -3 229 120 -3 230 111 -3 231 121 -3 232 122 -3 233 112 -3 234 113 -3 235 123 -3 236 124 -3 237 114 -3 238 115 -3 239 125 -3 240 126 -3 241 116 -3 242 117 -3 243 118 -3 244 127 -3 245 128 -3 246 119 -3 247 120 -3 248 129 -3 249 130 -3 250 121 -3 251 122 -3 252 131 -3 253 132 -3 254 123 -3 255 133 -3 256 134 -3 257 135 -3 258 125 -3 259 126 -3 260 136 -3 261 137 -3 262 127 -3 263 128 -3 264 138 -3 265 139 -3 266 140 -3 267 129 -3 268 130 -3 269 141 -3 270 142 -3 271 131 -3 272 132 -3 273 143 -3 274 144 -3 275 145 -3 276 134 -3 277 135 -3 278 146 -3 279 147 -3 280 136 -3 281 137 -3 282 148 -3 283 149 -3 284 138 -3 285 139 -3 286 140 -3 287 150 -3 288 151 -3 289 141 -3 290 142 -3 291 152 -3 292 153 -3 293 143 -3 294 144 -3 295 154 -3 296 145 -3 297 155 -3 298 156 -3 299 146 -3 300 147 -3 301 157 -3 302 158 -3 303 148 -3 304 149 -3 305 159 -3 306 160 -3 307 160 -3 308 161 -3 309 161 -3 310 150 -3 311 151 -3 312 162 -3 313 163 -3 314 152 -3 315 153 -3 316 164 -3 317 165 -3 318 166 -3 319 154 -3 320 167 -3 321 155 -3 322 156 -3 323 168 -3 324 169 -3 325 157 -3 326 158 -3 327 170 -3 328 171 -3 329 159 -3 330 172 -3 331 172 -3 332 173 -3 333 173 -3 334 174 -3 335 162 -3 336 163 -3 337 175 -3 338 176 -3 339 164 -3 340 165 -3 341 166 -3 342 177 -3 343 167 -3 344 178 -3 345 179 -3 346 168 -3 347 169 -3 348 180 -3 349 181 -3 350 170 -3 351 171 -3 352 182 -3 353 182 -3 354 183 -3 355 183 -3 356 174 -3 357 184 -3 358 185 -3 359 175 -3 360 176 -3 361 186 -3 362 187 -3 363 188 -3 364 177 -3 365 189 -3 366 178 -3 367 179 -3 368 190 -3 369 191 -3 370 180 -3 371 181 -3 372 192 -3 373 192 -3 374 193 -3 375 193 -3 376 194 -3 377 194 -3 378 184 -3 379 185 -3 380 195 -3 381 196 -3 382 186 -3 383 187 -3 384 188 -3 385 197 -3 386 189 -3 387 198 -3 388 199 -3 389 190 -3 390 191 -3 391 200 -3 392 200 -3 393 201 -3 394 201 -3 395 202 -3 396 202 -3 397 203 -3 398 203 -3 399 204 -3 400 195 -3 401 196 -3 402 205 -3 403 206 -3 404 207 -3 405 197 -3 406 208 -3 407 198 -3 408 199 -3 409 209 -3 410 210 -3 411 210 -3 412 211 -3 413 211 -3 414 212 -3 415 212 -3 416 213 -3 417 213 -3 418 204 -3 419 214 -3 420 215 -3 421 205 -3 422 206 -3 423 207 -3 424 216 -3 425 208 -3 426 217 -3 427 218 -3 428 209 -3 429 219 -3 430 219 -3 431 220 -3 432 220 -3 433 221 -3 434 221 -3 435 222 -3 436 222 -3 437 214 -3 438 215 -3 439 223 -3 440 224 -3 441 225 -3 442 216 -3 443 226 -3 444 217 -3 445 218 -3 446 227 -3 447 227 -3 448 228 -3 449 228 -3 450 229 -3 451 229 -3 452 230 -3 453 230 -3 454 231 -3 455 231 -3 456 223 -3 457 224 -3 458 225 -3 459 226 -3 460 232 -3 461 232 -3 462 233 -3 463 233 -3 464 234 -3 465 234 -3 466 235 -3 467 235 -3 468 236 -3 469 236 -3 470 237 -3 471 237 -3 472 238 -3 473 239 -3 474 240 -3 475 240 -3 476 241 -3 477 241 -3 478 242 -3 479 242 -3 480 243 -3 481 243 -3 482 244 -3 483 244 -3 484 245 -3 485 245 -3 486 246 -3 487 246 -3 488 247 -3 489 247 -3 490 248 -3 491 248 -3 492 10 -3 493 9 -3 494 133 -3 495 124 -3 496 239 -3 497 238 -3 498 249 -3 499 250 -3 500 251 -3 501 252 -3 502 253 -3 503 254 -3 504 255 -3 505 256 -3 506 257 -3 507 258 -3 508 259 -3 509 260 -3 510 261 -3 511 262 -3 512 263 -3 513 264 -3 514 265 -3 515 266 -3 516 267 -3 517 249 -3 518 254 -3 519 268 -3 520 269 -3 521 255 -3 522 260 -3 523 270 -3 524 271 -3 525 261 -3 526 266 -3 527 272 -3 528 267 -3 529 273 -3 530 274 -3 531 268 -3 532 269 -3 533 275 -3 534 276 -3 535 270 -3 536 271 -3 537 277 -3 538 278 -3 539 272 -3 540 279 -3 541 273 -3 542 274 -3 543 280 -3 544 281 -3 545 275 -3 546 276 -3 547 282 -3 548 283 -3 549 277 -3 550 278 -3 551 284 -3 552 250 -3 553 251 -3 554 252 -3 555 253 -3 556 256 -3 557 257 -3 558 258 -3 559 259 -3 560 262 -3 561 263 -3 562 264 -3 563 265 -4 0 0 -4 1 1 -4 2 1 -4 3 2 -4 4 2 -4 5 3 -4 6 3 -4 7 4 -4 8 4 -4 9 5 -4 10 6 -4 11 6 -4 12 7 -4 13 7 -4 14 8 -4 15 8 -4 16 9 -4 17 9 -4 18 10 -4 19 10 -4 20 11 -4 21 12 -4 22 13 -4 23 13 -4 24 14 -4 25 14 -4 26 15 -4 27 15 -4 28 16 -4 29 16 -4 30 17 -4 31 17 -4 32 18 -4 33 18 -4 34 19 -4 35 20 -4 36 21 -4 37 12 -4 38 22 -4 39 23 -4 40 23 -4 41 24 -4 42 24 -4 43 25 -4 44 25 -4 45 26 -4 46 26 -4 47 27 -4 48 27 -4 49 28 -4 50 28 -4 51 19 -4 52 20 -4 53 29 -4 54 21 -4 55 30 -4 56 22 -4 57 31 -4 58 32 -4 59 32 -4 60 33 -4 61 33 -4 62 34 -4 63 34 -4 64 35 -4 65 35 -4 66 36 -4 67 36 -4 68 37 -4 69 38 -4 70 39 -4 71 40 -4 72 41 -4 73 42 -4 74 30 -4 75 43 -4 76 31 -4 77 44 -4 78 45 -4 79 45 -4 80 46 -4 81 46 -4 82 47 -4 83 47 -4 84 48 -4 85 48 -4 86 49 -4 87 49 -4 88 37 -4 89 38 -4 90 39 -4 91 40 -4 92 41 -4 93 42 -4 94 50 -4 95 43 -4 96 51 -4 97 44 -4 98 52 -4 99 53 -4 100 53 -4 101 54 -4 102 54 -4 103 55 -4 104 55 -4 105 56 -4 106 56 -4 107 57 -4 108 58 -4 109 59 -4 110 60 -4 111 61 -4 112 62 -4 113 63 -4 114 64 -4 115 50 -4 116 65 -4 117 51 -4 118 66 -4 119 52 -4 120 67 -4 121 68 -4 122 68 -4 123 69 -4 124 69 -4 125 70 -4 126 70 -4 127 71 -4 128 71 -4 129 57 -4 130 58 -4 131 59 -4 132 60 -4 133 61 -4 134 62 -4 135 63 -4 136 64 -4 137 72 -4 138 65 -4 139 73 -4 140 66 -4 141 74 -4 142 67 -4 143 75 -4 144 76 -4 145 77 -4 146 77 -4 147 78 -4 148 78 -4 149 79 -4 150 80 -4 151 81 -4 152 82 -4 153 83 -4 154 84 -4 155 85 -4 156 86 -4 157 87 -4 158 88 -4 159 89 -4 160 72 -4 161 90 -4 162 73 -4 163 91 -4 164 74 -4 165 92 -4 166 75 -4 167 93 -4 168 76 -4 169 94 -4 170 94 -4 171 95 -4 172 95 -4 173 79 -4 174 80 -4 175 81 -4 176 82 -4 177 83 -4 178 84 -4 179 85 -4 180 86 -4 181 87 -4 182 88 -4 183 89 -4 184 96 -4 185 90 -4 186 97 -4 187 91 -4 188 98 -4 189 92 -4 190 99 -4 191 93 -4 192 100 -4 193 101 -4 194 102 -4 195 102 -4 196 103 -4 197 103 -4 198 104 -4 199 105 -4 200 106 -4 201 107 -4 202 108 -4 203 109 -4 204 110 -4 205 111 -4 206 112 -4 207 113 -4 208 114 -4 209 96 -4 210 115 -4 211 97 -4 212 116 -4 213 98 -4 214 117 -4 215 99 -4 216 118 -4 217 100 -4 218 119 -4 219 101 -4 220 120 -4 221 120 -4 222 104 -4 223 105 -4 224 106 -4 225 107 -4 226 108 -4 227 109 -4 228 110 -4 229 111 -4 230 112 -4 231 113 -4 232 121 -4 233 115 -4 234 122 -4 235 116 -4 236 123 -4 237 117 -4 238 124 -4 239 118 -4 240 125 -4 241 119 -4 242 126 -4 243 127 -4 244 128 -4 245 129 -4 246 130 -4 247 131 -4 248 132 -4 249 133 -4 250 134 -4 251 135 -4 252 121 -4 253 136 -4 254 122 -4 255 137 -4 256 123 -4 257 138 -4 258 124 -4 259 139 -4 260 125 -4 261 140 -4 262 126 -4 263 127 -4 264 128 -4 265 129 -4 266 130 -4 267 131 -4 268 132 -4 269 133 -4 270 134 -4 271 135 -4 272 136 -4 273 141 -4 274 137 -4 275 142 -4 276 138 -4 277 143 -4 278 139 -4 279 144 -4 280 145 -4 281 140 -4 282 146 -4 283 146 -4 284 147 -4 285 147 -4 286 148 -4 287 149 -4 288 150 -4 289 151 -4 290 152 -4 291 153 -4 292 154 -4 293 155 -4 294 141 -4 295 156 -4 296 142 -4 297 157 -4 298 143 -4 299 144 -4 300 158 -4 301 145 -4 302 159 -4 303 160 -4 304 161 -4 305 148 -4 306 149 -4 307 150 -4 308 151 -4 309 152 -4 310 153 -4 311 162 -4 312 163 -4 313 155 -4 314 164 -4 315 156 -4 316 165 -4 317 157 -4 318 166 -4 319 167 -4 320 158 -4 321 168 -4 322 159 -4 323 160 -4 324 161 -4 325 169 -4 326 170 -4 327 171 -4 328 172 -4 329 173 -4 330 174 -4 331 175 -4 332 176 -4 333 163 -4 334 177 -4 335 164 -4 336 178 -4 337 165 -4 338 179 -4 339 166 -4 340 167 -4 341 180 -4 342 168 -4 343 181 -4 344 182 -4 345 183 -4 346 184 -4 347 185 -4 348 169 -4 349 170 -4 350 171 -4 351 172 -4 352 173 -4 353 174 -4 354 175 -4 355 186 -4 356 176 -4 357 187 -4 358 177 -4 359 188 -4 360 178 -4 361 189 -4 362 179 -4 363 190 -4 364 191 -4 365 180 -4 366 181 -4 367 192 -4 368 192 -4 369 182 -4 370 183 -4 371 184 -4 372 185 -4 373 193 -4 374 194 -4 375 195 -4 376 196 -4 377 197 -4 378 198 -4 379 199 -4 380 200 -4 381 201 -4 382 187 -4 383 202 -4 384 188 -4 385 203 -4 386 189 -4 387 204 -4 388 190 -4 389 191 -4 390 205 -4 391 206 -4 392 206 -4 393 207 -4 394 207 -4 395 208 -4 396 208 -4 397 193 -4 398 194 -4 399 195 -4 400 196 -4 401 197 -4 402 198 -4 403 199 -4 404 200 -4 405 201 -4 406 209 -4 407 202 -4 408 210 -4 409 203 -4 410 211 -4 411 204 -4 412 212 -4 413 205 -4 414 213 -4 415 213 -4 416 214 -4 417 214 -4 418 215 -4 419 215 -4 420 216 -4 421 217 -4 422 218 -4 423 219 -4 424 220 -4 425 221 -4 426 222 -4 427 223 -4 428 224 -4 429 209 -4 430 225 -4 431 210 -4 432 226 -4 433 211 -4 434 227 -4 435 212 -4 436 228 -4 437 228 -4 438 229 -4 439 229 -4 440 230 -4 441 230 -4 442 216 -4 443 217 -4 444 218 -4 445 219 -4 446 220 -4 447 221 -4 448 222 -4 449 223 -4 450 224 -4 451 231 -4 452 225 -4 453 232 -4 454 226 -4 455 233 -4 456 227 -4 457 234 -4 458 234 -4 459 235 -4 460 235 -4 461 236 -4 462 236 -4 463 237 -4 464 237 -4 465 238 -4 466 239 -4 467 240 -4 468 241 -4 469 242 -4 470 243 -4 471 244 -4 472 231 -4 473 245 -4 474 232 -4 475 246 -4 476 233 -4 477 247 -4 478 247 -4 479 248 -4 480 248 -4 481 249 -4 482 249 -4 483 250 -4 484 250 -4 485 238 -4 486 239 -4 487 240 -4 488 241 -4 489 242 -4 490 243 -4 491 244 -4 492 251 -4 493 245 -4 494 252 -4 495 246 -4 496 253 -4 497 253 -4 498 254 -4 499 254 -4 500 255 -4 501 255 -4 502 256 -4 503 256 -4 504 257 -4 505 257 -4 506 258 -4 507 259 -4 508 260 -4 509 261 -4 510 262 -4 511 251 -4 512 263 -4 513 252 -4 514 264 -4 515 264 -4 516 265 -4 517 265 -4 518 266 -4 519 266 -4 520 267 -4 521 267 -4 522 268 -4 523 268 -4 524 258 -4 525 259 -4 526 260 -4 527 261 -4 528 269 -4 529 263 -4 530 270 -4 531 270 -4 532 271 -4 533 271 -4 534 272 -4 535 272 -4 536 273 -4 537 273 -4 538 274 -4 539 274 -4 540 275 -4 541 275 -4 542 276 -4 543 277 -4 544 277 -4 545 278 -4 546 278 -4 547 279 -4 548 279 -4 549 280 -4 550 280 -4 551 281 -4 552 281 -4 553 282 -4 554 282 -4 555 283 -4 556 283 -4 557 284 -4 558 284 -4 559 285 -4 560 285 -4 561 286 -4 562 286 -4 563 287 -4 564 288 -4 565 288 -4 566 289 -4 567 290 -4 568 5 -4 569 11 -4 570 291 -4 571 292 -4 572 293 -4 573 292 -4 574 294 -4 575 295 -4 576 294 -4 577 296 -4 578 154 -4 579 162 -4 580 297 -4 581 298 -4 582 299 -4 583 298 -4 584 300 -4 585 301 -4 586 300 -4 587 302 -4 588 269 -4 589 276 -4 590 303 -4 591 304 -4 592 305 -4 593 305 -4 594 306 -4 595 307 -4 596 308 -4 597 309 -4 598 310 -4 599 311 -4 600 312 -4 601 313 -4 602 314 -4 603 315 -4 604 316 -4 605 317 -4 606 318 -4 607 290 -4 608 291 -4 609 319 -4 610 320 -4 611 296 -4 612 297 -4 613 321 -4 614 322 -4 615 302 -4 616 303 -4 617 323 -4 618 318 -4 619 324 -4 620 325 -4 621 319 -4 622 320 -4 623 326 -4 624 327 -4 625 321 -4 626 322 -4 627 328 -4 628 329 -4 629 323 -4 630 306 -4 631 307 -4 632 308 -4 633 309 -4 634 310 -4 635 311 -4 636 312 -4 637 313 -4 638 314 -4 639 315 -4 640 316 -4 641 317 -4 642 0 -4 643 324 -4 644 325 -4 645 29 -4 646 114 -4 647 326 -4 648 327 -4 649 186 -4 650 262 -4 651 328 -4 652 329 -4 653 287 -4 654 289 -4 655 293 -4 656 295 -4 657 299 -4 658 301 -4 659 304 diff --git a/L1Trigger/L1THGCal/data/triggercell_mapping.txt b/L1Trigger/L1THGCal/data/triggercell_mapping.txt deleted file mode 100644 index 34a931647330a..0000000000000 --- a/L1Trigger/L1THGCal/data/triggercell_mapping.txt +++ /dev/null @@ -1,373 +0,0 @@ -0 0 0 -0 1 0 -0 2 1 -0 3 1 -0 4 0 -0 5 2 -0 6 2 -0 7 1 -0 8 1 -0 9 1 -0 10 0 -0 11 0 -0 12 2 -0 13 2 -0 14 2 -0 15 3 -0 16 3 -0 17 4 -0 18 4 -0 19 5 -0 20 5 -0 21 6 -0 22 6 -0 23 7 -0 24 7 -0 25 7 -0 26 3 -0 27 3 -0 28 3 -0 29 4 -0 30 4 -0 31 5 -0 32 5 -0 33 6 -0 34 6 -0 35 7 -0 36 7 -0 37 8 -0 38 9 -0 39 9 -0 40 10 -0 41 10 -0 42 11 -0 43 11 -0 44 12 -0 45 12 -0 46 13 -0 47 13 -0 48 8 -0 49 9 -0 50 9 -0 51 9 -0 52 10 -0 53 10 -0 54 11 -0 55 11 -0 56 12 -0 57 12 -0 58 13 -0 59 13 -0 60 8 -0 61 14 -0 62 14 -0 63 15 -0 64 15 -0 65 16 -0 66 16 -0 67 17 -0 68 17 -0 69 18 -0 70 18 -0 71 8 -0 72 19 -0 73 14 -0 74 14 -0 75 15 -0 76 15 -0 77 16 -0 78 16 -0 79 17 -0 80 17 -0 81 18 -0 82 18 -0 83 18 -0 84 19 -0 85 20 -0 86 20 -0 87 21 -0 88 21 -0 89 22 -0 90 22 -0 91 23 -0 92 23 -0 93 24 -0 94 24 -0 95 19 -0 96 19 -0 97 20 -0 98 20 -0 99 21 -0 100 21 -0 101 22 -0 102 22 -0 103 23 -0 104 23 -0 105 24 -0 106 24 -0 107 19 -0 108 25 -0 109 25 -0 110 26 -0 111 26 -0 112 27 -0 113 27 -0 114 28 -0 115 28 -0 116 24 -0 117 24 -0 118 25 -0 119 25 -0 120 26 -0 121 26 -0 122 27 -0 123 27 -0 124 28 -0 125 28 -0 126 25 -0 127 29 -0 128 29 -0 129 29 -0 130 28 -0 131 29 -0 132 29 -1 0 0 -1 1 0 -1 2 1 -1 3 0 -1 4 0 -1 5 0 -1 6 1 -1 7 1 -1 8 1 -1 9 2 -1 10 2 -1 11 3 -1 12 3 -1 13 4 -1 14 4 -1 15 5 -1 16 5 -1 17 6 -1 18 7 -1 19 7 -1 20 2 -1 21 2 -1 22 3 -1 23 3 -1 24 4 -1 25 4 -1 26 5 -1 27 5 -1 28 6 -1 29 6 -1 30 8 -1 31 8 -1 32 7 -1 33 9 -1 34 9 -1 35 10 -1 36 10 -1 37 11 -1 38 11 -1 39 12 -1 40 12 -1 41 13 -1 42 13 -1 43 14 -1 44 14 -1 45 8 -1 46 8 -1 47 7 -1 48 7 -1 49 9 -1 50 9 -1 51 10 -1 52 10 -1 53 11 -1 54 11 -1 55 12 -1 56 12 -1 57 13 -1 58 13 -1 59 14 -1 60 14 -1 61 8 -1 62 15 -1 63 15 -1 64 16 -1 65 16 -1 66 17 -1 67 17 -1 68 18 -1 69 18 -1 70 19 -1 71 19 -1 72 20 -1 73 20 -1 74 21 -1 75 21 -1 76 22 -1 77 22 -1 78 15 -1 79 15 -1 80 16 -1 81 16 -1 82 17 -1 83 17 -1 84 18 -1 85 18 -1 86 19 -1 87 19 -1 88 20 -1 89 20 -1 90 21 -1 91 21 -1 92 22 -1 93 23 -1 94 23 -1 95 24 -1 96 24 -1 97 25 -1 98 25 -1 99 26 -1 100 26 -1 101 27 -1 102 27 -1 103 28 -1 104 28 -1 105 29 -1 106 29 -1 107 22 -1 108 22 -1 109 23 -1 110 23 -1 111 24 -1 112 24 -1 113 25 -1 114 25 -1 115 26 -1 116 26 -1 117 27 -1 118 27 -1 119 28 -1 120 28 -1 121 29 -1 122 29 -1 123 30 -1 124 31 -1 125 31 -1 126 32 -1 127 32 -1 128 33 -1 129 33 -1 130 34 -1 131 34 -1 132 35 -1 133 35 -1 134 36 -1 135 36 -1 136 37 -1 137 37 -1 138 30 -1 139 30 -1 140 31 -1 141 31 -1 142 32 -1 143 32 -1 144 33 -1 145 33 -1 146 34 -1 147 34 -1 148 35 -1 149 35 -1 150 36 -1 151 36 -1 152 37 -1 153 37 -1 154 30 -1 155 38 -1 156 38 -1 157 39 -1 158 39 -1 159 40 -1 160 40 -1 161 41 -1 162 41 -1 163 42 -1 164 42 -1 165 43 -1 166 43 -1 167 44 -1 168 44 -1 169 45 -1 170 45 -1 171 38 -1 172 38 -1 173 39 -1 174 39 -1 175 40 -1 176 40 -1 177 41 -1 178 41 -1 179 42 -1 180 42 -1 181 43 -1 182 43 -1 183 44 -1 184 44 -1 185 45 -1 186 46 -1 187 46 -1 188 47 -1 189 47 -1 190 48 -1 191 48 -1 192 49 -1 193 49 -1 194 50 -1 195 50 -1 196 51 -1 197 51 -1 198 52 -1 199 52 -1 200 45 -1 201 46 -1 202 46 -1 203 47 -1 204 47 -1 205 48 -1 206 48 -1 207 49 -1 208 49 -1 209 50 -1 210 50 -1 211 51 -1 212 52 -1 213 52 -1 214 46 -1 215 53 -1 216 53 -1 217 54 -1 218 54 -1 219 55 -1 220 55 -1 221 56 -1 222 56 -1 223 56 -1 224 51 -1 225 53 -1 226 53 -1 227 54 -1 228 54 -1 229 55 -1 230 55 -1 231 56 -1 232 56 -1 233 53 -1 234 57 -1 235 57 -1 236 57 -1 237 57 -1 238 57 -1 239 57 From 9506526c2cf4842fe9c2f9f8410c020c58302a57 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Sauvan Date: Sat, 25 Jun 2016 18:15:50 +0200 Subject: [PATCH 43/43] Move stringstream outside loop and reserve vector --- L1Trigger/L1THGCal/plugins/HGCalTriggerDigiFEReproducer.cc | 5 ++++- L1Trigger/L1THGCal/plugins/HGCalTriggerDigiProducer.cc | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiFEReproducer.cc b/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiFEReproducer.cc index b359f5ece802d..ba84e6c4caae1 100644 --- a/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiFEReproducer.cc +++ b/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiFEReproducer.cc @@ -91,6 +91,8 @@ void HGCalTriggerDigiFEReproducer::produce(edm::Event& e, const edm::EventSetup& const l1t::HGCFETriggerDigiCollection& digis = *digis_h; + fe_output->reserve(digis.size()); + std::stringstream output; for( const auto& digi_in : digis ) { const auto& module = triggerGeometry_->modules().at(digi_in.id()); @@ -99,11 +101,12 @@ void HGCalTriggerDigiFEReproducer::produce(edm::Event& e, const edm::EventSetup& codec_->setDataPayload(*module, digi_in); codec_->encode(digi_out); digi_out.setDetId( digi_in.getDetId() ); - std::stringstream output; codec_->print(digi_out,output); edm::LogInfo("HGCalTriggerDigiFEReproducer") << output.str(); codec_->unSetDataPayload(); + output.str(std::string()); + output.clear(); } // get the orphan handle and fe digi collection diff --git a/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiProducer.cc b/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiProducer.cc index 54425bf5e06c6..17cb34f1ee4fe 100644 --- a/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiProducer.cc +++ b/L1Trigger/L1THGCal/plugins/HGCalTriggerDigiProducer.cc @@ -100,17 +100,20 @@ void HGCalTriggerDigiProducer::produce(edm::Event& e, const edm::EventSetup& es) //we produce one output trigger digi per module in the FE //so we use the geometry to tell us what to loop over + fe_output->reserve(triggerGeometry_->modules().size()); + std::stringstream output; for( const auto& module : triggerGeometry_->modules() ) { fe_output->push_back(l1t::HGCFETriggerDigi()); l1t::HGCFETriggerDigi& digi = fe_output->back(); codec_->setDataPayload(*(module.second),ee_digis,fh_digis,bh_digis); codec_->encode(digi); digi.setDetId( HGCalDetId(module.first) ); - std::stringstream output; codec_->print(digi,output); edm::LogInfo("HGCalTriggerDigiProducer") << output.str(); codec_->unSetDataPayload(); + output.str(std::string()); + output.clear(); } // get the orphan handle and fe digi collection