CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- 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 ()
 

Protected Member Functions

void beginRun (edm::Run const &run, edm::EventSetup const &eSetup)
 
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::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)
 

Private Attributes

bool actionOnLumiSec_
 
bool actionOnRunEnd_
 
bool doHitEfficiency_
 
int evtOffsetForInit_
 
bool firstLumi
 
bool hiRes_
 
std::ostringstream html_out_
 
std::string inputSource_
 
edm::EDGetTokenT
< FEDRawDataCollection
inputSourceToken_
 
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
< SiPixelFedCablingMap
theCablingMap
 
bool Tier0Flag_
 
int tkMapFrequency_
 

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)
 

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, dtNoiseDBValidation_cfg::cerr, groupFilesInBlocks::fin, contentValuesFiles::fullPath, 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 
)
protectedvirtual

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 
131  if(firstLumi){
132 
133  summaryFrequency_ = -1;
134  tkMapFrequency_ = -1;
135  actionOnRunEnd_ = true;
136  evtOffsetForInit_ = -1;
137 
138  nLumiSecs_ = 0;
139  nEvents_ = 0;
140  if(Tier0Flag_) nFEDs_ = 40;
141  else nFEDs_ = 0;
142 
143  }
144 
145 // cout<<"...leaving SiPixelEDAClient::beginRun. "<<endl;
146 
147 }
void SiPixelEDAClient::dqmEndJob ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 234 of file SiPixelEDAClient.cc.

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

234  {
235 // cout<<"In SiPixelEDAClient::endJob "<<endl;
236  edm::LogInfo("SiPixelEDAClient") <<"[SiPixelEDAClient]: endjob called!";
237 
238  if(actionOnRunEnd_){
239 
240  sipixelActionExecutor_->createSummary(iBooker, iGetter, isUpgrade_);
241 
243 
244  sipixelActionExecutor_->createOccupancy(iBooker,iGetter);
245 
246  iBooker.cd();
247  iGetter.cd();
248  bool init=true;
250  init=true;
251  iBooker.cd();
252  iGetter.cd();
253 
255  init=true;
257  }
258 
259 
260 
261 }
void cd(void)
Definition: DQMStore.cc:318
edm::ESHandle< SiPixelFedCablingMap > theCablingMap
void cd(void)
Definition: DQMStore.cc:266
void createEfficiency(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool isUpgrade)
int init
Definition: HydjetWrapper.h:62
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 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 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

Reimplemented from DQMEDHarvester.

Definition at line 155 of file SiPixelEDAClient.cc.

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

155  {
156  //cout<<"Entering SiPixelEDAClient::endLuminosityBlock: "<<endl;
157 
158  edm::LogInfo ("SiPixelEDAClient") <<"[SiPixelEDAClient]: Begin of LS transition";
159 
160  //Moved from beginLumi
162  MonitorElement * me = iGetter.get("Pixel/AdditionalPixelErrors/byLumiErrors");
163  if(me){
164  nEvents_lastLS_ = int(me->getBinContent(0));
165  nErrorsBarrel_lastLS_ = int(me->getBinContent(1));
166  nErrorsEndcap_lastLS_ = int(me->getBinContent(2));
167  me->Reset();
168  }
169 
170 
171  if (firstLumi){
172  iBooker.setCurrentFolder("Pixel/");
173  iGetter.setCurrentFolder("Pixel/");
174  // Creating Summary Histos:
176  // Booking Deviation Histos:
178  // Booking Efficiency Histos:
180  // Creating occupancy plots:
182  // Booking noisy pixel ME's:
184  // Booking summary report ME's:
186 
187  if(!Tier0Flag_){
188  MonitorElement * mefed = iGetter.get("Pixel/EventInfo/DAQContents/fedcounter");
189  if(mefed){ for (int i = 0; i < mefed->getNbinsX(); ++i) nFEDs_ += mefed->getBinContent(i+1);}
190  }
191  eSetup.get<SiPixelFedCablingMapRcd>().get(theCablingMap);
192 
193  firstLumi = false;
194  }
195 
196  edm::LogInfo ("SiPixelEDAClient") <<"[SiPixelEDAClient]: End of LS transition, performing the DQM client operation";
197  //
198  nLumiSecs_ = lumiSeg.id().luminosityBlock() ;
199  //nLumiSecs_++;
200 
201  edm::LogInfo("SiPixelEDAClient") << "====================================================== " << endl << " ===> Iteration # " << nLumiSecs_ << " " << lumiSeg.luminosityBlock() << endl << "====================================================== " << endl;
202 
203  bool init=true;
204  if(actionOnLumiSec_ && nLumiSecs_ % 1 == 0 ){
205 
207  sipixelActionExecutor_->createOccupancy(iBooker,iGetter);
208  iBooker.cd();
209  iGetter.cd();
210  sipixelDataQuality_->computeGlobalQualityFlagByLumi(iGetter,init,nFEDs_,Tier0Flag_,nEvents_lastLS_,nErrorsBarrel_lastLS_,nErrorsEndcap_lastLS_);
211  init=true;
212  iBooker.cd();
213  iGetter.cd();
215  init=true;
217  }
218 
219  if (actionOnRunEnd_){
220 
221  }
222 
223  init = true;
224 
225 
226  init =true;
227 
228 
229  //cout<<"...leaving SiPixelEDAClient::endLuminosityBlock. "<<endl;
230 }
int i
Definition: DBlmapReader.cc:9
void cd(void)
Definition: DQMStore.cc:318
edm::ESHandle< SiPixelFedCablingMap > theCablingMap
void cd(void)
Definition: DQMStore.cc:266
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:298
void createEfficiency(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool isUpgrade)
int init
Definition: HydjetWrapper.h:62
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:274
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:326
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.