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::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

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 beginRun (edm::Run const &, edm::EventSetup const &) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () 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 DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
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::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- 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)
 

Detailed Description

Definition at line 53 of file HGCalDigiValidation.cc.

Constructor & Destructor Documentation

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

Definition at line 99 of file HGCalDigiValidation.cc.

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

99  :
100  nameDetector_(iConfig.getParameter<std::string>("DetectorName")),
101  ifHCAL_(iConfig.getParameter<bool>("ifHCAL")),
102  verbosity_(iConfig.getUntrackedParameter<int>("Verbosity",0)),
103  SampleIndx_(iConfig.getUntrackedParameter<int>("SampleIndx",5)) {
104 
105  auto temp = iConfig.getParameter<edm::InputTag>("DigiSource");
106  if (nameDetector_ == "HGCalEESensitive" ) {
107  digiSource_ = consumes<HGCEEDigiCollection>(temp);
108  } else if (nameDetector_ == "HGCalHESiliconSensitive" ||
109  nameDetector_ == "HGCalHEScintillatorSensitive") {
110  digiSource_ = consumes<HGCHEDigiCollection>(temp);
111  } else if (nameDetector_ == "HCal") {
112  if (ifHCAL_) digiSource_ = consumes<QIE11DigiCollection>(temp);
113  else digiSource_ = consumes<HGCBHDigiCollection>(temp);
114  } else {
115  throw cms::Exception("BadHGCDigiSource")
116  << "HGCal DetectorName given as " << nameDetector_ << " must be: "
117  << "\"HGCalHESiliconSensitive\", \"HGCalHESiliconSensitive\", "
118  << "\"HGCalHEScintillatorSensitive\", or \"HCal\"!";
119  }
120 }
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 132 of file HGCalDigiValidation.cc.

References ecalMGPA::adc(), HcalCoderDb::adc2fC(), edm::SortedCollection< T, SORT >::begin(), edm::DataFrameContainer::begin(), AlignmentProducer_cff::calibrations, ALCARECOTkAlJpsiMuMu_cff::charge, HGCSample::data(), HcalDetId::depth(), digiSource_, digiValidation(), edm::SortedCollection< T, SORT >::end(), edm::DataFrameContainer::end(), 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(), HGCEEDetId::layer(), HGCHEDetId::layer(), nameDetector_, OccupancyMap_minus_, OccupancyMap_plus_, HcalCalibrations::pedestal(), edm::ESHandle< T >::product(), SampleIndx_, edm::SortedCollection< T, SORT >::size(), edm::DataFrameContainer::size(), HcalDetId::subdet(), HGCSample::toa(), and verbosity_.

Referenced by ~HGCalDigiValidation().

