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

#include <ESDcsInfoTask.h>

Inheritance diagram for ESDcsInfoTask:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 ESDcsInfoTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~ESDcsInfoTask ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob (void)
 BeginJob. More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
 BeginLuminosityBlock. More...
 
void cleanup (void)
 Cleanup. More...
 
void endJob (void)
 EndJob. More...
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
 EndLuminosityBlock. More...
 
void reset (void)
 Reset. More...
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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

edm::InputTag dcsStatuslabel_
 
DQMStoredqmStore_
 
bool enableCleanup_
 
int ievt_
 
MonitorElementmeESDcsActiveMap_
 
MonitorElementmeESDcsFraction_
 
bool mergeRuns_
 
std::string prefixME_
 

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

Detailed Description

Definition at line 11 of file ESDcsInfoTask.h.

Constructor & Destructor Documentation

ESDcsInfoTask::ESDcsInfoTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 22 of file ESDcsInfoTask.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and cppFunctionSkipper::operator.

22  {
23 
25 
26  prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
27 
28  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
29 
30  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
31 
32  dcsStatuslabel_ = ps.getParameter<InputTag>("DcsStatusLabel");
33 
34  meESDcsFraction_ = 0;
36 
37 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:56
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:57
edm::InputTag dcsStatuslabel_
Definition: ESDcsInfoTask.h:54
DQMStore * dqmStore_
Definition: ESDcsInfoTask.h:46
std::string prefixME_
Definition: ESDcsInfoTask.h:48
ESDcsInfoTask::~ESDcsInfoTask ( )
virtual

Destructor.

Definition at line 39 of file ESDcsInfoTask.cc.

39  {
40 
41 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 107 of file ESDcsInfoTask.cc.

References DcsStatus::ESm, DcsStatus::ESp, edm::Event::getByLabel(), and edm::HandleBase::isValid().

107  {
108 
109  ievt_++;
110 
111  float ESpDcsStatus = 0;
112  float ESmDcsStatus = 0;
113 
114  Handle<DcsStatusCollection> dcsStatus;
115  e.getByLabel(dcsStatuslabel_, dcsStatus);
116  if (dcsStatus.isValid()) {
117  for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin(); dcsStatusItr != dcsStatus->end(); ++dcsStatusItr) {
118  ESpDcsStatus = dcsStatusItr->ready(DcsStatus::ESp);
119  ESmDcsStatus = dcsStatusItr->ready(DcsStatus::ESm);
120  }
121 
122  ESpDcsStatus = (ESpDcsStatus + float(ievt_-1)*meESDcsActiveMap_->getBinContent(1))/float(ievt_);
123  ESmDcsStatus = (ESmDcsStatus + float(ievt_-1)*meESDcsActiveMap_->getBinContent(2))/float(ievt_);
124  }
125 
126  meESDcsActiveMap_->setBinContent(1, ESpDcsStatus);
127  meESDcsActiveMap_->setBinContent(2, ESmDcsStatus);
128 
129  meESDcsFraction_->Fill( (ESpDcsStatus + ESmDcsStatus)/2. );
130 
131 }
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:56
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:57
void Fill(long long x)
edm::InputTag dcsStatuslabel_
Definition: ESDcsInfoTask.h:54
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
double getBinContent(int binx) const
get content of bin (1-D)
void ESDcsInfoTask::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 43 of file ESDcsInfoTask.cc.

References timingPdfMaker::histo.

43  {
44 
45  char histo[200];
46 
47  if ( dqmStore_ ) {
48 
49  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
50 
51  sprintf(histo, "DCSSummary");
53  meESDcsFraction_->Fill(-1.0);
54 
55  sprintf(histo, "DCSSummaryMap");
56  meESDcsActiveMap_ = dqmStore_->book1D(histo,histo, 2, 0., 2.);
57  meESDcsActiveMap_->setAxisTitle("(ES+/ES-)", 1);
58 
59 
60  }
61 
62 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:56
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:57
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:659
void Fill(long long x)
DQMStore * dqmStore_
Definition: ESDcsInfoTask.h:46
std::string prefixME_
Definition: ESDcsInfoTask.h:48
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:434
void ESDcsInfoTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
protectedvirtual

BeginLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 70 of file ESDcsInfoTask.cc.

References i, and reset().

70  {
71 
72  this->reset();
73 
74  for( int i = 0; i < 2; i++) {
76  }
77 
78 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:57
void reset(void)
Reset.
void ESDcsInfoTask::cleanup ( void  )
protected

Cleanup.

Definition at line 93 of file ESDcsInfoTask.cc.

93  {
94 
95  if ( dqmStore_ ) {
96 
97  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
98 
100 
102 
103  }
104 
105 }
const std::string & getName(void) const
get name of ME
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:56
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:57
void removeElement(const std::string &name)
Definition: DQMStore.cc:2577
DQMStore * dqmStore_
Definition: ESDcsInfoTask.h:46
std::string prefixME_
Definition: ESDcsInfoTask.h:48
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
void ESDcsInfoTask::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 64 of file ESDcsInfoTask.cc.

References edm::cleanup().

64  {
65 
66  if ( enableCleanup_ ) this->cleanup();
67 
68 }
void cleanup(void)
Cleanup.
void ESDcsInfoTask::endLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
protectedvirtual

EndLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 80 of file ESDcsInfoTask.cc.

80  {
81 
82 }
void ESDcsInfoTask::reset ( void  )
protected

Reset.

Definition at line 84 of file ESDcsInfoTask.cc.

84  {
85 
87 
89 
90 }
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:56
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:57
void Reset(void)
reset ME (ie. contents, errors, etc)

Member Data Documentation

edm::InputTag ESDcsInfoTask::dcsStatuslabel_
private

Definition at line 54 of file ESDcsInfoTask.h.

DQMStore* ESDcsInfoTask::dqmStore_
private

Definition at line 46 of file ESDcsInfoTask.h.

bool ESDcsInfoTask::enableCleanup_
private

Definition at line 50 of file ESDcsInfoTask.h.

int ESDcsInfoTask::ievt_
private

Definition at line 59 of file ESDcsInfoTask.h.

MonitorElement* ESDcsInfoTask::meESDcsActiveMap_
private

Definition at line 57 of file ESDcsInfoTask.h.

MonitorElement* ESDcsInfoTask::meESDcsFraction_
private

Definition at line 56 of file ESDcsInfoTask.h.

bool ESDcsInfoTask::mergeRuns_
private

Definition at line 52 of file ESDcsInfoTask.h.

std::string ESDcsInfoTask::prefixME_
private

Definition at line 48 of file ESDcsInfoTask.h.