CMS 3D CMS Logo

RandomClusterAlgo.cc
Go to the documentation of this file.
3 
5 
6 using namespace HGCalTriggerBackend;
7 
8 class RandomClusterAlgo : public Algorithm<HGCal64BitRandomCodec> {
9 public:
10 
13  cluster_product_( new l1t::HGCalClusterBxCollection ){
14  }
15 
16  virtual void setProduces(edm::stream::EDProducer<>& prod) const override final {
18  }
19 
20  virtual void run(const l1t::HGCFETriggerDigiCollection& coll,
21  const edm::EventSetup& es,
22  edm::Event&evt
23  ) override final;
24 
25  virtual void putInEvent(edm::Event& evt) override final {
26  evt.put(std::move(cluster_product_),name());
27  }
28 
29  virtual void reset() override final {
30  cluster_product_.reset( new l1t::HGCalClusterBxCollection );
31  }
32 
33 private:
34  std::unique_ptr<l1t::HGCalClusterBxCollection> cluster_product_;
35 
36 };
37 
39  const edm::EventSetup& es,
40  edm::Event&evt
41  ) {
42  for( const auto& digi : coll ) {
44  digi.decode(codec_,my_data);
45 
46  unsigned word1 = my_data.payload & 0xffff;
47  unsigned word2 = (my_data.payload >> 16) & 0xffff;
48  unsigned word3 = (my_data.payload >> 32) & 0xffff;
49  unsigned word4 = (my_data.payload >> 48) & 0xffff;
50 
52  word1, word2, word3^word4 );
53 
54  cluster_product_->push_back(0,cluster);
55  }
56 }
57 
60  "RandomClusterAlgo");
RandomClusterAlgo(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
std::unique_ptr< l1t::HGCalClusterBxCollection > cluster_product_
virtual void putInEvent(edm::Event &evt) override final
delete x;
Definition: CaloConfig.h:22
virtual void setProduces(edm::stream::EDProducer<> &prod) const override final
virtual void reset() override final
JetCorrectorParametersCollection coll
Definition: classes.h:10
BXVector< HGCalCluster > HGCalClusterBxCollection
Definition: HGCalCluster.h:36
#define DEFINE_EDM_PLUGIN(factory, type, name)
virtual void run(const l1t::HGCFETriggerDigiCollection &coll, const edm::EventSetup &es, edm::Event &evt) override final
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: LeafCandidate.h:23
def move(src, dest)
Definition: eostools.py:510