CMS 3D CMS Logo

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

#include <SiPixelEDAClient.h>

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

Public Member Functions

 SiPixelEDAClient (const edm::ParameterSet &ps)
 
virtual ~SiPixelEDAClient ()
 
- 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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & itemsToGetFromEvent () 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void beginRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 
void dqmEndJob (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c) override
 
- 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)
 

Private Attributes

bool actionOnLumiSec_
 
bool actionOnRunEnd_
 
bool doHitEfficiency_
 
int evtOffsetForInit_
 
bool firstLumi
 
bool hiRes_
 
std::ostringstream html_out_
 
std::string inputSource_
 
edm::EDGetTokenT< FEDRawDataCollectioninputSourceToken_
 
bool isUpgrade_
 
unsigned long long m_cacheID_
 
int nErrorsBarrel_lastLS_
 
int nErrorsEndcap_lastLS_
 
int nEvents_
 
int nEvents_lastLS_
 
int nFEDs_
 
int nLumiSecs_
 
double noiseRate_
 
int noiseRateDenominator_
 
bool offlineXMLfile_
 
SiPixelActionExecutorsipixelActionExecutor_
 
SiPixelDataQualitysipixelDataQuality_
 
SiPixelInformationExtractorsipixelInformationExtractor_
 
SiPixelWebInterface * sipixelWebInterface_
 
unsigned int staticUpdateFrequency_
 
int summaryFrequency_
 
std::string summaryXMLfile_
 
edm::ESHandle< SiPixelFedCablingMaptheCablingMap
 
bool Tier0Flag_
 
int tkMapFrequency_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 29 of file SiPixelEDAClient.h.

Constructor & Destructor Documentation

SiPixelEDAClient::SiPixelEDAClient ( const edm::ParameterSet ps)

Definition at line 53 of file SiPixelEDAClient.cc.

References BUF_SIZE, MessageLogger_cfi::cerr, groupFilesInBlocks::fin, edm::ParameterSet::getUntrackedParameter(), recoMuon::in, and AlCaHLTBitMon_QueryRunRegistry::string.

53  {
54 // cout<<"Entering SiPixelEDAClient::SiPixelEDAClient: "<<endl;
55 
56  edm::LogInfo("SiPixelEDAClient") << " Creating SiPixelEDAClient " << "\n" ;
57 
58  summaryFrequency_ = ps.getUntrackedParameter<int>("SummaryCreationFrequency",20);
59  tkMapFrequency_ = ps.getUntrackedParameter<int>("TkMapCreationFrequency",50);
60  staticUpdateFrequency_ = ps.getUntrackedParameter<int>("StaticUpdateFrequency",10);
61  actionOnLumiSec_ = ps.getUntrackedParameter<bool>("ActionOnLumiSection",false); //client
62  actionOnRunEnd_ = ps.getUntrackedParameter<bool>("ActionOnRunEnd",true); //client
63  evtOffsetForInit_ = ps.getUntrackedParameter<int>("EventOffsetForInit",10); //client
64  offlineXMLfile_ = ps.getUntrackedParameter<bool>("UseOfflineXMLFile",false); //client
65  hiRes_ = ps.getUntrackedParameter<bool>("HighResolutionOccupancy",false); //client
66  noiseRate_ = ps.getUntrackedParameter<double>("NoiseRateCutValue",0.001); //client
67  noiseRateDenominator_ = ps.getUntrackedParameter<int>("NEventsForNoiseCalculation",100000); //client
68  Tier0Flag_ = ps.getUntrackedParameter<bool>("Tier0Flag",false); //client
69  doHitEfficiency_ = ps.getUntrackedParameter<bool>("DoHitEfficiency",true); //client
70  inputSource_ = ps.getUntrackedParameter<string>("inputSource", "source");
71  isUpgrade_ = ps.getUntrackedParameter<bool>("isUpgrade",false); //client
72 
73  if(!Tier0Flag_){
74  string localPath = string("DQM/SiPixelMonitorClient/test/loader.html");
75  std::ifstream fin(edm::FileInPath(localPath).fullPath().c_str(), ios::in);
76  char buf[BUF_SIZE];
77 
78  if (!fin) {
79  cerr << "Input File: loader.html"<< " could not be opened!" << endl;
80  return;
81  }
82 
83  while (fin.getline(buf, BUF_SIZE, '\n')) { // pops off the newline character
84  html_out_ << buf ;
85  }
86  fin.close();
87 
88  }
89 
90  firstLumi = true;
91 
92  //instantiate the three work horses of the client:
96 
97  inputSourceToken_ = consumes<FEDRawDataCollection>(ps.getUntrackedParameter<string>("inputSource", "source"));
98  // cout<<"...leaving SiPixelEDAClient::SiPixelEDAClient. "<<endl;
99 }
T getUntrackedParameter(std::string const &, T const &) const
unsigned int staticUpdateFrequency_
SiPixelInformationExtractor * sipixelInformationExtractor_
std::string inputSource_
SiPixelActionExecutor * sipixelActionExecutor_
#define BUF_SIZE
std::ostringstream html_out_
SiPixelDataQuality * sipixelDataQuality_
edm::EDGetTokenT< FEDRawDataCollection > inputSourceToken_
SiPixelEDAClient::~SiPixelEDAClient ( )
virtual

