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 | Static Public Attributes | Private Member Functions
dirstructure.Comparison Class Reference
Inheritance diagram for dirstructure.Comparison:
dirstructure.Weighted

Public Member Functions

def __init__
 
def __repr__
 
def tcanvas_slow
 
- Public Member Functions inherited from dirstructure.Weighted
def __init__
 

Public Attributes

 do_pngs
 
 draw_success
 
 img_name
 
 mother_dir
 
 name
 
 png_name
 
 rank
 
 status
 
 test_name
 
 test_thr
 
- Public Attributes inherited from dirstructure.Weighted
 name
 
 weight
 

Static Public Attributes

int canvas_xsize = 500
 
int canvas_ysize = 400
 

Private Member Functions

def __get_img_name
 
def __make_image
 
def __make_img_dir
 

Detailed Description

Definition at line 331 of file dirstructure.py.

Constructor & Destructor Documentation

def dirstructure.Comparison.__init__ (   self,
  name,
  mother_dir,
  h1,
  h2,
  stat_test,
  draw_success = False,
  do_pngs = False,
  skip = False 
)

Definition at line 334 of file dirstructure.py.

335  def __init__(self,name,mother_dir,h1,h2,stat_test,draw_success=False,do_pngs=False, skip=False):
336  self.name=name
337  self.png_name="placeholder.png"
338  self.mother_dir=mother_dir
339  self.img_name=""
340  #self.draw_success=draw_success
341  Weighted.__init__(self,name)
342 
343  stat_test.set_operands(h1,h2)
344  if skip:
345  self.status = SKIPED
346  self.test_name=stat_test.name
347  self.test_name=stat_test.name
348  self.test_thr=stat_test.threshold
349  self.rank = 0
350  else:
351  self.status=stat_test.get_status()
352  self.rank=stat_test.get_rank()
353  self.test_name=stat_test.name
354  self.test_thr=stat_test.threshold
355  self.do_pngs=do_pngs
356  self.draw_success=draw_success or not do_pngs
357  if ((self.status==FAIL or self.status==NULL or self.status == SKIPED or self.draw_success) and self.do_pngs):
358  self.__make_image(h1,h2)
359  #self.__make_image(h1,h2)

Member Function Documentation

def dirstructure.Comparison.__get_img_name (   self)
private

Definition at line 364 of file dirstructure.py.

