CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
DisplayManager.DisplayManager Class Reference
Inheritance diagram for DisplayManager.DisplayManager:

Public Member Functions

def __del__
 
def __init__
 
def Draw
 

Public Attributes

 box
 
 canvas
 
 draw_ratio
 
 draw_ratioLegend
 
 histos
 
 Legend
 
 name
 
 pullRange
 

Detailed Description

Definition at line 53 of file DisplayManager.py.

Constructor & Destructor Documentation

def DisplayManager.DisplayManager.__init__ (   self,
  name,
  ratio 
)

Definition at line 54 of file DisplayManager.py.

54 
55  def __init__(self, name, ratio):
56  if ratio:
57  self.canvas = createRatioCanvas(name.replace('pdf', ''))
58  else:
59  self.canvas = ROOT.TCanvas(name.replace('.pdf', ''))
60  self.name = name
61  self.draw_ratio = ratio
62  self.histos = []
63  self.Legend = ROOT.TLegend(0.15, 0.79, 0.5, 0.89)
65  self.draw_ratioLegend = ROOT.TLegend(0.15, 0.79, 0.5, 0.89)
67  self.pullRange = 0.5
68  self.box = ROOT.TPave(0.93,0.85,0.98,0.90)
69  self.canvas.Print(self.name + '[')
def DisplayManager.DisplayManager.__del__ (   self)

Definition at line 70 of file DisplayManager.py.

