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

#include <SiStripAnalyser.h>

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

Public Member Functions

 SiStripAnalyser (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~SiStripAnalyser ()
 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
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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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 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

SiStripActionExecutoractionExecutor_
 
SiStripClassToMonitorCondDatacondDataMon_
 
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_
 
bool printFaultyModuleList_
 
edm::InputTag rawDataTag_
 
edm::EDGetTokenT
< FEDRawDataCollection
rawDataToken_
 
int shiftReportFrequency_
 
int staticUpdateFrequency_
 
int summaryFrequency_
 
int tkMapFrequency_
 
edm::ParameterSet tkMapPSet_
 
bool trackerFEDsFound_
 

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 &)
 
- 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 32 of file SiStripAnalyser.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 54 of file SiStripAnalyser.cc.

References actionExecutor_, BUF_SIZE, ecal_dqm_sourceclient-live_cfg::cerr, condDataMon_, dqmStore_, endLumiAnalysisOn_, groupFilesInBlocks::fin, contentValuesFiles::fullPath, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), globalStatusFilling_, html_out_, recoMuon::in, cppFunctionSkipper::operator, printFaultyModuleList_, rawDataTag_, rawDataToken_, shiftReportFrequency_, staticUpdateFrequency_, AlCaHLTBitMon_QueryRunRegistry::string, summaryFrequency_, tkMapFrequency_, tkMapPSet_, and trackerFEDsFound_.

