CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
HGCalDigiClient Class Reference
Inheritance diagram for HGCalDigiClient:
DQMEDHarvester edm::one::EDProducer< T > 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 * > &hgcalMEs)
 
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 beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< T >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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 selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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_
 
const std::string nameDetector_
 
const edm::ESGetToken
< HGCalDDDConstants,
IdealGeometryRecord
tok_hgcal_
 
const 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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 20 of file HGCalDigiClient.cc.

Constructor & Destructor Documentation

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

Definition at line 37 of file HGCalDigiClient.cc.

References nameDetector_.

38  : nameDetector_(iConfig.getParameter<std::string>("DetectorName")),
39  verbosity_(iConfig.getUntrackedParameter<int>("Verbosity", 0)),
40  tok_hgcal_(esConsumes<HGCalDDDConstants, IdealGeometryRecord, edm::Transition::BeginRun>(
T getUntrackedParameter(std::string const &, T const &) const
const int verbosity_
const edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > tok_hgcal_
const std::string nameDetector_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HGCalDigiClient::~HGCalDigiClient ( )
inlineoverride

Definition at line 29 of file HGCalDigiClient.cc.

29 {}

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::getData(), HGCalDDDConstants::layers(), layers_, and tok_hgcal_.

43  {
44  const HGCalDDDConstants *hgcons = &iSetup.getData(tok_hgcal_);
45  layers_ = hgcons->layers(true);
46 }
unsigned int layers(bool reco) const
const edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > tok_hgcal_
int HGCalDigiClient::digisEndjob ( const std::vector< MonitorElement * > &  hgcalMEs)

Definition at line 78 of file HGCalDigiClient.cc.

References getName(), mps_fire::i, dqmiolumiharvest::j, layers_, mergeVDriftHistosByStation::name, and nevent.

Referenced by runClient_().

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

References runClient_().

48 { runClient_(ib, ig); }
void runClient_(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
void HGCalDigiClient::runClient_ ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)

Definition at line 50 of file HGCalDigiClient.cc.

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

Referenced by dqmEndJob().

50  {
51  ig.setCurrentFolder("/");
52  if (verbosity_)
53  edm::LogVerbatim("HGCalValidation") << "\nrunClient";
54  std::vector<MonitorElement *> hgcalMEs;
55  std::vector<std::string> fullDirPath = ig.getSubdirs();
56 
57  for (unsigned int i = 0; i < fullDirPath.size(); i++) {
58  if (verbosity_)
59  edm::LogVerbatim("HGCalValidation") << "\nfullPath: " << fullDirPath.at(i);
60  ig.setCurrentFolder(fullDirPath.at(i));
61  std::vector<std::string> fullSubDirPath = ig.getSubdirs();
62 
63  for (unsigned int j = 0; j < fullSubDirPath.size(); j++) {
64  if (verbosity_)
65  edm::LogVerbatim("HGCalValidation") << "fullSubPath: " << fullSubDirPath.at(j);
66  std::string nameDirectory = "HGCAL/HGCalDigisV/" + nameDetector_;
67  if (strcmp(fullSubDirPath.at(j).c_str(), nameDirectory.c_str()) == 0) {
68  hgcalMEs = ig.getContents(fullSubDirPath.at(j));
69  if (verbosity_)
70  edm::LogVerbatim("HGCalValidation") << "hgcalMES size : " << hgcalMEs.size();
71  if (!digisEndjob(hgcalMEs))
72  edm::LogVerbatim("HGCalValidation") << "\nError in DigisEndjob!";
73  }
74  }
75  }
76 }
Log< level::Info, true > LogVerbatim
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:700
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:593
const int verbosity_
int digisEndjob(const std::vector< MonitorElement * > &hgcalMEs)
const std::string nameDetector_

Member Data Documentation

int HGCalDigiClient::layers_
private

Definition at line 25 of file HGCalDigiClient.cc.

Referenced by beginRun(), and digisEndjob().

const std::string HGCalDigiClient::nameDetector_
private

Definition at line 22 of file HGCalDigiClient.cc.

Referenced by HGCalDigiClient(), and runClient_().

const edm::ESGetToken<HGCalDDDConstants, IdealGeometryRecord> HGCalDigiClient::tok_hgcal_
private

Definition at line 24 of file HGCalDigiClient.cc.

Referenced by beginRun().

const int HGCalDigiClient::verbosity_
private

Definition at line 23 of file HGCalDigiClient.cc.

Referenced by runClient_().