Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing DCS Filter Application in SiStripClusterMonitor #21433

Merged
merged 12 commits into from
Jan 15, 2018
Expand Up @@ -44,7 +44,7 @@
SiStripMonitorCluster.Mod_On = False
SiStripMonitorCluster.TProfClustersApvCycle.subdetswitchon = True
SiStripMonitorCluster.TProfTotalNumberOfClusters.subdetswitchon = True
SiStripMonitorCluster.TrendVsLS = True
SiStripMonitorCluster.TrendVs10LS = False
SiStripMonitorCluster.TH2CStripVsCpixel.globalswitchon=False
SiStripMonitorCluster.TH1MultiplicityRegions.globalswitchon=False
SiStripMonitorCluster.TH1MainDiagonalPosition.globalswitchon=False
Expand Down
Expand Up @@ -7,7 +7,7 @@
SiStripMonitorCluster.TH1TotalNumberOfClusters.subdetswitchon = True
SiStripMonitorCluster.TProfClustersApvCycle.subdetswitchon = True
SiStripMonitorCluster.TProfTotalNumberOfClusters.subdetswitchon = True
SiStripMonitorCluster.TrendVsLS = True
SiStripMonitorCluster.TrendVs10LS = False
SiStripMonitorCluster.TH2CStripVsCpixel.globalswitchon = True
SiStripMonitorCluster.TH1MultiplicityRegions.globalswitchon = True
SiStripMonitorCluster.TH1MainDiagonalPosition.globalswitchon = True
Expand Down
Expand Up @@ -42,7 +42,7 @@
SiStripMonitorClusterBPTX.TH1TotalNumberOfClusters.subdetswitchon = True
SiStripMonitorClusterBPTX.TProfClustersApvCycle.subdetswitchon = True
SiStripMonitorClusterBPTX.TProfTotalNumberOfClusters.subdetswitchon = True
SiStripMonitorClusterBPTX.TrendVsLS = True
SiStripMonitorClusterBPTX.TrendVs10LS = False
SiStripMonitorClusterBPTX.TH2CStripVsCpixel.globalswitchon = True
SiStripMonitorClusterBPTX.TH1MultiplicityRegions.globalswitchon = True
SiStripMonitorClusterBPTX.TH1MainDiagonalPosition.globalswitchon = True
Expand Down
Expand Up @@ -209,7 +209,7 @@ class SiStripMonitorCluster : public DQMEDAnalyzer {
bool clustertkhistomapon;
bool clusterchtkhistomapon;
bool createTrendMEs;
bool trendVsLs_;
bool trendVs10Ls_;
bool globalswitchnclusvscycletimeprof2don;
bool clusterWidth_vs_amplitude_on;

Expand Down
Expand Up @@ -28,7 +28,7 @@
SiStripCalZeroBiasMonitorCluster.StripDCSfilter = cms.PSet()

SiStripCalZeroBiasMonitorCluster.CreateTrendMEs = cms.bool(False)
SiStripCalZeroBiasMonitorCluster.TrendVsLS = cms.bool(True)
SiStripCalZeroBiasMonitorCluster.TrendVs10LS = cms.bool(False)
SiStripCalZeroBiasMonitorCluster.TH1ClusterNoise = cms.PSet(
Nbinx = cms.int32(20),
xmin = cms.double(-0.5),
Expand Down
10 changes: 5 additions & 5 deletions DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py
Expand Up @@ -25,17 +25,17 @@
StripDCSfilter = cms.PSet(),

CreateTrendMEs = cms.bool(False),
TrendVsLS = cms.bool(True),
TrendVs10LS = cms.bool(False),

Trending = cms.PSet(
Nbins = cms.int32(600),
Nbins = cms.int32(2400),
xmin = cms.double(0.0),
xmax = cms.double(3600.),
xaxis = cms.string('Event Time in Seconds')
xmax = cms.double(150.),
xaxis = cms.string('Lumisection')
),

TrendingLS = cms.PSet(
Nbins = cms.int32(2400),
Nbins = cms.int32(600),
xmin = cms.double(0.0),
xmax = cms.double(150),
xaxis = cms.string('Lumisection')
Expand Down
65 changes: 33 additions & 32 deletions DQM/SiStripMonitorCluster/src/SiStripMonitorCluster.cc
Expand Up @@ -174,7 +174,7 @@ SiStripMonitorCluster::SiStripMonitorCluster(const edm::ParameterSet& iConfig)
clustertkhistomapon = conf_.getParameter<bool>("TkHistoMap_On");
clusterchtkhistomapon = conf_.getParameter<bool>("ClusterChTkHistoMap_On");
createTrendMEs = conf_.getParameter<bool>("CreateTrendMEs");
trendVsLs_ = conf_.getParameter<bool>("TrendVsLS");
trendVs10Ls_ = conf_.getParameter<bool>("TrendVs10LS");
Mod_On_ = conf_.getParameter<bool>("Mod_On");
ClusterHisto_ = conf_.getParameter<bool>("ClusterHisto");

Expand Down Expand Up @@ -615,11 +615,11 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
// std::cout << "passBPTXfilter_ ? " << passBPTXfilter_ << std::endl;

// Filter out events if DCS Event if requested
if (dcsStatus_ && !dcsStatus_->getStatus(iEvent,iSetup)) return;
bool passDCSFilter_ = !(dcsStatus_ && !dcsStatus_->getStatus(iEvent,iSetup));

runNb = iEvent.id().run();
eventNb++;
trendVar = trendVsLs_ ? iEvent.orbitNumber()/262144.0 : iEvent.orbitNumber()/11223.0; // lumisection : seconds
trendVar = trendVs10Ls_ ? iEvent.orbitNumber()/(10*262144.0) : iEvent.orbitNumber()/(1*262144.0); // 10 lumisection : lumisection

int NPixClusters=0, NStripClusters=0, MultiplicityRegion=0;
bool isPixValid=false;
Expand Down Expand Up @@ -654,14 +654,14 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
isPixValid=true;
MultiplicityRegion=FindRegion(NStripClusters,NPixClusters);

if ( passBPTXfilter_ and passPixelDCSfilter_ and passStripDCSfilter_ ) {
if ( passBPTXfilter_ and passPixelDCSfilter_ and passStripDCSfilter_ and passDCSFilter_ ) {
if (globalswitchcstripvscpix) GlobalCStripVsCpix->Fill(NStripClusters,NPixClusters);
if (globalswitchmaindiagonalposition && NStripClusters > 0) GlobalMainDiagonalPosition->Fill(atan(NPixClusters/(k0*NStripClusters)));

if (globalswitchMultiRegions) PixVsStripMultiplicityRegions->Fill(MultiplicityRegion);
}

if (ClusterHisto_){
if (ClusterHisto_ and passDCSFilter_){
if ( passBPTXfilter_ and passPixelDCSfilter_ )
NumberOfPixelClus->Fill(NPixClusters);
if ( passBPTXfilter_ and passStripDCSfilter_ )
Expand Down Expand Up @@ -722,7 +722,7 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe

edmNew::DetSetVector<SiStripCluster>::const_iterator isearch = cluster_detsetvektor->find(detid); // search clusters of detid

if(isearch==cluster_detsetvektor->end()){
if(isearch==cluster_detsetvektor->end() and passDCSFilter_){
if(found_module_me && moduleswitchncluson && (mod_single.NumberOfClusters)){
(mod_single.NumberOfClusters)->Fill(0.); // no clusters for this detector module,fill histogram with 0
}
Expand Down Expand Up @@ -772,15 +772,15 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe


// Filling TkHistoMap with number of clusters for each module
if(clustertkhistomapon) {
if(clustertkhistomapon and passDCSFilter_) {
tkmapcluster->fill(detid,static_cast<float>(cluster_detset.size()));
}

if(moduleswitchncluson && found_module_me && (mod_single.NumberOfClusters != nullptr)){ // nr. of clusters per module
if(moduleswitchncluson && found_module_me && (mod_single.NumberOfClusters != nullptr) && passDCSFilter_){ // nr. of clusters per module
(mod_single.NumberOfClusters)->Fill(static_cast<float>(cluster_detset.size()));
}

if (found_layer_me && layerswitchnumclusterprofon)
if (found_layer_me && layerswitchnumclusterprofon && passDCSFilter_)
layer_single.LayerNumberOfClusterProfile->Fill(iDet, static_cast<float>(cluster_detset.size()));
ncluster_layer += cluster_detset.size();

Expand All @@ -802,7 +802,7 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
// add nr of strips of this cluster to total nr. of clusterized strips
total_clusterized_strips = total_clusterized_strips + cluster_width;

if(clusterchtkhistomapon) tkmapclusterch->fill(detid,static_cast<float>(clusterIter->charge()));
if(clusterchtkhistomapon and passDCSFilter_) tkmapclusterch->fill(detid,static_cast<float>(clusterIter->charge()));

// cluster signal and noise from the amplitudes
float cluster_signal = 0.0;
Expand Down Expand Up @@ -837,10 +837,10 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
cluster_properties.noise = cluster_noise;

// Fill Module Level MEs
if (found_module_me) fillModuleMEs(mod_single, cluster_properties);
if (found_module_me and passDCSFilter_) fillModuleMEs(mod_single, cluster_properties);

// Fill Layer Level MEs
if (found_layer_me) {
if (found_layer_me and passDCSFilter_) {
fillLayerMEs(layer_single, cluster_properties);
if (layerswitchclusterwidthprofon)
layer_single.LayerClusterWidthProfile->Fill(iDet, cluster_width);
Expand All @@ -851,18 +851,18 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
std::map<std::string, SubDetMEs>::iterator iSubdet = SubDetMEsMap.find(subdet_label);
if(iSubdet != SubDetMEsMap.end())
{
if (subdetswitchcluschargeon) iSubdet->second.SubDetClusterChargeTH1->Fill(cluster_signal);
if (subdetswitchcluswidthon) iSubdet->second.SubDetClusterWidthTH1->Fill(cluster_width);
if (subdetswitchcluschargeon and passDCSFilter_) iSubdet->second.SubDetClusterChargeTH1->Fill(cluster_signal);
if (subdetswitchcluswidthon and passDCSFilter_) iSubdet->second.SubDetClusterWidthTH1->Fill(cluster_width);
}
}


if (subdet_clusterWidth_vs_amplitude_on){
if (subdet_clusterWidth_vs_amplitude_on and passDCSFilter_){
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 ) {
if ( clusterWidth_vs_amplitude_on and passDCSFilter_) {
ClusWidthVsAmpTH2->Fill(cluster_signal, cluster_width);
}

Expand All @@ -886,16 +886,16 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe

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);
if (found_module_me) {
if (found_module_me and passDCSFilter_) {
if(moduleswitchnrclusterizedstrip && mod_single.NrOfClusterizedStrips ){ // nr of clusterized strips
mod_single.NrOfClusterizedStrips->Fill(static_cast<float>(total_clusterized_strips));
}

if(moduleswitchlocaloccupancy && mod_single.ModuleLocalOccupancy ){ // Occupancy
if(moduleswitchlocaloccupancy && mod_single.ModuleLocalOccupancy ){ // Occupancy
mod_single.ModuleLocalOccupancy->Fill(local_occupancy);
}
}
if (layerswitchlocaloccupancy && found_layer_me && layer_single.LayerLocalOccupancy) {
if (layerswitchlocaloccupancy && found_layer_me && layer_single.LayerLocalOccupancy && passDCSFilter_) {
fillME(layer_single.LayerLocalOccupancy,local_occupancy);
if (createTrendMEs)
fillME(layer_single.LayerLocalOccupancyTrend,trendVar,local_occupancy);
Expand Down Expand Up @@ -935,7 +935,7 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
bool MultiplicityRegion_Vs_APVcycle_filled=false;

// plot n 2
if ( passBPTXfilter_ and passPixelDCSfilter_ and passStripDCSfilter_ ) {
if ( passBPTXfilter_ and passPixelDCSfilter_ and passStripDCSfilter_ && passDCSFilter_) {
if (globalswitchcstripvscpix) GlobalABXTH1_CSCP->Fill(tbx%3564);
}
// plot n 2
Expand All @@ -961,7 +961,7 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe

long long dbxincycle = event_history->deltaBXinCycle(the_phase);
//std::cout<<"dbx in cycle: " << dbxincycle << std::endl;
if (globalswitchapvcycledbxth2on && !global_histo_filled) {
if (globalswitchapvcycledbxth2on && !global_histo_filled && passDCSFilter_) {
GlobalApvCycleDBxTH2->Fill(tbx_corr%70,dbx);
GlobalDBxTH1->Fill(dbx);
GlobalDBxCycleTH1->Fill(dbxincycle);
Expand All @@ -972,7 +972,7 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
// Fill MainDiagonalPosition plots ***************
if (cluster_detsetvektor_pix.isValid()){
if (ClusterHisto_){
if ( passBPTXfilter_ and passStripDCSfilter_ ){
if ( passBPTXfilter_ and passStripDCSfilter_ and passDCSFilter_){
NumberOfStripClus_vs_BX->Fill(tbx%3564,NStripClusters);
if(passPixelDCSfilter_ ){
NumberOfPixelClus_vs_BX->Fill(tbx%3564,NPixClusters);
Expand All @@ -989,7 +989,8 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
//for(it=FEDID_v_clustersum.begin(); it!=FEDID_v_clustersum.end(); it++){
for ( auto const & fedidEntry : FEDID_v_clustersum ) {
//NumberOfFEDClus->Fill(it->first,it->second);
NumberOfFEDClus->Fill(fedidEntry.first,fedidEntry.second);
if (passDCSFilter_)
NumberOfFEDClus->Fill(fedidEntry.first,fedidEntry.second);
//if(it->first < 100){
// Trend_NumberOfFEDClus->Fill(trendVar,it->first,it->second);
//}
Expand All @@ -999,28 +1000,28 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
}
}

if (isPixValid && !MultiplicityRegion_Vs_APVcycle_filled){
if (isPixValid && !MultiplicityRegion_Vs_APVcycle_filled && passDCSFilter_){
if (globalswitchstripnoise2apvcycle && MultiplicityRegion==2) {StripNoise2Cycle->Fill(tbx_corr%70);}
if (globalswitchstripnoise3apvcycle && MultiplicityRegion==3) {StripNoise3Cycle->Fill(tbx_corr%70);}
MultiplicityRegion_Vs_APVcycle_filled=true;
}

if (subdetswitchtotclusth1on)
if (subdetswitchtotclusth1on and passDCSFilter_)
sdetmes.SubDetTotClusterTH1->Fill(sdetmes.totNClusters);
if (subdetswitchtotclusprofon)
sdetmes.SubDetTotClusterProf->Fill(trendVar,sdetmes.totNClusters);
if (subdetswitchapvcycleprofon)
if (subdetswitchapvcycleprofon and passDCSFilter_)
sdetmes.SubDetClusterApvProf->Fill(tbx_corr%70,sdetmes.totNClusters);
if (subdetswitchapvcycleth2on)
if (subdetswitchapvcycleth2on and passDCSFilter_)
sdetmes.SubDetClusterApvTH2->Fill(tbx_corr%70,sdetmes.totNClusters);
if (subdetswitchdbxcycleprofon) {
if (subdetswitchdbxcycleprofon and passDCSFilter_) {
sdetmes.SubDetClusterDBxCycleProf->Fill(dbxincycle,sdetmes.totNClusters);
}
if (subdetswitchapvcycledbxprof2on)
if (subdetswitchapvcycledbxprof2on and passDCSFilter_)
sdetmes.SubDetApvDBxProf2->Fill(tbx_corr%70,dbx,sdetmes.totNClusters);
}

if ( globalswitchnclusvscycletimeprof2don )
if ( globalswitchnclusvscycletimeprof2don and passDCSFilter_)
{
long long tbx_corr = tbx;
int the_phase = apv_phase_collection->getPhase("All");
Expand Down Expand Up @@ -1319,7 +1320,7 @@ void SiStripMonitorCluster::createSubDetMEs(std::string label , DQMStore::IBooke
}
// Total Number of Cluster vs Time - Profile
if (subdetswitchtotclusprofon){
edm::ParameterSet Parameters = trendVsLs_ ? conf_.getParameter<edm::ParameterSet>("TrendingLS") : conf_.getParameter<edm::ParameterSet>("Trending");
edm::ParameterSet Parameters = trendVs10Ls_ ? conf_.getParameter<edm::ParameterSet>("TrendingLS") : conf_.getParameter<edm::ParameterSet>("Trending");
HistoName = "TotalNumberOfClusterProfile__" + label;
subdetMEs.SubDetTotClusterProf = ibooker.bookProfile(HistoName,HistoName,
Parameters.getParameter<int32_t>("Nbins"),
Expand Down Expand Up @@ -1513,7 +1514,7 @@ void SiStripMonitorCluster::fillLayerMEs(LayerMEs& layerMEs, ClusterProperties&
//------------------------------------------------------------------------------------------
MonitorElement* SiStripMonitorCluster::bookMETrend(const char* HistoName , DQMStore::IBooker & ibooker)
{
edm::ParameterSet ParametersTrend = trendVsLs_ ? conf_.getParameter<edm::ParameterSet>("TrendingLS") : conf_.getParameter<edm::ParameterSet>("Trending");
edm::ParameterSet ParametersTrend = trendVs10Ls_ ? conf_.getParameter<edm::ParameterSet>("TrendingLS") : conf_.getParameter<edm::ParameterSet>("Trending");
MonitorElement* me = ibooker.bookProfile(HistoName,HistoName,
ParametersTrend.getParameter<int32_t>("Nbins"),
ParametersTrend.getParameter<double>("xmin"),
Expand Down
2 changes: 1 addition & 1 deletion DQM/SiStripMonitorDigi/interface/SiStripMonitorDigi.h
Expand Up @@ -209,7 +209,7 @@ class SiStripMonitorDigi : public DQMEDAnalyzer {

bool createTrendMEs;

bool m_trendVsLS;
bool m_trendVs10LS;

edm::InputTag historyProducer_;
edm::InputTag apvPhaseProducer_;
Expand Down
2 changes: 1 addition & 1 deletion DQM/SiStripMonitorDigi/python/SiStripMonitorDigi_cfi.py
Expand Up @@ -203,5 +203,5 @@
ShowControlView = cms.bool(False),
CalculateStripOccupancy = cms.bool(False),
ResetMEsEachRun = cms.bool(False),
TrendVsLS = cms.bool(True),
TrendVs10LS = cms.bool(False),
)
10 changes: 4 additions & 6 deletions DQM/SiStripMonitorDigi/src/SiStripMonitorDigi.cc
Expand Up @@ -165,7 +165,7 @@ SiStripMonitorDigi::SiStripMonitorDigi(const edm::ParameterSet& iConfig) :

createTrendMEs = conf_.getParameter<bool>("CreateTrendMEs");
Mod_On_ = conf_.getParameter<bool>("Mod_On");
m_trendVsLS = conf_.getParameter<bool>("TrendVsLS");
m_trendVs10LS = conf_.getParameter<bool>("TrendVs10LS");
// xLumiProf = conf_.getParameter<int>("xLumiProf");
// Event History Producer
historyProducer_ = conf_.getParameter<edm::InputTag>("HistoryProducer");
Expand Down Expand Up @@ -587,7 +587,7 @@ void SiStripMonitorDigi::analyze(const edm::Event& iEvent, const edm::EventSetup
runNb = iEvent.id().run();
eventNb++;

float iOrbitVar = m_trendVsLS ? iEvent.orbitNumber()/NORBITS_PER_LS : iEvent.orbitNumber()/NORBITS_PER_SECOND ;
float iOrbitVar = m_trendVs10LS ? iEvent.orbitNumber()/(10*NORBITS_PER_LS) : iEvent.orbitNumber()/NORBITS_PER_LS;

digi_detset_handles.clear();

Expand Down Expand Up @@ -951,8 +951,7 @@ MonitorElement* SiStripMonitorDigi::bookMETrend(DQMStore::IBooker & ibooker , co
"" );
if(!me) return me;

if(m_trendVsLS ) me->setAxisTitle("Lumisection",1);
else me->setAxisTitle("Event Time in Seconds",1);
me->setAxisTitle("Lumisection",1);
if (me->kind() == MonitorElement::DQM_KIND_TPROFILE) me->getTH1()->SetCanExtend(TH1::kAllAxes);
return me;
}
Expand Down Expand Up @@ -1136,8 +1135,7 @@ void SiStripMonitorDigi::createSubDetMEs(DQMStore::IBooker & ibooker , std::stri
Parameters.getParameter<double>("ymin"),
Parameters.getParameter<double>("ymax"),
"" );
if(m_trendVsLS) subdetMEs.SubDetTotDigiProf->setAxisTitle("Lumisection",1);
else subdetMEs.SubDetTotDigiProf->setAxisTitle("Event Time in Seconds",1);
subdetMEs.SubDetTotDigiProf->setAxisTitle("Lumisection",1);

if (subdetMEs.SubDetTotDigiProf->kind() == MonitorElement::DQM_KIND_TPROFILE) subdetMEs.SubDetTotDigiProf->getTH1()->SetCanExtend(TH1::kAllAxes);
}
Expand Down