CMS 3D CMS Logo

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

Public Member Functions

void beginRun (const edm::Run &run, const edm::EventSetup &c) override
 
int digisEndjob (const std::vector< MonitorElement * > &hcalMEs)
 
void dqmEndJob (DQMStore::IBooker &ib, DQMStore::IGetter &ig) override
 
 HGCalDigiClient (const edm::ParameterSet &)
 
void runClient_ (DQMStore::IBooker &ib, DQMStore::IGetter &ig)
 
 ~HGCalDigiClient () override
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

int layers_
 
std::string nameDetector_
 
int verbosity_
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- 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
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 23 of file HGCalDigiClient.cc.

Constructor & Destructor Documentation

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

Definition at line 39 of file HGCalDigiClient.cc.

40  : nameDetector_(iConfig.getParameter<std::string>("DetectorName")),
41  verbosity_(iConfig.getUntrackedParameter<int>("Verbosity", 0)) {}
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string nameDetector_
HGCalDigiClient::~HGCalDigiClient ( )
inlineoverride

Member Function Documentation

void HGCalDigiClient::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
override

Definition at line 43 of file HGCalDigiClient.cc.

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

Referenced by ~HGCalDigiClient().

43  {
44  if (nameDetector_ == "HCal") {
46  iSetup.get<HcalRecNumberingRecord>().get(pHRNDC);
47  const HcalDDDRecConstants *hcons = &(*pHRNDC);
48  layers_ = hcons->getMaxDepth(1);
49  } else {
51  iSetup.get<IdealGeometryRecord>().get(nameDetector_, pHGDC);
52  const HGCalDDDConstants &hgcons_ = (*pHGDC);
53  layers_ = hgcons_.layers(true);
54  }
55 }
unsigned int layers(bool reco) const
int getMaxDepth(const int &type) const
std::string nameDetector_
int HGCalDigiClient::digisEndjob ( const std::vector< MonitorElement * > &  hcalMEs)

Definition at line 87 of file HGCalDigiClient.cc.

References DEFINE_FWK_MODULE, getName(), mps_fire::i, createfilelist::int, dqmiolumiharvest::j, layers_, Skims_PA_cff::name, and nevent.

Referenced by runClient_(), and ~HGCalDigiClient().

87  {
88  std::vector<MonitorElement *> charge_;
89  std::vector<MonitorElement *> DigiOccupancy_XY_;
90  std::vector<MonitorElement *> ADC_;
91  std::vector<MonitorElement *> DigiOccupancy_Plus_;
92  std::vector<MonitorElement *> DigiOccupancy_Minus_;
93  std::vector<MonitorElement *> MeanDigiOccupancy_Plus_;
94  std::vector<MonitorElement *> MeanDigiOccupancy_Minus_;
95  std::ostringstream name;
96  double nevent;
97  int nbinsx, nbinsy;
98 
99  for (int ilayer = 0; ilayer < layers_; ilayer++) {
100  //charge
101  name.str("");
102  name << "charge_layer_" << ilayer;
103  for (unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
104  if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0)
105  charge_.push_back(hgcalMEs[ih]);
106  }
107  //normalization
108  nevent = charge_.at(ilayer)->getEntries();
109  nbinsx = charge_.at(ilayer)->getNbinsX();
110  for (int i = 1; i <= nbinsx; i++) {
111  double binValue = charge_.at(ilayer)->getBinContent(i) / nevent;
112  charge_.at(ilayer)->setBinContent(i, binValue);
113  }
114 
115  //XY 2d plots
116  name.str("");
117  name << "DigiOccupancy_XY_"
118  << "layer_" << ilayer;
119  for (unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
120  if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0)
121  DigiOccupancy_XY_.push_back(hgcalMEs[ih]);
122  }
123 
124  //normalization of XY 2d
125  nevent = DigiOccupancy_XY_.at(ilayer)->getEntries();
126  nbinsx = DigiOccupancy_XY_.at(ilayer)->getNbinsX();
127  nbinsy = DigiOccupancy_XY_.at(ilayer)->getNbinsY();
128  for (int i = 1; i <= nbinsx; ++i) {
129  for (int j = 1; j <= nbinsy; ++j) {
130  double binValue = DigiOccupancy_XY_.at(ilayer)->getBinContent(i, j) / nevent;
131  DigiOccupancy_XY_.at(ilayer)->setBinContent(i, j, binValue);
132  }
133  }
134 
135  //ADC
136  name.str("");
137  name << "ADC_layer_" << ilayer;
138  for (unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
139  if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0)
140  ADC_.push_back(hgcalMEs[ih]);
141  }
142 
143  //normalization of ADC Histos
144  nevent = ADC_.at(ilayer)->getEntries();
145  nbinsx = ADC_.at(ilayer)->getNbinsX();
146  for (int i = 1; i <= nbinsx; ++i) {
147  double binValue = ADC_.at(ilayer)->getBinContent(i) / nevent;
148  ADC_.at(ilayer)->setBinContent(i, binValue);
149  }
150 
151  //Digi Occupancy
152  name.str("");
153  name << "DigiOccupancy_Plus_layer_" << ilayer;
154  for (unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
155  if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0) {
156  DigiOccupancy_Plus_.push_back(hgcalMEs[ih]);
157  }
158  }
159 
160  name.str("");
161  name << "DigiOccupancy_Minus_layer_" << ilayer;
162  for (unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
163  if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0) {
164  DigiOccupancy_Minus_.push_back(hgcalMEs[ih]);
165  }
166  }
167 
168  //normalization of Digi Occupancy histos
169  nevent = DigiOccupancy_Plus_.at(ilayer)->getEntries();
170  nbinsx = DigiOccupancy_Plus_.at(ilayer)->getNbinsX();
171  for (int i = 1; i <= nbinsx; ++i) {
172  double binValue = DigiOccupancy_Plus_.at(ilayer)->getBinContent(i) / nevent;
173  DigiOccupancy_Plus_.at(ilayer)->setBinContent(i, binValue);
174  }
175 
176  nevent = DigiOccupancy_Minus_.at(ilayer)->getEntries();
177  nbinsx = DigiOccupancy_Minus_.at(ilayer)->getNbinsX();
178  for (int i = 1; i <= nbinsx; ++i) {
179  double binValue = DigiOccupancy_Minus_.at(ilayer)->getBinContent(i) / nevent;
180  DigiOccupancy_Minus_.at(ilayer)->setBinContent(i, binValue);
181  }
182 
183  } //loop over layers
184 
185  name.str("");
186  name << "SUMOfDigiOccupancy_Plus";
187  for (unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
188  if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0) {
189  MeanDigiOccupancy_Plus_.push_back(hgcalMEs[ih]);
190  unsigned indx = MeanDigiOccupancy_Plus_.size() - 1;
191  for (int ilayer = 0; ilayer < (int)layers_; ++ilayer) {
192  double meanVal = DigiOccupancy_Plus_.at(ilayer)->getMean();
193  MeanDigiOccupancy_Plus_[indx]->setBinContent(ilayer + 1, meanVal);
194  }
195  break;
196  }
197  }
198 
199  name.str("");
200  name << "SUMOfDigiOccupancy_Plus";
201  for (unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
202  if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0) {
203  MeanDigiOccupancy_Minus_.push_back(hgcalMEs[ih]);
204  unsigned indx = MeanDigiOccupancy_Minus_.size() - 1;
205  for (int ilayer = 0; ilayer < (int)layers_; ++ilayer) {
206  double meanVal = DigiOccupancy_Minus_.at(ilayer)->getMean();
207  MeanDigiOccupancy_Minus_[indx]->setBinContent(ilayer + 1, meanVal);
208  }
209  break;
210  }
211  }
212  return 1;
213 }
int nevent
Definition: AMPTWrapper.h:84
TString getName(TString structure, int layer, TString geometry)
Definition: DMRtrends.cc:236
void HGCalDigiClient::dqmEndJob ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)
overridevirtual

