CMS 3D CMS Logo

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

#include <SiStripOfflineDQM.h>

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

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

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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.

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},
57  configPar_.getUntrackedParameter<bool>("UsedWithEDMtoMEConverter",
58  false)},
60  configPar_.getUntrackedParameter<bool>("CreateSummary", false)},
62  configPar_.getUntrackedParameter<bool>("CreateTkInfoFile", false)},
64  configPar_.getUntrackedParameter<std::string>("InputFileName", "")},
66  configPar_.getUntrackedParameter<std::string>("OutputFileName", "")},
68  configPar_.getUntrackedParameter<int>("GlobalStatusFilling", 1)},
70  configPar_.getUntrackedParameter<bool>("PrintFaultyModuleList", false)}
71 {
72  if (createTkInfoFile_) {
74  ->make<TTree>("TkDetIdInfo", "");
75  }
76 }
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 124 of file SiStripOfflineDQM.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 79 of file SiStripOfflineDQM.cc.

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

80 {
81  // Essential: reads xml file to get the histogram names to create summary
82  // Read the summary configuration file
83  if (createSummary_) {
85  edm::LogInfo("ReadConfigurationProblem")
86  << "SiStripOfflineDQM:: Error to read configuration file!! Summary "
87  "will not be produced!!!";
88  createSummary_ = false;
89  }
90  }
91  edm::LogInfo("BeginJobDone") << "SiStripOfflineDQM::beginJob done";
92 }
SiStripActionExecutor actionExecutor_
void SiStripOfflineDQM::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 95 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_.

96 {
97  edm::LogInfo ("BeginRun") <<"SiStripOfflineDQM:: Begining of Run";
98 
99  int nFEDs = 0;
100  if(auto runInfoRec = eSetup.tryToGet<RunInfoRcd>()) {
101 
102  edm::ESHandle<RunInfo> sumFED;
103  runInfoRec->get(sumFED);
104  if (sumFED.isValid()) {
105  constexpr int siStripFedIdMin{FEDNumbering::MINSiStripFEDID};
106  constexpr int siStripFedIdMax{FEDNumbering::MAXSiStripFEDID};
107 
108  for (auto const fedID : sumFED->m_fed_in) {
109  if (fedID >= siStripFedIdMin && fedID <= siStripFedIdMax) ++nFEDs;
110  }
111  }
112  }
113  auto& dqm_store = *edm::Service<DQMStore>{};
114  trackerFEDsFound_ = (nFEDs > 0);
116  if (!openInputFile(dqm_store)) createSummary_ = false;
117  }
118  if (globalStatusFilling_ > 0) {
119  actionExecutor_.createStatus(dqm_store);
120  }
121 }
bool openInputFile(DQMStore &dqm_store)
std::vector< int > m_fed_in
Definition: RunInfo.h:26
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 193 of file SiStripOfflineDQM.cc.

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

194 {
195  edm::LogInfo( "EndOfJob") << "SiStripOfflineDQM::endJob";
196  if (usedWithEDMtoMEConverter_) return;
197 
199  std::ostringstream str_val;
200  auto& dqm_store = *edm::Service<DQMStore>{};
201  actionExecutor_.printFaultyModuleList(dqm_store, str_val);
202  std::cout << str_val.str() << std::endl;
203  }
204 }
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 128 of file SiStripOfflineDQM.cc.

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

130 {
131  edm::LogInfo( "EndLumiBlock") << "SiStripOfflineDQM::endLuminosityBlock";
132  if (trackerFEDsFound_) {
133  if (globalStatusFilling_ > 0) {
134  auto& dqm_store = *edm::Service<DQMStore>{};
136  }
137  }
138 }
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 141 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_.

142 {
143  edm::LogInfo( "EndOfRun") << "SiStripOfflineDQM::endRun";
144 
145  // Access Cabling
147  eSetup.get<SiStripDetCablingRcd>().get(det_cabling);
148 
149  auto& dqm_store = *edm::Service<DQMStore>{};
150  if (globalStatusFilling_ > 0) {
151  actionExecutor_.createStatus(dqm_store);
152  if (!trackerFEDsFound_) {
154  return;
155  }
156  // Fill Global Status
157  actionExecutor_.fillStatus(dqm_store, det_cabling, eSetup);
158  }
159 
160  if (usedWithEDMtoMEConverter_) return;
161 
162  // create Summary Plots
164 
165  // Create TrackerMap
166  bool const create_tkmap =
167  configPar_.getUntrackedParameter<bool>("CreateTkMap", false);
168  if (create_tkmap) {
169  auto const tkMapOptions =
170  configPar_.getUntrackedParameter<std::vector<edm::ParameterSet>>(
171  "TkMapOptions");
173  std::vector<std::string> map_names;
174  for (auto const& ps : tkMapOptions) {
175  edm::ParameterSet tkMapPSet = ps;
176  std::string map_type =
177  ps.getUntrackedParameter<std::string>("mapName", "");
178  map_names.push_back(map_type);
180  "TkmapParameters"));
181  edm::LogInfo("TkMapParameters") << tkMapPSet;
183  tkMapPSet, dqm_store, map_type, eSetup);
184  }
185  if (createTkInfoFile_) {
186  actionExecutor_.createTkInfoFile(map_names, tkinfoTree_, dqm_store);
187  }
188  }
189  }
190 }
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 207 of file SiStripOfflineDQM.cc.

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

Referenced by beginRun().

208 {
209  if (inputFileName_.empty()) return false;
210  edm::LogInfo("OpenFile") << "SiStripOfflineDQM::openInputFile: Accessing root File" << inputFileName_;
211  dqm_store.open(inputFileName_, false);
212  return true;
213 }
std::string const inputFileName_
bool open(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2883

Member Data Documentation

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

Definition at line 58 of file SiStripOfflineDQM.h.

Referenced by endRun(), and SiStripOfflineDQM().

bool SiStripOfflineDQM::createSummary_
private

Definition at line 63 of file SiStripOfflineDQM.h.

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

bool const SiStripOfflineDQM::createTkInfoFile_
private

Definition at line 64 of file SiStripOfflineDQM.h.

Referenced by endRun(), and SiStripOfflineDQM().

int SiStripOfflineDQM::globalStatusFilling_
private

Definition at line 67 of file SiStripOfflineDQM.h.

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

std::string const SiStripOfflineDQM::inputFileName_
private

Definition at line 65 of file SiStripOfflineDQM.h.

Referenced by openInputFile(), and SiStripOfflineDQM().

std::string const SiStripOfflineDQM::outputFileName_
private

Definition at line 66 of file SiStripOfflineDQM.h.

Referenced by SiStripOfflineDQM().

bool SiStripOfflineDQM::printFaultyModuleList_
private

Definition at line 69 of file SiStripOfflineDQM.h.

Referenced by endJob(), and SiStripOfflineDQM().

TTree* SiStripOfflineDQM::tkinfoTree_ { 0 }
private

Definition at line 70 of file SiStripOfflineDQM.h.

Referenced by endRun(), and SiStripOfflineDQM().

bool SiStripOfflineDQM::trackerFEDsFound_
private

Definition at line 68 of file SiStripOfflineDQM.h.

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

bool SiStripOfflineDQM::usedWithEDMtoMEConverter_
private

Definition at line 62 of file SiStripOfflineDQM.h.

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