CMS 3D CMS Logo

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

#include <SiStripAnalyser.h>

Inheritance diagram for SiStripAnalyser:
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

 SiStripAnalyser (const edm::ParameterSet &ps)
 
 ~SiStripAnalyser () override
 
- 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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 beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup) 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 &eSetup) override
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 

Private Attributes

SiStripActionExecutor actionExecutor_
 
SiStripClassToMonitorCondData condDataMon_
 
edm::ESHandle< SiStripDetCablingdetCabling_
 
bool endLumiAnalysisOn_ {false}
 
edm::ESHandle< SiStripFedCablingfedCabling_
 
int globalStatusFilling_
 
unsigned long long m_cacheID_
 
int nEvents_ {}
 
int nLumiSecs_ {}
 
std::string outputFileName_
 
std::string outputFilePath_
 
bool printFaultyModuleList_
 
edm::EDGetTokenT< FEDRawDataCollectionrawDataToken_
 
int shiftReportFrequency_
 
int staticUpdateFrequency_
 
int summaryFrequency_ {-1}
 
edm::ParameterSet tkMapPSet_
 
bool trackerFEDsFound_ {false}
 

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
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 31 of file SiStripAnalyser.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 34 of file SiStripAnalyser.h.

◆ MonitorElement

Definition at line 33 of file SiStripAnalyser.h.

Constructor & Destructor Documentation

◆ SiStripAnalyser()

SiStripAnalyser::SiStripAnalyser ( const edm::ParameterSet ps)

Definition at line 40 of file SiStripAnalyser.cc.

41  : condDataMon_{ps},
42  actionExecutor_{ps},
43  tkMapPSet_{ps.getParameter<edm::ParameterSet>("TkmapParameters")},
44  summaryFrequency_{ps.getUntrackedParameter<int>("SummaryCreationFrequency", 1)},
45  staticUpdateFrequency_{ps.getUntrackedParameter<int>("StaticUpdateFrequency", 1)},
46  globalStatusFilling_{ps.getUntrackedParameter<int>("GlobalStatusFilling", 1)},
47  shiftReportFrequency_{ps.getUntrackedParameter<int>("ShiftReportFrequency", 1)},
48  rawDataToken_{consumes<FEDRawDataCollection>(ps.getUntrackedParameter<edm::InputTag>("RawDataTag"))},
49  printFaultyModuleList_{ps.getUntrackedParameter<bool>("PrintFaultyModuleList", true)} {
50  std::string const localPath{"DQM/SiStripMonitorClient/test/loader.html"};
51  std::ifstream fin{edm::FileInPath(localPath).fullPath(), std::ios::in};
52  if (!fin) {
53  std::cerr << "Input File: loader.html"
54  << " could not be opened!" << std::endl;
55  return;
56  }
57  edm::LogInfo("SiStripAnalyser") << " SiStripAnalyser::Creating SiStripAnalyser ";
58 }

◆ ~SiStripAnalyser()

SiStripAnalyser::~SiStripAnalyser ( )
override

Definition at line 60 of file SiStripAnalyser.cc.

60 { edm::LogInfo("SiStripAnalyser") << "SiStripAnalyser::Deleting SiStripAnalyser "; }

Member Function Documentation

◆ analyze()

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

◆ beginJob()

void SiStripAnalyser::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 62 of file SiStripAnalyser.cc.

62  {
63  // Read the summary configuration file
65  edm::LogInfo("SiStripAnalyser") << "SiStripAnalyser:: Error to read configuration file!! Summary will "
66  "not be produced!!!";
67  }
68 }

References actionExecutor_, and SiStripActionExecutor::readConfiguration().

◆ beginLuminosityBlock()

void SiStripAnalyser::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 93 of file SiStripAnalyser.cc.

93  {
94  edm::LogInfo("SiStripAnalyser") << "SiStripAnalyser:: Begin of LS transition";
95 }

◆ beginRun()

void SiStripAnalyser::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 70 of file SiStripAnalyser.cc.

