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
HcalRecHitsDQMClient Class Reference

#include <HcalRecHitsDQMClient.h>

Inheritance diagram for HcalRecHitsDQMClient:
DQMEDHarvester edm::one::EDProducer< T > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginJob (void) override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
 HcalRecHitsDQMClient (const edm::ParameterSet &)
 
int HcalRecHitsEndjob (const std::vector< MonitorElement * > &hcalMEs)
 
float phifactor (int ieta)
 
 ~HcalRecHitsDQMClient () 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

edm::ESGetToken< CaloGeometry,
CaloGeometryRecord
caloGeometryRunToken_
 
edm::ParameterSet conf_
 
bool debug_
 
std::string dirName_
 
std::string dirNameJet_
 
std::string dirNameMET_
 
edm::ESGetToken
< HcalDDDRecConstants,
HcalRecNumberingRecord
hcalDDDRecConstantsToken_
 
int maxDepthAll_
 
int maxDepthHB_
 
int maxDepthHE_
 
int maxDepthHF_
 
int maxDepthHO_
 
int nChannels_ [5]
 
std::string outputFile_
 
bool verbose_
 

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 46 of file HcalRecHitsDQMClient.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file HcalRecHitsDQMClient.cc.

References caloGeometryRunToken_, debug_, dirName_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), outputFile_, AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

14  : conf_(iConfig),
15  hcalDDDRecConstantsToken_{esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord, edm::Transition::BeginRun>()},
16  caloGeometryRunToken_{esConsumes<CaloGeometry, CaloGeometryRecord, edm::Transition::BeginRun>()} {
17  outputFile_ = iConfig.getUntrackedParameter<std::string>("outputFile", "myfile.root");
18  debug_ = false;
19  verbose_ = false;
20  dirName_ = iConfig.getParameter<std::string>("DQMDirName");
21 }
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryRunToken_
edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > hcalDDDRecConstantsToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ParameterSet conf_
HcalRecHitsDQMClient::~HcalRecHitsDQMClient ( )
override

Definition at line 23 of file HcalRecHitsDQMClient.cc.

23 {}

Member Function Documentation

void HcalRecHitsDQMClient::beginJob ( void  )
overridevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 25 of file HcalRecHitsDQMClient.cc.

25 {}
void HcalRecHitsDQMClient::beginRun ( edm::Run const &  run,
edm::EventSetup const &  iSetup 
)
override

Definition at line 27 of file HcalRecHitsDQMClient.cc.

References caloGeometryRunToken_, relativeConstraints::geometry, edm::EventSetup::getData(), HcalDDDRecConstants::getMaxDepth(), CaloGeometry::getValidDetIds(), DetId::Hcal, HcalBarrel, hcalDDDRecConstantsToken_, HcalEndcap, HcalForward, HcalOuter, mps_fire::i, SiStripPI::max, maxDepthAll_, maxDepthHB_, maxDepthHE_, maxDepthHF_, maxDepthHO_, and nChannels_.