References dirstructure.Comparison.img_name, dirstructure.Directory.mother_dir, dirstructure.Comparison.mother_dir, entry.name, genericValidation.GenericValidation.name, TmModule.name, EventMonitor::Entry.name, ora::RecordSpecImpl::Item.name, cond::persistency::GTEditorData.name, FWTGeoRecoGeometry::Info.name, Types._Untracked.name, alignment.Alignment.name, fit::RootMinuitCommand.name, CombinedMVAJetTagComputer::Computer.name, ParameterSet.name, PixelDCSObject< class >::Item.name, DQMRivetClient::LumiOption.name, MagCylinder.name, PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.name, PrintSensitive.name, cond::persistency::GTProxyData.name, RHStopTracer::StopPoint.name, DQMRivetClient::ScaleFactorOption.name, SingleObjectCondition.name, EgHLTOfflineSummaryClient::SumHistBinData.name, XMLRBXPedestalsLoader::_loaderBaseConfig.name, PhysicsTools::Source.name, DQMGenericClient::EfficOption.name, XMLHTRZeroSuppressionLoader::_loaderBaseConfig.name, MyWatcher.name, edm::PathTimingSummary.name, dirstructure.Weighted.name, cond::TimeTypeSpecs.name, lumi::TriggerInfo.name, PrintMaterialBudgetInfo.name, edm::PathSummary.name, perftools::EdmEventSize::BranchRecord.name, PixelEndcapLinkMaker::Item.name, FWTableViewManager::TableEntry.name, PixelBarrelLinkMaker::Item.name, EcalLogicID.name, options.ConnectionHLTMenu.name, Mapper::definition< ScannerT >.name, ExpressionHisto< T >.name, McSelector.name, python.rootplot.utilities.Hist2D.name, SensitiveDetector.name, RecoSelector.name, TreeCrawler.Package.name, XMLProcessor::_loaderBaseConfig.name, DQMGenericClient::NormOption.name, CaloTrkProcessing::Detector.name, TrajectorySeedProducer::LayerSpec.name, HcalForwardLibWriter::FileHandle.name, PrintGeomInfoAction.name, MagGeoBuilderFromDDD::volumeHandle.name, DQMGenericClient::CDOption.name, PrintGeomMatInfo.name, PhysicsTools::Calibration::Variable.name, cond::TagInfo_t.name, h4DSegm.name, PhysicsTools::Variable::Value.name, options.HLTProcessOptions.name, EDMtoMEConverter.name, ProcTMVA::Method.name, TreeSaver::Var.name, python.rootplot.tree2hists.Plot.name, MEtoEDM< T >::MEtoEDMObject.name, PhysicsTools::TreeReader::Value.name, PhysicsTools::TrainProcessor.name, MuonGeometrySanityCheckPoint.name, TotemSD.name, PhysicsTools::MVAModuleHelper< Record, Object, Filler >::Value.name, PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >.name, PhysicsTools::MVATrainer.name, h2DSegm.name, python.rootplot.utilities.Hist.name, BscSD.name, DQMNet::WaitObject.name, AlpgenParameterName.name, SiStripMonitorDigi.name, FP420SD.name, public_plots_tools.ColorScheme.name, PhysicsTools::Variable.name, PhysicsTools::TrainerMonitoring::Object.name, FastTimerService::LuminosityDescription.name, conddblib.Tag.name, conddblib.GlobalTag.name, plotscripts.SawTeethFunction.name, @16235::Id.name, FastTimerService::ProcessDescription.name, python.rootplot.utilities.RootFile.name, hTMaxCell.name, cscdqm::ParHistoDef.name, BeautifulSoup.Tag.name, @16231::Id.name, TiXmlAttribute.name, and BeautifulSoup.SoupStrainer.name.

Referenced by dirstructure.Comparison.__make_image().

365  def __get_img_name(self):
366  #self.__make_img_dir()
367  #print "MOTHER: ",self.mother_dir
368  self.img_name="%s/%s.png"%(self.mother_dir,self.name)
369  self.img_name=self.img_name.replace("Run summary","")
370  self.img_name=self.img_name.replace("/","_")
371  self.img_name=self.img_name.strip("_")
372  #print "IMAGE NAME: %s " %self.img_name
373  return self.img_name
def dirstructure.Comparison.__make_image (   self,
  obj1,
  obj2 
)
private

Definition at line 395 of file dirstructure.py.

