CMS 3D CMS Logo

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

#include <SiStripOfflineDQM.h>

Inheritance diagram for SiStripOfflineDQM:
edm::EDAnalyzer edm::EDConsumerBase

Public Types

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

Public Member Functions

 SiStripOfflineDQM (edm::ParameterSet const &ps)
 
- 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
 
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::vector< ModuleDescription const * > &modules, 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override
 
void beginJob () override
 
void beginRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 
void checkTrackerFEDs (edm::Event const &e)
 
void endJob () override
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup) override
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 
bool openInputFile (DQMStore &dqm_store)
 

Private Attributes

SiStripActionExecutor actionExecutor_
 
edm::ParameterSet const configPar_
 
bool createSummary_
 
bool const createTkInfoFile_
 
int globalStatusFilling_
 
std::string const inputFileName_
 
std::string const outputFileName_
 
bool printFaultyModuleList_
 
TTree * tkinfoTree_ { 0 }
 
bool trackerFEDsFound_
 
bool usedWithEDMtoMEConverter_
 

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 wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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)
 

Detailed Description

DQM/SiStripMonitorCluster/src/SiStripOfflineDQM.cc

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

DQM/SiStripMonitorCluster/interface/SiStripOfflineDQM.h

Description: DQM class to perform Summary creation Quality Test on a merged Root file after CAF processing Usage: <usage>

Definition at line 43 of file SiStripOfflineDQM.h.

Member Typedef Documentation

Definition at line 46 of file SiStripOfflineDQM.h.

Definition at line 45 of file SiStripOfflineDQM.h.

Constructor & Destructor Documentation

SiStripOfflineDQM::SiStripOfflineDQM ( edm::ParameterSet const &  ps)

Definition at line 53 of file SiStripOfflineDQM.cc.

References actionExecutor_, configPar_, createSummary_, createTkInfoFile_, edm::ParameterSet::getUntrackedParameter(), globalStatusFilling_, inputFileName_, TFileService::make(), outputFileName_, printFaultyModuleList_, AlCaHLTBitMon_QueryRunRegistry::string, tkinfoTree_, and usedWithEDMtoMEConverter_.

54  : configPar_{pSet},
55  actionExecutor_{pSet},
56  usedWithEDMtoMEConverter_{configPar_.getUntrackedParameter<bool>("UsedWithEDMtoMEConverter", false)},
57  createSummary_{configPar_.getUntrackedParameter<bool>("CreateSummary", false)},
58  createTkInfoFile_{configPar_.getUntrackedParameter<bool>("CreateTkInfoFile", false)},
61  globalStatusFilling_{configPar_.getUntrackedParameter<int>("GlobalStatusFilling", 1)},
62  printFaultyModuleList_{configPar_.getUntrackedParameter<bool>("PrintFaultyModuleList", false)} {
63  if (createTkInfoFile_) {
65  ->make<TTree>("TkDetIdInfo", "");
66  }
67 }
T getUntrackedParameter(std::string const &, T const &) const
std::string const inputFileName_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
bool const createTkInfoFile_
std::string const outputFileName_
SiStripActionExecutor actionExecutor_
edm::ParameterSet const configPar_

Member Function Documentation

void SiStripOfflineDQM::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 110 of file SiStripOfflineDQM.cc.

110 {}
void SiStripOfflineDQM::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 69 of file SiStripOfflineDQM.cc.

References actionExecutor_, createSummary_, and SiStripActionExecutor::readConfiguration().

69  {
70  // Essential: reads xml file to get the histogram names to create summary
71  // Read the summary configuration file
72  if (createSummary_) {
74  edm::LogInfo("ReadConfigurationProblem") << "SiStripOfflineDQM:: Error to read configuration file!! Summary "
75  "will not be produced!!!";
76  createSummary_ = false;
77  }
78  }
79  edm::LogInfo("BeginJobDone") << "SiStripOfflineDQM::beginJob done";
80 }
SiStripActionExecutor actionExecutor_
void SiStripOfflineDQM::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 82 of file SiStripOfflineDQM.cc.

References actionExecutor_, constexpr, SiStripActionExecutor::createStatus(), createSummary_, globalStatusFilling_, edm::ESHandleBase::isValid(), RunInfo::m_fed_in, FEDNumbering::MAXSiStripFEDID, FEDNumbering::MINSiStripFEDID, openInputFile(), trackerFEDsFound_, edm::EventSetup::tryToGet(), and usedWithEDMtoMEConverter_.

