CMS 3D CMS Logo

SingleCellClusterAlgo.cc
Go to the documentation of this file.
7 
8 using namespace HGCalTriggerBackend;
9 
10 template<typename FECODEC, typename DATA>
11 class SingleCellClusterAlgo : public Algorithm<FECODEC>
12 {
13  public:
15 
16  protected:
18 
19  public:
21  Algorithm<FECODEC>(conf,cc),
22  cluster_product_( new l1t::HGCalTriggerCellBxCollection ),
23  HGCalEESensitive_(conf.getParameter<std::string>("HGCalEESensitive_tag")),
24  HGCalHESiliconSensitive_(conf.getParameter<std::string>("HGCalHESiliconSensitive_tag")),
25  calibration_(conf.getParameterSet("calib_parameters")){}
26 
27  typedef std::unique_ptr<HGCalTriggerGeometryBase> ReturnType;
28 
29  virtual void setProduces(edm::stream::EDProducer<>& prod) const override final
30  {
32  }
33 
34  virtual void run(const l1t::HGCFETriggerDigiCollection& coll, const edm::EventSetup& es,
35  edm::Event&evt
36  ) override final
37  {
38  es.get<IdealGeometryRecord>().get(HGCalEESensitive_, hgceeTopoHandle_);
39  es.get<IdealGeometryRecord>().get(HGCalHESiliconSensitive_, hgchefTopoHandle_);
40 
41  for( const auto& digi : coll )
42  {
43  HGCalDetId module_id(digi.id());
44  DATA data;
45  data.reset();
46  digi.decode(codec_, data);
47  for(const auto& triggercell : data.payload)
48  {
49  if(triggercell.hwPt()>0)
50  {
51 
52  HGCalDetId detid(triggercell.detId());
53  int subdet = detid.subdetId();
54  int cellThickness = 0;
55 
56  if( subdet == HGCEE ){
57  cellThickness = (hgceeTopoHandle_)->dddConstants().waferTypeL((unsigned int)detid.wafer() );
58  }else if( subdet == HGCHEF ){
59  cellThickness = (hgchefTopoHandle_)->dddConstants().waferTypeL((unsigned int)detid.wafer() );
60  }else if( subdet == HGCHEB ){
61  edm::LogWarning("DataNotFound") << "ATTENTION: the BH trgCells are not yet implemented !! ";
62  }
63  l1t::HGCalTriggerCell calibratedtriggercell(triggercell);
64  calibration_.calibrateInGeV(calibratedtriggercell, cellThickness);
65  cluster_product_->push_back(0,calibratedtriggercell);
66  }
67  }
68  }
69  }
70 
71  virtual void putInEvent(edm::Event& evt) override final
72  {
73  evt.put(std::move(cluster_product_),name());
74  }
75 
76  virtual void reset() override final
77  {
78  cluster_product_.reset( new l1t::HGCalTriggerCellBxCollection );
79  }
80 
81  private:
82 
83  std::unique_ptr<l1t::HGCalTriggerCellBxCollection> cluster_product_;
86 
90 
91 };
92 
95 
98  "SingleCellClusterAlgoBestChoice");
99 
102  "SingleCellClusterAlgoThreshold");
BXVector< HGCalTriggerCell > HGCalTriggerCellBxCollection
virtual void run(const l1t::HGCFETriggerDigiCollection &coll, const edm::EventSetup &es, edm::Event &evt) override final
ParameterSet const & getParameterSet(ParameterSetID const &id)
SingleCellClusterAlgo(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
delete x;
Definition: CaloConfig.h:22
SingleCellClusterAlgo< HGCalTriggerCellThresholdCodec, HGCalTriggerCellThresholdCodec::data_type > SingleCellClusterAlgoThreshold
virtual void reset() override final
virtual void setProduces(edm::stream::EDProducer<> &prod) const override final
edm::ESHandle< HGCalTopology > hgchefTopoHandle_
virtual void putInEvent(edm::Event &evt) override final
std::unique_ptr< l1t::HGCalTriggerCellBxCollection > cluster_product_
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
edm::ESHandle< HGCalTopology > hgceeTopoHandle_
JetCorrectorParametersCollection coll
Definition: classes.h:10
HGCalTriggerCellCalibration calibration_
SingleCellClusterAlgo< HGCalTriggerCellBestChoiceCodec, HGCalTriggerCellBestChoiceCodec::data_type > SingleCellClusterAlgoBestChoice
std::unique_ptr< HGCalTriggerGeometryBase > ReturnType
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
#define DEFINE_EDM_PLUGIN(factory, type, name)
def move(src, dest)
Definition: eostools.py:510