33 #include "CLHEP/Units/GlobalSystemOfUnits.h" 62 template <
class T1,
class T2>
78 std::vector<MonitorElement*>
TOA_;
80 std::vector<MonitorElement*>
ADC_;
81 std::vector<MonitorElement*>
TOT_;
89 : nameDetector_(iConfig.getParameter<
std::
string>(
"DetectorName")),
90 ifNose_(iConfig.getParameter<
bool>(
"ifNose")),
91 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)),
92 SampleIndx_(iConfig.getUntrackedParameter<
int>(
"SampleIndx", 0)),
95 tok_hgcalg_(esConsumes<HGCalGeometry, IdealGeometryRecord>(
edm::ESInputTag{
"", nameDetector_})),
98 if ((nameDetector_ ==
"HGCalEESensitive") || (nameDetector_ ==
"HGCalHESiliconSensitive") ||
99 (nameDetector_ ==
"HGCalHEScintillatorSensitive") || (nameDetector_ ==
"HGCalHFNoseSensitive")) {
100 digiSource_ = consumes<HGCalDigiCollection>(
temp);
102 throw cms::Exception(
"BadHGCDigiSource") <<
"HGCal DetectorName given as " << nameDetector_ <<
" must be: " 103 <<
"\"HGCalEESensitive\", \"HGCalHESiliconSensitive\", or " 104 <<
"\"HGCalHEScintillatorSensitive\", \"HGCalHFNoseSensitive\"!";
112 desc.add<
bool>(
"ifNose",
false);
113 desc.addUntracked<
int>(
"Verbosity", 0);
114 desc.addUntracked<
int>(
"SampleIndx", 2);
115 descriptions.
add(
"hgcalDigiValidationEEDefault",
desc);
124 if (
geom0->topology().waferHexagon8())
126 else if (
geom0->topology().tileTrapezoid())
131 unsigned int ntot(0), nused(0);
136 if (theHGCEEDigiContainers.
isValid()) {
140 for (
const auto& it : *(theHGCEEDigiContainers.
product())) {
143 DetId detId = it.id();
148 uint16_t
gain = hgcSample.
toa();
149 uint16_t
adc = hgcSample.
data();
151 bool totmode = hgcSample.
mode();
152 bool zerothreshold = hgcSample.
threshold();
164 if (theHGCHEDigiContainers.
isValid()) {
168 for (
const auto& it : *(theHGCHEDigiContainers.
product())) {
171 DetId detId = it.id();
172 int layer = ((geomType == 0)
176 uint16_t
gain = hgcSample.
toa();
177 uint16_t
adc = hgcSample.
data();
179 bool totmode = hgcSample.
mode();
180 bool zerothreshold = hgcSample.
threshold();
196 template <
class T1,
class T2>
208 hinfo.x = global1.x();
209 hinfo.y = global1.y();
210 hinfo.z = global1.z();
220 if (global1.eta() > 0)
229 if (OccupancyMap.find(
layer) != OccupancyMap.end())
230 OccupancyMap[
layer]++;
232 OccupancyMap[
layer] = 1;
236 int ilayer =
hinfo.layer;
251 int layer = itr.first;
252 int occupancy = itr.second;
256 int layer = itr.first;
257 int occupancy = itr.second;
276 std::ostringstream histoname;
277 for (
int il = 0; il <
layers_; ++il) {
280 while (istr1.size() < 2) {
281 istr1.insert(0,
"0");
285 <<
"layer_" << istr1;
286 TOA_.push_back(iB.
book1D(histoname.str().c_str(),
"toa_", 1024, 0, 1024));
290 <<
"layer_" << istr1;
291 ADC_.push_back(iB.
book1D(histoname.str().c_str(),
"ADCDigiOccupancy", 1024, 0, 1024));
295 <<
"layer_" << istr1;
296 TOT_.push_back(iB.
book1D(histoname.str().c_str(),
"TOTDigiOccupancy", 4096, 0, 4096));
299 histoname <<
"DigiOccupancy_XY_" 300 <<
"layer_" << istr1;
301 DigiOccupancy_XY_.push_back(iB.
book2D(histoname.str().c_str(),
"DigiOccupancy", 50, -500, 500, 50, -500, 500));
304 histoname <<
"DigiOccupancy_Plus_" 305 <<
"layer_" << istr1;
308 histoname <<
"DigiOccupancy_Minus_" 309 <<
"layer_" << istr1;
314 histoname <<
"SUMOfDigiOccupancy_Plus";
317 histoname <<
"SUMOfRecDigiOccupancy_Minus";
Log< level::Info, true > LogVerbatim
void analyze(const edm::Event &, const edm::EventSetup &) override
int layer() const
get the layer #
const edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > tok_hgcalg_
virtual void setCurrentFolder(std::string const &fullpath)
std::vector< MonitorElement * > TOA_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< MonitorElement * > DigiOccupancy_XY_
T const * product() const
std::vector< MonitorElement * > TOT_
std::string to_string(const V &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
constexpr std::array< uint8_t, layerIndexSize > layer
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
int layer() const
get the layer #
int layer() const
get the layer #
const edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > tok_hgcalc_
HGCalDigiValidation(const edm::ParameterSet &)
~HGCalDigiValidation() override
#define DEFINE_FWK_MODULE(type)
unsigned int layers(bool reco) const
bool getData(T &iHolder) const
const std::string nameDetector_
std::vector< MonitorElement * > DigiOccupancy_Minus_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * MeanDigiOccupancy_Minus_
int layer() const
get the layer #
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void digiValidation(const T1 &detId, const T2 *geom, int layer, uint16_t adc, double charge, bool mode, bool threshold)
edm::EDGetToken digiSource_
std::map< int, int > OccupancyMap_minus_
std::map< int, int > OccupancyMap_plus_
Log< level::Warning, false > LogWarning
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
std::vector< MonitorElement * > ADC_
MonitorElement * MeanDigiOccupancy_Plus_
void fillOccupancyMap(std::map< int, int > &OccupancyMap, int layer)
std::vector< MonitorElement * > DigiOccupancy_Plus_
uint16_t *__restrict__ uint16_t const *__restrict__ adc