References ElectronMVAID.ElectronMVAID.name, counter.Counter.name, average.Average.name, AlignableObjectId::entry.name, geometrydata.GeometryData.name, histograms.Histograms.name, TmModule.name, cond::persistency::TAG::NAME.name, cond::persistency::GLOBAL_TAG::NAME.name, core.autovars.NTupleVariable.name, cond::persistency::TAG::TIME_TYPE.name, cond::persistency::GLOBAL_TAG::VALIDITY.name, cond::persistency::TAG::OBJECT_TYPE.name, genericValidation.GenericValidation.name, cond::persistency::GLOBAL_TAG::DESCRIPTION.name, cond::persistency::TAG::SYNCHRONIZATION.name, preexistingValidation.PreexistingValidation.name, cond::persistency::GLOBAL_TAG::RELEASE.name, MEPSet.name, cond::persistency::TAG::END_OF_VALIDITY.name, cond::persistency::GLOBAL_TAG::SNAPSHOT_TIME.name, cond::persistency::TAG::DESCRIPTION.name, cond::persistency::GTEditorData.name, cond::persistency::GLOBAL_TAG::INSERTION_TIME.name, cond::persistency::TAG::LAST_VALIDATED_TIME.name, FWTGeoRecoGeometry::Info.name, Types._Untracked.name, cond::persistency::TAG::INSERTION_TIME.name, cond::persistency::TAG::MODIFICATION_TIME.name, dataset.BaseDataset.name, OutputMEPSet.name, personalPlayback.Applet.name, fit::RootMinuitCommand.name, ParameterSet.name, production_tasks.Task.name, PixelDCSObject< class >::Item.name, analyzer.Analyzer.name, DQMRivetClient::LumiOption.name, MagCylinder.name, CharmTagger::MVAVar.name, alignment.Alignment.name, ParSet.name, DQMRivetClient::ScaleFactorOption.name, SingleObjectCondition.name, EgHLTOfflineSummaryClient::SumHistBinData.name, XMLHTRZeroSuppressionLoader::_loaderBaseConfig.name, PhysicsTools::Source.name, XMLRBXPedestalsLoader::_loaderBaseConfig.name, DQMGenericClient::EfficOption.name, cond::persistency::GTProxyData.name, core.autovars.NTupleObjectType.name, MyWatcher.name, o2o.O2OJob.name, Mapper::definition< ScannerT >.name, edm::PathTimingSummary.name, cond::TimeTypeSpecs.name, lumi::TriggerInfo.name, edm::PathSummary.name, PixelEndcapLinkMaker::Item.name, perftools::EdmEventSize::BranchRecord.name, cond::persistency::GLOBAL_TAG_MAP::GLOBAL_TAG_NAME.name, FWTableViewManager::TableEntry.name, cond::persistency::GLOBAL_TAG_MAP::RECORD.name, PixelBarrelLinkMaker::Item.name, EcalLogicID.name, cond::persistency::GLOBAL_TAG_MAP::LABEL.name, ExpressionHisto< T >.name, cond::persistency::GLOBAL_TAG_MAP::TAG_NAME.name, python.rootplot.utilities.Hist2D.name, XMLProcessor::_loaderBaseConfig.name, DQMGenericClient::ProfileOption.name, cond::persistency::PAYLOAD::HASH.name, TreeCrawler.Package.name, cond::persistency::PAYLOAD::OBJECT_TYPE.name, cond::persistency::PAYLOAD::DATA.name, cond::persistency::PAYLOAD::STREAMER_INFO.name, options.ConnectionHLTMenu.name, cond::persistency::PAYLOAD::VERSION.name, MagGeoBuilderFromDDD::volumeHandle.name, cond::persistency::PAYLOAD::INSERTION_TIME.name, DQMGenericClient::NormOption.name, DisplayManager.DisplayManager.name, Node.name, DQMGenericClient::CDOption.name, FastHFShowerLibrary.name, h4DSegm.name, PhysicsTools::Variable::Value.name, PhysicsTools::Calibration::Variable.name, cond::TagInfo_t.name, CounterChecker.name, EDMtoMEConverter.name, looper.Looper.name, ProcTMVA::Method.name, TreeSaver::Var.name, python.rootplot.tree2hists.Plot.name, MEtoEDM< T >::MEtoEDMObject.name, cond::persistency::IOV::TAG_NAME.name, cond::persistency::IOV::SINCE.name, TrackerSectorStruct.name, cond::persistency::IOV::PAYLOAD_HASH.name, PhysicsTools::TreeReader::Value.name, cond::persistency::IOV::INSERTION_TIME.name, HistogramManager.name, classes.MonitorData.name, PhysicsTools::TrainProcessor.name, MuonGeometrySanityCheckPoint.name, classes.OutputData.name, PhysicsTools::MVAModuleHelper< Record, Object, Filler >::Value.name, PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >.name, options.HLTProcessOptions.name, PhysicsTools::MVATrainer.name, h2DSegm.name, python.rootplot.utilities.Hist.name, config.Analyzer.name, core.autovars.NTupleSubObject.name, DQMNet::WaitObject.name, AlpgenParameterName.name, SiStripMonitorDigi.name, core.autovars.NTupleObject.name, geometry.Structure.name, cond::persistency::TAG_LOG::TAG_NAME.name, cond::persistency::TAG_LOG::EVENT_TIME.name, cond::persistency::TAG_LOG::USER_NAME.name, cond::persistency::TAG_LOG::HOST_NAME.name, cond::persistency::TAG_LOG::COMMAND.name, cond::persistency::TAG_LOG::ACTION.name, cond::persistency::TAG_LOG::USER_TEXT.name, config.Service.name, public_plots_tools.ColorScheme.name, PhysicsTools::Variable.name, PhysicsTools::TrainerMonitoring::Object.name, core.autovars.NTupleCollection.name, FastTimerService::LuminosityDescription.name, BPHRecoBuilder::BPHRecoSource.name, BPHRecoBuilder::BPHCompSource.name, personalPlayback.FrameworkJob.name, plotscripts.SawTeethFunction.name, @17860::Id.name, FastTimerService::ProcessDescription.name, python.rootplot.utilities.RootFile.name, hTMaxCell.name, cscdqm::ParHistoDef.name, BeautifulSoup.Tag.name, @17856::Id.name, SummaryOutputProducer::GenericSummary.name, and BeautifulSoup.SoupStrainer.name.

70 
71  def __del__(self):
72  self.canvas.Print(self.name + ']')

Member Function Documentation

def DisplayManager.DisplayManager.Draw (   self,
  histos,
  titles 
)

Definition at line 73 of file DisplayManager.py.

