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

Public Member Functions

 DQMDcsInfoClient (const edm::ParameterSet &ps)
 
 ~DQMDcsInfoClient () override
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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
 
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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void beginRun (const edm::Run &r, const edm::EventSetup &c) override
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, const edm::LuminosityBlock &l, 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 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

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::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 Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 25 of file DQMDcsInfoClient.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file DQMDcsInfoClient.cc.

References dcsinfofolder_, edm::ParameterSet::getUntrackedParameter(), parameters_, AlCaHLTBitMon_QueryRunRegistry::string, subsystemname_, and ~DQMDcsInfoClient().

16  {
17 
18  parameters_ = ps;
19 
20  subsystemname_ = parameters_.getUntrackedParameter<std::string>("subSystemFolder", "Info") ;
21  dcsinfofolder_ = parameters_.getUntrackedParameter<std::string>("dcsInfoFolder", "DcsInfo") ;
22 
23 }
std::string dcsinfofolder_
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet parameters_
std::string subsystemname_
DQMDcsInfoClient::~DQMDcsInfoClient ( )
overridedefault

Referenced by DQMDcsInfoClient().

Member Function Documentation

void DQMDcsInfoClient::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprotected

Definition at line 29 of file DQMDcsInfoClient.cc.

References DCS, and processedLS_.

30 {
31  DCS.clear();
32  DCS.resize(10); // start with 10 LS, resize later
33  processedLS_.clear();
34 }
std::set< unsigned int > processedLS_
std::vector< int > DCS
void DQMDcsInfoClient::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 70 of file DQMDcsInfoClient.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), DQMStore::IBooker::bookString(), DQMStore::IBooker::cd(), DCS, MonitorElement::Fill(), DQMStore::IGetter::get(), edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), edm::getProcessParameterSetContainingModule(), mps_fire::i, eostools::ls(), meProcessedLS_, edm::one::EDProducerBase::moduleDescription(), processedLS_, reportSummary_, reportSummaryMap_, MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, subsystemname_, and globals_cff::x1.

71 {
72  // Fetch GlobalTag information and fill the string/ME.
73  ibooker.cd();
74  ibooker.setCurrentFolder(subsystemname_ +"/CMSSWInfo/");
75  const edm::ParameterSet &globalTagPSet =
77  .getParameterSet("PoolDBESSource@GlobalTag");
78 
79  ibooker.bookString("globalTag_Harvesting", globalTagPSet.getParameter<std::string>("globaltag"));
80 
81  ibooker.cd();
82  ibooker.setCurrentFolder(subsystemname_ +"/EventInfo/");
83 
84  unsigned int nlsmax = DCS.size();
85  reportSummary_=ibooker.bookFloat("reportSummary");
86  reportSummary_->Fill(1.);
87 
88  reportSummaryMap_ = igetter.get(subsystemname_ +"/EventInfo/reportSummaryMap");
89  assert(!reportSummaryMap_); // this would be a configuration problem
90 
91  reportSummaryMap_ = ibooker.book2D("reportSummaryMap",
92  "HV and GT vs Lumi", nlsmax, 0., nlsmax, 25, 0., 25.);
93  if (processedLS_.empty()) return;
94  unsigned int lastProcessedLS = *(--processedLS_.end());
95  meProcessedLS_ = ibooker.book1D("ProcessedLS",
96  "Processed Lumisections",
97  lastProcessedLS+1,
98  0.,lastProcessedLS+1);
99  reportSummaryMap_->setBinLabel( 1, "CSC+" , 2);
100  reportSummaryMap_->setBinLabel( 2, "CSC-" , 2);
101  reportSummaryMap_->setBinLabel( 3, "DT0" , 2);
102  reportSummaryMap_->setBinLabel( 4, "DT+" , 2);
103  reportSummaryMap_->setBinLabel( 5, "DT-" , 2);
104  reportSummaryMap_->setBinLabel( 6, "EB+" , 2);
105  reportSummaryMap_->setBinLabel( 7, "EB-" , 2);
106  reportSummaryMap_->setBinLabel( 8, "EE+" , 2);
107  reportSummaryMap_->setBinLabel( 9, "EE-" , 2);
108  reportSummaryMap_->setBinLabel(10, "ES+" , 2);
109  reportSummaryMap_->setBinLabel(11, "ES-" , 2);
110  reportSummaryMap_->setBinLabel(12, "HBHEa" , 2);
111  reportSummaryMap_->setBinLabel(13, "HBHEb" , 2);
112  reportSummaryMap_->setBinLabel(14, "HBHEc" , 2);
113  reportSummaryMap_->setBinLabel(15, "HF" , 2);
114  reportSummaryMap_->setBinLabel(16, "HO" , 2);
115  reportSummaryMap_->setBinLabel(17, "BPIX" , 2);
116  reportSummaryMap_->setBinLabel(18, "FPIX" , 2);
117  reportSummaryMap_->setBinLabel(19, "RPC" , 2);
118  reportSummaryMap_->setBinLabel(20, "TIBTID" , 2);
119  reportSummaryMap_->setBinLabel(21, "TOB" , 2);
120  reportSummaryMap_->setBinLabel(22, "TECp" , 2);
121  reportSummaryMap_->setBinLabel(23, "TECm" , 2);
122  reportSummaryMap_->setBinLabel(24, "CASTOR" , 2);
123  reportSummaryMap_->setBinLabel(25, "PhysDecl", 2);
124  reportSummaryMap_->setAxisTitle("Luminosity Section");
125 
126  // fill
127  for (unsigned int i = 0 ; i < DCS.size() ; i++ )
128  {
129  for ( int j = 0 ; j < 25 ; j++ )
130  {
131  if (DCS[i] & (0x1 << j))
133  else
135  }
136  }
137 
138  unsigned int lastAccessed = 0;
139 
140  for (auto ls : processedLS_)
141  {
142  while (lastAccessed < ls)
143  {
144  // std::cout << "Filling " << lastAccessed << " with -1" << std::endl;
145  meProcessedLS_->Fill(lastAccessed, -1.);
146  lastAccessed++;
147  }
148  // std::cout << "Filling " << *it << " with 1" << std::endl;
150  lastAccessed = ls+1;
151  }
152 }
T getParameter(std::string const &) const
void setBinContent(int binx, double content)
set content of bin (1-D)
std::set< unsigned int > processedLS_
std::string subsystemname_
MonitorElement * meProcessedLS_
MonitorElement * bookString(Args &&...args)
Definition: DQMStore.h:103
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)
ModuleDescription const & moduleDescription() const
ParameterSet const & getProcessParameterSetContainingModule(ModuleDescription const &moduleDescription)
void Fill(long long x)
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * reportSummary_
MonitorElement * get(std::string const &path)
Definition: DQMStore.cc:303
def ls(path, rec=False)
Definition: eostools.py:349
std::vector< int > DCS
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
ParameterSet const & getParameterSet(std::string const &) const
MonitorElement * reportSummaryMap_
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:105
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void DQMDcsInfoClient::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
const edm::LuminosityBlock l,
const edm::EventSetup c 
)
overrideprotected

