CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HGCalHitClient Class Reference
Inheritance diagram for HGCalHitClient:
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
 
void dqmEndJob (DQMStore::IBooker &ib, DQMStore::IGetter &ig) override
 
 HGCalHitClient (const edm::ParameterSet &)
 
 ~HGCalHitClient () 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 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 () 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
 
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)
 

Private Member Functions

int geometryEndjob (const std::vector< MonitorElement * > &hcalMEs)
 

Private Attributes

std::string subDirectory_
 

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
 
- 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::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 DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 20 of file HGCalHitClient.cc.

Constructor & Destructor Documentation

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

Definition at line 35 of file HGCalHitClient.cc.

References edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and subDirectory_.

35  {
36 
37  subDirectory_ = iConfig.getParameter<std::string>("DirectoryName");
38 }
T getParameter(std::string const &) const
std::string subDirectory_
HGCalHitClient::~HGCalHitClient ( )
override

Definition at line 40 of file HGCalHitClient.cc.

40 { }

Member Function Documentation

void HGCalHitClient::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
inlineoverride

Definition at line 26 of file HGCalHitClient.cc.

References dqmEndJob(), and cuy::ib.

26 {}
void HGCalHitClient::dqmEndJob ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)
overridevirtual

Implements DQMEDHarvester.

Definition at line 42 of file HGCalHitClient.cc.

References geometryEndjob(), DQMStore::IGetter::getContents(), DQMStore::IGetter::getSubdirs(), mps_fire::i, DQMStore::IGetter::setCurrentFolder(), and subDirectory_.

Referenced by beginRun().

42  {
43  ig.setCurrentFolder("/");
44 #ifdef EDM_ML_DEBUG
45  edm::LogVerbatim("HGCalValid") << "HGCalHitValidation :: runClient";
46 #endif
47  std::vector<MonitorElement*> hgcalMEs;
48  std::vector<std::string> fullDirPath = ig.getSubdirs();
49 
50  for (unsigned int i=0; i<fullDirPath.size(); i++) {
51 #ifdef EDM_ML_DEBUG
52  edm::LogVerbatim("HGCalValid") << "HGCalHitValidation::fullPath: "
53  << fullDirPath.at(i);
54 #endif
55  ig.setCurrentFolder(fullDirPath.at(i));
56  std::vector<std::string> fullSubDirPath = ig.getSubdirs();
57 
58  for (unsigned int j=0; j<fullSubDirPath.size(); j++) {
59 #ifdef EDM_ML_DEBUG
60  edm::LogVerbatim("HGCalValid") << "HGCalHitValidation:: fullSubPath: "
61  << fullSubDirPath.at(j);
62 #endif
63  if (strcmp(fullSubDirPath.at(j).c_str(), subDirectory_.c_str()) == 0) {
64  hgcalMEs = ig.getContents(fullSubDirPath.at(j));
65 #ifdef EDM_ML_DEBUG
66  edm::LogVerbatim("HGCalValid") << "HGCalHitValidation:: hgcalMES size : "
67  << hgcalMEs.size();
68 #endif
69  if (!geometryEndjob(hgcalMEs))
70  edm::LogWarning("HGCalValid") << "\nError in HGcalHitEndjob!";
71  }
72  }
73  }
74 }
std::vector< MonitorElement * > getContents(Args &&...args)
Definition: DQMStore.h:305
int geometryEndjob(const std::vector< MonitorElement * > &hcalMEs)
std::string subDirectory_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:344
std::vector< std::string > getSubdirs()
Definition: DQMStore.cc:320
int HGCalHitClient::geometryEndjob ( const std::vector< MonitorElement * > &  hcalMEs)
private

Definition at line 76 of file HGCalHitClient.cc.

References DEFINE_FWK_MODULE, mps_fire::i, dataset::name, nevent, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqmEndJob().

76  {
77  std::string dets[3] = {"hee", "hef", "heb"};
78  std::string hist1[2] = {"EnRec","EnSim"};
79  std::string hist2[7] = {"dzVsZ","dyVsY","dxVsX","RecVsSimZ","RecVsSimY",
80  "RecVsSimX","EnSimRec"};
81 
82  std::vector<MonitorElement*> hist1_;
83  std::vector<MonitorElement*> hist2_;
84 
85  //Normalize the histograms
86  for (unsigned int idet=0; idet<3; ++idet) {
87  char name[100];
88  for (unsigned int kh=0; kh<2; ++kh) {
89  sprintf(name, "%s%s", dets[idet].c_str(), hist1[kh].c_str());
90  for (unsigned int ih=0; ih<hgcalMEs.size(); ih++) {
91  if (strcmp(hgcalMEs[ih]->getName().c_str(), name) == 0) {
92  hist1_.push_back(hgcalMEs[ih]);
93  double nevent = hist1_.back()->getEntries();
94  int nbinsx = hist1_.back()->getNbinsX();
95  for (int i=1; i<= nbinsx; ++i) {
96  double binValue = hist1_.back()->getBinContent(i)/nevent;
97  hist1_.back()->setBinContent(i,binValue);
98  }
99  }
100  }
101  }
102  for (unsigned int kh=0; kh<7; ++kh) {
103  sprintf(name, "%s%s", dets[idet].c_str(), hist2[kh].c_str());
104  for (unsigned int ih=0; ih<hgcalMEs.size(); ih++) {
105  if (strcmp(hgcalMEs[ih]->getName().c_str(), name) == 0) {
106  hist2_.push_back(hgcalMEs[ih]);
107  double nevent = hist2_.back()->getEntries();
108  int nbinsx = hist2_.back()->getNbinsX();
109  int nbinsy = hist2_.back()->getNbinsY();
110  for (int i=1; i<= nbinsx; ++i) {
111  for (int j=1; j<= nbinsy; ++j) {
112  double binValue = hist2_.back()->getBinContent(i,j)/nevent;
113  hist2_.back()->setBinContent(i,j,binValue);
114  }
115  }
116  }
117  }
118  }
119  }
120 
121  return 1;
122 }
int nevent
Definition: AMPTWrapper.h:74

Member Data Documentation

std::string HGCalHitClient::subDirectory_
private

Definition at line 30 of file HGCalHitClient.cc.

Referenced by dqmEndJob(), and HGCalHitClient().