82  {
83  edm::LogInfo("BeginRun") << "SiStripOfflineDQM:: Begining of Run";
84 
85  int nFEDs = 0;
86  if (auto runInfoRec = eSetup.tryToGet<RunInfoRcd>()) {
88  runInfoRec->get(sumFED);
89  if (sumFED.isValid()) {
90  constexpr int siStripFedIdMin{FEDNumbering::MINSiStripFEDID};
91  constexpr int siStripFedIdMax{FEDNumbering::MAXSiStripFEDID};
92 
93  for (auto const fedID : sumFED->m_fed_in) {
94  if (fedID >= siStripFedIdMin && fedID <= siStripFedIdMax)
95  ++nFEDs;
96  }
97  }
98  }
99  auto& dqm_store = *edm::Service<DQMStore>{};
100  trackerFEDsFound_ = (nFEDs > 0);
102  if (!openInputFile(dqm_store))
103  createSummary_ = false;
104  }
105  if (globalStatusFilling_ > 0) {
106  actionExecutor_.createStatus(dqm_store);
107  }
108 }
bool openInputFile(DQMStore &dqm_store)
std::vector< int > m_fed_in
Definition: RunInfo.h:25
void createStatus(DQMStore &dqm_store)
SiStripActionExecutor actionExecutor_
bool isValid() const
Definition: ESHandle.h:44
#define constexpr
void SiStripOfflineDQM::checkTrackerFEDs ( edm::Event const &  e)
private
void SiStripOfflineDQM::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 168 of file SiStripOfflineDQM.cc.

References actionExecutor_, gather_cfg::cout, SiStripActionExecutor::printFaultyModuleList(), printFaultyModuleList_, and usedWithEDMtoMEConverter_.

168  {
169  edm::LogInfo("EndOfJob") << "SiStripOfflineDQM::endJob";
171  return;
172 
174  std::ostringstream str_val;
175  auto& dqm_store = *edm::Service<DQMStore>{};
176  actionExecutor_.printFaultyModuleList(dqm_store, str_val);
177  std::cout << str_val.str() << std::endl;
178  }
179 }
void printFaultyModuleList(DQMStore &dqm_store, std::ostringstream &str_val)
SiStripActionExecutor actionExecutor_
void SiStripOfflineDQM::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 112 of file SiStripOfflineDQM.cc.

References actionExecutor_, SiStripActionExecutor::fillStatusAtLumi(), globalStatusFilling_, and trackerFEDsFound_.

112  {
113  edm::LogInfo("EndLumiBlock") << "SiStripOfflineDQM::endLuminosityBlock";
114  if (trackerFEDsFound_) {
115  if (globalStatusFilling_ > 0) {
116  auto& dqm_store = *edm::Service<DQMStore>{};
118  }
119  }
120 }
void fillStatusAtLumi(DQMStore &dqm_store)
SiStripActionExecutor actionExecutor_
void SiStripOfflineDQM::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 122 of file SiStripOfflineDQM.cc.

References actionExecutor_, edm::ParameterSet::augment(), configPar_, SiStripActionExecutor::createOfflineTkMap(), SiStripActionExecutor::createStatus(), createSummary_, SiStripActionExecutor::createSummaryOffline(), SiStripActionExecutor::createTkInfoFile(), createTkInfoFile_, SiStripActionExecutor::fillDummyStatus(), SiStripActionExecutor::fillStatus(), edm::EventSetup::get(), edm::ParameterSet::getUntrackedParameter(), globalStatusFilling_, SiStripActionExecutor::readTkMapConfiguration(), AlCaHLTBitMon_QueryRunRegistry::string, tkinfoTree_, trackerFEDsFound_, and usedWithEDMtoMEConverter_.

