CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
HGCalDigiValidation Class Reference
Inheritance diagram for HGCalDigiValidation:
DQMEDAnalyzer edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  digiInfo
 

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
 HGCalDigiValidation (const edm::ParameterSet &)
 
 ~HGCalDigiValidation () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

template<class T1 , class T2 >
void digiValidation (const T1 &detId, const T2 *geom, int, uint16_t, double)
 
void fillDigiInfo (digiInfo &hinfo)
 
void fillDigiInfo ()
 
void fillOccupancyMap (std::map< int, int > &OccupancyMap, int layer)
 

Private Attributes

std::vector< MonitorElement * > ADC_
 
std::vector< MonitorElement * > charge_
 
std::vector< MonitorElement * > DigiOccupancy_Minus_
 
std::vector< MonitorElement * > DigiOccupancy_Plus_
 
std::vector< MonitorElement * > DigiOccupancy_XY_
 
edm::EDGetToken digiSource_
 
bool ifHCAL_
 
int layers_
 
MonitorElementMeanDigiOccupancy_Minus_
 
MonitorElementMeanDigiOccupancy_Plus_
 
std::string nameDetector_
 
std::map< int, int > OccupancyMap_minus_
 
std::map< int, int > OccupancyMap_plus_
 
int SampleIndx_
 
int verbosity_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 51 of file HGCalDigiValidation.cc.

Constructor & Destructor Documentation

HGCalDigiValidation::HGCalDigiValidation ( const edm::ParameterSet iConfig)
explicit

Definition at line 97 of file HGCalDigiValidation.cc.

References digiSource_, Exception, edm::ParameterSet::getParameter(), ifHCAL_, nameDetector_, and groupFilesInBlocks::temp.

97  :
98  nameDetector_(iConfig.getParameter<std::string>("DetectorName")),
99  ifHCAL_(iConfig.getParameter<bool>("ifHCAL")),
100  verbosity_(iConfig.getUntrackedParameter<int>("Verbosity",0)),
101  SampleIndx_(iConfig.getUntrackedParameter<int>("SampleIndx",5)) {
102 
103  auto temp = iConfig.getParameter<edm::InputTag>("DigiSource");
104  if (nameDetector_ == "HGCalEESensitive" || nameDetector_ == "HGCalHESiliconSensitive" || nameDetector_ == "HGCalHEScintillatorSensitive") {
105  digiSource_ = consumes<HGCalDigiCollection>(temp);
106  } else if (nameDetector_ == "HCal") {
107  if (ifHCAL_) digiSource_ = consumes<QIE11DigiCollection>(temp);
108  else digiSource_ = consumes<HGCalDigiCollection>(temp);
109  } else {
110  throw cms::Exception("BadHGCDigiSource")
111  << "HGCal DetectorName given as " << nameDetector_ << " must be: "
112  << "\"HGCalEESensitive\", \"HGCalHESiliconSensitive\", "
113  << "\"HGCalHEScintillatorSensitive\", or \"HCal\"!";
114  }
115 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetToken digiSource_
HGCalDigiValidation::~HGCalDigiValidation ( )
inlineoverride

Member Function Documentation

void HGCalDigiValidation::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 127 of file HGCalDigiValidation.cc.

References ecalMGPA::adc(), HcalCoderDb::adc2fC(), AlignmentProducer_cff::calibrations, ALCARECOTkAlJpsiMuMu_cff::charge, HGCSample::data(), HcalDetId::depth(), digiSource_, digiValidation(), edm::EventID::event(), fillDigiInfo(), muonCSCDigis_cfi::gain, relativeConstraints::geom, motionPolicyChamber::geom0, geometryDiff::geom1, HGCalTopology::geomMode(), edm::EventSetup::get(), edm::Event::getByToken(), HcalDbService::getHcalCalibrations(), HcalDbService::getHcalCoder(), HcalDbService::getHcalShape(), HcalEndcap, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, QIE11DataFrame::id(), edm::EventBase::id(), ifHCAL_, edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), HGCScintillatorDetId::layer(), HGCalDetId::layer(), HGCSiliconDetId::layer(), ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, nameDetector_, OccupancyMap_minus_, OccupancyMap_plus_, HcalCalibrations::pedestal(), edm::Handle< T >::product(), edm::ESHandle< T >::product(), SampleIndx_, edm::SortedCollection< T, SORT >::size(), edm::DataFrameContainer::size(), HcalDetId::subdet(), HGCSample::toa(), HGCalGeometry::topology(), HGCalGeometryMode::Trapezoid, and verbosity_.

