CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FullModuleSumAlgo.cc
Go to the documentation of this file.
4 
6 
7 using namespace HGCalTriggerBackend;
8 
9 class FullModuleSumAlgo : public Algorithm<HGCalBestChoiceCodec>
10 {
11  public:
12 
15  cluster_product_( new l1t::HGCalClusterBxCollection ){}
16 
17  virtual void setProduces(edm::EDProducer& prod) const override final
18  {
20  }
21 
22  virtual void run(const l1t::HGCFETriggerDigiCollection& coll,
23  const std::unique_ptr<HGCalTriggerGeometryBase>& geom) override final;
24 
25  virtual void putInEvent(edm::Event& evt) override final
26  {
27  evt.put(std::move(cluster_product_),name());
28  }
29 
30  virtual void reset() override final
31  {
32  cluster_product_.reset( new l1t::HGCalClusterBxCollection );
33  }
34 
35  private:
36  std::unique_ptr<l1t::HGCalClusterBxCollection> cluster_product_;
37 
38 };
39 
40 /*****************************************************************/
42  const std::unique_ptr<HGCalTriggerGeometryBase>& geom)
43 /*****************************************************************/
44 {
45  for( const auto& digi : coll )
46  {
48  data.reset();
49  const HGCalDetId& moduleId = digi.getDetId<HGCalDetId>();
50  digi.decode(codec_, data);
51 
52  // Sum of trigger cells inside the module
53  uint32_t moduleSum = 0;
54  for(const auto& value : data.payload)
55  {
56  moduleSum += value;
57  }
58  // dummy cluster without position
59  // moduleId filled in place of hardware eta
61  moduleSum, moduleId, 0);
62 
63  cluster_product_->push_back(0,cluster);
64  }
65 }
66 
69  "FullModuleSumAlgo");
std::unique_ptr< l1t::HGCalClusterBxCollection > cluster_product_
virtual void putInEvent(edm::Event &evt) overridefinal
virtual void reset() overridefinal
FullModuleSumAlgo(const edm::ParameterSet &conf)
def move
Definition: eostools.py:510
virtual void run(const l1t::HGCFETriggerDigiCollection &coll, const std::unique_ptr< HGCalTriggerGeometryBase > &geom) overridefinal
JetCorrectorParametersCollection coll
Definition: classes.h:10
BXVector< HGCalCluster > HGCalClusterBxCollection
Definition: HGCalCluster.h:59
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
virtual void setProduces(edm::EDProducer &prod) const overridefinal
#define DEFINE_EDM_PLUGIN(factory, type, name)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: LeafCandidate.h:23