CMS 3D CMS Logo

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

#include <DQMDcsInfo.h>

Inheritance diagram for DQMDcsInfo:
one::DQMEDAnalyzer< one::DQMLuminosityBlockElements > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

 DQMDcsInfo (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DQMDcsInfo () override
 Destructor. More...
 
- Public Member Functions inherited from one::DQMEDAnalyzer< one::DQMLuminosityBlockElements >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 Analyze. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void endLuminosityBlock (const edm::LuminosityBlock &l, const edm::EventSetup &c) override
 

Private Member Functions

void makeDcsInfo (const edm::Event &e)
 
void makeGtInfo (const edm::Event &e)
 

Private Attributes

bool dcs [25]
 
MonitorElementDCSbyLS_
 
std::string dcsinfofolder_
 
edm::EDGetTokenT< DcsStatusCollectiondcsStatusCollection_
 
edm::EDGetTokenT< L1GlobalTriggerReadoutRecordgtCollection_
 
edm::ParameterSet parameters_
 
std::string subsystemname_
 

Detailed Description

Definition at line 25 of file DQMDcsInfo.h.

Constructor & Destructor Documentation

DQMDcsInfo::DQMDcsInfo ( const edm::ParameterSet ps)

Constructor.

Definition at line 16 of file DQMDcsInfo.cc.

References dcs, dcsinfofolder_, dcsStatusCollection_, edm::ParameterSet::getUntrackedParameter(), gtCollection_, parameters_, AlCaHLTBitMon_QueryRunRegistry::string, subsystemname_, and ~DQMDcsInfo().

17 {
18 
19  parameters_ = ps;
20 
21  subsystemname_ = parameters_.getUntrackedParameter<std::string>("subSystemFolder", "Info") ;
22  dcsinfofolder_ = parameters_.getUntrackedParameter<std::string>("dcsInfoFolder", "DcsInfo") ;
23  gtCollection_ = consumes<L1GlobalTriggerReadoutRecord>(parameters_.getUntrackedParameter<std::string>("gtCollection","gtDigis"));
24  dcsStatusCollection_ = consumes<DcsStatusCollection>(parameters_.getUntrackedParameter<std::string>("dcsStatusCollection","scalersRawToDigi"));
25 
26  // initialize
27  for (bool & dc : dcs) dc=true;
28 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtCollection_
Definition: DQMDcsInfo.h:50
edm::ParameterSet parameters_
Definition: DQMDcsInfo.h:47
bool dcs[25]
Definition: DQMDcsInfo.h:53
std::string dcsinfofolder_
Definition: DQMDcsInfo.h:49
std::string subsystemname_
Definition: DQMDcsInfo.h:48
edm::EDGetTokenT< DcsStatusCollection > dcsStatusCollection_
Definition: DQMDcsInfo.h:51
DQMDcsInfo::~DQMDcsInfo ( )
overridedefault

Destructor.

Referenced by DQMDcsInfo().

Member Function Documentation

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

Analyze.

Definition at line 56 of file DQMDcsInfo.cc.

References makeDcsInfo(), and makeGtInfo().

56  {
57 
58  makeDcsInfo(e);
59  makeGtInfo(e);
60 
61  return;
62 }
void makeDcsInfo(const edm::Event &e)
Definition: DQMDcsInfo.cc:86
void makeGtInfo(const edm::Event &e)
Definition: DQMDcsInfo.cc:135
void DQMDcsInfo::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotected

Definition at line 32 of file DQMDcsInfo.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::bookString(), DQMStore::IBooker::cd(), dcs, DCSbyLS_, dcsinfofolder_, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), edm::getProcessParameterSetContainingModule(), DQMStore::IBooker::setCurrentFolder(), MonitorElement::setLumiFlag(), AlCaHLTBitMon_QueryRunRegistry::string, and subsystemname_.

34  {
35 
36  // Fetch GlobalTag information and fill the string/ME.
37  ibooker.cd();
38  ibooker.setCurrentFolder(subsystemname_ +"/CMSSWInfo/");
39 
40  const edm::ParameterSet &globalTagPSet =
42  .getParameterSet("PoolDBESSource@GlobalTag");
43 
44  ibooker.bookString("globalTag_Step1", globalTagPSet.getParameter<std::string>("globaltag"));
45 
46  ibooker.cd();
48 
49  DCSbyLS_ = ibooker.book1D("DCSbyLS","DCS",25,0.,25.);
51 
52  // initialize
53  for (bool & dc : dcs) dc=true;
54 }
T getParameter(std::string const &) const
MonitorElement * bookString(Args &&...args)
Definition: DQMStore.h:103
ParameterSet const & getProcessParameterSetContainingModule(ModuleDescription const &moduleDescription)
void setLumiFlag()
this ME is meant to be stored for each luminosity section
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
bool dcs[25]
Definition: DQMDcsInfo.h:53
ParameterSet const & getParameterSet(std::string const &) const
std::string dcsinfofolder_
Definition: DQMDcsInfo.h:49
std::string subsystemname_
Definition: DQMDcsInfo.h:48
MonitorElement * DCSbyLS_
Definition: DQMDcsInfo.h:55
void DQMDcsInfo::endLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup c 
)
overrideprotected