122  {
123  edm::LogInfo("EndOfRun") << "SiStripOfflineDQM::endRun";
124 
125  // Access Cabling
127  eSetup.get<SiStripDetCablingRcd>().get(det_cabling);
128 
129  auto& dqm_store = *edm::Service<DQMStore>{};
130  if (globalStatusFilling_ > 0) {
131  actionExecutor_.createStatus(dqm_store);
132  if (!trackerFEDsFound_) {
134  return;
135  }
136  // Fill Global Status
137  actionExecutor_.fillStatus(dqm_store, det_cabling, eSetup);
138  }
139 
141  return;
142 
143  // create Summary Plots
144  if (createSummary_)
146 
147  // Create TrackerMap
148  bool const create_tkmap = configPar_.getUntrackedParameter<bool>("CreateTkMap", false);
149  if (create_tkmap) {
150  auto const tkMapOptions = configPar_.getUntrackedParameter<std::vector<edm::ParameterSet>>("TkMapOptions");
152  std::vector<std::string> map_names;
153  for (auto const& ps : tkMapOptions) {
154  edm::ParameterSet tkMapPSet = ps;
155  std::string map_type = ps.getUntrackedParameter<std::string>("mapName", "");
156  map_names.push_back(map_type);
157  tkMapPSet.augment(configPar_.getUntrackedParameter<edm::ParameterSet>("TkmapParameters"));
158  edm::LogInfo("TkMapParameters") << tkMapPSet;
159  actionExecutor_.createOfflineTkMap(tkMapPSet, dqm_store, map_type, eSetup);
160  }
161  if (createTkInfoFile_) {
162  actionExecutor_.createTkInfoFile(map_names, tkinfoTree_, dqm_store);
163  }
164  }
165  }
166 }
T getUntrackedParameter(std::string const &, T const &) const
void createTkInfoFile(std::vector< std::string > tkhmap_names, TTree *tkinfo_tree, DQMStore &dqm_store)
bool readTkMapConfiguration(const edm::EventSetup &eSetup)
void fillStatus(DQMStore &dqm_store, edm::ESHandle< SiStripDetCabling > const &fedcabling, edm::EventSetup const &eSetup)
void augment(ParameterSet const &from)
bool const createTkInfoFile_
void createStatus(DQMStore &dqm_store)
void createSummaryOffline(DQMStore &dqm_store)
SiStripActionExecutor actionExecutor_
edm::ParameterSet const configPar_
void createOfflineTkMap(const edm::ParameterSet &tkmapPset, DQMStore &dqm_store, std::string &map_type, const edm::EventSetup &eSetup)
bool SiStripOfflineDQM::openInputFile ( DQMStore dqm_store)
private

Definition at line 181 of file SiStripOfflineDQM.cc.

References DEFINE_FWK_MODULE, inputFileName_, and dqm::dqmstoreimpl::DQMStore::open().

Referenced by beginRun().

181  {
182  if (inputFileName_.empty())
183  return false;
184  edm::LogInfo("OpenFile") << "SiStripOfflineDQM::openInputFile: Accessing root File" << inputFileName_;
185  dqm_store.open(inputFileName_, false);
186  return true;
187 }
std::string const inputFileName_

Member Data Documentation

SiStripActionExecutor SiStripOfflineDQM::actionExecutor_
private
edm::ParameterSet const SiStripOfflineDQM::configPar_
private

Definition at line 61 of file SiStripOfflineDQM.h.

Referenced by endRun(), and SiStripOfflineDQM().

bool SiStripOfflineDQM::createSummary_
private

Definition at line 66 of file SiStripOfflineDQM.h.

Referenced by beginJob(), beginRun(), endRun(), and SiStripOfflineDQM().

bool const SiStripOfflineDQM::createTkInfoFile_
private

Definition at line 67 of file SiStripOfflineDQM.h.

Referenced by endRun(), and SiStripOfflineDQM().

int SiStripOfflineDQM::globalStatusFilling_
private

Definition at line 70 of file SiStripOfflineDQM.h.

Referenced by beginRun(), endLuminosityBlock(), endRun(), and SiStripOfflineDQM().

std::string const SiStripOfflineDQM::inputFileName_
private

Definition at line 68 of file SiStripOfflineDQM.h.

Referenced by openInputFile(), and SiStripOfflineDQM().

std::string const SiStripOfflineDQM::outputFileName_
private

Definition at line 69 of file SiStripOfflineDQM.h.

Referenced by SiStripOfflineDQM().

bool SiStripOfflineDQM::printFaultyModuleList_
private

Definition at line 72 of file SiStripOfflineDQM.h.

Referenced by endJob(), and SiStripOfflineDQM().

TTree* SiStripOfflineDQM::tkinfoTree_ { 0 }
private

Definition at line 73 of file SiStripOfflineDQM.h.

Referenced by endRun(), and SiStripOfflineDQM().

bool SiStripOfflineDQM::trackerFEDsFound_
private

Definition at line 71 of file SiStripOfflineDQM.h.

Referenced by beginRun(), endLuminosityBlock(), and endRun().

bool SiStripOfflineDQM::usedWithEDMtoMEConverter_
private

Definition at line 65 of file SiStripOfflineDQM.h.

Referenced by beginRun(), endJob(), endRun(), and SiStripOfflineDQM().