Referenced by ~HGCalDigiValidation().

128  {
129  OccupancyMap_plus_.clear();
130  OccupancyMap_minus_.clear();
131 
132  const HGCalGeometry* geom0(nullptr);
133  const CaloGeometry* geom1(nullptr);
134  int geomType(0);
135  if (nameDetector_ == "HCal") {
137  iSetup.get<CaloGeometryRecord>().get(geom);
138  if (!geom.isValid())
139  edm::LogVerbatim("HGCalValidation") << "HGCalDigiValidation: Cannot get valid "
140  << "HGCalGeometry Object for " << nameDetector_;
141  geom1 = geom.product();
142  } else {
144  iSetup.get<IdealGeometryRecord>().get(nameDetector_, geom);
145  if (!geom.isValid())
146  edm::LogVerbatim("HGCalValidation") << "HGCalDigiValidation: Cannot get valid "
147  << "HGCalGeometry Object for " << nameDetector_;
148  geom0 = geom.product();
149  HGCalGeometryMode::GeometryMode mode = geom0->topology().geomMode();
150  if ((mode == HGCalGeometryMode::Hexagon8) ||
151  (mode == HGCalGeometryMode::Hexagon8Full)) geomType = 1;
152  else if (mode == HGCalGeometryMode::Trapezoid) geomType = 2;
153  }
154 
155  unsigned int ntot(0), nused(0);
156  if (nameDetector_ == "HGCalEESensitive") {
157  //HGCalEE
158  edm::Handle<HGCalDigiCollection> theHGCEEDigiContainers;
159  iEvent.getByToken(digiSource_, theHGCEEDigiContainers);
160  if (theHGCEEDigiContainers.isValid()) {
161  if (verbosity_>0)
162  edm::LogVerbatim("HGCalValidation") << nameDetector_ << " with "
163  << theHGCEEDigiContainers->size()
164  << " element(s)";
165 
166  for (const auto & it: *(theHGCEEDigiContainers.product())) {
167  ntot++; nused++;
168  DetId detId = it.id();
169  int layer = ((geomType == 0) ? HGCalDetId(detId).layer() :
170  HGCSiliconDetId(detId).layer());
171  const HGCSample& hgcSample = it.sample(SampleIndx_);
172  uint16_t gain = hgcSample.toa();
173  uint16_t adc = hgcSample.data();
174  double charge = adc*gain;
175  digiValidation(detId, geom0, layer, adc, charge);
176  }
177  fillDigiInfo();
178  } else {
179  edm::LogVerbatim("HGCalValidation") << "DigiCollection handle does not "
180  << "exist for HGCEE!!!";
181  }
182  } else if ((nameDetector_ == "HGCalHESiliconSensitive") ||
183  (nameDetector_ == "HGCalHEScintillatorSensitive")) {
184  //HGCalHE
185  edm::Handle<HGCalDigiCollection> theHGCHEDigiContainers;
186  iEvent.getByToken(digiSource_, theHGCHEDigiContainers);
187  if (theHGCHEDigiContainers.isValid()) {
188  if (verbosity_>0)
189  edm::LogVerbatim("HGCalValidation") << nameDetector_ << " with "
190  << theHGCHEDigiContainers->size()
191  << " element(s)";
192 
193  for (const auto & it: *(theHGCHEDigiContainers.product())) {
194  ntot++; nused++;
195  DetId detId = it.id();
196  int layer = ((geomType == 0) ? HGCalDetId(detId).layer() :
197  ((geomType == 1) ? HGCSiliconDetId(detId).layer() :
198  HGCScintillatorDetId(detId).layer()));
199  const HGCSample& hgcSample = it.sample(SampleIndx_);
200  uint16_t gain = hgcSample.toa();
201  uint16_t adc = hgcSample.data();
202  double charge = adc*gain;
203  digiValidation(detId, geom0, layer, adc, charge);
204  }
205  fillDigiInfo();
206  } else {
207  edm::LogVerbatim("HGCalValidation") << "DigiCollection handle does not "
208  << "exist for HGCFH!!!";
209  }
210  } else if ((nameDetector_ == "HCal") && (!ifHCAL_)) {
211  //HGCalBH
212  edm::Handle<HGCalDigiCollection> theHGCBHDigiContainers;
213  iEvent.getByToken(digiSource_, theHGCBHDigiContainers);
214  if (theHGCBHDigiContainers.isValid()) {
215  if (verbosity_>0)
216  edm::LogVerbatim("HGCalValidation") << nameDetector_ << " with "
217  << theHGCBHDigiContainers->size()
218  << " element(s)";
219 
220  for (const auto & it: *(theHGCBHDigiContainers.product())) {
221  ntot++; nused++;
222  HcalDetId detId = it.id();
223  int layer = detId.depth();
224  const HGCSample& hgcSample = it.sample(SampleIndx_);
225  uint16_t gain = hgcSample.toa();
226  uint16_t adc = hgcSample.data();
227  double charge = adc*gain;
228  digiValidation(detId, geom1, layer, adc, charge);
229  }
230  fillDigiInfo();
231  } else {
232  edm::LogWarning("HGCalValidation") << "DigiCollection handle does not "
233  << "exist for HGCBH!!!";
234  }
235  } else if (nameDetector_ == "HCal") {
236  //HE
237  edm::Handle<QIE11DigiCollection> theHEDigiContainers;
238  iEvent.getByToken(digiSource_, theHEDigiContainers);
239  if (theHEDigiContainers.isValid()) {
240  if (verbosity_>0)
241  edm::LogVerbatim("HGCalValidation") << nameDetector_ << " with "
242  << theHEDigiContainers->size()
243  << " element(s)";
244  edm::ESHandle<HcalDbService> conditions;
245  iSetup.get<HcalDbRecord > ().get(conditions);
246 
247  for (const auto & it: *(theHEDigiContainers.product())) {
248  QIE11DataFrame df(it);
249  HcalDetId detId = (df.id());
250  ntot++;
251  if (detId.subdet() == HcalEndcap) {
252  nused++;
254  const HcalQIECoder* channelCoder = conditions->getHcalCoder(detId);
255  const HcalQIEShape* shape = conditions->getHcalShape(channelCoder);
256  HcalCoderDb coder(*channelCoder, *shape);
257  CaloSamples tool;
258  coder.adc2fC(df, tool);
259  int layer = detId.depth();
260  uint16_t adc = (df)[SampleIndx_].adc();
261  int capid = (df)[SampleIndx_].capid();
262  double charge = (tool[SampleIndx_] - calibrations.pedestal(capid));
263  digiValidation(detId, geom1, layer, adc, charge);
264  }
265  }
266  fillDigiInfo();
267  } else {
268  edm::LogWarning("HGCalValidation") << "DigiCollection handle does not "
269  << "exist for HGCBH!!!";
270  }
271  } else {
272  edm::LogWarning("HGCalValidation") << "invalid detector name !! "
273  << nameDetector_;
274  }
275  edm::LogVerbatim("HGCalValidation") << "Event " << iEvent.id().event()
276  << " with " << ntot << " total and "
277  << nused << " used digis";
278 }
int adc(sample_type sample)
get the ADC sample (12 bits)
EventNumber_t event() const
Definition: EventID.h:41
uint32_t data() const
Definition: HGCSample.h:62
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:142
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
wrapper for a data word
Definition: HGCSample.h:13
int depth() const
get the tower depth
Definition: HcalDetId.h:162
int layer() const
get the layer #
bool isValid() const
Definition: HandleBase.h:74
Definition: DetId.h:18
constexpr double pedestal(int fCapId) const
get pedestal for capid=0..3
void digiValidation(const T1 &detId, const T2 *geom, int, uint16_t, double)
T const * product() const
Definition: Handle.h:81
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
edm::EDGetToken digiSource_
uint32_t toa() const
Definition: HGCSample.h:61
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_
edm::EventID id() const
Definition: EventBase.h:60
size_type size() const
T get() const
Definition: EventSetup.h:63
bool isValid() const
Definition: ESHandle.h:47
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
T const * product() const
Definition: ESHandle.h:86
int layer() const
get the layer #
Definition: HGCalDetId.h:48
void HGCalDigiValidation::bookHistograms ( DQMStore::IBooker iB,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 359 of file HGCalDigiValidation.cc.

References ADC_, DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), charge_, DEFINE_FWK_MODULE, DigiOccupancy_Minus_, DigiOccupancy_Plus_, DigiOccupancy_XY_, layers_, MeanDigiOccupancy_Minus_, MeanDigiOccupancy_Plus_, nameDetector_, and DQMStore::IBooker::setCurrentFolder().

