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:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 TrackingAnalyser (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~TrackingAnalyser ()
 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 beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup)
 Begin Luminosity Block. 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 &eSetup)
 End Luminosity Block. More...
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup)
 EndRun. More...
 

Private Attributes

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

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

Definition at line 24 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, dtNoiseDBValidation_cfg::cerr, dqmStore_, endLumiAnalysisOn_, groupFilesInBlocks::fin, contentValuesFiles::fullPath, edm::ParameterSet::getUntrackedParameter(), globalStatusFilling_, html_out_, recoMuon::in, cppFunctionSkipper::operator, rawDataToken_, shiftReportFrequency_, staticUpdateFrequency_, AlCaHLTBitMon_QueryRunRegistry::string, and trackerFEDsFound_.

45  :
46  verbose_(ps.getUntrackedParameter<bool>("verbose",false))
47 {
48 
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  // get back-end interface
78 
79 
80  // instantiate web interface
82  trackerFEDsFound_ = false;
83  endLumiAnalysisOn_ = false;
84 }
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
T getUntrackedParameter(std::string const &, T const &) const
DQMStore * dqmStore_
std::ostringstream html_out_
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::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
privatevirtual

Analyze.

Implements edm::EDAnalyzer.

Definition at line 127 of file TrackingAnalyzer.cc.

References actionExecutor_, checkTrackerFEDs(), TrackingActionExecutor::createDummyShiftReport(), TrackingActionExecutor::createShiftReport(), dqmStore_, TrackingActionExecutor::fillDummyGlobalStatus(), TrackingActionExecutor::fillGlobalStatus(), globalStatusFilling_, nEvents_, shiftReportFrequency_, and trackerFEDsFound_.

127  {
128  nEvents_++;
129  if (nEvents_ == 1 && globalStatusFilling_ > 0) {
131  if (!trackerFEDsFound_) {
134  } else {
137  }
138  }
139 }
void checkTrackerFEDs(edm::Event const &e)
void createShiftReport(DQMStore *dqm_store)
DQMStore * dqmStore_
void fillGlobalStatus(DQMStore *dqm_store)
TrackingActionExecutor * actionExecutor_
void TrackingAnalyser::beginJob ( void  )
privatevirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 96 of file TrackingAnalyzer.cc.

References nEvents_, and nLumiSecs_.

96  {
97 
98  nLumiSecs_ = 0;
99  nEvents_ = 0;
100 }
void TrackingAnalyser::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
privatevirtual

Begin Luminosity Block.

Reimplemented from edm::EDAnalyzer.

Definition at line 121 of file TrackingAnalyzer.cc.

121  {
122  edm::LogInfo("TrackingAnalyser") <<"TrackingAnalyser:: Begin of LS transition";
123 }
void TrackingAnalyser::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
privatevirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 104 of file TrackingAnalyzer.cc.

References actionExecutor_, TrackingActionExecutor::createGlobalStatus(), detCabling_, dqmStore_, fedCabling_, edm::EventSetup::get(), globalStatusFilling_, and m_cacheID_.

104  {
105  edm::LogInfo ("TrackingAnalyser") <<"TrackingAnalyser:: Begining of Run";
106 
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  }
117 }
edm::ESHandle< SiStripDetCabling > detCabling_
unsigned long long m_cacheID_
DQMStore * dqmStore_
void createGlobalStatus(DQMStore *dqm_store)
edm::ESHandle< SiStripFedCabling > fedCabling_
TrackingActionExecutor * actionExecutor_
void TrackingAnalyser::checkTrackerFEDs ( edm::Event const &  e)
private

Definition at line 179 of file TrackingAnalyzer.cc.

References FEDRawData::data(), FEDRawDataCollection::FEDData(), edm::Event::getByToken(), i, edm::HandleBase::isValid(), FEDNumbering::MAXSiPixelFEDID, FEDNumbering::MAXSiStripFEDID, FEDNumbering::MINSiPixelFEDID, FEDNumbering::MINSiStripFEDID, rawDataToken_, FEDRawData::size(), and trackerFEDsFound_.

Referenced by analyze().

179  {
180  edm::Handle<FEDRawDataCollection> rawDataHandle;
181  e.getByToken( rawDataToken_, rawDataHandle );
182  if ( !rawDataHandle.isValid() ) return;
183 
184  const FEDRawDataCollection& rawDataCollection = *rawDataHandle;
185  const int siStripFedIdMin = FEDNumbering::MINSiStripFEDID;
186  const int siStripFedIdMax = FEDNumbering::MAXSiStripFEDID;
187  const int siPixelFedIdMin = FEDNumbering::MINSiPixelFEDID;
188  const int siPixelFedIdMax = FEDNumbering::MAXSiPixelFEDID;
189 
190  unsigned int nFed = 0;
191  for (int i=siStripFedIdMin; i <= siStripFedIdMax; i++) {
192  if (rawDataCollection.FEDData(i).size() &&
193  rawDataCollection.FEDData(i).data() )
194  nFed++;
195  }
196  for (int i=siPixelFedIdMin; i <= siPixelFedIdMax; i++) {
197  if (rawDataCollection.FEDData(i).size() &&
198  rawDataCollection.FEDData(i).data() )
199  nFed++;
200  }
201 
202  trackerFEDsFound_ = (nFed > 0);
203 
204 }
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
int i
Definition: DBlmapReader.cc:9
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
bool isValid() const
Definition: HandleBase.h:76
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
void TrackingAnalyser::endJob ( void  )
privatevirtual

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 173 of file TrackingAnalyzer.cc.

