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
HcalDetDiagPedestalMonitor Class Reference

#include <DQM/HcalDetDiagPedestalMonitor/src/HcalDetDiagPedestalMonitor.cc>

Inheritance diagram for HcalDetDiagPedestalMonitor:
HcalBaseDQMonitor edm::EDAnalyzer

Public Member Functions

 HcalDetDiagPedestalMonitor (const edm::ParameterSet &)
 
 ~HcalDetDiagPedestalMonitor ()
 
- Public Member Functions inherited from HcalBaseDQMonitor
 HcalBaseDQMonitor (const edm::ParameterSet &ps)
 
 HcalBaseDQMonitor ()
 
 ~HcalBaseDQMonitor ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
void beginRun (const edm::Run &run, const edm::EventSetup &c)
 
void CheckStatus ()
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
void endRun (const edm::Run &run, const edm::EventSetup &c)
 
void fillHistos ()
 
void LoadReference ()
 
void SaveReference ()
 

Private Attributes

int dataset_seq_number
 
const HcalElectronicsMapemap
 
HcalDetDiagPedestalData hb_data [85][72][4][4]
 
double HBMeanTreshold
 
double HBRmsTreshold
 
HcalDetDiagPedestalData he_data [85][72][4][4]
 
double HEMeanTreshold
 
double HERmsTreshold
 
HcalDetDiagPedestalData hf_data [85][72][4][4]
 
double HFMeanTreshold
 
double HFRmsTreshold
 
HcalDetDiagPedestalData ho_data [85][72][4][4]
 
double HOMeanTreshold
 
double HORmsTreshold
 
int ievt_
 
edm::InputTag inputLabelDigi_
 
edm::InputTag inputLabelRawData_
 
bool IsReference
 
bool LocalRun
 
MonitorElementmeEVT_
 
MonitorElementmeRUN_
 
bool Online_
 
std::string OutputFilePath
 
bool Overwrite
 
MonitorElementPedestals2DErrorHBHEHF
 
MonitorElementPedestals2DErrorHO
 
MonitorElementPedestals2DHBHEHF
 
MonitorElementPedestals2DHO
 
MonitorElementPedestals2DRmsHBHEHF
 
MonitorElementPedestals2DRmsHO
 
MonitorElementPedestalsAve4HB
 
MonitorElementPedestalsAve4HBref
 
MonitorElementPedestalsAve4HE
 
MonitorElementPedestalsAve4HEref
 
MonitorElementPedestalsAve4HF
 
MonitorElementPedestalsAve4HFref
 
MonitorElementPedestalsAve4HO
 
MonitorElementPedestalsAve4HOref
 
MonitorElementPedestalsAve4Simp
 
MonitorElementPedestalsRmsHB
 
MonitorElementPedestalsRmsHBref
 
MonitorElementPedestalsRmsHE
 
MonitorElementPedestalsRmsHEref
 
MonitorElementPedestalsRmsHF
 
MonitorElementPedestalsRmsHFref
 
MonitorElementPedestalsRmsHO
 
MonitorElementPedestalsRmsHOref
 
MonitorElementPedestalsRmsSimp
 
std::string prefixME_
 
EtaPhiHistsProblemCellsByDepth_badped
 
EtaPhiHistsProblemCellsByDepth_badped_val
 
EtaPhiHistsProblemCellsByDepth_badrms
 
EtaPhiHistsProblemCellsByDepth_badrms_val
 
EtaPhiHistsProblemCellsByDepth_missing
 
EtaPhiHistsProblemCellsByDepth_missing_val
 
EtaPhiHistsProblemCellsByDepth_unstable
 
EtaPhiHistsProblemCellsByDepth_unstable_val
 
std::vector< std::string > problemnames_
 
std::string ReferenceData
 
std::string ReferenceRun
 
MonitorElementRefRun_
 
int run_number
 
std::string XmlFilePath
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from HcalBaseDQMonitor
virtual void beginJob ()
 
virtual void cleanup (void)
 
virtual void endJob (void)
 
bool IsAllowedCalibType ()
 
bool LumiInOrder (int lumisec)
 
virtual void reset (void)
 
virtual void setup (void)
 
void SetupEtaPhiHists (EtaPhiHists &hh, std::string Name, std::string Units)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 
- Protected Attributes inherited from HcalBaseDQMonitor
std::vector< int > AllowedCalibTypes_
 
int badChannelStatusMask_
 
int currentLS
 
int currenttype_
 
DQMStoredbe_
 
int debug_
 
bool enableCleanup_
 
bool eventAllowed_
 
bool HBpresent_
 
bool HEpresent_
 
bool HFpresent_
 
bool HOpresent_
 
int ievt_
 
std::map< unsigned int, int > KnownBadCells_
 
int levt_
 
bool makeDiagnostics_
 
MonitorElementmeIevt_
 
MonitorElementmeLevt_
 
bool mergeRuns_
 
MonitorElementmeTevt_
 
MonitorElementmeTevtHist_
 
int NLumiBlocks_
 
bool Online_
 
std::string prefixME_
 
MonitorElementProblemsCurrentLB
 
MonitorElementProblemsVsLB
 
MonitorElementProblemsVsLB_HB
 
MonitorElementProblemsVsLB_HBHEHF
 
MonitorElementProblemsVsLB_HE
 
MonitorElementProblemsVsLB_HF
 
MonitorElementProblemsVsLB_HO
 
bool skipOutOfOrderLS_
 
std::string subdir_
 
int tevt_
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 125 of file HcalDetDiagPedestalMonitor.cc.

Constructor & Destructor Documentation

HcalDetDiagPedestalMonitor::HcalDetDiagPedestalMonitor ( const edm::ParameterSet iConfig)
explicit

Definition at line 218 of file HcalDetDiagPedestalMonitor.cc.

References dataset_seq_number, emap, edm::ParameterSet::getUntrackedParameter(), HBMeanTreshold, HBRmsTreshold, HEMeanTreshold, HERmsTreshold, HFMeanTreshold, HFRmsTreshold, HOMeanTreshold, HORmsTreshold, ievt_, inputLabelDigi_, inputLabelRawData_, IsReference, LocalRun, Online_, OutputFilePath, Overwrite, prefixME_, ReferenceData, run_number, HcalBaseDQMonitor::subdir_, and XmlFilePath.