27  {
28  HcalDDDRecConstants const &hcons = iSetup.getData(hcalDDDRecConstantsToken_);
29  maxDepthHB_ = hcons.getMaxDepth(0);
30  maxDepthHE_ = hcons.getMaxDepth(1);
31  maxDepthHF_ = std::max(hcons.getMaxDepth(2), 1);
32  maxDepthHO_ = hcons.getMaxDepth(3);
33 
34  CaloGeometry const &geometry = iSetup.getData(caloGeometryRunToken_);
35  const std::vector<DetId> &hbCells = geometry.getValidDetIds(DetId::Hcal, HcalBarrel);
36  const std::vector<DetId> &heCells = geometry.getValidDetIds(DetId::Hcal, HcalEndcap);
37  const std::vector<DetId> &hoCells = geometry.getValidDetIds(DetId::Hcal, HcalOuter);
38  const std::vector<DetId> &hfCells = geometry.getValidDetIds(DetId::Hcal, HcalForward);
39 
40  nChannels_[1] = hbCells.size();
41  nChannels_[2] = heCells.size();
42  nChannels_[3] = hoCells.size();
43  nChannels_[4] = hfCells.size();
44  nChannels_[0] = nChannels_[1] + nChannels_[2] + nChannels_[3] + nChannels_[4];
45  // avoid divide by zero
46  for (unsigned i = 0; i < 5; ++i) {
47  if (nChannels_[i] == 0)
48  nChannels_[i] = 1;
49  }
50 
51  // std::cout << "Channels HB:" << nChannels_[1] << " HE:" << nChannels_[2] <<
52  // " HO:" << nChannels_[3] << " HF:" << nChannels_[4] << std::endl;
53 
54  // We hardcode the HF depths because in the dual readout configuration,
55  // rechits are not defined for depths 3&4
56  maxDepthHF_ = (maxDepthHF_ > 2 ? 2 : maxDepthHF_); // We reatin the dynamic possibility
57  // that HF might have 0 or 1 depths
58 
59  maxDepthAll_ = (maxDepthHB_ + maxDepthHO_ > maxDepthHE_ ? maxDepthHB_ + maxDepthHO_ : maxDepthHE_);
61 }
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryRunToken_
edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > hcalDDDRecConstantsToken_
int getMaxDepth(const int &type) const
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
Definition: CaloGeometry.cc:75
void HcalRecHitsDQMClient::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overridevirtual

Implements DQMEDHarvester.

Definition at line 63 of file HcalRecHitsDQMClient.cc.

References gather_cfg::cout, dirName_, dqm::implementation::IGetter::getContents(), dqm::implementation::IGetter::getSubdirs(), HcalRecHitsEndjob(), mps_fire::i, dqmiolumiharvest::j, dqm::implementation::NavigatorBase::setCurrentFolder(), and verbose_.

63  {
64  igetter.setCurrentFolder(dirName_);
65 
66  if (verbose_)
67  std::cout << "\nrunClient" << std::endl;
68 
69  std::vector<MonitorElement *> hcalMEs;
70 
71  // Since out folders are fixed to three, we can just go over these three
72  // folders i.e., CaloTowersD/CaloTowersTask, HcalRecHitsD/HcalRecHitTask,
73  // NoiseRatesV/NoiseRatesTask.
74  std::vector<std::string> fullPathHLTFolders = igetter.getSubdirs();
75  for (unsigned int i = 0; i < fullPathHLTFolders.size(); i++) {
76  if (verbose_)
77  std::cout << "\nfullPath: " << fullPathHLTFolders[i] << std::endl;
78  igetter.setCurrentFolder(fullPathHLTFolders[i]);
79 
80  std::vector<std::string> fullSubPathHLTFolders = igetter.getSubdirs();
81  for (unsigned int j = 0; j < fullSubPathHLTFolders.size(); j++) {
82  if (verbose_)
83  std::cout << "fullSub: " << fullSubPathHLTFolders[j] << std::endl;
84 
85  if (strcmp(fullSubPathHLTFolders[j].c_str(), "HcalRecHitsD/HcalRecHitTask") == 0) {
86  hcalMEs = igetter.getContents(fullSubPathHLTFolders[j]);
87  if (verbose_)
88  std::cout << "hltMES size : " << hcalMEs.size() << std::endl;
89  if (!HcalRecHitsEndjob(hcalMEs))
90  std::cout << "\nError in HcalRecHitsEndjob!" << std::endl << std::endl;
91  }
92  }
93  }
94 }
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
int HcalRecHitsEndjob(const std::vector< MonitorElement * > &hcalMEs)
tuple cout
Definition: gather_cfg.py:144
int HcalRecHitsDQMClient::HcalRecHitsEndjob ( const std::vector< MonitorElement * > &  hcalMEs)

Definition at line 98 of file HcalRecHitsDQMClient.cc.

References ws_sso_content_reader::content, gather_cfg::cout, spr::find(), dqm::impl::MonitorElement::getEntries(), getName(), mps_fire::i, dqmiolumiharvest::j, nChannels_, phifactor(), PostProcessorHGCAL_cfi::prefix, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

