30 #include "CLHEP/Units/GlobalSystemOfUnits.h" 59 template <
class T1,
class T2>
75 std::vector<MonitorElement*>
TOA_;
77 std::vector<MonitorElement*>
ADC_;
78 std::vector<MonitorElement*>
TOT_;
86 : nameDetector_(iConfig.getParameter<
std::
string>(
"DetectorName")),
87 ifNose_(iConfig.getParameter<
bool>(
"ifNose")),
88 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)),
89 SampleIndx_(iConfig.getUntrackedParameter<
int>(
"SampleIndx", 0)),
92 tok_hgcalg_(esConsumes<HGCalGeometry, IdealGeometryRecord>(
edm::ESInputTag{
"", nameDetector_})),
93 digiSource_(consumes<HGCalDigiCollection>(iConfig.getParameter<
edm::InputTag>(
"DigiSource"))),
100 desc.add<
bool>(
"ifNose",
false);
101 desc.addUntracked<
int>(
"Verbosity", 0);
102 desc.addUntracked<
int>(
"SampleIndx", 2);
103 descriptions.
add(
"hgcalDigiValidationEEDefault",
desc);
112 if (
geom0->topology().waferHexagon8())
119 unsigned int ntot(0), nused(0);
123 if (theHGCEEDigiContainers.
isValid()) {
127 for (
const auto& it : *(theHGCEEDigiContainers.
product())) {
130 DetId detId = it.id();
133 uint16_t
gain = hgcSample.
toa();
134 uint16_t
adc = hgcSample.
data();
136 bool totmode = hgcSample.
mode();
137 bool zerothreshold = hgcSample.
threshold();
148 if (theHGCHEDigiContainers.
isValid()) {
152 for (
const auto& it : *(theHGCHEDigiContainers.
product())) {
155 DetId detId = it.id();
158 uint16_t
gain = hgcSample.
toa();
159 uint16_t
adc = hgcSample.
data();
161 bool totmode = hgcSample.
mode();
162 bool zerothreshold = hgcSample.
threshold();
178 template <
class T1,
class T2>
190 hinfo.x = global1.x();
191 hinfo.y = global1.y();
192 hinfo.z = global1.z();
202 if (global1.eta() > 0)
211 if (OccupancyMap.find(
layer) != OccupancyMap.end())
212 OccupancyMap[
layer]++;
214 OccupancyMap[
layer] = 1;
218 int ilayer =
hinfo.layer;
233 int layer = itr.first;
234 int occupancy = itr.second;
238 int layer = itr.first;
239 int occupancy = itr.second;
258 std::ostringstream histoname;
259 for (
int il = 0; il <
layers_; ++il) {
262 while (istr1.size() < 2) {
263 istr1.insert(0,
"0");
267 <<
"layer_" << istr1;
268 TOA_.push_back(iB.
book1D(histoname.str().c_str(),
"toa_", 1024, 0, 1024));
272 <<
"layer_" << istr1;
273 ADC_.push_back(iB.
book1D(histoname.str().c_str(),
"ADCDigiOccupancy", 1024, 0, 1024));
277 <<
"layer_" << istr1;
278 TOT_.push_back(iB.
book1D(histoname.str().c_str(),
"TOTDigiOccupancy", 4096, 0, 4096));
281 histoname <<
"DigiOccupancy_XY_" 282 <<
"layer_" << istr1;
283 DigiOccupancy_XY_.push_back(iB.
book2D(histoname.str().c_str(),
"DigiOccupancy", 50, -500, 500, 50, -500, 500));
286 histoname <<
"DigiOccupancy_Plus_" 287 <<
"layer_" << istr1;
290 histoname <<
"DigiOccupancy_Minus_" 291 <<
"layer_" << istr1;
296 histoname <<
"SUMOfDigiOccupancy_Plus";
299 histoname <<
"SUMOfRecDigiOccupancy_Minus";
Log< level::Info, true > LogVerbatim
void analyze(const edm::Event &, const edm::EventSetup &) override
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
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< TrackerTraits > > layer
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
int layer() const
get the layer #
const edm::EDGetTokenT< HGCalDigiCollection > digiSource_
int layer() const
get the layer #
const edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > tok_hgcalc_
HGCalDigiValidation(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
unsigned int layers(bool reco) 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_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
~HGCalDigiValidation() override=default
void digiValidation(const T1 &detId, const T2 *geom, int layer, uint16_t adc, double charge, bool mode, bool threshold)
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