References DisplayManager.checkDifferences(), DisplayManager.DisplayManager.draw_ratio, ElectronStudy.histos, DisplayManager.DisplayManager.histos, SiStripLAProfileBooker.histos, DTVDriftCalibration::cellInfo.histos, VariablePlotter::SubDirectory.histos, CSCValidation.histos, bookConverter.max, ElectronMVAID.ElectronMVAID.name, counter.Counter.name, average.Average.name, geometrydata.GeometryData.name, histograms.Histograms.name, AlignableObjectId::entry.name, cond::persistency::GLOBAL_TAG::NAME.name, cond::persistency::TAG::NAME.name, core.autovars.NTupleVariable.name, TmModule.name, cond::persistency::GLOBAL_TAG::VALIDITY.name, cond::persistency::TAG::TIME_TYPE.name, cond::persistency::GLOBAL_TAG::DESCRIPTION.name, genericValidation.GenericValidation.name, cond::persistency::TAG::OBJECT_TYPE.name, cond::persistency::GLOBAL_TAG::RELEASE.name, preexistingValidation.PreexistingValidation.name, cond::persistency::TAG::SYNCHRONIZATION.name, cond::persistency::GLOBAL_TAG::SNAPSHOT_TIME.name, MEPSet.name, cond::persistency::TAG::END_OF_VALIDITY.name, cond::persistency::GTEditorData.name, cond::persistency::GLOBAL_TAG::INSERTION_TIME.name, cond::persistency::TAG::DESCRIPTION.name, FWTGeoRecoGeometry::Info.name, cond::persistency::TAG::LAST_VALIDATED_TIME.name, Types._Untracked.name, cond::persistency::TAG::INSERTION_TIME.name, dataset.BaseDataset.name, cond::persistency::TAG::MODIFICATION_TIME.name, OutputMEPSet.name, personalPlayback.Applet.name, production_tasks.Task.name, fit::RootMinuitCommand.name, ParameterSet.name, PixelDCSObject< class >::Item.name, analyzer.Analyzer.name, DQMRivetClient::LumiOption.name, MagCylinder.name, CharmTagger::MVAVar.name, alignment.Alignment.name, ParSet.name, DQMRivetClient::ScaleFactorOption.name, SingleObjectCondition.name, EgHLTOfflineSummaryClient::SumHistBinData.name, cond::persistency::GTProxyData.name, PhysicsTools::Source.name, DQMGenericClient::EfficOption.name, XMLHTRZeroSuppressionLoader::_loaderBaseConfig.name, XMLRBXPedestalsLoader::_loaderBaseConfig.name, core.autovars.NTupleObjectType.name, o2o.O2OJob.name, MyWatcher.name, Mapper::definition< ScannerT >.name, edm::PathTimingSummary.name, cond::TimeTypeSpecs.name, lumi::TriggerInfo.name, edm::PathSummary.name, cond::persistency::GLOBAL_TAG_MAP::GLOBAL_TAG_NAME.name, PixelEndcapLinkMaker::Item.name, perftools::EdmEventSize::BranchRecord.name, FWTableViewManager::TableEntry.name, cond::persistency::GLOBAL_TAG_MAP::RECORD.name, PixelBarrelLinkMaker::Item.name, EcalLogicID.name, cond::persistency::GLOBAL_TAG_MAP::LABEL.name, cond::persistency::GLOBAL_TAG_MAP::TAG_NAME.name, ExpressionHisto< T >.name, python.rootplot.utilities.Hist2D.name, XMLProcessor::_loaderBaseConfig.name, DQMGenericClient::ProfileOption.name, TreeCrawler.Package.name, cond::persistency::PAYLOAD::HASH.name, cond::persistency::PAYLOAD::OBJECT_TYPE.name, cond::persistency::PAYLOAD::DATA.name, options.ConnectionHLTMenu.name, cond::persistency::PAYLOAD::STREAMER_INFO.name, MagGeoBuilderFromDDD::volumeHandle.name, cond::persistency::PAYLOAD::VERSION.name, cond::persistency::PAYLOAD::INSERTION_TIME.name, DQMGenericClient::NormOption.name, DisplayManager.DisplayManager.name, Node.name, DQMGenericClient::CDOption.name, FastHFShowerLibrary.name, h4DSegm.name, PhysicsTools::Variable::Value.name, PhysicsTools::Calibration::Variable.name, cond::TagInfo_t.name, CounterChecker.name, EDMtoMEConverter.name, looper.Looper.name, ProcTMVA::Method.name, TreeSaver::Var.name, python.rootplot.tree2hists.Plot.name, MEtoEDM< T >::MEtoEDMObject.name, cond::persistency::IOV::TAG_NAME.name, cond::persistency::IOV::SINCE.name, TrackerSectorStruct.name, cond::persistency::IOV::PAYLOAD_HASH.name, PhysicsTools::TreeReader::Value.name, cond::persistency::IOV::INSERTION_TIME.name, HistogramManager.name, classes.MonitorData.name, PhysicsTools::TrainProcessor.name, MuonGeometrySanityCheckPoint.name, classes.OutputData.name, PhysicsTools::MVAModuleHelper< Record, Object, Filler >::Value.name, PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >.name, options.HLTProcessOptions.name, PhysicsTools::MVATrainer.name, h2DSegm.name, python.rootplot.utilities.Hist.name, config.Analyzer.name, core.autovars.NTupleSubObject.name, DQMNet::WaitObject.name, AlpgenParameterName.name, SiStripMonitorDigi.name, core.autovars.NTupleObject.name, geometry.Structure.name, cond::persistency::TAG_LOG::TAG_NAME.name, cond::persistency::TAG_LOG::EVENT_TIME.name, cond::persistency::TAG_LOG::USER_NAME.name, cond::persistency::TAG_LOG::HOST_NAME.name, cond::persistency::TAG_LOG::COMMAND.name, cond::persistency::TAG_LOG::ACTION.name, cond::persistency::TAG_LOG::USER_TEXT.name, config.Service.name, public_plots_tools.ColorScheme.name, PhysicsTools::Variable.name, PhysicsTools::TrainerMonitoring::Object.name, core.autovars.NTupleCollection.name, FastTimerService::LuminosityDescription.name, BPHRecoBuilder::BPHRecoSource.name, BPHRecoBuilder::BPHCompSource.name, personalPlayback.FrameworkJob.name, plotscripts.SawTeethFunction.name, @17860::Id.name, FastTimerService::ProcessDescription.name, python.rootplot.utilities.RootFile.name, hTMaxCell.name, cscdqm::ParHistoDef.name, BeautifulSoup.Tag.name, @17856::Id.name, SummaryOutputProducer::GenericSummary.name, BeautifulSoup.SoupStrainer.name, and DisplayManager.DisplayManager.pullRange.