References dirstructure.Comparison.__get_img_name(), dirstructure.Comparison.img_name, entry.name, genericValidation.GenericValidation.name, TmModule.name, EventMonitor::Entry.name, ora::RecordSpecImpl::Item.name, cond::persistency::GTEditorData.name, FWTGeoRecoGeometry::Info.name, alignment.Alignment.name, Types._Untracked.name, fit::RootMinuitCommand.name, CombinedMVAJetTagComputer::Computer.name, ParameterSet.name, PixelDCSObject< class >::Item.name, DQMRivetClient::LumiOption.name, MagCylinder.name, PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.name, PrintSensitive.name, cond::persistency::GTProxyData.name, RHStopTracer::StopPoint.name, DQMRivetClient::ScaleFactorOption.name, SingleObjectCondition.name, EgHLTOfflineSummaryClient::SumHistBinData.name, XMLRBXPedestalsLoader::_loaderBaseConfig.name, PhysicsTools::Source.name, DQMGenericClient::EfficOption.name, XMLHTRZeroSuppressionLoader::_loaderBaseConfig.name, MyWatcher.name, edm::PathTimingSummary.name, dirstructure.Weighted.name, cond::TimeTypeSpecs.name, lumi::TriggerInfo.name, PrintMaterialBudgetInfo.name, edm::PathSummary.name, perftools::EdmEventSize::BranchRecord.name, PixelEndcapLinkMaker::Item.name, FWTableViewManager::TableEntry.name, PixelBarrelLinkMaker::Item.name, EcalLogicID.name, options.ConnectionHLTMenu.name, Mapper::definition< ScannerT >.name, ExpressionHisto< T >.name, McSelector.name, python.rootplot.utilities.Hist2D.name, SensitiveDetector.name, RecoSelector.name, XMLProcessor::_loaderBaseConfig.name, DQMGenericClient::NormOption.name, TreeCrawler.Package.name, CaloTrkProcessing::Detector.name, TrajectorySeedProducer::LayerSpec.name, HcalForwardLibWriter::FileHandle.name, PrintGeomInfoAction.name, MagGeoBuilderFromDDD::volumeHandle.name, DQMGenericClient::CDOption.name, PrintGeomMatInfo.name, PhysicsTools::Calibration::Variable.name, cond::TagInfo_t.name, h4DSegm.name, PhysicsTools::Variable::Value.name, options.HLTProcessOptions.name, EDMtoMEConverter.name, ProcTMVA::Method.name, TreeSaver::Var.name, python.rootplot.tree2hists.Plot.name, MEtoEDM< T >::MEtoEDMObject.name, PhysicsTools::TreeReader::Value.name, PhysicsTools::TrainProcessor.name, MuonGeometrySanityCheckPoint.name, TotemSD.name, PhysicsTools::MVAModuleHelper< Record, Object, Filler >::Value.name, PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >.name, PhysicsTools::MVATrainer.name, h2DSegm.name, python.rootplot.utilities.Hist.name, BscSD.name, DQMNet::WaitObject.name, AlpgenParameterName.name, SiStripMonitorDigi.name, FP420SD.name, public_plots_tools.ColorScheme.name, PhysicsTools::Variable.name, PhysicsTools::TrainerMonitoring::Object.name, FastTimerService::LuminosityDescription.name, conddblib.Tag.name, conddblib.GlobalTag.name, plotscripts.SawTeethFunction.name, @16235::Id.name, FastTimerService::ProcessDescription.name, python.rootplot.utilities.RootFile.name, hTMaxCell.name, cscdqm::ParHistoDef.name, BeautifulSoup.Tag.name, @16231::Id.name, TiXmlAttribute.name, BeautifulSoup.SoupStrainer.name, dirstructure.Comparison.rank, runall.testit.status, WorkFlowRunner.WorkFlowRunner.status, addOnTests.testit.status, SubTaskSummaryStatus.status, RPCDQMObject::DQMObjectItem.status, HcalChannelQualityXml::_ChannelQuality.status, TMatacq.status, SiPixelFedFillerWordEventNumber.status, HcalDetDiagLaserClient.status, HcalDetDiagLEDClient.status, HcalDetDiagPedestalClient.status, CastorPSMonitor.status, MCSmartSingleParticleFilter.status, CastorChannelQualityMonitor.status, EcalPyWrapperHelper< T >.status, MCSingleParticleFilter.status, DJpsiFilter.status, EcalPerEvtMatacqAnalyzer.status, MCParticlePairFilter.status, PythiaFilter.status, HemisphereAlgo.status, EcalMatacqAnalyzer.status, HcalDetDiagLEDData.status, HcalDetDiagPedestalData.status, HcalDetDiagLaserData.status, dirstructure.Comparison.status, HCAL_HLX::CMS_STATUS_DATA.status, reco::GsfElectron::MvaOutput.status, dirstructure.Comparison.tcanvas_slow(), and dirstructure.Comparison.test_name.