133  {
134  OccupancyMap_plus_.clear();
135  OccupancyMap_minus_.clear();
136 
137  const HGCalGeometry* geom0(nullptr);
138  const CaloGeometry* geom1(nullptr);
139  if (nameDetector_ == "HCal") {
141  iSetup.get<CaloGeometryRecord>().get(geom);
142  if (!geom.isValid())
143  edm::LogWarning("HGCalValidation") << "Cannot get valid HGCalGeometry "
144  << "Object for " << nameDetector_;
145  geom1 = geom.product();
146  } else {
148  iSetup.get<IdealGeometryRecord>().get(nameDetector_, geom);
149  if (!geom.isValid())
150  edm::LogWarning("HGCalValidation") << "Cannot get valid HGCalGeometry "
151  << "Object for " << nameDetector_;
152  geom0 = geom.product();
153  }
154 
155  unsigned int ntot(0), nused(0);
156  if (nameDetector_ == "HGCalEESensitive") {
157  //HGCalEE
158  edm::Handle<HGCEEDigiCollection> 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 (HGCEEDigiCollection::const_iterator it =theHGCEEDigiContainers->begin();
167  it !=theHGCEEDigiContainers->end(); ++it) {
168  ntot++; nused++;
169  HGCEEDetId detId = (it->id());
170  int layer = detId.layer();
171  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::LogWarning("HGCalValidation") << "DigiCollection handle does not "
180  << "exist for HGCEE!!!";
181  }
182  } else if ((nameDetector_ == "HGCalHESiliconSensitive") ||
183  (nameDetector_ == "HGCalHEScintillatorSensitive")) {
184  //HGCalHE
185  edm::Handle<HGCHEDigiCollection> 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 (HGCHEDigiCollection::const_iterator it =theHGCHEDigiContainers->begin();
194  it !=theHGCHEDigiContainers->end(); ++it) {
195  ntot++; nused++;
196  HGCHEDetId detId = (it->id());
197  int layer = detId.layer();
198  HGCSample hgcSample = it->sample(SampleIndx_);
199  uint16_t gain = hgcSample.toa();
200  uint16_t adc = hgcSample.data();
201  double charge = adc*gain;
202  digiValidation(detId, geom0, layer, adc, charge);
203  }
204  fillDigiInfo();
205  } else {
206  edm::LogWarning("HGCalValidation") << "DigiCollection handle does not "
207  << "exist for HGCFH!!!";
208  }
209  } else if ((nameDetector_ == "HCal") && (!ifHCAL_)) {
210  //HGCalBH
211  edm::Handle<HGCBHDigiCollection> theHGCBHDigiContainers;
212  iEvent.getByToken(digiSource_, theHGCBHDigiContainers);
213  if (theHGCBHDigiContainers.isValid()) {
214  if (verbosity_>0)
215  edm::LogVerbatim("HGCalValidation") << nameDetector_ << " with "
216  << theHGCBHDigiContainers->size()
217  << " element(s)";
218 
219  for (HGCBHDigiCollection::const_iterator it =theHGCBHDigiContainers->begin();
220  it !=theHGCBHDigiContainers->end(); ++it) {
221  ntot++; nused++;
222  HcalDetId detId = (it->id());
223  int layer = detId.depth();
224  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 (QIE11DigiCollection::const_iterator it =theHEDigiContainers->begin();
248  it !=theHEDigiContainers->end(); ++it) {
249  QIE11DataFrame df(*it);
250  HcalDetId detId = (df.id());
251  ntot++;
252  if (detId.subdet() == HcalEndcap) {
253  nused++;
255  const HcalQIECoder* channelCoder = conditions->getHcalCoder(detId);
256  const HcalQIEShape* shape = conditions->getHcalShape(channelCoder);
257  HcalCoderDb coder(*channelCoder, *shape);
258  CaloSamples tool;
259  coder.adc2fC(df, tool);
260  int layer = detId.depth();
261  uint16_t adc = (df)[SampleIndx_].adc();
262  int capid = (df)[SampleIndx_].capid();
263  double charge = (tool[SampleIndx_] - calibrations.pedestal(capid));
264  digiValidation(detId, geom1, layer, adc, charge);
265  }
266  }
267  fillDigiInfo();
268  } else {
269  edm::LogWarning("HGCalValidation") << "DigiCollection handle does not "
270  << "exist for HGCBH!!!";
271  }
272  } else {
273  edm::LogWarning("HGCalValidation") << "invalid detector name !! "
274  << nameDetector_;
275  }
276  edm::LogVerbatim("HGCalValidation") << "Event " << iEvent.id().event()
277  << " with " << ntot << " total and "
278  << nused << " used digis";
279 }
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
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
std::vector< HGCEEDataFrame >::const_iterator const_iterator
double pedestal(int fCapId) const
get pedestal for capid=0..3
int layer() const
get the layer #
Definition: HGCHEDetId.h:50
const_iterator begin() const
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
const_iterator end() const
int layer() const
get the layer #
Definition: HGCEEDetId.h:49
void digiValidation(const T1 &detId, const T2 *geom, int, uint16_t, double)
const T & get() const
Definition: EventSetup.h:58
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_
const_iterator end() const
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
const_iterator begin() const
void HGCalDigiValidation::bookHistograms ( DQMStore::IBooker iB,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 360 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().

362  {
363 
364  iB.setCurrentFolder("HGCalDigiV/"+nameDetector_);
365 
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));
370 
371  histoname.str(""); histoname << "ADC_" << "layer_" << ilayer;
372  ADC_.push_back(iB.book1D(histoname.str().c_str(), "DigiOccupancy",200,0,1000));
373 
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));
376 
377  histoname.str(""); histoname << "DigiOccupancy_Plus_" << "layer_" << ilayer;
378  DigiOccupancy_Plus_.push_back(iB.book1D(histoname.str().c_str(), "DigiOccupancy +z", 100, 0, 1000));
379  histoname.str(""); histoname << "DigiOccupancy_Minus_" << "layer_" << ilayer;
380  DigiOccupancy_Minus_.push_back(iB.book1D(histoname.str().c_str(), "DigiOccupancy -z", 100, 0, 1000));
381  }
382 
383  histoname.str(""); histoname << "SUMOfDigiOccupancy_Plus";
384  MeanDigiOccupancy_Plus_ = iB.book1D( histoname.str().c_str(), "SUMOfDigiOccupancy_Plus", layers_, -0.5, layers_-0.5);
385  histoname.str(""); histoname << "SUMOfRecDigiOccupancy_Minus";
386  MeanDigiOccupancy_Minus_ = iB.book1D( histoname.str().c_str(), "SUMOfDigiOccupancy_Minus", layers_, -0.5,layers_-0.5);
387 }
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 282 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().