Referenced by ~HGCalDigiValidation().

361  {
362 
363  iB.setCurrentFolder("HGCAL/HGCalDigisV/"+nameDetector_);
364 
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));
369 
370  histoname.str(""); histoname << "ADC_" << "layer_" << ilayer;
371  ADC_.push_back(iB.book1D(histoname.str().c_str(), "DigiOccupancy",200,0,1000));
372 
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));
375 
376  histoname.str(""); histoname << "DigiOccupancy_Plus_" << "layer_" << ilayer;
377  DigiOccupancy_Plus_.push_back(iB.book1D(histoname.str().c_str(), "DigiOccupancy +z", 100, 0, 1000));
378  histoname.str(""); histoname << "DigiOccupancy_Minus_" << "layer_" << ilayer;
379  DigiOccupancy_Minus_.push_back(iB.book1D(histoname.str().c_str(), "DigiOccupancy -z", 100, 0, 1000));
380  }
381 
382  histoname.str(""); histoname << "SUMOfDigiOccupancy_Plus";
383  MeanDigiOccupancy_Plus_ = iB.book1D( histoname.str().c_str(), "SUMOfDigiOccupancy_Plus", layers_, -0.5, layers_-0.5);
384  histoname.str(""); histoname << "SUMOfRecDigiOccupancy_Minus";
385  MeanDigiOccupancy_Minus_ = iB.book1D( histoname.str().c_str(), "SUMOfDigiOccupancy_Minus", layers_, -0.5,layers_-0.5);
386 }
std::vector< MonitorElement * > charge_
std::vector< MonitorElement * > DigiOccupancy_XY_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
std::vector< MonitorElement * > DigiOccupancy_Minus_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
MonitorElement * MeanDigiOccupancy_Minus_
std::vector< MonitorElement * > ADC_
MonitorElement * MeanDigiOccupancy_Plus_
std::vector< MonitorElement * > DigiOccupancy_Plus_
template<class T1 , class T2 >
void HGCalDigiValidation::digiValidation ( const T1 &  detId,
const T2 *  geom,
int  layer,
uint16_t  adc,
double  charge 
)
private