396  def __make_image(self,obj1,obj2):
397  self.img_name=self.__get_img_name()
398  if self.rank==-1:
399  return 0
400 
401  canvas=TCanvas(self.name,self.name,Comparison.canvas_xsize,Comparison.canvas_ysize)
402  objs=(obj1,obj2)
403 
404  # Add some specifics for the graphs
405  obj1.SetTitle(self.name)
406 
407  if obj1.GetNbinsY()!=0 and not "2" in obj1.ClassName() :
408  obj1 .SetLineWidth(2)
409  obj2 .SetLineWidth(2)
410 
411  obj1.SetMarkerStyle(8)
412  obj1.SetMarkerSize(.8)
413 
414  obj2.SetMarkerStyle(8)
415  obj2.SetMarkerSize(.8)
416 
417  obj1.SetMarkerColor(kBlue)
418  obj1.SetLineColor(kBlue)
419 
420  obj2.SetMarkerColor(kRed)
421  obj2.SetLineColor(kRed)
422 
423  obj1.Draw("EP")
424  #Statsbox
425  obj2.Draw("HistSames")
426  #gPad.Update()
427  #if 'stats' in map(lambda o: o.GetName(),list(gPad.GetListOfPrimitives())):
428  #st = gPad.GetPrimitive("stats")
429  #st.SetY1NDC(0.575)
430  #st.SetY2NDC(0.735)
431  #st.SetLineColor(kRed)
432  #st.SetTextColor(kRed)
433  #print st
434  else:
435  obj1.Draw("Colz")
436  gPad.Update()
437  #if 'stats' in map(lambda o: o.GetName(),list(gPad.GetListOfPrimitives())):
438  #st = gPad.GetPrimitive("stats")
439  #st.SetY1NDC(0.575)
440  #st.SetY2NDC(0.735)
441  #st.SetLineColor(kRed)
442  #st.SetTextColor(kRed)
443  #print st
444  obj2.Draw("ColSame")
445 
446  # Put together the TLatex for the stat test if possible
447  color=kGreen+2 # which is green, as everybody knows
448  if self.status==FAIL:
449  print "This comparison failed %f" %self.rank
450  color=kRed
451  elif self.status==NULL:
452  color=kYellow
453  elif self.status==SKIPED:
454  color=kBlue #check if kBlue exists ;)
455 
456  lat_text="#scale[.7]{#color[%s]{%s: %2.2f}}" %(color,self.test_name,self.rank)
457  lat=TLatex(.1,.91,lat_text)
458  lat.SetNDC()
459  lat.Draw()
460 
461  # Put also the stats together!
462  n1=obj1.GetEntries()
463  if n1> 100000:
464  n1="%e"%n1
465  else:
466  n1="%s"%n1
467  n2=obj2.GetEntries()
468  if n2> 100000:
469  n2="%e"%n2
470  else:
471  n2="%s"%n2
472 
473  lat_text1="#scale[.7]{#color[%s]{Entries: %s}}" %(obj1.GetLineColor(),n1)
474  lat1=TLatex(.3,.91,lat_text1)
475  lat1.SetNDC()
476  lat1.Draw()
477 
478 
479  lat_text2="#scale[.7]{#color[%s]{Entries: %s}}" %(obj2.GetLineColor(),n2)
480  lat2=TLatex(.6,.91,lat_text2)
481  lat2.SetNDC()
482  lat2.Draw()
483 
484 
485  self.tcanvas_slow(canvas)
def dirstructure.Comparison.__make_img_dir (   self)
private

Definition at line 360 of file dirstructure.py.

References dirstructure.Directory.mother_dir, and dirstructure.Comparison.mother_dir.

361  def __make_img_dir(self):
362  if not exists(self.mother_dir):
363  makedirs(self.mother_dir)
def dirstructure.Comparison.__repr__ (   self)

Definition at line 486 of file dirstructure.py.