73 
74  def Draw(self, histos, titles):
75  self.histos = histos
76  ymax = max(h.GetMaximum() for h in self.histos)
77  self.Legend.Clear()
78  self.draw_ratioLegend.Clear()
79  for i, h in enumerate(self.histos):
80  title = titles[i]
81  h.GetYaxis().SetRangeUser(0., ymax * 1.3)
82  self.Legend.AddEntry(h, title + ': ' + str(h.Integral()))
83  if i == 0:
84  h.Draw('HIST E')
85  else:
86  h.Draw('SAME HIST E')
87  self.Legend.Draw()
88  ## add an assessment on the agreement
89  rel_diff = checkDifferences(self.histos)
90  self.box.SetLineColor(1)
91  self.box.SetLineWidth(1)
92  self.box.SetShadowColor(0)
93  if rel_diff <= 0.01:
94  self.box.SetFillColor(416) ## kGreen
95  elif rel_diff <= 0.10:
96  self.box.SetFillColor(797) ## kOrange
97  else:
98  self.box.SetFillColor(632) ## kRed
99  self.box.ConvertNDCtoPad()
100  self.box.Draw()
101 
102  pull_histos = []
103  if self.draw_ratio:
104  self.canvas.cd(2)
105  for ihist in range(1, len(self.histos)):
106  histPull = copy.deepcopy(self.histos[ihist])
107  pull_histos.append(histPull)
108  histPull.Divide(self.histos[0])
109  histPull.UseCurrentStyle()
110  histPull.SetLineColor(self.histos[ihist].GetLineColor())
111  histPull.SetMarkerColor(self.histos[ihist].GetLineColor())
112  histPull.SetLineStyle(self.histos[ihist].GetLineStyle())
113  histPull.SetLineWidth(self.histos[ihist].GetLineWidth())
114  histPull.GetYaxis().SetRangeUser(-self.pullRange + 1., self.pullRange + 1.)
115  # defaultYtoPixel = 408. # height in pixels of default canvas
116  defaultYtoPixel = self.canvas.GetPad(1).YtoPixel(0.)
117  pad2YtoPixel = float(self.canvas.GetPad(2).YtoPixel(0))
118  pad2XaxisFactor = defaultYtoPixel / pad2YtoPixel
119  histPull.GetXaxis().SetLabelSize(self.histos[0].GetXaxis().GetLabelSize()*pad2XaxisFactor)
120  histPull.GetXaxis().SetLabelOffset(self.histos[0].GetXaxis().GetLabelOffset()*pad2XaxisFactor)
121  histPull.GetXaxis().SetTitleSize(self.histos[0].GetXaxis().GetTitleSize()*pad2XaxisFactor)
122  histPull.GetXaxis().SetTitleOffset(self.histos[0].GetXaxis().GetTitleOffset()/pad2XaxisFactor*2.5)
123  histPull.GetYaxis().SetLabelSize(self.histos[0].GetYaxis().GetLabelSize()*pad2XaxisFactor)
124  histPull.GetYaxis().SetLabelOffset(self.histos[0].GetYaxis().GetLabelOffset()*pad2XaxisFactor)
125  histPull.GetYaxis().SetTitleSize(self.histos[0].GetYaxis().GetTitleSize()*pad2XaxisFactor)
126  histPull.GetYaxis().SetTitleOffset(self.histos[0].GetYaxis().GetTitleOffset()/pad2XaxisFactor)
127  histPull.GetYaxis().CenterTitle()
128  histPull.GetXaxis().SetTickLength(histPull.GetXaxis().GetTickLength()*pad2XaxisFactor)
129  histPull.GetYaxis().SetNdivisions(306)
130  histPull.GetYaxis().SetTitle("Ratio to " + titles[0])
131  histPull.SetTitle('')
132  if ihist == 1:
133  histPull.Draw("ep")
134  else:
135  histPull.Draw("same ep")
136  self.draw_ratioLegend.AddEntry(histPull, titles[ihist])
137  # This is a little bit ugly though ...
138  for i, h in enumerate(self.histos):
139  h.GetXaxis().SetLabelSize(0)
140  self.canvas.cd(1)
141  self.canvas.Update()
142  self.canvas.Print(self.name)

