CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
DQMDcsInfoClient Class Reference

#include <DQMDcsInfoClient.h>

Inheritance diagram for DQMDcsInfoClient:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 DQMDcsInfoClient (const edm::ParameterSet &ps)
 
 ~DQMDcsInfoClient () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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)
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
void beginRun (const edm::Run &r, const edm::EventSetup &c) override
 
void endLuminosityBlock (const edm::LuminosityBlock &l, const edm::EventSetup &c) override
 
void endRun (const edm::Run &r, const edm::EventSetup &c) override
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ESProduct , Transition Tr = Transition::Event>
auto esConsumes (eventsetup::EventSetupRecordKey const &, ESInputTag const &tag)
 
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)
 

Private Attributes

DQMStoredbe_
 
std::vector< int > DCS
 
std::string dcsinfofolder_
 
MonitorElementmeProcessedLS_
 
edm::ParameterSet parameters_
 
std::set< unsigned int > processedLS_
 
MonitorElementreportSummary_
 
MonitorElementreportSummaryMap_
 
std::string subsystemname_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Detailed Description

Definition at line 25 of file DQMDcsInfoClient.h.

Constructor & Destructor Documentation

DQMDcsInfoClient::DQMDcsInfoClient ( const edm::ParameterSet ps)
DQMDcsInfoClient::~DQMDcsInfoClient ( )
overridedefault

Referenced by DQMDcsInfoClient().

Member Function Documentation

void DQMDcsInfoClient::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotected

Definition at line 48 of file DQMDcsInfoClient.cc.

49 {
50  return;
51 }
void DQMDcsInfoClient::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprotected

Definition at line 31 of file DQMDcsInfoClient.cc.

References DQMStore::bookString(), DQMStore::cd(), dbe_, DCS, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), edm::getProcessParameterSetContainingModule(), edm::EDAnalyzer::moduleDescription(), processedLS_, DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and subsystemname_.

32 {
33  // Fetch GlobalTag information and fill the string/ME.
34  dbe_->cd();
35  dbe_->setCurrentFolder(subsystemname_ +"/CMSSWInfo/");
36  const edm::ParameterSet &globalTagPSet =
38  .getParameterSet("PoolDBESSource@GlobalTag");
39 
40  dbe_->bookString("globalTag_Harvesting", globalTagPSet.getParameter<std::string>("globaltag"));
41 
42  DCS.clear();
43  DCS.resize(10); // start with 10 LS, resize later
44  processedLS_.clear();
45 }
T getParameter(std::string const &) const
std::set< unsigned int > processedLS_
std::string subsystemname_
ParameterSet const & getProcessParameterSetContainingModule(ModuleDescription const &moduleDescription)
ModuleDescription const & moduleDescription() const
Definition: EDAnalyzer.h:44
MonitorElement * bookString(char_string const &name, char_string const &value)
Book string.
Definition: DQMStore.cc:1057
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:565
std::vector< int > DCS
void cd()
go to top directory (ie. root)
Definition: DQMStore.cc:540
ParameterSet const & getParameterSet(std::string const &) const
void DQMDcsInfoClient::endLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup c 
)
overrideprotected

Definition at line 54 of file DQMDcsInfoClient.cc.

References dbe_, DCS, dcsinfofolder_, DQMStore::get(), MonitorElement::getTH1F(), mps_fire::i, edm::LuminosityBlockBase::id(), edm::LuminosityBlockID::luminosityBlock(), processedLS_, and subsystemname_.

