50 #include "CLHEP/Units/GlobalSystemOfUnits.h" 79 template<
class T1,
class T2>
95 std::vector<MonitorElement*>
ADC_;
106 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity",0)),
121 <<
"HGCal DetectorName given as " <<
nameDetector_ <<
" must be: " 122 <<
"\"HGCalEESensitive\", \"HGCalHESiliconSensitive\", " 123 <<
"\"HGCalHEScintillatorSensitive\", \"HFNoseSensitive\", " 132 desc.
add<
bool>(
"ifNose",
false);
133 desc.
add<
bool>(
"ifHCAL",
false);
136 descriptions.
add(
"hgcalDigiValidationEEDefault",desc);
152 <<
"valid Geometry Object for " 160 <<
"valid Geometry Object for " 170 unsigned int ntot(0), nused(0);
175 if (theHGCEEDigiContainers.
isValid()) {
178 << theHGCEEDigiContainers->
size()
180 for (
const auto & it: *(theHGCEEDigiContainers.
product())) {
182 DetId detId = it.id();
188 uint16_t
gain = hgcSample.
toa();
189 uint16_t
adc = hgcSample.
data();
203 if (theHGCHEDigiContainers.
isValid()) {
206 << theHGCHEDigiContainers->
size()
208 for (
const auto & it: *(theHGCHEDigiContainers.
product())) {
210 DetId detId = it.id();
215 uint16_t
gain = hgcSample.
toa();
216 uint16_t
adc = hgcSample.
data();
229 if (theHGCBHDigiContainers.
isValid()) {
232 << theHGCBHDigiContainers->
size()
234 for (
const auto & it: *(theHGCBHDigiContainers.
product())) {
237 int layer = detId.
depth();
239 uint16_t
gain = hgcSample.
toa();
240 uint16_t
adc = hgcSample.
data();
246 edm::LogWarning(
"HGCalValidation") <<
"DigiCollection handle does not " 253 if (theHEDigiContainers.
isValid()) {
256 << theHEDigiContainers->
size()
261 for (
const auto & it: *(theHEDigiContainers.
product())) {
273 int layer = detId.
depth();
282 edm::LogWarning(
"HGCalValidation") <<
"DigiCollection handle does not " 290 <<
" with " << ntot <<
" total and " 291 << nused <<
" used digis";
294 template<
class T1,
class T2>
296 int layer, uint16_t
adc,
303 const GlobalPoint& global1 = geom->getPosition(id1);
307 <<
" charge = " <<
charge;
310 hinfo.
x = global1.x();
311 hinfo.
y = global1.y();
312 hinfo.
z = global1.z();
319 <<
" gy = " << hinfo.
y 320 <<
" gz = " << hinfo.
z;
331 if (OccupancyMap.find(layer) != OccupancyMap.end()) OccupancyMap[layer] ++;
332 else OccupancyMap[layer] = 1;
336 int ilayer = hinfo.
layer;
339 ADC_.at(ilayer)->Fill(hinfo.
adc);
344 int layer = itr.first;
345 int occupancy = itr.second;
349 int layer = itr.first;
350 int occupancy = itr.second;
372 <<
"HGCAL/HGCalDigisV/" 374 <<
layers_ <<
" with the first one at " 384 std::ostringstream histoname;
385 for (
int il = 0; il <
layers_; ++il) {
387 histoname.str(
""); histoname <<
"charge_"<<
"layer_" << ilayer;
388 charge_.push_back(iB.
book1D(histoname.str().c_str(),
"charge_",100,-25,25));
390 histoname.str(
""); histoname <<
"ADC_" <<
"layer_" << ilayer;
391 ADC_.push_back(iB.
book1D(histoname.str().c_str(),
"DigiOccupancy",200,0,1000));
393 histoname.str(
""); histoname <<
"DigiOccupancy_XY_" <<
"layer_" << ilayer;
394 DigiOccupancy_XY_.push_back(iB.
book2D(histoname.str().c_str(),
"DigiOccupancy", 50, -500, 500, 50, -500, 500));
396 histoname.str(
""); histoname <<
"DigiOccupancy_Plus_" <<
"layer_" << ilayer;
398 histoname.str(
""); histoname <<
"DigiOccupancy_Minus_" <<
"layer_" << ilayer;
402 histoname.str(
""); histoname <<
"SUMOfDigiOccupancy_Plus";
404 histoname.str(
""); histoname <<
"SUMOfRecDigiOccupancy_Minus";
int adc(sample_type sample)
get the ADC sample (12 bits)
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
std::vector< MonitorElement * > charge_
HcalSubdetector subdet() const
get the subdetector
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< MonitorElement * > DigiOccupancy_XY_
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
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
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void digiValidation(const T1 &detId, const T2 *geom, int layer, uint16_t adc, double charge)
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)
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_