Referenced by dqmEndJob().

98  {
99  MonitorElement *Nhf = nullptr;
100 
101  // Search for emap histograms, and collect them into this vector
102  // All subdtectors are plotted together in these histograms. We only need to
103  // look for different depths
104  std::vector<MonitorElement *> emap_depths;
105 
106  // This vector is filled occupancy_maps identified by both subdetector and
107  // depth
108  std::vector<MonitorElement *> occupancy_maps;
109  std::vector<std::string> occupancyID;
110 
111  // This vector is filled with emean_vs_ieta histograms, they are divided by
112  // both subdetector and depth
113  std::vector<MonitorElement *> emean_vs_ieta;
114 
115  // These are the only histograms filled in this module; however, the
116  // histograms are created empty in HcalRecHitsAnalyzer occupancy_vs_ieta,
117  // divided by both subdetector and depth
118  std::vector<MonitorElement *> occupancy_vs_ieta;
119  std::vector<std::string> occupancy_vs_ietaID;
120 
121  // RecHit_StatusWord & RecHit_Aux_StatusWord
122  // Divided by subdectector
123  std::vector<MonitorElement *> RecHit_StatusWord;
124  std::vector<float> RecHit_StatusWord_Channels;
125  std::vector<MonitorElement *> RecHit_Aux_StatusWord;
126  std::vector<float> RecHit_Aux_StatusWord_Channels;
127 
128  for (unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
129  // N_HF is not special, it is just convient to get the total number of
130  // events The number of entries in N_HF is equal to the number of events
131  if (hcalMEs[ih]->getName() == "N_HF") {
132  Nhf = hcalMEs[ih];
133  continue;
134  }
135 
136  // ***********************
137  // * We fill the various MonitorElement vectors by searching for a matching
138  // substring
139  // * The methods that are used are agnostic to the ordering of vectors
140  // ***********************
141 
142  if (hcalMEs[ih]->getName().find("emap_depth") != std::string::npos) {
143  emap_depths.push_back(hcalMEs[ih]);
144  continue;
145  }
146 
147  if (hcalMEs[ih]->getName().find("occupancy_map_H") != std::string::npos) {
148  occupancy_maps.push_back(hcalMEs[ih]);
149 
150  // Use occupancyID to save the subdetector and depth information
151  // This will help preserve both indifference to vector ordering and
152  // specific details of the detector topology The position in occupancyID
153  // must correspond to the histogram position in occupancy_maps
154 
155  // Save the string after "occupancy_map_"
156 
157  std::string prefix = "occupancy_map_";
158 
159  occupancyID.push_back(hcalMEs[ih]->getName().substr(prefix.size()));
160 
161  continue;
162  }
163 
164  if (hcalMEs[ih]->getName().find("emean_vs_ieta_H") != std::string::npos) {
165  emean_vs_ieta.push_back(hcalMEs[ih]);
166  continue;
167  }
168 
169  if (hcalMEs[ih]->getName().find("occupancy_vs_ieta_H") != std::string::npos) {
170  occupancy_vs_ieta.push_back(hcalMEs[ih]);
171 
172  // Use occupancy_vs_ietaID to save the subdetector and depth information
173  // This will help preserve both indifference to vector ordering and
174  // specific details of the detector topology The position in occupancyID
175  // must correspond to the histogram position in occupancy_vs_ieta
176 
177  // Save the string after "occupancy_vs_ieta_"
178 
179  std::string prefix = "occupancy_vs_ieta_";
180 
181  occupancy_vs_ietaID.push_back(hcalMEs[ih]->getName().substr(prefix.size()));
182 
183  continue;
184  }
185 
186  if (hcalMEs[ih]->getName().find("HcalRecHitTask_RecHit_StatusWord_H") != std::string::npos) {
187  RecHit_StatusWord.push_back(hcalMEs[ih]);
188 
189  if (hcalMEs[ih]->getName().find("HB") != std::string::npos) {
190  RecHit_StatusWord_Channels.push_back((float)nChannels_[1]);
191  } else if (hcalMEs[ih]->getName().find("HE") != std::string::npos) {
192  RecHit_StatusWord_Channels.push_back((float)nChannels_[2]);
193  } else if (hcalMEs[ih]->getName().find("H0") != std::string::npos) {
194  RecHit_StatusWord_Channels.push_back((float)nChannels_[3]);
195  } else if (hcalMEs[ih]->getName().find("HF") != std::string::npos) {
196  RecHit_StatusWord_Channels.push_back((float)nChannels_[4]);
197  } else {
198  RecHit_StatusWord_Channels.push_back(1.);
199  }
200 
201  continue;
202  }
203 
204  if (hcalMEs[ih]->getName().find("HcalRecHitTask_RecHit_Aux_StatusWord_H") != std::string::npos) {
205  RecHit_Aux_StatusWord.push_back(hcalMEs[ih]);
206 
207  if (hcalMEs[ih]->getName().find("HB") != std::string::npos) {
208  RecHit_Aux_StatusWord_Channels.push_back((float)nChannels_[1]);
209  } else if (hcalMEs[ih]->getName().find("HE") != std::string::npos) {
210  RecHit_Aux_StatusWord_Channels.push_back((float)nChannels_[2]);
211  } else if (hcalMEs[ih]->getName().find("H0") != std::string::npos) {
212  RecHit_Aux_StatusWord_Channels.push_back((float)nChannels_[3]);
213  } else if (hcalMEs[ih]->getName().find("HF") != std::string::npos) {
214  RecHit_Aux_StatusWord_Channels.push_back((float)nChannels_[4]);
215  } else {
216  RecHit_Aux_StatusWord_Channels.push_back(1.);
217  }
218 
219  continue;
220  }
221  }
222 
223  // mean energies and occupancies evaluation
224 
225  double nevtot = Nhf->getEntries(); // Use the number of entries in the Nhf histogram to
226  // give the total number of events
227 
228  if (verbose_)
229  std::cout << "nevtot : " << nevtot << std::endl;
230 
231  // emap histograms are scaled by the number of events
232  float fev = float(nevtot);
233  double scaleBynevtot = 1 / fev;
234 
235  // In this and the following histogram vectors, recognize that the for-loop
236  // index does not have to correspond to any particular depth
237  for (unsigned int depthIdx = 0; depthIdx < emap_depths.size(); depthIdx++) {
238  int nx = emap_depths[depthIdx]->getNbinsX();
239  int ny = emap_depths[depthIdx]->getNbinsY();
240 
241  float cnorm;
242  float enorm;
243 
244  for (int i = 1; i <= nx; i++) {
245  for (int j = 1; j <= ny; j++) {
246  cnorm = emap_depths[depthIdx]->getBinContent(i, j) * scaleBynevtot;
247  enorm = emap_depths[depthIdx]->getBinError(i, j) * scaleBynevtot;
248  emap_depths[depthIdx]->setBinContent(i, j, cnorm);
249  emap_depths[depthIdx]->setBinError(i, j, enorm);
250  }
251  }
252  }
253 
254  // occupancy_maps & matched occupancy_vs_ieta
255 
256  bool omatched = false;
257 
258  for (unsigned int occupancyIdx = 0; occupancyIdx < occupancy_maps.size(); occupancyIdx++) {
259  int nx = occupancy_maps[occupancyIdx]->getNbinsX();
260  int ny = occupancy_maps[occupancyIdx]->getNbinsY();
261 
262  float cnorm;
263  float enorm;
264 
265  unsigned int vsIetaIdx = occupancy_vs_ieta.size();
266  omatched = false;
267 
268  for (vsIetaIdx = 0; vsIetaIdx < occupancy_vs_ieta.size(); vsIetaIdx++) {
269  if (occupancyID[occupancyIdx] == occupancy_vs_ietaID[vsIetaIdx]) {
270  omatched = true;
271  break;
272  }
273  } // match occupancy_vs_ieta histogram
274 
275  for (int i = 1; i <= nx; i++) {
276  for (int j = 1; j <= ny; j++) {
277  cnorm = occupancy_maps[occupancyIdx]->getBinContent(i, j) * scaleBynevtot;
278  enorm = occupancy_maps[occupancyIdx]->getBinError(i, j) * scaleBynevtot;
279  occupancy_maps[occupancyIdx]->setBinContent(i, j, cnorm);
280  occupancy_maps[occupancyIdx]->setBinError(i, j, enorm);
281  }
282  }
283 
284  // Fill occupancy_vs_ieta
285 
286  if (omatched) {
287  // We run over all of the ieta values
288  for (int ieta = -41; ieta <= 41; ieta++) {
289  float phi_factor = 1.;
290  float sumphi = 0.;
291  float sumphie = 0.;
292 
293  if (ieta == 0)
294  continue; // ieta=0 is not defined
295 
296  phi_factor = phifactor(ieta);
297 
298  // the rechits occupancy map defines iphi as 0..71
299  for (int iphi = 0; iphi <= 71; iphi++) {
300  int binIeta = occupancy_maps[occupancyIdx]->getTH2F()->GetXaxis()->FindBin(float(ieta));
301  int binIphi = occupancy_maps[occupancyIdx]->getTH2F()->GetYaxis()->FindBin(float(iphi));
302 
303  float content = occupancy_maps[occupancyIdx]->getBinContent(binIeta, binIphi);
304  float econtent = occupancy_maps[occupancyIdx]->getBinError(binIeta, binIphi);
305 
306  sumphi += content;
307  sumphie += econtent * econtent;
308  } // for loop over phi
309 
310  int ietabin = occupancy_vs_ieta[vsIetaIdx]->getTH1F()->GetXaxis()->FindBin(float(ieta));
311 
312  // fill occupancies vs ieta
313  cnorm = sumphi / phi_factor;
314  enorm = sqrt(sumphie) / phi_factor;
315  occupancy_vs_ieta[vsIetaIdx]->setBinContent(ietabin, cnorm);
316  occupancy_vs_ieta[vsIetaIdx]->setBinError(ietabin, enorm);
317 
318  } // Fill occupancy_vs_ieta
319  } // if omatched
320  }
321 
322  // Status Word
323  // Normalized by number of events and by number of channels per subdetector as
324  // well
325 
326  for (unsigned int StatusWordIdx = 0; StatusWordIdx < RecHit_StatusWord.size(); StatusWordIdx++) {
327  int nx = RecHit_StatusWord[StatusWordIdx]->getNbinsX();
328 
329  float cnorm;
330  float enorm;
331 
332  for (int i = 1; i <= nx; i++) {
333  cnorm = RecHit_StatusWord[StatusWordIdx]->getBinContent(i) * scaleBynevtot /
334  RecHit_StatusWord_Channels[StatusWordIdx];
335  enorm =
336  RecHit_StatusWord[StatusWordIdx]->getBinError(i) * scaleBynevtot / RecHit_StatusWord_Channels[StatusWordIdx];
337  RecHit_StatusWord[StatusWordIdx]->setBinContent(i, cnorm);
338  RecHit_StatusWord[StatusWordIdx]->setBinError(i, enorm);
339  }
340  }
341 
342  for (unsigned int AuxStatusWordIdx = 0; AuxStatusWordIdx < RecHit_Aux_StatusWord.size(); AuxStatusWordIdx++) {
343  int nx = RecHit_Aux_StatusWord[AuxStatusWordIdx]->getNbinsX();
344 
345  float cnorm;
346  float enorm;
347 
348  for (int i = 1; i <= nx; i++) {
349  cnorm = RecHit_Aux_StatusWord[AuxStatusWordIdx]->getBinContent(i) * scaleBynevtot /
350  RecHit_Aux_StatusWord_Channels[AuxStatusWordIdx];
351  enorm = RecHit_Aux_StatusWord[AuxStatusWordIdx]->getBinError(i) * scaleBynevtot /
352  RecHit_Aux_StatusWord_Channels[AuxStatusWordIdx];
353  RecHit_Aux_StatusWord[AuxStatusWordIdx]->setBinContent(i, cnorm);
354  RecHit_Aux_StatusWord[AuxStatusWordIdx]->setBinError(i, enorm);
355  }
356  }
357 
358  return 1;
359 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
virtual double getEntries() const
get # of entries
T sqrt(T t)
Definition: SSEVec.h:19
TString getName(TString structure, int layer, TString geometry)
Definition: DMRtrends.cc:236
tuple cout
Definition: gather_cfg.py:144
float HcalRecHitsDQMClient::phifactor ( int  ieta)

Definition at line 361 of file HcalRecHitsDQMClient.cc.

Referenced by HcalRecHitsEndjob().

361  {
362  float phi_factor_;
363 
364  if (ieta >= -20 && ieta <= 20) {
365  phi_factor_ = 72.;
366  } else {
367  if (ieta >= 40 || ieta <= -40) {
368  phi_factor_ = 18.;
369  } else {
370  phi_factor_ = 36.;
371  }
372  }
373 
374  return phi_factor_;
375 }

Member Data Documentation

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> HcalRecHitsDQMClient::caloGeometryRunToken_
private

Definition at line 59 of file HcalRecHitsDQMClient.h.

Referenced by beginRun(), and HcalRecHitsDQMClient().

edm::ParameterSet HcalRecHitsDQMClient::conf_
private

Definition at line 49 of file HcalRecHitsDQMClient.h.

bool HcalRecHitsDQMClient::debug_
private

Definition at line 52 of file HcalRecHitsDQMClient.h.

Referenced by HcalRecHitsDQMClient().

std::string HcalRecHitsDQMClient::dirName_
private

Definition at line 54 of file HcalRecHitsDQMClient.h.

Referenced by dqmEndJob(), and HcalRecHitsDQMClient().

std::string HcalRecHitsDQMClient::dirNameJet_
private

Definition at line 55 of file HcalRecHitsDQMClient.h.

std::string HcalRecHitsDQMClient::dirNameMET_
private

Definition at line 56 of file HcalRecHitsDQMClient.h.

edm::ESGetToken<HcalDDDRecConstants, HcalRecNumberingRecord> HcalRecHitsDQMClient::hcalDDDRecConstantsToken_
private

Definition at line 58 of file HcalRecHitsDQMClient.h.

Referenced by beginRun().

int HcalRecHitsDQMClient::maxDepthAll_
private

Definition at line 60 of file HcalRecHitsDQMClient.h.

Referenced by beginRun().

int HcalRecHitsDQMClient::maxDepthHB_
private

Definition at line 60 of file HcalRecHitsDQMClient.h.

Referenced by beginRun().

int HcalRecHitsDQMClient::maxDepthHE_
private

Definition at line 60 of file HcalRecHitsDQMClient.h.

Referenced by beginRun().

int HcalRecHitsDQMClient::maxDepthHF_
private

Definition at line 60 of file HcalRecHitsDQMClient.h.

Referenced by beginRun().

int HcalRecHitsDQMClient::maxDepthHO_
private

Definition at line 60 of file HcalRecHitsDQMClient.h.

Referenced by beginRun().

int HcalRecHitsDQMClient::nChannels_[5]
private

Definition at line 62 of file HcalRecHitsDQMClient.h.

Referenced by beginRun(), and HcalRecHitsEndjob().

std::string HcalRecHitsDQMClient::outputFile_
private

Definition at line 48 of file HcalRecHitsDQMClient.h.

Referenced by HcalRecHitsDQMClient().

bool HcalRecHitsDQMClient::verbose_
private

Definition at line 51 of file HcalRecHitsDQMClient.h.

Referenced by dqmEndJob(), HcalRecHitsDQMClient(), and HcalRecHitsEndjob().