CMS 3D CMS Logo

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

#include <DQM/SiStripMonitorCluster/interface/SiStripOfflineDQM.h>

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

Public Member Functions

 SiStripOfflineDQM (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~SiStripOfflineDQM () 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
 
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)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override
 Analyze. More...
 
void beginJob () override
 BeginJob. More...
 
void beginRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 BeginRun. More...
 
void checkTrackerFEDs (edm::Event const &e)
 
void endJob () override
 Endjob. More...
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup) override
 End Of Luminosity. More...
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 EndRun. More...
 
bool openInputFile ()
 Open Input File. More...
 

Private Attributes

SiStripActionExecutoractionExecutor_
 
edm::ParameterSet configPar_
 
bool createSummary_
 
bool createTkInfoFile_
 
DQMStoredqmStore_
 
int globalStatusFilling_
 
std::string inputFileName_
 
int nEvents_
 
std::string outputFileName_
 
bool printFaultyModuleList_
 
TTree * tkinfoTree_
 
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 ESProduct , Transition Tr = Transition::Event>
auto esConsumes (eventsetup::EventSetupRecordKey const &, 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

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

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

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

Definition at line 42 of file SiStripOfflineDQM.h.

Constructor & Destructor Documentation

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

Constructor.

Construct object.

Parameters
roPARAMETER_SETRegular Parameter Set that represent read configuration file

Definition at line 62 of file SiStripOfflineDQM.cc.

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

62  : configPar_(pSet) {
63  // Create MessageSender
64 
65  // Action Executor
67 
68  // get back-end interface
70 
71  usedWithEDMtoMEConverter_= configPar_.getUntrackedParameter<bool>("UsedWithEDMtoMEConverter",false);
72  createSummary_ = configPar_.getUntrackedParameter<bool>("CreateSummary",false);
73  createTkInfoFile_ = configPar_.getUntrackedParameter<bool>("CreateTkInfoFile",false);
76  globalStatusFilling_ = configPar_.getUntrackedParameter<int>("GlobalStatusFilling", 1);
77  printFaultyModuleList_ = configPar_.getUntrackedParameter<bool>("PrintFaultyModuleList", false);
78 
79  nEvents_ = 0;
80 
81  tkinfoTree_ = nullptr;
82 
83  if(createTkInfoFile_) {
85  tkinfoTree_ = fs->make<TTree>("TkDetIdInfo", "");
86  }
87 
88 }
T getUntrackedParameter(std::string const &, T const &) const
SiStripActionExecutor * actionExecutor_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
std::string outputFileName_
std::string inputFileName_
edm::ParameterSet configPar_
SiStripOfflineDQM::~SiStripOfflineDQM ( )
override

Destructor.

Definition at line 94 of file SiStripOfflineDQM.cc.

94  {
95 
96 }

Member Function Documentation

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

Analyze.

Executed at every Event.

Parameters
EventEvent
eSetupEvent Setup object with Geometry, Magnetic Field, etc.

Implements edm::EDAnalyzer.

Definition at line 164 of file SiStripOfflineDQM.cc.

References nEvents_.

164  {
165  nEvents_++;
166 }
void SiStripOfflineDQM::beginJob ( void  )
overrideprivatevirtual

BeginJob.

Executed at the begining of application.

Parameters
eSetupEvent Setup object

Reimplemented from edm::EDAnalyzer.

Definition at line 104 of file SiStripOfflineDQM.cc.

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

104  {
105 
106  // Essential: reads xml file to get the histogram names to create summary
107  // Read the summary configuration file
108  if (createSummary_) {
110  edm::LogInfo ("ReadConfigurationProblem") <<"SiStripOfflineDQM:: Error to read configuration file!! Summary will not be produced!!!";
111  createSummary_ = false;
112  }
113  }
114  edm::LogInfo("BeginJobDone") << "SiStripOfflineDQM::beginJob done";
115 }
SiStripActionExecutor * actionExecutor_
void SiStripOfflineDQM::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

BeginRun.

