Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-08 22:26:30

0001 #ifndef __L1Trigger_L1THGCal_HGCalProcessorBaseT_h__
0002 #define __L1Trigger_L1THGCal_HGCalProcessorBaseT_h__
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "DataFormats/Common/interface/Handle.h"
0006 
0007 #include "L1Trigger/L1THGCal/interface/HGCalTriggerGeometryBase.h"
0008 
0009 template <typename InputCollection, typename OutputCollection>
0010 class HGCalProcessorBaseT {
0011 public:
0012   HGCalProcessorBaseT(const edm::ParameterSet& conf)
0013       : geometry_(nullptr), name_(conf.getParameter<std::string>("ProcessorName")) {}
0014 
0015   virtual ~HGCalProcessorBaseT() {}
0016 
0017   const std::string& name() const { return name_; }
0018 
0019   virtual void setGeometry(const HGCalTriggerGeometryBase* const geom) { geometry_ = geom; }
0020 
0021   virtual void run(const InputCollection& inputColl, OutputCollection& outColl) = 0;
0022 
0023 protected:
0024   const HGCalTriggerGeometryBase* geometry() const {
0025     if (!geometry_)
0026       throw cms::Exception("HGCTriggerSetupError") << "The geometry has not been set in processor " << name_;
0027     return geometry_;
0028   }
0029 
0030 private:
0031   const HGCalTriggerGeometryBase* geometry_;
0032   const std::string name_;
0033 };
0034 
0035 #endif