27 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);
28 virtual void clear()
override final;
68 "HGCalTriggerNtupleHGCDigis" );
91 tree.Branch(
"hgcdigi_n", &
hgcdigi_n_,
"hgcdigi_n/I");
106 tree.Branch(
"bhdigi_n", &
bhdigi_n_,
"bhdigi_n/I");
137 std::unordered_map<uint32_t, double> simhits_ee;
138 std::unordered_map<uint32_t, double> simhits_fh;
139 std::unordered_map<uint32_t, double> simhits_bh;
170 const int kIntimeSample = 2;
171 for(
const auto& digi : ee_digis)
187 if (!(digi[kIntimeSample].
mode())) is_adc =1;
191 auto itr = simhits_ee.find(
id);
192 if(itr!=simhits_ee.end())hit_energy = itr->second;
197 for(
const auto& digi : fh_digis)
213 if (!(digi[kIntimeSample].
mode())) is_adc =1;
217 auto itr = simhits_fh.find(
id);
218 if(itr!=simhits_fh.end())hit_energy = itr->second;
223 for(
const auto& digi : bh_digis)
239 auto itr = simhits_bh.find(
id);
240 if(itr!=simhits_bh.end())hit_energy = itr->second;
248 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)
262 int layer=0,cell=0, sec=0, subsec=0, zp=0,subdet=0;
265 for(
const auto& simhit : ee_simhits ) {
269 cell = recoLayerCell.first;
270 layer = recoLayerCell.second;
271 if (layer<0 || cell<0) {
274 auto itr_insert = simhits_ee.emplace(
HGCalDetId(mysubdet,zp,layer,subsec,sec,cell), 0.);
275 itr_insert.first->second += simhit.energy();
279 layer=0; cell=0; sec=0; subsec=0; zp=0; subdet=0;
281 for(
const auto& simhit : fh_simhits ) {
285 cell = recoLayerCell.first;
286 layer = recoLayerCell.second;
287 if (layer<0 || cell<0) {
290 auto itr_insert = simhits_fh.emplace(
HGCalDetId(mysubdet,zp,layer,subsec,sec,cell), 0.);
291 itr_insert.first->second += simhit.energy();
294 for(
const auto& simhit : bh_simhits ) {
297 auto itr_insert = simhits_bh.emplace(
id, 0.);
298 itr_insert.first->second += simhit.energy();
const HGCalGeometry & eeGeometry() const
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_
const HGCalGeometry & fhGeometry() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< float > hgcdigi_eta_
const HGCalTopology & eeTopology() const
edm::EDGetToken SimHits_inputfh_
Geom::Phi< T > phi() const
virtual void initialize(TTree &, const edm::ParameterSet &, edm::ConsumesCollector &&) override final
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
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_
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_
~HGCalTriggerNtupleHGCDigis()
std::vector< int > hgcdigi_isadc_
const HcalTopology & bhTopology() const
HGCalTriggerNtupleHGCDigis(const edm::ParameterSet &conf)
virtual void fill(const edm::Event &e, const edm::EventSetup &es) override final
std::vector< float > hgcdigi_phi_
std::vector< float > hgcdigi_z_
GlobalPoint getPosition(const DetId &id) 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_
virtual void clear() override final
#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_
const HcalGeometry & bhGeometry() const