CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
plotting.FakeDuplicate Class Reference

Public Member Functions

def __init__
 
def __str__
 
def create
 

Private Attributes

 _assoc
 
 _dup
 
 _name
 
 _reco
 
 _title
 

Detailed Description

Class to calculate the fake+duplicate rate

Definition at line 846 of file plotting.py.

Constructor & Destructor Documentation

def plotting.FakeDuplicate.__init__ (   self,
  name,
  assoc,
  dup,
  reco,
  title = "" 
)
Constructor.

Arguments:
name  -- String for the name of the resulting efficiency histogram
assoc -- String for the name of the "associated" histogram
dup   -- String for the name of the "duplicates" histogram
reco  -- String for the name of the "reco" (denominator) histogram

Keyword arguments:
title  -- String for a title of the resulting histogram (default "")

The result is calculated as 1 - (assoc - dup) / reco

Definition at line 848 of file plotting.py.

849  def __init__(self, name, assoc, dup, reco, title=""):
850  """Constructor.
851 
852  Arguments:
853  name -- String for the name of the resulting efficiency histogram
854  assoc -- String for the name of the "associated" histogram
855  dup -- String for the name of the "duplicates" histogram
856  reco -- String for the name of the "reco" (denominator) histogram
857 
858  Keyword arguments:
859  title -- String for a title of the resulting histogram (default "")
860 
861  The result is calculated as 1 - (assoc - dup) / reco
862  """
863  self._name = name
864  self._assoc = assoc
865  self._dup = dup
866  self._reco = reco
867  self._title = title

Member Function Documentation

def plotting.FakeDuplicate.__str__ (   self)
String representation, returns the name

Definition at line 868 of file plotting.py.

References FP420HitsObject._name, TrackerHitsObject._name, PGeometricDet::Item._name, TrackingRecHitAlgorithm._name, Logger._name, hcaldqm::DQModule._name, citk::IsolationConeDefinitionBase._name, DrellYanValidation._name, WValidation._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, plotting.FakeDuplicate._name, and SequenceTypes.TaskPlaceholder._name.

869  def __str__(self):
870  """String representation, returns the name"""
871  return self._name
def plotting.FakeDuplicate.create (   self,
  tdirectory 
)
Create and return the fake+duplicate histogram from a TDirectory

Definition at line 872 of file plotting.py.

References SpecialClusterImporter< T >._assoc, plotting.FakeDuplicate._assoc, plotting.FakeDuplicate._dup, plotting._getObject(), FP420HitsObject._name, TrackerHitsObject._name, PGeometricDet::Item._name, TrackingRecHitAlgorithm._name, Logger._name, hcaldqm::DQModule._name, citk::IsolationConeDefinitionBase._name, DrellYanValidation._name, WValidation._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, plotting.FakeDuplicate._name, SequenceTypes.TaskPlaceholder._name, plotting.FakeDuplicate._reco, HistoParams< T >._title, HistoParams< TH2F >._title, SiStripHitEffFromCalibTree._title, HistoParams< TProfile2D >._title, html.PageSet._title, plotting.Subtract._title, html.HtmlReport._title, plotting.Transform._title, plotting.FakeDuplicate._title, and sistrip::SpyUtilities.range().

873  def create(self, tdirectory):
874  """Create and return the fake+duplicate histogram from a TDirectory"""
875  # Get the numerator/denominator histograms
876  hassoc = _getObject(tdirectory, self._assoc)
877  hdup = _getObject(tdirectory, self._dup)
878  hreco = _getObject(tdirectory, self._reco)
879 
880  # Skip if any of them does not exist
881  if not hassoc or not hdup or not hreco:
882  return None
883 
884  hfakedup = hreco.Clone(self._name)
885  hfakedup.SetTitle(self._title)
886 
887  for i in range(1, hassoc.GetNbinsX()+1):
888  numerVal = hassoc.GetBinContent(i) - hdup.GetBinContent(i)
889  denomVal = hreco.GetBinContent(i)
890 
891  fakedupVal = (1 - numerVal / denomVal) if denomVal != 0.0 else 0.0
892  errVal = math.sqrt(fakedupVal*(1-fakedupVal)/denomVal) if (denomVal != 0.0 and fakedupVal <= 1) else 0.0
893 
894  hfakedup.SetBinContent(i, fakedupVal)
895  hfakedup.SetBinError(i, errVal)
896 
897  return hfakedup
const uint16_t range(const Frame &aFrame)
def _getObject
Definition: plotting.py:49

Member Data Documentation

plotting.FakeDuplicate._assoc
private

Definition at line 863 of file plotting.py.

Referenced by plotting.FakeDuplicate.create().

plotting.FakeDuplicate._dup
private

Definition at line 864 of file plotting.py.

Referenced by plotting.FakeDuplicate.create().

plotting.FakeDuplicate._name
private

Definition at line 862 of file plotting.py.

Referenced by plotting.FakeDuplicate.__str__(), plotting.CutEfficiency.__str__(), plotting.AggregateBins.__str__(), plotting.AggregateHistos.__str__(), plotting.ROC.__str__(), trackingPlots.TimePerEventPlot.__str__(), trackingPlots.TimePerTrackPlot.__str__(), trackingPlots.TimePerEventPlot._create(), plotting.PlotGroup._drawSeparate(), plotting.PlotGroup._save(), plotting.FakeDuplicate.create(), plotting.CutEfficiency.create(), plotting.AggregateBins.create(), plotting.AggregateHistos.create(), trackingPlots.TimePerTrackPlot.create(), plotting.Plot.create(), plotting.PlotGroup.draw(), plotting.Plot.getName(), plotting.PlotGroup.getName(), plotting.PlotterFolder.getName(), plotting.PlotterItem.getName(), plotting.PlotterFolder.getSelectionNameIterator(), validation.SimpleSample.name(), trackingPlots.Iteration.name(), plotting.PlotterItem.readDirs(), plotting.PlotGroup.remove(), and plotting.Plot.setName().

plotting.FakeDuplicate._reco
private

Definition at line 865 of file plotting.py.

Referenced by plotting.FakeDuplicate.create().

plotting.FakeDuplicate._title
private

Definition at line 866 of file plotting.py.

Referenced by plotting.FakeDuplicate.create(), plotting.CutEfficiency.create(), and plotting.Plot.create().