Definition at line 281 of file HGCalDigiValidation.cc.

References ecalMGPA::adc(), HGCalDigiValidation::digiInfo::adc, ALCARECOTkAlJpsiMuMu_cff::charge, HGCalDigiValidation::digiInfo::charge, TauDecayModes::dec, fillDigiInfo(), fillOccupancyMap(), globals_cff::id1, HGCalDigiValidation::digiInfo::layer, layers_, min(), OccupancyMap_minus_, OccupancyMap_plus_, verbosity_, HGCalDigiValidation::digiInfo::x, HGCalDigiValidation::digiInfo::y, and HGCalDigiValidation::digiInfo::z.

Referenced by analyze(), and ~HGCalDigiValidation().

282  {
283 
284  if (verbosity_>1) edm::LogVerbatim("HGCalValidation") << std::hex
285  << detId.rawId()
286  << std::dec;
287  DetId id1 = DetId(detId.rawId());
288  const GlobalPoint& global1 = geom->getPosition(id1);
289 
290  if (verbosity_>1)
291  edm::LogVerbatim("HGCalValidation") << " adc = " << adc
292  << " charge = " << charge;
293 
294  digiInfo hinfo;
295  hinfo.x = global1.x();
296  hinfo.y = global1.y();
297  hinfo.z = global1.z();
298  hinfo.adc = adc;
299  hinfo.charge = charge; //charges[0];
300  hinfo.layer = std::min(layer,layers_);
301 
302  if (verbosity_>1)
303  edm::LogVerbatim("HGCalValidation") << "gx = " << hinfo.x
304  << " gy = " << hinfo.y
305  << " gz = " << hinfo.z;
306 
307  fillDigiInfo(hinfo);
308 
309  if (global1.eta() > 0) fillOccupancyMap(OccupancyMap_plus_, hinfo.layer -1);
310  else fillOccupancyMap(OccupancyMap_minus_, hinfo.layer -1);
311 
312 }
int adc(sample_type sample)
get the ADC sample (12 bits)
T min(T a, T b)
Definition: MathUtil.h:58
Definition: DetId.h:18
std::map< int, int > OccupancyMap_minus_
std::map< int, int > OccupancyMap_plus_
void fillOccupancyMap(std::map< int, int > &OccupancyMap, int layer)
void HGCalDigiValidation::dqmBeginRun ( const edm::Run ,
const edm::EventSetup iSetup 
)
override