70  {
71  edm::LogInfo("SiStripAnalyser") << "SiStripAnalyser:: Begining of Run";
72 
73  // Check latest Fed cabling and create TrackerMapCreator
74  unsigned long long const cacheID = eSetup.get<SiStripFedCablingRcd>().cacheIdentifier();
75  if (m_cacheID_ != cacheID) {
76  m_cacheID_ = cacheID;
77  edm::LogInfo("SiStripAnalyser") << "SiStripAnalyser::beginRun: "
78  << " Change in Cabling, recrated TrackerMap";
80  edm::LogInfo("SiStripAnalyser") << "SiStripAnalyser:: Error to read configuration file!! TrackerMap "
81  "will not be produced!!!";
82  }
83  eSetup.get<SiStripFedCablingRcd>().get(fedCabling_);
84  eSetup.get<SiStripDetCablingRcd>().get(detCabling_);
85  }
86  condDataMon_.beginRun(run.run(), eSetup);
88  auto& dqm_store = *edm::Service<DQMStore>{};
89  actionExecutor_.createStatus(dqm_store);
90  }
91 }

References actionExecutor_, SiStripClassToMonitorCondData::beginRun(), condDataMon_, SiStripActionExecutor::createStatus(), detCabling_, fedCabling_, edm::EventSetup::get(), get, globalStatusFilling_, m_cacheID_, SiStripActionExecutor::readTkMapConfiguration(), and writedatasetfile::run.

◆ checkTrackerFEDs()

void SiStripAnalyser::checkTrackerFEDs ( edm::Event const &  e)
private

Definition at line 155 of file SiStripAnalyser.cc.

155  {
156  edm::Handle<FEDRawDataCollection> rawDataHandle;
157  e.getByToken(rawDataToken_, rawDataHandle);
158  if (!rawDataHandle.isValid())
159  return;
160 
161  auto const& rawDataCollection = *rawDataHandle;
162  constexpr int siStripFedIdMin{FEDNumbering::MINSiStripFEDID};
163  constexpr int siStripFedIdMax{FEDNumbering::MAXSiStripFEDID};
164 
165  for (int i = siStripFedIdMin; i <= siStripFedIdMax; ++i) {
166  auto const& fedData = rawDataCollection.FEDData(i);
167  if (fedData.size() && fedData.data()) {
168  trackerFEDsFound_ = true;
169  return;
170  }
171  }
172 }

References MillePedeFileConverter_cfg::e, mps_fire::i, edm::HandleBase::isValid(), FEDNumbering::MAXSiStripFEDID, FEDNumbering::MINSiStripFEDID, rawDataToken_, and trackerFEDsFound_.

Referenced by analyze().

◆ endJob()

void SiStripAnalyser::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 145 of file SiStripAnalyser.cc.

145  {
146  edm::LogInfo("SiStripAnalyser") << "SiStripAnalyser:: endjob called!";
148  std::ostringstream str_val;
149  auto& dqm_store = *edm::Service<DQMStore>{};
150  actionExecutor_.printFaultyModuleList(dqm_store, str_val);
151  std::cout << str_val.str() << std::endl;
152  }
153 }

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

◆ endLuminosityBlock()

void SiStripAnalyser::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 113 of file SiStripAnalyser.cc.

113  {
114  edm::LogInfo("SiStripAnalyser") << "SiStripAnalyser:: End of LS transition, "
115  "performing the DQM client operation";
116  ++nLumiSecs_;
117 
118  if (!trackerFEDsFound_) {
120  return;
121  }
122  endLumiAnalysisOn_ = true;
123 
124  std::cout << "====================================================== " << std::endl;
125  std::cout << " ===> Iteration # " << nLumiSecs_ << " " << lumiSeg.luminosityBlock() << std::endl;
126  std::cout << "====================================================== " << std::endl;
127 
128  auto& dqm_store = *edm::Service<DQMStore>{};
129  // Fill Global Status
130  if (globalStatusFilling_ > 0) {
131  actionExecutor_.fillStatus(dqm_store, detCabling_, eSetup);
132  }
133  // -- Create summary monitor elements according to the frequency
134  if (summaryFrequency_ != -1 && nLumiSecs_ > 0 && nLumiSecs_ % summaryFrequency_ == 0) {
135  std::cout << " Creating Summary " << std::endl;
136  actionExecutor_.createSummary(dqm_store);
137  }
138  endLumiAnalysisOn_ = false;
139 }

References actionExecutor_, gather_cfg::cout, SiStripActionExecutor::createSummary(), detCabling_, endLumiAnalysisOn_, SiStripActionExecutor::fillDummyStatus(), SiStripActionExecutor::fillStatus(), globalStatusFilling_, edm::LuminosityBlockBase::luminosityBlock(), nLumiSecs_, summaryFrequency_, and trackerFEDsFound_.

