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

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
 
- 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 56 of file SiStripAnalyser.cc.

References actionExecutor_, BUF_SIZE, dtNoiseDBValidation_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_.

56  {
57 
58  // Get TkMap ParameterSet
59  tkMapPSet_ = ps.getParameter<edm::ParameterSet>("TkmapParameters");
60 
61  std::string localPath = std::string("DQM/SiStripMonitorClient/test/loader.html");
62  std::ifstream fin(edm::FileInPath(localPath).fullPath().c_str(), std::ios::in);
63  char buf[BUF_SIZE];
64 
65  if (!fin) {
66  std::cerr << "Input File: loader.html"<< " could not be opened!" << std::endl;
67  return;
68  }
69 
70  while (fin.getline(buf, BUF_SIZE, '\n')) { // pops off the newline character
71  html_out_ << buf ;
72  }
73  fin.close();
74 
75 
76 
77  edm::LogInfo("SiStripAnalyser") << " SiStripAnalyser::Creating SiStripAnalyser ";
78  summaryFrequency_ = ps.getUntrackedParameter<int>("SummaryCreationFrequency",1);
79  tkMapFrequency_ = ps.getUntrackedParameter<int>("TkMapCreationFrequency",1);
80  staticUpdateFrequency_ = ps.getUntrackedParameter<int>("StaticUpdateFrequency",1);
81  globalStatusFilling_ = ps.getUntrackedParameter<int>("GlobalStatusFilling", 1);
82  shiftReportFrequency_ = ps.getUntrackedParameter<int>("ShiftReportFrequency", 1);
83  rawDataTag_ = ps.getUntrackedParameter<edm::InputTag>("RawDataTag");
84  printFaultyModuleList_ = ps.getUntrackedParameter<bool>("PrintFaultyModuleList", true);
85 
86  rawDataToken_ = consumes<FEDRawDataCollection>(ps.getUntrackedParameter<edm::InputTag>("RawDataTag") );
87  // get back-end interface
89 
90 
91  // instantiate web interface
94  trackerFEDsFound_ = false;
95  endLumiAnalysisOn_ = false;
96 }
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 100 of file SiStripAnalyser.cc.

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

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 158 of file SiStripAnalyser.cc.

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

158  {
159  nEvents_++;
160  if (nEvents_ == 1 && globalStatusFilling_ > 0) {
162  if (!trackerFEDsFound_) {
165  } else {
168  }
169  }
170  /* removing xdaq deps
171  unsigned int nval = sistripWebInterface_->getNumberOfConDBPlotRequest();
172  if (nval > 0) {
173  for (unsigned int ival = 0; ival < nval; ival++) {
174  uint32_t det_id;
175  std::string subdet_type;
176  uint32_t subdet_side;
177  uint32_t layer_number;
178  sistripWebInterface_->getConDBPlotParameters(ival, det_id, subdet_type, subdet_side, layer_number);
179  if (condDataMon_) {
180  if (det_id == 999) condDataMon_->getLayerMEsOnDemand(eSetup,subdet_type, subdet_side,layer_number);
181  else if (layer_number == 999 && subdet_side == 999) condDataMon_->getModMEsOnDemand(eSetup,det_id);
182  }
183  }
184  sistripWebInterface_->clearConDBPlotRequests();
185  }
186  sistripWebInterface_->setActionFlag(SiStripWebInterface::CreatePlots);
187  sistripWebInterface_->performAction();
188  */
189 }
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 116 of file SiStripAnalyser.cc.

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

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

Begin Luminosity Block.

Reimplemented from edm::EDAnalyzer.

Definition at line 152 of file SiStripAnalyser.cc.

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

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 129 of file SiStripAnalyser.cc.

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

129  {
130  edm::LogInfo ("SiStripAnalyser") <<"SiStripAnalyser:: Begining of Run";
131 
132  // Check latest Fed cabling and create TrackerMapCreator
133  unsigned long long cacheID = eSetup.get<SiStripFedCablingRcd>().cacheIdentifier();
134  if (m_cacheID_ != cacheID) {
135  m_cacheID_ = cacheID;
136  edm::LogInfo("SiStripAnalyser") <<"SiStripAnalyser::beginRun: "
137  << " Change in Cabling, recrated TrackerMap";
138  if (!actionExecutor_->readTkMapConfiguration(eSetup)) {
139  edm::LogInfo ("SiStripAnalyser") <<"SiStripAnalyser:: Error to read configuration file!! TrackerMap will not be produced!!!";
140  tkMapFrequency_ = -1;
141 
142  }
143  eSetup.get<SiStripFedCablingRcd>().get(fedCabling_);
144  eSetup.get<SiStripDetCablingRcd>().get(detCabling_);
145  }
146  if (condDataMon_) condDataMon_->beginRun(eSetup);
148 }
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 262 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().

262  {
263  edm::Handle<FEDRawDataCollection> rawDataHandle;
264  e.getByToken( rawDataToken_, rawDataHandle );
265  if ( !rawDataHandle.isValid() ) return;
266 
267  const FEDRawDataCollection& rawDataCollection = *rawDataHandle;
268  const int siStripFedIdMin = FEDNumbering::MINSiStripFEDID;
269  const int siStripFedIdMax = FEDNumbering::MAXSiStripFEDID;
270 
271  unsigned int nFed = 0;
272  for (int i=siStripFedIdMin; i <= siStripFedIdMax; i++) {
273  if (rawDataCollection.FEDData(i).size() && rawDataCollection.FEDData(i).data()) {
274  nFed++;
275  }
276  }
277  if (nFed > 0) trackerFEDsFound_ = true;
278 }
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:76
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 251 of file SiStripAnalyser.cc.

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

251  {
252  edm::LogInfo("SiStripAnalyser") <<"SiStripAnalyser:: endjob called!";
254  std::ostringstream str_val;
256  std::cout << str_val.str() << std::endl;
257  }
258 }
DQMStore * dqmStore_
SiStripActionExecutor * actionExecutor_
tuple cout
Definition: gather_cfg.py:121
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 193 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_.

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

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 245 of file SiStripAnalyser.cc.

245  {
246  edm::LogInfo ("SiStripAnalyser") <<"SiStripAnalyser:: End of Run";
247 }

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().