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
TrackingAnalyser Class Reference

#include <TrackingAnalyzer.h>

Inheritance diagram for TrackingAnalyser:
DQMEDHarvester edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 TrackingAnalyser (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~TrackingAnalyser ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
 DQMEDHarvester (void)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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 beginJob ()
 BeginJob. More...
 
void beginRun (edm::Run const &run, edm::EventSetup const &eSetup)
 BeginRun. More...
 
void checkTrackerFEDsInLS (DQMStore::IGetter &igetter, double iLS)
 
void checkTrackerFEDsWdataInLS (DQMStore::IGetter &igetter, double iLS)
 
void dqmBeginLuminosityBlock (DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_, edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup)
 Begin Luminosity Block. More...
 
void dqmEndJob (DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_)
 Endjob. More...
 
void dqmEndLuminosityBlock (DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_, edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup)
 End Luminosity Block. More...
 

Private Attributes

TrackingActionExecutoractionExecutor_
 
edm::ESHandle< SiStripDetCablingdetCabling_
 
edm::ESHandle< SiStripFedCablingfedCabling_
 
int fileSaveFrequency_
 
int globalStatusFilling_
 
std::ostringstream html_out_
 
unsigned long long m_cacheID_
 
std::string nFEDinfoDir_
 
std::string nFEDinVsLSname_
 
std::string nFEDinWdataVsLSname_
 
int nLumiSecs_
 
std::string outputFileName_
 
std::string outputFilePath_
 
edm::EDGetTokenT
< FEDRawDataCollection
rawDataToken_
 
int shiftReportFrequency_
 
int staticUpdateFrequency_
 
edm::ParameterSet tkMapPSet_
 
bool trackerFEDsFound_
 
bool trackerFEDsWdataFound_
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

Definition at line 25 of file TrackingAnalyzer.h.

Constructor & Destructor Documentation

TrackingAnalyser::TrackingAnalyser ( const edm::ParameterSet ps)

Constructor.

Definition at line 45 of file TrackingAnalyzer.cc.

References actionExecutor_, BUF_SIZE, ecal_dqm_sourceclient-live_cfg::cerr, gather_cfg::cout, groupFilesInBlocks::fin, contentValuesFiles::fullPath, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), globalStatusFilling_, html_out_, recoMuon::in, nFEDinfoDir_, nFEDinVsLSname_, nFEDinWdataVsLSname_, rawDataToken_, shiftReportFrequency_, staticUpdateFrequency_, AlCaHLTBitMon_QueryRunRegistry::string, trackerFEDsFound_, trackerFEDsWdataFound_, and verbose_.

45  :
46  verbose_(ps.getUntrackedParameter<bool>("verbose",false))
47 {
48  if (verbose_) std::cout << "[TrackingAnalyser::TrackingAnalyser]" << std::endl;
49  // Get TkMap ParameterSet
50  // tkMapPSet_ = ps.getParameter<edm::ParameterSet>("TkmapParameters");
51 
52  std::string localPath = std::string("DQM/TrackingMonitorClient/test/loader.html");
53  std::ifstream fin(edm::FileInPath(localPath).fullPath().c_str(), std::ios::in);
54  char buf[BUF_SIZE];
55 
56  if (!fin) {
57  std::cerr << "Input File: loader.html"<< " could not be opened!" << std::endl;
58  return;
59  }
60 
61  while (fin.getline(buf, BUF_SIZE, '\n')) { // pops off the newline character
62  html_out_ << buf ;
63  }
64  fin.close();
65 
66 
67 
68  edm::LogInfo("TrackingAnalyser") << " TrackingAnalyser::Creating TrackingAnalyser ";
69  staticUpdateFrequency_ = ps.getUntrackedParameter<int>("StaticUpdateFrequency",1);
70  globalStatusFilling_ = ps.getUntrackedParameter<int>("GlobalStatusFilling", 1);
71  shiftReportFrequency_ = ps.getUntrackedParameter<int>("ShiftReportFrequency", 1);
72 
73  edm::InputTag rawDataTag = ps.getUntrackedParameter<edm::InputTag>("RawDataTag");
74  rawDataToken_ = consumes<FEDRawDataCollection>(rawDataTag);
75 
76  // instantiate web interface
78  trackerFEDsFound_ = false;
79  trackerFEDsWdataFound_ = false;
80 
81  nFEDinfoDir_ = ps.getParameter<std::string>("nFEDinfoDir");
82  nFEDinVsLSname_ = ps.getParameter<std::string>("nFEDinVsLSname");
83  nFEDinWdataVsLSname_ = ps.getParameter<std::string>("nFEDinWdataVsLSname");
84 }
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string nFEDinfoDir_
std::string nFEDinWdataVsLSname_
std::string nFEDinVsLSname_
std::ostringstream html_out_
tuple cout
Definition: gather_cfg.py:121
TrackingActionExecutor * actionExecutor_
#define BUF_SIZE
TrackingAnalyser::~TrackingAnalyser ( )
virtual

