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:
55  const std::string name_;
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
HGCalTriggerBackendAlgorithmBase::setGeometry
virtual void setGeometry(const HGCalTriggerGeometryBase *const geom)
Definition: HGCalTriggerBackendAlgorithmBase.h:48
HGCalTriggerGeometryBase
Definition: HGCalTriggerGeometryBase.h:19
PluginFactory.h
HGCalTriggerBackendAlgorithmBase::name_
const std::string name_
Definition: HGCalTriggerBackendAlgorithmBase.h:63
HGCFETriggerDigiDefs.h
HGCalTriggerBackendAlgorithmBase::name
const std::string & name() const
Definition: HGCalTriggerBackendAlgorithmBase.h:46
HGCalTriggerBackendAlgorithmBase::HGCalTriggerBackendAlgorithmBase
HGCalTriggerBackendAlgorithmBase(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
Definition: HGCalTriggerBackendAlgorithmBase.h:41
HGCalTriggerBackendAlgorithmBase::putInEvent
virtual void putInEvent(edm::Event &evt)=0
EDProducer.h
edm::SortedCollection
Definition: SortedCollection.h:49
HGCalTriggerBackend::Algorithm::codec_
FECODEC codec_
Definition: HGCalTriggerBackendAlgorithmBase.h:72
HGCalTriggerBackendAlgorithmBase::run
virtual void run(const l1t::HGCFETriggerDigiCollection &coll, const edm::EventSetup &es, edm::Event &e)=0
HGCalTriggerGeometryBase.h
HGCalTriggerBackendAlgorithmBase::reset
virtual void reset()=0
HGCFETriggerDigi.h
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
HGCalTriggerBackendAlgorithmBase::setProduces
virtual void setProduces(edm::stream::EDProducer<> &prod) const =0
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalTriggerBackend::Algorithm::setGeometry
void setGeometry(const HGCalTriggerGeometryBase *const geom) final
Definition: HGCalTriggerBackendAlgorithmBase.h:66
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
edmplugin::PluginFactory
Definition: PluginFactory.h:34
HGCalTriggerBackend
Definition: HGCalTriggerBackendAlgorithmBase.h:59
HGCalTriggerBackendAlgorithmBase::~HGCalTriggerBackendAlgorithmBase
virtual ~HGCalTriggerBackendAlgorithmBase()
Definition: HGCalTriggerBackendAlgorithmBase.h:44
HGCDigiCollections.h
edm::stream::EDProducer<>
edm::EventSetup
Definition: EventSetup.h:57
cc
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
edm::getParameterSet
ParameterSet const & getParameterSet(ParameterSetID const &id)
Definition: ParameterSet.cc:855
HGCalTriggerBackend::Algorithm
Definition: HGCalTriggerBackendAlgorithmBase.h:61
HGCalTriggerBackendAlgorithmBase
Definition: HGCalTriggerBackendAlgorithmBase.h:29
ParameterSet.h
edm::Event
Definition: Event.h:73
HGCalTriggerBackend::Algorithm::Algorithm
Algorithm(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
Definition: HGCalTriggerBackendAlgorithmBase.h:63
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
HGCalTriggerBackendAlgorithmBase::geometry_
const HGCalTriggerGeometryBase * geometry_
Definition: HGCalTriggerBackendAlgorithmBase.h:60