CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SingleCellClusterAlgo.cc
Go to the documentation of this file.
4 
6 
7 using namespace HGCalTriggerBackend;
8 
9 class SingleCellClusterAlgo : 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  int i = 0;
52  for(const auto& value : data.payload)
53  {
54  if(value>0)
55  {
56  GlobalPoint point = geom->getModulePosition(moduleId);
57  math::PtEtaPhiMLorentzVector p4((double)value/cosh(point.eta()), point.eta(), point.phi(), 0.);
58  // index in module stored as hwEta
59  l1t::HGCalCluster cluster(
61  value, i, 0);
62  cluster.setP4(p4);
63  cluster.setModule(moduleId.wafer());
64  cluster.setLayer(moduleId.layer());
65  cluster.setSubDet(moduleId.subdetId());
66  cluster_product_->push_back(0,cluster);
67  }
68  i++;
69  }
70 
71  }
72 }
73 
76  "SingleCellClusterAlgo");
int i
Definition: DBlmapReader.cc:9
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
void setSubDet(uint32_t subdet)
Definition: HGCalCluster.h:23
void setLayer(uint32_t layer)
Definition: HGCalCluster.h:24
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
void setModule(uint32_t module)
Definition: HGCalCluster.h:25
virtual void putInEvent(edm::Event &evt) overridefinal
double p4[4]
Definition: TauolaWrapper.h:92
def move
Definition: eostools.py:510
int wafer() const
get the wafer #
Definition: HGCalDetId.h:42
SingleCellClusterAlgo(const edm::ParameterSet &conf)
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
virtual void setProduces(edm::EDProducer &prod) const overridefinal
JetCorrectorParametersCollection coll
Definition: classes.h:10
virtual void reset() overridefinal
virtual void setP4(const LorentzVector &p4) final
set 4-momentum
BXVector< HGCalCluster > HGCalClusterBxCollection
Definition: HGCalCluster.h:59
virtual void run(const l1t::HGCFETriggerDigiCollection &coll, const std::unique_ptr< HGCalTriggerGeometryBase > &geom) overridefinal
T eta() const
Definition: PV3DBase.h:76
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
#define DEFINE_EDM_PLUGIN(factory, type, name)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: LeafCandidate.h:23
int layer() const
get the layer #
Definition: HGCalDetId.h:48
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
std::unique_ptr< l1t::HGCalClusterBxCollection > cluster_product_