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 () 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" ) {
105  digiSource_ = consumes<HGCEEDigiCollection>(temp);
106  } else if (nameDetector_ == "HGCalHESiliconSensitive" ||
107  nameDetector_ == "HGCalHEScintillatorSensitive") {
108  digiSource_ = consumes<HGCHEDigiCollection>(temp);
109  } else if (nameDetector_ == "HCal") {
110  if (ifHCAL_) digiSource_ = consumes<QIE11DigiCollection>(temp);
111  else digiSource_ = consumes<HGCBHDigiCollection>(temp);
112  } else {
113  throw cms::Exception("BadHGCDigiSource")
114  << "HGCal DetectorName given as " << nameDetector_ << " must be: "
115  << "\"HGCalHESiliconSensitive\", \"HGCalHESiliconSensitive\", "
116  << "\"HGCalHEScintillatorSensitive\", or \"HCal\"!";
117  }
118 }
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 130 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, edm::EventSetup::get(), edm::Event::getByToken(), HcalDbService::getHcalCalibrations(), HcalDbService::getHcalCoder(), HcalDbService::getHcalShape(), HcalEndcap, QIE11DataFrame::id(), edm::EventBase::id(), ifHCAL_, edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), HGCalDetId::layer(), 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(), and verbosity_.

Referenced by ~HGCalDigiValidation().

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

354  {
355 
356  iB.setCurrentFolder("HGCalDigiV/"+nameDetector_);
357 
358  std::ostringstream histoname;
359  for (int ilayer = 0; ilayer < layers_; ilayer++ ) {
360  histoname.str(""); histoname << "charge_"<< "layer_" << ilayer;
361  charge_.push_back(iB.book1D(histoname.str().c_str(),"charge_",100,-25,25));
362 
363  histoname.str(""); histoname << "ADC_" << "layer_" << ilayer;
364  ADC_.push_back(iB.book1D(histoname.str().c_str(), "DigiOccupancy",200,0,1000));
365 
366  histoname.str(""); histoname << "DigiOccupancy_XY_" << "layer_" << ilayer;
367  DigiOccupancy_XY_.push_back(iB.book2D(histoname.str().c_str(), "DigiOccupancy", 50, -500, 500, 50, -500, 500));
368 
369  histoname.str(""); histoname << "DigiOccupancy_Plus_" << "layer_" << ilayer;
370  DigiOccupancy_Plus_.push_back(iB.book1D(histoname.str().c_str(), "DigiOccupancy +z", 100, 0, 1000));
371  histoname.str(""); histoname << "DigiOccupancy_Minus_" << "layer_" << ilayer;
372  DigiOccupancy_Minus_.push_back(iB.book1D(histoname.str().c_str(), "DigiOccupancy -z", 100, 0, 1000));
373  }
374 
375  histoname.str(""); histoname << "SUMOfDigiOccupancy_Plus";
376  MeanDigiOccupancy_Plus_ = iB.book1D( histoname.str().c_str(), "SUMOfDigiOccupancy_Plus", layers_, -0.5, layers_-0.5);
377  histoname.str(""); histoname << "SUMOfRecDigiOccupancy_Minus";
378  MeanDigiOccupancy_Minus_ = iB.book1D( histoname.str().c_str(), "SUMOfDigiOccupancy_Minus", layers_, -0.5,layers_-0.5);
379 }
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:279
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 276 of file HGCalDigiValidation.cc.

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

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

277  {
278 
279  if (verbosity_>1) edm::LogVerbatim("HGCalValidation") << detId;
280  DetId id1 = DetId(detId.rawId());
281  const GlobalPoint& global1 = geom->getPosition(id1);
282 
283  if (verbosity_>1)
284  edm::LogVerbatim("HGCalValidation") << " adc = " << adc
285  << " charge = " << charge;
286 
287  digiInfo hinfo;
288  hinfo.x = global1.x();
289  hinfo.y = global1.y();
290  hinfo.z = global1.z();
291  hinfo.adc = adc;
292  hinfo.charge = charge; //charges[0];
293  hinfo.layer = layer;
294 
295  if (verbosity_>1)
296  edm::LogVerbatim("HGCalValidation") << "gx = " << hinfo.x
297  << " gy = " << hinfo.y
298  << " gz = " << hinfo.z;
299 
300  fillDigiInfo(hinfo);
301 
302  if (global1.eta() > 0) fillOccupancyMap(OccupancyMap_plus_, layer -1);
303  else fillOccupancyMap(OccupancyMap_minus_, layer -1);
304 
305 }
int adc(sample_type sample)
get the ADC sample (12 bits)
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 332 of file HGCalDigiValidation.cc.

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

Referenced by ~HGCalDigiValidation().

333  {
334  if (nameDetector_ == "HCal") {
336  iSetup.get<HcalRecNumberingRecord>().get( pHRNDC );
337  const HcalDDDRecConstants *hcons = &(*pHRNDC);
338  layers_ = hcons->getMaxDepth(1);
339  } else {
341  iSetup.get<IdealGeometryRecord>().get(nameDetector_, pHGDC);
342  const HGCalDDDConstants & hgcons_ = (*pHGDC);
343  layers_ = hgcons_.layers(true);
344  }
345 
346  if (verbosity_>0)
347  edm::LogVerbatim("HGCalValidation") << "current DQM directory: "
348  << "HGCalDigiV/" << nameDetector_
349  << " layer = "<< layers_;
350 }
unsigned int layers(bool reco) const
int getMaxDepth(const int &type) const
const T & get() const
Definition: EventSetup.h:59
void HGCalDigiValidation::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 120 of file HGCalDigiValidation.cc.

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

Referenced by ~HGCalDigiValidation().

120  {
122  desc.add<std::string>("DetectorName","HGCalEESensitive");
123  desc.add<edm::InputTag>("DigiSource",edm::InputTag("mix","HGCDigisEE"));
124  desc.add<bool>("ifHCAL",false);
125  desc.addUntracked<int>("Verbosity",0);
126  desc.addUntracked<int>("SampleIndx",0);
127  descriptions.add("hgcalDigiValidationEE",desc);
128 }
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 312 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.

312  {
313  int ilayer = hinfo.layer -1;
314  charge_.at(ilayer)->Fill(hinfo.charge);
315  DigiOccupancy_XY_.at(ilayer)->Fill(hinfo.x, hinfo.y);
316  ADC_.at(ilayer)->Fill(hinfo.adc);
317 }
std::vector< MonitorElement * > charge_
std::vector< MonitorElement * > DigiOccupancy_XY_
std::vector< MonitorElement * > ADC_
void HGCalDigiValidation::fillDigiInfo ( )
private

Definition at line 319 of file HGCalDigiValidation.cc.

References DigiOccupancy_Minus_, DigiOccupancy_Plus_, OccupancyMap_minus_, and OccupancyMap_plus_.

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

319  {
320  for (const auto & itr : OccupancyMap_plus_) {
321  int layer = itr.first;
322  int occupancy = itr.second;
323  DigiOccupancy_Plus_.at(layer)->Fill(occupancy);
324  }
325  for (const auto & itr : OccupancyMap_minus_) {
326  int layer = itr.first;
327  int occupancy = itr.second;
328  DigiOccupancy_Minus_.at(layer)->Fill(occupancy);
329  }
330 }
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 307 of file HGCalDigiValidation.cc.

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

307  {
308  if (OccupancyMap.find(layer) != OccupancyMap.end()) OccupancyMap[layer] ++;
309  else OccupancyMap[layer] = 1;
310 }

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(), 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().