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
35  name_(conf.getParameter<std::string>("AlgorithmName"))
36  {}
37 
39 
40  const std::string& name() const { return name_; }
41 
42  virtual void setGeometry(const HGCalTriggerGeometryBase* const geom) {geometry_ = geom;}
43 
44  //runs the trigger algorithm, storing internally the results
45  virtual void setProduces(edm::stream::EDProducer<>& prod) const = 0;
46 
47  virtual void run(const l1t::HGCFETriggerDigiCollection& coll,
48  const edm::EventSetup& es,
49  edm::Event &e
50  ) = 0;
51 
52  virtual void putInEvent(edm::Event& evt) = 0;
53 
54  virtual void reset() = 0;
55 
56  protected:
58 
59  private:
61 };
62 
63 // ----> all backend algorithm classes derive from this <----
64 // inheritance looks like class MyAlgorithm : public HGCalTriggerBackend::Algorithm<MyCodec>
66  template<typename FECODEC>
68  public:
71  codec_(conf.getParameterSet("FECodec")){ }
72 
73  void setGeometry(const HGCalTriggerGeometryBase* const geom) final {
75  codec_.setGeometry(geom);
76  }
77 
78  protected:
79  FECODEC codec_;
80  };
81 }
82 
85 
86 #endif
const HGCalTriggerGeometryBase * geometry_
edmplugin::PluginFactory< HGCalTriggerBackendAlgorithmBase *(const edm::ParameterSet &, edm::ConsumesCollector &) > HGCalTriggerBackendAlgorithmFactory
ParameterSet const & getParameterSet(ParameterSetID const &id)
virtual void setGeometry(const HGCalTriggerGeometryBase *const geom)
Algorithm(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
#define nullptr
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
void setGeometry(const HGCalTriggerGeometryBase *const geom) final
virtual void putInEvent(edm::Event &evt)=0