Definition at line 104 of file SiPixelEDAClient.cc.

104  {
105 // cout<<"Entering SiPixelEDAClient::~SiPixelEDAClient: "<<endl;
106 
107  edm::LogInfo("SiPixelEDAClient") << " Deleting SiPixelEDAClient " << "\n" ;
108 
112  }
114  delete sipixelActionExecutor_;
116  }
117  if (sipixelDataQuality_) {
118  delete sipixelDataQuality_;
120  }
121 
122 // cout<<"...leaving SiPixelEDAClient::~SiPixelEDAClient. "<<endl;
123 }
SiPixelInformationExtractor * sipixelInformationExtractor_
SiPixelActionExecutor * sipixelActionExecutor_
SiPixelDataQuality * sipixelDataQuality_

Member Function Documentation

void SiPixelEDAClient::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprotectedvirtual

cout << "-----------NEW RUN---------------" << endl;

Reimplemented from DQMEDHarvester.

Definition at line 127 of file SiPixelEDAClient.cc.

127  {
128  edm::LogInfo ("SiPixelEDAClient") <<"[SiPixelEDAClient]: Begining of Run";
129 // cout<<"Entering SiPixelEDAClient::beginRun: "<<endl;
130 
132 
133  if(firstLumi){
134 
135  summaryFrequency_ = -1;
136  tkMapFrequency_ = -1;
137  actionOnRunEnd_ = true;
138  evtOffsetForInit_ = -1;
139 
140  nLumiSecs_ = 0;
141  nEvents_ = 0;
142  if(Tier0Flag_) nFEDs_ = 40;
143  else nFEDs_ = 0;
144 
145  }
146 
147 // cout<<"...leaving SiPixelEDAClient::beginRun. "<<endl;
148 
149 }
void SiPixelEDAClient::dqmEndJob ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter 
)
overrideprotectedvirtual

cout << "[SiPixelEDAClient]: endjob called!" << endl;

Implements DQMEDHarvester.

Definition at line 235 of file SiPixelEDAClient.cc.

References DQMStore::IBooker::cd(), DQMStore::IGetter::cd(), and StGenEvtProducer_cfi::init.

235  {
236 // cout<<"In SiPixelEDAClient::endJob "<<endl;
237  edm::LogInfo("SiPixelEDAClient") <<"[SiPixelEDAClient]: endjob called!";
239  sipixelActionExecutor_->createSummary(iBooker, iGetter, isUpgrade_);
240 
241  if(actionOnRunEnd_){
242 
243  //sipixelActionExecutor_->createSummary(iBooker, iGetter, isUpgrade_);
244 
245  if(doHitEfficiency_) {
248  }
249 
250  sipixelActionExecutor_->createOccupancy(iBooker,iGetter);
251 
253 
254  iBooker.cd();
255  iGetter.cd();
256  bool init=true;
258  init=true;
259  iBooker.cd();
260  iGetter.cd();
261 
263  init=true;
265  }
266 
267 
268 
269 }
void cd(void)
Definition: DQMStore.cc:339
edm::ESHandle< SiPixelFedCablingMap > theCablingMap
void cd(void)
Definition: DQMStore.cc:269
void createEfficiency(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool isUpgrade)
void fillGlobalQualityPlot(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool init, edm::ESHandle< SiPixelFedCablingMap > theCablingMap, int nFEDs, bool Tier0Flag, int lumisec)
SiPixelInformationExtractor * sipixelInformationExtractor_
SiPixelActionExecutor * sipixelActionExecutor_
void normaliseAvDigiOcc(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter)
void createSummary(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool isUpgrade)
void findNoisyPixels(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool init, float noiseRate, int noiseRateDenominator, edm::ESHandle< SiPixelFedCablingMap > theCablingMap)
void computeGlobalQualityFlag(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool init, int nFEDs, bool Tier0Flag)
SiPixelDataQuality * sipixelDataQuality_
void fillEfficiencySummary(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter)
void createOccupancy(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter)
void SiPixelEDAClient::dqmEndLuminosityBlock ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
)
overrideprotectedvirtual

