CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions | Variables
python.rootplot.root2matplotlib Namespace Reference

Classes

class  Hist
 
class  Hist2D
 Define classes. More...
 
class  HistStack
 
class  RootFile
 

Functions

def replace
 

Variables

string __license__
 
tuple _all_whitespace_string = re.compile(r'\s*$')
 Define constants. More...
 

Detailed Description

Utilities for plotting ROOT histograms in matplotlib.

Function Documentation

def python.rootplot.root2matplotlib.replace (   string,
  replacements 
)
Modify a string based on a list of patterns and substitutions.

replacements should be a list of two-entry tuples, the first entry giving
a string to search for and the second entry giving the string with which
to replace it.  If replacements includes a pattern entry containing
'use_regexp', then all patterns will be treated as regular expressions
using re.sub.

Definition at line 443 of file root2matplotlib.py.

Referenced by dataset.Dataset.__getDataType(), dataset.Dataset.__getMagneticField(), dataset.Dataset.__getMagneticFieldForRun(), psClasses.BuildTreeNodeList.__str__(), psClasses.BuildTreeNode.__str__(), betterConfigParser.BetterConfigParser.__updateDict(), python.iterators._findIterators(), hltMuonPostProcessors_cff.add_reco_strings(), hltSMPPostProcessors_cff.add_reco_strings(), hltExoticaPostProcessors_cff.add_reco_strings(), L1CondDBIOVWriter.analyze(), L1O2OTestAnalyzer.analyze(), python.rootplot.root2matplotlib.Hist.bar(), python.rootplot.root2matplotlib.Hist.barh(), BTagDifferentialPlot.bookHisto(), MultiTrackValidator.bookHistograms(), TrackerSeedValidator.bookHistograms(), MuonTrackResidualAnalyzer.bookHistograms(), MuonTrackAnalyzer.bookHistograms(), MuonTrackValidator.bookHistograms(), TreeBranch.branchName(), EtaPtBin.buildDescriptionString(), dirstructure.Directory.calcStats(), cfgName2py.cfgName2py(), MatrixUtil.changeRefRelease(), ctfseeding::HitExtractorSTRP.cleanedOfClusters(), recoTauConfTools.cmssw_version(), electronDataDiscovery.common_search(), cmsHarvester.create_castor_path_name_common(), Vispa.Views.BoxDecayView.BoxDecayView.createBoxesRecursive(), customsPostLS1.customiseSimL1EmulatorForStage1(), cmsIgProf_Analysis.diff_igprof_analysis(), dataset.Dataset.dump_cff(), enablePileUpCorrection.enablePileUpCorrectionInPF2PAT(), python.rootplot.root2matplotlib.Hist.errorbar(), python.rootplot.root2matplotlib.Hist.errorbarh(), WorkFlowRunner.esReportWorkflow(), confdb.HLTProcess.expandWildcards(), cmsPerfSuiteHarvest.exportIgProfReport(), cmsPerfSuiteHarvest.exportMemcheckReport(), cmsPerfSuiteHarvest.exportTimeSizeJob(), VariableNTupler.fill(), commentSkipper.cppCommentSkipper.filterFile(), commentSkipper.buildFileCommentSkipper.filterMultilineComment(), commentSkipper.buildFileCommentSkipper.filterOneLineComment(), harvestRelVal.find_dqmref(), MultipleCompare.FindParents(), hltTrgSeedMapper.findUniqueSeed(), relval_machine.fix_run(), edm::DaqProvenanceHelper.fixMetaData(), getRunInfo.Func_MakeShellWord(), pkg.AbstractPkg.generate(), generateWrappers.generateBuildFile(), MatrixUtil.genvalid(), harvestRelVal.get_cond_from_dsetpath(), harvestRelVal.get_name_from_dsetpath(), hltHiggsPostProcessors_cff.get_reco_strings(), MixingModule_Full2Fast.get_VertexGeneratorPSet_PileUpProducer(), FileNamesHelper.getJobID_fromFileName(), betterConfigParser.BetterConfigParser.getResultingSection(), alcaDQMUpload.getURL(), TreeCrawler.mymf.import_module(), L1TriggerKeyDummyProd.L1TriggerKeyDummyProd(), cmsIgProf_Analysis.library_igprof_analysis(), DBSApi_cff.loadXML(), uploader.main(), produceOfflineValidationTex.main(), cfg-viewer.main(), cmsRelvalreport.Profile.make_report(), SelectRuns.SelectRuns.makeList(), DOTExport.DotProducer.nodeURL(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.open(), cmsHarvester.CMSHarvester.option_handler_input_spec(), cmsDriverOptions.OptionsFromItems(), TreeCrawler.packageNameFromFilename(), MatrixInjector.MatrixInjector.prepare(), ConfigBuilder.ConfigBuilder.prepare_LHE(), comments.prepareReplaceDict(), L1GtTriggerMenuTester.printWiki(), cmsPerfSuiteHarvest.process_igprof_dir(), VIDSelectorBase.process_pset(), L1RCTOmdsFedVectorProducer.produce(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.pypackage(), RunInfoRead.readData(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.recursePSetProperties(), alcaDQMUpload.registerFileAtLogServer(), VariableNTupler.registerleaves(), KinematicTree.replaceCurrentParticle(), KinematicTree.replaceCurrentVertex(), addOnTests.testit.run(), DQMStore.save(), Vispa.Gui.BoxContentDialog.BoxContentDialog.script(), BeamSpotWorkflow.selectFilesToProcess(), query.sendMessage(), python.rootplot.root2matplotlib.Hist.show_titles(), cmsIgProf_Analysis.simple_igprof_analysis(), pfTools.switchToPFJets(), pfTools.switchToPFMET(), tauTools.switchToPFTauHPS(), Config.TestModuleCommand.testSecSource(), coreTools.RunOnData.toolCode(), coreTools.RemoveMCMatching.toolCode(), tauTools.AddTauCollection.toolCode(), HiCoreTools.RemoveCleaning.toolCode(), HiCoreTools.AddCleaning.toolCode(), lumiReport.toScreenConfHlt(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.updateViewMenu(), trackSplittingValidation.TrackSplittingValidation.validsubdets(), betterConfigParser.BetterConfigParser.write(), FWPartialConfigSaveGUI.WriteConfig(), and produceOfflineValidationTex.writePage().

444 def replace(string, replacements):
445  """
446  Modify a string based on a list of patterns and substitutions.
447 
448  replacements should be a list of two-entry tuples, the first entry giving
449  a string to search for and the second entry giving the string with which
450  to replace it. If replacements includes a pattern entry containing
451  'use_regexp', then all patterns will be treated as regular expressions
452  using re.sub.
453  """
454  if not replacements:
455  return string
456  if 'use_regexp' in [x for x,y in replacements]:
457  for pattern, repl in [x for x in replacements
458  if x[0] != 'use_regexp']:
459  string = re.sub(pattern, repl, string)
460  else:
461  for pattern, repl in replacements:
462  string = string.replace(pattern, repl)
463  if re.match(_all_whitespace_string, string):
464  return ""
465  return string
466 

Variable Documentation

string python.rootplot.root2matplotlib.__license__
Initial value:
1 = '''\
2 Copyright (c) 2009-2010 Jeff Klukas <klukas@wisc.edu>
3 
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10 
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 THE SOFTWARE.
21 '''

Definition at line 5 of file root2matplotlib.py.

tuple python.rootplot.root2matplotlib._all_whitespace_string = re.compile(r'\s*$')

Define constants.

Definition at line 42 of file root2matplotlib.py.