CMS 3D CMS Logo

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

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

Inheritance diagram for HcalDAQInfo:
DQMEDHarvester edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

virtual void dqmEndJob (DQMStore::IBooker &ib, DQMStore::IGetter &ig)
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &ib, DQMStore::IGetter &ig, edm::LuminosityBlock const &, edm::EventSetup const &)
 
 HcalDAQInfo (const edm::ParameterSet &)
 
 ~HcalDAQInfo ()
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDHarvester (void)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Public Attributes

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

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 87 of file HcalDAQInfo.cc.

References debug_, edm::ParameterSet::getUntrackedParameter(), HcalDaqFraction, NULL, rootFolder_, and AlCaHLTBitMon_QueryRunRegistry::string.

88 {
89  // now do what ever initialization is needed
90  debug_=iConfig.getUntrackedParameter<int>("debug",0);
91  rootFolder_ = iConfig.getUntrackedParameter<std::string>("subSystemFolder","Hcal");
92 
94 
95 }
T getUntrackedParameter(std::string const &, T const &) const
#define NULL
Definition: scimark2.h:8
MonitorElement * HcalDaqFraction
Definition: HcalDAQInfo.cc:62
std::string rootFolder_
Definition: HcalDAQInfo.cc:72
HcalDAQInfo::~HcalDAQInfo ( )

Definition at line 97 of file HcalDAQInfo.cc.

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

Member Function Documentation

virtual void HcalDAQInfo::dqmEndJob ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)
inlinevirtual

Implements DQMEDHarvester.

Definition at line 57 of file HcalDAQInfo.cc.

57 { }
void HcalDAQInfo::dqmEndLuminosityBlock ( DQMStore::IBooker ib,
DQMStore::IGetter ig,
edm::LuminosityBlock const &  run,
edm::EventSetup const &  iSetup 
)
virtual

Reimplemented from DQMEDHarvester.

Definition at line 110 of file HcalDAQInfo.cc.

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