References dirstructure.Comparison.img_name, entry.name, genericValidation.GenericValidation.name, TmModule.name, ora::RecordSpecImpl::Item.name, EventMonitor::Entry.name, cond::persistency::GTEditorData.name, alignment.Alignment.name, FWTGeoRecoGeometry::Info.name, Types._Untracked.name, fit::RootMinuitCommand.name, CombinedMVAJetTagComputer::Computer.name, ParameterSet.name, PixelDCSObject< class >::Item.name, DQMRivetClient::LumiOption.name, MagCylinder.name, PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.name, PrintSensitive.name, cond::persistency::GTProxyData.name, RHStopTracer::StopPoint.name, DQMRivetClient::ScaleFactorOption.name, EgHLTOfflineSummaryClient::SumHistBinData.name, SingleObjectCondition.name, PhysicsTools::Source.name, DQMGenericClient::EfficOption.name, XMLRBXPedestalsLoader::_loaderBaseConfig.name, XMLHTRZeroSuppressionLoader::_loaderBaseConfig.name, MyWatcher.name, edm::PathTimingSummary.name, dirstructure.Weighted.name, cond::TimeTypeSpecs.name, lumi::TriggerInfo.name, edm::PathSummary.name, PrintMaterialBudgetInfo.name, PixelEndcapLinkMaker::Item.name, perftools::EdmEventSize::BranchRecord.name, FWTableViewManager::TableEntry.name, PixelBarrelLinkMaker::Item.name, Mapper::definition< ScannerT >.name, options.ConnectionHLTMenu.name, EcalLogicID.name, McSelector.name, ExpressionHisto< T >.name, python.rootplot.utilities.Hist2D.name, SensitiveDetector.name, RecoSelector.name, DQMGenericClient::NormOption.name, TreeCrawler.Package.name, XMLProcessor::_loaderBaseConfig.name, TrajectorySeedProducer::LayerSpec.name, CaloTrkProcessing::Detector.name, HcalForwardLibWriter::FileHandle.name, PrintGeomInfoAction.name, MagGeoBuilderFromDDD::volumeHandle.name, DQMGenericClient::CDOption.name, PrintGeomMatInfo.name, PhysicsTools::Calibration::Variable.name, cond::TagInfo_t.name, h4DSegm.name, PhysicsTools::Variable::Value.name, options.HLTProcessOptions.name, EDMtoMEConverter.name, ProcTMVA::Method.name, TreeSaver::Var.name, python.rootplot.tree2hists.Plot.name, MEtoEDM< T >::MEtoEDMObject.name, PhysicsTools::TreeReader::Value.name, MuonGeometrySanityCheckPoint.name, PhysicsTools::TrainProcessor.name, TotemSD.name, PhysicsTools::MVAModuleHelper< Record, Object, Filler >::Value.name, PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >.name, PhysicsTools::MVATrainer.name, h2DSegm.name, python.rootplot.utilities.Hist.name, BscSD.name, DQMNet::WaitObject.name, AlpgenParameterName.name, SiStripMonitorDigi.name, FP420SD.name, public_plots_tools.ColorScheme.name, PhysicsTools::Variable.name, PhysicsTools::TrainerMonitoring::Object.name, FastTimerService::LuminosityDescription.name, conddblib.Tag.name, conddblib.GlobalTag.name, plotscripts.SawTeethFunction.name, @16235::Id.name, FastTimerService::ProcessDescription.name, python.rootplot.utilities.RootFile.name, hTMaxCell.name, cscdqm::ParHistoDef.name, BeautifulSoup.Tag.name, @16231::Id.name, TiXmlAttribute.name, BeautifulSoup.SoupStrainer.name, dirstructure.Comparison.rank, runall.testit.status, WorkFlowRunner.WorkFlowRunner.status, addOnTests.testit.status, SubTaskSummaryStatus.status, RPCDQMObject::DQMObjectItem.status, HcalChannelQualityXml::_ChannelQuality.status, TMatacq.status, SiPixelFedFillerWordEventNumber.status, HcalDetDiagLaserClient.status, HcalDetDiagLEDClient.status, HcalDetDiagPedestalClient.status, CastorPSMonitor.status, MCSmartSingleParticleFilter.status, CastorChannelQualityMonitor.status, MCSingleParticleFilter.status, EcalPyWrapperHelper< T >.status, DJpsiFilter.status, MCParticlePairFilter.status, EcalPerEvtMatacqAnalyzer.status, PythiaFilter.status, HemisphereAlgo.status, EcalMatacqAnalyzer.status, HcalDetDiagLEDData.status, HcalDetDiagPedestalData.status, HcalDetDiagLaserData.status, dirstructure.Comparison.status, HCAL_HLX::CMS_STATUS_DATA.status, reco::GsfElectron::MvaOutput.status, and dirstructure.Comparison.test_name.

