Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:39

0001 #include "L1Trigger/L1THGCal/interface/HGCalProcessorBase.h"
0002 
0003 #include "DataFormats/L1THGCal/interface/HGCalTriggerSums.h"
0004 #include "DataFormats/L1THGCal/interface/HGCalTowerMap.h"
0005 #include "DataFormats/L1THGCal/interface/HGCalTower.h"
0006 
0007 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0008 #include "L1Trigger/L1THGCal/interface/HGCalTriggerGeometryBase.h"
0009 #include "L1Trigger/L1THGCal/interface/backend/HGCalTowerMap2DImpl.h"
0010 
0011 class HGCalTowerMapProcessor : public HGCalTowerMapProcessorBase {
0012 public:
0013   HGCalTowerMapProcessor(const edm::ParameterSet& conf) : HGCalTowerMapProcessorBase(conf) {
0014     towermap2D_ = std::make_unique<HGCalTowerMap2DImpl>(conf.getParameterSet("towermap_parameters"));
0015   }
0016 
0017   void run(const edm::Handle<l1t::HGCalTriggerSumsBxCollection>& collHandle,
0018            l1t::HGCalTowerMapBxCollection& collTowerMap) override {
0019     towermap2D_->setGeometry(geometry());
0020 
0021     /* create a persistent vector of pointers to the trigger-sums */
0022     std::vector<edm::Ptr<l1t::HGCalTriggerSums>> triggerSumsPtrs;
0023     for (unsigned i = 0; i < collHandle->size(); ++i) {
0024       edm::Ptr<l1t::HGCalTriggerSums> ptr(collHandle, i);
0025       triggerSumsPtrs.push_back(ptr);
0026     }
0027 
0028     /* call to towerMap2D clustering */
0029     towermap2D_->buildTowerMap2D(triggerSumsPtrs, collTowerMap);
0030   }
0031 
0032 private:
0033   /* algorithms instances */
0034   std::unique_ptr<HGCalTowerMap2DImpl> towermap2D_;
0035 };
0036 
0037 DEFINE_EDM_PLUGIN(HGCalTowerMapFactory, HGCalTowerMapProcessor, "HGCalTowerMapProcessor");