CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
plotting.Transform Class Reference

Public Member Functions

def __init__ (self, name, histo, func, title="")
 
def __str__ (self)
 
def create (self, tdirectory)
 

Private Attributes

 _func
 
 _histo
 
 _name
 
 _title
 

Detailed Description

Class to transform bin contents in an arbitrary way.

Definition at line 809 of file plotting.py.

Constructor & Destructor Documentation

◆ __init__()

def plotting.Transform.__init__ (   self,
  name,
  histo,
  func,
  title = "" 
)
Constructor.

Argument:
name  -- String for name of the resulting histogram
histo -- String for a source histogram (needs to be cumulative)
func  -- Function to operate on the bin content

Definition at line 811 of file plotting.py.

811  def __init__(self, name, histo, func, title=""):
812  """Constructor.
813 
814  Argument:
815  name -- String for name of the resulting histogram
816  histo -- String for a source histogram (needs to be cumulative)
817  func -- Function to operate on the bin content
818  """
819  self._name = name
820  self._histo = histo
821  self._func = func
822  self._title = title
823 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ __str__()

def plotting.Transform.__str__ (   self)

◆ create()

def plotting.Transform.create (   self,
  tdirectory 
)
Create and return the transformed histogram from a TDirectory

Definition at line 828 of file plotting.py.

References plotting.Transform._func, plotting._getOrCreateObject(), plotting.Transform._histo, FP420HitsObject._name, TrackerHitsObject._name, PGeometricDet::Item._name, TrackingRecHitAlgorithm._name, Logger._name, hcaldqm::DQModule._name, citk::IsolationConeDefinitionBase._name, WValidation._name, DrellYanValidation._name, hcaldqm::flag::Flag._name, hcaldqm::quantity::Quantity._name, HistoParams< T >._name, CutApplicatorBase._name, HistoParams< TH2F >._name, HistoParams< TProfile2D >._name, SequenceTypes.SequencePlaceholder._name, plotting.Subtract._name, plotting.Transform._name, SequenceTypes._TaskBasePlaceholder._name, HistoParams< T >._title, HistoParams< TH2F >._title, SiStripHitEffFromCalibTree._title, HistoParams< TProfile2D >._title, html.PageSet._title, plotting.Subtract._title, html.HtmlReport._title, plotting.Transform._title, and FastTimerService_cff.range.

828  def create(self, tdirectory):
829  """Create and return the transformed histogram from a TDirectory"""
830  histo = _getOrCreateObject(tdirectory, self._histo)
831  if not histo:
832  return None
833 
834  ret = histo.Clone(self._name)
835  ret.SetTitle(self._title)
836 
837  # Disable canExtend if it is set, otherwise setting the
838  # overflow bin will extend instead, possibly causing weird
839  # effects downstream
840  ret.SetCanExtend(False)
841 
842  for i in range(0, histo.GetNbinsX()+2):
843  ret.SetBinContent(i, self._func(histo.GetBinContent(i)))
844  return ret
845 
def create(alignables, pedeDump, additionalData, outputFile, config)
def _getOrCreateObject(tdirectory, nameOrCreator)
Definition: plotting.py:57

Member Data Documentation

◆ _func

plotting.Transform._func
private

Definition at line 821 of file plotting.py.

Referenced by plotting.Transform.create().

◆ _histo

plotting.Transform._histo
private

Definition at line 820 of file plotting.py.

Referenced by plotting.Transform.create(), and plotting.CutEfficiency.create().

◆ _name

plotting.Transform._name
private

◆ _title

plotting.Transform._title
private