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:
22  Algorithm<FECODEC>(conf),
23  cluster_product_( new l1t::HGCalClusterBxCollection ){}
24 
25  virtual void setProduces(edm::EDProducer& prod) const override final
26  {
28  }
29 
30  virtual void run(const l1t::HGCFETriggerDigiCollection& coll, const edm::EventSetup& es) override final
31  {
32  for( const auto& digi : coll )
33  {
34  DATA data;
35  data.reset();
36  const HGCalDetId& moduleId = digi.getDetId<HGCalDetId>();
37  digi.decode(codec_, data);
38 
39  // Sum of trigger cells inside the module
40  uint32_t moduleSum = 0;
41  for(const auto& triggercell : data.payload)
42  {
43  moduleSum += triggercell.hwPt();
44  }
45  // dummy cluster without position
46  // moduleId filled in place of hardware eta
47  l1t::HGCalCluster cluster( reco::LeafCandidate::LorentzVector(), moduleSum, 0, 0);
48  cluster.setModule(moduleId.wafer());
49  cluster.setLayer(moduleId.layer());
50  cluster.setSubDet(moduleId.subdetId());
51  cluster_product_->push_back(0,cluster);
52  }
53  }
54  virtual void putInEvent(edm::Event& evt) override final
55  {
56  evt.put(std::move(cluster_product_),name());
57  }
58 
59  virtual void reset() override final
60  {
61  cluster_product_.reset( new l1t::HGCalClusterBxCollection );
62  }
63 
64  private:
65  std::unique_ptr<l1t::HGCalClusterBxCollection> cluster_product_;
66 
67 };
68 
71 
72 
75  "FullModuleSumAlgoBestChoice");
76 
79  "FullModuleSumAlgoThreshold");
delete x;
Definition: CaloConfig.h:22
void setSubDet(uint32_t subdet)
Definition: HGCalCluster.h:23
virtual void putInEvent(edm::Event &evt) override final
void setLayer(uint32_t layer)
Definition: HGCalCluster.h:24
void setModule(uint32_t module)
Definition: HGCalCluster.h:25
std::unique_ptr< l1t::HGCalClusterBxCollection > cluster_product_
int wafer() const
get the wafer #
Definition: HGCalDetId.h:42
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
FullModuleSumAlgo(const edm::ParameterSet &conf)
FullModuleSumAlgo< HGCalTriggerCellBestChoiceCodec, HGCalTriggerCellBestChoiceCodec::data_type > FullModuleSumAlgoBestChoice
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 reset() override final
virtual void run(const l1t::HGCFETriggerDigiCollection &coll, const edm::EventSetup &es) override final
#define DEFINE_EDM_PLUGIN(factory, type, name)
virtual void setProduces(edm::EDProducer &prod) const override final
FullModuleSumAlgo< HGCalTriggerCellThresholdCodec, HGCalTriggerCellThresholdCodec::data_type > FullModuleSumAlgoThreshold
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: LeafCandidate.h:23
def move(src, dest)
Definition: eostools.py:510
int layer() const
get the layer #
Definition: HGCalDetId.h:48