CMS 3D CMS Logo

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

#include <SiStripAnalyser.h>

Inheritance diagram for SiStripAnalyser:
edm::EDAnalyzer edm::EDConsumerBase

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 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 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

- 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

Definition at line 31 of file SiStripAnalyser.h.

Constructor & Destructor Documentation

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

Definition at line 40 of file SiStripAnalyser.cc.

References actionExecutor_, MessageLogger_cfi::cerr, groupFilesInBlocks::fin, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), globalStatusFilling_, recoMuon::in, printFaultyModuleList_, rawDataToken_, shiftReportFrequency_, staticUpdateFrequency_, AlCaHLTBitMon_QueryRunRegistry::string, summaryFrequency_, and tkMapPSet_.

41  : condDataMon_{ps},
42  actionExecutor_{ps},
43  tkMapPSet_{ps.getParameter<edm::ParameterSet>("TkmapParameters")},
45  ps.getUntrackedParameter<int>("SummaryCreationFrequency", 1)},
47  ps.getUntrackedParameter<int>("StaticUpdateFrequency", 1)},
49  ps.getUntrackedParameter<int>("GlobalStatusFilling", 1)},
51  ps.getUntrackedParameter<int>("ShiftReportFrequency", 1)},
52  rawDataToken_{consumes<FEDRawDataCollection>(
53  ps.getUntrackedParameter<edm::InputTag>("RawDataTag"))},
55  ps.getUntrackedParameter<bool>("PrintFaultyModuleList", true)}
56 {
57  std::string const localPath{"DQM/SiStripMonitorClient/test/loader.html"};
58  std::ifstream fin{edm::FileInPath(localPath).fullPath(), std::ios::in};
59  if (!fin) {
60  std::cerr << "Input File: loader.html"
61  << " could not be opened!" << std::endl;
62  return;
63  }
64  edm::LogInfo("SiStripAnalyser")
65  << " SiStripAnalyser::Creating SiStripAnalyser ";
66 }
SiStripClassToMonitorCondData condDataMon_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
SiStripActionExecutor actionExecutor_
edm::ParameterSet tkMapPSet_
std::string fullPath() const
Definition: FileInPath.cc:163
SiStripAnalyser::~SiStripAnalyser ( )
override

Definition at line 68 of file SiStripAnalyser.cc.

69 {
70  edm::LogInfo("SiStripAnalyser")
71  << "SiStripAnalyser::Deleting SiStripAnalyser ";
72 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 121 of file SiStripAnalyser.cc.

References actionExecutor_, checkTrackerFEDs(), SiStripActionExecutor::createDummyShiftReport(), SiStripActionExecutor::createShiftReport(), detCabling_, SiStripActionExecutor::fillDummyStatus(), SiStripActionExecutor::fillStatus(), globalStatusFilling_, nEvents_, shiftReportFrequency_, and trackerFEDsFound_.

122 {
123  ++nEvents_;
124  if (nEvents_ == 1 && globalStatusFilling_ > 0) {
126  if (!trackerFEDsFound_) {
129  } else {
130  auto& dqm_store = *edm::Service<DQMStore>{};
131  actionExecutor_.fillStatus(dqm_store, detCabling_, eSetup);
132  if (shiftReportFrequency_ != -1)
134  }
135  }
136 }
void fillStatus(DQMStore &dqm_store, edm::ESHandle< SiStripDetCabling > const &fedcabling, edm::EventSetup const &eSetup)
SiStripActionExecutor actionExecutor_
edm::ESHandle< SiStripDetCabling > detCabling_
void createShiftReport(DQMStore &dqm_store)
void checkTrackerFEDs(edm::Event const &e)
void SiStripAnalyser::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 75 of file SiStripAnalyser.cc.

References actionExecutor_, and SiStripActionExecutor::readConfiguration().

76 {
77  // Read the summary configuration file
79  edm::LogInfo("SiStripAnalyser")
80  << "SiStripAnalyser:: Error to read configuration file!! Summary will "
81  "not be produced!!!";
82  }
83 }
SiStripActionExecutor actionExecutor_
void SiStripAnalyser::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 114 of file SiStripAnalyser.cc.

