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 
18  }
19 
21  const edm::EventSetup& es,
22  edm::Event&evt
23  ) final;
24 
25  void putInEvent(edm::Event& evt) final {
26  evt.put(std::move(cluster_product_),name());
27  }
28 
29  void reset() 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:137
std::unique_ptr< l1t::HGCalClusterBxCollection > cluster_product_
delete x;
Definition: CaloConfig.h:22
JetCorrectorParametersCollection coll
Definition: classes.h:10
void setProduces(edm::stream::EDProducer<> &prod) const final
BXVector< HGCalCluster > HGCalClusterBxCollection
Definition: HGCalCluster.h:36
void run(const l1t::HGCFETriggerDigiCollection &coll, const edm::EventSetup &es, edm::Event &evt) final
#define DEFINE_EDM_PLUGIN(factory, type, name)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: LeafCandidate.h:23
def move(src, dest)
Definition: eostools.py:510
void putInEvent(edm::Event &evt) final