diff --git a/DQM/CastorMonitor/interface/CastorDigiMonitor.h b/DQM/CastorMonitor/interface/CastorDigiMonitor.h index 900b93bda88b5..7b4d16fcc2362 100644 --- a/DQM/CastorMonitor/interface/CastorDigiMonitor.h +++ b/DQM/CastorMonitor/interface/CastorDigiMonitor.h @@ -19,23 +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 diff --git a/DQM/CastorMonitor/interface/CastorMonitorModule.h b/DQM/CastorMonitor/interface/CastorMonitorModule.h index 016c632caa0e8..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" @@ -115,6 +117,12 @@ class CastorMonitorModule : public DQMEDAnalyzer{ edm::InputTag inputLabelDigi_; edm::InputTag inputLabelRecHitCASTOR_; + edm::InputTag inputLabelCastorTowers_; + typedef std::vector CastorTowerCollection; + + edm::InputTag JetAlgorithm; +// edm::InputTag trigResultsSource; + CastorRecHitMonitor* RecHitMon_; CastorDigiMonitor* DigiMon_; CastorLEDMonitor* LedMon_; diff --git a/DQM/CastorMonitor/interface/CastorRecHitMonitor.h b/DQM/CastorMonitor/interface/CastorRecHitMonitor.h index 0759e422a9654..5d3d552a5e002 100644 --- a/DQM/CastorMonitor/interface/CastorRecHitMonitor.h +++ b/DQM/CastorMonitor/interface/CastorRecHitMonitor.h @@ -6,6 +6,18 @@ #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" + +#include "DataFormats/Common/interface/TriggerResults.h" + class CastorRecHitMonitor: public CastorBaseMonitor { public: CastorRecHitMonitor(const edm::ParameterSet& ps); @@ -14,15 +26,25 @@ 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); + void processEventJets(const reco::BasicJetCollection& Jets); private: int ievt_; float energyInEachChannel[14][16]; std::string subsystemname; + MonitorElement *hTowerE; + MonitorElement *hTowerDepth; + MonitorElement *h2TowerEMhad; + MonitorElement *hTowerMultipl; + MonitorElement *hJetsMultipl; + MonitorElement *hJetEnergy; + MonitorElement *hJetEta; + MonitorElement *hJetPhi; + TH2F *h2RecHitMap; - //MonitorElement* h2RHchan; - //MonitorElement* h2RHvsSec; + MonitorElement* h2RHchan; + MonitorElement* h2RHvsSec; MonitorElement* h2RHmap; MonitorElement* h2RHoccmap; MonitorElement* h2RHentriesMap; diff --git a/DQM/CastorMonitor/src/CastorDigiMonitor.cc b/DQM/CastorMonitor/src/CastorDigiMonitor.cc index cabd9806a8346..320645376ee1d 100644 --- a/DQM/CastorMonitor/src/CastorDigiMonitor.cc +++ b/DQM/CastorMonitor/src/CastorDigiMonitor.cc @@ -11,12 +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 = 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 ===============================// @@ -38,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.); @@ -64,22 +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,"QmeanfC_map(allTS)"); + + 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; @@ -153,8 +218,46 @@ 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 nGoodCh = 0; + for(int mod=0; mod<14; mod++) for(int sec=0; sec<16;sec++) { + 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=0; tsgetTH2F()->GetBinContent(ind+1,ts+1); + float r = 0.; + if(am > 0.) r = sum/(TS_MAX-1)/am; + 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; + } + 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); +} diff --git a/DQM/CastorMonitor/src/CastorMonitorModule.cc b/DQM/CastorMonitor/src/CastorMonitorModule.cc index 1f376d85baf44..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,14 +190,24 @@ 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); + if(rechitOK_) { +// RecHitMon_->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_){ cpu_timer.stop(); if (RecHitMon_!=NULL) std::cout <<"TIMER:: RECHIT MONITOR ->"<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 j=1; jgetTH2F()->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.); + yErh[0] = 0.; yErh[1] = E0; + for(int j=1; jgetTH2F()->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,"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"); @@ -73,16 +98,70 @@ 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"); + + 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(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 ) +void CastorRecHitMonitor::processEvent(const CastorRecHitCollection& castorHits) { if(fVerbosity>0) std::cout << "CastorRecHitMonitor::processEvent (begin)"<< std::endl; ievt_++; @@ -94,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(); @@ -112,18 +194,20 @@ 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++) { - //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); + etot += es; } // end for(int phi=0; if(ievt_ %100 == 0) @@ -135,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); +} +