62 : g4Label_(ps.getParameter<
std::
string>(
"ModuleLabel")),
63 hits_((ps.getParameter<
std::
string>(
"HitCollection"))),
64 digis_(ps.getParameter<
edm::
InputTag>(
"DigiCollection")),
65 iSample_(ps.getParameter<
int>(
"Sample")),
66 threshold_(ps.getParameter<double>(
"Threshold")),
73 <<
" Digits:" <<
digis_ <<
" Sample: " <<
iSample_ <<
" Threshold " 82 desc.add<
int>(
"Sample", 5);
83 desc.add<
double>(
"Threshold", 15.0);
84 descriptions.
add(
"hgcalBHAnalysis",
desc);
88 edm::LogVerbatim(
"HGCalValidation") <<
"HGCalBHValidation::Maximum Number of" 89 <<
" ring sectors:" <<
ringMax_ <<
"\nHitsValidationHcal::Booking the Histograms";
92 hsimE1_ =
fs_->
make<TH1D>(
"SimHitEn1",
"Sim Hit Energy", 1000, 0.0, 1.0);
93 hsimE2_ =
fs_->
make<TH1D>(
"SimHitEn2",
"Sim Hit Energy", 1000, 0.0, 1.0);
94 hsimTm_ =
fs_->
make<TH1D>(
"SimHitTime",
"Sim Hit Time", 1000, 0.0, 500.0);
95 hsimLn_ =
fs_->
make<TH1D>(
"SimHitLong",
"Sim Hit Long. Profile", 50, 0.0, 25.0);
100 hdigEn_ =
fs_->
make<TH1D>(
"DigiEnergy",
"Digi ADC Sample", 1000, 0.0, 1000.0);
101 hdigLn_ =
fs_->
make<TH1D>(
"DigiLong",
"Digi Long. Profile", 50, 0.0, 25.0);
108 edm::LogVerbatim(
"HGCalValidation") <<
"HGCalBHValidation:Run = " <<
e.id().run() <<
" Event = " <<
e.id().event();
112 edm::LogVerbatim(
"HGCalValidation") <<
"HGCalBHValidation.: PCaloHitContainer" 113 <<
" obtained with flag " << hitsHE.
isValid();
115 edm::LogVerbatim(
"HGCalValidation") <<
"HGCalBHValidation: PCaloHit buffer " << hitsHE->size();
117 std::map<unsigned int, double> map_try;
118 for (edm::PCaloHitContainer::const_iterator it = hitsHE->begin(); it != hitsHE->end(); ++it) {
119 double energy = it->energy();
120 double time = it->time();
121 unsigned int id = it->id();
134 if (map_try.count(
id) != 0)
142 for (std::map<unsigned int, double>::iterator itr = map_try.begin(); itr != map_try.end(); ++itr) {
148 unsigned int kount(0);
151 <<
"HGCalDigiCollection obtained with" 152 <<
" flag " << hecoll.
isValid();
155 <<
"buffer " << hecoll->
size();
161 int depth = cell.layer();
163 double ring = 0.01 + cell.ring();
164 double phi = cell.iphi() - 0.01;
165 double ring1 = cell.zside() *
ring;
static const std::string kSharedResource
Log< level::Info, true > LogVerbatim
std::vector< PCaloHit > PCaloHitContainer
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
const edm::InputTag digis_
std::vector< T >::const_iterator const_iterator
~HGCalBHValidation() override=default
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::string g4Label_
int iphi() const
get the phi index
edm::Service< TFileService > fs_
HGCalBHValidation(const edm::ParameterSet &ps)
const edm::EDGetTokenT< HGCalDigiCollection > tok_digi_
int layer() const
get the layer #
#define DEFINE_FWK_MODULE(type)
const_iterator begin() const
int zside() const
get the z-side of the cell (1/-1)
void beginRun(edm::Run const &, edm::EventSetup const &) override
int ring() const
get the eta index
const_iterator end() const
void analyze(edm::Event const &, edm::EventSetup const &) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
T * make(const Args &...args) const
make new ROOT object
void endRun(edm::Run const &, edm::EventSetup const &) override