Implements DQMEDHarvester.

Definition at line 57 of file HGCalDigiClient.cc.

References runClient_().

Referenced by ~HGCalDigiClient().

57 { runClient_(ib, ig); }
void runClient_(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
ib
Definition: cuy.py:662
void HGCalDigiClient::runClient_ ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)

Definition at line 59 of file HGCalDigiClient.cc.

References digisEndjob(), dqm::dqmstoreimpl::DQMStore::IGetter::getContents(), dqm::dqmstoreimpl::DQMStore::IGetter::getSubdirs(), mps_fire::i, dqmiolumiharvest::j, nameDetector_, dqm::dqmstoreimpl::DQMStore::IGetter::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and verbosity_.

Referenced by dqmEndJob(), and ~HGCalDigiClient().

59  {
60  ig.setCurrentFolder("/");
61  if (verbosity_)
62  edm::LogVerbatim("HGCalValidation") << "\nrunClient";
63  std::vector<MonitorElement *> hgcalMEs;
64  std::vector<std::string> fullDirPath = ig.getSubdirs();
65 
66  for (unsigned int i = 0; i < fullDirPath.size(); i++) {
67  if (verbosity_)
68  edm::LogVerbatim("HGCalValidation") << "\nfullPath: " << fullDirPath.at(i);
69  ig.setCurrentFolder(fullDirPath.at(i));
70  std::vector<std::string> fullSubDirPath = ig.getSubdirs();
71 
72  for (unsigned int j = 0; j < fullSubDirPath.size(); j++) {
73  if (verbosity_)
74  edm::LogVerbatim("HGCalValidation") << "fullSubPath: " << fullSubDirPath.at(j);
75  std::string nameDirectory = "HGCAL/HGCalDigisV/" + nameDetector_;
76  if (strcmp(fullSubDirPath.at(j).c_str(), nameDirectory.c_str()) == 0) {
77  hgcalMEs = ig.getContents(fullSubDirPath.at(j));
78  if (verbosity_)
79  edm::LogVerbatim("HGCalValidation") << "hgcalMES size : " << hgcalMEs.size();
80  if (!digisEndjob(hgcalMEs))
81  edm::LogVerbatim("HGCalValidation") << "\nError in DigisEndjob!";
82  }
83  }
84  }
85 }
int digisEndjob(const std::vector< MonitorElement * > &hcalMEs)
std::string nameDetector_

Member Data Documentation

int HGCalDigiClient::layers_
private

Definition at line 27 of file HGCalDigiClient.cc.

Referenced by beginRun(), and digisEndjob().

std::string HGCalDigiClient::nameDetector_
private

Definition at line 25 of file HGCalDigiClient.cc.

Referenced by beginRun(), and runClient_().

int HGCalDigiClient::verbosity_
private

Definition at line 26 of file HGCalDigiClient.cc.

Referenced by runClient_().