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
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 (const std::string &iProcessName, std::vector< const char * > &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 ()
 

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, ecal_dqm_sourceclient-live_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

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 233 of file SiPixelEDAClient.cc.

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

233  {
234 // cout<<"In SiPixelEDAClient::endJob "<<endl;
235  edm::LogInfo("SiPixelEDAClient") <<"[SiPixelEDAClient]: endjob called!";
237  sipixelActionExecutor_->createSummary(iBooker, iGetter, isUpgrade_);
238 
239  if(actionOnRunEnd_){
240 
241  //sipixelActionExecutor_->createSummary(iBooker, iGetter, isUpgrade_);
242 
244 
245  sipixelActionExecutor_->createOccupancy(iBooker,iGetter);
246 
247  iBooker.cd();
248  iGetter.cd();
249  bool init=true;
251  init=true;
252  iBooker.cd();
253  iGetter.cd();
254 
256  init=true;
258  }
259 
260 
261 
262 }
void cd(void)
Definition: DQMStore.cc:322
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

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(), i, edm::LuminosityBlockBase::id(), init, 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){
166  nEvents_lastLS_ = int(me->getBinContent(0));
167  nErrorsBarrel_lastLS_ = int(me->getBinContent(1));
168  nErrorsEndcap_lastLS_ = int(me->getBinContent(2));
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 
210  bool init=true;
211  if(actionOnLumiSec_ && nLumiSecs_ % 1 == 0 ){
212 
214  sipixelActionExecutor_->createOccupancy(iBooker,iGetter);
215  iBooker.cd();
216  iGetter.cd();
217  sipixelDataQuality_->computeGlobalQualityFlagByLumi(iGetter,init,nFEDs_,Tier0Flag_,nEvents_lastLS_,nErrorsBarrel_lastLS_,nErrorsEndcap_lastLS_);
218  init=true;
219  iBooker.cd();
220  iGetter.cd();
222  init=true;
224  }
225 
226 
227 
228  //cout<<"...leaving SiPixelEDAClient::endLuminosityBlock. "<<endl;
229 }
int i
Definition: DBlmapReader.cc:9
void cd(void)
Definition: DQMStore.cc:322
edm::ESHandle< SiPixelFedCablingMap > theCablingMap
void cd(void)
Definition: DQMStore.cc:266
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
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:330
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.