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)) {
67 <<
"HGCal DetectorName given as " <<
nameDetector_ <<
" must be: " 68 <<
"\"HGCalHESiliconSensitive\", \"HGCalHESiliconSensitive\", " 69 <<
"\"HGCalHEScintillatorSensitive\", or \"HCal\"!";
95 unsigned int ntot(0), nused(0);
100 if (theHGCEEDigiContainers.
isValid()) {
103 << theHGCEEDigiContainers->
size()
107 it !=theHGCEEDigiContainers->
end(); ++it) {
110 int layer = detId.
layer();
112 uint16_t
gain = hgcSample.
toa();
113 uint16_t
adc = hgcSample.
data();
119 edm::LogWarning(
"HGCalValidation") <<
"HGCEEDigiCollection handle does not exist !!!";
126 if (theHGCHEDigiContainers.
isValid()) {
129 << theHGCHEDigiContainers->
size()
133 it !=theHGCHEDigiContainers->
end(); ++it) {
136 int layer = detId.
layer();
138 uint16_t
gain = hgcSample.
toa();
139 uint16_t
adc = hgcSample.
data();
145 edm::LogWarning(
"HGCalValidation") <<
"HGCHEDigiCollection handle does not exist !!!";
151 if (theHGCBHDigiContainers.
isValid()) {
154 << theHGCBHDigiContainers->
size()
158 it !=theHGCBHDigiContainers->
end(); ++it) {
161 int layer = detId.
depth();
163 uint16_t
gain = hgcSample.
toa();
164 uint16_t
adc = hgcSample.
data();
170 edm::LogWarning(
"HGCalValidation") <<
"HGCBHDigiCollection handle does not exist !!!";
176 if (theHEDigiContainers.
isValid()) {
179 << theHEDigiContainers->
size()
185 it !=theHEDigiContainers->
end(); ++it) {
197 int layer = detId.
depth();
206 edm::LogWarning(
"HGCalValidation") <<
"HGCHEDigiCollection handle does not exist !!!";
213 <<
" with " << ntot <<
" total and " 214 << nused <<
" used digis";
217 template<
class T1,
class T2>
219 int layer, uint16_t
adc,
double charge) {
227 <<
" charge = " <<
charge;
230 hinfo.
x = global1.x();
231 hinfo.
y = global1.y();
232 hinfo.
z = global1.z();
239 <<
" gy = " << hinfo.
y 240 <<
" gz = " << hinfo.
z;
250 if (OccupancyMap.find(layer) != OccupancyMap.end()) OccupancyMap[layer] ++;
251 else OccupancyMap[layer] = 1;
255 int ilayer = hinfo.
layer -1;
258 ADC_.at(ilayer)->Fill(hinfo.
adc);
264 int layer = (*itr).first;
265 int occupancy = (*itr).second;
270 int layer = (*itr).first;
271 int occupancy = (*itr).second;
291 edm::LogInfo(
"HGCalValidation") <<
"current DQM directory: " 302 std::ostringstream histoname;
303 for (
int ilayer = 0; ilayer <
layers_; ilayer++ ) {
304 histoname.str(
""); histoname <<
"charge_"<<
"layer_" << ilayer;
305 charge_.push_back(iB.
book1D(histoname.str().c_str(),
"charge_",100,-25,25));
307 histoname.str(
""); histoname <<
"ADC_" <<
"layer_" << ilayer;
308 ADC_.push_back(iB.
book1D(histoname.str().c_str(),
"DigiOccupancy",200,0,1000));
310 histoname.str(
""); histoname <<
"DigiOccupancy_XY_" <<
"layer_" << ilayer;
311 DigiOccupancy_XY_.push_back(iB.
book2D(histoname.str().c_str(),
"DigiOccupancy", 50, -500, 500, 50, -500, 500));
313 histoname.str(
""); histoname <<
"DigiOccupancy_Plus_" <<
"layer_" << ilayer;
315 histoname.str(
""); histoname <<
"DigiOccupancy_Minus_" <<
"layer_" << ilayer;
319 histoname.str(
""); histoname <<
"SUMOfDigiOccupancy_Plus";
321 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
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< MonitorElement * > charge_
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
HcalSubdetector subdet() const
get the subdetector
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 #
const_iterator begin() const
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
void addDefault(ParameterSetDescription const &psetDescription)
unsigned int layers(bool reco) const
MonitorElement * book1D(Args &&...args)
edm::DataFrame::id_type id() const
HGCalDigiValidation(const edm::ParameterSet &)
std::vector< MonitorElement * > DigiOccupancy_Minus_
const_iterator end() const
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)
int getMaxDepth(const int &type) const
MonitorElement * MeanDigiOccupancy_Minus_
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
edm::EDGetToken digiSource_
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
std::map< int, int > OccupancyMap_minus_
const_iterator end() const
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)
std::vector< MonitorElement * > DigiOccupancy_Plus_
const_iterator begin() const