218  {
219  ievt_=-1;
220  emap=0;
222  run_number=-1;
223  IsReference=false;
224  LocalRun=false;
225 
226  inputLabelDigi_ = iConfig.getUntrackedParameter<edm::InputTag>("digiLabel");
227  inputLabelRawData_ = iConfig.getUntrackedParameter<edm::InputTag>("rawDataLabel");
228  ReferenceData = iConfig.getUntrackedParameter<std::string>("PedestalReferenceData" ,"");
229  OutputFilePath = iConfig.getUntrackedParameter<std::string>("OutputFilePath", "");
230  XmlFilePath = iConfig.getUntrackedParameter<std::string>("XmlFilePath", "");
231  Online_ = iConfig.getUntrackedParameter<bool> ("online",false);
232  Overwrite = iConfig.getUntrackedParameter<bool> ("Overwrite",true);
233 
234  prefixME_ = iConfig.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
235  if (prefixME_.size()>0 && prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
236  prefixME_.append("/");
237  subdir_ = iConfig.getUntrackedParameter<std::string>("TaskFolder","DetDiagPedestalMonitor_Hcal/");
238  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
239  subdir_.append("/");
240  subdir_=prefixME_+subdir_;
241 
242  HBMeanTreshold = iConfig.getUntrackedParameter<double>("HBMeanPedestalTreshold" , 0.2);
243  HBRmsTreshold = iConfig.getUntrackedParameter<double>("HBRmsPedestalTreshold" , 0.3);
244  HEMeanTreshold = iConfig.getUntrackedParameter<double>("HEMeanPedestalTreshold" , 0.2);
245  HERmsTreshold = iConfig.getUntrackedParameter<double>("HERmsPedestalTreshold" , 0.3);
246  HOMeanTreshold = iConfig.getUntrackedParameter<double>("HOMeanPedestalTreshold" , 0.2);
247  HORmsTreshold = iConfig.getUntrackedParameter<double>("HORmsPedestalTreshold" , 0.3);
248  HFMeanTreshold = iConfig.getUntrackedParameter<double>("HFMeanPedestalTreshold" , 0.2);
249  HFRmsTreshold = iConfig.getUntrackedParameter<double>("HFRmsPedestalTreshold" , 0.3);
250 }
T getUntrackedParameter(std::string const &, T const &) const
HcalDetDiagPedestalMonitor::~HcalDetDiagPedestalMonitor ( )

Definition at line 251 of file HcalDetDiagPedestalMonitor.cc.

251 {}

Member Function Documentation

void HcalDetDiagPedestalMonitor::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 367 of file HcalDetDiagPedestalMonitor.cc.

References HcalDetDiagPedestalData::add_statistics(), HcalBaseDQMonitor::analyze(), diJetCalib::calibType, CheckStatus(), FEDRawData::data(), eta(), MonitorElement::Fill(), fillHistos(), edm::Event::getByLabel(), edm::Event::getByType(), hb_data, hc_Pedestal, HcalBarrel, HcalEndcap, he_data, hf_data, ho_data, i, edm::EventBase::id(), ievt_, inputLabelDigi_, inputLabelRawData_, edm::HandleBase::isValid(), j, gen::k, prof2calltree::l, LocalRun, FEDNumbering::MAXHCALFEDID, meEVT_, meRUN_, FEDNumbering::MINHCALFEDID, Online_, edm::EventBase::orbitNumber(), phi, HcalBaseDQMonitor::reset(), edm::EventID::run(), run_number, SaveReference(), FEDRawData::size(), and relativeConstraints::value.

367  {
368  HcalBaseDQMonitor::analyze(iEvent, iSetup); // increments counters
369 int eta,phi,depth,nTS;
370 static bool PEDseq;
371 static int lastPEDorbit,nChecksPED;
372  if(ievt_==-1){ ievt_=0; PEDseq=false; lastPEDorbit=-1;nChecksPED=0; }
373  int orbit=iEvent.orbitNumber();
374  meRUN_->Fill(iEvent.id().run());
375 
376  bool PedestalEvent=false;
377 
378  // for local runs
379  edm::Handle<HcalTBTriggerData> trigger_data;
380  iEvent.getByType(trigger_data);
381  if(trigger_data.isValid()){
382  if(trigger_data->triggerWord()==5) PedestalEvent=true;
383  LocalRun=true;
384  }
385  if(LocalRun && !PedestalEvent) return;
386 
387 
388  if(!LocalRun && Online_){
389  if(PEDseq && (orbit-lastPEDorbit)>(11223*10) && ievt_>500){
390  PEDseq=false;
391  fillHistos();
392  CheckStatus();
393  nChecksPED++;
394  if(nChecksPED==1 || (nChecksPED>1 && ((nChecksPED-1)%12)==0)){
395  SaveReference();
396  }
397  for(int i=0;i<85;i++)for(int j=0;j<72;j++)for(int k=0;k<4;k++)for(int l=0;l<4;l++) hb_data[i][j][k][l].reset();
398  for(int i=0;i<85;i++)for(int j=0;j<72;j++)for(int k=0;k<4;k++)for(int l=0;l<4;l++) he_data[i][j][k][l].reset();
399  for(int i=0;i<85;i++)for(int j=0;j<72;j++)for(int k=0;k<4;k++)for(int l=0;l<4;l++) ho_data[i][j][k][l].reset();
400  for(int i=0;i<85;i++)for(int j=0;j<72;j++)for(int k=0;k<4;k++)for(int l=0;l<4;l++) hf_data[i][j][k][l].reset();
401  ievt_=0;
402  }
403  }
404 
405 
406  // Abort Gap pedestals
407  int calibType = -1 ;
408  if(LocalRun==false){
410  iEvent.getByLabel(inputLabelRawData_,rawdata);
411  //checking FEDs for calibration information
413  const FEDRawData& fedData = rawdata->FEDData(i) ;
414  if ( fedData.size() < 24 ) continue ;
415  int value = ((const HcalDCCHeader*)(fedData.data()))->getCalibType() ;
416  if ( calibType < 0 ) calibType = value ;
417  if(value==hc_Pedestal){ PEDseq=true; lastPEDorbit=orbit; break;}
418  }
419  }
420  if(!LocalRun && calibType!=hc_Pedestal) return;
421 
422  ievt_++;
423  meEVT_->Fill(ievt_);
424  run_number=iEvent.id().run();
425 
427  iEvent.getByLabel(inputLabelDigi_,hbhe);
428  if(hbhe.isValid()){
429  if(hbhe->size()<30 && calibType==hc_Pedestal){
430  ievt_--;
431  meEVT_->Fill(ievt_);
432  return;
433  }
434  for(HBHEDigiCollection::const_iterator digi=hbhe->begin();digi!=hbhe->end();digi++){
435  eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
436  if(nTS>8) nTS=8;
437  if(nTS<8) continue;
438  if(digi->id().subdet()==HcalBarrel){
439  for(int i=0;i<nTS;i++) hb_data[eta+42][phi-1][depth-1][digi->sample(i).capid()].add_statistics(digi->sample(i).adc());
440  }
441  if(digi->id().subdet()==HcalEndcap){
442  for(int i=0;i<nTS;i++) he_data[eta+42][phi-1][depth-1][digi->sample(i).capid()].add_statistics(digi->sample(i).adc());
443  }
444  }
445  }
447  iEvent.getByLabel(inputLabelDigi_,ho);
448  if(ho.isValid()){
449  for(HODigiCollection::const_iterator digi=ho->begin();digi!=ho->end();digi++){
450  eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
451  if(nTS>8) nTS=8;
452  if(nTS<8) continue;
453  for(int i=0;i<nTS;i++) ho_data[eta+42][phi-1][depth-1][digi->sample(i).capid()].add_statistics(digi->sample(i).adc());
454  }
455  }
457  iEvent.getByLabel(inputLabelDigi_,hf);
458  if(hf.isValid()){
459  for(HFDigiCollection::const_iterator digi=hf->begin();digi!=hf->end();digi++){
460  eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
461  if(nTS>8) nTS=8;
462  if(nTS<8) continue;
463  for(int i=0;i<nTS;i++) hf_data[eta+42][phi-1][depth-1][digi->sample(i).capid()].add_statistics(digi->sample(i).adc());
464  }
465  }
466 }
RunNumber_t run() const
Definition: EventID.h:42
int i
Definition: DBlmapReader.cc:9
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
HcalDetDiagPedestalData ho_data[85][72][4][4]
tuple calibType
Definition: diJetCalib.py:20
std::vector< T >::const_iterator const_iterator
bool getByType(Handle< PROD > &result) const
Definition: Event.h:403
HcalDetDiagPedestalData he_data[85][72][4][4]
T eta() const
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
void Fill(long long x)
HcalDetDiagPedestalData hb_data[85][72][4][4]
int j
Definition: DBlmapReader.cc:9
int orbitNumber() const
Definition: EventBase.h:63
void add_statistics(unsigned int val)
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
int k[5][pyjets_maxn]
virtual void reset(void)
edm::EventID id() const
Definition: EventBase.h:56
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29
HcalDetDiagPedestalData hf_data[85][72][4][4]
Definition: DDAxes.h:10
void HcalDetDiagPedestalMonitor::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
privatevirtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 1152 of file HcalDetDiagPedestalMonitor.cc.

1152 {}
void HcalDetDiagPedestalMonitor::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
privatevirtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 253 of file HcalDetDiagPedestalMonitor.cc.

References DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookInt(), DQMStore::bookString(), HcalBaseDQMonitor::dbe_, EtaPhiHists::depth, emap, edm::EventSetup::get(), i, LoadReference(), meEVT_, meRUN_, AlCaRecoCosmics_cfg::name, Pedestals2DErrorHBHEHF, Pedestals2DErrorHO, Pedestals2DHBHEHF, Pedestals2DHO, Pedestals2DRmsHBHEHF, Pedestals2DRmsHO, PedestalsAve4HB, PedestalsAve4HBref, PedestalsAve4HE, PedestalsAve4HEref, PedestalsAve4HF, PedestalsAve4HFref, PedestalsAve4HO, PedestalsAve4HOref, PedestalsAve4Simp, PedestalsRmsHB, PedestalsRmsHBref, PedestalsRmsHE, PedestalsRmsHEref, PedestalsRmsHF, PedestalsRmsHFref, PedestalsRmsHO, PedestalsRmsHOref, PedestalsRmsSimp, ProblemCellsByDepth_badped, ProblemCellsByDepth_badped_val, ProblemCellsByDepth_badrms, ProblemCellsByDepth_badrms_val, ProblemCellsByDepth_missing, ProblemCellsByDepth_missing_val, ProblemCellsByDepth_unstable, ProblemCellsByDepth_unstable_val, problemnames_, ReferenceRun, RefRun_, MonitorElement::setAxisRange(), MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), EtaPhiHists::setup(), HcalBaseDQMonitor::setup(), and HcalBaseDQMonitor::subdir_.

