22 void simhits(
const edm::Event& e, std::unordered_map<uint32_t, double>& simhits_ee, std::unordered_map<uint32_t, double>& simhits_fh);
23 virtual void clear()
override final;
51 "HGCalTriggerNtupleHGCDigis" );
72 tree.Branch(
"hgcdigi_n", &
hgcdigi_n_,
"hgcdigi_n/I");
105 std::unordered_map<uint32_t, double> simhits_ee;
106 std::unordered_map<uint32_t, double> simhits_fh;
125 for(
const auto& digi : ee_digis)
141 if (!(digi[2].
mode())) is_adc =1;
145 auto itr = simhits_ee.find(
id);
146 if(itr!=simhits_ee.end())hit_energy = itr->second;
151 for(
const auto& digi : fh_digis)
167 if (!(digi[2].
mode())) is_adc =1;
171 auto itr = simhits_fh.find(
id);
172 if(itr!=simhits_fh.end())hit_energy = itr->second;
180 simhits(
const edm::Event&
e, std::unordered_map<uint32_t, double>& simhits_ee, std::unordered_map<uint32_t, double>& simhits_fh)
191 int layer=0,cell=0, sec=0, subsec=0, zp=0,subdet=0;
194 for(
const auto& simhit : ee_simhits ) {
198 cell = recoLayerCell.first;
199 layer = recoLayerCell.second;
200 if (layer<0 || cell<0) {
203 auto itr_insert = simhits_ee.emplace(
HGCalDetId(mysubdet,zp,layer,subsec,sec,cell), 0.);
204 itr_insert.first->second += simhit.energy();
208 layer=0; cell=0; sec=0; subsec=0; zp=0; subdet=0;
210 for(
const auto& simhit : fh_simhits ) {
214 cell = recoLayerCell.first;
215 layer = recoLayerCell.second;
216 if (layer<0 || cell<0) {
219 auto itr_insert = simhits_fh.emplace(
HGCalDetId(mysubdet,zp,layer,subsec,sec,cell), 0.);
220 itr_insert.first->second += simhit.energy();
std::vector< int > hgcdigi_subdet_
edm::ESHandle< HGCalTopology > topo_fh
T getParameter(std::string const &) const
std::vector< PCaloHit > PCaloHitContainer
edm::EDGetToken ee_token_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< float > hgcdigi_eta_
edm::ESHandle< HGCalGeometry > geom_fh
edm::EDGetToken SimHits_inputfh_
Geom::Phi< T > phi() const
edm::ESHandle< HGCalGeometry > geom_ee
virtual void initialize(TTree &, const edm::ParameterSet &, edm::ConsumesCollector &&) override final
GlobalPoint getPosition(const DetId &id) const
std::vector< int > hgcdigi_layer_
bool detectorType() const
std::vector< uint32_t > hgcdigi_data_
std::vector< int > hgcdigi_wafer_
std::vector< int > hgcdigi_side_
std::pair< int, int > simToReco(int cell, int layer, int mod, bool half) const
edm::EDGetToken SimHits_inputee_
std::vector< int > hgcdigi_cell_
~HGCalTriggerNtupleHGCDigis()
std::vector< int > hgcdigi_isadc_
HGCalTriggerNtupleHGCDigis(const edm::ParameterSet &conf)
void simhits(const edm::Event &e, std::unordered_map< uint32_t, double > &simhits_ee, std::unordered_map< uint32_t, double > &simhits_fh)
virtual void fill(const edm::Event &e, const edm::EventSetup &es) override final
std::vector< float > hgcdigi_phi_
std::vector< float > hgcdigi_z_
edm::ESHandle< HGCalTopology > topo_ee
const HGCalDDDConstants & dddConstants() const
char data[epos_bytes_allocation]
virtual void clear() override final
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< int > hgcdigi_id_
std::vector< int > hgcdigi_wafertype_
edm::EDGetToken fh_token_
static void unpackHexagonIndex(const uint32_t &idx, int &subdet, int &z, int &lay, int &wafer, int &celltyp, int &cell)
std::vector< float > hgcdigi_simenergy_