CMS 3D CMS Logo

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

#include <HcalLSbyLSMonitor.h>

Inheritance diagram for HcalLSbyLSMonitor:
HcalBaseDQMonitor edm::EDAnalyzer

Public Member Functions

void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
void beginRun (const edm::Run &run, const edm::EventSetup &c)
 
void cleanup (void)
 
void done ()
 
void endJob ()
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
void endRun (const edm::Run &run, const edm::EventSetup &c)
 
 HcalLSbyLSMonitor (const edm::ParameterSet &ps)
 
void periodicReset ()
 
void reset ()
 
void setup ()
 
 ~HcalLSbyLSMonitor ()
 
- Public Member Functions inherited from HcalBaseDQMonitor
 HcalBaseDQMonitor (const edm::ParameterSet &ps)
 
 HcalBaseDQMonitor ()
 
 ~HcalBaseDQMonitor ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Attributes

int minEvents_
 
std::vector< std::string > TaskList_
 

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)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from HcalBaseDQMonitor
virtual void analyze (const edm::Event &e, const edm::EventSetup &c)
 
virtual void beginJob ()
 
bool IsAllowedCalibType ()
 
bool LumiInOrder (int lumisec)
 
void SetupEtaPhiHists (EtaPhiHists &hh, std::string Name, std::string Units)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 
- Protected Attributes inherited from HcalBaseDQMonitor
std::vector< int > AllowedCalibTypes_
 
int badChannelStatusMask_
 
int currentLS
 
int currenttype_
 
DQMStoredbe_
 
int debug_
 
bool enableCleanup_
 
bool eventAllowed_
 
bool HBpresent_
 
bool HEpresent_
 
bool HFpresent_
 
bool HOpresent_
 
int ievt_
 
std::map< unsigned int, int > KnownBadCells_
 
int levt_
 
bool makeDiagnostics_
 
MonitorElementmeIevt_
 
MonitorElementmeLevt_
 
bool mergeRuns_
 
MonitorElementmeTevt_
 
MonitorElementmeTevtHist_
 
int NLumiBlocks_
 
bool Online_
 
std::string prefixME_
 
MonitorElementProblemsCurrentLB
 
MonitorElementProblemsVsLB
 
MonitorElementProblemsVsLB_HB
 
MonitorElementProblemsVsLB_HBHEHF
 
MonitorElementProblemsVsLB_HE
 
MonitorElementProblemsVsLB_HF
 
MonitorElementProblemsVsLB_HO
 
bool skipOutOfOrderLS_
 
std::string subdir_
 
int tevt_
 

Detailed Description

Date:
2010/05/07 17:38:16
Revision:
1.2
Author
J. Temple - Univ. of Maryland

Definition at line 25 of file HcalLSbyLSMonitor.h.

Constructor & Destructor Documentation

HcalLSbyLSMonitor::HcalLSbyLSMonitor ( const edm::ParameterSet ps)

Definition at line 10 of file HcalLSbyLSMonitor.cc.

References HcalBaseDQMonitor::AllowedCalibTypes_, HcalBaseDQMonitor::debug_, HcalBaseDQMonitor::enableCleanup_, edm::ParameterSet::getUntrackedParameter(), HcalBaseDQMonitor::makeDiagnostics_, HcalBaseDQMonitor::mergeRuns_, minEvents_, HcalBaseDQMonitor::NLumiBlocks_, HcalBaseDQMonitor::Online_, HcalBaseDQMonitor::prefixME_, HcalBaseDQMonitor::skipOutOfOrderLS_, HcalBaseDQMonitor::subdir_, and TaskList_.