Definition at line 339 of file HGCalDigiValidation.cc.

References edm::EventSetup::get(), HcalDDDRecConstants::getMaxDepth(), HGCalDDDConstants::layers(), layers_, nameDetector_, and verbosity_.

Referenced by ~HGCalDigiValidation().

340  {
341  if (nameDetector_ == "HCal") {
343  iSetup.get<HcalRecNumberingRecord>().get( pHRNDC );
344  const HcalDDDRecConstants *hcons = &(*pHRNDC);
345  layers_ = hcons->getMaxDepth(1);
346  } else {
348  iSetup.get<IdealGeometryRecord>().get(nameDetector_, pHGDC);
349  const HGCalDDDConstants & hgcons_ = (*pHGDC);
350  layers_ = hgcons_.layers(true);
351  }
352 
353  if (verbosity_>0)
354  edm::LogVerbatim("HGCalValidation") << "current DQM directory: "
355  << "HGCAL/HGCalDigisV/" << nameDetector_
356  << " layer = "<< layers_;
357 }
unsigned int layers(bool reco) const
int getMaxDepth(const int &type) const
T get() const
Definition: EventSetup.h:63
void HGCalDigiValidation::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 117 of file HGCalDigiValidation.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ~HGCalDigiValidation().

117  {
119  desc.add<std::string>("DetectorName","HGCalEESensitive");
120  desc.add<edm::InputTag>("DigiSource",edm::InputTag("hgcalDigis","EE"));
121  desc.add<bool>("ifHCAL",false);
122  desc.addUntracked<int>("Verbosity",0);
123  desc.addUntracked<int>("SampleIndx",0);
124  descriptions.add("hgcalDigiValidationEEDefault",desc);
125 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HGCalDigiValidation::fillDigiInfo ( digiInfo hinfo)
private

Definition at line 319 of file HGCalDigiValidation.cc.

References HGCalDigiValidation::digiInfo::adc, ADC_, HGCalDigiValidation::digiInfo::charge, charge_, DigiOccupancy_XY_, HGCalDigiValidation::digiInfo::layer, HGCalDigiValidation::digiInfo::x, and HGCalDigiValidation::digiInfo::y.

319  {
320  int ilayer = hinfo.layer -1;
321  charge_.at(ilayer)->Fill(hinfo.charge);
322  DigiOccupancy_XY_.at(ilayer)->Fill(hinfo.x, hinfo.y);
323  ADC_.at(ilayer)->Fill(hinfo.adc);
324 }
std::vector< MonitorElement * > charge_
std::vector< MonitorElement * > DigiOccupancy_XY_
std::vector< MonitorElement * > ADC_
void HGCalDigiValidation::fillDigiInfo ( )
private

Definition at line 326 of file HGCalDigiValidation.cc.

References DigiOccupancy_Minus_, DigiOccupancy_Plus_, OccupancyMap_minus_, and OccupancyMap_plus_.

Referenced by analyze(), digiValidation(), and ~HGCalDigiValidation().

326  {
327  for (const auto & itr : OccupancyMap_plus_) {
328  int layer = itr.first;
329  int occupancy = itr.second;
330  DigiOccupancy_Plus_.at(layer)->Fill(occupancy);
331  }
332  for (const auto & itr : OccupancyMap_minus_) {
333  int layer = itr.first;
334  int occupancy = itr.second;
335  DigiOccupancy_Minus_.at(layer)->Fill(occupancy);
336  }
337 }
std::vector< MonitorElement * > DigiOccupancy_Minus_
std::map< int, int > OccupancyMap_minus_
std::map< int, int > OccupancyMap_plus_
std::vector< MonitorElement * > DigiOccupancy_Plus_
void HGCalDigiValidation::fillOccupancyMap ( std::map< int, int > &  OccupancyMap,
int  layer 
)
private

Definition at line 314 of file HGCalDigiValidation.cc.

Referenced by digiValidation(), and ~HGCalDigiValidation().

314  {
315  if (OccupancyMap.find(layer) != OccupancyMap.end()) OccupancyMap[layer] ++;
316  else OccupancyMap[layer] = 1;
317 }

Member Data Documentation

std::vector<MonitorElement*> HGCalDigiValidation::ADC_
private

Definition at line 90 of file HGCalDigiValidation.cc.

Referenced by bookHistograms(), and fillDigiInfo().

std::vector<MonitorElement*> HGCalDigiValidation::charge_
private

Definition at line 88 of file HGCalDigiValidation.cc.

Referenced by bookHistograms(), and fillDigiInfo().

std::vector<MonitorElement*> HGCalDigiValidation::DigiOccupancy_Minus_
private

Definition at line 92 of file HGCalDigiValidation.cc.

Referenced by bookHistograms(), and fillDigiInfo().

std::vector<MonitorElement*> HGCalDigiValidation::DigiOccupancy_Plus_
private

Definition at line 91 of file HGCalDigiValidation.cc.

Referenced by bookHistograms(), and fillDigiInfo().

std::vector<MonitorElement*> HGCalDigiValidation::DigiOccupancy_XY_
private

Definition at line 89 of file HGCalDigiValidation.cc.

Referenced by bookHistograms(), and fillDigiInfo().

edm::EDGetToken HGCalDigiValidation::digiSource_
private

Definition at line 80 of file HGCalDigiValidation.cc.

Referenced by analyze(), and HGCalDigiValidation().

bool HGCalDigiValidation::ifHCAL_
private

Definition at line 81 of file HGCalDigiValidation.cc.

Referenced by analyze(), and HGCalDigiValidation().

int HGCalDigiValidation::layers_
private

Definition at line 83 of file HGCalDigiValidation.cc.

Referenced by bookHistograms(), digiValidation(), and dqmBeginRun().

MonitorElement* HGCalDigiValidation::MeanDigiOccupancy_Minus_
private

Definition at line 94 of file HGCalDigiValidation.cc.

Referenced by bookHistograms().

MonitorElement* HGCalDigiValidation::MeanDigiOccupancy_Plus_
private

Definition at line 93 of file HGCalDigiValidation.cc.

Referenced by bookHistograms().

std::string HGCalDigiValidation::nameDetector_
private

Definition at line 79 of file HGCalDigiValidation.cc.

Referenced by analyze(), bookHistograms(), dqmBeginRun(), and HGCalDigiValidation().

std::map<int, int> HGCalDigiValidation::OccupancyMap_minus_
private

Definition at line 86 of file HGCalDigiValidation.cc.

Referenced by analyze(), digiValidation(), and fillDigiInfo().

std::map<int, int> HGCalDigiValidation::OccupancyMap_plus_
private

Definition at line 85 of file HGCalDigiValidation.cc.

Referenced by analyze(), digiValidation(), and fillDigiInfo().

int HGCalDigiValidation::SampleIndx_
private

Definition at line 82 of file HGCalDigiValidation.cc.

Referenced by analyze().

int HGCalDigiValidation::verbosity_
private

Definition at line 82 of file HGCalDigiValidation.cc.

Referenced by analyze(), digiValidation(), and dqmBeginRun().