55 auto withPrefix([&prefix, &bname](
char const* vname) ->
char const* {
56 bname = prefix +
"_" + vname;
61 tree.Branch(withPrefix(
"n"), &
cl_n_, (prefix +
"_n/I").c_str());
62 tree.Branch(withPrefix(
"id"), &
cl_id_);
63 tree.Branch(withPrefix(
"mipPt"), &
cl_mipPt_);
64 tree.Branch(withPrefix(
"pt"), &
cl_pt_);
65 tree.Branch(withPrefix(
"energy"), &
cl_energy_);
66 tree.Branch(withPrefix(
"eta"), &
cl_eta_);
67 tree.Branch(withPrefix(
"phi"), &
cl_phi_);
68 tree.Branch(withPrefix(
"layer"), &
cl_layer_);
69 tree.Branch(withPrefix(
"subdet"), &
cl_subdet_);
92 std::unordered_map<uint32_t, l1t::HGCalMulticlusterBxCollection::const_iterator> cluster2multicluster;
93 for (
auto mcl_itr = multiclusters.
begin(0); mcl_itr != multiclusters.
end(0); mcl_itr++) {
95 for (
const auto& cl_ptr : mcl_itr->constituents()) {
96 cluster2multicluster.emplace(cl_ptr.second->detId(), mcl_itr);
101 for (
auto cl_itr = clusters.
begin(0); cl_itr != clusters.
end(0); cl_itr++) {
102 auto mcl_itr = cluster2multicluster.find(cl_itr->detId());
103 uint32_t mcl_id = (mcl_itr != cluster2multicluster.end() ? mcl_itr->second->detId() : 0);
104 float mcl_pt = (mcl_itr != cluster2multicluster.end() ? mcl_itr->second->pt() : 0.);
110 cl_pt_.emplace_back(cl_itr->pt());
112 cl_eta_.emplace_back(cl_itr->eta());
113 cl_phi_.emplace_back(cl_itr->phi());
115 cl_id_.emplace_back(cl_itr->detId());
118 cl_cells_n_.emplace_back(cl_itr->constituents().size());
120 cl_cells_id_.emplace_back(cl_itr->constituents().size());
122 cl_itr->constituents_begin(),
123 cl_itr->constituents_end(),
125 [](
const std::pair<uint32_t, edm::Ptr<l1t::HGCalTriggerCell>>& id_tc) {
return id_tc.second->detId(); });
std::vector< float > cl_phi_
const_iterator end(int bx) const
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~HGCalTriggerNtupleHGCClusters() override
std::vector< float > cl_pt_
std::vector< int > cl_subdet_
std::vector< int > cl_cells_n_
std::vector< std::vector< uint32_t > > cl_cells_id_
std::vector< int > cl_layer_
edm::EDGetToken multiclusters_token_
std::vector< uint32_t > cl_multicluster_id_
std::vector< float > cl_mipPt_
std::vector< uint32_t > cl_id_
void initialize(TTree &, const edm::ParameterSet &, edm::ConsumesCollector &&) final
HGCalTriggerTools triggerTools_
ESHandle< TrackerGeometry > geometry
HGCalTriggerNtupleHGCClusters(const edm::ParameterSet &conf)
#define DEFINE_EDM_PLUGIN(factory, type, name)
edm::EDGetToken clusters_token_
std::vector< float > cl_eta_
const_iterator begin(int bx) const
std::vector< float > cl_multicluster_pt_
bool filter_clusters_in_multiclusters_
std::vector< float > cl_energy_
void fill(const edm::Event &e, const edm::EventSetup &es) final