46 #include "CLHEP/Units/GlobalSystemOfUnits.h" 75 template<
class T1,
class T2>
90 std::vector<MonitorElement*>
ADC_;
100 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity",0)),
111 <<
"HGCal DetectorName given as " <<
nameDetector_ <<
" must be: " 112 <<
"\"HGCalEESensitive\", \"HGCalHESiliconSensitive\", " 113 <<
"\"HGCalHEScintillatorSensitive\", or \"HCal\"!";
121 desc.
add<
bool>(
"ifHCAL",
false);
124 descriptions.
add(
"hgcalDigiValidationEEDefault",desc);
139 edm::LogVerbatim(
"HGCalValidation") <<
"HGCalDigiValidation: Cannot get valid " 146 edm::LogVerbatim(
"HGCalValidation") <<
"HGCalDigiValidation: Cannot get valid " 155 unsigned int ntot(0), nused(0);
160 if (theHGCEEDigiContainers.
isValid()) {
163 << theHGCEEDigiContainers->
size()
166 for (
const auto & it: *(theHGCEEDigiContainers.
product())) {
168 DetId detId = it.id();
172 uint16_t
gain = hgcSample.
toa();
173 uint16_t
adc = hgcSample.
data();
180 <<
"exist for HGCEE!!!";
187 if (theHGCHEDigiContainers.
isValid()) {
190 << theHGCHEDigiContainers->
size()
193 for (
const auto & it: *(theHGCHEDigiContainers.
product())) {
195 DetId detId = it.id();
200 uint16_t
gain = hgcSample.
toa();
201 uint16_t
adc = hgcSample.
data();
208 <<
"exist for HGCFH!!!";
214 if (theHGCBHDigiContainers.
isValid()) {
217 << theHGCBHDigiContainers->
size()
220 for (
const auto & it: *(theHGCBHDigiContainers.
product())) {
223 int layer = detId.
depth();
225 uint16_t
gain = hgcSample.
toa();
226 uint16_t
adc = hgcSample.
data();
232 edm::LogWarning(
"HGCalValidation") <<
"DigiCollection handle does not " 233 <<
"exist for HGCBH!!!";
239 if (theHEDigiContainers.
isValid()) {
242 << theHEDigiContainers->
size()
247 for (
const auto & it: *(theHEDigiContainers.
product())) {
259 int layer = detId.
depth();
268 edm::LogWarning(
"HGCalValidation") <<
"DigiCollection handle does not " 269 <<
"exist for HGCBH!!!";
276 <<
" with " << ntot <<
" total and " 277 << nused <<
" used digis";
280 template<
class T1,
class T2>
282 int layer, uint16_t
adc,
double charge) {
288 const GlobalPoint& global1 = geom->getPosition(id1);
292 <<
" charge = " <<
charge;
295 hinfo.
x = global1.x();
296 hinfo.
y = global1.y();
297 hinfo.
z = global1.z();
304 <<
" gy = " << hinfo.
y 305 <<
" gz = " << hinfo.
z;
315 if (OccupancyMap.find(layer) != OccupancyMap.end()) OccupancyMap[layer] ++;
316 else OccupancyMap[layer] = 1;
320 int ilayer = hinfo.
layer -1;
323 ADC_.at(ilayer)->Fill(hinfo.
adc);
328 int layer = itr.first;
329 int occupancy = itr.second;
333 int layer = itr.first;
334 int occupancy = itr.second;
365 std::ostringstream histoname;
366 for (
int ilayer = 0; ilayer <
layers_; ilayer++ ) {
367 histoname.str(
""); histoname <<
"charge_"<<
"layer_" << ilayer;
368 charge_.push_back(iB.
book1D(histoname.str().c_str(),
"charge_",100,-25,25));
370 histoname.str(
""); histoname <<
"ADC_" <<
"layer_" << ilayer;
371 ADC_.push_back(iB.
book1D(histoname.str().c_str(),
"DigiOccupancy",200,0,1000));
373 histoname.str(
""); histoname <<
"DigiOccupancy_XY_" <<
"layer_" << ilayer;
374 DigiOccupancy_XY_.push_back(iB.
book2D(histoname.str().c_str(),
"DigiOccupancy", 50, -500, 500, 50, -500, 500));
376 histoname.str(
""); histoname <<
"DigiOccupancy_Plus_" <<
"layer_" << ilayer;
378 histoname.str(
""); histoname <<
"DigiOccupancy_Minus_" <<
"layer_" << ilayer;
382 histoname.str(
""); histoname <<
"SUMOfDigiOccupancy_Plus";
384 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
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)
std::vector< MonitorElement * > DigiOccupancy_Minus_
constexpr double pedestal(int fCapId) const
get pedestal for capid=0..3
void digiValidation(const T1 &detId, const T2 *geom, int, uint16_t, double)
void setCurrentFolder(const std::string &fullpath)
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_