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\", \"HGCalHFNoseSensitive\", " 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);
176 if (theHGCEEDigiContainers.
isValid()) {
179 << theHGCEEDigiContainers->
size()
181 for (
const auto & it: *(theHGCEEDigiContainers.
product())) {
183 DetId detId = it.id();
189 uint16_t
gain = hgcSample.
toa();
190 uint16_t
adc = hgcSample.
data();
204 if (theHGCHEDigiContainers.
isValid()) {
207 << theHGCHEDigiContainers->
size()
209 for (
const auto & it: *(theHGCHEDigiContainers.
product())) {
211 DetId detId = it.id();
216 uint16_t
gain = hgcSample.
toa();
217 uint16_t
adc = hgcSample.
data();
230 if (theHGCBHDigiContainers.
isValid()) {
233 << theHGCBHDigiContainers->
size()
235 for (
const auto & it: *(theHGCBHDigiContainers.
product())) {
238 int layer = detId.
depth();
240 uint16_t
gain = hgcSample.
toa();
241 uint16_t
adc = hgcSample.
data();
247 edm::LogWarning(
"HGCalValidation") <<
"DigiCollection handle does not " 254 if (theHEDigiContainers.
isValid()) {
257 << theHEDigiContainers->
size()
262 for (
const auto & it: *(theHEDigiContainers.
product())) {
274 int layer = detId.
depth();
283 edm::LogWarning(
"HGCalValidation") <<
"DigiCollection handle does not " 291 <<
" with " << ntot <<
" total and " 292 << nused <<
" used digis";
295 template<
class T1,
class T2>
297 int layer, uint16_t
adc,
304 const GlobalPoint& global1 = geom->getPosition(id1);
308 <<
" charge = " <<
charge;
311 hinfo.
x = global1.x();
312 hinfo.
y = global1.y();
313 hinfo.
z = global1.z();
320 <<
" gy = " << hinfo.
y 321 <<
" gz = " << hinfo.
z;
332 if (OccupancyMap.find(layer) != OccupancyMap.end()) OccupancyMap[layer] ++;
333 else OccupancyMap[layer] = 1;
337 int ilayer = hinfo.
layer;
340 ADC_.at(ilayer)->Fill(hinfo.
adc);
345 int layer = itr.first;
346 int occupancy = itr.second;
350 int layer = itr.first;
351 int occupancy = itr.second;
373 <<
"HGCAL/HGCalDigisV/" 375 <<
layers_ <<
" with the first one at " 385 std::ostringstream histoname;
386 for (
int il = 0; il <
layers_; ++il) {
388 histoname.str(
""); histoname <<
"charge_"<<
"layer_" << ilayer;
389 charge_.push_back(iB.
book1D(histoname.str().c_str(),
"charge_",100,-25,25));
391 histoname.str(
""); histoname <<
"ADC_" <<
"layer_" << ilayer;
392 ADC_.push_back(iB.
book1D(histoname.str().c_str(),
"DigiOccupancy",200,0,1000));
394 histoname.str(
""); histoname <<
"DigiOccupancy_XY_" <<
"layer_" << ilayer;
395 DigiOccupancy_XY_.push_back(iB.
book2D(histoname.str().c_str(),
"DigiOccupancy", 50, -500, 500, 50, -500, 500));
397 histoname.str(
""); histoname <<
"DigiOccupancy_Plus_" <<
"layer_" << ilayer;
399 histoname.str(
""); histoname <<
"DigiOccupancy_Minus_" <<
"layer_" << ilayer;
403 histoname.str(
""); histoname <<
"SUMOfDigiOccupancy_Plus";
405 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_