48 #include "CLHEP/Units/GlobalSystemOfUnits.h" 77 template<
class T1,
class T2>
92 std::vector<MonitorElement*>
ADC_;
102 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity",0)),
116 <<
"HGCal DetectorName given as " <<
nameDetector_ <<
" must be: " 117 <<
"\"HGCalHESiliconSensitive\", \"HGCalHESiliconSensitive\", " 118 <<
"\"HGCalHEScintillatorSensitive\", or \"HCal\"!";
126 desc.
add<
bool>(
"ifHCAL",
false);
129 descriptions.
add(
"hgcalDigiValidationEE",desc);
143 edm::LogWarning(
"HGCalValidation") <<
"Cannot get valid HGCalGeometry " 150 edm::LogWarning(
"HGCalValidation") <<
"Cannot get valid HGCalGeometry " 155 unsigned int ntot(0), nused(0);
160 if (theHGCEEDigiContainers.
isValid()) {
163 << theHGCEEDigiContainers->
size()
167 it !=theHGCEEDigiContainers->
end(); ++it) {
170 int layer = detId.
layer();
172 uint16_t
gain = hgcSample.
toa();
173 uint16_t
adc = hgcSample.
data();
179 edm::LogWarning(
"HGCalValidation") <<
"DigiCollection handle does not " 180 <<
"exist for HGCEE!!!";
187 if (theHGCHEDigiContainers.
isValid()) {
190 << theHGCHEDigiContainers->
size()
194 it !=theHGCHEDigiContainers->
end(); ++it) {
197 int layer = detId.
layer();
199 uint16_t
gain = hgcSample.
toa();
200 uint16_t
adc = hgcSample.
data();
206 edm::LogWarning(
"HGCalValidation") <<
"DigiCollection handle does not " 207 <<
"exist for HGCFH!!!";
213 if (theHGCBHDigiContainers.
isValid()) {
216 << theHGCBHDigiContainers->
size()
220 it !=theHGCBHDigiContainers->
end(); ++it) {
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()
248 it !=theHEDigiContainers->
end(); ++it) {
260 int layer = detId.
depth();
269 edm::LogWarning(
"HGCalValidation") <<
"DigiCollection handle does not " 270 <<
"exist for HGCBH!!!";
277 <<
" with " << ntot <<
" total and " 278 << nused <<
" used digis";
281 template<
class T1,
class T2>
283 int layer, uint16_t
adc,
double charge) {
287 const GlobalPoint& global1 = geom->getPosition(id1);
291 <<
" charge = " <<
charge;
294 hinfo.
x = global1.x();
295 hinfo.
y = global1.y();
296 hinfo.
z = global1.z();
303 <<
" gy = " << hinfo.
y 304 <<
" gz = " << hinfo.
z;
314 if (OccupancyMap.find(layer) != OccupancyMap.end()) OccupancyMap[layer] ++;
315 else OccupancyMap[layer] = 1;
319 int ilayer = hinfo.
layer -1;
322 ADC_.at(ilayer)->Fill(hinfo.
adc);
328 int layer = (*itr).first;
329 int occupancy = (*itr).second;
334 int layer = (*itr).first;
335 int occupancy = (*itr).second;
366 std::ostringstream histoname;
367 for (
int ilayer = 0; ilayer <
layers_; ilayer++ ) {
368 histoname.str(
""); histoname <<
"charge_"<<
"layer_" << ilayer;
369 charge_.push_back(iB.
book1D(histoname.str().c_str(),
"charge_",100,-25,25));
371 histoname.str(
""); histoname <<
"ADC_" <<
"layer_" << ilayer;
372 ADC_.push_back(iB.
book1D(histoname.str().c_str(),
"DigiOccupancy",200,0,1000));
374 histoname.str(
""); histoname <<
"DigiOccupancy_XY_" <<
"layer_" << ilayer;
375 DigiOccupancy_XY_.push_back(iB.
book2D(histoname.str().c_str(),
"DigiOccupancy", 50, -500, 500, 50, -500, 500));
377 histoname.str(
""); histoname <<
"DigiOccupancy_Plus_" <<
"layer_" << ilayer;
379 histoname.str(
""); histoname <<
"DigiOccupancy_Minus_" <<
"layer_" << ilayer;
383 histoname.str(
""); histoname <<
"SUMOfDigiOccupancy_Plus";
385 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
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_
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
unsigned int layers(bool reco) 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_
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
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_
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