55 {
56  if (!dbe_) return;
57 
58  unsigned int nlumi = l.id().luminosityBlock() ;
59  processedLS_.insert(nlumi);
60  // cout << " in lumi section " << nlumi << endl;
61 
62  if (nlumi+1 > DCS.size())
63  DCS.resize(nlumi+1);
64  // cout << "DCS size: " << DCS.size() << endl;
65 
66  MonitorElement* DCSbyLS_ =
67  dbe_->get(subsystemname_ + "/" + dcsinfofolder_ + "/DCSbyLS" );
68 
69  if ( DCSbyLS_ )
70  {
71  if ( TH1F * h1 = DCSbyLS_->getTH1F())
72  {
73  int word = 0;
74  for (int i = 0; i < 25 ; i++)
75  {
76 
77  if ( h1->GetBinContent(i+1) != 0 )
78  word |= (0x0 << i); // set to 0 because HV was off (!)
79  else
80  word |= (0x1 << i); // set to 1 because HV was on (!)
81  }
82  DCS[nlumi] = word;
83  }
84  }
85  return;
86 }
LuminosityBlockID id() const
std::string dcsinfofolder_
std::set< unsigned int > processedLS_
std::string subsystemname_
TH1F * getTH1F() const
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
Definition: DQMStore.cc:1601
std::vector< int > DCS
LuminosityBlockNumber_t luminosityBlock() const
void DQMDcsInfoClient::endRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprotected

Definition at line 89 of file DQMDcsInfoClient.cc.

References DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookFloat(), DQMStore::cd(), dbe_, DCS, MonitorElement::Fill(), DQMStore::get(), MonitorElement::getName(), mps_fire::i, meProcessedLS_, processedLS_, DQMStore::removeElement(), reportSummary_, reportSummaryMap_, MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), subsystemname_, and globals_cff::x1.

90 {
91 
92  // book
93  dbe_->cd();
94  dbe_->setCurrentFolder(subsystemname_ +"/EventInfo/");
95 
96  unsigned int nlsmax = DCS.size();
97  reportSummary_=dbe_->bookFloat("reportSummary");
98  reportSummary_->Fill(1.);
99 
100  reportSummaryMap_ = dbe_->get(subsystemname_ +"/EventInfo/reportSummaryMap");
102 
103  reportSummaryMap_ = dbe_->book2D("reportSummaryMap",
104  "HV and GT vs Lumi", nlsmax, 0., nlsmax, 25, 0., 25.);
105  unsigned int lastProcessedLS = *(--processedLS_.end());
106  meProcessedLS_ = dbe_->book1D("ProcessedLS",
107  "Processed Lumisections",
108  lastProcessedLS+1,
109  0.,lastProcessedLS+1);
110  reportSummaryMap_->setBinLabel( 1, "CSC+" , 2);
111  reportSummaryMap_->setBinLabel( 2, "CSC-" , 2);
112  reportSummaryMap_->setBinLabel( 3, "DT0" , 2);
113  reportSummaryMap_->setBinLabel( 4, "DT+" , 2);
114  reportSummaryMap_->setBinLabel( 5, "DT-" , 2);
115  reportSummaryMap_->setBinLabel( 6, "EB+" , 2);
116  reportSummaryMap_->setBinLabel( 7, "EB-" , 2);
117  reportSummaryMap_->setBinLabel( 8, "EE+" , 2);
118  reportSummaryMap_->setBinLabel( 9, "EE-" , 2);
119  reportSummaryMap_->setBinLabel(10, "ES+" , 2);
120  reportSummaryMap_->setBinLabel(11, "ES-" , 2);
121  reportSummaryMap_->setBinLabel(12, "HBHEa" , 2);
122  reportSummaryMap_->setBinLabel(13, "HBHEb" , 2);
123  reportSummaryMap_->setBinLabel(14, "HBHEc" , 2);
124  reportSummaryMap_->setBinLabel(15, "HF" , 2);
125  reportSummaryMap_->setBinLabel(16, "HO" , 2);
126  reportSummaryMap_->setBinLabel(17, "BPIX" , 2);
127  reportSummaryMap_->setBinLabel(18, "FPIX" , 2);
128  reportSummaryMap_->setBinLabel(19, "RPC" , 2);
129  reportSummaryMap_->setBinLabel(20, "TIBTID" , 2);
130  reportSummaryMap_->setBinLabel(21, "TOB" , 2);
131  reportSummaryMap_->setBinLabel(22, "TECp" , 2);
132  reportSummaryMap_->setBinLabel(23, "TECm" , 2);
133  reportSummaryMap_->setBinLabel(24, "CASTOR" , 2);
134  reportSummaryMap_->setBinLabel(25, "PhysDecl", 2);
135  reportSummaryMap_->setAxisTitle("Luminosity Section");
136 
137  // fill
138  for (unsigned int i = 0 ; i < DCS.size() ; i++ )
139  {
140  for ( int j = 0 ; j < 25 ; j++ )
141  {
142  if (DCS[i] & (0x1 << j))
144  else
146  }
147  }
148 
149  std::set<unsigned int>::iterator it,ite;
150  it = processedLS_.begin();
151  ite = processedLS_.end();
152  unsigned int lastAccessed = 0;
153 
154  for (; it!=ite; it++)
155  {
156  while (lastAccessed < (*it))
157  {
158  // std::cout << "Filling " << lastAccessed << " with -1" << std::endl;
159  meProcessedLS_->Fill(lastAccessed, -1.);
160  lastAccessed++;
161  }
162  // std::cout << "Filling " << *it << " with 1" << std::endl;
163  meProcessedLS_->Fill(*it);
164  lastAccessed = (*it)+1;
165  }
166 
167 }
MonitorElement * book2D(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1161
void setBinContent(int binx, double content)
set content of bin (1-D)
std::set< unsigned int > processedLS_
std::string subsystemname_
void removeElement(std::string const &name)
Definition: DQMStore.cc:3104
MonitorElement * meProcessedLS_
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)
const std::string & getName() const
get name of ME
MonitorElement * book1D(char_string const &name, char_string const &title, int const nchX, double const lowX, double const highX)
Book 1D histogram.
Definition: DQMStore.cc:1086
MonitorElement * bookFloat(char_string const &name)
Book float.
Definition: DQMStore.cc:1036
void Fill(long long x)
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
Definition: DQMStore.cc:1601
MonitorElement * reportSummary_
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:565
std::vector< int > DCS
void cd()
go to top directory (ie. root)
Definition: DQMStore.cc:540
MonitorElement * reportSummaryMap_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