Definition at line 65 of file DQMDcsInfo.cc.

References dcs, DCSbyLS_, mps_fire::i, and MonitorElement::setBinContent().

66 {
67  // int nlumi = l.id().luminosityBlock();
68 
69  // fill dcs vs lumi
70  /* set those bins 0 for which bits are ON
71  needed for merge off lumi histograms across files */
72  for (int i=0;i<25;i++)
73  {
74  if (dcs[i])
75  DCSbyLS_->setBinContent(i+1,0.);
76  else
77  DCSbyLS_->setBinContent(i+1,1.);
78 
79  dcs[i]=true;
80  }
81 
82  return;
83 }
void setBinContent(int binx, double content)
set content of bin (1-D)
bool dcs[25]
Definition: DQMDcsInfo.h:53
MonitorElement * DCSbyLS_
Definition: DQMDcsInfo.h:55
void DQMDcsInfo::makeDcsInfo ( const edm::Event e)
private

Definition at line 86 of file DQMDcsInfo.cc.

References DcsStatus::BPIX, DcsStatus::CASTOR, DcsStatus::CSCm, DcsStatus::CSCp, dcs, dcsStatusCollection_, DcsStatus::DT0, DcsStatus::DTm, DcsStatus::DTp, DcsStatus::EBm, DcsStatus::EBp, DcsStatus::EEm, DcsStatus::EEp, DcsStatus::ESm, DcsStatus::ESp, DcsStatus::FPIX, edm::Event::getByToken(), DcsStatus::HBHEa, DcsStatus::HBHEb, DcsStatus::HBHEc, DcsStatus::HF, DcsStatus::HO, mps_fire::i, edm::HandleBase::isValid(), mathSSE::return(), DcsStatus::RPC, DcsStatus::TECm, DcsStatus::TECp, DcsStatus::TIBTID, and DcsStatus::TOB.

Referenced by analyze().

