34 #include "CLHEP/Units/GlobalSystemOfUnits.h"
63 template <
class T1,
class T2>
79 std::vector<MonitorElement*>
TOA_;
81 std::vector<MonitorElement*>
ADC_;
82 std::vector<MonitorElement*>
TOT_;
90 : nameDetector_(iConfig.getParameter<
std::
string>(
"DetectorName")),
91 ifNose_(iConfig.getParameter<
bool>(
"ifNose")),
92 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)),
93 SampleIndx_(iConfig.getUntrackedParameter<
int>(
"SampleIndx", 0)),
96 tok_hgcalg_(esConsumes<HGCalGeometry, IdealGeometryRecord>(
edm::ESInputTag{
"", nameDetector_})),
99 if ((nameDetector_ ==
"HGCalEESensitive") || (nameDetector_ ==
"HGCalHESiliconSensitive") ||
100 (nameDetector_ ==
"HGCalHEScintillatorSensitive") || (nameDetector_ ==
"HGCalHFNoseSensitive")) {
101 digiSource_ = consumes<HGCalDigiCollection>(
temp);
103 throw cms::Exception(
"BadHGCDigiSource") <<
"HGCal DetectorName given as " << nameDetector_ <<
" must be: "
104 <<
"\"HGCalEESensitive\", \"HGCalHESiliconSensitive\", or "
105 <<
"\"HGCalHEScintillatorSensitive\", \"HGCalHFNoseSensitive\"!";
113 desc.add<
bool>(
"ifNose",
false);
114 desc.addUntracked<
int>(
"Verbosity", 0);
115 desc.addUntracked<
int>(
"SampleIndx", 2);
116 descriptions.
add(
"hgcalDigiValidationEEDefault",
desc);
125 if (
geom0->topology().waferHexagon8())
127 else if (
geom0->topology().tileTrapezoid())
132 unsigned int ntot(0), nused(0);
137 if (theHGCEEDigiContainers.
isValid()) {
141 for (
const auto& it : *(theHGCEEDigiContainers.
product())) {
144 DetId detId = it.id();
149 uint16_t
gain = hgcSample.
toa();
150 uint16_t
adc = hgcSample.
data();
152 bool totmode = hgcSample.
mode();
153 bool zerothreshold = hgcSample.
threshold();
165 if (theHGCHEDigiContainers.
isValid()) {
169 for (
const auto& it : *(theHGCHEDigiContainers.
product())) {
172 DetId detId = it.id();
173 int layer = ((geomType == 0)
177 uint16_t
gain = hgcSample.
toa();
178 uint16_t
adc = hgcSample.
data();
180 bool totmode = hgcSample.
mode();
181 bool zerothreshold = hgcSample.
threshold();
197 template <
class T1,
class T2>
209 hinfo.x = global1.x();
210 hinfo.y = global1.y();
211 hinfo.z = global1.z();
221 if (global1.eta() > 0)
230 if (OccupancyMap.find(
layer) != OccupancyMap.end())
231 OccupancyMap[
layer]++;
233 OccupancyMap[
layer] = 1;
237 int ilayer =
hinfo.layer;
252 int layer = itr.first;
253 int occupancy = itr.second;
257 int layer = itr.first;
258 int occupancy = itr.second;
277 std::ostringstream histoname;
278 for (
int il = 0; il <
layers_; ++il) {
280 auto istr1 = std::to_string(ilayer);
281 while (istr1.size() < 2) {
282 istr1.insert(0,
"0");
286 <<
"layer_" << istr1;
287 TOA_.push_back(iB.
book1D(histoname.str().c_str(),
"toa_", 1024, 0, 1024));
291 <<
"layer_" << istr1;
292 ADC_.push_back(iB.
book1D(histoname.str().c_str(),
"ADCDigiOccupancy", 1024, 0, 1024));
296 <<
"layer_" << istr1;
297 TOT_.push_back(iB.
book1D(histoname.str().c_str(),
"TOTDigiOccupancy", 4096, 0, 4096));
300 histoname <<
"DigiOccupancy_XY_"
301 <<
"layer_" << istr1;
302 DigiOccupancy_XY_.push_back(iB.
book2D(histoname.str().c_str(),
"DigiOccupancy", 50, -500, 500, 50, -500, 500));
305 histoname <<
"DigiOccupancy_Plus_"
306 <<
"layer_" << istr1;
309 histoname <<
"DigiOccupancy_Minus_"
310 <<
"layer_" << istr1;
315 histoname <<
"SUMOfDigiOccupancy_Plus";
318 histoname <<
"SUMOfRecDigiOccupancy_Minus";