◆ endRun()

void SiStripAnalyser::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 141 of file SiStripAnalyser.cc.

141  {
142  edm::LogInfo("SiStripAnalyser") << "SiStripAnalyser:: End of Run";
143 }

Member Data Documentation

◆ actionExecutor_

SiStripActionExecutor SiStripAnalyser::actionExecutor_
private

Definition at line 51 of file SiStripAnalyser.h.

Referenced by analyze(), beginJob(), beginRun(), endJob(), and endLuminosityBlock().

◆ condDataMon_

SiStripClassToMonitorCondData SiStripAnalyser::condDataMon_
private

Definition at line 50 of file SiStripAnalyser.h.

Referenced by beginRun().

◆ detCabling_

edm::ESHandle<SiStripDetCabling> SiStripAnalyser::detCabling_
private

Definition at line 65 of file SiStripAnalyser.h.

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

◆ endLumiAnalysisOn_

bool SiStripAnalyser::endLumiAnalysisOn_ {false}
private

Definition at line 72 of file SiStripAnalyser.h.

Referenced by endLuminosityBlock().

◆ fedCabling_

edm::ESHandle<SiStripFedCabling> SiStripAnalyser::fedCabling_
private

Definition at line 64 of file SiStripAnalyser.h.

Referenced by beginRun().

◆ globalStatusFilling_

int SiStripAnalyser::globalStatusFilling_
private

Definition at line 56 of file SiStripAnalyser.h.

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

◆ m_cacheID_

unsigned long long SiStripAnalyser::m_cacheID_
private

Definition at line 67 of file SiStripAnalyser.h.

Referenced by beginRun().

◆ nEvents_

int SiStripAnalyser::nEvents_ {}
private

Definition at line 69 of file SiStripAnalyser.h.

Referenced by analyze().

◆ nLumiSecs_

int SiStripAnalyser::nLumiSecs_ {}
private

Definition at line 68 of file SiStripAnalyser.h.

Referenced by endLuminosityBlock().

◆ outputFileName_

std::string SiStripAnalyser::outputFileName_
private

Definition at line 62 of file SiStripAnalyser.h.

◆ outputFilePath_

std::string SiStripAnalyser::outputFilePath_
private

Definition at line 61 of file SiStripAnalyser.h.

◆ printFaultyModuleList_

bool SiStripAnalyser::printFaultyModuleList_
private

Definition at line 71 of file SiStripAnalyser.h.

Referenced by endJob().

◆ rawDataToken_

edm::EDGetTokenT<FEDRawDataCollection> SiStripAnalyser::rawDataToken_
private

Definition at line 59 of file SiStripAnalyser.h.

Referenced by checkTrackerFEDs().

◆ shiftReportFrequency_

int SiStripAnalyser::shiftReportFrequency_
private

Definition at line 57 of file SiStripAnalyser.h.

Referenced by analyze().

◆ staticUpdateFrequency_

int SiStripAnalyser::staticUpdateFrequency_
private

Definition at line 55 of file SiStripAnalyser.h.

◆ summaryFrequency_

int SiStripAnalyser::summaryFrequency_ {-1}
private

Definition at line 54 of file SiStripAnalyser.h.

Referenced by endLuminosityBlock().

◆ tkMapPSet_

edm::ParameterSet SiStripAnalyser::tkMapPSet_
private

Definition at line 52 of file SiStripAnalyser.h.

◆ trackerFEDsFound_

bool SiStripAnalyser::trackerFEDsFound_ {false}
private

Definition at line 70 of file SiStripAnalyser.h.

Referenced by analyze(), checkTrackerFEDs(), and endLuminosityBlock().

