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 319 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 322 of file dirstructure.py.

323  def __init__(self,name,mother_dir,h1,h2,stat_test,draw_success=False,do_pngs=False, skip=False):
324  self.name=name
325  self.png_name="placeholder.png"
326  self.mother_dir=mother_dir
327  self.img_name=""
328  #self.draw_success=draw_success
329  Weighted.__init__(self,name)
330 
331  stat_test.set_operands(h1,h2)
332  if skip:
333  self.status = SKIPED
334  self.test_name=stat_test.name
335  self.test_name=stat_test.name
336  self.test_thr=stat_test.threshold
337  self.rank = 0
338  else:
339  self.status=stat_test.get_status()
340  self.rank=stat_test.get_rank()
341  self.test_name=stat_test.name
342  self.test_thr=stat_test.threshold
343  self.do_pngs=do_pngs
344  self.draw_success=draw_success or not do_pngs
345  if ((self.status==FAIL or self.status==NULL or self.status == SKIPED or self.draw_success) and self.do_pngs):
346  self.__make_image(h1,h2)
347  #self.__make_image(h1,h2)

Member Function Documentation

def dirstructure.Comparison.__get_img_name (   self)
private

Definition at line 352 of file dirstructure.py.

References dirstructure.Comparison.img_name, dirstructure.Directory.mother_dir, dirstructure.Comparison.mother_dir, cond::TagInfo.name, profilereader.FunctionInfo.name, genericValidation.GenericValidation.name, TmModule.name, Select.name, ora::RecordSpecImpl::Item.name, GifDisplay.name, FWTGeoRecoGeometry::Info.name, alignment.Alignment.name, Button.name, Types._Untracked.name, MyWatcher.name, PixelDCSObject< class >::Item.name, fit::RootMinuitCommand.name, ParameterSet.name, HcalForwardLibWriter::FileHandle.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, XMLHTRZeroSuppressionLoader::_loaderBaseConfig.name, SingleObjectCondition.name, XMLRBXPedestalsLoader::_loaderBaseConfig.name, cond::TimeTypeSpecs.name, PrintMaterialBudgetInfo.name, MagVolume6Faces.name, perftools::EdmEventSize::BranchRecord.name, DQMGenericClient::EfficOption.name, edm::PathSummary.name, dirstructure.Weighted.name, PixelEndcapLinkMaker::Item.name, PixelBarrelLinkMaker::Item.name, FWTableViewManager::TableEntry.name, Mapper::definition< ScannerT >.name, options.ConnectionHLTMenu.name, McSelector.name, EcalLogicID.name, ExpressionHisto< T >.name, RecoSelector.name, MEtoEDM< T >::MEtoEDMObject.name, python.rootplot.utilities.Hist2D.name, TreeCrawler.Package.name, SensitiveDetector.name, XMLProcessor::_loaderBaseConfig.name, CaloTrkProcessing::Detector.name, PrintGeomInfoAction.name, MagGeoBuilderFromDDD::volumeHandle.name, PhysicsTools::Calibration::Variable.name, DQMGenericClient::NormOption.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, 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, @15930::Id.name, python.rootplot.utilities.RootFile.name, hTMaxCell.name, cscdqm::ParHistoDef.name, BeautifulSoup.Tag.name, @15926::Id.name, TiXmlAttribute.name, and BeautifulSoup.SoupStrainer.name.

Referenced by dirstructure.Comparison.__make_image().

353  def __get_img_name(self):
354  #self.__make_img_dir()
355  #print "MOTHER: ",self.mother_dir
356  self.img_name="%s/%s.png"%(self.mother_dir,self.name)
357  self.img_name=self.img_name.replace("Run summary","")
358  self.img_name=self.img_name.replace("/","_")
359  self.img_name=self.img_name.strip("_")
360  #print "IMAGE NAME: %s " %self.img_name
361  return self.img_name
def dirstructure.Comparison.__make_image (   self,
  obj1,
  obj2 
)
private

Definition at line 383 of file dirstructure.py.

References dirstructure.Comparison.__get_img_name(), dirstructure.Comparison.img_name, cond::TagInfo.name, profilereader.FunctionInfo.name, genericValidation.GenericValidation.name, TmModule.name, Select.name, ora::RecordSpecImpl::Item.name, GifDisplay.name, FWTGeoRecoGeometry::Info.name, alignment.Alignment.name, Button.name, Types._Untracked.name, MyWatcher.name, PixelDCSObject< class >::Item.name, fit::RootMinuitCommand.name, ParameterSet.name, HcalForwardLibWriter::FileHandle.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, XMLHTRZeroSuppressionLoader::_loaderBaseConfig.name, SingleObjectCondition.name, XMLRBXPedestalsLoader::_loaderBaseConfig.name, cond::TimeTypeSpecs.name, PrintMaterialBudgetInfo.name, MagVolume6Faces.name, perftools::EdmEventSize::BranchRecord.name, DQMGenericClient::EfficOption.name, edm::PathSummary.name, PixelEndcapLinkMaker::Item.name, dirstructure.Weighted.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, 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, 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, @15930::Id.name, python.rootplot.utilities.RootFile.name, hTMaxCell.name, cscdqm::ParHistoDef.name, BeautifulSoup.Tag.name, @15926::Id.name, TiXmlAttribute.name, BeautifulSoup.SoupStrainer.name, dirstructure.Comparison.rank, runall.testit.status, WorkFlowRunner.WorkFlowRunner.status, xdaqSourcePositionDriverData.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, EcalPerEvtMatacqAnalyzer.status, MCParticlePairFilter.status, DJpsiFilter.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.

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

