24 std::unordered_map<uint32_t, double>& simhits_ee,
25 std::unordered_map<uint32_t, double>& simhits_fh,
26 std::unordered_map<uint32_t, double>& simhits_bh);
94 tree.Branch(
"tc_n", &
tc_n_,
"tc_n/I");
95 tree.Branch(
"tc_id", &
tc_id_);
105 tree.Branch(
"tc_pt", &
tc_pt_);
110 tree.Branch(
"tc_eta", &
tc_eta_);
111 tree.Branch(
"tc_phi", &
tc_phi_);
112 tree.Branch(
"tc_x", &
tc_x_);
113 tree.Branch(
"tc_y", &
tc_y_);
114 tree.Branch(
"tc_z", &
tc_z_);
135 std::unordered_map<uint32_t, double> simhits_ee;
136 std::unordered_map<uint32_t, double> simhits_fh;
137 std::unordered_map<uint32_t, double> simhits_bh;
139 simhits(e, simhits_ee, simhits_fh, simhits_bh);
142 std::unordered_map<uint32_t, uint32_t> cell2cluster;
143 std::unordered_map<uint32_t, l1t::HGCalMulticlusterBxCollection::const_iterator> cell2multicluster;
144 for (
auto mcl_itr = multiclusters.
begin(0); mcl_itr != multiclusters.
end(0); mcl_itr++) {
146 for (
const auto& cl_ptr : mcl_itr->constituents()) {
148 for (
const auto& tc_ptr : cl_ptr.second->constituents()) {
149 cell2cluster.emplace(tc_ptr.second->detId(), cl_ptr.second->detId());
150 cell2multicluster.emplace(tc_ptr.second->detId(), mcl_itr);
158 for (
auto tc_itr = trigger_cells.
begin(0); tc_itr != trigger_cells.
end(0); tc_itr++) {
159 if (tc_itr->hwPt() > 0) {
160 auto cl_itr = cell2cluster.find(tc_itr->detId());
161 auto mcl_itr = cell2multicluster.find(tc_itr->detId());
162 uint32_t cl_id = (cl_itr != cell2cluster.end() ? cl_itr->second : 0);
163 uint32_t mcl_id = (mcl_itr != cell2multicluster.end() ? mcl_itr->second->detId() : 0);
164 float mcl_pt = (mcl_itr != cell2multicluster.end() ? mcl_itr->second->pt() : 0.);
171 tc_id_.emplace_back(tc_itr->detId());
178 tc_data_.emplace_back(tc_itr->hwPt());
183 tc_pt_.emplace_back(tc_itr->pt());
185 tc_eta_.emplace_back(tc_itr->eta());
186 tc_phi_.emplace_back(tc_itr->phi());
187 tc_x_.emplace_back(tc_itr->position().x());
188 tc_y_.emplace_back(tc_itr->position().y());
189 tc_z_.emplace_back(tc_itr->position().z());
197 int subdet =
id.subdetId();
204 auto itr = simhits_ee.find(c_id);
205 if (itr != simhits_ee.end())
206 energy +=
calibrate(itr->second, thickness, layer);
210 auto itr = simhits_fh.find(c_id);
211 if (itr != simhits_fh.end())
212 energy +=
calibrate(itr->second, thickness, layer);
216 auto itr = simhits_bh.find(c_id);
217 if (itr != simhits_bh.end())
218 energy += itr->second;
235 double TeV2GeV = 1.e3;
240 std::unordered_map<uint32_t, double>& simhits_ee,
241 std::unordered_map<uint32_t, double>& simhits_fh,
242 std::unordered_map<uint32_t, double>& simhits_bh) {
254 for (
const auto& simhit : ee_simhits) {
258 auto itr_insert = simhits_ee.emplace(
id, 0.);
259 itr_insert.first->second += simhit.energy();
262 for (
const auto& simhit : fh_simhits) {
266 auto itr_insert = simhits_fh.emplace(
id, 0.);
267 itr_insert.first->second += simhit.energy();
270 for (
const auto& simhit : bh_simhits) {
275 auto itr_insert = simhits_bh.emplace(
id, 0.);
276 itr_insert.first->second += simhit.energy();
void initialize(TTree &, const edm::ParameterSet &, edm::ConsumesCollector &&) final
std::vector< float > tc_energy_
std::vector< int > tc_cell_
const_iterator end(int bx) const
T getParameter(std::string const &) const
edm::ESHandle< HGCalTriggerGeometryBase > geometry_
std::vector< uint32_t > tc_data_
std::vector< uint32_t > tc_compressedCharge_
std::vector< PCaloHit > PCaloHitContainer
virtual geom_set getCellsFromTriggerCell(const unsigned cell_det_id) const =0
void fill(const edm::Event &e, const edm::EventSetup &es) final
std::vector< int > tc_wafer_
std::vector< double > layerWeights_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const HGCalTopology & eeTopology() const
~HGCalTriggerNtupleHGCTriggerCells() override
HGCalTriggerNtupleHGCTriggerCells(const edm::ParameterSet &conf)
std::vector< int > tc_side_
std::vector< uint32_t > tc_id_
std::vector< float > tc_eta_
bool filter_cells_in_multiclusters_
const HcalTopology & bhTopology() const
edm::EDGetToken multiclusters_token_
std::vector< uint32_t > tc_uncompressedCharge_
edm::EDGetToken simhits_ee_token_
std::vector< uint32_t > tc_cluster_id_
edm::EDGetToken trigger_cells_token_
HGCalTriggerTools triggerTools_
edm::EDGetToken simhits_bh_token_
std::vector< int > tc_wafertype_
std::vector< float > tc_multicluster_pt_
const HGCalTopology & hscTopology() const
std::vector< double > thicknessCorrections_
std::vector< float > tc_phi_
bool isV9Geometry() const
edm::EDGetToken simhits_fh_token_
std::vector< float > tc_x_
std::vector< float > tc_pt_
std::vector< int > tc_subdet_
std::vector< float > tc_mipPt_
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< float > tc_y_
double calibrate(double, int, unsigned)
void simhits(const edm::Event &e, std::unordered_map< uint32_t, double > &simhits_ee, std::unordered_map< uint32_t, double > &simhits_fh, std::unordered_map< uint32_t, double > &simhits_bh)
std::vector< float > tc_z_
std::vector< double > fcPerMip_
std::vector< int > tc_layer_
const_iterator begin(int bx) const
std::vector< float > tc_simenergy_
std::vector< uint32_t > tc_multicluster_id_
const HGCalTopology & fhTopology() const