253  {
254  edm::ESHandle<HcalDbService> conditions_;
255  c.get<HcalDbRecord>().get(conditions_);
256  emap=conditions_->getHcalMapping();
257 
259  if (!dbe_) return;
260  std::string name;
261 
263  meEVT_ = dbe_->bookInt("HcalDetDiagPedestalMonitor Event Number");
264  meRUN_ = dbe_->bookInt("HcalDetDiagPedestalMonitor Run Number");
265 
267  ProblemCellsByDepth_missing->setup(dbe_," Problem Missing Channels");
268  for(unsigned int i=0;i<ProblemCellsByDepth_missing->depth.size();i++)
269  problemnames_.push_back(ProblemCellsByDepth_missing->depth[i]->getName());
271  ProblemCellsByDepth_unstable->setup(dbe_," Problem Unstable Channels");
272  for(unsigned int i=0;i<ProblemCellsByDepth_unstable->depth.size();i++)
273  problemnames_.push_back(ProblemCellsByDepth_unstable->depth[i]->getName());
275  ProblemCellsByDepth_badped->setup(dbe_," Problem Bad Pedestal Value");
276  for(unsigned int i=0;i<ProblemCellsByDepth_badped->depth.size();i++)
277  problemnames_.push_back(ProblemCellsByDepth_badped->depth[i]->getName());
279  ProblemCellsByDepth_badrms->setup(dbe_," Problem Bad Rms Value");
280  for(unsigned int i=0;i<ProblemCellsByDepth_badrms->depth.size();i++)
281  problemnames_.push_back(ProblemCellsByDepth_badrms->depth[i]->getName());
282 
283  dbe_->setCurrentFolder(subdir_+"Summary Plots");
284  name="HB Pedestal Distribution (average over 4 caps)"; PedestalsAve4HB = dbe_->book1D(name,name,200,0,6);
285  name="HE Pedestal Distribution (average over 4 caps)"; PedestalsAve4HE = dbe_->book1D(name,name,200,0,6);
286  name="HO Pedestal Distribution (average over 4 caps)"; PedestalsAve4HO = dbe_->book1D(name,name,200,0,6);
287  name="HF Pedestal Distribution (average over 4 caps)"; PedestalsAve4HF = dbe_->book1D(name,name,200,0,6);
288  name="SIPM Pedestal Distribution (average over 4 caps)"; PedestalsAve4Simp = dbe_->book1D(name,name,200,5,15);
289 
290  name="HB Pedestal-Reference Distribution (average over 4 caps)"; PedestalsAve4HBref= dbe_->book1D(name,name,1500,-3,3);
291  name="HE Pedestal-Reference Distribution (average over 4 caps)"; PedestalsAve4HEref= dbe_->book1D(name,name,1500,-3,3);
292  name="HO Pedestal-Reference Distribution (average over 4 caps)"; PedestalsAve4HOref= dbe_->book1D(name,name,1500,-3,3);
293  name="HF Pedestal-Reference Distribution (average over 4 caps)"; PedestalsAve4HFref= dbe_->book1D(name,name,1500,-3,3);
294 
295  name="HB Pedestal RMS Distribution (individual cap)"; PedestalsRmsHB = dbe_->book1D(name,name,200,0,2);
296  name="HE Pedestal RMS Distribution (individual cap)"; PedestalsRmsHE = dbe_->book1D(name,name,200,0,2);
297  name="HO Pedestal RMS Distribution (individual cap)"; PedestalsRmsHO = dbe_->book1D(name,name,200,0,2);
298  name="HF Pedestal RMS Distribution (individual cap)"; PedestalsRmsHF = dbe_->book1D(name,name,200,0,2);
299  name="SIPM Pedestal RMS Distribution (individual cap)"; PedestalsRmsSimp = dbe_->book1D(name,name,200,0,4);
300 
301  name="HB Pedestal_rms-Reference_rms Distribution"; PedestalsRmsHBref = dbe_->book1D(name,name,1500,-3,3);
302  name="HE Pedestal_rms-Reference_rms Distribution"; PedestalsRmsHEref = dbe_->book1D(name,name,1500,-3,3);
303  name="HO Pedestal_rms-Reference_rms Distribution"; PedestalsRmsHOref = dbe_->book1D(name,name,1500,-3,3);
304  name="HF Pedestal_rms-Reference_rms Distribution"; PedestalsRmsHFref = dbe_->book1D(name,name,1500,-3,3);
305 
306  name="HBHEHF pedestal mean map"; Pedestals2DHBHEHF = dbe_->book2D(name,name,87,-43,43,74,0,73);
307  name="HO pedestal mean map"; Pedestals2DHO = dbe_->book2D(name,name,33,-16,16,74,0,73);
308  name="HBHEHF pedestal rms map"; Pedestals2DRmsHBHEHF = dbe_->book2D(name,name,87,-43,43,74,0,73);
309  name="HO pedestal rms map"; Pedestals2DRmsHO = dbe_->book2D(name,name,33,-16,16,74,0,73);
310  name="HBHEHF pedestal problems map"; Pedestals2DErrorHBHEHF = dbe_->book2D(name,name,87,-43,43,74,0,73);
311  name="HO pedestal problems map"; Pedestals2DErrorHO = dbe_->book2D(name,name,33,-16,16,74,0,73);
312 
314  Pedestals2DHO->setAxisRange(1,5,3);
317 
318  Pedestals2DHBHEHF->setAxisTitle("i#eta",1);
319  Pedestals2DHBHEHF->setAxisTitle("i#phi",2);
320  Pedestals2DHO->setAxisTitle("i#eta",1);
321  Pedestals2DHO->setAxisTitle("i#phi",2);
324  Pedestals2DRmsHO->setAxisTitle("i#eta",1);
325  Pedestals2DRmsHO->setAxisTitle("i#phi",2);
328  Pedestals2DErrorHO->setAxisTitle("i#eta",1);
329  Pedestals2DErrorHO->setAxisTitle("i#phi",2);
330  PedestalsAve4HB->setAxisTitle("ADC counts",1);
331  PedestalsAve4HE->setAxisTitle("ADC counts",1);
332  PedestalsAve4HO->setAxisTitle("ADC counts",1);
333  PedestalsAve4HF->setAxisTitle("ADC counts",1);
334  PedestalsAve4Simp->setAxisTitle("ADC counts",1);
335  PedestalsAve4HBref->setAxisTitle("ADC counts",1);
336  PedestalsAve4HEref->setAxisTitle("ADC counts",1);
337  PedestalsAve4HOref->setAxisTitle("ADC counts",1);
338  PedestalsAve4HFref->setAxisTitle("ADC counts",1);
339  PedestalsRmsHB->setAxisTitle("ADC counts",1);
340  PedestalsRmsHE->setAxisTitle("ADC counts",1);
341  PedestalsRmsHO->setAxisTitle("ADC counts",1);
342  PedestalsRmsHF->setAxisTitle("ADC counts",1);
343  PedestalsRmsSimp->setAxisTitle("ADC counts",1);
344  PedestalsRmsHBref->setAxisTitle("ADC counts",1);
345  PedestalsRmsHEref->setAxisTitle("ADC counts",1);
346  PedestalsRmsHOref->setAxisTitle("ADC counts",1);
347  PedestalsRmsHFref->setAxisTitle("ADC counts",1);
348 
349  ReferenceRun="UNKNOWN";
350  LoadReference();
352  RefRun_= dbe_->bookString("HcalDetDiagLaserMonitor Reference Run",ReferenceRun);
353 
354  dbe_->setCurrentFolder(subdir_+"Plots for client");
356  ProblemCellsByDepth_missing_val->setup(dbe_," Missing channels");
358  ProblemCellsByDepth_unstable_val->setup(dbe_," Channel instability value");
360  ProblemCellsByDepth_badped_val->setup(dbe_," Bad Pedestal-Ref Value");
362  ProblemCellsByDepth_badrms_val->setup(dbe_," Bad Rms-ref Value");
363 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:519
void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
std::vector< std::string > problemnames_
void setup(DQMStore *&m_dbe, std::string Name, std::string Units="")
std::vector< MonitorElement * > depth
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:485
const T & get() const
Definition: EventSetup.h:55
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:426
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:647
virtual void setup(void)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
void HcalDetDiagPedestalMonitor::CheckStatus ( )
private

Definition at line 576 of file HcalDetDiagPedestalMonitor.cc.

References HcalElectronicsMap::allElectronicsIdPrecision(), CalcEtaBin(), HcalDetDiagPedestalData::change_status(), HcalDetId::depth(), EtaPhiHists::depth, DetId::det(), cond::rpcobgas::detid, ExpressReco_HICollisions_FallBack::e, emap, eta(), MonitorElement::Fill(), HcalDetDiagPedestalData::get_average(), HcalDetDiagPedestalData::get_overflow(), HcalDetDiagPedestalData::get_reference(), HcalDetDiagPedestalData::get_statistics(), hb_data, HBMeanTreshold, HBRmsTreshold, DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, HcalOuter, he_data, HEMeanTreshold, HERmsTreshold, hf_data, HFMeanTreshold, HFRmsTreshold, ho_data, HOMeanTreshold, HORmsTreshold, i, HcalDetId::ieta(), ievt_, HcalDetId::iphi(), HcalElectronicsMap::lookup(), HcalDetDiagPedestalData::nBadPed, HcalDetDiagPedestalData::nBadRms, HcalDetDiagPedestalData::nChecks, HcalDetDiagPedestalData::nMissing, HcalDetDiagPedestalData::nUnstable, Pedestals2DErrorHBHEHF, Pedestals2DErrorHO, PedestalsAve4HBref, PedestalsAve4HEref, PedestalsAve4HFref, PedestalsAve4HOref, PedestalsRmsHBref, PedestalsRmsHEref, PedestalsRmsHFref, PedestalsRmsHOref, phi, ProblemCellsByDepth_badped, ProblemCellsByDepth_badped_val, ProblemCellsByDepth_badrms, ProblemCellsByDepth_badrms_val, ProblemCellsByDepth_missing, ProblemCellsByDepth_missing_val, ProblemCellsByDepth_unstable, ProblemCellsByDepth_unstable_val, MonitorElement::Reset(), plotscripts::rms(), ntuplemaker::status, DetId::subdetId(), and tmp.

Referenced by analyze(), and endRun().

576  {
577  for(int i=0;i<4;i++){
582  }
591 
594 
595  if(emap==0) return;
596 
597  std::vector <HcalElectronicsId> AllElIds = emap->allElectronicsIdPrecision();
598  for (std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++) {
599  DetId detid=emap->lookup(*eid);
600  if (detid.det()!=DetId::Hcal) continue;
601  HcalGenericDetId gid(emap->lookup(*eid));
602  if (gid.null())
603  continue;
604  if (gid.genericSubdet()!=HcalGenericDetId::HcalGenBarrel &&
605  gid.genericSubdet()!=HcalGenericDetId::HcalGenEndcap &&
606  gid.genericSubdet()!=HcalGenericDetId::HcalGenForward &&
607  gid.genericSubdet()!=HcalGenericDetId::HcalGenOuter)
608  continue;
609 
610  int eta=0,phi=0,depth=0;
611 
612  HcalDetId hid(detid);
613  eta=hid.ieta();
614  phi=hid.iphi();
615  depth=hid.depth();
616 
617  int sd=detid.subdetId();
618  if(sd==HcalBarrel){
619  int ovf=hb_data[eta+42][phi-1][depth-1][0].get_overflow();
620  int stat=hb_data[eta+42][phi-1][depth-1][0].get_statistics()+ovf;
621  double status=0;
622  double ped[4],rms[4],ped_ref[4],rms_ref[4];
623  hb_data[eta+42][phi-1][depth-1][0].nChecks++;
624  if(stat==0){
625  status=1;
626  int e=CalcEtaBin(sd,eta,depth)+1;
627  hb_data[eta+42][phi-1][depth-1][0].nMissing++;
628  double val=hb_data[eta+42][phi-1][depth-1][0].nMissing/hb_data[eta+42][phi-1][depth-1][0].nChecks;
629  ProblemCellsByDepth_missing->depth[depth-1]->setBinContent(e,phi,val);
630  ProblemCellsByDepth_missing_val->depth[depth-1]->setBinContent(e,phi,1);
631  }
632  if(status) hb_data[eta+42][phi-1][depth-1][0].change_status(1);
633  if(stat>0 && stat!=(ievt_*2)){ status=(double)stat/(double)(ievt_*2);
634  if(status<0.995){
635  int e=CalcEtaBin(sd,eta,depth)+1;
636  hb_data[eta+42][phi-1][depth-1][0].nUnstable++;
637  double val=hb_data[eta+42][phi-1][depth-1][0].nUnstable/hb_data[eta+42][phi-1][depth-1][0].nChecks;
638  ProblemCellsByDepth_unstable->depth[depth-1]->setBinContent(e,phi,val);
639  ProblemCellsByDepth_unstable_val->depth[depth-1]->setBinContent(e,phi,status);
640  hb_data[eta+42][phi-1][depth-1][0].change_status(2);
641  }
642  }
643  if(hb_data[eta+42][phi-1][depth-1][0].get_reference(&ped_ref[0],&rms_ref[0])
644  && hb_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0])){
645  hb_data[eta+42][phi-1][depth-1][1].get_reference(&ped_ref[1],&rms_ref[1]);
646  hb_data[eta+42][phi-1][depth-1][2].get_reference(&ped_ref[2],&rms_ref[2]);
647  hb_data[eta+42][phi-1][depth-1][3].get_reference(&ped_ref[3],&rms_ref[3]);
648  hb_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
649  hb_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
650  hb_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
651  double ave=(ped[0]+ped[1]+ped[2]+ped[3])/4.0;
652  double ave_ref=(ped_ref[0]+ped_ref[1]+ped_ref[2]+ped_ref[3])/4.0;
653  double deltaPed=ave-ave_ref; PedestalsAve4HBref->Fill(deltaPed); if(deltaPed<0) deltaPed=-deltaPed;
654  double deltaRms=rms[0]-rms_ref[0]; PedestalsRmsHBref->Fill(deltaRms); if(deltaRms<0) deltaRms=-deltaRms;
655  for(int i=1;i<4;i++){
656  double tmp=rms[i]-rms_ref[i]; PedestalsRmsHBref->Fill(tmp);
657  if(fabs(tmp)>fabs(deltaRms)) deltaRms=tmp;
658  }
659  if(deltaPed>HBMeanTreshold){
660  int e=CalcEtaBin(sd,eta,depth)+1;
661  hb_data[eta+42][phi-1][depth-1][0].nBadPed++;
662  double val=hb_data[eta+42][phi-1][depth-1][0].nBadPed/hb_data[eta+42][phi-1][depth-1][0].nChecks;
663  ProblemCellsByDepth_badped_val->depth[depth-1]->setBinContent(e,phi,ave-ave_ref);
664  ProblemCellsByDepth_badped->depth[depth-1]->setBinContent(e,phi,val);
666  }
667  if(deltaRms>HBRmsTreshold){
668  int e=CalcEtaBin(sd,eta,depth)+1;
669  hb_data[eta+42][phi-1][depth-1][0].nBadRms++;
670  double val=hb_data[eta+42][phi-1][depth-1][0].nBadRms/hb_data[eta+42][phi-1][depth-1][0].nChecks;
671  ProblemCellsByDepth_badrms->depth[depth-1]->setBinContent(e,phi,val);
672  ProblemCellsByDepth_badrms_val->depth[depth-1]->setBinContent(e,phi,deltaRms);
674  }
675  }
676  }
677  if(sd==HcalEndcap){
678  int ovf=he_data[eta+42][phi-1][depth-1][0].get_overflow();
679  int stat=he_data[eta+42][phi-1][depth-1][0].get_statistics()+ovf;
680  double status=0;
681  double ped[4],rms[4],ped_ref[4],rms_ref[4];
682  he_data[eta+42][phi-1][depth-1][0].nChecks++;
683  if(stat==0){
684  status=1;
685  int e=CalcEtaBin(sd,eta,depth)+1;
686  he_data[eta+42][phi-1][depth-1][0].nMissing++;
687  double val=he_data[eta+42][phi-1][depth-1][0].nMissing/he_data[eta+42][phi-1][depth-1][0].nChecks;
688  ProblemCellsByDepth_missing->depth[depth-1]->setBinContent(e,phi,val);
689  ProblemCellsByDepth_missing_val->depth[depth-1]->setBinContent(e,phi,1);
690  }
691  if(status) he_data[eta+42][phi-1][depth-1][0].change_status(1);
692  if(stat>0 && stat!=(ievt_*2)){ status=(double)stat/(double)(ievt_*2);
693  if(status<0.995){
694  int e=CalcEtaBin(sd,eta,depth)+1;
695  he_data[eta+42][phi-1][depth-1][0].nUnstable++;
696  double val=he_data[eta+42][phi-1][depth-1][0].nUnstable/he_data[eta+42][phi-1][depth-1][0].nChecks;
697  ProblemCellsByDepth_unstable->depth[depth-1]->setBinContent(e,phi,val);
698  ProblemCellsByDepth_unstable_val->depth[depth-1]->setBinContent(e,phi,status);
699  he_data[eta+42][phi-1][depth-1][0].change_status(2);
700  }
701  }
702  if(he_data[eta+42][phi-1][depth-1][0].get_reference(&ped_ref[0],&rms_ref[0])
703  && he_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0])){
704  he_data[eta+42][phi-1][depth-1][1].get_reference(&ped_ref[1],&rms_ref[1]);
705  he_data[eta+42][phi-1][depth-1][2].get_reference(&ped_ref[2],&rms_ref[2]);
706  he_data[eta+42][phi-1][depth-1][3].get_reference(&ped_ref[3],&rms_ref[3]);
707  he_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
708  he_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
709  he_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
710  double ave=(ped[0]+ped[1]+ped[2]+ped[3])/4.0;
711  double ave_ref=(ped_ref[0]+ped_ref[1]+ped_ref[2]+ped_ref[3])/4.0;
712  double deltaPed=ave-ave_ref; PedestalsAve4HEref->Fill(deltaPed); if(deltaPed<0) deltaPed=-deltaPed;
713  double deltaRms=rms[0]-rms_ref[0]; PedestalsRmsHEref->Fill(deltaRms); if(deltaRms<0) deltaRms=-deltaRms;
714  for(int i=1;i<4;i++){
715  double tmp=rms[i]-rms_ref[i]; PedestalsRmsHEref->Fill(tmp);
716  if(fabs(tmp)>fabs(deltaRms)) deltaRms=tmp;
717  }
718  if(deltaPed>HEMeanTreshold){
719  int e=CalcEtaBin(sd,eta,depth)+1;
720  he_data[eta+42][phi-1][depth-1][0].nBadPed++;
721  double val=he_data[eta+42][phi-1][depth-1][0].nBadPed/he_data[eta+42][phi-1][depth-1][0].nChecks;
722  ProblemCellsByDepth_badped->depth[depth-1]->setBinContent(e,phi,val);
723  ProblemCellsByDepth_badped_val->depth[depth-1]->setBinContent(e,phi,ave-ave_ref);
725  }
726  if(deltaRms>HERmsTreshold){
727  int e=CalcEtaBin(sd,eta,depth)+1;
728  he_data[eta+42][phi-1][depth-1][0].nBadRms++;
729  double val=he_data[eta+42][phi-1][depth-1][0].nBadRms/he_data[eta+42][phi-1][depth-1][0].nChecks;
730  ProblemCellsByDepth_badrms->depth[depth-1]->setBinContent(e,phi,val);
731  ProblemCellsByDepth_badrms_val->depth[depth-1]->setBinContent(e,phi,deltaRms);
733  }
734  }
735  }
736  if(sd==HcalOuter){
737  int ovf=ho_data[eta+42][phi-1][depth-1][0].get_overflow();
738  int stat=ho_data[eta+42][phi-1][depth-1][0].get_statistics()+ovf;
739  double status=0;
740  double ped[4],rms[4],ped_ref[4],rms_ref[4];
741  ho_data[eta+42][phi-1][depth-1][0].nChecks++;
742  if(stat==0){
743  status=1;
744  int e=CalcEtaBin(sd,eta,depth)+1;
745  ho_data[eta+42][phi-1][depth-1][0].nMissing++;
746  double val=ho_data[eta+42][phi-1][depth-1][0].nMissing/ho_data[eta+42][phi-1][depth-1][0].nChecks;
747  ProblemCellsByDepth_missing->depth[depth-1]->setBinContent(e,phi,val);
748  ProblemCellsByDepth_missing_val->depth[depth-1]->setBinContent(e,phi,1);
749  }
750  if(status) ho_data[eta+42][phi-1][depth-1][0].change_status(1);
751  if(stat>0 && stat!=(ievt_*2)){ status=(double)stat/(double)(ievt_*2);
752  if(status<0.995){
753  int e=CalcEtaBin(sd,eta,depth)+1;
754  ho_data[eta+42][phi-1][depth-1][0].nUnstable++;
755  double val=ho_data[eta+42][phi-1][depth-1][0].nUnstable/ho_data[eta+42][phi-1][depth-1][0].nChecks;
756  ProblemCellsByDepth_unstable->depth[depth-1]->setBinContent(e,phi,val);
757  ProblemCellsByDepth_unstable_val->depth[depth-1]->setBinContent(e,phi,status);
758  ho_data[eta+42][phi-1][depth-1][0].change_status(2);
759  }
760  }
761  if(ho_data[eta+42][phi-1][depth-1][0].get_reference(&ped_ref[0],&rms_ref[0])
762  && ho_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0])){
763  ho_data[eta+42][phi-1][depth-1][1].get_reference(&ped_ref[1],&rms_ref[1]);
764  ho_data[eta+42][phi-1][depth-1][2].get_reference(&ped_ref[2],&rms_ref[2]);
765  ho_data[eta+42][phi-1][depth-1][3].get_reference(&ped_ref[3],&rms_ref[3]);
766  ho_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
767  ho_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
768  ho_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
769 
770  double THRESTHOLD=HORmsTreshold;
771  if((eta>=11 && eta<=15 && phi>=59 && phi<=70) || (eta>=5 && eta<=10 && phi>=47 && phi<=58))THRESTHOLD*=2;
772  double ave=(ped[0]+ped[1]+ped[2]+ped[3])/4.0;
773  double ave_ref=(ped_ref[0]+ped_ref[1]+ped_ref[2]+ped_ref[3])/4.0;
774  double deltaPed=ave-ave_ref; PedestalsAve4HOref->Fill(deltaPed);if(deltaPed<0) deltaPed=-deltaPed;
775  double deltaRms=rms[0]-rms_ref[0]; PedestalsRmsHOref->Fill(deltaRms); if(deltaRms<0) deltaRms=-deltaRms;
776  for(int i=1;i<4;i++){
777  double tmp=rms[i]-rms_ref[i]; PedestalsRmsHOref->Fill(tmp);
778  if(fabs(tmp)>fabs(deltaRms)) deltaRms=tmp;
779  }
780  if(deltaPed>HOMeanTreshold){
781  int e=CalcEtaBin(sd,eta,depth)+1;
782  ho_data[eta+42][phi-1][depth-1][0].nBadPed++;
783  double val=ho_data[eta+42][phi-1][depth-1][0].nBadPed/ho_data[eta+42][phi-1][depth-1][0].nChecks;
784  ProblemCellsByDepth_badped->depth[depth-1]->setBinContent(e,phi,val);
785  ProblemCellsByDepth_badped_val->depth[depth-1]->setBinContent(e,phi,ave-ave_ref);
786  Pedestals2DErrorHO->Fill(eta,phi,1);
787  }
788  if(deltaRms>THRESTHOLD){
789  int e=CalcEtaBin(sd,eta,depth)+1;
790  ho_data[eta+42][phi-1][depth-1][0].nBadRms++;
791  double val=ho_data[eta+42][phi-1][depth-1][0].nBadRms/ho_data[eta+42][phi-1][depth-1][0].nChecks;
792  ProblemCellsByDepth_badrms->depth[depth-1]->setBinContent(e,phi,val);
793  ProblemCellsByDepth_badrms_val->depth[depth-1]->setBinContent(e,phi,deltaRms);
794  Pedestals2DErrorHO->Fill(eta,phi,1);
795  }
796  }
797  }
798  if(sd==HcalForward){
799  int ovf=hf_data[eta+42][phi-1][depth-1][0].get_overflow();
800  int stat=hf_data[eta+42][phi-1][depth-1][0].get_statistics()+ovf;
801  double status=0;
802  double ped[4],rms[4],ped_ref[4],rms_ref[4];
803  hf_data[eta+42][phi-1][depth-1][0].nChecks++;
804  if(stat==0){
805  status=1;
806  int e=CalcEtaBin(sd,eta,depth)+1;
807  hf_data[eta+42][phi-1][depth-1][0].nMissing++;
808  double val=hf_data[eta+42][phi-1][depth-1][0].nMissing/hf_data[eta+42][phi-1][depth-1][0].nChecks;
809  ProblemCellsByDepth_missing->depth[depth-1]->setBinContent(e,phi,val);
810  ProblemCellsByDepth_missing_val->depth[depth-1]->setBinContent(e,phi,1);
811  }
812  if(status) hf_data[eta+42][phi-1][depth-1][0].change_status(1);
813  if(stat>0 && stat!=(ievt_*2)){ status=(double)stat/(double)(ievt_*2);
814  if(status<0.995){
815  int e=CalcEtaBin(sd,eta,depth)+1;
816  hf_data[eta+42][phi-1][depth-1][0].nUnstable++;
817  double val=hf_data[eta+42][phi-1][depth-1][0].nUnstable/hf_data[eta+42][phi-1][depth-1][0].nChecks;
818  ProblemCellsByDepth_unstable->depth[depth-1]->setBinContent(e,phi,val);
819  ProblemCellsByDepth_unstable_val->depth[depth-1]->setBinContent(e,phi,status);
820  hf_data[eta+42][phi-1][depth-1][0].change_status(2);
821  }
822  }
823  if(hf_data[eta+42][phi-1][depth-1][0].get_reference(&ped_ref[0],&rms_ref[0])
824  && hf_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0])){
825  hf_data[eta+42][phi-1][depth-1][1].get_reference(&ped_ref[1],&rms_ref[1]);
826  hf_data[eta+42][phi-1][depth-1][2].get_reference(&ped_ref[2],&rms_ref[2]);
827  hf_data[eta+42][phi-1][depth-1][3].get_reference(&ped_ref[3],&rms_ref[3]);
828  hf_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
829  hf_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
830  hf_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
831  double ave=(ped[0]+ped[1]+ped[2]+ped[3])/4.0;
832  double ave_ref=(ped_ref[0]+ped_ref[1]+ped_ref[2]+ped_ref[3])/4.0;
833  double deltaPed=ave-ave_ref; PedestalsAve4HFref->Fill(deltaPed); if(deltaPed<0) deltaPed=-deltaPed;
834  double deltaRms=rms[0]-rms_ref[0]; PedestalsRmsHFref->Fill(deltaRms); if(deltaRms<0) deltaRms=-deltaRms;
835  for(int i=1;i<4;i++){
836  double tmp=rms[i]-rms_ref[i]; PedestalsRmsHFref->Fill(tmp);
837  if(fabs(tmp)>fabs(deltaRms)) deltaRms=tmp;
838  }
839  if(deltaPed>HFMeanTreshold){
840  int e=CalcEtaBin(sd,eta,depth)+1;
841  hf_data[eta+42][phi-1][depth-1][0].nBadPed++;
842  double val=hf_data[eta+42][phi-1][depth-1][0].nBadPed/hf_data[eta+42][phi-1][depth-1][0].nChecks;
843  ProblemCellsByDepth_badped->depth[depth-1]->setBinContent(e,phi,val);
844  ProblemCellsByDepth_badped_val->depth[depth-1]->setBinContent(e,phi,ave-ave_ref);
846  }
847  if(deltaRms>HFRmsTreshold){
848  int e=CalcEtaBin(sd,eta,depth)+1;
849  hf_data[eta+42][phi-1][depth-1][0].nBadRms++;
850  double val=hf_data[eta+42][phi-1][depth-1][0].nBadRms/hf_data[eta+42][phi-1][depth-1][0].nChecks;
851  ProblemCellsByDepth_badrms->depth[depth-1]->setBinContent(e,phi,val);
852  ProblemCellsByDepth_badrms_val->depth[depth-1]->setBinContent(e,phi,deltaRms);
854  }
855  }
856  }
857  }
858 }
int i
Definition: DBlmapReader.cc:9
std::vector< HcalElectronicsId > allElectronicsIdPrecision() const
HcalDetDiagPedestalData ho_data[85][72][4][4]
HcalDetDiagPedestalData he_data[85][72][4][4]
bool get_average(double *ave, double *rms)
T eta() const
void Fill(long long x)
bool get_reference(double *val, double *rms)
std::vector< MonitorElement * > depth
HcalDetDiagPedestalData hb_data[85][72][4][4]
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
Definition: DetId.h:20
int CalcEtaBin(int subdet, int ieta, int depth)
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
tuple status
Definition: ntuplemaker.py:245
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
void Reset(void)
reset ME (ie. contents, errors, etc)
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
HcalDetDiagPedestalData hf_data[85][72][4][4]
Definition: DDAxes.h:10
void HcalDetDiagPedestalMonitor::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
privatevirtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 1153 of file HcalDetDiagPedestalMonitor.cc.