Member Data Documentation

DisplayManager.DisplayManager.box

Definition at line 67 of file DisplayManager.py.

DisplayManager.DisplayManager.canvas

Definition at line 56 of file DisplayManager.py.

DisplayManager.DisplayManager.draw_ratio

Definition at line 60 of file DisplayManager.py.

Referenced by DisplayManager.DisplayManager.Draw().

DisplayManager.DisplayManager.draw_ratioLegend

Definition at line 64 of file DisplayManager.py.

DisplayManager.DisplayManager.histos

Definition at line 61 of file DisplayManager.py.

Referenced by cuy.ValElement.__init__(), cuy.additionElement.__init__(), cuy.superimposeElement.__init__(), cuy.graphElement.__init__(), and DisplayManager.DisplayManager.Draw().

DisplayManager.DisplayManager.Legend

Definition at line 62 of file DisplayManager.py.

DisplayManager.DisplayManager.name

Definition at line 59 of file DisplayManager.py.

Referenced by dirstructure.Directory.__create_pie_image(), DisplayManager.DisplayManager.__del__(), dqm_interfaces.DirID.__eq__(), dirstructure.Directory.__get_full_path(), dirstructure.Comparison.__get_img_name(), cuy.divideElement.__init__(), cuy.plotElement.__init__(), cuy.additionElement.__init__(), cuy.superimposeElement.__init__(), cuy.graphElement.__init__(), dirstructure.Comparison.__make_image(), dirstructure.Directory.__repr__(), dqm_interfaces.DirID.__repr__(), dirstructure.Comparison.__repr__(), config.CFG.__str__(), dirstructure.Directory.calcStats(), validation.Sample.digest(), DisplayManager.DisplayManager.Draw(), utils.StatisticalTest.get_status(), VIDSelectorBase.VIDSelectorBase.initialize(), dirstructure.Directory.print_report(), and Vispa.Views.PropertyView.Property.valueChanged().

DisplayManager.DisplayManager.pullRange

Definition at line 66 of file DisplayManager.py.

Referenced by DisplayManager.DisplayManager.Draw().