CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
HGCalDigiValidation Class Reference

#include <Validation/HGCalValidation/plugins/HGCalDigiValidation.cc>

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 ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual 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
 
virtual ~EDAnalyzerBase ()
 
- 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
 
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

Description: Validates SimHits of High Granularity Calorimeter Implementation: [Notes on implementation]

Definition at line 43 of file HGCalDigiValidation.h.

Constructor & Destructor Documentation

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

Definition at line 51 of file HGCalDigiValidation.cc.

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

51  :
52  nameDetector_(iConfig.getParameter<std::string>("DetectorName")),
53  verbosity_(iConfig.getUntrackedParameter<int>("Verbosity",0)),
54  SampleIndx_(iConfig.getUntrackedParameter<int>("SampleIndx",5)) {
55  ifHCAL_ = iConfig.getParameter<bool>("ifHCAL");
56  auto temp = iConfig.getParameter<edm::InputTag>("DigiSource");
57  if( nameDetector_ == "HGCalEESensitive" ) {
58  digiSource_ = consumes<HGCEEDigiCollection>(temp);
59  } else if ( nameDetector_ == "HGCalHESiliconSensitive" ||
60  nameDetector_ == "HGCalHEScintillatorSensitive" ) {
61  digiSource_ = consumes<HGCHEDigiCollection>(temp);
62  } else if ( nameDetector_ == "HCal" ) {
63  if (ifHCAL_) digiSource_ = consumes<QIE11DigiCollection>(temp);
64  else digiSource_ = consumes<HGCBHDigiCollection>(temp);
65  } else {
66  throw cms::Exception("BadHGCDigiSource")
67  << "HGCal DetectorName given as " << nameDetector_ << " must be: "
68  << "\"HGCalHESiliconSensitive\", \"HGCalHESiliconSensitive\", "
69  << "\"HGCalHEScintillatorSensitive\", or \"HCal\"!";
70  }
71 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetToken digiSource_
HGCalDigiValidation::~HGCalDigiValidation ( )

Definition at line 74 of file HGCalDigiValidation.cc.

74 { }

Member Function Documentation

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

Definition at line 76 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_.

77  {
78  OccupancyMap_plus_.clear();
79  OccupancyMap_minus_.clear();
80 
81  const HGCalGeometry* geom0(0);
82  const CaloGeometry* geom1(0);
83  if (nameDetector_ == "HCal") {
85  iSetup.get<CaloGeometryRecord>().get(geom);
86  if (!geom.isValid()) edm::LogWarning("HGCalValidation") << "Cannot get valid HGCalGeometry Object for " << nameDetector_;
87  geom1 = geom.product();
88  } else {
90  iSetup.get<IdealGeometryRecord>().get(nameDetector_, geom);
91  if (!geom.isValid()) edm::LogWarning("HGCalValidation") << "Cannot get valid HGCalGeometry Object for " << nameDetector_;
92  geom0 = geom.product();
93  }
94 
95  unsigned int ntot(0), nused(0);
96  if (nameDetector_ == "HGCalEESensitive") {
97  //HGCalEE
98  edm::Handle<HGCEEDigiCollection> theHGCEEDigiContainers;
99  iEvent.getByToken(digiSource_, theHGCEEDigiContainers);
100  if (theHGCEEDigiContainers.isValid()) {
101  if (verbosity_>0)
102  edm::LogInfo("HGCalValidation") << nameDetector_ << " with "
103  << theHGCEEDigiContainers->size()
104  << " element(s)";
105 
106  for (HGCEEDigiCollection::const_iterator it =theHGCEEDigiContainers->begin();
107  it !=theHGCEEDigiContainers->end(); ++it) {
108  ntot++; nused++;
109  HGCEEDetId detId = (it->id());
110  int layer = detId.layer();
111  HGCSample hgcSample = it->sample(SampleIndx_);
112  uint16_t gain = hgcSample.toa();
113  uint16_t adc = hgcSample.data();
114  double charge = adc*gain;
115  digiValidation(detId, geom0, layer, adc, charge);
116  }
117  fillDigiInfo();
118  } else {
119  edm::LogWarning("HGCalValidation") << "HGCEEDigiCollection handle does not exist !!!";
120  }
121  } else if ((nameDetector_ == "HGCalHESiliconSensitive") ||
122  (nameDetector_ == "HGCalHEScintillatorSensitive")) {
123  //HGCalHE
124  edm::Handle<HGCHEDigiCollection> theHGCHEDigiContainers;
125  iEvent.getByToken(digiSource_, theHGCHEDigiContainers);
126  if (theHGCHEDigiContainers.isValid()) {
127  if (verbosity_>0)
128  edm::LogInfo("HGCalValidation") << nameDetector_ << " with "
129  << theHGCHEDigiContainers->size()
130  << " element(s)";
131 
132  for (HGCHEDigiCollection::const_iterator it =theHGCHEDigiContainers->begin();
133  it !=theHGCHEDigiContainers->end(); ++it) {
134  ntot++; nused++;
135  HGCHEDetId detId = (it->id());
136  int layer = detId.layer();
137  HGCSample hgcSample = it->sample(SampleIndx_);
138  uint16_t gain = hgcSample.toa();
139  uint16_t adc = hgcSample.data();
140  double charge = adc*gain;
141  digiValidation(detId, geom0, layer, adc, charge);
142  }
143  fillDigiInfo();
144  } else {
145  edm::LogWarning("HGCalValidation") << "HGCHEDigiCollection handle does not exist !!!";
146  }
147  } else if ((nameDetector_ == "HCal") && (!ifHCAL_)) {
148  //HGCalBH
149  edm::Handle<HGCBHDigiCollection> theHGCBHDigiContainers;
150  iEvent.getByToken(digiSource_, theHGCBHDigiContainers);
151  if (theHGCBHDigiContainers.isValid()) {
152  if (verbosity_>0)
153  edm::LogInfo("HGCalValidation") << nameDetector_ << " with "
154  << theHGCBHDigiContainers->size()
155  << " element(s)";
156 
157  for (HGCBHDigiCollection::const_iterator it =theHGCBHDigiContainers->begin();
158  it !=theHGCBHDigiContainers->end(); ++it) {
159  ntot++; nused++;
160  HcalDetId detId = (it->id());
161  int layer = detId.depth();
162  HGCSample hgcSample = it->sample(SampleIndx_);
163  uint16_t gain = hgcSample.toa();
164  uint16_t adc = hgcSample.data();
165  double charge = adc*gain;
166  digiValidation(detId, geom1, layer, adc, charge);
167  }
168  fillDigiInfo();
169  } else {
170  edm::LogWarning("HGCalValidation") << "HGCBHDigiCollection handle does not exist !!!";
171  }
172  } else if (nameDetector_ == "HCal") {
173  //HE
174  edm::Handle<QIE11DigiCollection> theHEDigiContainers;
175  iEvent.getByToken(digiSource_, theHEDigiContainers);
176  if (theHEDigiContainers.isValid()) {
177  if (verbosity_>0)
178  edm::LogInfo("HGCalValidation") << nameDetector_ << " with "
179  << theHEDigiContainers->size()
180  << " element(s)";
181  edm::ESHandle<HcalDbService> conditions;
182  iSetup.get<HcalDbRecord > ().get(conditions);
183 
184  for (QIE11DigiCollection::const_iterator it =theHEDigiContainers->begin();
185  it !=theHEDigiContainers->end(); ++it) {
186  QIE11DataFrame df(*it);
187  HcalDetId detId = (df.id());
188  ntot++;
189  if (detId.subdet() == HcalEndcap) {
190  nused++;
192  const HcalQIECoder* channelCoder = conditions->getHcalCoder(detId);
193  const HcalQIEShape* shape = conditions->getHcalShape(channelCoder);
194  HcalCoderDb coder(*channelCoder, *shape);
195  CaloSamples tool;
196  coder.adc2fC(df, tool);
197  int layer = detId.depth();
198  uint16_t adc = (df)[SampleIndx_].adc();
199  int capid = (df)[SampleIndx_].capid();
200  double charge = (tool[SampleIndx_] - calibrations.pedestal(capid));
201  digiValidation(detId, geom1, layer, adc, charge);
202  }
203  }
204  fillDigiInfo();
205  } else {
206  edm::LogWarning("HGCalValidation") << "HGCHEDigiCollection handle does not exist !!!";
207  }
208  } else {
209  edm::LogWarning("HGCalValidation") << "invalid detector name !! "
210  << nameDetector_;
211  }
212  edm::LogInfo("HGCalValidation") << "Event " << iEvent.id().event()
213  << " with " << ntot << " total and "
214  << nused << " used digis";
215 }
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:57
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:460
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:56
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
edm::EDGetToken digiSource_
uint32_t toa() const
Definition: HGCSample.h:56
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 296 of file HGCalDigiValidation.cc.

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

298  {
299 
300  iB.setCurrentFolder("HGCalDigiV/"+nameDetector_);
301 
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));
306 
307  histoname.str(""); histoname << "ADC_" << "layer_" << ilayer;
308  ADC_.push_back(iB.book1D(histoname.str().c_str(), "DigiOccupancy",200,0,1000));
309 
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));
312 
313  histoname.str(""); histoname << "DigiOccupancy_Plus_" << "layer_" << ilayer;
314  DigiOccupancy_Plus_.push_back(iB.book1D(histoname.str().c_str(), "DigiOccupancy +z", 100, 0, 1000));
315  histoname.str(""); histoname << "DigiOccupancy_Minus_" << "layer_" << ilayer;
316  DigiOccupancy_Minus_.push_back(iB.book1D(histoname.str().c_str(), "DigiOccupancy -z", 100, 0, 1000));
317  }
318 
319  histoname.str(""); histoname << "SUMOfDigiOccupancy_Plus";
320  MeanDigiOccupancy_Plus_ = iB.book1D( histoname.str().c_str(), "SUMOfDigiOccupancy_Plus", layers_, -0.5, layers_-0.5);
321  histoname.str(""); histoname << "SUMOfRecDigiOccupancy_Minus";
322  MeanDigiOccupancy_Minus_ = iB.book1D( histoname.str().c_str(), "SUMOfDigiOccupancy_Minus", layers_, -0.5,layers_-0.5);
323 }
std::vector< MonitorElement * > charge_
std::vector< MonitorElement * > DigiOccupancy_XY_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::vector< MonitorElement * > DigiOccupancy_Minus_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
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 218 of file HGCalDigiValidation.cc.

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