173  {
174  edm::LogInfo("TrackingAnalyser") <<"TrackingAnalyser:: endjob called!";
175 }
void TrackingAnalyser::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
privatevirtual

End Luminosity Block.

Reimplemented from edm::EDAnalyzer.

Definition at line 143 of file TrackingAnalyzer.cc.

References actionExecutor_, gather_cfg::cout, dqmStore_, endLumiAnalysisOn_, TrackingActionExecutor::fillDummyLSStatus(), TrackingActionExecutor::fillGlobalStatus(), globalStatusFilling_, edm::LuminosityBlockBase::luminosityBlock(), nLumiSecs_, trackerFEDsFound_, and verbose_.

143  {
144  edm::LogInfo ("TrackingAnalyser") <<"TrackingAnalyser:: End of LS transition, performing the DQM client operation";
145  if (verbose_) std::cout << "[TrackingAnalyser::endLuminosityBlock]" << std::endl;
146  nLumiSecs_++;
147 
148  if (!trackerFEDsFound_) {
150  return;
151  }
152  endLumiAnalysisOn_ = true;
153 
154  if (verbose_) std::cout << "====================================================== " << std::endl;
155  if (verbose_) std::cout << " ===> Iteration # " << nLumiSecs_ << " " << lumiSeg.luminosityBlock() << std::endl;
156  if (verbose_) std::cout << "====================================================== " << std::endl;
157  // Fill Global Status
158  if (globalStatusFilling_ > 0) {
160  }
161  endLumiAnalysisOn_ = false;
162 }
DQMStore * dqmStore_
void fillGlobalStatus(DQMStore *dqm_store)
tuple cout
Definition: gather_cfg.py:121
TrackingActionExecutor * actionExecutor_
void TrackingAnalyser::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
privatevirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 167 of file TrackingAnalyzer.cc.

167  {
168  edm::LogInfo ("TrackingAnalyser") <<"TrackingAnalyser:: End of Run";
169 }

Member Data Documentation

TrackingActionExecutor* TrackingAnalyser::actionExecutor_
private

Definition at line 81 of file TrackingAnalyzer.h.

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

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

Definition at line 80 of file TrackingAnalyzer.h.

Referenced by beginRun().

DQMStore* TrackingAnalyser::dqmStore_
private

Definition at line 66 of file TrackingAnalyzer.h.

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

bool TrackingAnalyser::endLumiAnalysisOn_
private

Definition at line 87 of file TrackingAnalyzer.h.

Referenced by endLuminosityBlock(), and TrackingAnalyser().

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

Definition at line 79 of file TrackingAnalyzer.h.

Referenced by beginRun().

int TrackingAnalyser::fileSaveFrequency_
private

Definition at line 68 of file TrackingAnalyzer.h.

int TrackingAnalyser::globalStatusFilling_
private

Definition at line 70 of file TrackingAnalyzer.h.

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

std::ostringstream TrackingAnalyser::html_out_
private

Definition at line 88 of file TrackingAnalyzer.h.

Referenced by TrackingAnalyser().

unsigned long long TrackingAnalyser::m_cacheID_
private

Definition at line 83 of file TrackingAnalyzer.h.

Referenced by beginRun().

int TrackingAnalyser::nEvents_
private

Definition at line 85 of file TrackingAnalyzer.h.

Referenced by analyze(), and beginJob().

int TrackingAnalyser::nLumiSecs_
private

Definition at line 84 of file TrackingAnalyzer.h.

Referenced by beginJob(), and endLuminosityBlock().

std::string TrackingAnalyser::outputFileName_
private

Definition at line 76 of file TrackingAnalyzer.h.

std::string TrackingAnalyser::outputFilePath_
private

Definition at line 75 of file TrackingAnalyzer.h.

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

Definition at line 73 of file TrackingAnalyzer.h.

Referenced by checkTrackerFEDs(), and TrackingAnalyser().

int TrackingAnalyser::shiftReportFrequency_
private

Definition at line 71 of file TrackingAnalyzer.h.

Referenced by analyze(), and TrackingAnalyser().

int TrackingAnalyser::staticUpdateFrequency_
private

Definition at line 69 of file TrackingAnalyzer.h.

Referenced by TrackingAnalyser().

edm::ParameterSet TrackingAnalyser::tkMapPSet_
private

Definition at line 78 of file TrackingAnalyzer.h.

bool TrackingAnalyser::trackerFEDsFound_
private

Definition at line 86 of file TrackingAnalyzer.h.

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

bool TrackingAnalyser::verbose_
private

Definition at line 62 of file TrackingAnalyzer.h.

Referenced by endLuminosityBlock().