487  def __repr__(self):
488  return "%s , (%s=%s). IMG=%s. status=%s" %(self.name,self.test_name,self.rank,self.img_name,self.status)
489 
490 #-------------------------------------------------------------------------------
def dirstructure.Comparison.tcanvas_slow (   self,
  canvas 
)

Definition at line 374 of file dirstructure.py.

References dirstructure.Comparison.img_name.

Referenced by dirstructure.Comparison.__make_image().

375  def tcanvas_slow(self,canvas):
376  #print "About to print %s" %self.img_name
377  #print_multi_threaded(canvas,self.img_name)
378  #print "-->Printed"
379 
380  p = Process(target=print_multi_threaded, args=(canvas,self.img_name))
381  p.start()
382  tcanvas_print_processes.append(p)
383  n_proc=len(tcanvas_print_processes)
384  if n_proc>3:
385  p_to_remove=[]
386  for iprocess in xrange(0,n_proc):
387  p=tcanvas_print_processes[iprocess]
388  p.join()
389  p_to_remove.append(iprocess)
390 
391  adjustment=0
392  for iprocess in p_to_remove:
393  tcanvas_print_processes.pop(iprocess-adjustment)
394  adjustment+=1

Member Data Documentation

int dirstructure.Comparison.canvas_xsize = 500
static

Definition at line 332 of file dirstructure.py.

int dirstructure.Comparison.canvas_ysize = 400
static

Definition at line 333 of file dirstructure.py.

dirstructure.Comparison.do_pngs

Definition at line 354 of file dirstructure.py.

Referenced by dqm_interfaces.DirWalkerDB.run().

dirstructure.Comparison.draw_success

Definition at line 355 of file dirstructure.py.

dirstructure.Comparison.img_name

Definition at line 338 of file dirstructure.py.

Referenced by dirstructure.Comparison.__get_img_name(), dirstructure.Comparison.__make_image(), dirstructure.Comparison.__repr__(), and dirstructure.Comparison.tcanvas_slow().

dirstructure.Comparison.mother_dir

Definition at line 337 of file dirstructure.py.

Referenced by dirstructure.Comparison.__get_img_name(), and dirstructure.Comparison.__make_img_dir().

dirstructure.Comparison.name

Definition at line 335 of file dirstructure.py.

Referenced by dqm_interfaces.DirID.__eq__(), dataset.Dataset.__getFileInfoList(), cuy.divideElement.__init__(), cuy.plotElement.__init__(), cuy.additionElement.__init__(), cuy.superimposeElement.__init__(), cuy.graphElement.__init__(), dqm_interfaces.DirID.__repr__(), utils.StatisticalTest.get_status(), and Vispa.Views.PropertyView.Property.valueChanged().

dirstructure.Comparison.png_name

Definition at line 336 of file dirstructure.py.

dirstructure.Comparison.rank

Definition at line 348 of file dirstructure.py.

Referenced by dirstructure.Comparison.__make_image(), dirstructure.Comparison.__repr__(), utils.StatisticalTest.get_rank(), and utils.StatisticalTest.get_status().

dirstructure.Comparison.status

Definition at line 344 of file dirstructure.py.

Referenced by dirstructure.Comparison.__make_image(), and dirstructure.Comparison.__repr__().

dirstructure.Comparison.test_name

Definition at line 345 of file dirstructure.py.

Referenced by dirstructure.Comparison.__make_image(), and dirstructure.Comparison.__repr__().

dirstructure.Comparison.test_thr

Definition at line 347 of file dirstructure.py.