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),
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::EDProducer& prod) const override final
30  {
32  }
33 
34  virtual void run(const l1t::HGCFETriggerDigiCollection& coll, const edm::EventSetup& es) override final
35  {
36  es.get<IdealGeometryRecord>().get(HGCalEESensitive_, hgceeTopoHandle_);
37  es.get<IdealGeometryRecord>().get(HGCalHESiliconSensitive_, hgchefTopoHandle_);
38 
39  for( const auto& digi : coll )
40  {
41  HGCalDetId module_id(digi.id());
42  DATA data;
43  data.reset();
44  digi.decode(codec_, data);
45  for(const auto& triggercell : data.payload)
46  {
47  if(triggercell.hwPt()>0)
48  {
49 
50  HGCalDetId detid(triggercell.detId());
51  int subdet = detid.subdetId();
52  int cellThickness = 0;
53 
54  if( subdet == HGCEE ){
55  cellThickness = (hgceeTopoHandle_)->dddConstants().waferTypeL((unsigned int)detid.wafer() );
56  }else if( subdet == HGCHEF ){
57  cellThickness = (hgchefTopoHandle_)->dddConstants().waferTypeL((unsigned int)detid.wafer() );
58  }else if( subdet == HGCHEB ){
59  edm::LogWarning("DataNotFound") << "ATTENTION: the BH trgCells are not yet implemented !! ";
60  }
61  l1t::HGCalTriggerCell calibratedtriggercell(triggercell);
62  calibration_.calibrate(calibratedtriggercell, cellThickness);
63  cluster_product_->push_back(0,calibratedtriggercell);
64  }
65  }
66  }
67  }
68 
69  virtual void putInEvent(edm::Event& evt) override final
70  {
71  evt.put(std::move(cluster_product_),name());
72  }
73 
74  virtual void reset() override final
75  {
76  cluster_product_.reset( new l1t::HGCalTriggerCellBxCollection );
77  }
78 
79  private:
80 
81  std::unique_ptr<l1t::HGCalTriggerCellBxCollection> cluster_product_;
84 
88 
89 };
90 
93 
96  "SingleCellClusterAlgoBestChoice");
97 
100  "SingleCellClusterAlgoThreshold");
BXVector< HGCalTriggerCell > HGCalTriggerCellBxCollection
ParameterSet const & getParameterSet(ParameterSetID const &id)
delete x;
Definition: CaloConfig.h:22
SingleCellClusterAlgo< HGCalTriggerCellThresholdCodec, HGCalTriggerCellThresholdCodec::data_type > SingleCellClusterAlgoThreshold
virtual void reset() override final
SingleCellClusterAlgo(const edm::ParameterSet &conf)
virtual void run(const l1t::HGCFETriggerDigiCollection &coll, const edm::EventSetup &es) override final
edm::ESHandle< HGCalTopology > hgchefTopoHandle_
virtual void putInEvent(edm::Event &evt) override final
virtual void setProduces(edm::EDProducer &prod) const 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