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

Implements DQMEDHarvester.

Definition at line 250 of file SiPixelEDAClient.cc.

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

250  {
251 // cout<<"In SiPixelEDAClient::endJob "<<endl;
252  edm::LogInfo("SiPixelEDAClient") <<"[SiPixelEDAClient]: endjob called!";
253 
254  if(actionOnRunEnd_){
255 
256  sipixelActionExecutor_->createSummary(iBooker, iGetter, isUpgrade_);
257 
259 
260  sipixelActionExecutor_->createOccupancy(iBooker,iGetter);
261 
262  iBooker.cd();
263  iGetter.cd();
264  bool init=true;
266  init=true;
267  iBooker.cd();
268  iGetter.cd();
269 
271  init=true;
273  }
274 
275 
276 
277 }
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 156 of file SiPixelEDAClient.cc.

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

156  {
157  //cout<<"Entering SiPixelEDAClient::endLuminosityBlock: "<<endl;
158 
159  edm::LogInfo ("SiPixelEDAClient") <<"[SiPixelEDAClient]: Begin of LS transition";
160 
161  //Moved from beginLumi
163  MonitorElement * me = iGetter.get("Pixel/AdditionalPixelErrors/byLumiErrors");
164  if(me){
165  nEvents_lastLS_ = int(me->getBinContent(0));
166  nErrorsBarrel_lastLS_ = int(me->getBinContent(1));
167  nErrorsEndcap_lastLS_ = int(me->getBinContent(2));
168  me->Reset();
169  }
170 
171 
172  if (firstLumi){
173  iBooker.setCurrentFolder("Pixel/");
174  iGetter.setCurrentFolder("Pixel/");
175  // Creating Summary Histos:
177  // Booking Deviation Histos:
179  // Booking Efficiency Histos:
181  // Creating occupancy plots:
183  // Booking noisy pixel ME's:
185  // Booking summary report ME's:
187 
188  /* nEvents_++;
189  if(!Tier0Flag_){
190 
191  if(nEvents_==1){
192  // check if any Pixel FED is in readout:
193  edm::Handle<FEDRawDataCollection> rawDataHandle;
194  e.getByToken(inputSourceToken_, rawDataHandle);
195  if(!rawDataHandle.isValid()){
196  edm::LogInfo("SiPixelEDAClient") << inputSource_ << " is empty";
197  return;
198  }
199  const FEDRawDataCollection& rawDataCollection = *rawDataHandle;
200  nFEDs_ = 0;
201  for(int i = 0; i != 40; i++){
202  if(rawDataCollection.FEDData(i).size() && rawDataCollection.FEDData(i).data()) nFEDs_++;
203  }
204  }
205  }*/
206 
207  eSetup.get<SiPixelFedCablingMapRcd>().get(theCablingMap);
208 
209  firstLumi = false;
210  }
211 
212  edm::LogInfo ("SiPixelEDAClient") <<"[SiPixelEDAClient]: End of LS transition, performing the DQM client operation";
213 
214  nLumiSecs_++;
215 
216  edm::LogInfo("SiPixelEDAClient") << "====================================================== " << endl << " ===> Iteration # " << nLumiSecs_ << " " << lumiSeg.luminosityBlock() << endl << "====================================================== " << endl;
217 
218  bool init=true;
219  if(actionOnLumiSec_ && nLumiSecs_ % 1 == 0 ){
220 
222  sipixelActionExecutor_->createOccupancy(iBooker,iGetter);
223  iBooker.cd();
224  iGetter.cd();
225 
226  sipixelDataQuality_->computeGlobalQualityFlagByLumi(iGetter,init,nFEDs_,Tier0Flag_,nEvents_lastLS_,nErrorsBarrel_lastLS_,nErrorsEndcap_lastLS_);
227  init=true;
228  iBooker.cd();
229  iGetter.cd();
231  init=true;
233  }
234 
235  if (actionOnRunEnd_){
236 
237  }
238 
239  init = true;
240 
241 
242  init =true;
243 
244 
245  //cout<<"...leaving SiPixelEDAClient::endLuminosityBlock. "<<endl;
246 }
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)
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.