50 #include "CLHEP/Units/GlobalSystemOfUnits.h" 81 template<
class T1,
class T2>
95 std::vector<MonitorElement*>
TOA_;
97 std::vector<MonitorElement*>
ADC_;
98 std::vector<MonitorElement*>
TOT_;
109 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity",0)),
124 <<
"HGCal DetectorName given as " <<
nameDetector_ <<
" must be: " 125 <<
"\"HGCalEESensitive\", \"HGCalHESiliconSensitive\", " 126 <<
"\"HGCalHEScintillatorSensitive\", \"HGCalHFNoseSensitive\", " 135 desc.
add<
bool>(
"ifNose",
false);
136 desc.
add<
bool>(
"ifHCAL",
false);
139 descriptions.
add(
"hgcalDigiValidationEEDefault",desc);
155 <<
"valid Geometry Object for " 163 <<
"valid Geometry Object for " 173 unsigned int ntot(0), nused(0);
179 if (theHGCEEDigiContainers.
isValid()) {
182 << theHGCEEDigiContainers->
size()
184 for (
const auto & it: *(theHGCEEDigiContainers.
product())) {
186 DetId detId = it.id();
192 uint16_t
gain = hgcSample.
toa();
193 uint16_t
adc = hgcSample.
data();
195 bool totmode = hgcSample.
mode();
196 bool zerothreshold = hgcSample.
threshold();
197 digiValidation(detId, geom0, layer, adc, charge, totmode, zerothreshold);
209 if (theHGCHEDigiContainers.
isValid()) {
212 << theHGCHEDigiContainers->
size()
214 for (
const auto & it: *(theHGCHEDigiContainers.
product())) {
216 DetId detId = it.id();
221 uint16_t
gain = hgcSample.
toa();
222 uint16_t
adc = hgcSample.
data();
224 bool totmode = hgcSample.
mode();
225 bool zerothreshold = hgcSample.
threshold();
226 digiValidation(detId, geom0, layer, adc, charge, totmode, zerothreshold);
237 if (theHGCBHDigiContainers.
isValid()) {
240 << theHGCBHDigiContainers->
size()
242 for (
const auto & it: *(theHGCBHDigiContainers.
product())) {
245 int layer = detId.
depth();
247 uint16_t
gain = hgcSample.
toa();
248 uint16_t
adc = hgcSample.
data();
250 bool totmode = hgcSample.
mode();
251 bool zerothreshold = hgcSample.
threshold();
252 digiValidation(detId, geom1, layer, adc, charge, totmode, zerothreshold);
256 edm::LogWarning(
"HGCalValidation") <<
"DigiCollection handle does not " 263 if (theHEDigiContainers.
isValid()) {
266 << theHEDigiContainers->
size()
271 for (
const auto & it: *(theHEDigiContainers.
product())) {
283 int layer = detId.
depth();
287 bool totmode =
false;
288 bool zerothreshold =
false;
289 digiValidation(detId, geom1, layer, adc, charge, totmode, zerothreshold);
294 edm::LogWarning(
"HGCalValidation") <<
"DigiCollection handle does not " 303 <<
" with " << ntot <<
" total and " 304 << nused <<
" used digis";
307 template<
class T1,
class T2>
309 int layer, uint16_t
adc,
315 <<
" " << detId.rawId();
317 const GlobalPoint& global1 = geom->getPosition(id1);
324 hinfo.
x = global1.x();
325 hinfo.
y = global1.y();
326 hinfo.
z = global1.z();
335 <<
" gy = " << hinfo.
y 336 <<
" gz = " << hinfo.
z;
347 if (OccupancyMap.find(layer) != OccupancyMap.end()) OccupancyMap[layer] ++;
348 else OccupancyMap[layer] = 1;
352 int ilayer = hinfo.
layer;
356 TOT_.at(ilayer)->Fill(hinfo.
adc);
360 ADC_.at(ilayer)->Fill(hinfo.
adc);
367 int layer = itr.first;
368 int occupancy = itr.second;
372 int layer = itr.first;
373 int occupancy = itr.second;
395 <<
"HGCAL/HGCalDigisV/" 397 <<
layers_ <<
" with the first one at " 407 std::ostringstream histoname;
408 for (
int il = 0; il <
layers_; ++il) {
410 histoname.str(
""); histoname <<
"TOA_"<<
"layer_" << ilayer;
411 TOA_.push_back(iB.
book1D(histoname.str().c_str(),
"toa_",1024,0,1024));
413 histoname.str(
""); histoname <<
"ADC_" <<
"layer_" << ilayer;
414 ADC_.push_back(iB.
book1D(histoname.str().c_str(),
"ADCDigiOccupancy",1024,0,1024));
416 histoname.str(
""); histoname <<
"TOT_" <<
"layer_" << ilayer;
417 TOT_.push_back(iB.
book1D(histoname.str().c_str(),
"TOTDigiOccupancy",4096,0,4096));
419 histoname.str(
""); histoname <<
"DigiOccupancy_XY_" <<
"layer_" << ilayer;
420 DigiOccupancy_XY_.push_back(iB.
book2D(histoname.str().c_str(),
"DigiOccupancy", 50, -500, 500, 50, -500, 500));
422 histoname.str(
""); histoname <<
"DigiOccupancy_Plus_" <<
"layer_" << ilayer;
424 histoname.str(
""); histoname <<
"DigiOccupancy_Minus_" <<
"layer_" << ilayer;
428 histoname.str(
""); histoname <<
"SUMOfDigiOccupancy_Plus";
430 histoname.str(
""); histoname <<
"SUMOfRecDigiOccupancy_Minus";
HGCalGeometryMode::GeometryMode geomMode() const
Geometry mode.
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
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
void setCurrentFolder(std::string const &fullpath)
int layer() const
get the layer #
int layer() const
get the layer #
const HGCalTopology & topology() const
MonitorElement * book1D(Args &&...args)
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
MonitorElement * book2D(Args &&...args)
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_
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_