From a071572e7fdb623df1f53156915db0c70423b839 Mon Sep 17 00:00:00 2001 From: gflouris Date: Wed, 21 Jun 2017 15:13:37 +0200 Subject: [PATCH] #clusters per layer and ring - TProfile2D --- .../python/SiStripMonitorCluster_cfi.py | 68 ++++++------- .../src/SiStripMonitorCluster.cc | 95 ++++++++++++------- 2 files changed, 96 insertions(+), 67 deletions(-) diff --git a/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py b/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py index e315832154479..910487e302faf 100644 --- a/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py +++ b/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py @@ -4,7 +4,7 @@ SiStripMonitorCluster = cms.EDAnalyzer("SiStripMonitorCluster", ClusterProducerStrip = cms.InputTag('siStripClusters'), ClusterProducerPix = cms.InputTag('siPixelClusters'), - + ResetMEsEachRun = cms.bool(False), StripQualityLabel = cms.string(''), @@ -17,15 +17,15 @@ TkHistoMap_On = cms.bool(True), ClusterChTkHistoMap_On = cms.bool(True), - + TopFolderName = cms.string('SiStrip'), BPTXfilter = cms.PSet(), PixelDCSfilter = cms.PSet(), StripDCSfilter = cms.PSet(), - + CreateTrendMEs = cms.bool(False), - TrendVsLS = cms.bool(False), + TrendVsLS = cms.bool(False), Trending = cms.PSet( Nbins = cms.int32(600), @@ -34,7 +34,7 @@ xaxis = cms.string('Event Time in Seconds') ), - TrendingLS = cms.PSet( + TrendingLS = cms.PSet( Nbins = cms.int32(2400), xmin = cms.double(0.0), xmax = cms.double(150), @@ -69,7 +69,7 @@ xmax = cms.double(767.5), layerswitchon = cms.bool(False), moduleswitchon = cms.bool(False) - ), + ), TH1ModuleLocalOccupancy = cms.PSet( Nbinx = cms.int32(51), xmin = cms.double(-0.01), @@ -103,7 +103,7 @@ ), TH1ClusterCharge = cms.PSet( Nbinx = cms.int32(200), - xmin = cms.double(-0.5), + xmin = cms.double(-0.5), xmax = cms.double(799.5), layerswitchon = cms.bool(False), moduleswitchon = cms.bool(True), @@ -113,7 +113,7 @@ Nbinx = cms.int32(20), xmin = cms.double(-0.5), xmax = cms.double(19.5), - layerswitchon = cms.bool(False), + layerswitchon = cms.bool(False), moduleswitchon = cms.bool(True), subdetswitchon = cms.bool(False) ), @@ -122,18 +122,18 @@ Nbinx = cms.int32(100), xmin = cms.double(-0.5), xmax = cms.double(499.5), - layerswitchon = cms.bool(False), - moduleswitchon = cms.bool(False) + layerswitchon = cms.bool(False), + moduleswitchon = cms.bool(False) ), - + TProfClusterWidth = cms.PSet( Nbinx = cms.int32(100), xmin = cms.double(-0.5), xmax = cms.double(499.5), - layerswitchon = cms.bool(False), - moduleswitchon = cms.bool(False) + layerswitchon = cms.bool(False), + moduleswitchon = cms.bool(False) ), - + ClusterConditions = cms.PSet( minWidth = cms.double(0.0), On = cms.bool(True), @@ -152,7 +152,7 @@ xmax = cms.double(14999.5), subdetswitchon = cms.bool(False) ), - + TProfClustersApvCycle = cms.PSet( Nbins = cms.int32(70), xmin = cms.double(-0.5), @@ -172,7 +172,7 @@ yfactor = cms.double(0.2), subdetswitchon = cms.bool(False) ), - + TProfClustersVsDBxCycle = cms.PSet( Nbins = cms.int32(800), xmin = cms.double(0.5), @@ -181,14 +181,14 @@ ymax = cms.double(0.0), subdetswitchon = cms.bool(True) ), - + TH1ABx_CSCP = cms.PSet( Nbinsx = cms.int32(3565), xmin = cms.double(0.), xmax = cms.double(3564), subdetswitchon = cms.bool(True) ), - + TProf2ApvCycleVsDBx = cms.PSet( Nbinsx = cms.int32(70), xmin = cms.double(-0.5), @@ -200,7 +200,7 @@ zmax = cms.double(0.0), subdetswitchon = cms.bool(False) ), - + TH2ApvCycleVsDBxGlobal = cms.PSet( Nbinsx = cms.int32(70), xmin = cms.double(-0.5), @@ -234,7 +234,7 @@ ymax = cms.double(29999.5), globalswitchon = cms.bool(True) ), - + MultiplicityRegions = cms.PSet( k0 = cms.double(0.188), # k from linear fit of the diagonal default 0.13 q0 = cms.double(300), # +/- variation of y axis intercept default 300 @@ -242,20 +242,20 @@ MaxClus = cms.double(26000), #Divide Region 2 and Region 3 default 20000 MinPix = cms.double(50) # minimum number of Pix clusters to flag events with zero Si clusters default 50 ), - + TH1MultiplicityRegions = cms.PSet( Nbinx = cms.int32(5), xmin = cms.double(0.5), xmax = cms.double(5.5), globalswitchon = cms.bool(False) - ), + ), TH1MainDiagonalPosition= cms.PSet( Nbinsx = cms.int32(100), xmin = cms.double(0.), xmax = cms.double(2.), globalswitchon = cms.bool(False) - ), + ), TProfMainDiagonalPosition= cms.PSet( Nbinsx = cms.int32(3565), @@ -276,16 +276,16 @@ ymax = cms.double(2.), globalswitchon = cms.bool(False) ), - + TH1NClusPx = cms.PSet( Nbinsx = cms.int32(200), - xmax = cms.double(19999.5), + xmax = cms.double(19999.5), xmin = cms.double(-0.5) ), - + TH1NClusStrip = cms.PSet( Nbinsx = cms.int32(500), - xmax = cms.double(99999.5), + xmax = cms.double(99999.5), xmin = cms.double(-0.5) ), @@ -324,7 +324,7 @@ xmax = cms.double(69.5), globalswitchon = cms.bool(False) ), - + NclusVsCycleTimeProf2D = cms.PSet( Nbins = cms.int32(70), xmin = cms.double(-0.5), @@ -335,7 +335,7 @@ globalswitchon = cms.bool(True) ), - NumberOfClusterPerRingVsTrendVarTH2 = cms.PSet( + NumberOfClusterPerRingVsTrendVar = cms.PSet( Nbinsx = cms.int32(1000), xmin = cms.double(0.), xmax = cms.double(150.), @@ -345,7 +345,7 @@ globalswitchon = cms.bool(True), ), - NumberOfClusterPerLayerTrendVarTH2 = cms.PSet( + NumberOfClusterPerLayerTrendVar = cms.PSet( Nbinsx = cms.int32(1000), xmin = cms.double(0.), xmax = cms.double(150.), @@ -363,7 +363,7 @@ ymin = cms.double(0.), ymax = cms.double(100.), globalswitchon = cms.bool(True), - subdetswitchon = cms.bool(False), + subdetswitchon = cms.bool(False), layerswitchon = cms.bool(False), moduleswitchon = cms.bool(False) ), @@ -373,9 +373,9 @@ HistoryProducer = cms.InputTag("consecutiveHEs"), ApvPhaseProducer = cms.InputTag("APVPhases"), - + UseDCSFiltering = cms.bool(True), - + ShowControlView = cms.bool(False), - ShowReadoutView = cms.bool(False) + ShowReadoutView = cms.bool(False) ) diff --git a/DQM/SiStripMonitorCluster/src/SiStripMonitorCluster.cc b/DQM/SiStripMonitorCluster/src/SiStripMonitorCluster.cc index 445d8a43b46ce..a74c796514790 100644 --- a/DQM/SiStripMonitorCluster/src/SiStripMonitorCluster.cc +++ b/DQM/SiStripMonitorCluster/src/SiStripMonitorCluster.cc @@ -375,7 +375,7 @@ void SiStripMonitorCluster::createMEs(const edm::EventSetup& es , DQMStore::IBoo GlobalTH2Parameters.getParameter("ymax")); GlobalCStripVsCpix->setAxisTitle("Strip Clusters",1); GlobalCStripVsCpix->setAxisTitle("Pix Clusters",2); - + // Absolute Bunch Crossing *********************** edm::ParameterSet GlobalTH1Parameters = conf_.getParameter("TH1ABx_CSCP"); HistoName = "AbsoluteBx_CStripVsCpixel"; @@ -439,8 +439,8 @@ void SiStripMonitorCluster::createMEs(const edm::EventSetup& es , DQMStore::IBoo GlobalTH2MainDiagonalPosition_vs_BX->setAxisTitle("Absolute BX",1); GlobalTH2MainDiagonalPosition_vs_BX->setAxisTitle("tan^{-1}(NPix/k*NStrip))",2); - - + + } // TO BE ADDED !!! @@ -552,7 +552,7 @@ void SiStripMonitorCluster::createMEs(const edm::EventSetup& es , DQMStore::IBoo NumberOfPixelClus_vs_BX->setAxisTitle("Absolute BX", 1); NumberOfPixelClus_vs_BX->setAxisTitle("# of Clusters in Pixel", 2); - + } }//end of if @@ -636,7 +636,7 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe MultiplicityRegion=FindRegion(NStripClusters,NPixClusters); if ( passBPTXfilter_ and passPixelDCSfilter_ and passStripDCSfilter_ ) { - if (globalswitchcstripvscpix) GlobalCStripVsCpix->Fill(NStripClusters,NPixClusters); + if (globalswitchcstripvscpix) GlobalCStripVsCpix->Fill(NStripClusters,NPixClusters); if (globalswitchmaindiagonalposition && NStripClusters > 0) GlobalMainDiagonalPosition->Fill(atan(NPixClusters/(k0*NStripClusters))); if (globalswitchMultiRegions) PixVsStripMultiplicityRegions->Fill(MultiplicityRegion); @@ -672,6 +672,9 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe found_layer_me = true; } + + int ncluster_ring[20] = {0}; + bool found_module_me = false; uint16_t iDet = 0; std::string subdet_label = ""; @@ -785,40 +788,45 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe if (layerswitchclusterwidthprofon) layer_single.LayerClusterWidthProfile->Fill(iDet, cluster_width); } - + if (subdetswitchcluschargeon || subdetswitchcluswidthon) { std::map::iterator iSubdet = SubDetMEsMap.find(subdet_label); - if(iSubdet != SubDetMEsMap.end()) + if(iSubdet != SubDetMEsMap.end()) { if (subdetswitchcluschargeon) iSubdet->second.SubDetClusterChargeTH1->Fill(cluster_signal); if (subdetswitchcluswidthon) iSubdet->second.SubDetClusterWidthTH1->Fill(cluster_width); } } - + if (subdet_clusterWidth_vs_amplitude_on){ std::map::iterator iSubdet = SubDetMEsMap.find(subdet_label); - if(iSubdet != SubDetMEsMap.end()) iSubdet->second.SubDetClusWidthVsAmpTH2->Fill(cluster_signal, cluster_width); + if(iSubdet != SubDetMEsMap.end()) iSubdet->second.SubDetClusWidthVsAmpTH2->Fill(cluster_signal, cluster_width); } if ( clusterWidth_vs_amplitude_on ) { ClusWidthVsAmpTH2->Fill(cluster_signal, cluster_width); } - - if (subdetswitchtotclusprofon) { - std::map::iterator iSubdet = SubDetMEsMap.find(subdet_label); - std::pair det_layer_pair = folder_organizer.GetSubDetAndLayer(detid, tTopo); - if(iSubdet != SubDetMEsMap.end()) iSubdet->second.SubDetNumberOfClusterPerLayerTrend->Fill(trendVar,abs(det_layer_pair.second)); - } if (subdetswitchtotclusprofon && (subdet_label.find("TID")!=std::string::npos || subdet_label.find("TEC")!=std::string::npos)){ - std::pair det_ring_pair = folder_organizer.GetSubDetAndLayer(detid,tTopo,true); - fillME(layer_single.LayerNumberOfClusterPerRingTrend, trendVar, abs(det_ring_pair.second)); + std::pair det_ring_pair = folder_organizer.GetSubDetAndLayer(detid,tTopo,true); + ncluster_ring[abs(det_ring_pair.second)] ++ ; } } // end loop over clusters + if (subdetswitchtotclusprofon) { + std::map::iterator iSubdet = SubDetMEsMap.find(subdet_label); + std::pair det_layer_pair = folder_organizer.GetSubDetAndLayer(detid, tTopo); + iSubdet->second.SubDetNumberOfClusterPerLayerTrend->Fill(trendVar,abs(det_layer_pair.second), ncluster_layer); + } + + if (subdetswitchtotclusprofon && (subdet_label.find("TID")!=std::string::npos || subdet_label.find("TEC")!=std::string::npos)){ + std::pair det_ring_pair = folder_organizer.GetSubDetAndLayer(detid,tTopo,true); + layer_single.LayerNumberOfClusterPerRingTrend->Fill(trendVar, abs(det_ring_pair.second), ncluster_ring[abs(det_ring_pair.second)]); + } + short total_nr_strips = SiStripDetCabling_->nApvPairs(detid) * 2 * 128; // get correct # of avp pairs float local_occupancy = static_cast(total_clusterized_strips)/static_cast(total_nr_strips); if (found_module_me) { @@ -842,7 +850,12 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe std::map::iterator iSubdet = SubDetMEsMap.find(subdet_label); if(iSubdet != SubDetMEsMap.end()) iSubdet->second.totNClusters += ncluster_layer; - } + }///end of layer loop + + + + + // EventHistory edm::Handle event_history; @@ -878,7 +891,7 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe int the_phase = APVCyclePhaseCollection::invalid; long long tbx_corr = tbx; - + if (SubDetPhasePartMap.find(sdet) != SubDetPhasePartMap.end()) the_phase = apv_phase_collection->getPhase(SubDetPhasePartMap[sdet]); if(the_phase==APVCyclePhaseCollection::nopartition || @@ -900,20 +913,20 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe // Fill MainDiagonalPosition plots *************** - if (cluster_detsetvektor_pix.isValid()){ + if (cluster_detsetvektor_pix.isValid()){ if (ClusterHisto_){ if ( passBPTXfilter_ and passStripDCSfilter_ ){ NumberOfStripClus_vs_BX->Fill(tbx%3564,NStripClusters); if(passPixelDCSfilter_ ){ - NumberOfPixelClus_vs_BX->Fill(tbx%3564,NPixClusters); - if (globalswitchmaindiagonalposition && NStripClusters > 0){ + NumberOfPixelClus_vs_BX->Fill(tbx%3564,NPixClusters); + if (globalswitchmaindiagonalposition && NStripClusters > 0){ GlobalMainDiagonalPosition_vs_BX->Fill(tbx%3564,atan(NPixClusters/(k0*NStripClusters))); GlobalTH2MainDiagonalPosition_vs_BX->Fill(tbx%3564,atan(NPixClusters/(k0*NStripClusters))); } } - + } - } + } } if (isPixValid && !MultiplicityRegion_Vs_APVcycle_filled){ @@ -935,18 +948,18 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe } if (subdetswitchapvcycledbxprof2on) sdetmes.SubDetApvDBxProf2->Fill(tbx_corr%70,dbx,sdetmes.totNClusters); - } + } if ( globalswitchnclusvscycletimeprof2don ) { long long tbx_corr = tbx; int the_phase = apv_phase_collection->getPhase("All"); - + if( the_phase == APVCyclePhaseCollection::nopartition || the_phase == APVCyclePhaseCollection::multiphase || the_phase == APVCyclePhaseCollection::invalid ) the_phase=30; - + tbx_corr -= the_phase; NclusVsCycleTimeProf2D->Fill( tbx_corr%70 , (int)event_history->_orbit , NStripClusters ); @@ -1162,8 +1175,17 @@ void SiStripMonitorCluster::createLayerMEs(std::string label, int ndets , DQMSto layerMEs.LayerNumberOfClusterTrend = bookMETrend(hidmanager.createHistoLayer("NumberOfClusterTrend","layer",label,"").c_str(),ibooker); if (label.find("TID")!=std::string::npos || label.find("TEC")!=std::string::npos){ - edm::ParameterSet Parameters = conf_.getParameter("NumberOfClusterPerRingVsTrendVarTH2"); - layerMEs.LayerNumberOfClusterPerRingTrend = bookME2D("NumberOfClusterPerRingVsTrendVarTH2", hidmanager.createHistoLayer("NumberOfClusterPerRing_vs_TrendVar","layer",label,"").c_str() , ibooker ); + edm::ParameterSet Parameters = conf_.getParameter("NumberOfClusterPerRingVsTrendVar"); + + layerMEs.LayerNumberOfClusterPerRingTrend = ibooker.bookProfile2D("NumberOfClusterPerRingVsTrendVar", hidmanager.createHistoLayer("NumberOfClusterPerRing_vs_TrendVar","layer",label,"").c_str(), + Parameters.getParameter("Nbinsx"), + Parameters.getParameter("xmin"), + Parameters.getParameter("xmax"), + Parameters.getParameter("Nbinsy"), + Parameters.getParameter("ymin"), + Parameters.getParameter("ymax"), 0, 0, "" ); + + } } @@ -1236,9 +1258,16 @@ void SiStripMonitorCluster::createSubDetMEs(std::string label , DQMStore::IBooke 0 , 0 , "" ); subdetMEs.SubDetTotClusterProf->setAxisTitle(Parameters.getParameter("xaxis"),1); if (subdetMEs.SubDetTotClusterProf->kind() == MonitorElement::DQM_KIND_TPROFILE) subdetMEs.SubDetTotClusterProf->getTH1()->SetCanExtend(TH1::kAllAxes); - + + Parameters = conf_.getParameter("NumberOfClusterPerLayerTrendVar"); HistoName = "TotalNumberOfClusterPerLayer__" + label; - subdetMEs.SubDetNumberOfClusterPerLayerTrend = bookME2D("NumberOfClusterPerLayerTrendVarTH2", HistoName.c_str() , ibooker ); + subdetMEs.SubDetNumberOfClusterPerLayerTrend = ibooker.bookProfile2D("NumberOfClusterPerLayerTrendVar", HistoName.c_str(), + Parameters.getParameter("Nbinsx"), + Parameters.getParameter("xmin"), + Parameters.getParameter("xmax"), + Parameters.getParameter("Nbinsy"), + Parameters.getParameter("ymin"), + Parameters.getParameter("ymax"), 0, 0, "" ); subdetMEs.SubDetNumberOfClusterPerLayerTrend->setAxisTitle("Lumisection",1); subdetMEs.SubDetNumberOfClusterPerLayerTrend->setAxisTitle("Layer Number",2); } @@ -1298,8 +1327,8 @@ void SiStripMonitorCluster::createSubDetMEs(std::string label , DQMStore::IBooke } - - + + // Total Number of Cluster vs DeltaBxCycle - Profile if(subdetswitchdbxcycleprofon){ edm::ParameterSet Parameters = conf_.getParameter("TProfClustersVsDBxCycle");