CMS 3D CMS Logo

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

#include <RPCDcsInfoClient.h>

Inheritance diagram for RPCDcsInfoClient:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 RPCDcsInfoClient (const edm::ParameterSet &ps)
 
 ~RPCDcsInfoClient ()
 
- 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 ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 
void endLuminosityBlock (const edm::LuminosityBlock &l, const edm::EventSetup &c)
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 
- 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)
 

Private Attributes

DQMStoredbe_
 
std::vector< int > DCS
 
std::string dcsinfofolder_
 

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 &)
 

Detailed Description

Definition at line 14 of file RPCDcsInfoClient.h.

Constructor & Destructor Documentation

RPCDcsInfoClient::RPCDcsInfoClient ( const edm::ParameterSet ps)
RPCDcsInfoClient::~RPCDcsInfoClient ( )

Definition at line 12 of file RPCDcsInfoClient.cc.

12 {}

Member Function Documentation

void RPCDcsInfoClient::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Implements edm::EDAnalyzer.

Definition at line 19 of file RPCDcsInfoClient.cc.

19 {}
void RPCDcsInfoClient::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 14 of file RPCDcsInfoClient.cc.

References DCS.

14  {
15  DCS.clear();
16  DCS.resize(10); // start with 10 LS, resize later
17 }
std::vector< int > DCS
void RPCDcsInfoClient::endLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 21 of file RPCDcsInfoClient.cc.

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

21  {
22  if (!dbe_) return;
23 
24  unsigned int nlumi = l.id().luminosityBlock() ;
25 
26  if (nlumi+1 > DCS.size()) DCS.resize(nlumi+1);
27 
28 
29  MonitorElement* DCSbyLS_ = dbe_->get(dcsinfofolder_ + "/DCSbyLS" );
30 
31  if ( !DCSbyLS_ ) return;
32 
33  if ( TH1F * h1 = DCSbyLS_->getTH1F()) {
34  int hvStatus = 0;
35 
36  if ( h1->GetBinContent(1) != 0 ) {
37  hvStatus = 0; // set to 0 because HV was off (!)
38  } else {
39  hvStatus = 1; // set to 1 because HV was on (!)
40  }
41 
42  DCS[nlumi] = hvStatus;
43  }
44 
45  return;
46 }
LuminosityBlockID id() const
std::vector< int > DCS
std::string dcsinfofolder_
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1708
TH1F * getTH1F(void) const
LuminosityBlockNumber_t luminosityBlock() const
void RPCDcsInfoClient::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 48 of file RPCDcsInfoClient.cc.

References DQMStore::book2D(), DQMStore::bookInt(), DQMStore::cd(), dbe_, DCS, dcsinfofolder_, MonitorElement::Fill(), DQMStore::get(), MonitorElement::getName(), i, DQMStore::removeElement(), MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

48  {
49 
50  // book
51  dbe_->cd();
53 
54  unsigned int nlsmax = DCS.size();
55  if (nlsmax > 900 ) nlsmax = 900;
56 
57  std::string meName = dcsinfofolder_ + "/rpcHVStatus";
58  MonitorElement* rpcHVStatus = dbe_->get(meName);
59  if (rpcHVStatus) dbe_->removeElement(rpcHVStatus->getName());
60 
61  rpcHVStatus = dbe_->book2D("rpcHVStatus","RPC HV Status", nlsmax, 1., nlsmax+1, 1, 0.5, 1.5);
62  rpcHVStatus->setAxisTitle("Luminosity Section", 1);
63  rpcHVStatus->setBinLabel(1,"",2);
64 
65  int lsCounter = 0;
66  // fill
67  for (unsigned int i = 0 ; i < nlsmax ; i++ ) {
68  rpcHVStatus->setBinContent(i+1,1,DCS[i]);
69  lsCounter +=DCS[i];
70  }
71 
72  meName = dcsinfofolder_ + "/rpcHV";
73  MonitorElement* rpcHV = dbe_->get(meName);
74  if (rpcHV) dbe_->removeElement(rpcHVStatus->getName());
75  rpcHV = dbe_->bookInt("rpcHV");
76 
77  rpcHV ->Fill(lsCounter);
78 
79  return;
80 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:644
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)
std::vector< int > DCS
void Fill(long long x)
void removeElement(const std::string &name)
Definition: DQMStore.cc:3143
std::string dcsinfofolder_
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1708
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:861
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 setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667

Member Data Documentation

DQMStore* RPCDcsInfoClient::dbe_
private

Definition at line 30 of file RPCDcsInfoClient.h.

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

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

Definition at line 32 of file RPCDcsInfoClient.h.

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

std::string RPCDcsInfoClient::dcsinfofolder_
private

Definition at line 28 of file RPCDcsInfoClient.h.

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