CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiStripOfflineDQM Class Reference

#include <DQM/SiStripMonitorCluster/src/SiStripOfflineDQM.cc>

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

Public Member Functions

 SiStripOfflineDQM (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~SiStripOfflineDQM ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

SiStripActionExecutoractionExecutor_
 
edm::ParameterSet configPar_
 
bool createSummary_
 
DQMStoredqmStore_
 
int globalStatusFilling_
 
std::string inputFileName_
 
int nEvents_
 
std::string outputFileName_
 
bool printFaultyModuleList_
 
bool trackerFEDsFound_
 
bool usedWithEDMtoMEConverter_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 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: DQM class to perform Summary creation Quality Test on a merged Root file after CAF processing Usage: <usage>

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

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

Definition at line 41 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 60 of file SiStripOfflineDQM.cc.

References actionExecutor_, configPar_, createSummary_, dqmStore_, edm::ParameterSet::getUntrackedParameter(), globalStatusFilling_, inputFileName_, nEvents_, cppFunctionSkipper::operator, outputFileName_, printFaultyModuleList_, AlCaHLTBitMon_QueryRunRegistry::string, and usedWithEDMtoMEConverter_.

60  : configPar_(pSet) {
61  // Create MessageSender
62 
63  // Action Executor
65 
66  // get back-end interface
68 
69  usedWithEDMtoMEConverter_= configPar_.getUntrackedParameter<bool>("UsedWithEDMtoMEConverter",false);
70  createSummary_ = configPar_.getUntrackedParameter<bool>("CreateSummary",false);
73  globalStatusFilling_ = configPar_.getUntrackedParameter<int>("GlobalStatusFilling", 1);
74  printFaultyModuleList_ = configPar_.getUntrackedParameter<bool>("PrintFaultyModuleList", false);
75 
76  nEvents_ = 0;
77 }
T getUntrackedParameter(std::string const &, T const &) const
SiStripActionExecutor * actionExecutor_
std::string outputFileName_
std::string inputFileName_
edm::ParameterSet configPar_
SiStripOfflineDQM::~SiStripOfflineDQM ( )
virtual

Destructor.

Definition at line 83 of file SiStripOfflineDQM.cc.

83  {
84 
85 }

Member Function Documentation

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

Analyze.

Executed at every Event.

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

Implements edm::EDAnalyzer.

Definition at line 154 of file SiStripOfflineDQM.cc.

References nEvents_.

154  {
155  nEvents_++;
156 }
void SiStripOfflineDQM::beginJob ( void  )
privatevirtual

BeginJob.

Executed at the begining of application.

Parameters
eSetupEvent Setup object

Reimplemented from edm::EDAnalyzer.

Definition at line 93 of file SiStripOfflineDQM.cc.

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

93  {
94 
95  // Essential: reads xml file to get the histogram names to create summary
96  // Read the summary configuration file
97  if (createSummary_) {
99  edm::LogInfo ("ReadConfigurationProblem") <<"SiStripOfflineDQM:: Error to read configuration file!! Summary will not be produced!!!";
100  createSummary_ = false;
101  }
102  }
103  edm::LogInfo("BeginJobDone") << "SiStripOfflineDQM::beginJob done";
104 }
SiStripActionExecutor * actionExecutor_
void SiStripOfflineDQM::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
privatevirtual

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 114 of file SiStripOfflineDQM.cc.

References actionExecutor_, SiStripActionExecutor::createStatus(), createSummary_, dqmStore_, edm::EventSetup::find(), edm::eventsetup::heterocontainer::HCTypeTag::findType(), edm::EventSetup::get(), globalStatusFilling_, edm::ESHandleBase::isValid(), FEDNumbering::MAXSiStripFEDID, FEDNumbering::MINSiStripFEDID, openInputFile(), trackerFEDsFound_, and usedWithEDMtoMEConverter_.

114  {
115  edm::LogInfo ("BeginRun") <<"SiStripOfflineDQM:: Begining of Run";
116 
117  int nFEDs = 0;
119  if( eSetup.find( recordKey ) != 0) {
120 
121  edm::ESHandle<RunInfo> sumFED;
122  eSetup.get<RunInfoRcd>().get(sumFED);
123  if ( sumFED.isValid() ) {
124 
125  const int siStripFedIdMin = FEDNumbering::MINSiStripFEDID;
126  const int siStripFedIdMax = FEDNumbering::MAXSiStripFEDID;
127 
128  std::vector<int> FedsInIds= sumFED->m_fed_in;
129  for(unsigned int it = 0; it < FedsInIds.size(); ++it) {
130  int fedID = FedsInIds[it];
131 
132  if(fedID>=siStripFedIdMin && fedID<=siStripFedIdMax) ++nFEDs;
133  }
134  }
135  }
136  if (nFEDs > 0) trackerFEDsFound_ = true;
137  else trackerFEDsFound_ = false;
139  if (!openInputFile()) createSummary_ = false;
140  }
142 }
SiStripActionExecutor * actionExecutor_
void createStatus(DQMStore *dqm_store)
bool openInputFile()
Open Input File.
bool isValid() const
Definition: ESHandle.h:47
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:125
void SiStripOfflineDQM::checkTrackerFEDs ( edm::Event const &  e)
private
void SiStripOfflineDQM::endJob ( void  )
privatevirtual