111 {
112  if (debug_>0) {
113  std::cout <<"<HcalDAQInfo::endLuminosityBlock> "<<std::endl;
114  }
115 
116  // check that MonitorElements exist
117  // if not, book the histograms
118  if ( !HcalDaqFraction ) {
120  std::string currDir = ib.pwd();
121  if (debug_>0) std::cout << "--- Current Directory " << currDir << std::endl;
122 
123  ib.setCurrentFolder(rootFolder_+"/EventInfo/");
124 
125  HcalDaqFraction = ib.bookFloat("DAQSummary");
126 
127  DAQSummaryMap = ib.book2D("DAQSummaryMap","HcalDAQSummaryMap",7,0.,7.,1,0.,1.);
128  DAQSummaryMap->setAxisRange(-1,1,3);
129  DAQSummaryMap->setBinLabel(1,"HB");
130  DAQSummaryMap->setBinLabel(2,"HE");
131  DAQSummaryMap->setBinLabel(3,"HO");
132  DAQSummaryMap->setBinLabel(4,"HF");
133  DAQSummaryMap->setBinLabel(5,"H00");
134  DAQSummaryMap->setBinLabel(6,"H012");
135  DAQSummaryMap->setBinLabel(7,"HFlumi");
136  DAQSummaryMap->setBinLabel(1,"Status",2);
137 
138  ib.setCurrentFolder(rootFolder_+"/EventInfo/DAQContents/");
139  HBDaqFraction = ib.bookFloat("Hcal_HB");
140  HEDaqFraction = ib.bookFloat("Hcal_HE");
141  HODaqFraction = ib.bookFloat("Hcal_HO");
142  HFDaqFraction = ib.bookFloat("Hcal_HF");
143  HO0DaqFraction = ib.bookFloat("Hcal_HO0");
144  HO12DaqFraction = ib.bookFloat("Hcal_HO12");
145  HFlumiDaqFraction = ib.bookFloat("Hcal_HFlumi");
146  }
147 
148  HcalDaqFraction->Fill(-1);
149 
150  for (int ii=0; ii<7; ii++) DAQSummaryMap->setBinContent(ii+1,1,-1);
151 
152  HBDaqFraction->Fill(-1);
153  HEDaqFraction->Fill(-1);
154  HODaqFraction->Fill(-1);
155  HFDaqFraction->Fill(-1);
156  HO0DaqFraction->Fill(-1);
157  HO12DaqFraction->Fill(-1);
158  HFlumiDaqFraction->Fill(-1);
159 
161 
162  if( iSetup.find( recordKey ) ) {
163 
164  edm::ESHandle<RunInfo> sumFED;
165  iSetup.get<RunInfoRcd>().get(sumFED);
166 
167  std::vector<int> FedsInIds= sumFED->m_fed_in;
168 
169  float HcalFedCount = 0.;
170  float HBFedCount = 0.;
171  float HEFedCount = 0.;
172  float HFFedCount = 0.;
173  float HOFedCount = 0.;
174  float HO0FedCount = 0.;
175  float HO12FedCount = 0.;
176  float HFlumiFedCount = 0.;
177 
178  // By FED taking into account Nchannels per FED
179 
180  for( unsigned int fedItr=0; fedItr<FedsInIds.size(); ++fedItr ) {
181 
182  int fedID=FedsInIds[fedItr];
183 
184  if (fedID >= 700 && fedID <= 731) {
185  HcalFedCount++;
186  if (fedID >= 700 && fedID <= 717) {
187  HBFedCount++;
188  HEFedCount++;
189  }
190  else if (fedID >= 718 && fedID <= 723) {
191  HFFedCount++;
192  HFlumiFedCount++;
193  }
194  else if (fedID >= 724 && fedID <= 731) {
195  if (fedID%2 == 0) {
196  HOFedCount += 276;
197  HO0FedCount += 84;
198  HO12FedCount += 192;
199  }
200  else {
201  HOFedCount += 264;
202  HO0FedCount += 60;
203  HO12FedCount += 204;
204  }
205  }
206  }
207 
208  //else if ( fedID == 735 ) std::cout<<fedID<<" -- LumiScaler"<<std::endl;
209  }
210 
211  HcalFedCount = (HBFedCount*144+HEFedCount*144+HFFedCount*288+HOFedCount)/9072;
212  HBFedCount /= 18;
213  HEFedCount /= 18;
214  HFFedCount /= 6;
215  HFlumiFedCount /= 6;
216  HOFedCount /= 2160;
217  HO0FedCount /= 576;
218  HO12FedCount /= 1584;
219 
220  DAQSummaryMap->setBinContent(1,1,HBFedCount);
221  DAQSummaryMap->setBinContent(2,1,HEFedCount);
222  DAQSummaryMap->setBinContent(3,1,HOFedCount);
223  DAQSummaryMap->setBinContent(4,1,HFFedCount);
224  DAQSummaryMap->setBinContent(5,1,HO0FedCount);
225  DAQSummaryMap->setBinContent(6,1,HO12FedCount);
226  DAQSummaryMap->setBinContent(7,1,HFlumiFedCount);
227 
228  HcalDaqFraction->Fill(HcalFedCount);
229  HBDaqFraction->Fill(HBFedCount);
230  HEDaqFraction->Fill(HEFedCount);
231  HFDaqFraction->Fill(HFFedCount);
232  HODaqFraction->Fill(HOFedCount);
233  HO0DaqFraction->Fill(HO0FedCount);
234  HO12DaqFraction->Fill(HO12FedCount);
235  HFlumiDaqFraction->Fill(HFlumiFedCount);
236 
237  if (debug_>0) {
238  std::cout<<" HcalFedCount= "<<HcalFedCount<<std::endl;
239  std::cout<<" HBFedCount= "<<HBFedCount<<std::endl;
240  std::cout<<" HEFedCount= "<<HEFedCount<<std::endl;
241  std::cout<<" HFFedCount= "<<HFFedCount<<std::endl;
242  std::cout<<" HOFedCount= "<<HOFedCount<<std::endl;
243  std::cout<<" HO0FedCount= "<<HO0FedCount<<std::endl;
244  std::cout<<" HO12FedCount= "<<HO12FedCount<<std::endl;
245  std::cout<<" HFlumiFedCount= "<<HFlumiFedCount<<std::endl;
246  }
247  }
248  else edm::LogInfo(rootFolder_+"/EventInfo/")<<"No RunInfoRcd"<<std::endl;
249 
250 // ---------------------- end of DAQ Info
251  if (debug_>0) std::cout << "HcalDAQInfo::MEfilled " << std::endl;
252 
253 }
void setBinContent(int binx, double content)
set content of bin (1-D)
void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
const std::string & pwd(void)
Definition: DQMStore.cc:282
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:68
int ii
Definition: cuy.py:588
void Fill(long long x)
MonitorElement * DAQSummaryMap
Definition: HcalDAQInfo.cc:63
MonitorElement * HBDaqFraction
Definition: HcalDAQInfo.cc:64
MonitorElement * HFDaqFraction
Definition: HcalDAQInfo.cc:67
MonitorElement * HODaqFraction
Definition: HcalDAQInfo.cc:66
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * HcalDaqFraction
Definition: HcalDAQInfo.cc:62
MonitorElement * HFlumiDaqFraction
Definition: HcalDAQInfo.cc:70
tuple cout
Definition: gather_cfg.py:121
std::string rootFolder_
Definition: HcalDAQInfo.cc:72
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * HEDaqFraction
Definition: HcalDAQInfo.cc:65
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
MonitorElement * HO12DaqFraction
Definition: HcalDAQInfo.cc:69

