CMS 3D CMS Logo

HGCalTriggerBackendAlgorithmBase.h
Go to the documentation of this file.
1 #ifndef __L1Trigger_L1THGCal_HGCalTriggerBackendAlgorithmBase_h__
2 #define __L1Trigger_L1THGCal_HGCalTriggerBackendAlgorithmBase_h__
3 
5 
7 
10 
12 
15 
16 #include <memory>
17 
18 /*******
19  *
20  * class: HGCalTriggerBackendAlgorithmBase
21  * author: L.Gray (FNAL)
22  * date: 27 July, 2015
23  *
24  * This contains two base classes, one which presents the abstract interface,
25  * and a second that allows specialization to various FE codecs so that
26  * data can be manipulated directly.
27  *
28  *******/
29 
31 public:
32  // Allow HGCalTriggerBackend to be passed a consume collector
34  : geometry_(nullptr), name_(conf.getParameter<std::string>("AlgorithmName")) {}
35 
37 
38  const std::string& name() const { return name_; }
39 
40  virtual void setGeometry(const HGCalTriggerGeometryBase* const geom) { geometry_ = geom; }
41 
42  //runs the trigger algorithm, storing internally the results
43  virtual void setProduces(edm::stream::EDProducer<>& prod) const = 0;
44 
45  virtual void run(const l1t::HGCFETriggerDigiCollection& coll, const edm::EventSetup& es, edm::Event& e) = 0;
46 
47  virtual void putInEvent(edm::Event& evt) = 0;
48 
49  virtual void reset() = 0;
50 
51 protected:
53 
54 private:
56 };
57 
58 // ----> all backend algorithm classes derive from this <----
59 // inheritance looks like class MyAlgorithm : public HGCalTriggerBackend::Algorithm<MyCodec>
61  template <typename FECODEC>
63  public:
65  : HGCalTriggerBackendAlgorithmBase(conf, cc), codec_(conf.getParameterSet("FECodec")) {}
66 
67  void setGeometry(const HGCalTriggerGeometryBase* const geom) final {
69  codec_.setGeometry(geom);
70  }
71 
72  protected:
73  FECODEC codec_;
74  };
75 } // namespace HGCalTriggerBackend
76 
80 
81 #endif
const HGCalTriggerGeometryBase * geometry_
ParameterSet const & getParameterSet(ParameterSetID const &id)
virtual void setGeometry(const HGCalTriggerGeometryBase *const geom)
#define nullptr
Algorithm(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
virtual void setProduces(edm::stream::EDProducer<> &prod) const =0
virtual void run(const l1t::HGCFETriggerDigiCollection &coll, const edm::EventSetup &es, edm::Event &e)=0
HGCalTriggerBackendAlgorithmBase(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
JetCorrectorParametersCollection coll
Definition: classes.h:10
edmplugin::PluginFactory< HGCalTriggerBackendAlgorithmBase *(const edm::ParameterSet &, edm::ConsumesCollector &)> HGCalTriggerBackendAlgorithmFactory
void setGeometry(const HGCalTriggerGeometryBase *const geom) final
virtual void putInEvent(edm::Event &evt)=0