Executed at the begining a Run.

Parameters
runRun object
eSetupEvent Setup object with Geometry, Magnetic Field, etc.

Reimplemented from edm::EDAnalyzer.

Definition at line 125 of file SiStripOfflineDQM.cc.

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

125  {
126  edm::LogInfo ("BeginRun") <<"SiStripOfflineDQM:: Begining of Run";
127 
128  int nFEDs = 0;
129  if(auto runInfoRec = eSetup.tryToGet<RunInfoRcd>()) {
130 
131  edm::ESHandle<RunInfo> sumFED;
132  runInfoRec->get(sumFED);
133  if ( sumFED.isValid() ) {
134 
135  const int siStripFedIdMin = FEDNumbering::MINSiStripFEDID;
136  const int siStripFedIdMax = FEDNumbering::MAXSiStripFEDID;
137 
138  std::vector<int> FedsInIds= sumFED->m_fed_in;
139  for(unsigned int it = 0; it < FedsInIds.size(); ++it) {
140  int fedID = FedsInIds[it];
141 
142  if(fedID>=siStripFedIdMin && fedID<=siStripFedIdMax) ++nFEDs;
143  }
144  }
145  }
146  if (nFEDs > 0) trackerFEDsFound_ = true;
147  else trackerFEDsFound_ = false;
149  if (!openInputFile()) createSummary_ = false;
150  }
152 }
SiStripActionExecutor * actionExecutor_
void createStatus(DQMStore *dqm_store)
std::vector< int > m_fed_in
Definition: RunInfo.h:26
bool openInputFile()
Open Input File.
bool isValid() const
Definition: ESHandle.h:45
void SiStripOfflineDQM::checkTrackerFEDs ( edm::Event const &  e)
private
void SiStripOfflineDQM::endJob ( void  )
overrideprivatevirtual

Endjob.

End Job.

Reimplemented from edm::EDAnalyzer.

Definition at line 237 of file SiStripOfflineDQM.cc.

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

237  {
238 
239  edm::LogInfo( "EndOfJob") << "SiStripOfflineDQM::endJob";
242  std::ostringstream str_val;
244  std::cout << str_val.str() << std::endl;
245  }
246  }
247 }
SiStripActionExecutor * actionExecutor_
void printFaultyModuleList(DQMStore *dqm_store, std::ostringstream &str_val)
void SiStripOfflineDQM::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

End Of Luminosity.

End Lumi.

Reimplemented from edm::EDAnalyzer.

Definition at line 173 of file SiStripOfflineDQM.cc.

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

173  {
174  edm::LogInfo( "EndLumiBlock") << "SiStripOfflineDQM::endLuminosityBlock";
175  if (trackerFEDsFound_) {
177  }
178 }
SiStripActionExecutor * actionExecutor_
void fillStatusAtLumi(DQMStore *dqm_store)
void SiStripOfflineDQM::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

EndRun.

End Run.

Reimplemented from edm::EDAnalyzer.

Definition at line 185 of file SiStripOfflineDQM.cc.

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