54  {
55 
56  // Get TkMap ParameterSet
57  tkMapPSet_ = ps.getParameter<edm::ParameterSet>("TkmapParameters");
58 
59  std::string localPath = std::string("DQM/SiStripMonitorClient/test/loader.html");
60  std::ifstream fin(edm::FileInPath(localPath).fullPath().c_str(), std::ios::in);
61  char buf[BUF_SIZE];
62 
63  if (!fin) {
64  std::cerr << "Input File: loader.html"<< " could not be opened!" << std::endl;
65  return;
66  }
67 
68  while (fin.getline(buf, BUF_SIZE, '\n')) { // pops off the newline character
69  html_out_ << buf ;
70  }
71  fin.close();
72 
73 
74 
75  edm::LogInfo("SiStripAnalyser") << " SiStripAnalyser::Creating SiStripAnalyser ";
76  summaryFrequency_ = ps.getUntrackedParameter<int>("SummaryCreationFrequency",1);
77  tkMapFrequency_ = ps.getUntrackedParameter<int>("TkMapCreationFrequency",1);
78  staticUpdateFrequency_ = ps.getUntrackedParameter<int>("StaticUpdateFrequency",1);
79  globalStatusFilling_ = ps.getUntrackedParameter<int>("GlobalStatusFilling", 1);
80  shiftReportFrequency_ = ps.getUntrackedParameter<int>("ShiftReportFrequency", 1);
81  rawDataTag_ = ps.getUntrackedParameter<edm::InputTag>("RawDataTag");
82  printFaultyModuleList_ = ps.getUntrackedParameter<bool>("PrintFaultyModuleList", true);
83 
84  rawDataToken_ = consumes<FEDRawDataCollection>(ps.getUntrackedParameter<edm::InputTag>("RawDataTag") );
85  // get back-end interface
87 
88 
89  // instantiate web interface
92  trackerFEDsFound_ = false;
93  endLumiAnalysisOn_ = false;
94 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag rawDataTag_
DQMStore * dqmStore_
std::ostringstream html_out_
#define BUF_SIZE
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
SiStripActionExecutor * actionExecutor_
edm::ParameterSet tkMapPSet_
SiStripClassToMonitorCondData * condDataMon_
SiStripAnalyser::~SiStripAnalyser ( )
virtual

Destructor.

Definition at line 98 of file SiStripAnalyser.cc.

98  {
99 
100  edm::LogInfo("SiStripAnalyser") << "SiStripAnalyser::Deleting SiStripAnalyser ";
101 // if (sistripWebInterface_) {
102 // delete sistripWebInterface_;
103 // sistripWebInterface_ = 0;
104 // }
105 // if (trackerMapCreator_) {
106 // delete trackerMapCreator_;
107 // trackerMapCreator_ = 0;
108 // }
109 
110 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 156 of file SiStripAnalyser.cc.

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

156  {
157  nEvents_++;
158  if (nEvents_ == 1 && globalStatusFilling_ > 0) {
160  if (!trackerFEDsFound_) {
163  } else {
166  }
167  }
168  /* removing xdaq deps
169  unsigned int nval = sistripWebInterface_->getNumberOfConDBPlotRequest();
170  if (nval > 0) {
171  for (unsigned int ival = 0; ival < nval; ival++) {
172  uint32_t det_id;
173  std::string subdet_type;
174  uint32_t subdet_side;
175  uint32_t layer_number;
176  sistripWebInterface_->getConDBPlotParameters(ival, det_id, subdet_type, subdet_side, layer_number);
177  if (condDataMon_) {
178  if (det_id == 999) condDataMon_->getLayerMEsOnDemand(eSetup,subdet_type, subdet_side,layer_number);
179  else if (layer_number == 999 && subdet_side == 999) condDataMon_->getModMEsOnDemand(eSetup,det_id);
180  }
181  }
182  sistripWebInterface_->clearConDBPlotRequests();
183  }
184  sistripWebInterface_->setActionFlag(SiStripWebInterface::CreatePlots);
185  sistripWebInterface_->performAction();
186  */
187 }
DQMStore * dqmStore_
void fillStatus(DQMStore *dqm_store, const edm::ESHandle< SiStripDetCabling > &fedcabling, const edm::EventSetup &eSetup)
edm::ESHandle< SiStripDetCabling > detCabling_
SiStripActionExecutor * actionExecutor_
void createShiftReport(DQMStore *dqm_store)
void checkTrackerFEDs(edm::Event const &e)
void SiStripAnalyser::beginJob ( void  )
privatevirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 114 of file SiStripAnalyser.cc.

References actionExecutor_, nEvents_, nLumiSecs_, SiStripActionExecutor::readConfiguration(), and summaryFrequency_.

114  {
115 
116  // Read the summary configuration file
118  edm::LogInfo ("SiStripAnalyser") <<"SiStripAnalyser:: Error to read configuration file!! Summary will not be produced!!!";
119  summaryFrequency_ = -1;
120  }
121  nLumiSecs_ = 0;
122  nEvents_ = 0;
123 }
SiStripActionExecutor * actionExecutor_
void SiStripAnalyser::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
privatevirtual

Begin Luminosity Block.

Reimplemented from edm::EDAnalyzer.

Definition at line 150 of file SiStripAnalyser.cc.

150  {
151  edm::LogInfo("SiStripAnalyser") <<"SiStripAnalyser:: Begin of LS transition";
152 }
void SiStripAnalyser::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
privatevirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 127 of file SiStripAnalyser.cc.

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

127  {
128  edm::LogInfo ("SiStripAnalyser") <<"SiStripAnalyser:: Begining of Run";
129 
130  // Check latest Fed cabling and create TrackerMapCreator
131  unsigned long long cacheID = eSetup.get<SiStripFedCablingRcd>().cacheIdentifier();
132  if (m_cacheID_ != cacheID) {
133  m_cacheID_ = cacheID;
134  edm::LogInfo("SiStripAnalyser") <<"SiStripAnalyser::beginRun: "
135  << " Change in Cabling, recrated TrackerMap";
136  if (!actionExecutor_->readTkMapConfiguration(eSetup)) {
137  edm::LogInfo ("SiStripAnalyser") <<"SiStripAnalyser:: Error to read configuration file!! TrackerMap will not be produced!!!";
138  tkMapFrequency_ = -1;
139 
140  }
141  eSetup.get<SiStripFedCablingRcd>().get(fedCabling_);
142  eSetup.get<SiStripDetCablingRcd>().get(detCabling_);
143  }
144  if (condDataMon_) condDataMon_->beginRun(eSetup);
146 }
edm::ESHandle< SiStripFedCabling > fedCabling_
DQMStore * dqmStore_
void beginRun(edm::EventSetup const &eSetup)
bool readTkMapConfiguration(const edm::EventSetup &eSetup)
void createStatus(DQMStore *dqm_store)
edm::ESHandle< SiStripDetCabling > detCabling_
SiStripActionExecutor * actionExecutor_
SiStripClassToMonitorCondData * condDataMon_
unsigned long long m_cacheID_
void SiStripAnalyser::checkTrackerFEDs ( edm::Event const &  e)
private

Definition at line 260 of file SiStripAnalyser.cc.

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

Referenced by analyze().

260  {
261  edm::Handle<FEDRawDataCollection> rawDataHandle;
262  e.getByToken( rawDataToken_, rawDataHandle );
263  if ( !rawDataHandle.isValid() ) return;
264 
265  const FEDRawDataCollection& rawDataCollection = *rawDataHandle;
266  const int siStripFedIdMin = FEDNumbering::MINSiStripFEDID;
267  const int siStripFedIdMax = FEDNumbering::MAXSiStripFEDID;
268 
269  unsigned int nFed = 0;
270  for (int i=siStripFedIdMin; i <= siStripFedIdMax; i++) {
271  if (rawDataCollection.FEDData(i).size() && rawDataCollection.FEDData(i).data()) {
272  nFed++;
273  }
274  }
275  if (nFed > 0) trackerFEDsFound_ = true;
276 }
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
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:75
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
void SiStripAnalyser::endJob ( void  )
privatevirtual

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 249 of file SiStripAnalyser.cc.

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

249  {
250  edm::LogInfo("SiStripAnalyser") <<"SiStripAnalyser:: endjob called!";
252  std::ostringstream str_val;
254  std::cout << str_val.str() << std::endl;
255  }
256 }
DQMStore * dqmStore_
SiStripActionExecutor * actionExecutor_
tuple cout
Definition: gather_cfg.py:145
void printFaultyModuleList(DQMStore *dqm_store, std::ostringstream &str_val)
void SiStripAnalyser::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
privatevirtual

