CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 444 of file root2matplotlib.py.

Referenced by dataset.Dataset.__getDataType(), dataset.Dataset.__getMagneticField(), dataset.Dataset.__getMagneticFieldForRun(), dataset.Dataset.__lumiSelectionSnippet(), psClasses.BuildTreeNodeList.__str__(), psClasses.BuildTreeNode.__str__(), betterConfigParser.BetterConfigParser.__updateDict(), submitPVValidationJobs.BetterConfigParser.__updateDict(), trackingPlots.TimePerEventPlot._create(), python.iterators._findIterators(), trackingPlots.TrackingIterationOrder._findOrder(), trackingPlots._mapCollectionToAlgoQuality(), html._ptCut(), FrontierCondition_GT_autoExpress_cfi.Tier0Handler._queryTier0DataSvc(), tier0.Tier0Handler._queryTier0DataSvc(), iterativeTkConfig._seedOrTrackProducers(), trackingNtuple_cff._seedProdToTrackCands(), Muon.Muon.absIsoWithFSR(), Electron.Electron.absIsoWithFSR(), shallowTree_test_template.add_rawRelVals(), hltMuonPostProcessors_cff.add_reco_strings(), ConfigBuilder.ConfigBuilder.addCustomise(), ConfigBuilder.ConfigBuilder.addOutput(), L1CondDBIOVWriterExt.analyze(), L1O2OTestAnalyzerExt.analyze(), L1CondDBIOVWriter.analyze(), L1O2OTestAnalyzer.analyze(), hgcalPlots.append_hgcalTrackstersPlots(), data_sources.json_list.as_table(), python.rootplot.root2matplotlib.Hist.bar(), python.rootplot.root2matplotlib.Hist.barh(), heppy_batch.batchScriptCERN(), L1TEMTFEventInfoClient.book(), BTagDifferentialPlot.bookHisto(), HLTFiltersDQMonitor.bookHistograms(), L1TObjectsTiming.bookHistograms(), MultiTrackValidator.bookHistograms(), MuonTrackResidualAnalyzer.bookHistograms(), MuonTrackAnalyzer.bookHistograms(), MuonTrackValidator.bookHistograms(), TreeBranch.branchName(), EtaPtBin.buildDescriptionString(), MaterialBudgetCategorizer.buildHGCalCategoryMap(), dirstructure.Directory.calcStats(), MatrixUtil.changeRefRelease(), visDQMUtils.classifyDQMFile(), ctfseeding::HitExtractorSTRP.cleanedOfClusters(), recoTauConfTools.cmssw_version(), core.ProvenanceAnalyzer.ProvenanceAnalyzer.cmsswVNums(), electronDataDiscovery.common_search(), cmsHarvester.create_castor_path_name_common(), customiseMTVForBPix123Holes.customiseMTVForBPix123Holes(), customsPostLS1.customiseSimL1EmulatorForStage1(), customiseTrackingNtuple.customiseTrackingNtupleTool(), getPayloadData.discover_plugins(), dataset.Dataset.dump_cff(), enablePileUpCorrection.enablePileUpCorrectionInPF2PAT(), eostools.eosToLFN(), python.rootplot.root2matplotlib.Hist.errorbar(), python.rootplot.root2matplotlib.Hist.errorbarh(), confdb.HLTProcess.expandWildcards(), VariableNTupler.fill(), commentSkipper.cppCommentSkipper.filterFile(), commentSkipper.buildFileCommentSkipper.filterMultilineComment(), commentSkipper.buildFileCommentSkipper.filterOneLineComment(), harvestRelVal.find_dqmref(), SequenceTypes.findDirectDependencies(), MultipleCompare.FindParents(), relval_machine.fix_run(), edm::DaqProvenanceHelper.fixMetaData(), getRunInfo.Func_MakeShellWord(), pkg.AbstractPkg.generate(), generateGeometry.GeometryGenerator.generateGeom(), defaults_cfi.genjet_distribution_name(), MatrixUtil.genvalid(), harvestRelVal.get_cond_from_dsetpath(), tools.get_iovs(), harvestRelVal.get_name_from_dsetpath(), compareHistograms.get_output_filename(), electronDataDiscovery.getCMSdata(), betterConfigParser.BetterConfigParser.getResultingSection(), submitPVValidationJobs.BetterConfigParser.getResultingSection(), confdb.HLTProcess.getSetupConfigurationFromDB(), alcaDQMUpload.getURL(), heppy_hadd.hadd(), TreeCrawler.mymf.import_module(), ExternalGeneratorFilter.ExternalGeneratorFilter.insertInto(), compareHistograms.is_blacklisted(), L1TriggerKeyDummyProd.L1TriggerKeyDummyProd(), L1TriggerKeyDummyProdExt.L1TriggerKeyDummyProdExt(), DBSApi_cff.loadXML(), uploader.main(), produceOfflineValidationTex.main(), hltExoticaPostProcessors_cff.make_exo_postprocessor(), hltHiggsPostProcessors_cff.make_higgs_postprocessor(), hltSMPPostProcessors_cff.make_smp_postprocessor(), FastTrackerRecHitMaskProducer_cfi.maskProducerFromClusterRemover(), mergeLHE.DefaultLHEMerger.merge_headers(), APVGain.monHnames(), cmsHarvester.CMSHarvester.option_handler_input_spec(), cmsDriverOptions.OptionsFromItems(), TreeCrawler.packageNameFromFilename(), presentation.SummarySection.pages(), cmsswPreprocessor.CmsswPreprocessor.prefetchOneXrootdFile(), MatrixInjector.MatrixInjector.prepare(), ConfigBuilder.ConfigBuilder.prepare_GEN(), L1GtTriggerMenuTester.printWiki(), core.ProvenanceAnalyzer.ProvenanceAnalyzer.process(), VIDSelectorBase.process_pset(), L1RCTOmdsFedVectorProducer.produce(), dqm-mbProfile.read_procfs(), RunInfoRead.readData(), alcaDQMUpload.registerFileAtLogServer(), VariableNTupler.registerleaves(), KinematicTree.replaceCurrentParticle(), KinematicTree.replaceCurrentVertex(), defaults_cfi.response_distribution_name(), addOnTests.testit.run(), plotBaryCentre_VS_BeamSpot.Run(), cond2xml.sanitize(), compare.save(), BeamSpotWorkflow.selectFilesToProcess(), query.sendMessage(), cmsswConfigtrace.serve_main(), python.rootplot.root2matplotlib.Hist.show_titles(), confdb.HLTProcess.specificCustomize(), pfTools.switchToPFJets(), pfTools.switchToPFMET(), tauTools.switchToPFTauHPS(), coreTools.RunOnData.toolCode(), coreTools.RemoveMCMatching.toolCode(), tauTools.AddTauCollection.toolCode(), plottingOptions.PlottingOptionsTrackSplitting.validsubdets(), upgradeWorkflowComponents.UpgradeWorkflowPremix.workflow_(), betterConfigParser.BetterConfigParser.write(), FWPartialConfigSaveGUI.WriteConfig(), and presentation.writePage().

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

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 6 of file root2matplotlib.py.

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

Define constants.

Definition at line 43 of file root2matplotlib.py.