185  {
186 
187  edm::LogInfo( "EndOfRun") << "SiStripOfflineDQM::endRun";
188 
189  // Access Cabling
191  eSetup.get<SiStripDetCablingRcd>().get(det_cabling);
192  // edm::ESHandle< SiStripFedCabling > fed_cabling;
193  // eSetup.get<SiStripFedCablingRcd>().get(fed_cabling);
195 
196  if (!trackerFEDsFound_) {
198  return;
199  }
200 
201  // Fill Global Status
202  if (globalStatusFilling_ > 0) actionExecutor_->fillStatus(dqmStore_, det_cabling, eSetup);
203 
205 
206  // create Summary Plots
208 
209  // Create TrackerMap
210  bool create_tkmap = configPar_.getUntrackedParameter<bool>("CreateTkMap",false);
211  if (create_tkmap) {
212  std::vector<edm::ParameterSet> tkMapOptions = configPar_.getUntrackedParameter< std::vector<edm::ParameterSet> >("TkMapOptions" );
214  std::vector<std::string> map_names;
215 
216  for(std::vector<edm::ParameterSet>::iterator it = tkMapOptions.begin(); it != tkMapOptions.end(); ++it) {
217  edm::ParameterSet tkMapPSet = *it;
218  std::string map_type = it->getUntrackedParameter<std::string>("mapName","");
219  map_names.push_back(map_type);
220  tkMapPSet.augment(configPar_.getUntrackedParameter<edm::ParameterSet>("TkmapParameters"));
221  edm::LogInfo("TkMapParameters") << tkMapPSet;
222  actionExecutor_->createOfflineTkMap(tkMapPSet, dqmStore_, map_type, eSetup);
223  }
224  if(createTkInfoFile_) {
226  }
227  }
228  }
229  }
230 }
T getUntrackedParameter(std::string const &, T const &) const
SiStripActionExecutor * actionExecutor_
void createOfflineTkMap(const edm::ParameterSet &tkmapPset, DQMStore *dqm_store, std::string &map_type, const edm::EventSetup &eSetup)
void fillStatus(DQMStore *dqm_store, const edm::ESHandle< SiStripDetCabling > &fedcabling, const edm::EventSetup &eSetup)
bool readTkMapConfiguration(const edm::EventSetup &eSetup)
void createStatus(DQMStore *dqm_store)
void augment(ParameterSet const &from)
void createTkInfoFile(std::vector< std::string > tkhmap_names, TTree *tkinfo_tree, DQMStore *dqm_store)
void createSummaryOffline(DQMStore *dqm_store)
edm::ParameterSet configPar_
bool SiStripOfflineDQM::openInputFile ( )
private

Open Input File.

Definition at line 254 of file SiStripOfflineDQM.cc.

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

Referenced by beginRun().

254  {
255  if (inputFileName_.empty()) return false;
256  edm::LogInfo("OpenFile") << "SiStripOfflineDQM::openInputFile: Accessing root File" << inputFileName_;
257  dqmStore_->open(inputFileName_, false);
258  return true;
259 }
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:2861
std::string inputFileName_

Member Data Documentation

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

Definition at line 92 of file SiStripOfflineDQM.h.

Referenced by endRun(), and SiStripOfflineDQM().

bool SiStripOfflineDQM::createSummary_
private

Definition at line 81 of file SiStripOfflineDQM.h.

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

bool SiStripOfflineDQM::createTkInfoFile_
private

Definition at line 82 of file SiStripOfflineDQM.h.

Referenced by endRun(), and SiStripOfflineDQM().

DQMStore* SiStripOfflineDQM::dqmStore_
private
int SiStripOfflineDQM::globalStatusFilling_
private

Definition at line 85 of file SiStripOfflineDQM.h.

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

std::string SiStripOfflineDQM::inputFileName_
private

Definition at line 83 of file SiStripOfflineDQM.h.

Referenced by openInputFile(), and SiStripOfflineDQM().

int SiStripOfflineDQM::nEvents_
private

Definition at line 87 of file SiStripOfflineDQM.h.

Referenced by analyze(), and SiStripOfflineDQM().

std::string SiStripOfflineDQM::outputFileName_
private

Definition at line 84 of file SiStripOfflineDQM.h.

Referenced by SiStripOfflineDQM().

bool SiStripOfflineDQM::printFaultyModuleList_
private

Definition at line 89 of file SiStripOfflineDQM.h.

Referenced by endJob(), and SiStripOfflineDQM().

TTree* SiStripOfflineDQM::tkinfoTree_
private

Definition at line 90 of file SiStripOfflineDQM.h.

Referenced by endRun(), and SiStripOfflineDQM().

bool SiStripOfflineDQM::trackerFEDsFound_
private

Definition at line 88 of file SiStripOfflineDQM.h.

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

bool SiStripOfflineDQM::usedWithEDMtoMEConverter_
private

Definition at line 86 of file SiStripOfflineDQM.h.

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