Member Data Documentation

edm::ParameterSet HcalDAQInfo::conf_

Definition at line 61 of file HcalDAQInfo.cc.

MonitorElement* HcalDAQInfo::DAQSummaryMap

Definition at line 63 of file HcalDAQInfo.cc.

Referenced by dqmEndLuminosityBlock().

int HcalDAQInfo::debug_

Definition at line 71 of file HcalDAQInfo.cc.

Referenced by dqmEndLuminosityBlock(), and HcalDAQInfo().

MonitorElement* HcalDAQInfo::HBDaqFraction

Definition at line 64 of file HcalDAQInfo.cc.

Referenced by dqmEndLuminosityBlock().

MonitorElement* HcalDAQInfo::HcalDaqFraction

Definition at line 62 of file HcalDAQInfo.cc.

Referenced by dqmEndLuminosityBlock(), and HcalDAQInfo().

MonitorElement* HcalDAQInfo::HEDaqFraction

Definition at line 65 of file HcalDAQInfo.cc.

Referenced by dqmEndLuminosityBlock().

MonitorElement* HcalDAQInfo::HFDaqFraction

Definition at line 67 of file HcalDAQInfo.cc.

Referenced by dqmEndLuminosityBlock().

MonitorElement* HcalDAQInfo::HFlumiDaqFraction

Definition at line 70 of file HcalDAQInfo.cc.

Referenced by dqmEndLuminosityBlock().

MonitorElement* HcalDAQInfo::HO0DaqFraction

Definition at line 68 of file HcalDAQInfo.cc.

Referenced by dqmEndLuminosityBlock().

MonitorElement* HcalDAQInfo::HO12DaqFraction

Definition at line 69 of file HcalDAQInfo.cc.

Referenced by dqmEndLuminosityBlock().

MonitorElement* HcalDAQInfo::HODaqFraction

Definition at line 66 of file HcalDAQInfo.cc.

Referenced by dqmEndLuminosityBlock().

std::string HcalDAQInfo::rootFolder_

Definition at line 72 of file HcalDAQInfo.cc.

Referenced by dqmEndLuminosityBlock(), and HcalDAQInfo().