Member Data Documentation

DQMStore* DQMDcsInfoClient::dbe_
private

Definition at line 43 of file DQMDcsInfoClient.h.

Referenced by beginRun(), DQMDcsInfoClient(), endLuminosityBlock(), and endRun().

std::vector<int> DQMDcsInfoClient::DCS
private

Definition at line 45 of file DQMDcsInfoClient.h.

Referenced by beginRun(), endLuminosityBlock(), and endRun().

std::string DQMDcsInfoClient::dcsinfofolder_
private

Definition at line 41 of file DQMDcsInfoClient.h.

Referenced by DQMDcsInfoClient(), and endLuminosityBlock().

MonitorElement* DQMDcsInfoClient::meProcessedLS_
private

Definition at line 52 of file DQMDcsInfoClient.h.

Referenced by endRun().

edm::ParameterSet DQMDcsInfoClient::parameters_
private
std::set<unsigned int> DQMDcsInfoClient::processedLS_
private

Definition at line 46 of file DQMDcsInfoClient.h.

Referenced by beginRun(), endLuminosityBlock(), and endRun().

MonitorElement* DQMDcsInfoClient::reportSummary_
private

Definition at line 50 of file DQMDcsInfoClient.h.

Referenced by endRun().

MonitorElement* DQMDcsInfoClient::reportSummaryMap_
private

Definition at line 51 of file DQMDcsInfoClient.h.

Referenced by endRun().

std::string DQMDcsInfoClient::subsystemname_
private

Definition at line 40 of file DQMDcsInfoClient.h.

Referenced by beginRun(), DQMDcsInfoClient(), endLuminosityBlock(), and endRun().