Referenced by analyze().

219  {
220 
221  if (verbosity_>1) edm::LogInfo("HGCalValidation") << detId;
222  DetId id1 = DetId(detId.rawId());
223  GlobalPoint global1 = geom->getPosition(id1);
224 
225  if (verbosity_>1)
226  edm::LogInfo("HGCalValidation") << " adc = " << adc
227  << " charge = " << charge;
228 
229  digiInfo hinfo;
230  hinfo.x = global1.x();
231  hinfo.y = global1.y();
232  hinfo.z = global1.z();
233  hinfo.adc = adc;
234  hinfo.charge = charge; //charges[0];
235  hinfo.layer = layer;
236 
237  if (verbosity_>1)
238  edm::LogInfo("HGCalValidation") << "gx = " << hinfo.x
239  << " gy = " << hinfo.y
240  << " gz = " << hinfo.z;
241 
242  fillDigiInfo(hinfo);
243 
244  if (global1.eta() > 0) fillOccupancyMap(OccupancyMap_plus_, layer -1);
245  else fillOccupancyMap(OccupancyMap_minus_, layer -1);
246 
247 }
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 276 of file HGCalDigiValidation.cc.

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

277  {
278  if (nameDetector_ == "HCal") {
280  iSetup.get<HcalRecNumberingRecord>().get( pHRNDC );
281  const HcalDDDRecConstants *hcons = &(*pHRNDC);
282  layers_ = hcons->getMaxDepth(1);
283  } else {
285  iSetup.get<IdealGeometryRecord>().get(nameDetector_, pHGDC);
286  const HGCalDDDConstants & hgcons_ = (*pHGDC);
287  layers_ = hgcons_.layers(true);
288  }
289 
290  if (verbosity_>0)
291  edm::LogInfo("HGCalValidation") << "current DQM directory: "
292  << "HGCalDigiV/" << nameDetector_
293  << " layer = "<< layers_;
294 }
int getMaxDepth(const int type) const
unsigned int layers(bool reco) const
const T & get() const
Definition: EventSetup.h:56
void HGCalDigiValidation::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 327 of file HGCalDigiValidation.cc.

