CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
HcalDAQInfo Class Reference

#include <DQM/HcalMonitorClient/src/HcalDAQInfo.cc>

Inheritance diagram for HcalDAQInfo:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 HcalDAQInfo (const edm::ParameterSet &)
 
 ~HcalDAQInfo ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginJob () override
 
virtual void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 
virtual void endJob () override
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 

Private Attributes

edm::ParameterSet conf_
 
MonitorElementDAQSummaryMap
 
DQMStoredbe_
 
int debug_
 
MonitorElementHBDaqFraction
 
MonitorElementHcalDaqFraction
 
MonitorElementHEDaqFraction
 
MonitorElementHFDaqFraction
 
MonitorElementHFlumiDaqFraction
 
MonitorElementHO0DaqFraction
 
MonitorElementHO12DaqFraction
 
MonitorElementHODaqFraction
 
std::string rootFolder_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 51 of file HcalDAQInfo.cc.

Constructor & Destructor Documentation

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

Definition at line 92 of file HcalDAQInfo.cc.

References dbe_, debug_, edm::ParameterSet::getUntrackedParameter(), cppFunctionSkipper::operator, rootFolder_, and AlCaHLTBitMon_QueryRunRegistry::string.

93 {
94  // now do what ever initialization is needed
95  debug_=iConfig.getUntrackedParameter<int>("debug",0);
96  rootFolder_ = iConfig.getUntrackedParameter<std::string>("subSystemFolder","Hcal");
98 }
T getUntrackedParameter(std::string const &, T const &) const
DQMStore * dbe_
Definition: HcalDAQInfo.cc:66
std::string rootFolder_
Definition: HcalDAQInfo.cc:77
HcalDAQInfo::~HcalDAQInfo ( )

Definition at line 100 of file HcalDAQInfo.cc.

101 {
102  // do anything here that needs to be done at destruction time
103  // (e.g. close files, deallocate resources etc.)
104 }

Member Function Documentation

void HcalDAQInfo::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 112 of file HcalDAQInfo.cc.