std::cout << "CREATING SUMMARY" << std::endl;

std::cout << "NEW LUMISECTION n " << nLumiSecs_ << std::endl;

Reimplemented from DQMEDHarvester.

Definition at line 157 of file SiPixelEDAClient.cc.

References DQMStore::IBooker::cd(), DQMStore::IGetter::cd(), edm::EventSetup::get(), DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), mps_fire::i, edm::LuminosityBlockBase::id(), StGenEvtProducer_cfi::init, createfilelist::int, edm::LuminosityBlockBase::luminosityBlock(), edm::LuminosityBlockID::luminosityBlock(), MonitorElement::Reset(), DQMStore::IBooker::setCurrentFolder(), and DQMStore::IGetter::setCurrentFolder().

157  {
158  //cout<<"Entering SiPixelEDAClient::endLuminosityBlock: "<<endl;
159 
160  edm::LogInfo ("SiPixelEDAClient") <<"[SiPixelEDAClient]: Begin of LS transition";
161 
162  //Moved from beginLumi
164  MonitorElement * me = iGetter.get("Pixel/AdditionalPixelErrors/byLumiErrors");
165  if(me){
169  me->Reset();
170  }
171 
174 
175  if (firstLumi){
176  iBooker.setCurrentFolder("Pixel/");
177  iGetter.setCurrentFolder("Pixel/");
178  // Creating Summary Histos:
179  //std::cout << "CREATING SUMMARY" << std::endl;
180  //sipixelActionExecutor_->createSummary(iBooker,iGetter, isUpgrade_);
181  // Booking Deviation Histos:
183  // Booking Efficiency Histos:
185  // Creating occupancy plots:
187  // Booking noisy pixel ME's:
189  // Booking summary report ME's:
191 
192  if(!Tier0Flag_){
193  MonitorElement * mefed = iGetter.get("Pixel/EventInfo/DAQContents/fedcounter");
194  if(mefed){ for (int i = 0; i < mefed->getNbinsX(); ++i) nFEDs_ += mefed->getBinContent(i+1);}
195  }
196  eSetup.get<SiPixelFedCablingMapRcd>().get(theCablingMap);
197 
198  firstLumi = false;
199  }
200 
201  edm::LogInfo ("SiPixelEDAClient") <<"[SiPixelEDAClient]: End of LS transition, performing the DQM client operation";
202  //
203  nLumiSecs_ = lumiSeg.id().luminosityBlock() ;
204 
206  //nLumiSecs_++;
207 
208  edm::LogInfo("SiPixelEDAClient") << "====================================================== " << endl << " ===> Iteration # " << nLumiSecs_ << " " << lumiSeg.luminosityBlock() << endl << "====================================================== " << endl;
209 
211 
212  bool init=true;
213  if(actionOnLumiSec_ && nLumiSecs_ % 1 == 0 ){
214 
216  sipixelActionExecutor_->createOccupancy(iBooker,iGetter);
217  iBooker.cd();
218  iGetter.cd();
219  sipixelDataQuality_->computeGlobalQualityFlagByLumi(iGetter,init,nFEDs_,Tier0Flag_,nEvents_lastLS_,nErrorsBarrel_lastLS_,nErrorsEndcap_lastLS_);
220  init=true;
221  iBooker.cd();
222  iGetter.cd();
224  init=true;
226  }
227 
228 
229 
230  //cout<<"...leaving SiPixelEDAClient::endLuminosityBlock. "<<endl;
231 }
void normaliseAvDigiOccVsLumi(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, int lumisec)
void cd(void)
Definition: DQMStore.cc:339
edm::ESHandle< SiPixelFedCablingMap > theCablingMap
void cd(void)
Definition: DQMStore.cc:269
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:305
void createEfficiency(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool isUpgrade)
void bookOccupancyPlots(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool hiRes, bool isbarrel)
void fillGlobalQualityPlot(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool init, edm::ESHandle< SiPixelFedCablingMap > theCablingMap, int nFEDs, bool Tier0Flag, int lumisec)
SiPixelInformationExtractor * sipixelInformationExtractor_
SiPixelActionExecutor * sipixelActionExecutor_
void bookDeviations(DQMStore::IBooker &iBooker, bool isUpgrade)
void bookNoisyPixels(DQMStore::IBooker &iBooker, float noiseRate, bool Tier0Flag)
void createSummary(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool isUpgrade)
void findNoisyPixels(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool init, float noiseRate, int noiseRateDenominator, edm::ESHandle< SiPixelFedCablingMap > theCablingMap)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
SiPixelDataQuality * sipixelDataQuality_
void computeGlobalQualityFlagByLumi(DQMStore::IGetter &iGetter, bool init, int nFEDs, bool Tier0Flag, int nEvents_lastLS_, int nErrorsBarrel_lastLS_, int nErrorsEndcap_lastLS_)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:347
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
void createOccupancy(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter)
void Reset(void)
reset ME (ie. contents, errors, etc)
void bookEfficiency(DQMStore::IBooker &iBooker, bool isUpgrade)
void bookGlobalQualityFlag(DQMStore::IBooker &iBooker, bool Tier0Flag, int nFEDs)

