29 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);
72 "HGCalTriggerNtupleHGCDigis" );
95 tree.Branch(
"hgcdigi_n", &
hgcdigi_n_,
"hgcdigi_n/I");
110 tree.Branch(
"bhdigi_n", &
bhdigi_n_,
"bhdigi_n/I");
143 std::unordered_map<uint32_t, double> simhits_ee;
144 std::unordered_map<uint32_t, double> simhits_fh;
145 std::unordered_map<uint32_t, double> simhits_bh;
176 const int kIntimeSample = 2;
177 for(
const auto& digi : ee_digis)
193 if (!(digi[kIntimeSample].
mode())) is_adc =1;
197 auto itr = simhits_ee.find(
id);
198 if(itr!=simhits_ee.end())hit_energy = itr->second;
203 for(
const auto& digi : fh_digis)
219 if (!(digi[kIntimeSample].
mode())) is_adc =1;
223 auto itr = simhits_fh.find(
id);
224 if(itr!=simhits_fh.end())hit_energy = itr->second;
229 for(
const auto& digi : bh_digis)
245 auto itr = simhits_bh.find(
id);
246 if(itr!=simhits_bh.end())hit_energy = itr->second;
254 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)
268 int layer=0,cell=0, sec=0, subsec=0, zp=0,subdet=0;
271 for(
const auto& simhit : ee_simhits ) {
275 cell = recoLayerCell.first;
276 layer = recoLayerCell.second;
277 if (layer<0 || cell<0) {
280 auto itr_insert = simhits_ee.emplace(
HGCalDetId(mysubdet,zp,layer,subsec,sec,cell), 0.);
281 itr_insert.first->second += simhit.energy();
285 layer=0; cell=0; sec=0; subsec=0; zp=0; subdet=0;
287 for(
const auto& simhit : fh_simhits ) {
291 cell = recoLayerCell.first;
292 layer = recoLayerCell.second;
293 if (layer<0 || cell<0) {
296 auto itr_insert = simhits_fh.emplace(
HGCalDetId(mysubdet,zp,layer,subsec,sec,cell), 0.);
297 itr_insert.first->second += simhit.energy();
300 for(
const auto& simhit : bh_simhits ) {
303 auto itr_insert = simhits_bh.emplace(
id, 0.);
304 itr_insert.first->second += simhit.energy();
std::vector< int > hgcdigi_subdet_
T getParameter(std::string const &) const
const HcalDDDRecConstants * dddConstants() const
std::vector< PCaloHit > PCaloHitContainer
edm::EDGetToken ee_token_
std::vector< float > bhdigi_eta_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< float > hgcdigi_eta_
const HGCalGeometry * eeGeometry() const
const HGCalTopology & eeTopology() const
edm::EDGetToken SimHits_inputfh_
Geom::Phi< T > phi() const
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
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)
GlobalPoint getPosition(const DetId &id) const
std::vector< int > bhdigi_id_
std::vector< int > hgcdigi_layer_
bool detectorType() const
HGCalTriggerTools triggerTools_
void fill(const edm::Event &e, const edm::EventSetup &es) final
std::vector< uint32_t > hgcdigi_data_
std::vector< int > hgcdigi_wafer_
std::vector< int > bhdigi_side_
std::vector< float > bhdigi_phi_
std::vector< int > hgcdigi_side_
void initialize(TTree &, const edm::ParameterSet &, edm::ConsumesCollector &&) final
std::pair< int, int > simToReco(int cell, int layer, int mod, bool half) const
std::vector< int > bhdigi_ieta_
edm::EDGetToken SimHits_inputee_
std::vector< int > hgcdigi_cell_
std::vector< int > hgcdigi_isadc_
const HGCalGeometry * fhGeometry() const
const HcalTopology & bhTopology() const
HGCalTriggerNtupleHGCDigis(const edm::ParameterSet &conf)
std::vector< float > hgcdigi_phi_
std::vector< float > hgcdigi_z_
GlobalPoint getPosition(const DetId &id) const
const HcalGeometry * bhGeometry() const
std::vector< uint32_t > bhdigi_data_
const HGCalDDDConstants & dddConstants() const
std::vector< float > bhdigi_z_
char data[epos_bytes_allocation]
edm::EDGetToken bh_token_
std::vector< int > bhdigi_subdet_
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< float > bhdigi_simenergy_
DetId relabel(const uint32_t testId) const
std::vector< int > hgcdigi_id_
std::vector< int > hgcdigi_wafertype_
edm::EDGetToken fh_token_
std::vector< int > bhdigi_layer_
edm::EDGetToken SimHits_inputbh_
std::vector< int > bhdigi_iphi_
static void unpackHexagonIndex(const uint32_t &idx, int &subdet, int &z, int &lay, int &wafer, int &celltyp, int &cell)
const HGCalTopology & fhTopology() const
std::vector< float > hgcdigi_simenergy_
~HGCalTriggerNtupleHGCDigis() override