From 16118950de14cd9b61f2ae3638629eef392a8997 Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 16 Jul 2015 12:21:47 +0200 Subject: [PATCH 1/3] Addition of histograms for SiStrip : Cluster widths vs amplitudes --- .../interface/SiStripMonitorCluster.h | 9 ++ .../python/SiStripMonitorCluster_cfi.py | 13 +++ .../src/SiStripMonitorCluster.cc | 102 +++++++++++++++++- 3 files changed, 120 insertions(+), 4 deletions(-) diff --git a/DQM/SiStripMonitorCluster/interface/SiStripMonitorCluster.h b/DQM/SiStripMonitorCluster/interface/SiStripMonitorCluster.h index 69758d997706b..40ec3e7f16cf0 100644 --- a/DQM/SiStripMonitorCluster/interface/SiStripMonitorCluster.h +++ b/DQM/SiStripMonitorCluster/interface/SiStripMonitorCluster.h @@ -56,6 +56,7 @@ class SiStripMonitorCluster : public DQMEDAnalyzer { MonitorElement* ClusterSignalOverNoiseVsPos = 0; MonitorElement* ModuleLocalOccupancy = 0; MonitorElement* NrOfClusterizedStrips = 0; // can be used at client level for occupancy calculations + MonitorElement* Module_ClusWidthVsAmpTH2 = 0; }; struct LayerMEs{ // MEs for Layer Level @@ -71,6 +72,7 @@ class SiStripMonitorCluster : public DQMEDAnalyzer { MonitorElement* LayerLocalOccupancyTrend = 0; MonitorElement* LayerNumberOfClusterProfile = 0; MonitorElement* LayerClusterWidthProfile = 0; + MonitorElement* LayerClusWidthVsAmpTH2 = 0; }; @@ -84,6 +86,7 @@ class SiStripMonitorCluster : public DQMEDAnalyzer { MonitorElement* SubDetApvDBxProf2 = 0; MonitorElement* SubDetClusterChargeTH1 = 0; MonitorElement* SubDetClusterWidthTH1 = 0; + MonitorElement* SubDetClusWidthVsAmpTH2 = 0; }; struct ClusterProperties { // Cluster Properties @@ -104,6 +107,7 @@ class SiStripMonitorCluster : public DQMEDAnalyzer { MonitorElement* NumberOfStripClus = 0; MonitorElement* BPTXrateTrend = 0; MonitorElement* NclusVsCycleTimeProf2D = 0; + MonitorElement* ClusWidthVsAmpTH2 = 0; private: @@ -123,6 +127,7 @@ class SiStripMonitorCluster : public DQMEDAnalyzer { inline void fillME(MonitorElement* ME,float value1,float value2,float value3,float value4){if (ME!=0)ME->Fill(value1,value2,value3,value4);} MonitorElement * bookMETrend(const char* , DQMStore::IBooker & ibooker); MonitorElement* bookME1D(const char* ParameterSetLabel, const char* HistoName , DQMStore::IBooker & ibooker); + MonitorElement* bookME2D(const char* ParameterSetLabel, const char* HistoName , DQMStore::IBooker & ibooker); edm::ParameterSet conf_; std::map ModuleMEsMap; @@ -159,6 +164,7 @@ class SiStripMonitorCluster : public DQMEDAnalyzer { bool layerswitchnrclusterizedstrip; bool layerswitchnumclusterprofon; bool layerswitchclusterwidthprofon; + bool layer_clusterWidth_vs_amplitude_on; bool globalswitchstripnoise2apvcycle; bool globalswitchstripnoise3apvcycle; @@ -174,6 +180,7 @@ class SiStripMonitorCluster : public DQMEDAnalyzer { bool moduleswitchcluswidthon; bool moduleswitchlocaloccupancy; bool moduleswitchnrclusterizedstrip; + bool module_clusterWidth_vs_amplitude_on; bool subdetswitchtotclusprofon; bool subdetswitchapvcycleprofon; bool subdetswitchapvcycleth2on; @@ -182,6 +189,7 @@ class SiStripMonitorCluster : public DQMEDAnalyzer { bool subdetswitchtotclusth1on; bool subdetswitchcluschargeon; bool subdetswitchcluswidthon; + bool subdet_clusterWidth_vs_amplitude_on; bool globalswitchapvcycledbxth2on; bool globalswitchcstripvscpix; bool globalswitchMultiRegions; @@ -189,6 +197,7 @@ class SiStripMonitorCluster : public DQMEDAnalyzer { bool createTrendMEs; bool trendVsLs_; bool globalswitchnclusvscycletimeprof2don; + bool clusterWidth_vs_amplitude_on; bool Mod_On_; bool ClusterHisto_; diff --git a/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py b/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py index 38dbf48ee4ebc..21a6150419925 100644 --- a/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py +++ b/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py @@ -271,6 +271,19 @@ globalswitchon = cms.bool(True) ), + ClusWidthVsAmpTH2 = cms.PSet( + Nbinsx = cms.int32(2000), + xmin = cms.double(0.), + xmax = cms.double(2000.), + Nbinsy = cms.int32(100), + ymin = cms.double(0.), + ymax = cms.double(100.), + globalswitchon = cms.bool(False), + subdetswitchon = cms.bool(True), + layerswitchon = cms.bool(True), + moduleswitchon = cms.bool(False) + ), + Mod_On = cms.bool(True), ClusterHisto = cms.bool(False), diff --git a/DQM/SiStripMonitorCluster/src/SiStripMonitorCluster.cc b/DQM/SiStripMonitorCluster/src/SiStripMonitorCluster.cc index dfafd9e6c664c..f27b0960ae75b 100644 --- a/DQM/SiStripMonitorCluster/src/SiStripMonitorCluster.cc +++ b/DQM/SiStripMonitorCluster/src/SiStripMonitorCluster.cc @@ -161,6 +161,12 @@ SiStripMonitorCluster::SiStripMonitorCluster(const edm::ParameterSet& iConfig) edm::ParameterSet ParametersNclusVsCycleTimeProf2D = conf_.getParameter("NclusVsCycleTimeProf2D"); globalswitchnclusvscycletimeprof2don = ParametersNclusVsCycleTimeProf2D.getParameter("globalswitchon"); + edm::ParameterSet ParametersClusWidthVsAmpTH2 = conf_.getParameter("ClusWidthVsAmpTH2"); + clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter("globalswitchon"); + layer_clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter("layerswitchon"); + subdet_clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter("subdetswitchon"); + module_clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter("moduleswitchon"); + clustertkhistomapon = conf_.getParameter("TkHistoMap_On"); createTrendMEs = conf_.getParameter("CreateTrendMEs"); trendVsLs_ = conf_.getParameter("TrendVsLS"); @@ -417,6 +423,19 @@ void SiStripMonitorCluster::createMEs(const edm::EventSetup& es , DQMStore::IBoo 0 , 0 ); if (NclusVsCycleTimeProf2D->kind() == MonitorElement::DQM_KIND_TPROFILE2D) NclusVsCycleTimeProf2D->getTH1()->SetCanExtend(TH1::kAllAxes); } + if ( clusterWidth_vs_amplitude_on ) { + ibooker.setCurrentFolder(topFolderName_+"/MechanicalView/"); + edm::ParameterSet ParametersClusWidthVsAmpTH2 = conf_.getParameter("ClusWidthVsAmpTH2"); + const char* HistoName = "ClusterWidths_vs_Amplitudes"; + const char* HistoTitle = "Cluster widths vs amplitudes;Amplitudes (integrated ADC counts);Cluster widths"; + ClusWidthVsAmpTH2 = ibooker.book2D(HistoName,HistoTitle, + ParametersClusWidthVsAmpTH2.getParameter("Nbinsx"), + ParametersClusWidthVsAmpTH2.getParameter("xmin"), + ParametersClusWidthVsAmpTH2.getParameter("xmax"), + ParametersClusWidthVsAmpTH2.getParameter("Nbinsy"), + ParametersClusWidthVsAmpTH2.getParameter("ymin"), + ParametersClusWidthVsAmpTH2.getParameter("ymax")); + } if (ClusterHisto_){ ibooker.setCurrentFolder(topFolderName_+"/MechanicalView/"); @@ -439,7 +458,6 @@ void SiStripMonitorCluster::createMEs(const edm::EventSetup& es , DQMStore::IBoo NumberOfStripClus->setAxisTitle("Number of Events", 2); } - }//end of if }//end of method @@ -674,9 +692,20 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe { if (subdetswitchcluschargeon) iSubdet->second.SubDetClusterChargeTH1->Fill(cluster_signal); if (subdetswitchcluswidthon) iSubdet->second.SubDetClusterWidthTH1->Fill(cluster_width); - } + } } - } // end loop over clusters + + + 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 ( clusterWidth_vs_amplitude_on ) { + ClusWidthVsAmpTH2->Fill(cluster_signal, cluster_width); + } + + } // end loop over clusters 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); @@ -760,7 +789,7 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe sdetmes.SubDetClusterDBxCycleProf->Fill(dbxincycle,sdetmes.totNClusters); if (subdetswitchapvcycledbxprof2on) sdetmes.SubDetApvDBxProf2->Fill(tbx_corr%70,dbx,sdetmes.totNClusters); - } + } if ( globalswitchnclusvscycletimeprof2don ) { @@ -795,6 +824,7 @@ void SiStripMonitorCluster::ResetModuleMEs(uint32_t idet){ if (moduleswitchclusstonon) mod_me.ClusterSignalOverNoise->Reset(); if (moduleswitchlocaloccupancy) mod_me.ModuleLocalOccupancy->Reset(); if (moduleswitchnrclusterizedstrip) mod_me.NrOfClusterizedStrips->Reset(); + if (module_clusterWidth_vs_amplitude_on) mod_me.Module_ClusWidthVsAmpTH2->Reset(); } // // -- Create Module Level MEs @@ -895,6 +925,25 @@ void SiStripMonitorCluster::createModuleMEs(ModMEs& mod_single, uint32_t detid , ibooker.tag(mod_single.NrOfClusterizedStrips, detid); mod_single.NrOfClusterizedStrips->setAxisTitle("number of clusterized strips"); } + + if (module_clusterWidth_vs_amplitude_on){ + hid = hidmanager.createHistoId("ClusterWidths_vs_Amplitudes","det",detid); + Parameters = conf_.getParameter("ClusWidthVsAmpTH2"); + int32_t Nbinsx = Parameters.getParameter("Nbinsx"); + Nbinsx = Nbinsx/2; //Without this "rebinning" the job is killed on lxplus. We think it's due to the high memory needed to create all those histograms. + mod_single.Module_ClusWidthVsAmpTH2 = ibooker.book2D(hid.c_str() , hid.c_str(), + Nbinsx, + Parameters.getParameter("xmin"), + Parameters.getParameter("xmax"), + Parameters.getParameter("Nbinsy"), + Parameters.getParameter("ymin"), + Parameters.getParameter("ymax") + ); + ibooker.tag(mod_single.Module_ClusWidthVsAmpTH2, detid); + mod_single.Module_ClusWidthVsAmpTH2->setAxisTitle("Amplitudes (integrated ADC counts)",1); + mod_single.Module_ClusWidthVsAmpTH2->setAxisTitle("Cluster widths",2); + } + } // // -- Create Module Level MEs @@ -916,6 +965,7 @@ void SiStripMonitorCluster::createLayerMEs(std::string label, int ndets , DQMSto layerMEs.LayerLocalOccupancyTrend = 0; layerMEs.LayerNumberOfClusterProfile = 0; layerMEs.LayerClusterWidthProfile = 0; + layerMEs.LayerClusWidthVsAmpTH2 = 0; //Cluster Width if(layerswitchcluswidthon) { @@ -964,6 +1014,11 @@ void SiStripMonitorCluster::createLayerMEs(std::string label, int ndets , DQMSto layerMEs.LayerClusterWidthProfile = ibooker.bookProfile(hid, hid, ndets, 0.5, ndets+0.5, 20, -0.5, 19.5); } + if(layer_clusterWidth_vs_amplitude_on) { + layerMEs.LayerClusWidthVsAmpTH2=bookME2D("ClusWidthVsAmpTH2", hidmanager.createHistoLayer("ClusterWidths_vs_Amplitudes","layer",label,"").c_str() , ibooker ); + } + + LayerMEsMap[label]=layerMEs; } // @@ -981,6 +1036,7 @@ void SiStripMonitorCluster::createSubDetMEs(std::string label , DQMStore::IBooke subdetMEs.SubDetApvDBxProf2 = 0; subdetMEs.SubDetClusterChargeTH1 = 0; subdetMEs.SubDetClusterWidthTH1 = 0; + subdetMEs.SubDetClusWidthVsAmpTH2 = 0; std::string HistoName; // cluster charge @@ -1055,6 +1111,25 @@ void SiStripMonitorCluster::createSubDetMEs(std::string label , DQMStore::IBooke subdetMEs.SubDetClusterApvTH2->setAxisTitle("Total # of Clusters",2); } + + // Cluster widths vs amplitudes - 2D + if(subdet_clusterWidth_vs_amplitude_on){ + edm::ParameterSet Parameters = conf_.getParameter("ClusWidthVsAmpTH2"); + HistoName = "ClusterWidths_vs_Amplitudes__" + label; + subdetMEs.SubDetClusWidthVsAmpTH2=ibooker.book2D(HistoName,HistoName, + Parameters.getParameter("Nbinsx"), + Parameters.getParameter("xmin"), + Parameters.getParameter("xmax"), + Parameters.getParameter("Nbinsy"), + Parameters.getParameter("ymin"), + Parameters.getParameter("ymax")); + subdetMEs.SubDetClusWidthVsAmpTH2->setAxisTitle("Amplitudes (integrated ADC counts)",1); + subdetMEs.SubDetClusWidthVsAmpTH2->setAxisTitle("Cluster widths",2); + + } + + + // Total Number of Cluster vs DeltaBxCycle - Profile if(subdetswitchdbxcycleprofon){ edm::ParameterSet Parameters = conf_.getParameter("TProfClustersVsDBxCycle"); @@ -1123,6 +1198,7 @@ void SiStripMonitorCluster::fillModuleMEs(ModMEs& mod_mes, ClusterProperties& cl if(moduleswitchcluschargeon && (mod_mes.ClusterCharge)) // charge of cluster (mod_mes.ClusterCharge)->Fill(cluster.charge); + if(module_clusterWidth_vs_amplitude_on) (mod_mes.Module_ClusWidthVsAmpTH2)->Fill(cluster.charge, cluster.width); } // // -- Fill Layer Level MEs @@ -1157,6 +1233,9 @@ void SiStripMonitorCluster::fillLayerMEs(LayerMEs& layerMEs, ClusterProperties& } } + if( layer_clusterWidth_vs_amplitude_on ) { + fillME(layerMEs.LayerClusWidthVsAmpTH2, cluster.charge, cluster.width); + } } //------------------------------------------------------------------------------------------ MonitorElement* SiStripMonitorCluster::bookMETrend(const char* HistoName , DQMStore::IBooker & ibooker) @@ -1184,6 +1263,21 @@ MonitorElement* SiStripMonitorCluster::bookME1D(const char* ParameterSetLabel, c ); } +//------------------------------------------------------------------------------------------ +MonitorElement* SiStripMonitorCluster::bookME2D(const char* ParameterSetLabel, const char* HistoName , DQMStore::IBooker & ibooker) +{ + Parameters = conf_.getParameter(ParameterSetLabel); + return ibooker.book2D(HistoName,HistoName, + Parameters.getParameter("Nbinsx"), + Parameters.getParameter("xmin"), + Parameters.getParameter("xmax"), + Parameters.getParameter("Nbinsy"), + Parameters.getParameter("ymin"), + Parameters.getParameter("ymax") + ); +} + + int SiStripMonitorCluster::FindRegion(int nstrip,int npix){ double kplus= k0*(1+dk0/100); From 3c585b3d64a3886066b8e15be1dfbee89be6e886 Mon Sep 17 00:00:00 2001 From: Hugo Delannoy Date: Mon, 17 Aug 2015 10:57:51 +0200 Subject: [PATCH 2/3] Update SiStripMonitorCluster_cfi.py --- DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py b/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py index 21a6150419925..094c907a35f64 100644 --- a/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py +++ b/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py @@ -279,8 +279,8 @@ ymin = cms.double(0.), ymax = cms.double(100.), globalswitchon = cms.bool(False), - subdetswitchon = cms.bool(True), - layerswitchon = cms.bool(True), + subdetswitchon = cms.bool(False), + layerswitchon = cms.bool(False), moduleswitchon = cms.bool(False) ), From 19f75c57f641f7ab81600daa19adeb8f5906be8c Mon Sep 17 00:00:00 2001 From: Hugo Delannoy Date: Mon, 17 Aug 2015 10:59:19 +0200 Subject: [PATCH 3/3] Update SiStripMonitorCluster_cfi.py --- DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py b/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py index 094c907a35f64..416dff51c78e3 100644 --- a/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py +++ b/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py @@ -278,7 +278,7 @@ Nbinsy = cms.int32(100), ymin = cms.double(0.), ymax = cms.double(100.), - globalswitchon = cms.bool(False), + globalswitchon = cms.bool(True), subdetswitchon = cms.bool(False), layerswitchon = cms.bool(False), moduleswitchon = cms.bool(False)