CMS 3D CMS Logo

FullModuleSumAlgo.cc
Go to the documentation of this file.
5 
7 
8 using namespace HGCalTriggerBackend;
9 
10 template<typename FECODEC, typename DATA>
11 class FullModuleSumAlgo : public Algorithm<FECODEC>
12 {
13  public:
14 
16 
17  protected:
19 
20  public:
21 
23  Algorithm<FECODEC>(conf,cc),
24  cluster_product_( new l1t::HGCalClusterBxCollection )
25  {}
26 
28  {
30  }
31 
32  void run(const l1t::HGCFETriggerDigiCollection& coll, const edm::EventSetup& es, edm::Event&evt ) final;
33  void putInEvent(edm::Event& evt) final
34  {
35  evt.put(std::move(cluster_product_),name());
36  }
37 
38  void reset() final
39  {
40  cluster_product_.reset( new l1t::HGCalClusterBxCollection );
41  }
42 
43  private:
44  std::unique_ptr<l1t::HGCalClusterBxCollection> cluster_product_;
45 
46 };
47 
48 /*****************************************************************/
49 template<typename FECODEC, typename DATA>
51  const edm::EventSetup& es,
52  edm::Event&evt
53  )
54 /*****************************************************************/
55 {
56  for( const auto& digi : coll )
57  {
58  DATA data;
59  data.reset();
60  const HGCalDetId& moduleId = digi.getDetId<HGCalDetId>();
61  digi.decode(codec_, data);
62 
63  // Sum of trigger cells inside the module
64  uint32_t moduleSum = 0;
65  for(const auto& triggercell : data.payload)
66  {
67  moduleSum += triggercell.hwPt();
68  }
69  // dummy cluster without position
70  // moduleId filled in place of hardware eta
72  moduleSum, 0, 0);
73  cluster.setModule(moduleId.wafer());
74  cluster_product_->push_back(0,cluster);
75  }
76 }
77 
80 
83  "FullModuleSumAlgoBestChoice");
84 
87  "FullModuleSumAlgoThreshold");
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
delete x;
Definition: CaloConfig.h:22
void setModule(uint32_t module)
Definition: HGCalCluster.h:27
void setProduces(edm::stream::EDProducer<> &prod) const final
std::unique_ptr< l1t::HGCalClusterBxCollection > cluster_product_
int wafer() const
get the wafer #
Definition: HGCalDetId.h:42
FullModuleSumAlgo(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
FullModuleSumAlgo< HGCalTriggerCellBestChoiceCodec, HGCalTriggerCellBestChoiceCodec::data_type > FullModuleSumAlgoBestChoice
JetCorrectorParametersCollection coll
Definition: classes.h:10
void putInEvent(edm::Event &evt) final
BXVector< HGCalCluster > HGCalClusterBxCollection
Definition: HGCalCluster.h:36
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void run(const l1t::HGCFETriggerDigiCollection &coll, const edm::EventSetup &es, edm::Event &evt) final
#define DEFINE_EDM_PLUGIN(factory, type, name)
FullModuleSumAlgo< HGCalTriggerCellThresholdCodec, HGCalTriggerCellThresholdCodec::data_type > FullModuleSumAlgoThreshold
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: LeafCandidate.h:23
def move(src, dest)
Definition: eostools.py:510