87 {
88 
90  if ( ! e.getByToken(dcsStatusCollection_, dcsStatus) )
91  {
92  for (int i=0;i<24;i++) dcs[i]=false;
93  return;
94  }
95 
96  if ( ! dcsStatus.isValid() )
97  {
98  edm::LogWarning("DQMDcsInfo") << "scalersRawToDigi not found" ;
99  for (int i=0;i<24;i++) dcs[i]=false; // info not available: set to false
100  return;
101  }
102 
103  for (auto const & dcsStatusItr : *dcsStatus)
104  {
105  if (!dcsStatusItr.ready(DcsStatus::CSCp)) dcs[0]=false;
106  if (!dcsStatusItr.ready(DcsStatus::CSCm)) dcs[1]=false;
107  if (!dcsStatusItr.ready(DcsStatus::DT0)) dcs[2]=false;
108  if (!dcsStatusItr.ready(DcsStatus::DTp)) dcs[3]=false;
109  if (!dcsStatusItr.ready(DcsStatus::DTm)) dcs[4]=false;
110  if (!dcsStatusItr.ready(DcsStatus::EBp)) dcs[5]=false;
111  if (!dcsStatusItr.ready(DcsStatus::EBm)) dcs[6]=false;
112  if (!dcsStatusItr.ready(DcsStatus::EEp)) dcs[7]=false;
113  if (!dcsStatusItr.ready(DcsStatus::EEm)) dcs[8]=false;
114  if (!dcsStatusItr.ready(DcsStatus::ESp)) dcs[9]=false;
115  if (!dcsStatusItr.ready(DcsStatus::ESm)) dcs[10]=false;
116  if (!dcsStatusItr.ready(DcsStatus::HBHEa)) dcs[11]=false;
117  if (!dcsStatusItr.ready(DcsStatus::HBHEb)) dcs[12]=false;
118  if (!dcsStatusItr.ready(DcsStatus::HBHEc)) dcs[13]=false;
119  if (!dcsStatusItr.ready(DcsStatus::HF)) dcs[14]=false;
120  if (!dcsStatusItr.ready(DcsStatus::HO)) dcs[15]=false;
121  if (!dcsStatusItr.ready(DcsStatus::BPIX)) dcs[16]=false;
122  if (!dcsStatusItr.ready(DcsStatus::FPIX)) dcs[17]=false;
123  if (!dcsStatusItr.ready(DcsStatus::RPC)) dcs[18]=false;
124  if (!dcsStatusItr.ready(DcsStatus::TIBTID)) dcs[19]=false;
125  if (!dcsStatusItr.ready(DcsStatus::TOB)) dcs[20]=false;
126  if (!dcsStatusItr.ready(DcsStatus::TECp)) dcs[21]=false;
127  if (!dcsStatusItr.ready(DcsStatus::TECm)) dcs[22]=false;
128  if (!dcsStatusItr.ready(DcsStatus::CASTOR)) dcs[23]=false;
129  }
130 
131  return ;
132 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
return((rh^lh)&mask)
bool isValid() const
Definition: HandleBase.h:74
bool dcs[25]
Definition: DQMDcsInfo.h:53
edm::EDGetTokenT< DcsStatusCollection > dcsStatusCollection_
Definition: DQMDcsInfo.h:51
void DQMDcsInfo::makeGtInfo ( const edm::Event e)
private

Definition at line 135 of file DQMDcsInfo.cc.

References dcs, edm::Event::getByToken(), gtCollection_, L1GlobalTriggerReadoutRecord::gtFdlWord(), edm::HandleBase::isValid(), L1GtFdlWord::physicsDeclared(), and edm::Handle< T >::product().

Referenced by analyze().

136 {
137 
139  if ( ! e.getByToken(gtCollection_, gtrr_handle) )
140  {
141  dcs[24]=false; // info not available: set to false
142  return;
143  }
144 
145  if ( ! gtrr_handle.isValid() )
146  {
147  edm::LogWarning("DQMDcsInfo") << " gtDigis not found" ;
148  dcs[24]=false; // info not available: set to false
149  return;
150  }
151 
152  L1GlobalTriggerReadoutRecord const* gtrr = gtrr_handle.product();
153  L1GtFdlWord fdlWord ;
154  if (gtrr)
155  fdlWord = gtrr->gtFdlWord();
156  else
157  {
158  edm::LogWarning ("DQMDcsInfo") << " phys decl. bit not accessible !!!";
159  dcs[24]=false; // info not available: set to false
160  return;
161  }
162 
163  if (fdlWord.physicsDeclared() !=1) dcs[24]=false;
164 
165  return;
166 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtCollection_
Definition: DQMDcsInfo.h:50
bool dcs[25]
Definition: DQMDcsInfo.h:53
T const * product() const
Definition: Handle.h:74
const L1GtFdlWord gtFdlWord(int bxInEventValue) const
get / set FDL word (record) in the GT readout record
const cms_uint16_t physicsDeclared() const
get/set "physics declared" bit
Definition: L1GtFdlWord.h:227

Member Data Documentation

bool DQMDcsInfo::dcs[25]
private

Definition at line 53 of file DQMDcsInfo.h.

Referenced by bookHistograms(), DQMDcsInfo(), endLuminosityBlock(), makeDcsInfo(), and makeGtInfo().

MonitorElement* DQMDcsInfo::DCSbyLS_
private

Definition at line 55 of file DQMDcsInfo.h.

Referenced by bookHistograms(), and endLuminosityBlock().

std::string DQMDcsInfo::dcsinfofolder_
private

Definition at line 49 of file DQMDcsInfo.h.

Referenced by bookHistograms(), and DQMDcsInfo().

edm::EDGetTokenT<DcsStatusCollection> DQMDcsInfo::dcsStatusCollection_
private

Definition at line 51 of file DQMDcsInfo.h.

Referenced by DQMDcsInfo(), and makeDcsInfo().

edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> DQMDcsInfo::gtCollection_
private

Definition at line 50 of file DQMDcsInfo.h.

Referenced by DQMDcsInfo(), and makeGtInfo().

edm::ParameterSet DQMDcsInfo::parameters_
private
std::string DQMDcsInfo::subsystemname_
private

Definition at line 48 of file DQMDcsInfo.h.

Referenced by bookHistograms(), and DQMDcsInfo().