CMS 3D CMS Logo

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 edm::EventSetup& es) final;
17 
18 private:
19  void clear() final;
20 
22 
25 
26  int econ_n_;
27  std::vector<uint32_t> econ_id_;
34  std::vector<uint32_t> econ_index_;
35  std::vector<uint32_t> econ_data_;
36 };
37 
41 
43  : HGCalTriggerNtupleBase(conf) {}
44 
46  const edm::ParameterSet& conf,
47  edm::ConsumesCollector&& collector) {
49  collector.consumes<l1t::HGCalConcentratorDataBxCollection>(conf.getParameter<edm::InputTag>("ConcentratorData"));
50 
51  std::string prefix(conf.getUntrackedParameter<std::string>("Prefix", "econ"));
52 
53  std::string bname;
54  auto withPrefix([&prefix, &bname](char const* vname) -> char const* {
55  bname = prefix + "_" + vname;
56  return bname.c_str();
57  });
58 
59  tree.Branch(withPrefix("n"), &econ_n_, (prefix + "_n/I").c_str());
60  tree.Branch(withPrefix("id"), &econ_id_);
61  tree.Branch(withPrefix("subdet"), &econ_subdet_);
62  tree.Branch(withPrefix("zside"), &econ_side_);
63  tree.Branch(withPrefix("layer"), &econ_layer_);
64  tree.Branch(withPrefix("waferu"), &econ_waferu_);
65  tree.Branch(withPrefix("waferv"), &econ_waferv_);
66  tree.Branch(withPrefix("wafertype"), &econ_wafertype_);
67  tree.Branch(withPrefix("index"), &econ_index_);
68  tree.Branch(withPrefix("data"), &econ_data_);
69 }
70 
72  // retrieve trigger cells
74  e.getByToken(concentrator_data_token_, concentrator_data_h);
75  const l1t::HGCalConcentratorDataBxCollection& concentrator_data = *concentrator_data_h;
76 
77  // retrieve geometry
79 
81 
82  clear();
83  for (auto econ_itr = concentrator_data.begin(0); econ_itr != concentrator_data.end(0); econ_itr++) {
84  econ_n_++;
85  // hardware data
86  DetId id(econ_itr->detId());
87  econ_id_.emplace_back(econ_itr->detId());
88  econ_side_.emplace_back(triggerTools_.zside(id));
89  econ_layer_.emplace_back(triggerTools_.layerWithOffset(id));
90 
91  HGCalTriggerDetId idv9(id);
92  econ_subdet_.emplace_back(idv9.subdet());
93  econ_waferu_.emplace_back(idv9.waferU());
94  econ_waferv_.emplace_back(idv9.waferV());
95  econ_wafertype_.emplace_back(idv9.type());
96 
97  econ_index_.emplace_back(econ_itr->index());
98  econ_data_.emplace_back(econ_itr->data());
99  }
100 }
101 
103  econ_n_ = 0;
104  econ_id_.clear();
105  econ_subdet_.clear();
106  econ_side_.clear();
107  econ_layer_.clear();
108  econ_wafertype_.clear();
109  econ_data_.clear();
110 }
HGCalTriggerNtupleHGCConcentratorData::initialize
void initialize(TTree &, const edm::ParameterSet &, edm::ConsumesCollector &&) final
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:45
HGCalTriggerTools.h
HGCalTriggerGeometryBase
Definition: HGCalTriggerGeometryBase.h:19
HGCalTriggerNtupleHGCConcentratorData::triggerTools_
HGCalTriggerTools triggerTools_
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:21
HGCalTriggerTools::eventSetup
void eventSetup(const edm::EventSetup &)
Definition: HGCalTriggerTools.cc:35
HGCalTriggerNtupleHGCConcentratorData::HGCalTriggerNtupleHGCConcentratorData
HGCalTriggerNtupleHGCConcentratorData(const edm::ParameterSet &conf)
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:42
HGCalTriggerNtupleHGCConcentratorData::econ_n_
int econ_n_
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:26
HGCalTriggerNtupleHGCConcentratorData::econ_side_
std::vector< int > econ_side_
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:29
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
edm
HLT enums.
Definition: AlignableModifier.h:19
tree
Definition: tree.py:1
AssociationMap.h
ESHandle
HGCalTriggerNtupleHGCConcentratorData::~HGCalTriggerNtupleHGCConcentratorData
~HGCalTriggerNtupleHGCConcentratorData() override
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:14
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
watchdog.const
const
Definition: watchdog.py:83
edm::Handle
Definition: AssociativeIterator.h:50
BXVector
Definition: BXVector.h:15
HGCalTriggerNtupleBase
Definition: HGCalTriggerNtupleBase.h:10
DetId
Definition: DetId.h:17
HGCalTriggerNtupleHGCConcentratorData::econ_index_
std::vector< uint32_t > econ_index_
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:34
HGCalTriggerNtupleHGCConcentratorData::concentrator_data_token_
edm::EDGetToken concentrator_data_token_
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:23
HGCalTriggerNtupleHGCConcentratorData::econ_id_
std::vector< uint32_t > econ_id_
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:27
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
HGCalTriggerGeometryBase.h
HGCalTriggerNtupleHGCConcentratorData::econ_wafertype_
std::vector< int > econ_wafertype_
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:33
Event
HGCalTriggerTools::layerWithOffset
unsigned layerWithOffset(const DetId &) const
Definition: HGCalTriggerTools.cc:134
HGCalTriggerTools::zside
int zside(const DetId &) const
Definition: HGCalTriggerTools.cc:210
BXVector::begin
const_iterator begin(int bx) const
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
CaloGeometryRecord.h
HGCalTriggerNtupleHGCConcentratorData::clear
void clear() final
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:102
HGCalTriggerDetId
Definition: HGCalTriggerDetId.h:26
BXVector::end
const_iterator end(int bx) const
edm::ParameterSet
Definition: ParameterSet.h:47
HGCalTriggerDetId::subdet
HGCalTriggerSubdetector subdet() const
get the subdetector
Definition: HGCalTriggerDetId.h:42
HGCalTriggerDetId::waferU
int waferU() const
Definition: HGCalTriggerDetId.h:72
ParameterSet
Definition: Functions.h:16
edmplugin::PluginFactory
Definition: PluginFactory.h:34
HGCalTriggerNtupleBase.h
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::EventSetup
Definition: EventSetup.h:58
get
#define get
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EDGetToken
HGCalTriggerNtupleHGCConcentratorData::econ_waferv_
std::vector< int > econ_waferv_
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:32
HGCalTriggerNtupleHGCConcentratorData::econ_data_
std::vector< uint32_t > econ_data_
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:35
HGCalTriggerNtupleHGCConcentratorData::econ_subdet_
std::vector< int > econ_subdet_
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:28
HGCalDetId.h
std
Definition: JetResolutionObject.h:76
HGCalTriggerDetId::waferV
int waferV() const
Definition: HGCalTriggerDetId.h:73
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
HGCalConcentratorData.h
HGCalTriggerNtupleHGCConcentratorData::fill
void fill(const edm::Event &e, const edm::EventSetup &es) final
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:71
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HGCalTriggerTools
Definition: HGCalTriggerTools.h:32
HGCalTriggerNtupleHGCConcentratorData
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:11
HGCalTriggerNtupleHGCConcentratorData::geometry_
edm::ESHandle< HGCalTriggerGeometryBase > geometry_
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:24
HGCalTriggerDetId::type
int type() const
get the type
Definition: HGCalTriggerDetId.h:47
EventSetup
edm::Event
Definition: Event.h:73
HGCalTriggerNtupleHGCConcentratorData::econ_waferu_
std::vector< int > econ_waferu_
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:31
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
HGCalTriggerNtupleHGCConcentratorData::econ_layer_
std::vector< int > econ_layer_
Definition: HGCalTriggerNtupleHGCConcentratorData.cc:30
hcallasereventfilter2012_cfi.prefix
prefix
Definition: hcallasereventfilter2012_cfi.py:10
HGCalTriggerDetId.h
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37