Skip to content

Commit

Permalink
Merge pull request #17645 from aspiezia/DQMResidualPlots_900p5
Browse files Browse the repository at this point in the history
residual plots for DQM
  • Loading branch information
cmsbuild committed Apr 3, 2017
2 parents 7e98eaf + b3214f8 commit f859c88
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 7 deletions.
Expand Up @@ -61,6 +61,7 @@ class SiStripTrackerMapCreator {
float tkMapMin_;
float meanToMaxFactor_;
bool useSSQuality_;
bool ResidualsRMS_;
std::string ssqLabel_;
int nDet;
TkDetMap* tkDetMap_;
Expand Down
39 changes: 33 additions & 6 deletions DQM/SiStripMonitorClient/src/SiStripTrackerMapCreator.cc
Expand Up @@ -196,11 +196,27 @@ void SiStripTrackerMapCreator::createForOffline(const edm::ParameterSet & tkmapP

if(tkmapPset.exists("mapMax")) tkMapMax_ = tkmapPset.getUntrackedParameter<double>("mapMax");
if(tkmapPset.exists("mapMin")) tkMapMin_ = tkmapPset.getUntrackedParameter<double>("mapMin");

edm::LogInfo("TkMapToBeSaved") << "Ready to save TkMap " << map_type << namesuffix << " with range set to " << tkMapMin_ << " - " << tkMapMax_;

trackerMap_->save(true, tkMapMin_,tkMapMax_, map_type+namesuffix+".svg");
trackerMap_->save(true, tkMapMin_,tkMapMax_, map_type+namesuffix+".png",4500,2400);

if (map_type == "ResidualsMean"){
ResidualsRMS_ = false;
setTkMapFromHistogram(dqm_store, map_type, eSetup);
edm::LogInfo("TkMapToBeSaved") << "Ready to save TkMap " << map_type << namesuffix << " with range set to " << tkMapMin_ << " - " << tkMapMax_;
trackerMap_->save(true, tkMapMin_,tkMapMax_, map_type+namesuffix+".svg");
trackerMap_->save(true, tkMapMin_,tkMapMax_, map_type+namesuffix+".png",4500,2400);
ResidualsRMS_ = true;
map_type = "ResidualsRMS";
if (runNumber_>0) { tmap_title = " Run: " + sRunNumber + ", Tracker Map from " + map_type; } //LG
else { tmap_title = " Tracker Map from " + map_type; } //LG
trackerMap_->setTitle(tmap_title);
setTkMapFromHistogram(dqm_store, map_type, eSetup);
edm::LogInfo("TkMapToBeSaved") << "Ready to save TkMap " << map_type << namesuffix << " with range set to 0.0 - 1.0";
trackerMap_->save(true, 0.0, 1.0, map_type+namesuffix+".svg");
trackerMap_->save(true, 0.0, 1.0, map_type+namesuffix+".png",4500,2400);
} else {
edm::LogInfo("TkMapToBeSaved") << "Ready to save TkMap " << map_type << namesuffix << " with range set to " << tkMapMin_ << " - " << tkMapMax_;
trackerMap_->save(true, tkMapMin_,tkMapMax_, map_type+namesuffix+".svg");
trackerMap_->save(true, tkMapMin_,tkMapMax_, map_type+namesuffix+".png",4500,2400);
}

if(tkMapPSU) {

Expand Down Expand Up @@ -495,7 +511,18 @@ void SiStripTrackerMapCreator::paintTkMapFromHistogram(DQMStore* dqm_store, Moni
TProfile2D* tp = me->getTProfile2D() ;
fval = tp->GetBinEntries(tp->GetBin(xyval.ix, xyval.iy)) * tp->GetBinContent(xyval.ix, xyval.iy);
}
} else fval = me->getBinContent(xyval.ix, xyval.iy);
} else if(name.find("Residuals") != std::string::npos){
if(ResidualsRMS_==true){
if (me->kind() == MonitorElement::DQM_KIND_TPROFILE2D) {
TProfile2D* tp = me->getTProfile2D() ;
float fval_prov = tp->GetBinError(xyval.ix, xyval.iy) * sqrt(tp->GetBinEntries(tp->GetBin(xyval.ix, xyval.iy)));
fval = fval_prov;
}
} else {
float fval_prov = me->getBinContent(xyval.ix, xyval.iy);
fval = fval_prov;
}
} else fval = me->getBinContent(xyval.ix, xyval.iy);
if (htype == "QTestAlarm") {
edm::LogError("ItShouldNotBeHere") << "QTestAlarm map: you should not be here!";
/*
Expand Down
Expand Up @@ -127,7 +127,8 @@
cms.PSet(mapName=cms.untracked.string('ChargePerCMfromTrack'),RunNumber=cms.untracked.uint32(options.runNumber),mapMax=cms.untracked.double(-1.)),
cms.PSet(mapName=cms.untracked.string('NumberMissingHits'),RunNumber=cms.untracked.uint32(options.runNumber),mapMax=cms.untracked.double(-1.)),
cms.PSet(mapName=cms.untracked.string('NumberValidHits'),RunNumber=cms.untracked.uint32(options.runNumber),mapMax=cms.untracked.double(-1.)),
cms.PSet(mapName=cms.untracked.string('NumberInactiveHits'),RunNumber=cms.untracked.uint32(options.runNumber))
cms.PSet(mapName=cms.untracked.string('NumberInactiveHits'),RunNumber=cms.untracked.uint32(options.runNumber)),
cms.PSet(mapName=cms.untracked.string('ResidualsMean'),RunNumber=cms.untracked.uint32(options.runNumber),mapMax=cms.untracked.double(-1.),TopModules=cms.untracked.bool(True))
)
)

Expand Down
2 changes: 2 additions & 0 deletions DQM/TrackerMonitorTrack/interface/MonitorTrackResiduals.h
Expand Up @@ -23,6 +23,7 @@ Monitoring source for track residuals on each detector module
#include <DQMServices/Core/interface/DQMEDAnalyzer.h>
#include "Alignment/OfflineValidation/interface/TrackerValidationVariables.h"
#include "DataFormats/VertexReco/interface/VertexFwd.h"
#include "DQM/SiStripCommon/interface/TkHistoMap.h"

class MonitorElement;
class DQMStore;
Expand Down Expand Up @@ -61,6 +62,7 @@ class MonitorTrackResidualsBase : public DQMEDAnalyzer {

HistoSet m_SubdetLayerResiduals;
HistoSet m_ModuleResiduals;
std::unique_ptr<TkHistoMap> tkhisto_ResidualsMean;

edm::ParameterSet conf_;
edm::ParameterSet Parameters;
Expand Down
5 changes: 5 additions & 0 deletions DQM/TrackerMonitorTrack/src/MonitorTrackResiduals.cc
Expand Up @@ -38,6 +38,10 @@ void MonitorTrackResidualsBase<pixel_or_strip>::bookHistograms(DQMStore::IBooker
m_cacheID_ = cacheID;
this->createMEs( ibooker , iSetup);
}
std::string topFolderName_ = "SiStrip";
SiStripFolderOrganizer folder_organizer;
folder_organizer.setSiStripFolderName(topFolderName_);
tkhisto_ResidualsMean = std::unique_ptr<TkHistoMap>(new TkHistoMap(ibooker , topFolderName_ ,"TkHMap_ResidualsMean", 0.0,true));
}

template<TrackerType pixel_or_strip>
Expand Down Expand Up @@ -259,6 +263,7 @@ void MonitorTrackResidualsBase<pixel_or_strip>::analyze(const edm::Event& iEvent
if(it.resXprimeErr != 0 && histos.x.base) {
histos.x.base->Fill(it.resXprime);
histos.x.normed->Fill(it.resXprime/it.resXprimeErr);
if(!isPixel) tkhisto_ResidualsMean->fill(RawId,it.resXprime);
}
if(it.resYprimeErr != 0 && histos.y.base) {
histos.y.base->Fill(it.resYprime);
Expand Down

0 comments on commit f859c88

Please sign in to comment.