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::one::EDAnalyzer< edm::one::SharedResources, edm::one::WatchLuminosityBlocks > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase 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::one::EDAnalyzer< edm::one::SharedResources, edm::one::WatchLuminosityBlocks >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~EDAnalyzerBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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 endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 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)
 
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 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::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

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  {
20  usesResource("DQMStore");
22 
23  prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
24 
25  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
26 
27  dcsStatustoken_ = consumes<DcsStatusCollection>(ps.getParameter<InputTag>("DcsStatusLabel"));
28 
29  meESDcsFraction_ = nullptr;
30  meESDcsActiveMap_ = nullptr;
31 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:50
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:51
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DcsStatusCollection > dcsStatustoken_
Definition: ESDcsInfoTask.h:48
DQMStore * dqmStore_
Definition: ESDcsInfoTask.h:42
std::string prefixME_
Definition: ESDcsInfoTask.h:44

◆ ~ESDcsInfoTask()

ESDcsInfoTask::~ESDcsInfoTask ( )
override

Destructor.

Definition at line 33 of file ESDcsInfoTask.cc.

33 {}

Member Function Documentation

◆ analyze()

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

Analyze.

Implements edm::one::EDAnalyzerBase.

Definition at line 71 of file ESDcsInfoTask.cc.

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

71  {
72  ievt_++;
73 
74  float ESpDcsStatus = 0;
75  float ESmDcsStatus = 0;
76 
78  e.getByToken(dcsStatustoken_, dcsStatus);
79  if (dcsStatus.isValid()) {
80  for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin(); dcsStatusItr != dcsStatus->end();
81  ++dcsStatusItr) {
82  ESpDcsStatus = dcsStatusItr->ready(DcsStatus::ESp);
83  ESmDcsStatus = dcsStatusItr->ready(DcsStatus::ESm);
84  }
85 
86  ESpDcsStatus = (ESpDcsStatus + float(ievt_ - 1) * meESDcsActiveMap_->getBinContent(1)) / float(ievt_);
87  ESmDcsStatus = (ESmDcsStatus + float(ievt_ - 1) * meESDcsActiveMap_->getBinContent(2)) / float(ievt_);
88  }
89 
90  meESDcsActiveMap_->setBinContent(1, ESpDcsStatus);
91  meESDcsActiveMap_->setBinContent(2, ESmDcsStatus);
92 
93  meESDcsFraction_->Fill((ESpDcsStatus + ESmDcsStatus) / 2.);
94 }
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:50
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:51
void Fill(long long x)
edm::EDGetTokenT< DcsStatusCollection > dcsStatustoken_
Definition: ESDcsInfoTask.h:48
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::one::EDAnalyzerBase.

Definition at line 35 of file ESDcsInfoTask.cc.

References timingPdfMaker::histo.

35  {
36  char histo[200];
37 
38  if (dqmStore_) {
39  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
40 
41  sprintf(histo, "DCSSummary");
43  meESDcsFraction_->Fill(-1.0);
44 
45  sprintf(histo, "DCSSummaryMap");
47  meESDcsActiveMap_->setAxisTitle("(ES+/ES-)", 1);
48  }
49 }
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:50
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:656
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:51
void Fill(long long x)
DQMStore * dqmStore_
Definition: ESDcsInfoTask.h:42
std::string prefixME_
Definition: ESDcsInfoTask.h:44
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 
)
overrideprotected

BeginLuminosityBlock.

Definition at line 53 of file ESDcsInfoTask.cc.

References mps_fire::i, and reset().

53  {
54  this->reset();
55 
56  for (int i = 0; i < 2; i++) {
57  meESDcsActiveMap_->setBinContent(i + 1, -1.0);
58  }
59 }
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:51
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::one::EDAnalyzerBase.

Definition at line 51 of file ESDcsInfoTask.cc.

51 {}

◆ endLuminosityBlock()

void ESDcsInfoTask::endLuminosityBlock ( const edm::LuminosityBlock ,
const edm::EventSetup  
)
overrideprotected

EndLuminosityBlock.

Definition at line 61 of file ESDcsInfoTask.cc.

61 {}

◆ reset()

void ESDcsInfoTask::reset ( void  )
protected

Reset.

Definition at line 63 of file ESDcsInfoTask.cc.

63  {
64  if (meESDcsFraction_)
66 
69 }
MonitorElement * meESDcsFraction_
Definition: ESDcsInfoTask.h:50
MonitorElement * meESDcsActiveMap_
Definition: ESDcsInfoTask.h:51
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 48 of file ESDcsInfoTask.h.

◆ dqmStore_

DQMStore* ESDcsInfoTask::dqmStore_
private

Definition at line 42 of file ESDcsInfoTask.h.

◆ ievt_

int ESDcsInfoTask::ievt_
private

Definition at line 53 of file ESDcsInfoTask.h.

◆ meESDcsActiveMap_

MonitorElement* ESDcsInfoTask::meESDcsActiveMap_
private

Definition at line 51 of file ESDcsInfoTask.h.

◆ meESDcsFraction_

MonitorElement* ESDcsInfoTask::meESDcsFraction_
private

Definition at line 50 of file ESDcsInfoTask.h.

◆ mergeRuns_

bool ESDcsInfoTask::mergeRuns_
private

Definition at line 46 of file ESDcsInfoTask.h.

◆ prefixME_

std::string ESDcsInfoTask::prefixME_
private

Definition at line 44 of file ESDcsInfoTask.h.