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_;
107 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 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();
189 digiValidation(detId, geom0, layer, adc, charge, totmode, zerothreshold);
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();
217 digiValidation(detId, geom0, layer, adc, charge, totmode, zerothreshold);
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();
243 digiValidation(detId, geom1, layer, adc, charge, totmode, zerothreshold);
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;
279 digiValidation(detId, geom1, layer, adc, charge, totmode, zerothreshold);
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>
301 const GlobalPoint& global1 = geom->getPosition(id1);
307 hinfo.
x = global1.x();
308 hinfo.
y = global1.y();
309 hinfo.
z = global1.z();
317 edm::LogVerbatim(
"HGCalValidation") <<
"gx = " << hinfo.
x <<
" gy = " << hinfo.
y <<
" gz = " << hinfo.
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;
339 TOT_.at(ilayer)->Fill(hinfo.
adc);
343 ADC_.at(ilayer)->Fill(hinfo.
adc);
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";
427 iB.
book1D(histoname.str().c_str(),
"SUMOfDigiOccupancy_Minus",
layers_, -0.5, layers_ - 0.5);
HGCalGeometryMode::GeometryMode geomMode() const
Geometry mode.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
EventNumber_t event() const
void analyze(const edm::Event &, const edm::EventSetup &) override
HcalSubdetector subdet() const
get the subdetector
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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_
std::vector< MonitorElement * > TOT_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const override
int depth() const
get the tower depth
#define DEFINE_FWK_MODULE(type)
unsigned int layers(bool reco) const
int layer() const
get the layer #
int layer() const
get the layer #
const HGCalTopology & topology() const
edm::DataFrame::id_type id() const
HGCalDigiValidation(const edm::ParameterSet &)
~HGCalDigiValidation() override
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< MonitorElement * > DigiOccupancy_Minus_
constexpr double pedestal(int fCapId) const
get pedestal for capid=0..3
T const * product() const
int getMaxDepth(const int &type) const
MonitorElement * MeanDigiOccupancy_Minus_
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
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_
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
std::map< int, int > OccupancyMap_minus_
int layer() const
get the layer #
std::map< int, int > OccupancyMap_plus_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
std::string nameDetector_
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
std::vector< MonitorElement * > ADC_
MonitorElement * MeanDigiOccupancy_Plus_
T const * product() const
void fillOccupancyMap(std::map< int, int > &OccupancyMap, int layer)
int layer() const
get the layer #
std::vector< MonitorElement * > DigiOccupancy_Plus_