CMS 3D CMS Logo

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

#include <ESDcsInfoTask.h>

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

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 ESDcsInfoTask (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~ESDcsInfoTask () override
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 Analyze. More...
 
void beginJob (void) override
 BeginJob. More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup) override
 BeginLuminosityBlock. More...
 
void endJob (void) override
 EndJob. 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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Private Attributes

edm::EDGetTokenT< DcsStatusCollectiondcsStatustoken_
 
DQMStoredqmStore_
 
int ievt_
 
MonitorElementmeESDcsActiveMap_
 
MonitorElementmeESDcsFraction_
 
bool mergeRuns_
 
std::string prefixME_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Detailed Description

Definition at line 11 of file ESDcsInfoTask.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 14 of file ESDcsInfoTask.h.

◆ MonitorElement

Definition at line 13 of file ESDcsInfoTask.h.

Constructor & Destructor Documentation

◆ ESDcsInfoTask()

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

Constructor.

Definition at line 19 of file ESDcsInfoTask.cc.

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

19  {
21 
22  prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
23 
24  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
25 
26  dcsStatustoken_ = consumes<DcsStatusCollection>(ps.getParameter<InputTag>("DcsStatusLabel"));
27 
28  meESDcsFraction_ = nullptr;
29  meESDcsActiveMap_ = nullptr;
30 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:47
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:48
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DcsStatusCollection > dcsStatustoken_
Definition: ESDcsInfoTask.h:45
DQMStore * dqmStore_
Definition: ESDcsInfoTask.h:39
std::string prefixME_
Definition: ESDcsInfoTask.h:41

◆ ~ESDcsInfoTask()

ESDcsInfoTask::~ESDcsInfoTask ( )
override

Destructor.

Definition at line 32 of file ESDcsInfoTask.cc.

32 {}

Member Function Documentation

◆ analyze()

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 68 of file ESDcsInfoTask.cc.

References MillePedeFileConverter_cfg::e, DcsStatus::ESm, DcsStatus::ESp, dqmMemoryStats::float, and edm::HandleBase::isValid().

68  {
69  ievt_++;
70 
71  float ESpDcsStatus = 0;
72  float ESmDcsStatus = 0;
73 
75  e.getByToken(dcsStatustoken_, dcsStatus);
76  if (dcsStatus.isValid()) {
77  for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin(); dcsStatusItr != dcsStatus->end();
78  ++dcsStatusItr) {
79  ESpDcsStatus = dcsStatusItr->ready(DcsStatus::ESp);
80  ESmDcsStatus = dcsStatusItr->ready(DcsStatus::ESm);
81  }
82 
83  ESpDcsStatus = (ESpDcsStatus + float(ievt_ - 1) * meESDcsActiveMap_->getBinContent(1)) / float(ievt_);
84  ESmDcsStatus = (ESmDcsStatus + float(ievt_ - 1) * meESDcsActiveMap_->getBinContent(2)) / float(ievt_);
85  }
86 
87  meESDcsActiveMap_->setBinContent(1, ESpDcsStatus);
88  meESDcsActiveMap_->setBinContent(2, ESmDcsStatus);
89 
90  meESDcsFraction_->Fill((ESpDcsStatus + ESmDcsStatus) / 2.);
91 }
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:47
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:48
void Fill(long long x)
edm::EDGetTokenT< DcsStatusCollection > dcsStatustoken_
Definition: ESDcsInfoTask.h:45
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
bool isValid() const
Definition: HandleBase.h:70
virtual double getBinContent(int binx) const
get content of bin (1-D)

◆ beginJob()

void ESDcsInfoTask::beginJob ( void  )
overrideprotectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 34 of file ESDcsInfoTask.cc.

References timingPdfMaker::histo.

34  {
35  char histo[200];
36 
37  if (dqmStore_) {
38  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
39 
40  sprintf(histo, "DCSSummary");
42  meESDcsFraction_->Fill(-1.0);
43 
44  sprintf(histo, "DCSSummaryMap");
46  meESDcsActiveMap_->setAxisTitle("(ES+/ES-)", 1);
47  }
48 }
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:47
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:646
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:48
void Fill(long long x)
DQMStore * dqmStore_
Definition: ESDcsInfoTask.h:39
std::string prefixME_
Definition: ESDcsInfoTask.h:41
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ beginLuminosityBlock()

void ESDcsInfoTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
overrideprotectedvirtual

BeginLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 52 of file ESDcsInfoTask.cc.

References mps_fire::i, and reset().

52  {
53  this->reset();
54 
55  for (int i = 0; i < 2; i++) {
56  meESDcsActiveMap_->setBinContent(i + 1, -1.0);
57  }
58 }
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:48
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
void reset(void)
Reset.

◆ endJob()

void ESDcsInfoTask::endJob ( void  )
overrideprotectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 50 of file ESDcsInfoTask.cc.

50 {}

◆ reset()

void ESDcsInfoTask::reset ( void  )
protected

Reset.

Definition at line 60 of file ESDcsInfoTask.cc.

60  {
61  if (meESDcsFraction_)
63 
66 }
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:47
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:48
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.

Member Data Documentation

◆ dcsStatustoken_

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

Definition at line 45 of file ESDcsInfoTask.h.

◆ dqmStore_

DQMStore* ESDcsInfoTask::dqmStore_
private

Definition at line 39 of file ESDcsInfoTask.h.

◆ ievt_

int ESDcsInfoTask::ievt_
private

Definition at line 50 of file ESDcsInfoTask.h.

◆ meESDcsActiveMap_

MonitorElement* ESDcsInfoTask::meESDcsActiveMap_
private

Definition at line 48 of file ESDcsInfoTask.h.

◆ meESDcsFraction_

MonitorElement* ESDcsInfoTask::meESDcsFraction_
private

Definition at line 47 of file ESDcsInfoTask.h.

◆ mergeRuns_

bool ESDcsInfoTask::mergeRuns_
private

Definition at line 43 of file ESDcsInfoTask.h.

◆ prefixME_

std::string ESDcsInfoTask::prefixME_
private

Definition at line 41 of file ESDcsInfoTask.h.