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
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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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)
 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::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::EDGetTokenT
< DcsStatusCollection
dcsStatustoken_
 
DQMStoredqmStore_
 
bool enableCleanup_
 
int ievt_
 
MonitorElementmeESDcsActiveMap_
 
MonitorElementmeESDcsFraction_
 
bool mergeRuns_
 
std::string prefixME_
 

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 13 of file ESDcsInfoTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 20 of file ESDcsInfoTask.cc.

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

20  {
21 
23 
24  prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
25 
26  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
27 
28  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
29 
30  dcsStatustoken_ = consumes<DcsStatusCollection>(ps.getParameter<InputTag>("DcsStatusLabel"));
31 
32  meESDcsFraction_ = 0;
34 
35 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:58
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:59
edm::EDGetTokenT< DcsStatusCollection > dcsStatustoken_
Definition: ESDcsInfoTask.h:56
DQMStore * dqmStore_
Definition: ESDcsInfoTask.h:48
std::string prefixME_
Definition: ESDcsInfoTask.h:50
ESDcsInfoTask::~ESDcsInfoTask ( )
virtual

Destructor.

Definition at line 37 of file ESDcsInfoTask.cc.

37  {
38 
39 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 105 of file ESDcsInfoTask.cc.

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

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

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 41 of file ESDcsInfoTask.cc.

References timingPdfMaker::histo.

41  {
42 
43  char histo[200];
44 
45  if ( dqmStore_ ) {
46 
47  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
48 
49  sprintf(histo, "DCSSummary");
50  meESDcsFraction_ = dqmStore_->bookFloat(histo);
51  meESDcsFraction_->Fill(-1.0);
52 
53  sprintf(histo, "DCSSummaryMap");
54  meESDcsActiveMap_ = dqmStore_->book1D(histo,histo, 2, 0., 2.);
55  meESDcsActiveMap_->setAxisTitle("(ES+/ES-)", 1);
56 
57 
58  }
59 
60 }
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:58
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:59
void Fill(long long x)
DQMStore * dqmStore_
Definition: ESDcsInfoTask.h:48
std::string prefixME_
Definition: ESDcsInfoTask.h:50
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void ESDcsInfoTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
protectedvirtual

BeginLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 68 of file ESDcsInfoTask.cc.

References i, and reset().

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

Cleanup.

Definition at line 91 of file ESDcsInfoTask.cc.

Referenced by esMonitoring.FDJsonServer::handle_close().

91  {
92 
93  if ( dqmStore_ ) {
94 
95  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
96 
97  if ( meESDcsFraction_ ) dqmStore_->removeElement( meESDcsFraction_->getName() );
98 
99  if ( meESDcsActiveMap_ ) dqmStore_->removeElement( meESDcsActiveMap_->getName() );
100 
101  }
102 
103 }
const std::string & getName(void) const
get name of ME
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:58
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:59
DQMStore * dqmStore_
Definition: ESDcsInfoTask.h:48
std::string prefixME_
Definition: ESDcsInfoTask.h:50
void ESDcsInfoTask::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 62 of file ESDcsInfoTask.cc.

References edm::cleanup().

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

EndLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 78 of file ESDcsInfoTask.cc.

78  {
79 
80 }
void ESDcsInfoTask::reset ( void  )
protected

Reset.

Definition at line 82 of file ESDcsInfoTask.cc.

82  {
83 
85 
87 
88 }
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:58
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:59
void Reset(void)
reset ME (ie. contents, errors, etc)

Member Data Documentation

edm::EDGetTokenT<DcsStatusCollection> ESDcsInfoTask::dcsStatustoken_
private

Definition at line 56 of file ESDcsInfoTask.h.

DQMStore* ESDcsInfoTask::dqmStore_
private

Definition at line 48 of file ESDcsInfoTask.h.

bool ESDcsInfoTask::enableCleanup_
private

Definition at line 52 of file ESDcsInfoTask.h.

int ESDcsInfoTask::ievt_
private

Definition at line 61 of file ESDcsInfoTask.h.

MonitorElement* ESDcsInfoTask::meESDcsActiveMap_
private

Definition at line 59 of file ESDcsInfoTask.h.

MonitorElement* ESDcsInfoTask::meESDcsFraction_
private

Definition at line 58 of file ESDcsInfoTask.h.

bool ESDcsInfoTask::mergeRuns_
private

Definition at line 54 of file ESDcsInfoTask.h.

std::string ESDcsInfoTask::prefixME_
private

Definition at line 50 of file ESDcsInfoTask.h.