1153 {}
void HcalDetDiagPedestalMonitor::endRun ( const edm::Run run,
const edm::EventSetup c 
)
privatevirtual
void HcalDetDiagPedestalMonitor::fillHistos ( )
private

Definition at line 468 of file HcalDetDiagPedestalMonitor.cc.

References abs, eta(), MonitorElement::Fill(), HcalDetDiagPedestalData::get_average(), hb_data, he_data, hf_data, ho_data, Pedestals2DHBHEHF, Pedestals2DHO, Pedestals2DRmsHBHEHF, Pedestals2DRmsHO, PedestalsAve4HB, PedestalsAve4HE, PedestalsAve4HF, PedestalsAve4HO, PedestalsAve4Simp, PedestalsRmsHB, PedestalsRmsHE, PedestalsRmsHF, PedestalsRmsHO, PedestalsRmsSimp, phi, MonitorElement::Reset(), and plotscripts::rms().

Referenced by analyze(), and endRun().

468  {
482  Pedestals2DHO->Reset();
483  // HBHEHF summary map
484  for(int eta=-42;eta<=42;eta++) for(int phi=1;phi<=72;phi++){
485  double PED=0,RMS=0,nped=0,nrms=0,ave=0,rms=0;
486  for(int depth=1;depth<=3;depth++){
487  if(hb_data[eta+42][phi-1][depth-1][0].get_statistics()>100){
488  hb_data[eta+42][phi-1][depth-1][0].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
489  hb_data[eta+42][phi-1][depth-1][1].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
490  hb_data[eta+42][phi-1][depth-1][2].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
491  hb_data[eta+42][phi-1][depth-1][3].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
492  }
493  if(he_data[eta+42][phi-1][depth-1][0].get_statistics()>100){
494  he_data[eta+42][phi-1][depth-1][0].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
495  he_data[eta+42][phi-1][depth-1][1].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
496  he_data[eta+42][phi-1][depth-1][2].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
497  he_data[eta+42][phi-1][depth-1][3].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
498  }
499  if(hf_data[eta+42][phi-1][depth-1][0].get_statistics()>100){
500  hf_data[eta+42][phi-1][depth-1][0].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
501  hf_data[eta+42][phi-1][depth-1][1].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
502  hf_data[eta+42][phi-1][depth-1][2].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
503  hf_data[eta+42][phi-1][depth-1][3].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
504  }
505  }
506  if(nped>0) Pedestals2DHBHEHF->Fill(eta,phi,PED/nped);
507  if(nrms>0) Pedestals2DRmsHBHEHF->Fill(eta,phi,RMS/nrms);
508  if(nped>0 && abs(eta)>20) Pedestals2DHBHEHF->Fill(eta,phi+1,PED/nped);
509  if(nrms>0 && abs(eta)>20) Pedestals2DRmsHBHEHF->Fill(eta,phi+1,RMS/nrms);
510  }
511  // HO summary map
512  for(int eta=-42;eta<=42;eta++) for(int phi=1;phi<=72;phi++){
513  double PED=0,RMS=0,nped=0,nrms=0,ave,rms;
514  if(ho_data[eta+42][phi-1][4-1][0].get_statistics()>100){
515  ho_data[eta+42][phi-1][4-1][0].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
516  ho_data[eta+42][phi-1][4-1][1].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
517  ho_data[eta+42][phi-1][4-1][2].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
518  ho_data[eta+42][phi-1][4-1][3].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
519  }
520  if(nped>0) Pedestals2DHO->Fill(eta,phi,PED/nped);
521  if(nrms>0) Pedestals2DRmsHO->Fill(eta,phi,RMS/nrms);
522  }
523  // HB histograms
524  for(int eta=-16;eta<=16;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
525  if(hb_data[eta+42][phi-1][depth-1][0].get_statistics()>100){
526  double ave,rms,sum=0;
527  hb_data[eta+42][phi-1][depth-1][0].get_average(&ave,&rms); sum+=ave; PedestalsRmsHB->Fill(rms);
528  hb_data[eta+42][phi-1][depth-1][1].get_average(&ave,&rms); sum+=ave; PedestalsRmsHB->Fill(rms);
529  hb_data[eta+42][phi-1][depth-1][2].get_average(&ave,&rms); sum+=ave; PedestalsRmsHB->Fill(rms);
530  hb_data[eta+42][phi-1][depth-1][3].get_average(&ave,&rms); sum+=ave; PedestalsRmsHB->Fill(rms);
531  PedestalsAve4HB->Fill(sum/4.0);
532  }
533  }
534  // HE histograms
535  for(int eta=-29;eta<=29;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=3;depth++){
536  if(he_data[eta+42][phi-1][depth-1][0].get_statistics()>100){
537  double ave=0,rms=0,sum=0;
538  he_data[eta+42][phi-1][depth-1][0].get_average(&ave,&rms); sum+=ave; PedestalsRmsHE->Fill(rms);
539  he_data[eta+42][phi-1][depth-1][1].get_average(&ave,&rms); sum+=ave; PedestalsRmsHE->Fill(rms);
540  he_data[eta+42][phi-1][depth-1][2].get_average(&ave,&rms); sum+=ave; PedestalsRmsHE->Fill(rms);
541  he_data[eta+42][phi-1][depth-1][3].get_average(&ave,&rms); sum+=ave; PedestalsRmsHE->Fill(rms);
542  PedestalsAve4HE->Fill(sum/4.0);
543  }
544  }
545  // HO histograms
546  for(int eta=-15;eta<=15;eta++) for(int phi=1;phi<=72;phi++) for(int depth=4;depth<=4;depth++){
547  if(ho_data[eta+42][phi-1][depth-1][0].get_statistics()>100){
548  double ave,rms,sum=0;
549  if((eta>=11 && eta<=15 && phi>=59 && phi<=70) || (eta>=5 && eta<=10 && phi>=47 && phi<=58)){
550  ho_data[eta+42][phi-1][depth-1][0].get_average(&ave,&rms); sum+=ave; PedestalsRmsSimp->Fill(rms);
551  ho_data[eta+42][phi-1][depth-1][1].get_average(&ave,&rms); sum+=ave; PedestalsRmsSimp->Fill(rms);
552  ho_data[eta+42][phi-1][depth-1][2].get_average(&ave,&rms); sum+=ave; PedestalsRmsSimp->Fill(rms);
553  ho_data[eta+42][phi-1][depth-1][3].get_average(&ave,&rms); sum+=ave; PedestalsRmsSimp->Fill(rms);
554  PedestalsAve4Simp->Fill(sum/4.0);
555  }else{
556  ho_data[eta+42][phi-1][depth-1][0].get_average(&ave,&rms); sum+=ave; PedestalsRmsHO->Fill(rms);
557  ho_data[eta+42][phi-1][depth-1][1].get_average(&ave,&rms); sum+=ave; PedestalsRmsHO->Fill(rms);
558  ho_data[eta+42][phi-1][depth-1][2].get_average(&ave,&rms); sum+=ave; PedestalsRmsHO->Fill(rms);
559  ho_data[eta+42][phi-1][depth-1][3].get_average(&ave,&rms); sum+=ave; PedestalsRmsHO->Fill(rms);
560  PedestalsAve4HO->Fill(sum/4.0);
561  }
562  }
563  }
564  // HF histograms
565  for(int eta=-42;eta<=42;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
566  if(hf_data[eta+42][phi-1][depth-1][0].get_statistics()>100){
567  double ave,rms,sum=0;
568  hf_data[eta+42][phi-1][depth-1][0].get_average(&ave,&rms); sum+=ave; PedestalsRmsHF->Fill(rms);
569  hf_data[eta+42][phi-1][depth-1][1].get_average(&ave,&rms); sum+=ave; PedestalsRmsHF->Fill(rms);
570  hf_data[eta+42][phi-1][depth-1][2].get_average(&ave,&rms); sum+=ave; PedestalsRmsHF->Fill(rms);
571  hf_data[eta+42][phi-1][depth-1][3].get_average(&ave,&rms); sum+=ave; PedestalsRmsHF->Fill(rms);
572  PedestalsAve4HF->Fill(sum/4.0);
573  }
574  }
575 }
HcalDetDiagPedestalData ho_data[85][72][4][4]
#define abs(x)
Definition: mlp_lapack.h:159
HcalDetDiagPedestalData he_data[85][72][4][4]
bool get_average(double *ave, double *rms)
T eta() const
void Fill(long long x)
HcalDetDiagPedestalData hb_data[85][72][4][4]
void Reset(void)
reset ME (ie. contents, errors, etc)
HcalDetDiagPedestalData hf_data[85][72][4][4]
Definition: DDAxes.h:10
void HcalDetDiagPedestalMonitor::LoadReference ( )
private

