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
DQMDcsInfoClient Class Reference

#include <DQMDcsInfoClient.h>

Inheritance diagram for DQMDcsInfoClient:
edm::EDAnalyzer

Public Member Functions

 DQMDcsInfoClient (const edm::ParameterSet &ps)
 
 ~DQMDcsInfoClient ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 28 of file DQMDcsInfoClient.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file DQMDcsInfoClient.cc.

References dbe_, dcsinfofolder_, edm::ParameterSet::getUntrackedParameter(), cmsCodeRules.cppFunctionSkipper::operator, parameters_, and subsystemname_.

19  {
20 
21  parameters_ = ps;
22 
24 
25  subsystemname_ = parameters_.getUntrackedParameter<std::string>("subSystemFolder", "Info") ;
26  dcsinfofolder_ = parameters_.getUntrackedParameter<std::string>("dcsInfoFolder", "DcsInfo") ;
27 
28 }
std::string dcsinfofolder_
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet parameters_
std::string subsystemname_
DQMDcsInfoClient::~DQMDcsInfoClient ( )

Definition at line 31 of file DQMDcsInfoClient.cc.

31  {
32 
33 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 44 of file DQMDcsInfoClient.cc.

45 {
46  return;
47 }
void DQMDcsInfoClient::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 36 of file DQMDcsInfoClient.cc.

References DCS, and processedLS_.

37 {
38  DCS.clear();
39  DCS.resize(10); // start with 10 LS, resize later
40  processedLS_.clear();
41 }
std::set< unsigned int > processedLS_
std::vector< int > DCS
void DQMDcsInfoClient::endLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 50 of file DQMDcsInfoClient.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 85 of file DQMDcsInfoClient.cc.

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

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

Member Data Documentation

DQMStore* DQMDcsInfoClient::dbe_
private

Definition at line 46 of file DQMDcsInfoClient.h.

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

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

Definition at line 48 of file DQMDcsInfoClient.h.

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

std::string DQMDcsInfoClient::dcsinfofolder_
private

Definition at line 44 of file DQMDcsInfoClient.h.

Referenced by DQMDcsInfoClient(), and endLuminosityBlock().

MonitorElement* DQMDcsInfoClient::meProcessedLS_
private

Definition at line 55 of file DQMDcsInfoClient.h.

Referenced by endRun().

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

Definition at line 49 of file DQMDcsInfoClient.h.

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

MonitorElement* DQMDcsInfoClient::reportSummary_
private

Definition at line 53 of file DQMDcsInfoClient.h.

Referenced by endRun().

MonitorElement* DQMDcsInfoClient::reportSummaryMap_
private

Definition at line 54 of file DQMDcsInfoClient.h.

Referenced by endRun().

std::string DQMDcsInfoClient::subsystemname_
private

Definition at line 43 of file DQMDcsInfoClient.h.

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