48 #include "CLHEP/Units/GlobalSystemOfUnits.h"
77 template <
class T1,
class T2>
91 std::vector<MonitorElement*>
TOA_;
93 std::vector<MonitorElement*>
ADC_;
94 std::vector<MonitorElement*>
TOT_;
102 : nameDetector_(iConfig.getParameter<
std::
string>(
"DetectorName")),
103 ifNose_(iConfig.getParameter<
bool>(
"ifNose")),
104 ifHCAL_(iConfig.getParameter<
bool>(
"ifHCAL")),
105 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)),
106 SampleIndx_(iConfig.getUntrackedParameter<
int>(
"SampleIndx", 0)),
119 <<
"\"HGCalEESensitive\", \"HGCalHESiliconSensitive\", "
120 <<
"\"HGCalHEScintillatorSensitive\", \"HGCalHFNoseSensitive\", "
129 desc.add<
bool>(
"ifNose",
false);
130 desc.add<
bool>(
"ifHCAL",
false);
131 desc.addUntracked<
int>(
"Verbosity", 0);
132 desc.addUntracked<
int>(
"SampleIndx", 2);
133 descriptions.
add(
"hgcalDigiValidationEEDefault",
desc);
157 if (
geom0->topology().waferHexagon8())
159 else if (
geom0->topology().tileTrapezoid())
165 unsigned int ntot(0), nused(0);
170 if (theHGCEEDigiContainers.
isValid()) {
174 for (
const auto& it : *(theHGCEEDigiContainers.
product())) {
177 DetId detId = it.id();
181 uint16_t
gain = hgcSample.
toa();
182 uint16_t
adc = hgcSample.
data();
184 bool totmode = hgcSample.
mode();
185 bool zerothreshold = hgcSample.
threshold();
197 if (theHGCHEDigiContainers.
isValid()) {
201 for (
const auto& it : *(theHGCHEDigiContainers.
product())) {
204 DetId detId = it.id();
205 int layer = ((geomType == 0)
209 uint16_t
gain = hgcSample.
toa();
210 uint16_t
adc = hgcSample.
data();
212 bool totmode = hgcSample.
mode();
213 bool zerothreshold = hgcSample.
threshold();
225 if (theHGCBHDigiContainers.
isValid()) {
229 for (
const auto& it : *(theHGCBHDigiContainers.
product())) {
235 uint16_t
gain = hgcSample.
toa();
236 uint16_t
adc = hgcSample.
data();
238 bool totmode = hgcSample.
mode();
239 bool zerothreshold = hgcSample.
threshold();
244 edm::LogWarning(
"HGCalValidation") <<
"DigiCollection handle does not "
251 if (theHEDigiContainers.
isValid()) {
258 for (
const auto& it : *(theHEDigiContainers.
product())) {
274 bool totmode =
false;
275 bool zerothreshold =
false;
281 edm::LogWarning(
"HGCalValidation") <<
"DigiCollection handle does not "
292 template <
class T1,
class T2>
304 hinfo.x = global1.x();
305 hinfo.y = global1.y();
306 hinfo.z = global1.z();
316 if (global1.eta() > 0)
325 if (OccupancyMap.find(
layer) != OccupancyMap.end())
326 OccupancyMap[
layer]++;
328 OccupancyMap[
layer] = 1;
332 int ilayer =
hinfo.layer;
347 int layer = itr.first;
348 int occupancy = itr.second;
352 int layer = itr.first;
353 int occupancy = itr.second;
381 std::ostringstream histoname;
382 for (
int il = 0; il <
layers_; ++il) {
384 auto istr1 = std::to_string(ilayer);
385 while (istr1.size() < 2) {
386 istr1.insert(0,
"0");
390 <<
"layer_" << istr1;
391 TOA_.push_back(iB.
book1D(histoname.str().c_str(),
"toa_", 1024, 0, 1024));
395 <<
"layer_" << istr1;
396 ADC_.push_back(iB.
book1D(histoname.str().c_str(),
"ADCDigiOccupancy", 1024, 0, 1024));
400 <<
"layer_" << istr1;
401 TOT_.push_back(iB.
book1D(histoname.str().c_str(),
"TOTDigiOccupancy", 4096, 0, 4096));
404 histoname <<
"DigiOccupancy_XY_"
405 <<
"layer_" << istr1;
406 DigiOccupancy_XY_.push_back(iB.
book2D(histoname.str().c_str(),
"DigiOccupancy", 50, -500, 500, 50, -500, 500));
409 histoname <<
"DigiOccupancy_Plus_"
410 <<
"layer_" << istr1;
413 histoname <<
"DigiOccupancy_Minus_"
414 <<
"layer_" << istr1;
419 histoname <<
"SUMOfDigiOccupancy_Plus";
422 histoname <<
"SUMOfRecDigiOccupancy_Minus";