11 {
12  Online_ = ps.getUntrackedParameter<bool>("online",false);
13  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns",false);
14  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup",false);
15  debug_ = ps.getUntrackedParameter<int>("debug",0);
16  prefixME_ = ps.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
17  if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
18  prefixME_.append("/");
19  subdir_ = ps.getUntrackedParameter<std::string>("TaskFolder","LSbyLSMonitor_Hcal");
20  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
21  subdir_.append("/");
22  subdir_=prefixME_+subdir_;
23  AllowedCalibTypes_ = ps.getUntrackedParameter<std::vector<int> > ("AllowedCalibTypes");
24  skipOutOfOrderLS_ = ps.getUntrackedParameter<bool>("skipOutOfOrderLS",true);
25  NLumiBlocks_ = ps.getUntrackedParameter<int>("NLumiBlocks",4000);
26  makeDiagnostics_ = ps.getUntrackedParameter<bool>("makeDiagnostics",false);
27 
28  // Specify the directories where the tasks to be check reside
29  TaskList_ = ps.getUntrackedParameter<std::vector<std::string> >("TaskDirectories");
30  // Minimum number of events per lumi section that must be present for checks to be made. *ALL* tasks must contain at least this many events
31  minEvents_ = ps.getUntrackedParameter<int>("minEvents",500);
32 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > TaskList_
std::vector< int > AllowedCalibTypes_
HcalLSbyLSMonitor::~HcalLSbyLSMonitor ( )

Definition at line 34 of file HcalLSbyLSMonitor.cc.

35 {
36 } //destructor

Member Function Documentation

void HcalLSbyLSMonitor::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 71 of file HcalLSbyLSMonitor.cc.

References HcalBaseDQMonitor::beginLuminosityBlock(), HcalBaseDQMonitor::LumiInOrder(), edm::LuminosityBlockBase::luminosityBlock(), HcalBaseDQMonitor::ProblemsCurrentLB, and MonitorElement::Reset().

73 {
74  if (LumiInOrder(lumiSeg.luminosityBlock())==false) return;
77  return;
78 } // beginLuminosityBlock(...)
bool LumiInOrder(int lumisec)
MonitorElement * ProblemsCurrentLB
LuminosityBlockNumber_t luminosityBlock() const
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
void Reset(void)
reset ME (ie. contents, errors, etc)
void HcalLSbyLSMonitor::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 52 of file HcalLSbyLSMonitor.cc.

References HcalBaseDQMonitor::beginRun(), gather_cfg::cout, HcalBaseDQMonitor::debug_, HcalBaseDQMonitor::mergeRuns_, reset(), setup(), and HcalBaseDQMonitor::tevt_.

53 {
54  if (debug_>1) std::cout <<"HcalLSbyLSMonitor::beginRun"<<std::endl;
56 
57  if (tevt_==0) this->setup(); // set up histograms if they have not been created before
58  if (mergeRuns_==false)
59  this->reset();
60 
61  return;
62 } //void HcalLSbyLSMonitor::beginRun(...)
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
tuple cout
Definition: gather_cfg.py:121
void HcalLSbyLSMonitor::cleanup ( void  )
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 159 of file HcalLSbyLSMonitor.cc.

References HcalBaseDQMonitor::dbe_, HcalBaseDQMonitor::enableCleanup_, DQMStore::removeContents(), DQMStore::setCurrentFolder(), and HcalBaseDQMonitor::subdir_.

Referenced by endJob().

160 {
161  if (!enableCleanup_) return;
162  if (dbe_)
163  {
165  dbe_->removeContents();
166  dbe_->setCurrentFolder(subdir_+"LSvalues");
167  dbe_->removeContents();
168  }
169 }
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
Definition: DQMStore.cc:2564
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void HcalLSbyLSMonitor::done ( )

Definition at line 144 of file HcalLSbyLSMonitor.cc.

145 {
146  // moved database dumps to client; we want to be able to sum over results in offline
147  return;
148 
149 } // void HcalLSbyLSMonitor::done()
void HcalLSbyLSMonitor::endJob ( void  )
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 152 of file HcalLSbyLSMonitor.cc.

References cleanup(), gather_cfg::cout, HcalBaseDQMonitor::debug_, and HcalBaseDQMonitor::enableCleanup_.

153 {
154  if (debug_>0) std::cout <<"HcalLSbyLSMonitor::endJob()"<<std::endl;
155  if (enableCleanup_) cleanup(); // when do we force cleanup?
156 }
tuple cout
Definition: gather_cfg.py:121
void HcalLSbyLSMonitor::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 80 of file HcalLSbyLSMonitor.cc.

References gather_cfg::cout, HcalBaseDQMonitor::dbe_, HcalBaseDQMonitor::debug_, DQMStore::get(), MonitorElement::getBinContent(), i, max(), minEvents_, mergeVDriftHistosByStation::name, HcalBaseDQMonitor::prefixME_, HcalBaseDQMonitor::ProblemsCurrentLB, MonitorElement::setBinContent(), DQMStore::setCurrentFolder(), and TaskList_.

82 {
83  // Processing should go here
84  if (!dbe_) return;
85  bool enoughEvents=true;
86  int Nevents=0;
87  int TotalEvents=0;
88  int badHB=0;
89  int badHE=0;
90  int badHO=0;
91  int badHF=0;
92  int badHO0=0;
93  int badHO12=0;
94  int badHFLUMI=0;
95 
96  for (unsigned int i=0;i<TaskList_.size();++i)
97  {
98  std::string name=prefixME_+TaskList_[i]+"LSvalues/";
99  dbe_->setCurrentFolder(name.c_str());
100  // Do we need the 'name' prefix here?
101  MonitorElement *me=dbe_->get(name+"ProblemsThisLS");
102  if (me==0)
103  {
104  if (debug_>0) std::cout <<"<HcalLSbyLSMonitor> Error! Could not get histogram "<<name.c_str()<<std::endl;
105  enoughEvents=false;
106  break;
107  }
108 
109  Nevents=(int)me->getBinContent(-1);
110  if (Nevents<minEvents_)
111  {
112  if (debug_>0)
113  std::cout <<"<HcalLSbyLSMonitor> Error! Number of events "<<Nevents<<" for histogram "<<name.c_str()<<" is less than the required minimum of "<<minEvents_<<std::endl;
114  enoughEvents=false;
115  break;
116  }
117  // Total events is the number of events processed in this LS
118  TotalEvents=std::max(TotalEvents,Nevents);
119  // errors are sum over all tests. This WILL lead to double counting in some subdetectors!
120  badHB+=(int)me->getBinContent(1,1);
121  badHE+=(int)me->getBinContent(2,1);
122  badHO+=(int)me->getBinContent(3,1);
123  badHF+=(int)me->getBinContent(4,1);
124  badHO0+=(int)me->getBinContent(5,1);
125  badHO12+=(int)me->getBinContent(6,1);
126  badHFLUMI+=(int)me->getBinContent(7,1);
127  }
128  if (enoughEvents==false) // not enough events to make a decision
129  {
130  return;
131  }
132  ProblemsCurrentLB->setBinContent(-1,-1,TotalEvents);
133  ProblemsCurrentLB->setBinContent(1,1,badHB);
134  ProblemsCurrentLB->setBinContent(2,1,badHE);
135  ProblemsCurrentLB->setBinContent(3,1,badHO);
136  ProblemsCurrentLB->setBinContent(4,1,badHF);
137  ProblemsCurrentLB->setBinContent(5,1,badHO0);
138  ProblemsCurrentLB->setBinContent(6,1,badHO12);
139  ProblemsCurrentLB->setBinContent(7,1,badHFLUMI);
140  return;
141 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * ProblemsCurrentLB
std::vector< std::string > TaskList_
const T & max(const T &a, const T &b)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
double getBinContent(int binx) const
get content of bin (1-D)
tuple cout
Definition: gather_cfg.py:121
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void HcalLSbyLSMonitor::endRun ( const edm::Run run,
const edm::EventSetup c 
)
inlinevirtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 34 of file HcalLSbyLSMonitor.h.

34 {};
void HcalLSbyLSMonitor::periodicReset ( )
inline

Definition at line 52 of file HcalLSbyLSMonitor.h.

52 {};
void HcalLSbyLSMonitor::reset ( void  )
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 65 of file HcalLSbyLSMonitor.cc.

References HcalBaseDQMonitor::ProblemsCurrentLB, HcalBaseDQMonitor::reset(), and MonitorElement::Reset().

Referenced by beginRun(), and setup().

66 {
69 } // reset function is empty for now
MonitorElement * ProblemsCurrentLB
virtual void reset(void)
void Reset(void)
reset ME (ie. contents, errors, etc)
void HcalLSbyLSMonitor::setup ( void  )
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 38 of file HcalLSbyLSMonitor.cc.

References gather_cfg::cout, HcalBaseDQMonitor::dbe_, HcalBaseDQMonitor::debug_, HcalBaseDQMonitor::ProblemsCurrentLB, reset(), DQMStore::setCurrentFolder(), MonitorElement::setLumiFlag(), HcalBaseDQMonitor::setup(), and HcalBaseDQMonitor::subdir_.

Referenced by beginRun().

39 {
40  // Call base class setup
42 
43  if (debug_>1)
44  std::cout <<"<HcalLSbyLSMonitor::setup> Setting up histograms"<<std::endl;
45 
47  // This will cause this information to be kept for every lumi block
50  this->reset();
51 }
MonitorElement * ProblemsCurrentLB
tuple cout
Definition: gather_cfg.py:121
void setLumiFlag(void)
this ME is meant to be stored for each luminosity section
virtual void setup(void)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429

Member Data Documentation

int HcalLSbyLSMonitor::minEvents_
private

Definition at line 52 of file HcalLSbyLSMonitor.h.

Referenced by endLuminosityBlock(), and HcalLSbyLSMonitor().

std::vector<std::string> HcalLSbyLSMonitor::TaskList_
private

Definition at line 57 of file HcalLSbyLSMonitor.h.

Referenced by endLuminosityBlock(), and HcalLSbyLSMonitor().