Member Data Documentation

bool SiPixelEDAClient::actionOnLumiSec_
private

Definition at line 61 of file SiPixelEDAClient.h.

bool SiPixelEDAClient::actionOnRunEnd_
private

Definition at line 62 of file SiPixelEDAClient.h.

bool SiPixelEDAClient::doHitEfficiency_
private

Definition at line 72 of file SiPixelEDAClient.h.

int SiPixelEDAClient::evtOffsetForInit_
private

Definition at line 63 of file SiPixelEDAClient.h.

bool SiPixelEDAClient::firstLumi
private

Definition at line 71 of file SiPixelEDAClient.h.

bool SiPixelEDAClient::hiRes_
private

Definition at line 65 of file SiPixelEDAClient.h.

std::ostringstream SiPixelEDAClient::html_out_
private

Definition at line 76 of file SiPixelEDAClient.h.

std::string SiPixelEDAClient::inputSource_
private

Definition at line 74 of file SiPixelEDAClient.h.

edm::EDGetTokenT<FEDRawDataCollection> SiPixelEDAClient::inputSourceToken_
private

Definition at line 78 of file SiPixelEDAClient.h.

bool SiPixelEDAClient::isUpgrade_
private

Definition at line 73 of file SiPixelEDAClient.h.

unsigned long long SiPixelEDAClient::m_cacheID_
private

Definition at line 46 of file SiPixelEDAClient.h.

int SiPixelEDAClient::nErrorsBarrel_lastLS_
private

Definition at line 50 of file SiPixelEDAClient.h.

int SiPixelEDAClient::nErrorsEndcap_lastLS_
private

Definition at line 51 of file SiPixelEDAClient.h.

int SiPixelEDAClient::nEvents_
private

Definition at line 48 of file SiPixelEDAClient.h.

int SiPixelEDAClient::nEvents_lastLS_
private

Definition at line 49 of file SiPixelEDAClient.h.

int SiPixelEDAClient::nFEDs_
private

Definition at line 69 of file SiPixelEDAClient.h.

int SiPixelEDAClient::nLumiSecs_
private

Definition at line 47 of file SiPixelEDAClient.h.

double SiPixelEDAClient::noiseRate_
private

Definition at line 66 of file SiPixelEDAClient.h.

int SiPixelEDAClient::noiseRateDenominator_
private

Definition at line 67 of file SiPixelEDAClient.h.

bool SiPixelEDAClient::offlineXMLfile_
private

Definition at line 68 of file SiPixelEDAClient.h.

SiPixelActionExecutor* SiPixelEDAClient::sipixelActionExecutor_
private

Definition at line 56 of file SiPixelEDAClient.h.

SiPixelDataQuality* SiPixelEDAClient::sipixelDataQuality_
private

Definition at line 55 of file SiPixelEDAClient.h.

SiPixelInformationExtractor* SiPixelEDAClient::sipixelInformationExtractor_
private

Definition at line 54 of file SiPixelEDAClient.h.

SiPixelWebInterface* SiPixelEDAClient::sipixelWebInterface_
private

Definition at line 53 of file SiPixelEDAClient.h.

unsigned int SiPixelEDAClient::staticUpdateFrequency_
private

Definition at line 60 of file SiPixelEDAClient.h.

int SiPixelEDAClient::summaryFrequency_
private

Definition at line 59 of file SiPixelEDAClient.h.

std::string SiPixelEDAClient::summaryXMLfile_
private

Definition at line 64 of file SiPixelEDAClient.h.

edm::ESHandle<SiPixelFedCablingMap> SiPixelEDAClient::theCablingMap
private

Definition at line 79 of file SiPixelEDAClient.h.

bool SiPixelEDAClient::Tier0Flag_
private

Definition at line 70 of file SiPixelEDAClient.h.

int SiPixelEDAClient::tkMapFrequency_
private

Definition at line 58 of file SiPixelEDAClient.h.