End Luminosity Block.

Reimplemented from edm::EDAnalyzer.

Definition at line 191 of file SiStripAnalyser.cc.

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

191  {
192  edm::LogInfo ("SiStripAnalyser") <<"SiStripAnalyser:: End of LS transition, performing the DQM client operation";
193 
194  nLumiSecs_++;
195 
196  if (!trackerFEDsFound_) {
198  return;
199  }
200  endLumiAnalysisOn_ = true;
201 
202  // sistripWebInterface_->setCabling(detCabling_);
203 
204  std::cout << "====================================================== " << std::endl;
205  std::cout << " ===> Iteration # " << nLumiSecs_ << " "
206  << lumiSeg.luminosityBlock() << std::endl;
207  std::cout << "====================================================== " << std::endl;
208  // Create predefined plots
209  /*removing xdaq dep
210  if (staticUpdateFrequency_ != -1 && nLumiSecs_ > 0 && nLumiSecs_%staticUpdateFrequency_ == 0) {
211  std::cout << " Creating predefined plots " << std::endl;
212  sistripWebInterface_->setActionFlag(SiStripWebInterface::PlotHistogramFromLayout);
213  sistripWebInterface_->performAction();
214  }
215  */
216  // Fill Global Status
217  if (globalStatusFilling_ > 0) {
219  }
220  // -- Create summary monitor elements according to the frequency
221  if (summaryFrequency_ != -1 && nLumiSecs_ > 0 && nLumiSecs_%summaryFrequency_ == 0) {
222  std::cout << " Creating Summary " << std::endl;
224  }
225  // -- Create TrackerMap according to the frequency
226  /* removing xdaq deps
227  if (tkMapFrequency_ != -1 && nLumiSecs_ > 0 && nLumiSecs_%tkMapFrequency_ == 0) {
228  std::cout << " Creating Tracker Map " << std::endl;
229  std::string tkmap_type = sistripWebInterface_->getTkMapType();
230  actionExecutor_->createTkMap(tkMapPSet_, dqmStore_, tkmap_type, eSetup);
231  }
232  */
233  // Create Shift Report
234  // if (shiftReportFrequency_ != -1 && trackerFEDsFound_ && nLumiSecs_%shiftReportFrequency_ == 0) {
235  // actionExecutor_->createShiftReport(dqmStore_);
236  // }
237  endLumiAnalysisOn_ = false;
238 }
DQMStore * dqmStore_
void createSummary(DQMStore *dqm_store)
void fillStatus(DQMStore *dqm_store, const edm::ESHandle< SiStripDetCabling > &fedcabling, const edm::EventSetup &eSetup)
edm::ESHandle< SiStripDetCabling > detCabling_
SiStripActionExecutor * actionExecutor_
tuple cout
Definition: gather_cfg.py:145
void SiStripAnalyser::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
privatevirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 243 of file SiStripAnalyser.cc.