Definition at line 1095 of file HcalDetDiagPedestalMonitor.cc.

References reco::tau::disc::Eta(), f, hb_data, he_data, hf_data, ho_data, IsReference, colinearityKinematic::Phi, ReferenceData, ReferenceRun, plotscripts::rms(), HcalDetDiagPedestalData::set_reference(), and matplotRender::t.

Referenced by beginRun().

1095  {
1096  double ped[4],rms[4];
1097  int Eta,Phi,Depth;
1098  char subdet[10];
1099  TFile *f;
1100  if(gSystem->AccessPathName(ReferenceData.c_str())) return;
1101  f = new TFile(ReferenceData.c_str(),"READ");
1102  if(!f->IsOpen()) return ;
1103  TObjString *STR=(TObjString *)f->Get("run number");
1104 
1105  if(STR){ std::string Ref(STR->String()); ReferenceRun=Ref;}
1106 
1107  TTree* t=(TTree*)f->Get("HCAL Pedestal data");
1108  if(!t) return;
1109  t->SetBranchAddress("Subdet", subdet);
1110  t->SetBranchAddress("eta", &Eta);
1111  t->SetBranchAddress("phi", &Phi);
1112  t->SetBranchAddress("depth", &Depth);
1113  t->SetBranchAddress("cap0_ped", &ped[0]);
1114  t->SetBranchAddress("cap0_rms", &rms[0]);
1115  t->SetBranchAddress("cap1_ped", &ped[1]);
1116  t->SetBranchAddress("cap1_rms", &rms[1]);
1117  t->SetBranchAddress("cap2_ped", &ped[2]);
1118  t->SetBranchAddress("cap2_rms", &rms[2]);
1119  t->SetBranchAddress("cap3_ped", &ped[3]);
1120  t->SetBranchAddress("cap3_rms", &rms[3]);
1121  for(int ievt=0;ievt<t->GetEntries();ievt++){
1122  t->GetEntry(ievt);
1123  if(strcmp(subdet,"HB")==0){
1124  hb_data[Eta+42][Phi-1][Depth-1][0].set_reference(ped[0],rms[0]);
1125  hb_data[Eta+42][Phi-1][Depth-1][1].set_reference(ped[1],rms[1]);
1126  hb_data[Eta+42][Phi-1][Depth-1][2].set_reference(ped[2],rms[2]);
1127  hb_data[Eta+42][Phi-1][Depth-1][3].set_reference(ped[3],rms[3]);
1128  }
1129  if(strcmp(subdet,"HE")==0){
1130  he_data[Eta+42][Phi-1][Depth-1][0].set_reference(ped[0],rms[0]);
1131  he_data[Eta+42][Phi-1][Depth-1][1].set_reference(ped[1],rms[1]);
1132  he_data[Eta+42][Phi-1][Depth-1][2].set_reference(ped[2],rms[2]);
1133  he_data[Eta+42][Phi-1][Depth-1][3].set_reference(ped[3],rms[3]);
1134  }
1135  if(strcmp(subdet,"HO")==0){
1136  ho_data[Eta+42][Phi-1][Depth-1][0].set_reference(ped[0],rms[0]);
1137  ho_data[Eta+42][Phi-1][Depth-1][1].set_reference(ped[1],rms[1]);
1138  ho_data[Eta+42][Phi-1][Depth-1][2].set_reference(ped[2],rms[2]);
1139  ho_data[Eta+42][Phi-1][Depth-1][3].set_reference(ped[3],rms[3]);
1140  }
1141  if(strcmp(subdet,"HF")==0){
1142  hf_data[Eta+42][Phi-1][Depth-1][0].set_reference(ped[0],rms[0]);
1143  hf_data[Eta+42][Phi-1][Depth-1][1].set_reference(ped[1],rms[1]);
1144  hf_data[Eta+42][Phi-1][Depth-1][2].set_reference(ped[2],rms[2]);
1145  hf_data[Eta+42][Phi-1][Depth-1][3].set_reference(ped[3],rms[3]);
1146  }
1147  }
1148  f->Close();
1149  IsReference=true;
1150 }
HcalDetDiagPedestalData ho_data[85][72][4][4]
HcalDetDiagPedestalData he_data[85][72][4][4]
HcalDetDiagPedestalData hb_data[85][72][4][4]
double f[11][100]
void set_reference(float val, float rms)
HcalDetDiagPedestalData hf_data[85][72][4][4]
void HcalDetDiagPedestalMonitor::SaveReference ( )
private