References edm::ConfigurationDescriptions::addDefault(), DEFINE_FWK_MODULE, and edm::ParameterSetDescription::setUnknown().

327  {
328  //The following says we do not know what parameters are allowed so do no validation
329  // Please change this to state exactly what you do use, even if it is no parameters
331  desc.setUnknown();
332  descriptions.addDefault(desc);
333 }
void addDefault(ParameterSetDescription const &psetDescription)
void HGCalDigiValidation::fillDigiInfo ( digiInfo hinfo)
private

Definition at line 254 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.

254  {
255  int ilayer = hinfo.layer -1;
256  charge_.at(ilayer)->Fill(hinfo.charge);
257  DigiOccupancy_XY_.at(ilayer)->Fill(hinfo.x, hinfo.y);
258  ADC_.at(ilayer)->Fill(hinfo.adc);
259 }
std::vector< MonitorElement * > charge_
std::vector< MonitorElement * > DigiOccupancy_XY_
std::vector< MonitorElement * > ADC_
void HGCalDigiValidation::fillDigiInfo ( )
private

Definition at line 261 of file HGCalDigiValidation.cc.

References DigiOccupancy_Minus_, DigiOccupancy_Plus_, OccupancyMap_minus_, and OccupancyMap_plus_.

Referenced by analyze(), and digiValidation().