SiStripClassToMonitorCondData::beginRun
void beginRun(edm::RunNumber_t iRun, edm::EventSetup const &eSetup)
Definition: SiStripClassToMonitorCondData.cc:83
mps_fire.i
i
Definition: mps_fire.py:355
SiStripAnalyser::nLumiSecs_
int nLumiSecs_
Definition: SiStripAnalyser.h:68
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::LogInfo
Definition: MessageLogger.h:254
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
SiStripAnalyser::checkTrackerFEDs
void checkTrackerFEDs(edm::Event const &e)
Definition: SiStripAnalyser.cc:155
SiStripActionExecutor::printFaultyModuleList
void printFaultyModuleList(DQMStore &dqm_store, std::ostringstream &str_val)
Definition: SiStripActionExecutor.cc:241
edm::Handle
Definition: AssociativeIterator.h:50
SiStripActionExecutor::fillStatus
void fillStatus(DQMStore &dqm_store, edm::ESHandle< SiStripDetCabling > const &fedcabling, edm::EventSetup const &eSetup)
Definition: SiStripActionExecutor.cc:116
edm::FileInPath
Definition: FileInPath.h:64
SiStripFedCablingRcd
Definition: SiStripCondDataRecords.h:22
SiStripAnalyser::endLumiAnalysisOn_
bool endLumiAnalysisOn_
Definition: SiStripAnalyser.h:72
groupFilesInBlocks.fin
fin
Definition: groupFilesInBlocks.py:94
SiStripDetCablingRcd
Definition: SiStripDependentRecords.h:19
SiStripActionExecutor::createShiftReport
void createShiftReport(DQMStore &dqm_store)
Definition: SiStripActionExecutor.cc:131
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripAnalyser::condDataMon_
SiStripClassToMonitorCondData condDataMon_
Definition: SiStripAnalyser.h:50
FEDNumbering::MAXSiStripFEDID
Definition: FEDNumbering.h:30
edm::ParameterSet
Definition: ParameterSet.h:36
SiStripActionExecutor::createStatus
void createStatus(DQMStore &dqm_store)
Definition: SiStripActionExecutor.cc:107
beam_dqm_sourceclient-live_cfg.cerr
cerr
Definition: beam_dqm_sourceclient-live_cfg.py:17
recoMuon::in
Definition: RecoMuonEnumerators.h:6
SiStripAnalyser::trackerFEDsFound_
bool trackerFEDsFound_
Definition: SiStripAnalyser.h:70
SiStripAnalyser::staticUpdateFrequency_
int staticUpdateFrequency_
Definition: SiStripAnalyser.h:55
edm::Service
Definition: Service.h:30
SiStripAnalyser::detCabling_
edm::ESHandle< SiStripDetCabling > detCabling_
Definition: SiStripAnalyser.h:65
SiStripActionExecutor::readTkMapConfiguration
bool readTkMapConfiguration(const edm::EventSetup &eSetup)
Definition: SiStripActionExecutor.cc:41
get
#define get
SiStripAnalyser::nEvents_
int nEvents_
Definition: SiStripAnalyser.h:69
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
SiStripActionExecutor::createDummyShiftReport
void createDummyShiftReport()
Definition: SiStripActionExecutor.cc:124
writedatasetfile.run
run
Definition: writedatasetfile.py:27
SiStripAnalyser::printFaultyModuleList_
bool printFaultyModuleList_
Definition: SiStripAnalyser.h:71
SiStripActionExecutor::fillDummyStatus
void fillDummyStatus()
Definition: SiStripActionExecutor.cc:114
SiStripAnalyser::summaryFrequency_
int summaryFrequency_
Definition: SiStripAnalyser.h:54
SiStripAnalyser::globalStatusFilling_
int globalStatusFilling_
Definition: SiStripAnalyser.h:56
SiStripAnalyser::actionExecutor_
SiStripActionExecutor actionExecutor_
Definition: SiStripAnalyser.h:51
SiStripActionExecutor::readConfiguration
bool readConfiguration()
Definition: SiStripActionExecutor.cc:29
SiStripActionExecutor::createSummary
void createSummary(DQMStore &dqm_store)
Definition: SiStripActionExecutor.cc:48
SiStripAnalyser::m_cacheID_
unsigned long long m_cacheID_
Definition: SiStripAnalyser.h:67
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
SiStripAnalyser::tkMapPSet_
edm::ParameterSet tkMapPSet_
Definition: SiStripAnalyser.h:52
edm::InputTag
Definition: InputTag.h:15
SiStripAnalyser::rawDataToken_
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
Definition: SiStripAnalyser.h:59
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163
SiStripAnalyser::shiftReportFrequency_
int shiftReportFrequency_
Definition: SiStripAnalyser.h:57
SiStripAnalyser::fedCabling_
edm::ESHandle< SiStripFedCabling > fedCabling_
Definition: SiStripAnalyser.h:64
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
FEDNumbering::MINSiStripFEDID
Definition: FEDNumbering.h:29