116 {
117  edm::LogInfo("SiStripAnalyser") << "SiStripAnalyser:: Begin of LS transition";
118 }
void SiStripAnalyser::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 86 of file SiStripAnalyser.cc.

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

87 {
88  edm::LogInfo("SiStripAnalyser") << "SiStripAnalyser:: Begining of Run";
89 
90  // Check latest Fed cabling and create TrackerMapCreator
91  unsigned long long const cacheID =
92  eSetup.get<SiStripFedCablingRcd>().cacheIdentifier();
93  if (m_cacheID_ != cacheID) {
94  m_cacheID_ = cacheID;
95  edm::LogInfo("SiStripAnalyser")
96  << "SiStripAnalyser::beginRun: "
97  << " Change in Cabling, recrated TrackerMap";
99  edm::LogInfo("SiStripAnalyser")
100  << "SiStripAnalyser:: Error to read configuration file!! TrackerMap "
101  "will not be produced!!!";
102  }
103  eSetup.get<SiStripFedCablingRcd>().get(fedCabling_);
104  eSetup.get<SiStripDetCablingRcd>().get(detCabling_);
105  }
106  condDataMon_.beginRun(run.run(), eSetup);
107  if (globalStatusFilling_) {
108  auto& dqm_store = *edm::Service<DQMStore>{};
109  actionExecutor_.createStatus(dqm_store);
110  }
111 }
SiStripClassToMonitorCondData condDataMon_
void beginRun(edm::RunNumber_t iRun, edm::EventSetup const &eSetup)
bool readTkMapConfiguration(const edm::EventSetup &eSetup)
SiStripActionExecutor actionExecutor_
edm::ESHandle< SiStripDetCabling > detCabling_
edm::ESHandle< SiStripFedCabling > fedCabling_
void createStatus(DQMStore &dqm_store)
unsigned long long m_cacheID_
void SiStripAnalyser::checkTrackerFEDs ( edm::Event const &  e)
private

Definition at line 192 of file SiStripAnalyser.cc.

References constexpr, DEFINE_FWK_MODULE, edm::Event::getByToken(), mps_fire::i, edm::HandleBase::isValid(), FEDNumbering::MAXSiStripFEDID, FEDNumbering::MINSiStripFEDID, rawDataToken_, and trackerFEDsFound_.

Referenced by analyze().

193 {
194  edm::Handle<FEDRawDataCollection> rawDataHandle;
195  e.getByToken(rawDataToken_, rawDataHandle);
196  if (!rawDataHandle.isValid()) return;
197 
198  auto const& rawDataCollection = *rawDataHandle;
199  constexpr int siStripFedIdMin{FEDNumbering::MINSiStripFEDID};
200  constexpr int siStripFedIdMax{FEDNumbering::MAXSiStripFEDID};
201 
202  for (int i = siStripFedIdMin; i <= siStripFedIdMax; ++i) {
203  auto const& fedData = rawDataCollection.FEDData(i);
204  if (fedData.size() && fedData.data()) {
205  trackerFEDsFound_ = true;
206  return;
207  }
208  }
209 }
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
bool isValid() const
Definition: HandleBase.h:74
#define constexpr
void SiStripAnalyser::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 180 of file SiStripAnalyser.cc.

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

181 {
182  edm::LogInfo("SiStripAnalyser") << "SiStripAnalyser:: endjob called!";
184  std::ostringstream str_val;
185  auto& dqm_store = *edm::Service<DQMStore>{};
186  actionExecutor_.printFaultyModuleList(dqm_store, str_val);
187  std::cout << str_val.str() << std::endl;
188  }
189 }
SiStripActionExecutor actionExecutor_
void printFaultyModuleList(DQMStore &dqm_store, std::ostringstream &str_val)
void SiStripAnalyser::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 139 of file SiStripAnalyser.cc.

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