Definition at line 868 of file HcalDetDiagPedestalMonitor.cc.

References HcalElectronicsMap::allElectronicsIdPrecision(), dataset_seq_number, HcalDetId::depth(), DetId::det(), cond::rpcobgas::detid, emap, reco::tau::disc::Eta(), eta(), patZpeak::events, HcalDetDiagPedestalData::get_average(), HcalDetDiagPedestalData::get_statistics(), HcalDetDiagPedestalData::get_status(), hb_data, DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, HcalOuter, he_data, hf_data, ho_data, HcalDetId::ieta(), ievt_, HcalDetId::iphi(), HcalElectronicsMap::lookup(), OutputFilePath, Overwrite, phi, colinearityKinematic::Phi, plotscripts::rms(), CrabTask::run, run_number, step1_ZMM_7Tev::Status, DetId::subdetId(), matplotRender::t, interactiveExample::theFile, cond::rpcobgas::time, diffTreeTool::tree, xmlFile(), and XmlFilePath.

Referenced by analyze(), and endRun().

868  {
869 double ped[4],rms[4];
870 int Eta,Phi,Depth,Statistic,Status=0;
871 char Subdet[10],str[500];
872  if(OutputFilePath.size()>0){
873  if(!Overwrite){
874  sprintf(str,"%sHcalDetDiagPedestalData_run%06i_%i.root",OutputFilePath.c_str(),run_number,dataset_seq_number);
875  }else{
876  sprintf(str,"%sHcalDetDiagPedestalData.root",OutputFilePath.c_str());
877  }
878  TFile *theFile = new TFile(str, "RECREATE");
879  if(!theFile->IsOpen()) return;
880  theFile->cd();
881  sprintf(str,"%d",run_number); TObjString run(str); run.Write("run number");
882  sprintf(str,"%d",ievt_); TObjString events(str); events.Write("Total events processed");
883  sprintf(str,"%d",dataset_seq_number); TObjString dsnum(str); dsnum.Write("Dataset number");
884  Long_t t; t=time(0); strftime(str,30,"%F %T",localtime(&t)); TObjString tm(str); tm.Write("Dataset creation time");
885 
886  TTree *tree =new TTree("HCAL Pedestal data","HCAL Pedestal data");
887  if(tree==0) return;
888  tree->Branch("Subdet", &Subdet, "Subdet/C");
889  tree->Branch("eta", &Eta, "Eta/I");
890  tree->Branch("phi", &Phi, "Phi/I");
891  tree->Branch("depth", &Depth, "Depth/I");
892  tree->Branch("statistic",&Statistic, "Statistic/I");
893  tree->Branch("status", &Status, "Status/I");
894  tree->Branch("cap0_ped", &ped[0], "cap0_ped/D");
895  tree->Branch("cap0_rms", &rms[0], "cap0_rms/D");
896  tree->Branch("cap1_ped", &ped[1], "cap1_ped/D");
897  tree->Branch("cap1_rms", &rms[1], "cap1_rms/D");
898  tree->Branch("cap2_ped", &ped[2], "cap2_ped/D");
899  tree->Branch("cap2_rms", &rms[2], "cap2_rms/D");
900  tree->Branch("cap3_ped", &ped[3], "cap3_ped/D");
901  tree->Branch("cap3_rms", &rms[3], "cap3_rms/D");
902  sprintf(Subdet,"HB");
903  for(int eta=-16;eta<=16;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
904  if((Statistic=hb_data[eta+42][phi-1][depth-1][0].get_statistics())>100){
905  Eta=eta; Phi=phi; Depth=depth;
906  Status=hb_data[eta+42][phi-1][depth-1][0].get_status();
907  hb_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0]);
908  hb_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
909  hb_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
910  hb_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
911  tree->Fill();
912  }
913  }
914  sprintf(Subdet,"HE");
915  for(int eta=-29;eta<=29;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=3;depth++){
916  if((Statistic=he_data[eta+42][phi-1][depth-1][0].get_statistics())>100){
917  Eta=eta; Phi=phi; Depth=depth;
918  Status=he_data[eta+42][phi-1][depth-1][0].get_status();
919  he_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0]);
920  he_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
921  he_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
922  he_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
923  tree->Fill();
924  }
925  }
926  sprintf(Subdet,"HO");
927  for(int eta=-15;eta<=15;eta++) for(int phi=1;phi<=72;phi++) for(int depth=4;depth<=4;depth++){
928  if((Statistic=ho_data[eta+42][phi-1][depth-1][0].get_statistics())>100){
929  Eta=eta; Phi=phi; Depth=depth;
930  Status=ho_data[eta+42][phi-1][depth-1][0].get_status();
931  ho_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0]);
932  ho_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
933  ho_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
934  ho_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
935  tree->Fill();
936  }
937  }
938  sprintf(Subdet,"HF");
939  for(int eta=-42;eta<=42;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
940  if((Statistic=hf_data[eta+42][phi-1][depth-1][0].get_statistics())>100){
941  Eta=eta; Phi=phi; Depth=depth;
942  Status=hf_data[eta+42][phi-1][depth-1][0].get_status();
943  hf_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0]);
944  hf_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
945  hf_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
946  hf_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
947  tree->Fill();
948  }
949  }
950  theFile->Write();
951  theFile->Close();
952  }
953  if(XmlFilePath.size()>0){
954  //create XML file
955  if(!Overwrite){
956  sprintf(str,"HcalDetDiagPedestals_%i_%i.xml",run_number,dataset_seq_number);
957  }else{
958  sprintf(str,"HcalDetDiagPedestals.xml");
959  }
960  std::string xmlName=str;
961  ofstream xmlFile;
962  xmlFile.open(xmlName.c_str());
963 
964  xmlFile<<"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
965  xmlFile<<"<ROOT>\n";
966  xmlFile<<" <HEADER>\n";
967  xmlFile<<" <HINTS mode='only-det-root'/>\n";
968  xmlFile<<" <TYPE>\n";
969  xmlFile<<" <EXTENSION_TABLE_NAME>HCAL_DETMON_PEDESTALS_V1</EXTENSION_TABLE_NAME>\n";
970  xmlFile<<" <NAME>HCAL Pedestals [abort gap global]</NAME>\n";
971  xmlFile<<" </TYPE>\n";
972  xmlFile<<" <!-- run details -->\n";
973  xmlFile<<" <RUN>\n";
974  xmlFile<<" <RUN_TYPE>GLOBAL-RUN</RUN_TYPE>\n";
975  xmlFile<<" <RUN_NUMBER>"<<run_number<<"</RUN_NUMBER>\n";
976  xmlFile<<" <RUN_BEGIN_TIMESTAMP>2009-01-01 00:00:00</RUN_BEGIN_TIMESTAMP>\n";
977  xmlFile<<" <COMMENT_DESCRIPTION>hcal ped data</COMMENT_DESCRIPTION>\n";
978  xmlFile<<" <LOCATION>P5</LOCATION>\n";
979  xmlFile<<" <INITIATED_BY_USER>dma</INITIATED_BY_USER>\n";
980  xmlFile<<" </RUN>\n";
981  xmlFile<<" </HEADER>\n";
982  xmlFile<<" <DATA_SET>\n";
983  xmlFile<<" <!-- optional dataset metadata -->\n\n";
984  xmlFile<<" <SET_NUMBER>"<<dataset_seq_number<<"</SET_NUMBER>\n";
985  xmlFile<<" <SET_BEGIN_TIMESTAMP>2009-01-01 00:00:00</SET_BEGIN_TIMESTAMP>\n";
986  xmlFile<<" <SET_END_TIMESTAMP>2009-01-01 00:00:00</SET_END_TIMESTAMP>\n";
987  xmlFile<<" <NUMBER_OF_EVENTS_IN_SET>"<<ievt_<<"</NUMBER_OF_EVENTS_IN_SET>\n";
988  xmlFile<<" <COMMENT_DESCRIPTION>Automatic DQM output</COMMENT_DESCRIPTION>\n";
989  xmlFile<<" <DATA_FILE_NAME>"<< xmlName <<"</DATA_FILE_NAME>\n";
990  xmlFile<<" <IMAGE_FILE_NAME>data plot url or file path</IMAGE_FILE_NAME>\n";
991  xmlFile<<" <!-- who and when created this dataset-->\n\n";
992  Long_t t; t=time(0); strftime(str,30,"%F %T",localtime(&t));
993  xmlFile<<" <CREATE_TIMESTAMP>"<<str<<"</CREATE_TIMESTAMP>\n";
994  xmlFile<<" <CREATED_BY_USER>dma</CREATED_BY_USER>\n";
995  xmlFile<<" <!-- version (string) and subversion (number) -->\n";
996  xmlFile<<" <!-- fields are used to read data back from the database -->\n\n";
997  xmlFile<<" <VERSION>"<<run_number<<dataset_seq_number<<"</VERSION>\n";
998  xmlFile<<" <SUBVERSION>1</SUBVERSION>\n";
999  xmlFile<<" <!-- Assign predefined dataset attributes -->\n\n";
1000  xmlFile<<" <PREDEFINED_ATTRIBUTES>\n";
1001  xmlFile<<" <ATTRIBUTE>\n";
1002  xmlFile<<" <NAME>HCAL Dataset Status</NAME>\n";
1003  xmlFile<<" <VALUE>VALID</VALUE>\n";
1004  xmlFile<<" </ATTRIBUTE>\n";
1005  xmlFile<<" </PREDEFINED_ATTRIBUTES>\n";
1006  xmlFile<<" <!-- multiple data block records -->\n\n";
1007 
1008  std::vector <HcalElectronicsId> AllElIds = emap->allElectronicsIdPrecision();
1009  for(std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++){
1010  DetId detid=emap->lookup(*eid);
1011  if (detid.det()!=DetId::Hcal) continue;
1012  HcalGenericDetId gid(emap->lookup(*eid));
1013  if (gid.null())
1014  continue;
1015  if (gid.genericSubdet()!=HcalGenericDetId::HcalGenBarrel &&
1016  gid.genericSubdet()!=HcalGenericDetId::HcalGenEndcap &&
1017  gid.genericSubdet()!=HcalGenericDetId::HcalGenForward &&
1018  gid.genericSubdet()!=HcalGenericDetId::HcalGenOuter)
1019  continue;
1020 
1021  int eta,phi,depth;
1022  std::string subdet="";
1023  HcalDetId hid(detid);
1024  eta=hid.ieta();
1025  phi=hid.iphi();
1026  depth=hid.depth();
1027 
1028  double ped[4]={0,0,0,0},rms[4]={0,0,0,0};
1029  if(detid.subdetId()==HcalBarrel){
1030  subdet="HB";
1031  Statistic=hb_data[eta+42][phi-1][depth-1][0].get_statistics();
1032  Status =hb_data[eta+42][phi-1][depth-1][0].get_status();
1033  hb_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0]);
1034  hb_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
1035  hb_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
1036  hb_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
1037  }else if(detid.subdetId()==HcalEndcap){
1038  subdet="HE";
1039  he_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0]);
1040  he_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
1041  he_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
1042  he_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
1043  Statistic=he_data[eta+42][phi-1][depth-1][0].get_statistics();
1044  Status =he_data[eta+42][phi-1][depth-1][0].get_status();
1045  }else if(detid.subdetId()==HcalForward){
1046  subdet="HF";
1047  hf_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0]);
1048  hf_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
1049  hf_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
1050  hf_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
1051  Statistic=hf_data[eta+42][phi-1][depth-1][0].get_statistics();
1052  Status =hf_data[eta+42][phi-1][depth-1][0].get_status();
1053  }else if(detid.subdetId()==HcalOuter){
1054  subdet="HO";
1055  ho_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0]);
1056  ho_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
1057  ho_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
1058  ho_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
1059  Statistic=ho_data[eta+42][phi-1][depth-1][0].get_statistics();
1060  Status =ho_data[eta+42][phi-1][depth-1][0].get_status();
1061  }else continue;
1062  xmlFile<<" <DATA>\n";
1063  xmlFile<<" <NUMBER_OF_EVENTS_USED>"<<Statistic<<"</NUMBER_OF_EVENTS_USED>\n";
1064  xmlFile<<" <MEAN0>"<<ped[0]<<"</MEAN0>\n";
1065  xmlFile<<" <MEAN1>"<<ped[1]<<"</MEAN1>\n";
1066  xmlFile<<" <MEAN2>"<<ped[2]<<"</MEAN2>\n";
1067  xmlFile<<" <MEAN3>"<<ped[3]<<"</MEAN3>\n";
1068  xmlFile<<" <RMS0>"<<rms[0]<<"</RMS0>\n";
1069  xmlFile<<" <RMS1>"<<rms[1]<<"</RMS1>\n";
1070  xmlFile<<" <RMS2>"<<rms[2]<<"</RMS2>\n";
1071  xmlFile<<" <RMS3>"<<rms[3]<<"</RMS3>\n";
1072  xmlFile<<" <CHANNEL_STATUS_WORD>"<<Status<<"</CHANNEL_STATUS_WORD>\n";
1073  xmlFile<<" <CHANNEL_OBJECTNAME>HcalDetId</CHANNEL_OBJECTNAME>\n";
1074  xmlFile<<" <SUBDET>"<<subdet<<"</SUBDET>\n";
1075  xmlFile<<" <IETA>"<<eta<<"</IETA>\n";
1076  xmlFile<<" <IPHI>"<<phi<<"</IPHI>\n";
1077  xmlFile<<" <DEPTH>"<<depth<<"</DEPTH>\n";
1078  xmlFile<<" <TYPE>0</TYPE>\n";
1079  xmlFile<<" </DATA>\n";
1080  }
1082  xmlFile<<" </DATA_SET>\n";
1083  xmlFile<<"</ROOT>\n";
1084  xmlFile.close();
1085  sprintf(str,"zip %s.zip %s",xmlName.c_str(),xmlName.c_str());
1086  system(str);
1087  sprintf(str,"rm -f %s",xmlName.c_str());
1088  system(str);
1089  sprintf(str,"mv -f %s.zip %s",xmlName.c_str(),XmlFilePath.c_str());
1090  system(str);
1091  }
1092  dataset_seq_number++;
1093 }
std::vector< HcalElectronicsId > allElectronicsIdPrecision() const
HcalDetDiagPedestalData ho_data[85][72][4][4]
HcalDetDiagPedestalData he_data[85][72][4][4]
bool get_average(double *ave, double *rms)
T eta() const
HcalDetDiagPedestalData hb_data[85][72][4][4]
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
Definition: DetId.h:20
bool xmlFile(const std::string fParam)
tuple events
Definition: patZpeak.py:19
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
HcalDetDiagPedestalData hf_data[85][72][4][4]
Definition: DDAxes.h:10

