CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HGCalTriggerNtupleHGCConcentratorData.cc
Go to the documentation of this file.
1 
10 
12 public:
15  void initialize(TTree&, const edm::ParameterSet&, edm::ConsumesCollector&&) final;
16  void fill(const edm::Event& e, const HGCalTriggerNtupleEventSetup& es) final;
17 
18 private:
19  void clear() final;
20 
22 
24 
25  int econ_n_;
26  std::vector<uint32_t> econ_id_;
27  std::vector<int> econ_subdet_;
28  std::vector<int> econ_side_;
29  std::vector<int> econ_layer_;
30  std::vector<int> econ_waferu_;
31  std::vector<int> econ_waferv_;
33  std::vector<uint32_t> econ_index_;
34  std::vector<uint32_t> econ_data_;
35 };
36 
39  "HGCalTriggerNtupleHGCConcentratorData");
40 
41 HGCalTriggerNtupleHGCConcentratorData::HGCalTriggerNtupleHGCConcentratorData(const edm::ParameterSet& conf)
42  : HGCalTriggerNtupleBase(conf) {
43  accessEventSetup_ = false;
44 }
45 
47  const edm::ParameterSet& conf,
48  edm::ConsumesCollector&& collector) {
50  collector.consumes<l1t::HGCalConcentratorDataBxCollection>(conf.getParameter<edm::InputTag>("ConcentratorData"));
51 
52  std::string prefix(conf.getUntrackedParameter<std::string>("Prefix", "econ"));
53 
54  std::string bname;
55  auto withPrefix([&prefix, &bname](char const* vname) -> char const* {
56  bname = prefix + "_" + vname;
57  return bname.c_str();
58  });
59 
60  tree.Branch(withPrefix("n"), &econ_n_, (prefix + "_n/I").c_str());
61  tree.Branch(withPrefix("id"), &econ_id_);
62  tree.Branch(withPrefix("subdet"), &econ_subdet_);
63  tree.Branch(withPrefix("zside"), &econ_side_);
64  tree.Branch(withPrefix("layer"), &econ_layer_);
65  tree.Branch(withPrefix("waferu"), &econ_waferu_);
66  tree.Branch(withPrefix("waferv"), &econ_waferv_);
67  tree.Branch(withPrefix("wafertype"), &econ_wafertype_);
68  tree.Branch(withPrefix("index"), &econ_index_);
69  tree.Branch(withPrefix("data"), &econ_data_);
70 }
71 
73  // retrieve trigger cells
75  e.getByToken(concentrator_data_token_, concentrator_data_h);
76  const l1t::HGCalConcentratorDataBxCollection& concentrator_data = *concentrator_data_h;
77 
79 
80  clear();
81  for (auto econ_itr = concentrator_data.begin(0); econ_itr != concentrator_data.end(0); econ_itr++) {
82  econ_n_++;
83  // hardware data
84  DetId id(econ_itr->detId());
85  econ_id_.emplace_back(econ_itr->detId());
86  econ_side_.emplace_back(triggerTools_.zside(id));
87  econ_layer_.emplace_back(triggerTools_.layerWithOffset(id));
88 
89  HGCalTriggerDetId idv9(id);
90  econ_subdet_.emplace_back(idv9.subdet());
91  econ_waferu_.emplace_back(idv9.waferU());
92  econ_waferv_.emplace_back(idv9.waferV());
93  econ_wafertype_.emplace_back(idv9.type());
94 
95  econ_index_.emplace_back(econ_itr->index());
96  econ_data_.emplace_back(econ_itr->data());
97  }
98 }
99 
101  econ_n_ = 0;
102  econ_id_.clear();
103  econ_subdet_.clear();
104  econ_side_.clear();
105  econ_layer_.clear();
106  econ_wafertype_.clear();
107  econ_data_.clear();
108 }
const_iterator end(int bx) const
T getUntrackedParameter(std::string const &, T const &) const
HGCalTriggerSubdetector subdet() const
get the subdetector
uint16_t *__restrict__ id
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
unsigned layerWithOffset(const DetId &) const
edm::ESHandle< HGCalTriggerGeometryBase > geometry
int type() const
get the type
void setGeometry(const HGCalTriggerGeometryBase *const)
void initialize(TTree &, const edm::ParameterSet &, edm::ConsumesCollector &&) final
int zside(const DetId &) const
Definition: DetId.h:17
T const * product() const
Definition: ESHandle.h:86
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
#define DEFINE_EDM_PLUGIN(factory, type, name)
void fill(const edm::Event &e, const HGCalTriggerNtupleEventSetup &es) final
const_iterator begin(int bx) const
HGCalTriggerNtupleHGCConcentratorData(const edm::ParameterSet &conf)