141 {
142  edm::LogInfo("SiStripAnalyser") << "SiStripAnalyser:: End of LS transition, "
143  "performing the DQM client operation";
144  ++nLumiSecs_;
145 
146  if (!trackerFEDsFound_) {
148  return;
149  }
150  endLumiAnalysisOn_ = true;
151 
152  std::cout << "====================================================== "
153  << std::endl;
154  std::cout << " ===> Iteration # " << nLumiSecs_ << " "
155  << lumiSeg.luminosityBlock() << std::endl;
156  std::cout << "====================================================== "
157  << std::endl;
158 
159  auto& dqm_store = *edm::Service<DQMStore>{};
160  // Fill Global Status
161  if (globalStatusFilling_ > 0) {
162  actionExecutor_.fillStatus(dqm_store, detCabling_, eSetup);
163  }
164  // -- Create summary monitor elements according to the frequency
165  if (summaryFrequency_ != -1 && nLumiSecs_ > 0 &&
166  nLumiSecs_ % summaryFrequency_ == 0) {
167  std::cout << " Creating Summary " << std::endl;
168  actionExecutor_.createSummary(dqm_store);
169  }
170  endLumiAnalysisOn_ = false;
171 }
void createSummary(DQMStore &dqm_store)
void fillStatus(DQMStore &dqm_store, edm::ESHandle< SiStripDetCabling > const &fedcabling, edm::EventSetup const &eSetup)
SiStripActionExecutor actionExecutor_
edm::ESHandle< SiStripDetCabling > detCabling_
void SiStripAnalyser::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 174 of file SiStripAnalyser.cc.

175 {
176  edm::LogInfo("SiStripAnalyser") << "SiStripAnalyser:: End of Run";
177 }

Member Data Documentation

SiStripActionExecutor SiStripAnalyser::actionExecutor_
private
SiStripClassToMonitorCondData SiStripAnalyser::condDataMon_
private

Definition at line 49 of file SiStripAnalyser.h.

Referenced by beginRun().

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

Definition at line 64 of file SiStripAnalyser.h.

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

bool SiStripAnalyser::endLumiAnalysisOn_ {false}
private

Definition at line 71 of file SiStripAnalyser.h.

Referenced by endLuminosityBlock().

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

Definition at line 63 of file SiStripAnalyser.h.

Referenced by beginRun().

int SiStripAnalyser::globalStatusFilling_
private

Definition at line 55 of file SiStripAnalyser.h.

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

unsigned long long SiStripAnalyser::m_cacheID_
private

Definition at line 66 of file SiStripAnalyser.h.

Referenced by beginRun().

int SiStripAnalyser::nEvents_ {}
private

Definition at line 68 of file SiStripAnalyser.h.

Referenced by analyze().

int SiStripAnalyser::nLumiSecs_ {}
private

Definition at line 67 of file SiStripAnalyser.h.

Referenced by endLuminosityBlock().

std::string SiStripAnalyser::outputFileName_
private

Definition at line 61 of file SiStripAnalyser.h.

std::string SiStripAnalyser::outputFilePath_
private

Definition at line 60 of file SiStripAnalyser.h.

bool SiStripAnalyser::printFaultyModuleList_
private

Definition at line 70 of file SiStripAnalyser.h.

Referenced by endJob(), and SiStripAnalyser().

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

Definition at line 58 of file SiStripAnalyser.h.

Referenced by checkTrackerFEDs(), and SiStripAnalyser().

int SiStripAnalyser::shiftReportFrequency_
private

Definition at line 56 of file SiStripAnalyser.h.

Referenced by analyze(), and SiStripAnalyser().

int SiStripAnalyser::staticUpdateFrequency_
private

Definition at line 54 of file SiStripAnalyser.h.

Referenced by SiStripAnalyser().

int SiStripAnalyser::summaryFrequency_ {-1}
private

Definition at line 53 of file SiStripAnalyser.h.

Referenced by endLuminosityBlock(), and SiStripAnalyser().

edm::ParameterSet SiStripAnalyser::tkMapPSet_
private

Definition at line 51 of file SiStripAnalyser.h.

Referenced by SiStripAnalyser().

bool SiStripAnalyser::trackerFEDsFound_ {false}
private

Definition at line 69 of file SiStripAnalyser.h.

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