112 {}
void HcalDAQInfo::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 116 of file HcalDAQInfo.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), gather_cfg::cout, DAQSummaryMap, dbe_, debug_, DQMStore::getAllContents(), HBDaqFraction, HcalDaqFraction, HEDaqFraction, HFDaqFraction, HFlumiDaqFraction, HO0DaqFraction, HO12DaqFraction, HODaqFraction, DQMStore::pwd(), rootFolder_, MonitorElement::setAxisRange(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

117 {
118  if (debug_>0) std::cout<<"<HcalDAQInfo::beginJob>"<< std::endl;
119 
121  std::string currDir = dbe_->pwd();
122  if (debug_>0) std::cout << "--- Current Directory " << currDir << std::endl;
123  std::vector<MonitorElement*> mes = dbe_->getAllContents("");
124  if (debug_>0) std::cout << "found " << mes.size() << " monitoring elements:" << std::endl;
125 
126  dbe_->setCurrentFolder(rootFolder_+"/EventInfo/");
127 
128  HcalDaqFraction = dbe_->bookFloat("DAQSummary");
129 
130  DAQSummaryMap = dbe_->book2D("DAQSummaryMap","HcalDAQSummaryMap",7,0.,7.,1,0.,1.);
131  DAQSummaryMap->setAxisRange(-1,1,3);
132  DAQSummaryMap->setBinLabel(1,"HB");
133  DAQSummaryMap->setBinLabel(2,"HE");
134  DAQSummaryMap->setBinLabel(3,"HO");
135  DAQSummaryMap->setBinLabel(4,"HF");
136  DAQSummaryMap->setBinLabel(5,"H00");
137  DAQSummaryMap->setBinLabel(6,"H012");
138  DAQSummaryMap->setBinLabel(7,"HFlumi");
139  DAQSummaryMap->setBinLabel(1,"Status",2);
140 
141  dbe_->setCurrentFolder(rootFolder_+"/EventInfo/DAQContents/");
142  HBDaqFraction = dbe_->bookFloat("Hcal_HB");
143  HEDaqFraction = dbe_->bookFloat("Hcal_HE");
144  HODaqFraction = dbe_->bookFloat("Hcal_HO");
145  HFDaqFraction = dbe_->bookFloat("Hcal_HF");
146  HO0DaqFraction = dbe_->bookFloat("Hcal_HO0");
147  HO12DaqFraction = dbe_->bookFloat("Hcal_HO12");
148  HFlumiDaqFraction = dbe_->bookFloat("Hcal_HFlumi");
149 
150 }
void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * HO0DaqFraction
Definition: HcalDAQInfo.cc:73
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:891
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0) const
Definition: DQMStore.cc:1921
MonitorElement * DAQSummaryMap
Definition: HcalDAQInfo.cc:68
MonitorElement * HBDaqFraction
Definition: HcalDAQInfo.cc:69
MonitorElement * HFDaqFraction
Definition: HcalDAQInfo.cc:72
DQMStore * dbe_
Definition: HcalDAQInfo.cc:66
MonitorElement * HODaqFraction
Definition: HcalDAQInfo.cc:71
MonitorElement * HcalDaqFraction
Definition: HcalDAQInfo.cc:67
MonitorElement * HFlumiDaqFraction
Definition: HcalDAQInfo.cc:75
tuple cout
Definition: gather_cfg.py:121
std::string rootFolder_
Definition: HcalDAQInfo.cc:77
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1082
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
MonitorElement * HEDaqFraction
Definition: HcalDAQInfo.cc:70
const std::string & pwd(void) const
Definition: DQMStore.cc:639
MonitorElement * HO12DaqFraction
Definition: HcalDAQInfo.cc:74
void HcalDAQInfo::beginLuminosityBlock ( const edm::LuminosityBlock run,
const edm::EventSetup c 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 161 of file HcalDAQInfo.cc.

References gather_cfg::cout, and debug_.

162 {
163  if (debug_>0) std::cout<<"<HcalDAQInfo::beginLuminosityBlock>"<<std::endl;
164 }
tuple cout
Definition: gather_cfg.py:121
void HcalDAQInfo::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 154 of file HcalDAQInfo.cc.

References gather_cfg::cout, and debug_.

155 {
156  if (debug_>0) std::cout << "<HcalDAQInfo::endJob> " << std::endl;
157 }
tuple cout
Definition: gather_cfg.py:121
void HcalDAQInfo::endLuminosityBlock ( const edm::LuminosityBlock run,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 168 of file HcalDAQInfo.cc.

References gather_cfg::cout, DAQSummaryMap, dbe_, debug_, MonitorElement::Fill(), edm::EventSetup::find(), edm::eventsetup::heterocontainer::HCTypeTag::findType(), edm::EventSetup::get(), DQMStore::getAllContents(), HBDaqFraction, HcalDaqFraction, HEDaqFraction, HFDaqFraction, HFlumiDaqFraction, HO0DaqFraction, HO12DaqFraction, HODaqFraction, cuy::ii, DQMStore::pwd(), rootFolder_, MonitorElement::setBinContent(), DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

169 {
170  if (debug_>0) {
171  std::cout <<"<HcalDAQInfo::endLuminosityBlock> "<<std::endl;
173  std::string currDir = dbe_->pwd();
174  std::cout << "--- Current Directory " << currDir << std::endl;
175  std::vector<MonitorElement*> mes = dbe_->getAllContents("");
176  std::cout << "found " << mes.size() << " monitoring elements:" << std::endl;
177  }
178 
179  HcalDaqFraction->Fill(-1);
180 
181  for (int ii=0; ii<7; ii++) DAQSummaryMap->setBinContent(ii+1,1,-1);
182 
183  HBDaqFraction->Fill(-1);
184  HEDaqFraction->Fill(-1);
185  HODaqFraction->Fill(-1);
186  HFDaqFraction->Fill(-1);
187  HO0DaqFraction->Fill(-1);
188  HO12DaqFraction->Fill(-1);
189  HFlumiDaqFraction->Fill(-1);
190 
192 
193  if( iSetup.find( recordKey ) ) {
194 
195  edm::ESHandle<RunInfo> sumFED;
196  iSetup.get<RunInfoRcd>().get(sumFED);
197 
198  std::vector<int> FedsInIds= sumFED->m_fed_in;
199 
200  float HcalFedCount = 0.;
201  float HBFedCount = 0.;
202  float HEFedCount = 0.;
203  float HFFedCount = 0.;
204  float HOFedCount = 0.;
205  float HO0FedCount = 0.;
206  float HO12FedCount = 0.;
207  float HFlumiFedCount = 0.;
208 
209  // By FED taking into account Nchannels per FED
210 
211  for( unsigned int fedItr=0; fedItr<FedsInIds.size(); ++fedItr ) {
212 
213  int fedID=FedsInIds[fedItr];
214 
215  if (fedID >= 700 && fedID <= 731) {
216  HcalFedCount++;
217  if (fedID >= 700 && fedID <= 717) {
218  HBFedCount++;
219  HEFedCount++;
220  }
221  else if (fedID >= 718 && fedID <= 723) {
222  HFFedCount++;
223  HFlumiFedCount++;
224  }
225  else if (fedID >= 724 && fedID <= 731) {
226  if (fedID%2 == 0) {
227  HOFedCount += 276;
228  HO0FedCount += 84;
229  HO12FedCount += 192;
230  }
231  else {
232  HOFedCount += 264;
233  HO0FedCount += 60;
234  HO12FedCount += 204;
235  }
236  }
237  }
238 
239  //else if ( fedID == 735 ) std::cout<<fedID<<" -- LumiScaler"<<std::endl;
240  }
241 
242  HcalFedCount = (HBFedCount*144+HEFedCount*144+HFFedCount*288+HOFedCount)/9072;
243  HBFedCount /= 18;
244  HEFedCount /= 18;
245  HFFedCount /= 6;
246  HFlumiFedCount /= 6;
247  HOFedCount /= 2160;
248  HO0FedCount /= 576;
249  HO12FedCount /= 1584;
250 
251  DAQSummaryMap->setBinContent(1,1,HBFedCount);
252  DAQSummaryMap->setBinContent(2,1,HEFedCount);
253  DAQSummaryMap->setBinContent(3,1,HOFedCount);
254  DAQSummaryMap->setBinContent(4,1,HFFedCount);
255  DAQSummaryMap->setBinContent(5,1,HO0FedCount);
256  DAQSummaryMap->setBinContent(6,1,HO12FedCount);
257  DAQSummaryMap->setBinContent(7,1,HFlumiFedCount);
258 
259  HcalDaqFraction->Fill(HcalFedCount);
260  HBDaqFraction->Fill(HBFedCount);
261  HEDaqFraction->Fill(HEFedCount);
262  HFDaqFraction->Fill(HFFedCount);
263  HODaqFraction->Fill(HOFedCount);
264  HO0DaqFraction->Fill(HO0FedCount);
265  HO12DaqFraction->Fill(HO12FedCount);
266  HFlumiDaqFraction->Fill(HFlumiFedCount);
267 
268  if (debug_>0) {
269  std::cout<<" HcalFedCount= "<<HcalFedCount<<std::endl;
270  std::cout<<" HBFedCount= "<<HBFedCount<<std::endl;
271  std::cout<<" HEFedCount= "<<HEFedCount<<std::endl;
272  std::cout<<" HFFedCount= "<<HFFedCount<<std::endl;
273  std::cout<<" HOFedCount= "<<HOFedCount<<std::endl;
274  std::cout<<" HO0FedCount= "<<HO0FedCount<<std::endl;
275  std::cout<<" HO12FedCount= "<<HO12FedCount<<std::endl;
276  std::cout<<" HFlumiFedCount= "<<HFlumiFedCount<<std::endl;
277  }
278  }
279  else edm::LogInfo(rootFolder_+"/EventInfo/")<<"No RunInfoRcd"<<std::endl;
280 
281 // ---------------------- end of DAQ Info
282  if (debug_>0) std::cout << "HcalDAQInfo::MEfilled " << std::endl;
283 
284 }
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * HO0DaqFraction
Definition: HcalDAQInfo.cc:73
int ii
Definition: cuy.py:588
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
void Fill(long long x)
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0) const
Definition: DQMStore.cc:1921
MonitorElement * DAQSummaryMap
Definition: HcalDAQInfo.cc:68
MonitorElement * HBDaqFraction
Definition: HcalDAQInfo.cc:69
MonitorElement * HFDaqFraction
Definition: HcalDAQInfo.cc:72
DQMStore * dbe_
Definition: HcalDAQInfo.cc:66
MonitorElement * HODaqFraction
Definition: HcalDAQInfo.cc:71
const T & get() const
Definition: EventSetup.h:55
MonitorElement * HcalDaqFraction
Definition: HcalDAQInfo.cc:67
MonitorElement * HFlumiDaqFraction
Definition: HcalDAQInfo.cc:75
tuple cout
Definition: gather_cfg.py:121
std::string rootFolder_
Definition: HcalDAQInfo.cc:77
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
MonitorElement * HEDaqFraction
Definition: HcalDAQInfo.cc:70
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:125
const std::string & pwd(void) const
Definition: DQMStore.cc:639
MonitorElement * HO12DaqFraction
Definition: HcalDAQInfo.cc:74

Member Data Documentation

edm::ParameterSet HcalDAQInfo::conf_
private

Definition at line 65 of file HcalDAQInfo.cc.

MonitorElement* HcalDAQInfo::DAQSummaryMap
private

Definition at line 68 of file HcalDAQInfo.cc.

Referenced by beginJob(), and endLuminosityBlock().

DQMStore* HcalDAQInfo::dbe_
private

Definition at line 66 of file HcalDAQInfo.cc.

Referenced by beginJob(), endLuminosityBlock(), and HcalDAQInfo().

int HcalDAQInfo::debug_
private
MonitorElement* HcalDAQInfo::HBDaqFraction
private

Definition at line 69 of file HcalDAQInfo.cc.

Referenced by beginJob(), and endLuminosityBlock().

MonitorElement* HcalDAQInfo::HcalDaqFraction
private

Definition at line 67 of file HcalDAQInfo.cc.

Referenced by beginJob(), and endLuminosityBlock().

MonitorElement* HcalDAQInfo::HEDaqFraction
private

Definition at line 70 of file HcalDAQInfo.cc.

Referenced by beginJob(), and endLuminosityBlock().

MonitorElement* HcalDAQInfo::HFDaqFraction
private

Definition at line 72 of file HcalDAQInfo.cc.

Referenced by beginJob(), and endLuminosityBlock().

MonitorElement* HcalDAQInfo::HFlumiDaqFraction
private

Definition at line 75 of file HcalDAQInfo.cc.

Referenced by beginJob(), and endLuminosityBlock().

MonitorElement* HcalDAQInfo::HO0DaqFraction
private

Definition at line 73 of file HcalDAQInfo.cc.

Referenced by beginJob(), and endLuminosityBlock().

MonitorElement* HcalDAQInfo::HO12DaqFraction
private

Definition at line 74 of file HcalDAQInfo.cc.

Referenced by beginJob(), and endLuminosityBlock().

MonitorElement* HcalDAQInfo::HODaqFraction
private

Definition at line 71 of file HcalDAQInfo.cc.

Referenced by beginJob(), and endLuminosityBlock().

std::string HcalDAQInfo::rootFolder_
private

Definition at line 77 of file HcalDAQInfo.cc.

Referenced by beginJob(), endLuminosityBlock(), and HcalDAQInfo().