50 #include "CLHEP/Units/GlobalSystemOfUnits.h"
79 template <
class T1,
class T2>
93 std::vector<MonitorElement*>
TOA_;
95 std::vector<MonitorElement*>
ADC_;
96 std::vector<MonitorElement*>
TOT_;
104 : nameDetector_(iConfig.getParameter<
std::
string>(
"DetectorName")),
105 ifNose_(iConfig.getParameter<
bool>(
"ifNose")),
106 ifHCAL_(iConfig.getParameter<
bool>(
"ifHCAL")),
107 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)),
108 SampleIndx_(iConfig.getUntrackedParameter<
int>(
"SampleIndx", 0)),
121 <<
"\"HGCalEESensitive\", \"HGCalHESiliconSensitive\", "
122 <<
"\"HGCalHEScintillatorSensitive\", \"HGCalHFNoseSensitive\", "
131 desc.
add<
bool>(
"ifNose",
false);
132 desc.
add<
bool>(
"ifHCAL",
false);
135 descriptions.
add(
"hgcalDigiValidationEEDefault", desc);
168 unsigned int ntot(0), nused(0);
173 if (theHGCEEDigiContainers.
isValid()) {
177 for (
const auto& it : *(theHGCEEDigiContainers.
product())) {
180 DetId detId = it.id();
184 uint16_t
gain = hgcSample.
toa();
185 uint16_t
adc = hgcSample.
data();
187 bool totmode = hgcSample.
mode();
188 bool zerothreshold = hgcSample.
threshold();
200 if (theHGCHEDigiContainers.
isValid()) {
204 for (
const auto& it : *(theHGCHEDigiContainers.
product())) {
207 DetId detId = it.id();
208 int layer = ((geomType == 0)
212 uint16_t
gain = hgcSample.
toa();
213 uint16_t
adc = hgcSample.
data();
215 bool totmode = hgcSample.
mode();
216 bool zerothreshold = hgcSample.
threshold();
228 if (theHGCBHDigiContainers.
isValid()) {
232 for (
const auto& it : *(theHGCBHDigiContainers.
product())) {
236 int layer = detId.
depth();
238 uint16_t
gain = hgcSample.
toa();
239 uint16_t
adc = hgcSample.
data();
241 bool totmode = hgcSample.
mode();
242 bool zerothreshold = hgcSample.
threshold();
247 edm::LogWarning(
"HGCalValidation") <<
"DigiCollection handle does not "
254 if (theHEDigiContainers.
isValid()) {
261 for (
const auto& it : *(theHEDigiContainers.
product())) {
273 int layer = detId.
depth();
277 bool totmode =
false;
278 bool zerothreshold =
false;
284 edm::LogWarning(
"HGCalValidation") <<
"DigiCollection handle does not "
291 edm::LogVerbatim(
"HGCalValidation") <<
"Event " <<
iEvent.id().event() <<
" with " << ntot <<
" total and " << nused
295 template <
class T1,
class T2>
307 hinfo.x = global1.x();
308 hinfo.y = global1.y();
309 hinfo.z = global1.z();
319 if (global1.eta() > 0)
328 if (OccupancyMap.find(layer) != OccupancyMap.end())
329 OccupancyMap[layer]++;
331 OccupancyMap[layer] = 1;
335 int ilayer =
hinfo.layer;
350 int layer =
itr.first;
351 int occupancy =
itr.second;
355 int layer =
itr.first;
356 int occupancy =
itr.second;
384 std::ostringstream histoname;
385 for (
int il = 0; il <
layers_; ++il) {
387 auto istr1 = std::to_string(ilayer);
388 while (istr1.size() < 2) {
389 istr1.insert(0,
"0");
393 <<
"layer_" << istr1;
394 TOA_.push_back(iB.
book1D(histoname.str().c_str(),
"toa_", 1024, 0, 1024));
398 <<
"layer_" << istr1;
399 ADC_.push_back(iB.
book1D(histoname.str().c_str(),
"ADCDigiOccupancy", 1024, 0, 1024));
403 <<
"layer_" << istr1;
404 TOT_.push_back(iB.
book1D(histoname.str().c_str(),
"TOTDigiOccupancy", 4096, 0, 4096));
407 histoname <<
"DigiOccupancy_XY_"
408 <<
"layer_" << istr1;
409 DigiOccupancy_XY_.push_back(iB.
book2D(histoname.str().c_str(),
"DigiOccupancy", 50, -500, 500, 50, -500, 500));
412 histoname <<
"DigiOccupancy_Plus_"
413 <<
"layer_" << istr1;
416 histoname <<
"DigiOccupancy_Minus_"
417 <<
"layer_" << istr1;
422 histoname <<
"SUMOfDigiOccupancy_Plus";
425 histoname <<
"SUMOfRecDigiOccupancy_Minus";