Definition at line 348 of file dirstructure.py.

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

349  def __make_img_dir(self):
350  if not exists(self.mother_dir):
351  makedirs(self.mother_dir)
def dirstructure.Comparison.__repr__ (   self)

Definition at line 474 of file dirstructure.py.

References dirstructure.Comparison.img_name, cond::TagInfo.name, profilereader.FunctionInfo.name, genericValidation.GenericValidation.name, TmModule.name, ora::RecordSpecImpl::Item.name, Select.name, alignment.Alignment.name, FWTGeoRecoGeometry::Info.name, GifDisplay.name, Button.name, Types._Untracked.name, MyWatcher.name, PixelDCSObject< class >::Item.name, fit::RootMinuitCommand.name, ParameterSet.name, HcalForwardLibWriter::FileHandle.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, XMLHTRZeroSuppressionLoader::_loaderBaseConfig.name, XMLRBXPedestalsLoader::_loaderBaseConfig.name, SingleObjectCondition.name, cond::TimeTypeSpecs.name, PrintMaterialBudgetInfo.name, MagVolume6Faces.name, DQMGenericClient::EfficOption.name, edm::PathSummary.name, PixelEndcapLinkMaker::Item.name, dirstructure.Weighted.name, perftools::EdmEventSize::BranchRecord.name, PixelBarrelLinkMaker::Item.name, FWTableViewManager::TableEntry.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, XMLProcessor::_loaderBaseConfig.name, CaloTrkProcessing::Detector.name, SensitiveDetector.name, PrintGeomInfoAction.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, 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, 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, @15930::Id.name, python.rootplot.utilities.RootFile.name, hTMaxCell.name, cscdqm::ParHistoDef.name, BeautifulSoup.Tag.name, @15926::Id.name, TiXmlAttribute.name, BeautifulSoup.SoupStrainer.name, dirstructure.Comparison.rank, runall.testit.status, WorkFlowRunner.WorkFlowRunner.status, xdaqSourcePositionDriverData.status, addOnTests.testit.status, SubTaskSummaryStatus.status, RPCDQMObject::DQMObjectItem.status, HcalChannelQualityXml::_ChannelQuality.status, TMatacq.status, SiPixelFedFillerWordEventNumber.status, HcalDetDiagLaserClient.status, HcalDetDiagLEDClient.status, HcalDetDiagPedestalClient.status, CastorPSMonitor.status, CastorChannelQualityMonitor.status, MCSmartSingleParticleFilter.status, EcalPyWrapperHelper< T >.status, MCSingleParticleFilter.status, EcalPerEvtMatacqAnalyzer.status, MCParticlePairFilter.status, DJpsiFilter.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.

475  def __repr__(self):
476  return "%s , (%s=%s). IMG=%s. status=%s" %(self.name,self.test_name,self.rank,self.img_name,self.status)
477 
478 #-------------------------------------------------------------------------------
def dirstructure.Comparison.tcanvas_slow (   self,
  canvas 
)

Definition at line 362 of file dirstructure.py.

References dirstructure.Comparison.img_name.

Referenced by dirstructure.Comparison.__make_image().

363  def tcanvas_slow(self,canvas):
364  #print "About to print %s" %self.img_name
365  #print_multi_threaded(canvas,self.img_name)
366  #print "-->Printed"
367 
368  p = Process(target=print_multi_threaded, args=(canvas,self.img_name))
369  p.start()
370  tcanvas_print_processes.append(p)
371  n_proc=len(tcanvas_print_processes)
372  if n_proc>3:
373  p_to_remove=[]
374  for iprocess in xrange(0,n_proc):
375  p=tcanvas_print_processes[iprocess]
376  p.join()
377  p_to_remove.append(iprocess)
378 
379  adjustment=0
380  for iprocess in p_to_remove:
381  tcanvas_print_processes.pop(iprocess-adjustment)
382  adjustment+=1

Member Data Documentation

int dirstructure.Comparison.canvas_xsize = 500
static

Definition at line 320 of file dirstructure.py.

int dirstructure.Comparison.canvas_ysize = 400
static

Definition at line 321 of file dirstructure.py.

dirstructure.Comparison.do_pngs

Definition at line 342 of file dirstructure.py.

Referenced by dqm_interfaces.DirWalkerDB.run().

dirstructure.Comparison.draw_success

Definition at line 343 of file dirstructure.py.

dirstructure.Comparison.img_name

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

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

dirstructure.Comparison.name

Definition at line 323 of file dirstructure.py.

Referenced by dqm_interfaces.DirID.__eq__(), dataset.Dataset.__getDataType(), dataset.Dataset.__getFileInfoList(), dqm_interfaces.DirID.__repr__(), utils.StatisticalTest.get_status(), and Vispa.Views.PropertyView.Property.valueChanged().

dirstructure.Comparison.png_name

Definition at line 324 of file dirstructure.py.

dirstructure.Comparison.rank

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

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

dirstructure.Comparison.test_name

Definition at line 333 of file dirstructure.py.

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

dirstructure.Comparison.test_thr

Definition at line 335 of file dirstructure.py.