Skip to content

Commit

Permalink
Merge pull request #10242 from hdelanno/SiStrip_newHisto_ClusterWidth…
Browse files Browse the repository at this point in the history
…sVsAmplitudes

Addition of histograms for SiStrip : Cluster widths vs amplitudes
  • Loading branch information
cmsbuild committed Sep 3, 2015
2 parents c01403e + 19f75c5 commit 3ad4125
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 4 deletions.
9 changes: 9 additions & 0 deletions DQM/SiStripMonitorCluster/interface/SiStripMonitorCluster.h
Expand Up @@ -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
Expand All @@ -71,6 +72,7 @@ class SiStripMonitorCluster : public DQMEDAnalyzer {
MonitorElement* LayerLocalOccupancyTrend = 0;
MonitorElement* LayerNumberOfClusterProfile = 0;
MonitorElement* LayerClusterWidthProfile = 0;
MonitorElement* LayerClusWidthVsAmpTH2 = 0;

};

Expand All @@ -84,6 +86,7 @@ class SiStripMonitorCluster : public DQMEDAnalyzer {
MonitorElement* SubDetApvDBxProf2 = 0;
MonitorElement* SubDetClusterChargeTH1 = 0;
MonitorElement* SubDetClusterWidthTH1 = 0;
MonitorElement* SubDetClusWidthVsAmpTH2 = 0;
};

struct ClusterProperties { // Cluster Properties
Expand All @@ -104,6 +107,7 @@ class SiStripMonitorCluster : public DQMEDAnalyzer {
MonitorElement* NumberOfStripClus = 0;
MonitorElement* BPTXrateTrend = 0;
MonitorElement* NclusVsCycleTimeProf2D = 0;
MonitorElement* ClusWidthVsAmpTH2 = 0;

private:

Expand All @@ -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<uint32_t, ModMEs> ModuleMEsMap;
Expand Down Expand Up @@ -159,6 +164,7 @@ class SiStripMonitorCluster : public DQMEDAnalyzer {
bool layerswitchnrclusterizedstrip;
bool layerswitchnumclusterprofon;
bool layerswitchclusterwidthprofon;
bool layer_clusterWidth_vs_amplitude_on;

bool globalswitchstripnoise2apvcycle;
bool globalswitchstripnoise3apvcycle;
Expand All @@ -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;
Expand All @@ -182,13 +189,15 @@ class SiStripMonitorCluster : public DQMEDAnalyzer {
bool subdetswitchtotclusth1on;
bool subdetswitchcluschargeon;
bool subdetswitchcluswidthon;
bool subdet_clusterWidth_vs_amplitude_on;
bool globalswitchapvcycledbxth2on;
bool globalswitchcstripvscpix;
bool globalswitchMultiRegions;
bool clustertkhistomapon;
bool createTrendMEs;
bool trendVsLs_;
bool globalswitchnclusvscycletimeprof2don;
bool clusterWidth_vs_amplitude_on;

bool Mod_On_;
bool ClusterHisto_;
Expand Down
13 changes: 13 additions & 0 deletions DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py
Expand Up @@ -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(True),
subdetswitchon = cms.bool(False),
layerswitchon = cms.bool(False),
moduleswitchon = cms.bool(False)
),

Mod_On = cms.bool(True),
ClusterHisto = cms.bool(False),

Expand Down
102 changes: 98 additions & 4 deletions DQM/SiStripMonitorCluster/src/SiStripMonitorCluster.cc
Expand Up @@ -161,6 +161,12 @@ SiStripMonitorCluster::SiStripMonitorCluster(const edm::ParameterSet& iConfig)
edm::ParameterSet ParametersNclusVsCycleTimeProf2D = conf_.getParameter<edm::ParameterSet>("NclusVsCycleTimeProf2D");
globalswitchnclusvscycletimeprof2don = ParametersNclusVsCycleTimeProf2D.getParameter<bool>("globalswitchon");

edm::ParameterSet ParametersClusWidthVsAmpTH2 = conf_.getParameter<edm::ParameterSet>("ClusWidthVsAmpTH2");
clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter<bool>("globalswitchon");
layer_clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter<bool>("layerswitchon");
subdet_clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter<bool>("subdetswitchon");
module_clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter<bool>("moduleswitchon");

clustertkhistomapon = conf_.getParameter<bool>("TkHistoMap_On");
createTrendMEs = conf_.getParameter<bool>("CreateTrendMEs");
trendVsLs_ = conf_.getParameter<bool>("TrendVsLS");
Expand Down Expand Up @@ -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<edm::ParameterSet>("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<int32_t>("Nbinsx"),
ParametersClusWidthVsAmpTH2.getParameter<double>("xmin"),
ParametersClusWidthVsAmpTH2.getParameter<double>("xmax"),
ParametersClusWidthVsAmpTH2.getParameter<int32_t>("Nbinsy"),
ParametersClusWidthVsAmpTH2.getParameter<double>("ymin"),
ParametersClusWidthVsAmpTH2.getParameter<double>("ymax"));
}

if (ClusterHisto_){
ibooker.setCurrentFolder(topFolderName_+"/MechanicalView/");
Expand All @@ -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

Expand Down Expand Up @@ -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<std::string, SubDetMEs>::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<float>(total_clusterized_strips)/static_cast<float>(total_nr_strips);
Expand Down Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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<edm::ParameterSet>("ClusWidthVsAmpTH2");
int32_t Nbinsx = Parameters.getParameter<int32_t>("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<double>("xmin"),
Parameters.getParameter<double>("xmax"),
Parameters.getParameter<int32_t>("Nbinsy"),
Parameters.getParameter<double>("ymin"),
Parameters.getParameter<double>("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
Expand All @@ -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) {
Expand Down Expand Up @@ -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;
}
//
Expand All @@ -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
Expand Down Expand Up @@ -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<edm::ParameterSet>("ClusWidthVsAmpTH2");
HistoName = "ClusterWidths_vs_Amplitudes__" + label;
subdetMEs.SubDetClusWidthVsAmpTH2=ibooker.book2D(HistoName,HistoName,
Parameters.getParameter<int32_t>("Nbinsx"),
Parameters.getParameter<double>("xmin"),
Parameters.getParameter<double>("xmax"),
Parameters.getParameter<int32_t>("Nbinsy"),
Parameters.getParameter<double>("ymin"),
Parameters.getParameter<double>("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<edm::ParameterSet>("TProfClustersVsDBxCycle");
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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<edm::ParameterSet>(ParameterSetLabel);
return ibooker.book2D(HistoName,HistoName,
Parameters.getParameter<int32_t>("Nbinsx"),
Parameters.getParameter<double>("xmin"),
Parameters.getParameter<double>("xmax"),
Parameters.getParameter<int32_t>("Nbinsy"),
Parameters.getParameter<double>("ymin"),
Parameters.getParameter<double>("ymax")
);
}


int SiStripMonitorCluster::FindRegion(int nstrip,int npix){

double kplus= k0*(1+dk0/100);
Expand Down

0 comments on commit 3ad4125

Please sign in to comment.