From 6bbb5d748b5d704781099af7d8ce8f1ac627a6bb Mon Sep 17 00:00:00 2001 From: vladimir Date: Thu, 12 Feb 2015 13:17:40 +0100 Subject: [PATCH 01/14] add var.bins histograms --- DQM/CastorMonitor/src/CastorRecHitMonitor.cc | 52 +++++++++++++++----- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/DQM/CastorMonitor/src/CastorRecHitMonitor.cc b/DQM/CastorMonitor/src/CastorRecHitMonitor.cc index cea3a9b8f84c6..be93f02bbc404 100644 --- a/DQM/CastorMonitor/src/CastorRecHitMonitor.cc +++ b/DQM/CastorMonitor/src/CastorRecHitMonitor.cc @@ -40,17 +40,43 @@ void CastorRecHitMonitor::bookHistograms(DQMStore::IBooker& ibooker, std::cout<<"CastorRecHitMonitor::bookHistograms"<getTH2F()->GetXaxis()->SetTitle("sectorPhi"); - //h2RHvsSec->getTH2F()->GetYaxis()->SetTitle("RecHit"); - //h2RHvsSec->getTH2F()->SetOption("colz"); + const int N_Sec = 16; + const int nySec = 20; + static float ySec[nySec+1]; + static float xSec[N_Sec+1]; + double E0sec = 1./1024.; + ySec[0] = 0.; ySec[1] = E0sec; + double lnBsec = log(2.); +// for(int i=1; i<=nySec; i++) ySec[i+1]= E0sec*exp(i*lnBsec); + for(int j=1; j<=nySec; j++) ySec[j] = E0sec*exp(j*lnBsec); + for(int i=0; i<=N_Sec; i++) xSec[i]=i; + + sprintf(s,"CastorRecHit Sectors"); +// sprintf(s,"CastorRecHitSumInSectors"); + h2RHvsSec = ibooker.book2D(s,s, N_Sec, xSec, nySec, ySec); + h2RHvsSec->getTH2F()->GetXaxis()->SetTitle("sectorPhi"); + h2RHvsSec->getTH2F()->GetYaxis()->SetTitle("RecHit / GeV"); + h2RHvsSec->getTH2F()->SetOption("colz"); + + + const int nxCh = 224; + const int nyE = 18; + static float xCh[nxCh+1]; + float yErh[nyE+1]; + for(int i=0; i<=nxCh; i++) xCh[i]=i; + double E0 = 1./1024.; + double lnA = log(2.); // log(50.)/double(nyE); + yErh[0] = 0.; yErh[1] = E0; + for(int j=1; j<=nyE; j++) yErh[j+1] = E0*exp(j*lnA); +// for(int i=1; i<=nyE; i++) yErh[i+1]= E0*exp(i*lnA); +// for(int i=0; i<=nyE; i++) printf(" [%d]%f",i,yErh[i]); +// printf(":CastorRecHitMonitor\n"); sprintf(s,"CastorTileRecHit"); - //h2RHchan = ibooker.book2D(s,s, 224, 0,224, 5100, -1000,50000.); - //h2RHchan->getTH2F()->GetXaxis()->SetTitle("sector*14+module"); - //h2RHchan->getTH2F()->GetYaxis()->SetTitle("RecHit"); - //h2RHchan->getTH2F()->SetOption("colz"); + h2RHchan = ibooker.book2D(s,s, nxCh, xCh, nyE, yErh); + h2RHchan->getTH2F()->GetXaxis()->SetTitle("sector*14+module"); + h2RHchan->getTH2F()->GetYaxis()->SetTitle("RecHit / GeV"); + h2RHchan->getTH2F()->SetOption("colz"); sprintf(s,"CastorRecHitMap(cumulative)"); h2RHmap = ibooker.book2D(s,s,14, 0,14, 16, 0,16); @@ -115,15 +141,15 @@ void CastorRecHitMonitor::processEvent(const CastorRecHitCollection& castorHits for(int phi=0; phi<16; phi++) { double es = 0.; for (int z=0; z<14; z++) { - //int ind = phi*14 + z +1; - float rh = energyInEachChannel[z][phi]; - //h2RHchan->Fill(ind,rh); + float rh = energyInEachChannel[z][phi]*0.001; + int ind = phi*14 + z +1; + h2RHchan->Fill(ind,rh); hallchan->Fill(rh); if(rh < 0.) continue; h2RHmap->Fill(z,phi,rh); es += rh; } - //h2RHvsSec->Fill(phi,es); + h2RHvsSec->Fill(phi,es); } // end for(int phi=0; if(ievt_ %100 == 0) From 9e45771d09d3a2850569209f93fd6fc6bd396c53 Mon Sep 17 00:00:00 2001 From: vladimir Date: Thu, 12 Feb 2015 13:18:07 +0100 Subject: [PATCH 02/14] add var.bins histograms --- DQM/CastorMonitor/src/CastorDigiMonitor.cc | 43 ++++++++++++++++++++-- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/DQM/CastorMonitor/src/CastorDigiMonitor.cc b/DQM/CastorMonitor/src/CastorDigiMonitor.cc index cabd9806a8346..9a9c7c5d1b6df 100644 --- a/DQM/CastorMonitor/src/CastorDigiMonitor.cc +++ b/DQM/CastorMonitor/src/CastorDigiMonitor.cc @@ -12,6 +12,11 @@ //****************************************************// //---- critical revision 26.06.2014 (Vladimir Popov) //==================================================================// + + static int TS_MAX = 6; + static float RatioThresh1 = 1.5; + static float RatioThresh2 = 1.2; + //======================= Constructor ==============================// CastorDigiMonitor::CastorDigiMonitor(const edm::ParameterSet& ps) { @@ -74,7 +79,14 @@ void CastorDigiMonitor::bookHistograms(DQMStore::IBooker& ibooker, h2QmeantsvsCh->getTH2F()->GetXaxis()->SetTitle("Tile(=sector*14+module)"); h2QmeantsvsCh->getTH2F()->GetYaxis()->SetTitle("TS"); h2QmeantsvsCh->getTH2F()->SetOption("colz"); - sprintf(s,"QmeanfC_map(allTS)"); + + sprintf(s,"CASTORreportSummaryMap"); + h2reportMap = ibooker.book2D(s,s,14, 0,14, 16, 0,16); + h2reportMap->getTH2F()->GetXaxis()->SetTitle("moduleZ"); + h2reportMap->getTH2F()->GetYaxis()->SetTitle("sectorPhi"); + h2reportMap->getTH2F()->SetOption("colz"); + + sprintf(s,"QmeanfC_map(allTS)"); h2QmeanMap = ibooker.book2D(s,s,14,0.,14., 16,0.,16.); h2QmeanMap->getTH2F()->GetXaxis()->SetTitle("ModuleZ"); h2QmeanMap->getTH2F()->GetYaxis()->SetTitle("SectorPhi"); @@ -130,7 +142,8 @@ void CastorDigiMonitor::processEvent(const CastorDigiCollection& castorDigis, } //end for(CastorDigiCollection::const_iterator ... ievt_++; - if(ievt_ %100 == 0) { +// if(ievt_ %100 == 0) { + if(ievt_ %100 != 0) return; float ModuleSum[14], SectorSum[16]; for(int m=0; m<14; m++) ModuleSum[m]=0.; for(int s=0; s<16; s++) SectorSum[s]=0.; @@ -153,8 +166,30 @@ void CastorDigiMonitor::processEvent(const CastorDigiCollection& castorDigis, hModule->getTH1F()->SetBinContent(mod+1,ModuleSum[mod]); for(int sec=0; sec<16; sec++) hSector->getTH1F()->SetBinContent(sec+1,SectorSum[sec]); - } //end if(ievt_ %100 == 0) { - if(fVerbosity>0) std::cout << "CastorDigiMonitor::processEvent (end)"<< std::endl; + int tsm = 0; + for(int ts=0; tsgetTH2F()->GetBinContent(ind+1,ts+1); + if(sm < s) {sm = s; tsm = ts;} + } + + for(int mod=0; mod<14; mod++) for(int sec=0; sec<16;sec++) { + int ind = sec*14 + mod; + double am= h2QmeantsvsCh->getTH2F()->GetBinContent(ind+1,tsm+1); + double sum = 0.; + for(int ts=1; ts<=TS_MAX; ts++) if(ts != tsm) + sum += h2QmeantsvsCh->getTH2F()->GetBinContent(ind+1,ts); + float r = 0.; + if(am > 0.) r = sum/(TS_MAX-1)/am; + float statusTS = 0.87; + if(r > RatioThresh1) statusTS = 1.0; + else if(r > RatioThresh2) statusTS = 0.93; + h2reportMap->getTH2F()->SetBinContent(mod+1,sec+1,statusTS); + } + +// } //end if(ievt_ %100 == 0) { + return; } From 5dec9ef2e7351f7f62fe6eb491056f64df9a2479 Mon Sep 17 00:00:00 2001 From: vladimir Date: Thu, 12 Feb 2015 13:18:24 +0100 Subject: [PATCH 03/14] add var.bins histograms --- DQM/CastorMonitor/interface/CastorDigiMonitor.h | 1 + 1 file changed, 1 insertion(+) diff --git a/DQM/CastorMonitor/interface/CastorDigiMonitor.h b/DQM/CastorMonitor/interface/CastorDigiMonitor.h index 900b93bda88b5..da253728a29c2 100644 --- a/DQM/CastorMonitor/interface/CastorDigiMonitor.h +++ b/DQM/CastorMonitor/interface/CastorDigiMonitor.h @@ -29,6 +29,7 @@ class CastorDigiMonitor: public CastorBaseMonitor { int ievt_; MonitorElement* h2digierr; + MonitorElement* h2reportMap; MonitorElement* h2QtsvsCh; MonitorElement *h2QmeantsvsCh; MonitorElement *h2QmeanMap; From 152dc0fbdb1de4b26cbbdd76e6282e9a344bf75d Mon Sep 17 00:00:00 2001 From: vladimir Date: Thu, 12 Feb 2015 13:18:46 +0100 Subject: [PATCH 04/14] add var.bins histograms --- DQM/CastorMonitor/interface/CastorRecHitMonitor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DQM/CastorMonitor/interface/CastorRecHitMonitor.h b/DQM/CastorMonitor/interface/CastorRecHitMonitor.h index 0759e422a9654..67f1e2fd70077 100644 --- a/DQM/CastorMonitor/interface/CastorRecHitMonitor.h +++ b/DQM/CastorMonitor/interface/CastorRecHitMonitor.h @@ -21,8 +21,8 @@ class CastorRecHitMonitor: public CastorBaseMonitor { std::string subsystemname; TH2F *h2RecHitMap; - //MonitorElement* h2RHchan; - //MonitorElement* h2RHvsSec; + MonitorElement* h2RHchan; + MonitorElement* h2RHvsSec; MonitorElement* h2RHmap; MonitorElement* h2RHoccmap; MonitorElement* h2RHentriesMap; From bd2a16631fb65c307f93aa78d259e1e954aafa33 Mon Sep 17 00:00:00 2001 From: vladimir Date: Mon, 16 Feb 2015 14:45:27 +0100 Subject: [PATCH 05/14] add tower collection --- DQM/CastorMonitor/src/CastorMonitorModule.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/DQM/CastorMonitor/src/CastorMonitorModule.cc b/DQM/CastorMonitor/src/CastorMonitorModule.cc index 2b4a5c9ae9bd5..7ee5282097f87 100644 --- a/DQM/CastorMonitor/src/CastorMonitorModule.cc +++ b/DQM/CastorMonitor/src/CastorMonitorModule.cc @@ -30,7 +30,7 @@ CastorMonitorModule::CastorMonitorModule(const edm::ParameterSet& ps) NBunchesOrbit = ps.getUntrackedParameter("nBunchesOrbit",3563); fVerbosity = ps.getUntrackedParameter("debug", 0); showTiming_ = ps.getUntrackedParameter("showTiming",false); -//inputLabelCastorTowers_ = ps.getParameter("CastorTowerLabel"); + inputLabelCastorTowers_ = ps.getParameter("CastorTowerLabel"); //dump2database_ = ps.getUntrackedParameter("dump2database",false); irun_=0; @@ -197,7 +197,13 @@ void CastorMonitorModule::analyze(const edm::Event& iEvent, const edm::EventSetu cpu_timer.reset(); cpu_timer.start(); } - if(rechitOK_) RecHitMon_->processEvent(*CastorHits); + if(rechitOK_) { + RecHitMon_->processEvent(*CastorHits); + edm::Handle castorTowers; + iEvent.getByLabel(inputLabelCastorTowers_,castorTowers); + RecHitMon_->processEventTowers(*castorTowers); + } + if (showTiming_){ cpu_timer.stop(); if (RecHitMon_!=NULL) std::cout <<"TIMER:: RECHIT MONITOR ->"< Date: Mon, 16 Feb 2015 14:45:51 +0100 Subject: [PATCH 06/14] add tower collection --- DQM/CastorMonitor/src/CastorRecHitMonitor.cc | 63 ++++++++++++++++---- 1 file changed, 52 insertions(+), 11 deletions(-) diff --git a/DQM/CastorMonitor/src/CastorRecHitMonitor.cc b/DQM/CastorMonitor/src/CastorRecHitMonitor.cc index be93f02bbc404..a15e2fe1f0d70 100644 --- a/DQM/CastorMonitor/src/CastorRecHitMonitor.cc +++ b/DQM/CastorMonitor/src/CastorRecHitMonitor.cc @@ -47,12 +47,10 @@ void CastorRecHitMonitor::bookHistograms(DQMStore::IBooker& ibooker, double E0sec = 1./1024.; ySec[0] = 0.; ySec[1] = E0sec; double lnBsec = log(2.); -// for(int i=1; i<=nySec; i++) ySec[i+1]= E0sec*exp(i*lnBsec); - for(int j=1; j<=nySec; j++) ySec[j] = E0sec*exp(j*lnBsec); + for(int j=1; jgetTH2F()->GetXaxis()->SetTitle("sectorPhi"); h2RHvsSec->getTH2F()->GetYaxis()->SetTitle("RecHit / GeV"); @@ -65,12 +63,9 @@ void CastorRecHitMonitor::bookHistograms(DQMStore::IBooker& ibooker, float yErh[nyE+1]; for(int i=0; i<=nxCh; i++) xCh[i]=i; double E0 = 1./1024.; - double lnA = log(2.); // log(50.)/double(nyE); + double lnA = log(2.); yErh[0] = 0.; yErh[1] = E0; - for(int j=1; j<=nyE; j++) yErh[j+1] = E0*exp(j*lnA); -// for(int i=1; i<=nyE; i++) yErh[i+1]= E0*exp(i*lnA); -// for(int i=0; i<=nyE; i++) printf(" [%d]%f",i,yErh[i]); -// printf(":CastorRecHitMonitor\n"); + for(int j=1; jgetTH2F()->GetYaxis()->SetTitle("RecHit / GeV"); h2RHchan->getTH2F()->SetOption("colz"); + sprintf(s,"Reco all tiles"); + hallchan = ibooker.book1D(s,s,nyE,yErh); + hallchan->getTH1F()->GetXaxis()->SetTitle("GeV"); + sprintf(s,"CastorRecHitMap(cumulative)"); h2RHmap = ibooker.book2D(s,s,14, 0,14, 16, 0,16); h2RHmap->getTH2F()->GetXaxis()->SetTitle("moduleZ"); @@ -99,14 +98,56 @@ void CastorRecHitMonitor::bookHistograms(DQMStore::IBooker& ibooker, sprintf(s,"CastorRecHitTime"); hRHtime = ibooker.book1D(s,s,301, -101.,200.); - sprintf(s,"Reco all tiles"); - hallchan = ibooker.book1D(s,s,22000,-20000.,200000.); - + sprintf(s,"CASTORTowerDepth"); + hTowerDepth = ibooker.book1D(s,s,130,-15500.,-14200.); + hTowerDepth->getTH1F()->GetXaxis()->SetTitle("mm"); + + sprintf(s,"CASTORTowerMultiplicity"); + hTowerMultipl = ibooker.book1D(s,s,20,0.,20.); + + const int NEtow = 20; + static float EhadTow[NEtow+1]; + static float EMTow[NEtow+1]; + static float ETower[NEtow+2]; + double E0tow = 1./1024.; + EMTow[0] = 0.; EMTow[1] = E0tow; + EhadTow[0] = 0.; EhadTow[1] = E0tow; + double lnBtow = log(2.); + for(int j=1; jgetTH2F()->GetXaxis()->SetTitle("Ehad / GeV"); + h2TowerEMhad->getTH2F()->GetYaxis()->SetTitle("EM / GeV"); + h2TowerEMhad->getTH2F()->SetOption("colz"); + + sprintf(s,"CASTORTowerTotalEnergy"); + hTowerE = ibooker.book1D(s,s,NEtow+1,ETower); + hTowerE->getTH1F()->GetXaxis()->SetTitle("GeV"); + if(fVerbosity>0) std::cout<<"CastorRecHitMonitor::bookHistograms(end)"<Fill(iTower->energy()*0.001); + h2TowerEMhad->Fill(iTower->hadEnergy()*0.001,iTower->emEnergy()*0.001); + hTowerDepth->Fill(iTower->depth()); + nTowers++; + } + hTowerMultipl->Fill(nTowers); +} //================== processEvent ==========================// void CastorRecHitMonitor::processEvent(const CastorRecHitCollection& castorHits ) { From bbf7f6be6a8df596818c7a1332bcae2d2b996403 Mon Sep 17 00:00:00 2001 From: vladimir Date: Mon, 16 Feb 2015 14:46:31 +0100 Subject: [PATCH 07/14] add tower collection --- DQM/CastorMonitor/interface/CastorMonitorModule.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DQM/CastorMonitor/interface/CastorMonitorModule.h b/DQM/CastorMonitor/interface/CastorMonitorModule.h index 016c632caa0e8..98b9d4d13b4a7 100644 --- a/DQM/CastorMonitor/interface/CastorMonitorModule.h +++ b/DQM/CastorMonitor/interface/CastorMonitorModule.h @@ -115,6 +115,9 @@ class CastorMonitorModule : public DQMEDAnalyzer{ edm::InputTag inputLabelDigi_; edm::InputTag inputLabelRecHitCASTOR_; + edm::InputTag inputLabelCastorTowers_; + typedef std::vector CastorTowerCollection; + CastorRecHitMonitor* RecHitMon_; CastorDigiMonitor* DigiMon_; CastorLEDMonitor* LedMon_; From 58e5c9f54a659e4a5611b8fb50613d0ad206f1a0 Mon Sep 17 00:00:00 2001 From: vladimir Date: Mon, 16 Feb 2015 14:47:09 +0100 Subject: [PATCH 08/14] add tower collection --- .../interface/CastorRecHitMonitor.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/DQM/CastorMonitor/interface/CastorRecHitMonitor.h b/DQM/CastorMonitor/interface/CastorRecHitMonitor.h index 67f1e2fd70077..620b7d555e012 100644 --- a/DQM/CastorMonitor/interface/CastorRecHitMonitor.h +++ b/DQM/CastorMonitor/interface/CastorRecHitMonitor.h @@ -6,6 +6,16 @@ #include "DQMServices/Core/interface/MonitorElement.h" //#include "DataFormats/HcalRecHit/interface/CastorRecHit.h" +#include "DataFormats/CastorReco/interface/CastorTower.h" +#include "DataFormats/CastorReco/interface/CastorCluster.h" +#include "DataFormats/CastorReco/interface/CastorJet.h" +#include "DataFormats/JetReco/interface/CastorJetID.h" +#include "RecoJets/JetProducers/interface/CastorJetIDHelper.h" +#include "RecoJets/JetProducers/plugins/CastorJetIDProducer.h" +#include "DataFormats/JetReco/interface/BasicJet.h" +#include "DataFormats/JetReco/interface/BasicJetCollection.h" +#include "DataFormats/JetReco/interface/Jet.h" + class CastorRecHitMonitor: public CastorBaseMonitor { public: CastorRecHitMonitor(const edm::ParameterSet& ps); @@ -14,12 +24,18 @@ class CastorRecHitMonitor: public CastorBaseMonitor { void setup(const edm::ParameterSet& ps); void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &); void processEvent(const CastorRecHitCollection& castorHits); + void processEventTowers(const reco::CastorTowerCollection& castorTowers); private: int ievt_; float energyInEachChannel[14][16]; std::string subsystemname; + MonitorElement *hTowerE; + MonitorElement *hTowerDepth; + MonitorElement *h2TowerEMhad; + MonitorElement *hTowerMultipl; + TH2F *h2RecHitMap; MonitorElement* h2RHchan; MonitorElement* h2RHvsSec; From 76072e36a182043e3147a01c922e7e88843e03d3 Mon Sep 17 00:00:00 2001 From: vladimir Date: Wed, 29 Apr 2015 13:46:30 +0200 Subject: [PATCH 09/14] add jets --- DQM/CastorMonitor/src/CastorRecHitMonitor.cc | 36 ++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/DQM/CastorMonitor/src/CastorRecHitMonitor.cc b/DQM/CastorMonitor/src/CastorRecHitMonitor.cc index a15e2fe1f0d70..fc33d008bb1fb 100644 --- a/DQM/CastorMonitor/src/CastorRecHitMonitor.cc +++ b/DQM/CastorMonitor/src/CastorRecHitMonitor.cc @@ -50,7 +50,7 @@ void CastorRecHitMonitor::bookHistograms(DQMStore::IBooker& ibooker, for(int j=1; jgetTH2F()->GetXaxis()->SetTitle("sectorPhi"); h2RHvsSec->getTH2F()->GetYaxis()->SetTitle("RecHit / GeV"); @@ -127,6 +127,18 @@ void CastorRecHitMonitor::bookHistograms(DQMStore::IBooker& ibooker, hTowerE = ibooker.book1D(s,s,NEtow+1,ETower); hTowerE->getTH1F()->GetXaxis()->SetTitle("GeV"); + sprintf(s,"CASTORJetsMultiplicity"); + hJetsMultipl = ibooker.book1D(s,s,16, 0.,16.); + + sprintf(s,"CASTORJetEnergy"); + hJetEnergy = ibooker.book1D(s,s,5000, 0.,500.); + + sprintf(s,"CASTORJetEta"); + hJetEta = ibooker.book1D(s,s,126, -6.3, 6.3); + + sprintf(s,"CASTORJetPhi"); + hJetPhi = ibooker.book1D(s,s,63, -3.15,3.15); + if(fVerbosity>0) std::cout<<"CastorRecHitMonitor::bookHistograms(end)"<Fill(nTowers); } //================== processEvent ==========================// -void CastorRecHitMonitor::processEvent(const CastorRecHitCollection& castorHits ) +void CastorRecHitMonitor::processEvent(const CastorRecHitCollection& castorHits) { if(fVerbosity>0) std::cout << "CastorRecHitMonitor::processEvent (begin)"<< std::endl; ievt_++; @@ -161,6 +173,9 @@ void CastorRecHitMonitor::processEvent(const CastorRecHitCollection& castorHits if(castorHits.size() <= 0) return; + //for(edm::TriggerResults::const_iterator iTrig= hltResults->begin(); +// iTrig!= hltResults->end(); iTrig++) {;} + for(CASTORiter=castorHits.begin(); CASTORiter!=castorHits.end(); ++CASTORiter) { float energy = CASTORiter->energy(); @@ -179,6 +194,7 @@ void CastorRecHitMonitor::processEvent(const CastorRecHitCollection& castorHits h2RHentriesMap->Fill(module-1,sector-1); } // end for(CASTORiter=castorHits.begin(); CASTORiter!= ... + double etot = 0.; for(int phi=0; phi<16; phi++) { double es = 0.; for (int z=0; z<14; z++) { @@ -191,6 +207,7 @@ void CastorRecHitMonitor::processEvent(const CastorRecHitCollection& castorHits es += rh; } h2RHvsSec->Fill(phi,es); + etot += es; } // end for(int phi=0; if(ievt_ %100 == 0) @@ -202,3 +219,18 @@ void CastorRecHitMonitor::processEvent(const CastorRecHitCollection& castorHits if(fVerbosity>0) std::cout << "CastorRecHitMonitor::processEvent (end)"<< std::endl; return; } + +void CastorRecHitMonitor::processEventJets(const reco::BasicJetCollection& Jets) +{ + int nJets=0; + for(reco::BasicJetCollection::const_iterator ibegin = Jets.begin(), + iend = Jets.end(), ijet = ibegin; ijet!= iend; ++ijet) { + nJets++; + float energy = ijet->energy()*0.001; + hJetEnergy->Fill(energy); + hJetEta->Fill(ijet->eta()); + hJetPhi->Fill(ijet->phi()); + } + hJetsMultipl->Fill(nJets); +} + From f48bd433177b8c9000c602717e4e4294de7fd15d Mon Sep 17 00:00:00 2001 From: vladimir Date: Wed, 29 Apr 2015 13:46:45 +0200 Subject: [PATCH 10/14] add jets --- DQM/CastorMonitor/interface/CastorRecHitMonitor.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/DQM/CastorMonitor/interface/CastorRecHitMonitor.h b/DQM/CastorMonitor/interface/CastorRecHitMonitor.h index 620b7d555e012..5d3d552a5e002 100644 --- a/DQM/CastorMonitor/interface/CastorRecHitMonitor.h +++ b/DQM/CastorMonitor/interface/CastorRecHitMonitor.h @@ -16,6 +16,8 @@ #include "DataFormats/JetReco/interface/BasicJetCollection.h" #include "DataFormats/JetReco/interface/Jet.h" +#include "DataFormats/Common/interface/TriggerResults.h" + class CastorRecHitMonitor: public CastorBaseMonitor { public: CastorRecHitMonitor(const edm::ParameterSet& ps); @@ -25,7 +27,7 @@ class CastorRecHitMonitor: public CastorBaseMonitor { void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &); void processEvent(const CastorRecHitCollection& castorHits); void processEventTowers(const reco::CastorTowerCollection& castorTowers); - + void processEventJets(const reco::BasicJetCollection& Jets); private: int ievt_; float energyInEachChannel[14][16]; @@ -35,6 +37,10 @@ class CastorRecHitMonitor: public CastorBaseMonitor { MonitorElement *hTowerDepth; MonitorElement *h2TowerEMhad; MonitorElement *hTowerMultipl; + MonitorElement *hJetsMultipl; + MonitorElement *hJetEnergy; + MonitorElement *hJetEta; + MonitorElement *hJetPhi; TH2F *h2RecHitMap; MonitorElement* h2RHchan; From 03fb58e7c8eff3cafa8d072886d0862d008a9991 Mon Sep 17 00:00:00 2001 From: vladimir Date: Wed, 29 Apr 2015 13:47:29 +0200 Subject: [PATCH 11/14] add report --- DQM/CastorMonitor/interface/CastorDigiMonitor.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/DQM/CastorMonitor/interface/CastorDigiMonitor.h b/DQM/CastorMonitor/interface/CastorDigiMonitor.h index da253728a29c2..7b4d16fcc2362 100644 --- a/DQM/CastorMonitor/interface/CastorDigiMonitor.h +++ b/DQM/CastorMonitor/interface/CastorDigiMonitor.h @@ -19,24 +19,31 @@ class CastorDigiMonitor: public CastorBaseMonitor { CastorDigiMonitor(const edm::ParameterSet& ps); ~CastorDigiMonitor(); - void setup(const edm::ParameterSet& ps); + void setup(const edm::ParameterSet& ps); void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &); - void processEvent(const CastorDigiCollection& cast,const CastorDbService& cond, int bunch); - + void processEvent(const CastorDigiCollection& cast,const CastorDbService& cond); + int ModSecToIndex(int module, int sector); private: std::string subsystemname_; int fVerbosity; int ievt_; + float Qrms_DEAD; + MonitorElement* h2QrmsTSvsCh; + MonitorElement* hQIErms[10]; + MonitorElement* hTSratio; + MonitorElement* h2TSratio; + MonitorElement* h2status; MonitorElement* h2digierr; MonitorElement* h2reportMap; + MonitorElement* hReport; MonitorElement* h2QtsvsCh; MonitorElement *h2QmeantsvsCh; MonitorElement *h2QmeanMap; MonitorElement *hModule; MonitorElement *hSector; MonitorElement* hdigisize; - MonitorElement* hBunchOcc; +// MonitorElement* hBunchOcc; }; #endif From c7c614cd77134bc18c15eaea85999f56d861b8a5 Mon Sep 17 00:00:00 2001 From: vladimir Date: Wed, 29 Apr 2015 13:47:39 +0200 Subject: [PATCH 12/14] add report --- DQM/CastorMonitor/src/CastorDigiMonitor.cc | 188 ++++++++++++++------- 1 file changed, 128 insertions(+), 60 deletions(-) diff --git a/DQM/CastorMonitor/src/CastorDigiMonitor.cc b/DQM/CastorMonitor/src/CastorDigiMonitor.cc index 9a9c7c5d1b6df..320645376ee1d 100644 --- a/DQM/CastorMonitor/src/CastorDigiMonitor.cc +++ b/DQM/CastorMonitor/src/CastorDigiMonitor.cc @@ -11,17 +11,24 @@ //// last revision: 31.05.2011 (Panos Katsas) to remove selecting N events for filling the histograms //****************************************************// //---- critical revision 26.06.2014 (Vladimir Popov) +// add rms check 15.04.2015 (Vladimir Popov) //==================================================================// - static int TS_MAX = 6; - static float RatioThresh1 = 1.5; - static float RatioThresh2 = 1.2; + static int TS_MAX = 10; + static float RatioThresh1 = 0.; + static float QIEerrThreshold = 0.0001; + static double QrmsTS[224][10], QmeanTS[224][10]; + const int TSped = 0; //======================= Constructor ==============================// CastorDigiMonitor::CastorDigiMonitor(const edm::ParameterSet& ps) { -subsystemname_=ps.getUntrackedParameter("subSystemFolder","Castor"); fVerbosity = ps.getUntrackedParameter("debug",0); +subsystemname_=ps.getUntrackedParameter("subSystemFolder","Castor"); + RatioThresh1 = ps.getUntrackedParameter("ratioThreshold",0.9); + Qrms_DEAD = ps.getUntrackedParameter("QrmsDead",0.01); //fC + Qrms_DEAD = Qrms_DEAD*Qrms_DEAD; + TS_MAX = ps.getUntrackedParameter("qieTSmax",6); } //======================= Destructor ===============================// @@ -43,21 +50,35 @@ void CastorDigiMonitor::bookHistograms(DQMStore::IBooker& ibooker, { char s[60]; if(fVerbosity>0) std::cout << "CastorDigiMonitor::beginRun (start)" << std::endl; + char sTileIndex[50]; + sprintf(sTileIndex,"Tile(=module*16+sector)"); + ievt_=0; -// pset_.getUntrackedParameter("subSystemFolder","Castor"); -// baseFolder_ = rootFolder_+"CastorDigiMonitor"; ibooker.setCurrentFolder(subsystemname_ + "/CastorDigiMonitor"); - std::string s2 = "QIE_capID+er+dv"; - h2digierr = ibooker.book2D(s2,s2,14,0.,14., 16,0.,16.); - h2digierr->getTH2F()->GetXaxis()->SetTitle("ModuleZ"); - h2digierr->getTH2F()->GetYaxis()->SetTitle("SectorPhi"); - h2digierr->getTH2F()->SetOption("colz"); - sprintf(s,"BunchOccupancy(fC)_all_TS"); - hBunchOcc = ibooker.bookProfile(s,s,4000,0,4000, 100,0,1.e10,""); - hBunchOcc->getTProfile()->GetXaxis()->SetTitle("BX"); - hBunchOcc->getTProfile()->GetYaxis()->SetTitle("QIE(fC)"); + std::string s2 = "CASTOR QIE_capID+er+dv"; + h2digierr=ibooker.bookProfile2D(s2,s2,14,0.,14., 16,0.,16.,100,0,1.e10,""); + h2digierr->getTProfile2D()->GetXaxis()->SetTitle("ModuleZ"); + h2digierr->getTProfile2D()->GetYaxis()->SetTitle("SectorPhi"); + h2digierr->getTProfile2D()->SetMaximum(1.); + h2digierr->getTProfile2D()->SetMinimum(QIEerrThreshold); + h2digierr->getTProfile2D()->SetOption("colz"); + + sprintf(s,"CASTOR DeadChannelsMap"); + h2status = ibooker.book2D(s,s,14,0.,14., 16,0.,16.); + h2status->getTH2F()->GetXaxis()->SetTitle("ModuleZ"); + h2status->getTH2F()->GetYaxis()->SetTitle("SectorPhi"); + h2status->getTH2F()->SetOption("colz"); + + sprintf(s,"CASTOR AverageToMaxRatioMap"); + h2TSratio = ibooker.book2D(s,s,14,0.,14., 16,0.,16.); + h2TSratio->getTH2F()->GetXaxis()->SetTitle("ModuleZ"); + h2TSratio->getTH2F()->GetYaxis()->SetTitle("SectorPhi"); + h2TSratio->getTH2F()->SetOption("colz"); + + sprintf(s,"CASTOR AverageToMaxRatio"); + hTSratio = ibooker.book1D(s,s,100,0.,1.); sprintf(s,"DigiSize"); hdigisize = ibooker.book1D(s,s,20,0.,20.); @@ -69,29 +90,48 @@ void CastorDigiMonitor::bookHistograms(DQMStore::IBooker& ibooker, hSector = ibooker.book1D(s,s,16,0.,16.); hSector->getTH1F()->GetXaxis()->SetTitle("SectorPhi"); hSector->getTH1F()->GetYaxis()->SetTitle("QIE(fC)"); - sprintf(s,"QfC=f(Tile TS) (cumulative)"); - h2QtsvsCh = ibooker.book2D(s,s,224,0.,224., 10,0.,10.); - h2QtsvsCh->getTH2F()->GetXaxis()->SetTitle("Tile(=sector*14+module)"); - h2QtsvsCh->getTH2F()->GetYaxis()->SetTitle("TS"); - h2QtsvsCh->getTH2F()->SetOption("colz"); + + sprintf(s,"QfC=f(x=Tile y=TS) (cumulative)"); + h2QtsvsCh = ibooker.book2D(s,s,224,0.,224., 10,0.,10.); + h2QtsvsCh->getTH2F()->GetXaxis()->SetTitle(sTileIndex); + h2QtsvsCh->getTH2F()->GetYaxis()->SetTitle("TS"); + h2QtsvsCh->getTH2F()->SetOption("colz"); + sprintf(s,"QmeanfC=f(Tile TS)"); h2QmeantsvsCh = ibooker.book2D(s,s,224,0.,224., 10,0.,10.); - h2QmeantsvsCh->getTH2F()->GetXaxis()->SetTitle("Tile(=sector*14+module)"); - h2QmeantsvsCh->getTH2F()->GetYaxis()->SetTitle("TS"); + h2QmeantsvsCh->getTH2F()->GetXaxis()->SetTitle(sTileIndex); + h2QmeantsvsCh->getTH2F()->GetYaxis()->SetTitle("Time Slice"); h2QmeantsvsCh->getTH2F()->SetOption("colz"); + sprintf(s,"QrmsfC=f(Tile TS)"); + h2QrmsTSvsCh = ibooker.book2D(s,s,224,0.,224., 10,0.,10.); + h2QrmsTSvsCh->getTH2F()->GetXaxis()->SetTitle(sTileIndex); + h2QrmsTSvsCh->getTH2F()->GetYaxis()->SetTitle("TS"); + h2QrmsTSvsCh->getTH2F()->SetOption("colz"); + sprintf(s,"CASTORreportSummaryMap"); h2reportMap = ibooker.book2D(s,s,14, 0,14, 16, 0,16); h2reportMap->getTH2F()->GetXaxis()->SetTitle("moduleZ"); h2reportMap->getTH2F()->GetYaxis()->SetTitle("sectorPhi"); h2reportMap->getTH2F()->SetOption("colz"); + hReport = ibooker.bookFloat("CASTOR reportSummary"); + sprintf(s,"QmeanfC_map(allTS)"); h2QmeanMap = ibooker.book2D(s,s,14,0.,14., 16,0.,16.); h2QmeanMap->getTH2F()->GetXaxis()->SetTitle("ModuleZ"); h2QmeanMap->getTH2F()->GetYaxis()->SetTitle("SectorPhi"); h2QmeanMap->getTH2F()->SetOption("textcolz"); + for(int ts=0; ts<=1; ts++) { + sprintf(s,"QIErms_TS=%d",ts); + hQIErms[ts] = ibooker.book1D(s,s,1000,0.,100.); + hQIErms[ts]->getTH1F()->GetXaxis()->SetTitle("QIErms(fC)"); + } + + for(int ind=0; ind<224; ind++) for(int ts=0; ts<10; ts++) + QrmsTS[ind][ts] = QmeanTS[ind][ts]= 0.; + if(fVerbosity>0) std::cout<<"CastorDigiMonitor::beginRun(end)"<0) std::cout << "CastorDigiMonitor::processEvent (begin)"<< std::endl; -// CaloSamples tool; - if(castorDigis.size() <= 0) { - if(fVerbosity>0) std::cout<<"CastorPSMonitor::processEvent NO Castor Digis"<0) std::cout<<"CastorPSMonitor::processEvent NO Castor Digis"<Fill(digi.size()); double sum = 0.; -// for (int i=1; iFill(module,sector); - int ind = sector*14 + module; + h2digierr->Fill(module,sector,err); +// if(err !=0) continue; + int ind = ModSecToIndex(module,sector); h2QtsvsCh->Fill(ind,i,LedMonAdc2fc[rawd]); - sum += LedMonAdc2fc[rawd]; -// if(err != 0 && fVerbosity>0) -// std::cout<<"event/idigi=" <0) + std::cout<<"event/idigi=" <Fill(iBunch,sum); +// hBunchOcc->Fill(iBunch,sum); } //end for(CastorDigiCollection::const_iterator ... ievt_++; -// if(ievt_ %100 == 0) { + + const float repChanBAD = 0.9; + const float repChanWarning = 0.95; if(ievt_ %100 != 0) return; float ModuleSum[14], SectorSum[16]; for(int m=0; m<14; m++) ModuleSum[m]=0.; for(int s=0; s<16; s++) SectorSum[s]=0.; for(int mod=0; mod<14; mod++) for(int sec=0; sec<16; sec++) { + for(int ts=0; ts<=1; ts++) { + int ind = ModSecToIndex(mod,sec); + double Qmean = QmeanTS[ind][ts]/ievt_; + double Qrms = sqrt(QrmsTS[ind][ts]/ievt_ - Qmean*Qmean); + hQIErms[ts]->Fill(Qrms); + } + double sum=0.; - for(int ts=1; ts<=10; ts++) { - int ind = sec*14 + mod +1; + for(int ts=1; ts<=TS_MAX; ts++) { + int ind = ModSecToIndex(mod,sec) + 1; double a=h2QtsvsCh->getTH2F()->GetBinContent(ind,ts); h2QmeantsvsCh->getTH2F()->SetBinContent(ind,ts,a/double(ievt_)); sum += a; + double Qmean = QmeanTS[ind-1][ts-1]/ievt_; + double Qrms = QrmsTS[ind-1][ts-1]/ievt_ - Qmean*Qmean; + h2QrmsTSvsCh->getTH2F()->SetBinContent(ind,ts,sqrt(Qrms)); } sum /= double(ievt_); ModuleSum[mod] += sum; @@ -167,29 +219,45 @@ void CastorDigiMonitor::processEvent(const CastorDigiCollection& castorDigis, for(int sec=0; sec<16; sec++) hSector->getTH1F()->SetBinContent(sec+1,SectorSum[sec]); - int tsm = 0; - for(int ts=0; tsgetTH2F()->GetBinContent(ind+1,ts+1); - if(sm < s) {sm = s; tsm = ts;} - } - + int nGoodCh = 0; for(int mod=0; mod<14; mod++) for(int sec=0; sec<16;sec++) { - int ind = sec*14 + mod; - double am= h2QmeantsvsCh->getTH2F()->GetBinContent(ind+1,tsm+1); + int ind = ModSecToIndex(mod,sec); + double Qmean = QmeanTS[ind][TSped]/ievt_; + double Qrms = QrmsTS[ind][TSped]/ievt_ - Qmean*Qmean; + float ChanStatus = 0.; + if(Qrms < Qrms_DEAD) ChanStatus = 1.; + h2status->getTH2F()->SetBinContent(mod+1,sec+1,ChanStatus); + + int tsm = 0; + float am=0.; + for(int ts=0; tsgetTH2F()->GetBinContent(ind+1,ts+1); + if(am < a) {am = a; tsm = ts;} + } + double sum = 0.; - for(int ts=1; ts<=TS_MAX; ts++) if(ts != tsm) - sum += h2QmeantsvsCh->getTH2F()->GetBinContent(ind+1,ts); + for(int ts=0; tsgetTH2F()->GetBinContent(ind+1,ts+1); float r = 0.; if(am > 0.) r = sum/(TS_MAX-1)/am; - float statusTS = 0.87; - if(r > RatioThresh1) statusTS = 1.0; - else if(r > RatioThresh2) statusTS = 0.93; - h2reportMap->getTH2F()->SetBinContent(mod+1,sec+1,statusTS); + h2TSratio->getTH2F()->SetBinContent(mod+1,sec+1,r); + hTSratio->Fill(r); + float statusTS = 1.0; + if(r > RatioThresh1) statusTS = repChanWarning; + else if(r > 0.99) statusTS = repChanBAD; + float gChanStatus = statusTS; + if(ChanStatus > 0.) gChanStatus = repChanBAD; // RMS + if(h2digierr->getTProfile2D()->GetBinContent(mod+1,sec+1)>QIEerrThreshold) + gChanStatus = repChanBAD; + h2reportMap->getTH2F()->SetBinContent(mod+1,sec+1,gChanStatus); + if(gChanStatus > repChanBAD) ++nGoodCh; } - -// } //end if(ievt_ %100 == 0) { - + hReport->Fill(float(nGoodCh)/224.); return; } + +int CastorDigiMonitor::ModSecToIndex(int module, int sector) { + int ind = sector + module*16; + if(ind>223) ind=223; + return(ind); +} From 11223ce416c239a444ddbbccd1395a4f9ba51534 Mon Sep 17 00:00:00 2001 From: vladimir Date: Wed, 29 Apr 2015 13:49:36 +0200 Subject: [PATCH 13/14] remove bunch hist --- DQM/CastorMonitor/src/CastorMonitorModule.cc | 32 +++++++++++--------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/DQM/CastorMonitor/src/CastorMonitorModule.cc b/DQM/CastorMonitor/src/CastorMonitorModule.cc index 2f465ff268a9b..75c4128c953a6 100644 --- a/DQM/CastorMonitor/src/CastorMonitorModule.cc +++ b/DQM/CastorMonitor/src/CastorMonitorModule.cc @@ -1,4 +1,4 @@ -#include "DQM/CastorMonitor/interface/CastorMonitorModule.h" +#include #include "DataFormats/FEDRawData/interface/FEDNumbering.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ESHandle.h" @@ -19,18 +19,19 @@ //==================================================================// //======================= Constructor ==============================// -CastorMonitorModule::CastorMonitorModule(const edm::ParameterSet& ps): - fVerbosity{ps.getUntrackedParameter("debug", 0)} +CastorMonitorModule::CastorMonitorModule(const edm::ParameterSet& ps) { - if(fVerbosity>0) std::cout<<"CastorMonitorModule Constructor(start)"<("rawLabel"); - inputLabelReport_ = ps.getParameter("unpackerReportLabel"); - inputLabelDigi_ = ps.getParameter("digiLabel"); - inputLabelRecHitCASTOR_ = ps.getParameter("CastorRecHitLabel"); - NBunchesOrbit = ps.getUntrackedParameter("nBunchesOrbit",3563); - showTiming_ = ps.getUntrackedParameter("showTiming",false); - inputLabelCastorTowers_ = ps.getParameter("CastorTowerLabel"); + inputLabelRaw_ = ps.getParameter("rawLabel"); + inputLabelReport_ = ps.getParameter("unpackerReportLabel"); + inputLabelDigi_ = ps.getParameter("digiLabel"); + inputLabelRecHitCASTOR_ = ps.getParameter("CastorRecHitLabel"); + NBunchesOrbit = ps.getUntrackedParameter("nBunchesOrbit",3563); + fVerbosity = ps.getUntrackedParameter("debug", 0); + showTiming_ = ps.getUntrackedParameter("showTiming",false); + inputLabelCastorTowers_ = ps.getParameter("CastorTowerLabel"); + JetAlgorithm = ps.getParameter("CastorBasicJetsLabel"); +// trigResultsSource = ps.getParameter("HLTtriggerResults"); +// trigResultsSource = ps.getParameter("triggerResults"); //dump2database_ = ps.getUntrackedParameter("dump2database",false); irun_=0; @@ -111,7 +112,6 @@ void CastorMonitorModule::bookHistograms(DQMStore::IBooker& ibooker, CastorEventProduct->getTH1F()->GetXaxis()->SetBinLabel(3,"CastorDigi"); CastorEventProduct->getTH1F()->GetXaxis()->SetBinLabel(4,"CastorRecHits"); -// reset(); if(fVerbosity>0) std::cout<<"CastorMonitorModule::bookHistogram(end)"<< std::endl; return; @@ -190,7 +190,7 @@ void CastorMonitorModule::analyze(const edm::Event& iEvent, const edm::EventSetu CastorEventProduct->Fill(3,int(rechitOK_)); // if((DigiMon_!=NULL) && (evtMask&DO_CASTOR_PED_CALIBMON) && digiOK_) - if(digiOK_) DigiMon_->processEvent(*CastorDigi,*conditions_,ibunch_); + if(digiOK_) DigiMon_->processEvent(*CastorDigi,*conditions_); if (showTiming_){ cpu_timer.stop(); if (DigiMon_!=NULL) std::cout <<"TIMER:: DIGI MONITOR ->"<processEvent(*CastorHits,*hltResults); RecHitMon_->processEvent(*CastorHits); edm::Handle castorTowers; iEvent.getByLabel(inputLabelCastorTowers_,castorTowers); RecHitMon_->processEventTowers(*castorTowers); + edm::Handle jets; + iEvent.getByLabel(JetAlgorithm,jets); + RecHitMon_->processEventJets(*jets); } if (showTiming_){ From 6a60584a3571ca4ec562ed6e0bd7985c1d6e6157 Mon Sep 17 00:00:00 2001 From: vladimir Date: Wed, 29 Apr 2015 13:49:48 +0200 Subject: [PATCH 14/14] remove bunch hist --- DQM/CastorMonitor/interface/CastorMonitorModule.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/DQM/CastorMonitor/interface/CastorMonitorModule.h b/DQM/CastorMonitor/interface/CastorMonitorModule.h index 98b9d4d13b4a7..67ef832402afd 100644 --- a/DQM/CastorMonitor/interface/CastorMonitorModule.h +++ b/DQM/CastorMonitor/interface/CastorMonitorModule.h @@ -32,6 +32,8 @@ #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h" +#include "DataFormats/Common/interface/TriggerResults.h" +#include "FWCore/Common/interface/TriggerNames.h" #include "DataFormats/CastorReco/interface/CastorTower.h" #include "DataFormats/CastorReco/interface/CastorCluster.h" @@ -118,6 +120,9 @@ class CastorMonitorModule : public DQMEDAnalyzer{ edm::InputTag inputLabelCastorTowers_; typedef std::vector CastorTowerCollection; + edm::InputTag JetAlgorithm; +// edm::InputTag trigResultsSource; + CastorRecHitMonitor* RecHitMon_; CastorDigiMonitor* DigiMon_; CastorLEDMonitor* LedMon_;