48 #include "CLHEP/Units/GlobalSystemOfUnits.h"
52 nameDetector_(iConfig.getParameter<std::
string>(
"DetectorName")),
53 verbosity_(iConfig.getUntrackedParameter<int>(
"Verbosity",0)),
54 SampleIndx_(iConfig.getUntrackedParameter<int>(
"SampleIndx",5)) {
63 consumes<edm::SortedCollection<HcalUpgradeDataFrame> >(
temp);
66 <<
"HGCal DetectorName given as " <<
nameDetector_ <<
" must be: "
67 <<
"\"HGCalHESiliconSensitive\", \"HGCalHESiliconSensitive\", "
68 <<
"\"HGCalHEScintillatorSensitive\", or \"HCal\"!";
94 unsigned int ntot(0), nused(0);
99 if (theHGCEEDigiContainers.
isValid()) {
102 << theHGCEEDigiContainers->size()
106 it !=theHGCEEDigiContainers->end(); ++it) {
109 int layer = detId.
layer();
111 uint16_t gain = hgcSample.
toa();
112 uint16_t
adc = hgcSample.
data();
118 edm::LogWarning(
"HGCalValidation") <<
"HGCEEDigiCollection handle does not exist !!!";
125 if (theHGCHEDigiContainers.
isValid()) {
128 << theHGCHEDigiContainers->size()
132 it !=theHGCHEDigiContainers->end(); ++it) {
135 int layer = detId.
layer();
137 uint16_t gain = hgcSample.
toa();
138 uint16_t
adc = hgcSample.
data();
144 edm::LogWarning(
"HGCalValidation") <<
"HGCHEDigiCollection handle does not exist !!!";
150 if (theHEDigiContainers.
isValid()) {
153 << theHEDigiContainers->size()
159 it !=theHEDigiContainers->end(); ++it) {
165 const HcalQIECoder* channelCoder = conditions->getHcalCoder(detId);
166 const HcalQIEShape* shape = conditions->getHcalShape(channelCoder);
170 int layer = detId.
depth();
179 edm::LogWarning(
"HGCalValidation") <<
"HGCHEDigiCollection handle does not exist !!!";
186 <<
" with " << ntot <<
" total and "
187 << nused <<
" used digis";
190 template<
class T1,
class T2>
192 int layer, uint16_t
adc,
double charge) {
200 <<
" charge = " <<
charge;
203 hinfo.
x = global1.x();
204 hinfo.
y = global1.y();
205 hinfo.
z = global1.z();
212 <<
" gy = " << hinfo.
y
213 <<
" gz = " << hinfo.
z;
223 if (OccupancyMap.find(layer) != OccupancyMap.end()) OccupancyMap[layer] ++;
224 else OccupancyMap[layer] = 1;
228 int ilayer = hinfo.
layer -1;
231 ADC_.at(ilayer)->Fill(hinfo.
adc);
237 int layer = (*itr).first;
238 int occupancy = (*itr).second;
243 int layer = (*itr).first;
244 int occupancy = (*itr).second;
264 edm::LogInfo(
"HGCalValidation") <<
"current DQM directory: "
275 std::ostringstream histoname;
276 for (
int ilayer = 0; ilayer <
layers_; ilayer++ ) {
277 histoname.str(
""); histoname <<
"charge_"<<
"layer_" << ilayer;
278 charge_.push_back(iB.
book1D(histoname.str().c_str(),
"charge_",100,-25,25));
280 histoname.str(
""); histoname <<
"ADC_" <<
"layer_" << ilayer;
281 ADC_.push_back(iB.
book1D(histoname.str().c_str(),
"DigiOccupancy",200,0,1000));
283 histoname.str(
""); histoname <<
"DigiOccupancy_XY_" <<
"layer_" << ilayer;
284 DigiOccupancy_XY_.push_back(iB.
book2D(histoname.str().c_str(),
"DigiOccupancy", 50, -500, 500, 50, -500, 500));
286 histoname.str(
""); histoname <<
"DigiOccupancy_Plus_" <<
"layer_" << ilayer;
288 histoname.str(
""); histoname <<
"DigiOccupancy_Minus_" <<
"layer_" << ilayer;
292 histoname.str(
""); histoname <<
"SUMOfDigiOccupancy_Plus";
294 histoname.str(
""); histoname <<
"SUMOfRecDigiOccupancy_Minus";
int adc(sample_type sample)
get the ADC sample (12 bits)
T getParameter(std::string const &) const
EventNumber_t event() const
std::vector< MonitorElement * > charge_
void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
HcalSubdetector subdet() const
get the subdetector
void analyze(const edm::Event &, const edm::EventSetup &)
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_
std::vector< HGCEEDataFrame >::const_iterator const_iterator
double pedestal(int fCapId) const
get pedestal for capid=0..3
int layer() const
get the layer #
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
int getMaxDepth(const int type) const
int depth() const
get the tower depth
void addDefault(ParameterSetDescription const &psetDescription)
unsigned int layers(bool reco) const
virtual void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const
MonitorElement * book1D(Args &&...args)
HGCalDigiValidation(const edm::ParameterSet &)
std::vector< MonitorElement * > DigiOccupancy_Minus_
int layer() const
get the layer #
void digiValidation(const T1 &detId, const T2 *geom, int, uint16_t, double)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
MonitorElement * MeanDigiOccupancy_Minus_
T const * product() const
edm::EDGetToken digiSource_
std::map< int, int > OccupancyMap_minus_
std::map< int, int > OccupancyMap_plus_
std::string nameDetector_
std::vector< MonitorElement * > ADC_
MonitorElement * MeanDigiOccupancy_Plus_
void fillOccupancyMap(std::map< int, int > &OccupancyMap, int layer)
std::vector< MonitorElement * > DigiOccupancy_Plus_