Destructor.

Definition at line 88 of file TrackingAnalyzer.cc.

88  {
89 
90  edm::LogInfo("TrackingAnalyser") << "TrackingAnalyser::Deleting TrackingAnalyser ";
91 
92 }

Member Function Documentation

void TrackingAnalyser::beginJob ( void  )
privatevirtual

BeginJob.

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 96 of file TrackingAnalyzer.cc.

References nLumiSecs_.

96  {
97 
98  nLumiSecs_ = 0;
99 }
void TrackingAnalyser::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
privatevirtual

BeginRun.

Reimplemented from DQMEDHarvester.

Definition at line 103 of file TrackingAnalyzer.cc.

References gather_cfg::cout, detCabling_, fedCabling_, edm::EventSetup::get(), m_cacheID_, and verbose_.

103  {
104  edm::LogInfo ("TrackingAnalyser") <<"TrackingAnalyser:: Begining of Run";
105 
106  if (verbose_) std::cout << "[TrackingAnalyser::beginRun]" << std::endl;
107  // Check latest Fed cabling and create TrackerMapCreator
108  unsigned long long cacheID = eSetup.get<SiStripFedCablingRcd>().cacheIdentifier();
109  if (m_cacheID_ != cacheID) {
110  m_cacheID_ = cacheID;
111  edm::LogInfo("TrackingAnalyser") <<"TrackingAnalyser::beginRun: "
112  << " Change in Cabling, recrated TrackerMap";
113  eSetup.get<SiStripFedCablingRcd>().get(fedCabling_);
114  eSetup.get<SiStripDetCablingRcd>().get(detCabling_);
115  }
116 }
edm::ESHandle< SiStripDetCabling > detCabling_
unsigned long long m_cacheID_
edm::ESHandle< SiStripFedCabling > fedCabling_
tuple cout
Definition: gather_cfg.py:121
void TrackingAnalyser::checkTrackerFEDsInLS ( DQMStore::IGetter igetter,
double  iLS 
)
private

Definition at line 181 of file TrackingAnalyzer.cc.

References gather_cfg::cout, DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getTProfile(), nFEDinfoDir_, nFEDinVsLSname_, trackerFEDsFound_, and verbose_.

Referenced by dqmEndLuminosityBlock().

182 {
183 
184  double nFEDinLS = 0.;
185  MonitorElement* tmpME = igetter.get(nFEDinfoDir_+"/"+nFEDinVsLSname_);
186  if (tmpME) {
187  TProfile* tmpP = tmpME->getTProfile();
188  size_t ibin = tmpP->GetXaxis()->FindBin(iLS);
189  if (verbose_) std::cout << "iLS: " << iLS << " ibin: " << ibin;
190  nFEDinLS = tmpME->getBinContent(ibin);
191  if (verbose_) std::cout << " ---> nFEDinLS: " << nFEDinLS;
192  }
193 
194  trackerFEDsFound_ = (nFEDinLS>0);
195  if (verbose_) std::cout << " ---> trackerFEDsFound_: " << trackerFEDsFound_ << std::endl;
196 }
std::string nFEDinfoDir_
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
std::string nFEDinVsLSname_
double getBinContent(int binx) const
get content of bin (1-D)
TProfile * getTProfile(void) const
tuple cout
Definition: gather_cfg.py:121
void TrackingAnalyser::checkTrackerFEDsWdataInLS ( DQMStore::IGetter igetter,
double  iLS 
)
private

Definition at line 198 of file TrackingAnalyzer.cc.

References gather_cfg::cout, DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getTProfile(), nFEDinfoDir_, nFEDinWdataVsLSname_, trackerFEDsWdataFound_, and verbose_.

Referenced by dqmEndLuminosityBlock().