243  {
244  edm::LogInfo ("SiStripAnalyser") <<"SiStripAnalyser:: End of Run";
245 }

Member Data Documentation

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

Definition at line 74 of file SiStripAnalyser.h.

Referenced by beginRun(), and SiStripAnalyser().

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

Definition at line 96 of file SiStripAnalyser.h.

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

DQMStore* SiStripAnalyser::dqmStore_
private

Definition at line 77 of file SiStripAnalyser.h.

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

bool SiStripAnalyser::endLumiAnalysisOn_
private

Definition at line 104 of file SiStripAnalyser.h.

Referenced by endLuminosityBlock(), and SiStripAnalyser().

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

Definition at line 95 of file SiStripAnalyser.h.

Referenced by beginRun().

int SiStripAnalyser::fileSaveFrequency_
private

Definition at line 81 of file SiStripAnalyser.h.

int SiStripAnalyser::globalStatusFilling_
private

Definition at line 85 of file SiStripAnalyser.h.

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

std::ostringstream SiStripAnalyser::html_out_
private

Definition at line 105 of file SiStripAnalyser.h.

Referenced by SiStripAnalyser().

unsigned long long SiStripAnalyser::m_cacheID_
private

Definition at line 99 of file SiStripAnalyser.h.

Referenced by beginRun().

int SiStripAnalyser::nEvents_
private

Definition at line 101 of file SiStripAnalyser.h.

Referenced by analyze(), and beginJob().

int SiStripAnalyser::nLumiSecs_
private

Definition at line 100 of file SiStripAnalyser.h.

Referenced by beginJob(), and endLuminosityBlock().

std::string SiStripAnalyser::outputFileName_
private

Definition at line 92 of file SiStripAnalyser.h.

std::string SiStripAnalyser::outputFilePath_
private

Definition at line 91 of file SiStripAnalyser.h.

bool SiStripAnalyser::printFaultyModuleList_
private

Definition at line 103 of file SiStripAnalyser.h.

Referenced by endJob(), and SiStripAnalyser().

edm::InputTag SiStripAnalyser::rawDataTag_
private

Definition at line 88 of file SiStripAnalyser.h.

Referenced by SiStripAnalyser().

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

Definition at line 89 of file SiStripAnalyser.h.

Referenced by checkTrackerFEDs(), and SiStripAnalyser().

int SiStripAnalyser::shiftReportFrequency_
private

Definition at line 86 of file SiStripAnalyser.h.

Referenced by analyze(), and SiStripAnalyser().

int SiStripAnalyser::staticUpdateFrequency_
private

Definition at line 84 of file SiStripAnalyser.h.

Referenced by SiStripAnalyser().

int SiStripAnalyser::summaryFrequency_
private

Definition at line 82 of file SiStripAnalyser.h.

Referenced by beginJob(), endLuminosityBlock(), and SiStripAnalyser().

int SiStripAnalyser::tkMapFrequency_
private

Definition at line 83 of file SiStripAnalyser.h.

Referenced by beginRun(), and SiStripAnalyser().

edm::ParameterSet SiStripAnalyser::tkMapPSet_
private

Definition at line 94 of file SiStripAnalyser.h.

Referenced by SiStripAnalyser().

bool SiStripAnalyser::trackerFEDsFound_
private

Definition at line 102 of file SiStripAnalyser.h.

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