Member Data Documentation

int HcalDetDiagPedestalMonitor::dataset_seq_number
private

Definition at line 149 of file HcalDetDiagPedestalMonitor.cc.

Referenced by HcalDetDiagPedestalMonitor(), and SaveReference().

const HcalElectronicsMap* HcalDetDiagPedestalMonitor::emap
private
HcalDetDiagPedestalData HcalDetDiagPedestalMonitor::hb_data[85][72][4][4]
private
double HcalDetDiagPedestalMonitor::HBMeanTreshold
private

Definition at line 153 of file HcalDetDiagPedestalMonitor.cc.

Referenced by CheckStatus(), and HcalDetDiagPedestalMonitor().

double HcalDetDiagPedestalMonitor::HBRmsTreshold
private

Definition at line 154 of file HcalDetDiagPedestalMonitor.cc.

Referenced by CheckStatus(), and HcalDetDiagPedestalMonitor().

HcalDetDiagPedestalData HcalDetDiagPedestalMonitor::he_data[85][72][4][4]
private
double HcalDetDiagPedestalMonitor::HEMeanTreshold
private

Definition at line 155 of file HcalDetDiagPedestalMonitor.cc.

Referenced by CheckStatus(), and HcalDetDiagPedestalMonitor().

double HcalDetDiagPedestalMonitor::HERmsTreshold
private