199 {
200 
201  double nFEDinLS = 0.;
202  MonitorElement* tmpME = igetter.get(nFEDinfoDir_+"/"+nFEDinWdataVsLSname_);
203  if (verbose_) std::cout << "found " << nFEDinfoDir_ << "/" << nFEDinWdataVsLSname_ << " ? " << (tmpME ? "YES" : "NOPE") << std::endl;
204  if (tmpME) {
205  TProfile* tmpP = tmpME->getTProfile();
206  size_t ibin = tmpP->GetXaxis()->FindBin(iLS);
207  if (verbose_) std::cout << "iLS: " << iLS << " ibin: " << ibin;
208  nFEDinLS = tmpME->getBinContent(ibin);
209  if (verbose_) std::cout << " ---> nFEDinLS: " << nFEDinLS;
210  }
211 
212  trackerFEDsWdataFound_ = (nFEDinLS>0);
213  if (verbose_) std::cout << " ---> trackerFEDsWdataFound_: " << trackerFEDsWdataFound_ << std::endl;
214 }
std::string nFEDinfoDir_
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
std::string nFEDinWdataVsLSname_
double getBinContent(int binx) const
get content of bin (1-D)
TProfile * getTProfile(void) const
tuple cout
Definition: gather_cfg.py:121
void TrackingAnalyser::dqmBeginLuminosityBlock ( DQMStore::IBooker ibooker_,
DQMStore::IGetter igetter_,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
private

Begin Luminosity Block.

Definition at line 120 of file TrackingAnalyzer.cc.

References gather_cfg::cout, and verbose_.

120  {
121  edm::LogInfo("TrackingAnalyser") <<"TrackingAnalyser:: Begin of LS transition";
122  if (verbose_) std::cout << "[TrackingAnalyser::dqmBeginLuminosityBlock]" << std::endl;
123 }
tuple cout
Definition: gather_cfg.py:121
void TrackingAnalyser::dqmEndJob ( DQMStore::IBooker ibooker_,
DQMStore::IGetter igetter_ 
)
privatevirtual

Endjob.

Implements DQMEDHarvester.

Definition at line 166 of file TrackingAnalyzer.cc.

References actionExecutor_, gather_cfg::cout, TrackingActionExecutor::createGlobalStatus(), TrackingActionExecutor::fillGlobalStatus(), globalStatusFilling_, and verbose_.

166  {
167  edm::LogInfo("TrackingAnalyser") <<"TrackingAnalyser:: endjob called!";
168  if (verbose_) std::cout << "[TrackingAnalyser::dqmEndJob]" << std::endl;
169 
171  // Fill Global Status
172  if (globalStatusFilling_ > 0) {
173  actionExecutor_->fillGlobalStatus(ibooker_,igetter_);
174  }
175 
176 
177 }
void fillGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void createGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
tuple cout
Definition: gather_cfg.py:121
TrackingActionExecutor * actionExecutor_
void TrackingAnalyser::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker_,
DQMStore::IGetter igetter_,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
privatevirtual

End Luminosity Block.

Reimplemented from DQMEDHarvester.

Definition at line 128 of file TrackingAnalyzer.cc.

References actionExecutor_, checkTrackerFEDsInLS(), checkTrackerFEDsWdataInLS(), gather_cfg::cout, TrackingActionExecutor::createDummyShiftReport(), TrackingActionExecutor::createGlobalStatus(), TrackingActionExecutor::createShiftReport(), TrackingActionExecutor::fillDummyGlobalStatus(), TrackingActionExecutor::fillDummyLSStatus(), TrackingActionExecutor::fillGlobalStatus(), globalStatusFilling_, edm::LuminosityBlockBase::id(), edm::LuminosityBlockID::luminosityBlock(), edm::LuminosityBlockBase::luminosityBlock(), nLumiSecs_, shiftReportFrequency_, trackerFEDsFound_, trackerFEDsWdataFound_, and verbose_.

128  {
129  edm::LogInfo ("TrackingAnalyser") <<"TrackingAnalyser:: End of LS transition, performing the DQM client operation";
130  if (verbose_) std::cout << "[TrackingAnalyser::endLuminosityBlock]" << std::endl;
131  nLumiSecs_++;
132 
133  if (verbose_) std::cout << "[TrackingAnalyser::endLuminosityBlock] globalStatusFilling_ " << (globalStatusFilling_ ? "YES" : "NOPE") << std::endl;
135 
136  double iLS = lumiSeg.id().luminosityBlock();
137  checkTrackerFEDsInLS(igetter_,iLS);
138  checkTrackerFEDsWdataInLS(igetter_,iLS);
139  if (verbose_) std::cout << "[TrackingAnalyser::endLuminosityBlock] trackerFEDsFound_ " << (trackerFEDsFound_ ? "YES" : "NOPE") << std::endl;
140  if (verbose_) std::cout << "[TrackingAnalyser::endLuminosityBlock] trackerFEDsWdataFound_ " << (trackerFEDsWdataFound_ ? "YES" : "NOPE") << std::endl;
141 
142  if (!trackerFEDsFound_) {
145  } else {
147  actionExecutor_->fillGlobalStatus(ibooker_,igetter_);
148  if (shiftReportFrequency_ != -1) actionExecutor_->createShiftReport(ibooker_,igetter_);
149  }
150  }
151 
152  if (!trackerFEDsFound_) {
154  return;
155  }
156 
157  if (verbose_) std::cout << "====================================================== " << std::endl;
158  if (verbose_) std::cout << " ===> Iteration # " << nLumiSecs_ << " " << lumiSeg.luminosityBlock() << std::endl;
159  if (verbose_) std::cout << "====================================================== " << std::endl;
160 
161 }
void fillGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void createShiftReport(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void createGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void checkTrackerFEDsWdataInLS(DQMStore::IGetter &igetter, double iLS)
tuple cout
Definition: gather_cfg.py:121
TrackingActionExecutor * actionExecutor_
void checkTrackerFEDsInLS(DQMStore::IGetter &igetter, double iLS)

Member Data Documentation

TrackingActionExecutor* TrackingAnalyser::actionExecutor_
private

Definition at line 75 of file TrackingAnalyzer.h.

Referenced by dqmEndJob(), dqmEndLuminosityBlock(), and TrackingAnalyser().

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

Definition at line 74 of file TrackingAnalyzer.h.

Referenced by beginRun().

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

Definition at line 73 of file TrackingAnalyzer.h.

Referenced by beginRun().

int TrackingAnalyser::fileSaveFrequency_
private

Definition at line 62 of file TrackingAnalyzer.h.

int TrackingAnalyser::globalStatusFilling_
private

Definition at line 64 of file TrackingAnalyzer.h.

Referenced by dqmEndJob(), dqmEndLuminosityBlock(), and TrackingAnalyser().

std::ostringstream TrackingAnalyser::html_out_
private

Definition at line 81 of file TrackingAnalyzer.h.

Referenced by TrackingAnalyser().

unsigned long long TrackingAnalyser::m_cacheID_
private

Definition at line 77 of file TrackingAnalyzer.h.

Referenced by beginRun().

std::string TrackingAnalyser::nFEDinfoDir_
private
std::string TrackingAnalyser::nFEDinVsLSname_
private

Definition at line 84 of file TrackingAnalyzer.h.

Referenced by checkTrackerFEDsInLS(), and TrackingAnalyser().

std::string TrackingAnalyser::nFEDinWdataVsLSname_
private

Definition at line 85 of file TrackingAnalyzer.h.

Referenced by checkTrackerFEDsWdataInLS(), and TrackingAnalyser().

int TrackingAnalyser::nLumiSecs_
private

Definition at line 78 of file TrackingAnalyzer.h.

Referenced by beginJob(), and dqmEndLuminosityBlock().

std::string TrackingAnalyser::outputFileName_
private

Definition at line 70 of file TrackingAnalyzer.h.

std::string TrackingAnalyser::outputFilePath_
private

Definition at line 69 of file TrackingAnalyzer.h.

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

Definition at line 67 of file TrackingAnalyzer.h.

Referenced by TrackingAnalyser().

int TrackingAnalyser::shiftReportFrequency_
private

Definition at line 65 of file TrackingAnalyzer.h.

Referenced by dqmEndLuminosityBlock(), and TrackingAnalyser().

int TrackingAnalyser::staticUpdateFrequency_
private

Definition at line 63 of file TrackingAnalyzer.h.

Referenced by TrackingAnalyser().

edm::ParameterSet TrackingAnalyser::tkMapPSet_
private

Definition at line 72 of file TrackingAnalyzer.h.

bool TrackingAnalyser::trackerFEDsFound_
private
bool TrackingAnalyser::trackerFEDsWdataFound_
private
bool TrackingAnalyser::verbose_
private