261  {
262  for (auto itr = OccupancyMap_plus_.begin();
263  itr != OccupancyMap_plus_.end(); ++itr) {
264  int layer = (*itr).first;
265  int occupancy = (*itr).second;
266  DigiOccupancy_Plus_.at(layer)->Fill(occupancy);
267  }
268  for (auto itr = OccupancyMap_minus_.begin();
269  itr != OccupancyMap_minus_.end(); ++itr) {
270  int layer = (*itr).first;
271  int occupancy = (*itr).second;
272  DigiOccupancy_Minus_.at(layer)->Fill(occupancy);
273  }
274 }
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 249 of file HGCalDigiValidation.cc.

Referenced by digiValidation().

249  {
250  if (OccupancyMap.find(layer) != OccupancyMap.end()) OccupancyMap[layer] ++;
251  else OccupancyMap[layer] = 1;
252 }

Member Data Documentation

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

Definition at line 82 of file HGCalDigiValidation.h.

Referenced by bookHistograms(), and fillDigiInfo().

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

Definition at line 80 of file HGCalDigiValidation.h.

Referenced by bookHistograms(), and fillDigiInfo().

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

Definition at line 84 of file HGCalDigiValidation.h.

Referenced by bookHistograms(), and fillDigiInfo().

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

Definition at line 83 of file HGCalDigiValidation.h.

Referenced by bookHistograms(), and fillDigiInfo().

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

Definition at line 81 of file HGCalDigiValidation.h.

Referenced by bookHistograms(), and fillDigiInfo().

edm::EDGetToken HGCalDigiValidation::digiSource_
private

Definition at line 72 of file HGCalDigiValidation.h.

Referenced by analyze(), and HGCalDigiValidation().

bool HGCalDigiValidation::ifHCAL_
private

Definition at line 74 of file HGCalDigiValidation.h.

Referenced by analyze(), and HGCalDigiValidation().

int HGCalDigiValidation::layers_
private

Definition at line 75 of file HGCalDigiValidation.h.

Referenced by bookHistograms(), and dqmBeginRun().

MonitorElement* HGCalDigiValidation::MeanDigiOccupancy_Minus_
private

Definition at line 86 of file HGCalDigiValidation.h.

Referenced by bookHistograms().

MonitorElement* HGCalDigiValidation::MeanDigiOccupancy_Plus_
private

Definition at line 85 of file HGCalDigiValidation.h.

Referenced by bookHistograms().

std::string HGCalDigiValidation::nameDetector_
private

Definition at line 71 of file HGCalDigiValidation.h.

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

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

Definition at line 78 of file HGCalDigiValidation.h.

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

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

Definition at line 77 of file HGCalDigiValidation.h.

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

int HGCalDigiValidation::SampleIndx_
private

Definition at line 73 of file HGCalDigiValidation.h.

Referenced by analyze().

int HGCalDigiValidation::verbosity_
private

Definition at line 73 of file HGCalDigiValidation.h.

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