Definition at line 156 of file HcalDetDiagPedestalMonitor.cc.

Referenced by CheckStatus(), and HcalDetDiagPedestalMonitor().

HcalDetDiagPedestalData HcalDetDiagPedestalMonitor::hf_data[85][72][4][4]
private
double HcalDetDiagPedestalMonitor::HFMeanTreshold
private

Definition at line 159 of file HcalDetDiagPedestalMonitor.cc.

Referenced by CheckStatus(), and HcalDetDiagPedestalMonitor().

double HcalDetDiagPedestalMonitor::HFRmsTreshold
private

Definition at line 160 of file HcalDetDiagPedestalMonitor.cc.

Referenced by CheckStatus(), and HcalDetDiagPedestalMonitor().

HcalDetDiagPedestalData HcalDetDiagPedestalMonitor::ho_data[85][72][4][4]
private
double HcalDetDiagPedestalMonitor::HOMeanTreshold
private

Definition at line 157 of file HcalDetDiagPedestalMonitor.cc.

Referenced by CheckStatus(), and HcalDetDiagPedestalMonitor().

double HcalDetDiagPedestalMonitor::HORmsTreshold
private

Definition at line 158 of file HcalDetDiagPedestalMonitor.cc.

Referenced by CheckStatus(), and HcalDetDiagPedestalMonitor().

int HcalDetDiagPedestalMonitor::ievt_
private
edm::InputTag HcalDetDiagPedestalMonitor::inputLabelDigi_
private

Definition at line 138 of file HcalDetDiagPedestalMonitor.cc.

Referenced by analyze(), and HcalDetDiagPedestalMonitor().

edm::InputTag HcalDetDiagPedestalMonitor::inputLabelRawData_
private

Definition at line 139 of file HcalDetDiagPedestalMonitor.cc.

Referenced by analyze(), and HcalDetDiagPedestalMonitor().

bool HcalDetDiagPedestalMonitor::IsReference
private

Definition at line 150 of file HcalDetDiagPedestalMonitor.cc.

Referenced by HcalDetDiagPedestalMonitor(), and LoadReference().

bool HcalDetDiagPedestalMonitor::LocalRun
private

Definition at line 151 of file HcalDetDiagPedestalMonitor.cc.

Referenced by analyze(), endRun(), and HcalDetDiagPedestalMonitor().

MonitorElement* HcalDetDiagPedestalMonitor::meEVT_
private

Definition at line 171 of file HcalDetDiagPedestalMonitor.cc.

Referenced by analyze(), and beginRun().

MonitorElement * HcalDetDiagPedestalMonitor::meRUN_
private

Definition at line 171 of file HcalDetDiagPedestalMonitor.cc.

Referenced by analyze(), and beginRun().

bool HcalDetDiagPedestalMonitor::Online_
private

Definition at line 168 of file HcalDetDiagPedestalMonitor.cc.

Referenced by analyze(), endRun(), and HcalDetDiagPedestalMonitor().

std::string HcalDetDiagPedestalMonitor::OutputFilePath
private

Definition at line 164 of file HcalDetDiagPedestalMonitor.cc.

Referenced by HcalDetDiagPedestalMonitor(), and SaveReference().

bool HcalDetDiagPedestalMonitor::Overwrite
private

Definition at line 169 of file HcalDetDiagPedestalMonitor.cc.

Referenced by HcalDetDiagPedestalMonitor(), and SaveReference().

MonitorElement* HcalDetDiagPedestalMonitor::Pedestals2DErrorHBHEHF
private

Definition at line 198 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

MonitorElement* HcalDetDiagPedestalMonitor::Pedestals2DErrorHO
private

Definition at line 199 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

MonitorElement* HcalDetDiagPedestalMonitor::Pedestals2DHBHEHF
private

Definition at line 196 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and fillHistos().

MonitorElement* HcalDetDiagPedestalMonitor::Pedestals2DHO
private

Definition at line 197 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and fillHistos().

MonitorElement* HcalDetDiagPedestalMonitor::Pedestals2DRmsHBHEHF
private

Definition at line 194 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and fillHistos().

MonitorElement* HcalDetDiagPedestalMonitor::Pedestals2DRmsHO
private

Definition at line 195 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and fillHistos().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsAve4HB
private

Definition at line 173 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and fillHistos().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsAve4HBref
private

Definition at line 179 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsAve4HE
private

Definition at line 174 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and fillHistos().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsAve4HEref
private

Definition at line 180 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsAve4HF
private

Definition at line 176 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and fillHistos().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsAve4HFref
private

Definition at line 182 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsAve4HO
private

Definition at line 175 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and fillHistos().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsAve4HOref
private

Definition at line 181 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsAve4Simp
private

Definition at line 177 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and fillHistos().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsRmsHB
private

Definition at line 183 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and fillHistos().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsRmsHBref
private

Definition at line 189 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsRmsHE
private

Definition at line 184 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and fillHistos().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsRmsHEref
private

Definition at line 190 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsRmsHF
private

Definition at line 186 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and fillHistos().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsRmsHFref
private

Definition at line 192 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsRmsHO
private

Definition at line 185 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and fillHistos().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsRmsHOref
private

Definition at line 191 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

MonitorElement* HcalDetDiagPedestalMonitor::PedestalsRmsSimp
private

Definition at line 187 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and fillHistos().

std::string HcalDetDiagPedestalMonitor::prefixME_
private

Definition at line 167 of file HcalDetDiagPedestalMonitor.cc.

Referenced by HcalDetDiagPedestalMonitor().

EtaPhiHists* HcalDetDiagPedestalMonitor::ProblemCellsByDepth_badped
private

Definition at line 203 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

EtaPhiHists* HcalDetDiagPedestalMonitor::ProblemCellsByDepth_badped_val
private

Definition at line 208 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

EtaPhiHists* HcalDetDiagPedestalMonitor::ProblemCellsByDepth_badrms
private

Definition at line 204 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

EtaPhiHists* HcalDetDiagPedestalMonitor::ProblemCellsByDepth_badrms_val
private

Definition at line 209 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

EtaPhiHists* HcalDetDiagPedestalMonitor::ProblemCellsByDepth_missing
private

Definition at line 201 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

EtaPhiHists* HcalDetDiagPedestalMonitor::ProblemCellsByDepth_missing_val
private

Definition at line 206 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

EtaPhiHists* HcalDetDiagPedestalMonitor::ProblemCellsByDepth_unstable
private

Definition at line 202 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

EtaPhiHists* HcalDetDiagPedestalMonitor::ProblemCellsByDepth_unstable_val
private

Definition at line 207 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and CheckStatus().

std::vector<std::string> HcalDetDiagPedestalMonitor::problemnames_
private

Definition at line 210 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun().

std::string HcalDetDiagPedestalMonitor::ReferenceData
private

Definition at line 162 of file HcalDetDiagPedestalMonitor.cc.

Referenced by HcalDetDiagPedestalMonitor(), and LoadReference().

std::string HcalDetDiagPedestalMonitor::ReferenceRun
private

Definition at line 163 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun(), and LoadReference().

MonitorElement* HcalDetDiagPedestalMonitor::RefRun_
private

Definition at line 172 of file HcalDetDiagPedestalMonitor.cc.

Referenced by beginRun().

int HcalDetDiagPedestalMonitor::run_number
private
std::string HcalDetDiagPedestalMonitor::XmlFilePath
private

Definition at line 165 of file HcalDetDiagPedestalMonitor.cc.

Referenced by HcalDetDiagPedestalMonitor(), and SaveReference().