Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-18 08:23:36

0001 #include "L1Trigger/L1THGCal/interface/backend/HGCalBackendStage1Processor.h"
0002 #include "DataFormats/ForwardDetId/interface/HGCalTriggerBackendDetId.h"
0003 
0004 DEFINE_EDM_PLUGIN(HGCalBackendStage1Factory, HGCalBackendStage1Processor, "HGCalBackendStage1Processor");
0005 
0006 HGCalBackendStage1Processor::HGCalBackendStage1Processor(const edm::ParameterSet& conf)
0007     : HGCalBackendStage1ProcessorBase(conf), conf_(conf) {
0008   const edm::ParameterSet& truncationParamConfig = conf.getParameterSet("truncation_parameters");
0009   const std::string& truncationWrapperName = truncationParamConfig.getParameter<std::string>("AlgoName");
0010 
0011   truncationWrapper_ = std::unique_ptr<HGCalStage1TruncationWrapperBase>{
0012       HGCalStage1TruncationWrapperBaseFactory::get()->create(truncationWrapperName, truncationParamConfig)};
0013 }
0014 
0015 void HGCalBackendStage1Processor::run(
0016     const std::pair<uint32_t, std::vector<edm::Ptr<l1t::HGCalTriggerCell>>>& fpga_id_tcs,
0017     std::vector<edm::Ptr<l1t::HGCalTriggerCell>>& truncated_tcs) {
0018   const unsigned sector120 = HGCalTriggerBackendDetId(fpga_id_tcs.first).sector();
0019   const uint32_t fpga_id = fpga_id_tcs.first;
0020 
0021   // Configuration
0022   const std::tuple<const HGCalTriggerGeometryBase* const, unsigned, uint32_t> configuration{
0023       geometry(), sector120, fpga_id};
0024   truncationWrapper_->configure(configuration);
0025 
0026   truncationWrapper_->process(fpga_id_tcs.second, truncated_tcs);
0027 }