Skip to content

Commit

Permalink
Merge pull request #7448 from threus/clusmulti_vs_bx_orbit
Browse files Browse the repository at this point in the history
added plot with cluster multiplicity vs BX and time
  • Loading branch information
cmsbuild committed Jan 30, 2015
2 parents 2b8c046 + 52ce62c commit fa4e6e3
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 16 deletions.
7 changes: 2 additions & 5 deletions DQM/SiStripMonitorCluster/interface/SiStripMonitorCluster.h
Expand Up @@ -41,8 +41,6 @@ class SiStripMonitorCluster : public DQMEDAnalyzer {
explicit SiStripMonitorCluster(const edm::ParameterSet&);
~SiStripMonitorCluster();
virtual void analyze(const edm::Event&, const edm::EventSetup&);
//virtual void beginJob() ;
virtual void endJob() ;
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
void dqmBeginRun(const edm::Run&, const edm::EventSetup&) ;

Expand Down Expand Up @@ -104,8 +102,8 @@ class SiStripMonitorCluster : public DQMEDAnalyzer {
MonitorElement* StripNoise3Cycle = 0;
MonitorElement* NumberOfPixelClus = 0;
MonitorElement* NumberOfStripClus = 0;

MonitorElement* BPTXrateTrend = 0;
MonitorElement* NclusVsCycleTimeProf2D = 0;

private:

Expand All @@ -126,8 +124,6 @@ class SiStripMonitorCluster : public DQMEDAnalyzer {
MonitorElement * bookMETrend(const char*, const char* , DQMStore::IBooker & ibooker);
MonitorElement* bookME1D(const char* ParameterSetLabel, const char* HistoName , DQMStore::IBooker & ibooker);

private:
DQMStore* dqmStore_;
edm::ParameterSet conf_;
std::map<uint32_t, ModMEs> ModuleMEsMap;
std::map<std::string, LayerMEs> LayerMEsMap;
Expand Down Expand Up @@ -190,6 +186,7 @@ class SiStripMonitorCluster : public DQMEDAnalyzer {
bool globalswitchMultiRegions;
bool clustertkhistomapon;
bool createTrendMEs;
bool globalswitchnclusvscycletimeprof2don;

bool Mod_On_;
bool ClusterHisto_;
Expand Down
10 changes: 10 additions & 0 deletions DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py
Expand Up @@ -260,6 +260,16 @@
globalswitchon = cms.bool(False)
),

NclusVsCycleTimeProf2D = cms.PSet(
Nbins = cms.int32(70),
xmin = cms.double(-0.5),
xmax = cms.double(69.5),
Nbinsy = cms.int32(90),
ymin = cms.double(0.),
ymax = cms.double(90*262144),
globalswitchon = cms.bool(True)
),

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

Expand Down
48 changes: 37 additions & 11 deletions DQM/SiStripMonitorCluster/src/SiStripMonitorCluster.cc
Expand Up @@ -41,7 +41,7 @@

//--------------------------------------------------------------------------------------------
SiStripMonitorCluster::SiStripMonitorCluster(const edm::ParameterSet& iConfig)
: dqmStore_(edm::Service<DQMStore>().operator->()), conf_(iConfig), show_mechanical_structure_view(true), show_readout_view(false), show_control_view(false), select_all_detectors(false), reset_each_run(false), m_cacheID_(0)
: conf_(iConfig), show_mechanical_structure_view(true), show_readout_view(false), show_control_view(false), select_all_detectors(false), reset_each_run(false), m_cacheID_(0)
// , genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig, consumesCollector()))
{

Expand Down Expand Up @@ -157,6 +157,9 @@ SiStripMonitorCluster::SiStripMonitorCluster(const edm::ParameterSet& iConfig)
maxClus = ClusterMultiplicityRegions.getParameter<double>("MaxClus");
minPix = ClusterMultiplicityRegions.getParameter<double>("MinPix");

edm::ParameterSet ParametersNclusVsCycleTimeProf2D = conf_.getParameter<edm::ParameterSet>("NclusVsCycleTimeProf2D");
globalswitchnclusvscycletimeprof2don = ParametersNclusVsCycleTimeProf2D.getParameter<bool>("globalswitchon");

clustertkhistomapon = conf_.getParameter<bool>("TkHistoMap_On");
createTrendMEs = conf_.getParameter<bool>("CreateTrendMEs");
Mod_On_ = conf_.getParameter<bool>("Mod_On");
Expand Down Expand Up @@ -398,6 +401,21 @@ void SiStripMonitorCluster::createMEs(const edm::EventSetup& es , DQMStore::IBoo
StripNoise3Cycle->setAxisTitle("APV Cycle");
}

if ( globalswitchnclusvscycletimeprof2don ) {
const char* HistoName = "StripClusVsBXandOrbit";
const char* HistoTitle = "Strip cluster multiplicity vs BX mod(70) and Orbit;Event 1 BX mod(70);time [Orb#]";
edm::ParameterSet ParametersNclusVsCycleTimeProf2D = conf_.getParameter<edm::ParameterSet>("NclusVsCycleTimeProf2D");
NclusVsCycleTimeProf2D = ibooker.bookProfile2D ( HistoName , HistoTitle ,
ParametersNclusVsCycleTimeProf2D.getParameter<int32_t>("Nbins"),
ParametersNclusVsCycleTimeProf2D.getParameter<double>("xmin"),
ParametersNclusVsCycleTimeProf2D.getParameter<double>("xmax"),
ParametersNclusVsCycleTimeProf2D.getParameter<int32_t>("Nbinsy"),
ParametersNclusVsCycleTimeProf2D.getParameter<double>("ymin"),
ParametersNclusVsCycleTimeProf2D.getParameter<double>("ymax"),
0 , 0 );
if (NclusVsCycleTimeProf2D->kind() == MonitorElement::DQM_KIND_TPROFILE2D) NclusVsCycleTimeProf2D->getTH1()->SetBit(TH1::kCanRebin);
}

if (ClusterHisto_){
ibooker.setCurrentFolder(topFolderName_+"/MechanicalView/");
edm::ParameterSet PixelCluster = conf_.getParameter<edm::ParameterSet>("TH1NClusPx");
Expand Down Expand Up @@ -740,17 +758,25 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
if (subdetswitchapvcycledbxprof2on)
sdetmes.SubDetApvDBxProf2->Fill(tbx_corr%70,dbx,sdetmes.totNClusters);
}
}
}
//
// -- EndJob
//
void SiStripMonitorCluster::endJob(void){
bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
std::string outputFileName = conf_.getParameter<std::string>("OutputFileName");
//------------------
//void DigiBXCorrHistogramMaker<T>::fill(const T& he, const std::map<int,int>& ndigi, const edm::Handle<APVCyclePhaseCollection>& phase) {
//NdigiVsCycleTimeTH2->Fill(tbx_corr%70,(int)event_history->_orbit,digi->second)

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;

// save histos in a file
if(outputMEsInRootFile) dqmStore_->save(outputFileName);
NclusVsCycleTimeProf2D->Fill( tbx_corr%70 , (int)event_history->_orbit , NStripClusters );
}
}
}
//
// -- Reset MEs
Expand Down

0 comments on commit fa4e6e3

Please sign in to comment.