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::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources, edm::EndLuminosityBlockProducer > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (const edm::Run &run, const edm::EventSetup &c)
 
void dqmEndJob (DQMStore::IBooker &ib, DQMStore::IGetter &ig)
 
 HGCalHitClient (const edm::ParameterSet &)
 
virtual ~HGCalHitClient ()
 
- Public Member Functions inherited from DQMEDHarvester
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester (void)
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endJob () override final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &) override
 
virtual void produce (edm::Event &, edm::EventSetup const &) override final
 
virtual ~DQMEDHarvester ()=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources, edm::EndLuminosityBlockProducer >
 EDProducer ()=default
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- 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)
 

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
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)
 

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 ( )
virtual

Definition at line 40 of file HGCalHitClient.cc.

40 { }

Member Function Documentation

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

Definition at line 26 of file HGCalHitClient.cc.

References dqmEndJob(), and cuy::ib.

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

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::LogInfo("HGCalValid") << "HGCalHitValidation :: runClient" << std::endl;
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::LogInfo("HGCalValid") << "HGCalHitValidation::fullPath: "
53  << fullDirPath.at(i) << std::endl;
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::LogInfo("HGCalValid") << "HGCalHitValidation:: fullSubPath: "
61  << fullSubDirPath.at(j) << std::endl;
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::LogInfo("HGCalValid") << "HGCalHitValidation:: hgcalMES size : "
67  << hgcalMEs.size() << std::endl;
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:197
int geometryEndjob(const std::vector< MonitorElement * > &hcalMEs)
std::string subDirectory_
std::vector< std::string > getSubdirs(void)
Definition: DQMStore.cc:323
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:347
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().