Definition at line 37 of file DQMDcsInfoClient.cc.

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

38 {
39  unsigned int nlumi = l.id().luminosityBlock() ;
40  processedLS_.insert(nlumi);
41  // cout << " in lumi section " << nlumi << endl;
42 
43  if (nlumi+1 > DCS.size())
44  DCS.resize(nlumi+1);
45  // cout << "DCS size: " << DCS.size() << endl;
46 
47  MonitorElement* DCSbyLS_ =
48  igetter.get(subsystemname_ + "/" + dcsinfofolder_ + "/DCSbyLS" );
49 
50  if ( DCSbyLS_ )
51  {
52  if ( TH1F * h1 = DCSbyLS_->getTH1F())
53  {
54  int word = 0;
55  for (int i = 0; i < 25 ; i++)
56  {
57 
58  if ( h1->GetBinContent(i+1) != 0 )
59  word |= (0x0 << i); // set to 0 because HV was off (!)
60  else
61  word |= (0x1 << i); // set to 1 because HV was on (!)
62  }
63  DCS[nlumi] = word;
64  }
65  }
66  return;
67 }
LuminosityBlockID id() const
std::string dcsinfofolder_
std::set< unsigned int > processedLS_
std::string subsystemname_
TH1F * getTH1F() const
MonitorElement * get(std::string const &path)
Definition: DQMStore.cc:303
std::vector< int > DCS
LuminosityBlockNumber_t luminosityBlock() const

Member Data Documentation

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

Definition at line 43 of file DQMDcsInfoClient.h.

Referenced by beginRun(), dqmEndJob(), and dqmEndLuminosityBlock().

std::string DQMDcsInfoClient::dcsinfofolder_
private

Definition at line 40 of file DQMDcsInfoClient.h.

Referenced by DQMDcsInfoClient(), and dqmEndLuminosityBlock().

MonitorElement* DQMDcsInfoClient::meProcessedLS_
private

Definition at line 50 of file DQMDcsInfoClient.h.

Referenced by dqmEndJob().

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

Definition at line 44 of file DQMDcsInfoClient.h.

Referenced by beginRun(), dqmEndJob(), and dqmEndLuminosityBlock().

MonitorElement* DQMDcsInfoClient::reportSummary_
private

Definition at line 48 of file DQMDcsInfoClient.h.

Referenced by dqmEndJob().

MonitorElement* DQMDcsInfoClient::reportSummaryMap_
private

Definition at line 49 of file DQMDcsInfoClient.h.

Referenced by dqmEndJob().

std::string DQMDcsInfoClient::subsystemname_
private

Definition at line 39 of file DQMDcsInfoClient.h.

Referenced by DQMDcsInfoClient(), dqmEndJob(), and dqmEndLuminosityBlock().