Endjob.

End Job.

Reimplemented from edm::EDAnalyzer.

Definition at line 222 of file SiStripOfflineDQM.cc.

References actionExecutor_, DQMStore::cd(), gather_cfg::cout, dqmStore_, outputFileName_, SiStripActionExecutor::printFaultyModuleList(), printFaultyModuleList_, DQMStore::save(), and usedWithEDMtoMEConverter_.

222  {
223 
224  edm::LogInfo( "EndOfJob") << "SiStripOfflineDQM::endJob";
227  std::ostringstream str_val;
229  std::cout << str_val.str() << std::endl;
230  }
231  // Save Output file
232  dqmStore_->cd();
233  dqmStore_->save(outputFileName_, "","","");
234  }
235 }
SiStripActionExecutor * actionExecutor_
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:661
std::string outputFileName_
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2562
tuple cout
Definition: gather_cfg.py:121
void printFaultyModuleList(DQMStore *dqm_store, std::ostringstream &str_val)
void SiStripOfflineDQM::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  iSetup 
)
privatevirtual

End Of Luminosity.

End Lumi.

Reimplemented from edm::EDAnalyzer.

Definition at line 163 of file SiStripOfflineDQM.cc.

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

163  {
164  edm::LogInfo( "EndLumiBlock") << "SiStripOfflineDQM::endLuminosityBlock";
165  if (trackerFEDsFound_) {
167  }
168 }
SiStripActionExecutor * actionExecutor_
void fillStatusAtLumi(DQMStore *dqm_store)
void SiStripOfflineDQM::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
privatevirtual

EndRun.

End Run.

Reimplemented from edm::EDAnalyzer.

Definition at line 175 of file SiStripOfflineDQM.cc.

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

175  {
176 
177  edm::LogInfo( "EndOfRun") << "SiStripOfflineDQM::endRun";
178 
179  // Access Cabling
181  eSetup.get<SiStripDetCablingRcd>().get(det_cabling);
182  // edm::ESHandle< SiStripFedCabling > fed_cabling;
183  // eSetup.get<SiStripFedCablingRcd>().get(fed_cabling);
185 
186  if (!trackerFEDsFound_) {
188  return;
189  }
190 
191  // Fill Global Status
192  if (globalStatusFilling_ > 0) actionExecutor_->fillStatus(dqmStore_, det_cabling, eSetup);
193 
195 
196  // create Summary Plots
198 
199  // Create TrackerMap
200  bool create_tkmap = configPar_.getUntrackedParameter<bool>("CreateTkMap",false);
201  if (create_tkmap) {
202  std::vector<edm::ParameterSet> tkMapOptions = configPar_.getUntrackedParameter< std::vector<edm::ParameterSet> >("TkMapOptions" );
204 
205  for(std::vector<edm::ParameterSet>::iterator it = tkMapOptions.begin(); it != tkMapOptions.end(); ++it) {
206  edm::ParameterSet tkMapPSet = *it;
207  std::string map_type = it->getUntrackedParameter<std::string>("mapName","");
208  tkMapPSet.augment(configPar_.getUntrackedParameter<edm::ParameterSet>("TkmapParameters"));
209  edm::LogInfo("TkMapParameters") << tkMapPSet;
210  actionExecutor_->createOfflineTkMap(tkMapPSet, dqmStore_, map_type, eSetup);
211  }
212  }
213  }
214  }
215 }
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 createSummaryOffline(DQMStore *dqm_store)
edm::ParameterSet configPar_
bool SiStripOfflineDQM::openInputFile ( )
private

Open Input File.

Definition at line 242 of file SiStripOfflineDQM.cc.

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

Referenced by beginRun().

242  {
243  if (inputFileName_.size() == 0) return false;
244  edm::LogInfo("OpenFile") << "SiStripOfflineDQM::openInputFile: Accessing root File" << inputFileName_;
245  dqmStore_->open(inputFileName_, false);
246  return true;
247 }
std::string inputFileName_
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2917

Member Data Documentation

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

Definition at line 89 of file SiStripOfflineDQM.h.

Referenced by endRun(), and SiStripOfflineDQM().

bool SiStripOfflineDQM::createSummary_
private

Definition at line 80 of file SiStripOfflineDQM.h.

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

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

Definition at line 83 of file SiStripOfflineDQM.h.

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

std::string SiStripOfflineDQM::inputFileName_
private

Definition at line 81 of file SiStripOfflineDQM.h.

Referenced by openInputFile(), and SiStripOfflineDQM().

int SiStripOfflineDQM::nEvents_
private

Definition at line 85 of file SiStripOfflineDQM.h.

Referenced by analyze(), and SiStripOfflineDQM().

std::string SiStripOfflineDQM::outputFileName_
private

Definition at line 82 of file SiStripOfflineDQM.h.

Referenced by endJob(), and SiStripOfflineDQM().

bool SiStripOfflineDQM::printFaultyModuleList_
private

Definition at line 87 of file SiStripOfflineDQM.h.

Referenced by endJob(), and SiStripOfflineDQM().

bool SiStripOfflineDQM::trackerFEDsFound_
private

Definition at line 86 of file SiStripOfflineDQM.h.

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

bool SiStripOfflineDQM::usedWithEDMtoMEConverter_
private

Definition at line 84 of file SiStripOfflineDQM.h.

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