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 334 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 337 of file dirstructure.py.

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

Member Function Documentation

def dirstructure.Comparison.__get_img_name (   self)
private

Definition at line 367 of file dirstructure.py.

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

Referenced by dirstructure.Comparison.__make_image().

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

Definition at line 398 of file dirstructure.py.

References dirstructure.Comparison.__get_img_name(), dirstructure.Comparison.img_name, cond::TagInfo.name, entry.name, genericValidation.GenericValidation.name, TmModule.name, Select.name, ora::RecordSpecImpl::Item.name, GifDisplay.name, FWTGeoRecoGeometry::Info.name, alignment.Alignment.name, Types._Untracked.name, Button.name, PixelDCSObject< class >::Item.name, fit::RootMinuitCommand.name, ParameterSet.name, SeedingLayerSetsBuilder::LayerSpec.name, DQMRivetClient::LumiOption.name, MagCylinder.name, PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.name, PrintSensitive.name, RHStopTracer::StopPoint.name, CombinedMVAJetTagComputer::Computer.name, DQMRivetClient::ScaleFactorOption.name, EgHLTOfflineSummaryClient::SumHistBinData.name, PhysicsTools::Source.name, XMLRBXPedestalsLoader::_loaderBaseConfig.name, CSCDCCExaminer::OStream.name, MyWatcher.name, lumi::TriggerInfo.name, SingleObjectCondition.name, XMLHTRZeroSuppressionLoader::_loaderBaseConfig.name, cond::TimeTypeSpecs.name, PrintMaterialBudgetInfo.name, DQMGenericClient::EfficOption.name, edm::PathSummary.name, dirstructure.Weighted.name, PixelEndcapLinkMaker::Item.name, perftools::EdmEventSize::BranchRecord.name, FWTableViewManager::TableEntry.name, PixelBarrelLinkMaker::Item.name, Mapper::definition< ScannerT >.name, options.ConnectionHLTMenu.name, McSelector.name, EcalLogicID.name, ExpressionHisto< T >.name, MEtoEDM< T >::MEtoEDMObject.name, RecoSelector.name, python.rootplot.utilities.Hist2D.name, TreeCrawler.Package.name, XMLProcessor::_loaderBaseConfig.name, CaloTrkProcessing::Detector.name, SensitiveDetector.name, PrintGeomInfoAction.name, HcalForwardLibWriter::FileHandle.name, PrintGeomMatInfo.name, MagGeoBuilderFromDDD::volumeHandle.name, DQMGenericClient::NormOption.name, PhysicsTools::Calibration::Variable.name, DQMGenericClient::CDOption.name, h4DSegm.name, PhysicsTools::Variable::Value.name, options.HLTProcessOptions.name, ProcTMVA::Method.name, EDMtoMEConverter.name, TreeSaver::Var.name, python.rootplot.tree2hists.Plot.name, PhysicsTools::TrainProcessor.name, MuonGeometrySanityCheckPoint.name, PhysicsTools::TreeReader::Value.name, TotemSD.name, PhysicsTools::MVAModuleHelper< Record, Object, Filler >::Value.name, PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >.name, PhysicsTools::MVATrainer.name, EfficiencyHandler.name, h2DSegm.name, python.rootplot.utilities.Hist.name, BscSD.name, stor::DataSenderMonitorCollection::OutputModuleRecord.name, DQMNet::WaitObject.name, SiStripMonitorDigi.name, AlpgenParameterName.name, FP420SD.name, Vardesc.name, public_plots_tools.ColorScheme.name, PhysicsTools::Variable.name, Namelist.name, PhysicsTools::TrainerMonitoring::Object.name, stor::DataSenderMonitorCollection::OutputModuleResult.name, plotscripts.SawTeethFunction.name, @16192::Id.name, python.rootplot.utilities.RootFile.name, hTMaxCell.name, cscdqm::ParHistoDef.name, @16188::Id.name, BeautifulSoup.SoupStrainer.name, TiXmlAttribute.name, dirstructure.Comparison.rank, runall.testit.status, xdaqSourcePositionDriverData.status, WorkFlowRunner.WorkFlowRunner.status, addOnTests.testit.status, SubTaskSummaryStatus.status, RPCDQMObject::DQMObjectItem.status, TMatacq.status, HcalChannelQualityXml::_ChannelQuality.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.

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

Definition at line 363 of file dirstructure.py.

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

364  def __make_img_dir(self):
365  if not exists(self.mother_dir):
366  makedirs(self.mother_dir)
def dirstructure.Comparison.__repr__ (   self)

Definition at line 489 of file dirstructure.py.

