53 : g4Label_(ps.getParameter<
std::
string>(
"moduleLabel")),
54 caloHitSource_(ps.getParameter<
std::
string>(
"caloHitSource")),
55 nameSense_(ps.getParameter<
std::
string>(
"nameSense")),
56 nameDetector_(ps.getParameter<
std::
string>(
"tag")),
57 tag_(ps.getParameter<
std::
string>(
"nameDevice")),
58 layers_(ps.getParameter<
int>(
"layers")),
59 verbosity_(ps.getParameter<
int>(
"verbosity")),
63 edm::LogVerbatim(
"HitStudy") <<
"Test Hit ID for " << nameDetector_ <<
" using SimHits for " << nameSense_
64 <<
" with module Label: " << g4Label_ <<
" Hits: " << caloHitSource_;
74 desc.add<
int>(
"layers", 26);
75 desc.add<
int>(
"verbosity", 0);
76 descriptions.
add(
"hgcalHitCheckEE",
desc);
81 if (!
fs.isAvailable()) {
86 sprintf(
name,
"HitsL");
90 h_hits_->GetYaxis()->SetTitle(
"Hits");
92 sprintf(
name,
"HitsF");
93 sprintf(
title,
"Number of hits in %s for %s in Full Wafers or SiPM 2",
nameSense_.c_str(),
tag_.c_str());
96 h_hit1_->GetYaxis()->SetTitle(
"Hits");
98 sprintf(
name,
"HitsP");
99 sprintf(
title,
"Number of hits in %s for %s in Partial Wafers or SiPM 4",
nameSense_.c_str(),
tag_.c_str());
102 h_hit2_->GetYaxis()->SetTitle(
"Hits");
105 sprintf(
name,
"HitsL%d",
k + 1);
106 sprintf(
title,
"Number of hits in %s for %s in Layer %d",
nameSense_.c_str(),
tag_.c_str(),
k + 1);
109 h_hitL_.back()->GetYaxis()->SetTitle(
"Hits");
111 sprintf(
name,
"HitsF%d",
k + 1);
113 "Number of hits in %s for %s in Full Wafers or SiPM 2 of Layer %d",
119 h_hitF_.back()->GetYaxis()->SetTitle(
"Hits");
121 sprintf(
name,
"HitsP%d",
k + 1);
123 "Number of hits in %s for %s in Partial Wafers or SiPM 4 of Layer %d",
129 h_hitP_.back()->GetYaxis()->SetTitle(
"Hits");
137 edm::LogVerbatim(
"HitStudy") <<
"Run = " <<
e.id().run() <<
" Event = " <<
e.id().event();
142 const std::vector<DetId>& validIds =
geom->getValidDetIds();
146 bool getHits = (hitsCalo.
isValid());
147 uint32_t
nhits = (getHits) ? hitsCalo->size() : 0;
148 uint32_t wafer(0), tiles(0);
150 edm::LogVerbatim(
"HitStudy") <<
"HGcalHitCheck: Input flags Hits " << getHits <<
" with " <<
nhits <<
" hits";
155 std::vector<PCaloHit>
hits;
156 hits.insert(
hits.end(), hitsCalo->begin(), hitsCalo->end());
163 int lay =
id.layer();
176 int lay =
id.layer();
178 int sipm =
id.sipm();
191 edm::LogVerbatim(
"HitStudy") <<
"Total hits = " <<
nhits <<
" Wafer DetIds = " << wafer <<
" Tile DetIds = " << tiles;
Log< level::Info, true > LogVerbatim
void analyze(edm::Event const &, edm::EventSetup const &) override
std::vector< PCaloHit > PCaloHitContainer
const std::string nameSense_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
int32_t waferU(const int32_t index)
std::vector< TH1D * > h_hitP_
static constexpr int32_t WaferFull
std::vector< TH1D * > h_hitF_
const std::string nameDetector_
std::vector< TH1D * > h_hitL_
#define DEFINE_FWK_MODULE(type)
const std::string g4Label_
const std::string caloHitSource_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
HGcalHitCheck(const edm::ParameterSet &ps)
~HGcalHitCheck() override
int32_t waferV(const int32_t index)
const edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > geomToken_
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_calo_