283  {
284 
285  if (verbosity_>1) edm::LogVerbatim("HGCalValidation") << detId;
286  DetId id1 = DetId(detId.rawId());
287  const GlobalPoint& global1 = geom->getPosition(id1);
288 
289  if (verbosity_>1)
290  edm::LogVerbatim("HGCalValidation") << " adc = " << adc
291  << " charge = " << charge;
292 
293  digiInfo hinfo;
294  hinfo.x = global1.x();
295  hinfo.y = global1.y();
296  hinfo.z = global1.z();
297  hinfo.adc = adc;
298  hinfo.charge = charge; //charges[0];
299  hinfo.layer = layer;
300 
301  if (verbosity_>1)
302  edm::LogVerbatim("HGCalValidation") << "gx = " << hinfo.x
303  << " gy = " << hinfo.y
304  << " gz = " << hinfo.z;
305 
306  fillDigiInfo(hinfo);
307 
308  if (global1.eta() > 0) fillOccupancyMap(OccupancyMap_plus_, layer -1);
309  else fillOccupancyMap(OccupancyMap_minus_, layer -1);
310 
311 }
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 340 of file HGCalDigiValidation.cc.

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

Referenced by ~HGCalDigiValidation().

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

Definition at line 122 of file HGCalDigiValidation.cc.

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

Referenced by ~HGCalDigiValidation().

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

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

Definition at line 325 of file HGCalDigiValidation.cc.

References DigiOccupancy_Minus_, DigiOccupancy_Plus_, OccupancyMap_minus_, and OccupancyMap_plus_.

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

325  {
326  for (auto itr = OccupancyMap_plus_.begin();
327  itr != OccupancyMap_plus_.end(); ++itr) {
328  int layer = (*itr).first;
329  int occupancy = (*itr).second;
330  DigiOccupancy_Plus_.at(layer)->Fill(occupancy);
331  }
332  for (auto itr = OccupancyMap_minus_.begin();
333  itr != OccupancyMap_minus_.end(); ++itr) {
334  int layer = (*itr).first;
335  int occupancy = (*itr).second;
336  DigiOccupancy_Minus_.at(layer)->Fill(occupancy);
337  }
338 }
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 313 of file HGCalDigiValidation.cc.

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

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

Member Data Documentation

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

Definition at line 92 of file HGCalDigiValidation.cc.

Referenced by bookHistograms(), and fillDigiInfo().

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

Definition at line 90 of file HGCalDigiValidation.cc.

Referenced by bookHistograms(), and fillDigiInfo().

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

Definition at line 94 of file HGCalDigiValidation.cc.

Referenced by bookHistograms(), and fillDigiInfo().

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

Definition at line 93 of file HGCalDigiValidation.cc.

Referenced by bookHistograms(), and fillDigiInfo().

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

Definition at line 91 of file HGCalDigiValidation.cc.

Referenced by bookHistograms(), and fillDigiInfo().

edm::EDGetToken HGCalDigiValidation::digiSource_
private

Definition at line 82 of file HGCalDigiValidation.cc.

Referenced by analyze(), and HGCalDigiValidation().

bool HGCalDigiValidation::ifHCAL_
private

Definition at line 83 of file HGCalDigiValidation.cc.

Referenced by analyze(), and HGCalDigiValidation().

int HGCalDigiValidation::layers_
private

Definition at line 85 of file HGCalDigiValidation.cc.

Referenced by bookHistograms(), and dqmBeginRun().

MonitorElement* HGCalDigiValidation::MeanDigiOccupancy_Minus_
private

Definition at line 96 of file HGCalDigiValidation.cc.

Referenced by bookHistograms().

MonitorElement* HGCalDigiValidation::MeanDigiOccupancy_Plus_
private

Definition at line 95 of file HGCalDigiValidation.cc.

Referenced by bookHistograms().

std::string HGCalDigiValidation::nameDetector_
private

Definition at line 81 of file HGCalDigiValidation.cc.

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

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

Definition at line 88 of file HGCalDigiValidation.cc.

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

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

Definition at line 87 of file HGCalDigiValidation.cc.

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

int HGCalDigiValidation::SampleIndx_
private

Definition at line 84 of file HGCalDigiValidation.cc.

Referenced by analyze().

int HGCalDigiValidation::verbosity_
private

Definition at line 84 of file HGCalDigiValidation.cc.

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