References dirstructure.Comparison.img_name, cond::TagInfo.name, entry.name, genericValidation.GenericValidation.name, TmModule.name, ora::RecordSpecImpl::Item.name, Select.name, alignment.Alignment.name, FWTGeoRecoGeometry::Info.name, Types._Untracked.name, GifDisplay.name, Button.name, PixelDCSObject< class >::Item.name, fit::RootMinuitCommand.name, ParameterSet.name, SeedingLayerSetsBuilder::LayerSpec.name, DQMRivetClient::LumiOption.name, MagCylinder.name, PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.name, PrintSensitive.name, RHStopTracer::StopPoint.name, CombinedMVAJetTagComputer::Computer.name, DQMRivetClient::ScaleFactorOption.name, EgHLTOfflineSummaryClient::SumHistBinData.name, PhysicsTools::Source.name, CSCDCCExaminer::OStream.name, lumi::TriggerInfo.name, MyWatcher.name, XMLRBXPedestalsLoader::_loaderBaseConfig.name, SingleObjectCondition.name, XMLHTRZeroSuppressionLoader::_loaderBaseConfig.name, cond::TimeTypeSpecs.name, PrintMaterialBudgetInfo.name, DQMGenericClient::EfficOption.name, edm::PathSummary.name, PixelEndcapLinkMaker::Item.name, dirstructure.Weighted.name, perftools::EdmEventSize::BranchRecord.name, FWTableViewManager::TableEntry.name, PixelBarrelLinkMaker::Item.name, Mapper::definition< ScannerT >.name, options.ConnectionHLTMenu.name, McSelector.name, EcalLogicID.name, MEtoEDM< T >::MEtoEDMObject.name, RecoSelector.name, ExpressionHisto< T >.name, python.rootplot.utilities.Hist2D.name, TreeCrawler.Package.name, CaloTrkProcessing::Detector.name, SensitiveDetector.name, XMLProcessor::_loaderBaseConfig.name, PrintGeomInfoAction.name, HcalForwardLibWriter::FileHandle.name, PrintGeomMatInfo.name, MagGeoBuilderFromDDD::volumeHandle.name, DQMGenericClient::NormOption.name, PhysicsTools::Calibration::Variable.name, DQMGenericClient::CDOption.name, h4DSegm.name, PhysicsTools::Variable::Value.name, options.HLTProcessOptions.name, EDMtoMEConverter.name, ProcTMVA::Method.name, TreeSaver::Var.name, python.rootplot.tree2hists.Plot.name, MuonGeometrySanityCheckPoint.name, PhysicsTools::TrainProcessor.name, TotemSD.name, PhysicsTools::TreeReader::Value.name, PhysicsTools::MVAModuleHelper< Record, Object, Filler >::Value.name, PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >.name, PhysicsTools::MVATrainer.name, EfficiencyHandler.name, h2DSegm.name, python.rootplot.utilities.Hist.name, BscSD.name, DQMNet::WaitObject.name, stor::DataSenderMonitorCollection::OutputModuleRecord.name, SiStripMonitorDigi.name, AlpgenParameterName.name, FP420SD.name, Vardesc.name, public_plots_tools.ColorScheme.name, PhysicsTools::Variable.name, Namelist.name, PhysicsTools::TrainerMonitoring::Object.name, stor::DataSenderMonitorCollection::OutputModuleResult.name, plotscripts.SawTeethFunction.name, @16192::Id.name, python.rootplot.utilities.RootFile.name, hTMaxCell.name, cscdqm::ParHistoDef.name, @16188::Id.name, BeautifulSoup.SoupStrainer.name, TiXmlAttribute.name, dirstructure.Comparison.rank, runall.testit.status, xdaqSourcePositionDriverData.status, WorkFlowRunner.WorkFlowRunner.status, addOnTests.testit.status, SubTaskSummaryStatus.status, RPCDQMObject::DQMObjectItem.status, TMatacq.status, HcalChannelQualityXml::_ChannelQuality.status, SiPixelFedFillerWordEventNumber.status, HcalDetDiagLaserClient.status, HcalDetDiagLEDClient.status, HcalDetDiagPedestalClient.status, CastorPSMonitor.status, CastorChannelQualityMonitor.status, MCSmartSingleParticleFilter.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, and dirstructure.Comparison.test_name.

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

Definition at line 377 of file dirstructure.py.

References dirstructure.Comparison.img_name.

Referenced by dirstructure.Comparison.__make_image().

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

Member Data Documentation

int dirstructure.Comparison.canvas_xsize = 500
static

Definition at line 335 of file dirstructure.py.

int dirstructure.Comparison.canvas_ysize = 400
static

Definition at line 336 of file dirstructure.py.

dirstructure.Comparison.do_pngs

Definition at line 357 of file dirstructure.py.

Referenced by dqm_interfaces.DirWalkerDB.run().

dirstructure.Comparison.draw_success

Definition at line 358 of file dirstructure.py.

dirstructure.Comparison.img_name

Definition at line 341 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 340 of file dirstructure.py.

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

dirstructure.Comparison.name

Definition at line 338 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__(), BeautifulSoup.Tag._invert(), utils.StatisticalTest.get_status(), and Vispa.Views.PropertyView.Property.valueChanged().

dirstructure.Comparison.png_name

Definition at line 339 of file dirstructure.py.

dirstructure.Comparison.rank

Definition at line 351 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 347 of file dirstructure.py.

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

dirstructure.Comparison.test_name

Definition at line 348 of file dirstructure.py.

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

dirstructure.Comparison.test_thr

Definition at line 350 of file dirstructure.py.