CMS 3D CMS Logo

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

Public Member Functions

def __init__ (self, name, assoc, dup, reco, title="")
 
def __str__ (self)
 
def create (self, tdirectory)
 

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

◆ __init__()

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.

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

◆ create()

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, condhdf5tohdf5.H5DataProduct._name, WValidation._name, DrellYanValidation._name, hcaldqm::flag::Flag._name, hcaldqm::quantity::Quantity._name, HistoParams< T >._name, condhdf5tohdf5.H5Tag._name, CutApplicatorBase._name, condhdf5tohdf5.H5GlobalTag._name, HistoParams< TH2F >._name, HistoParams< TProfile2D >._name, conddb2hdf5.DBGlobalTag._name, SequenceTypes.SequencePlaceholder._name, plotting.Subtract._name, plotting.Transform._name, plotting.FakeDuplicate._name, SequenceTypes._TaskBasePlaceholder._name, plotting.FakeDuplicate._reco, HistoParams< T >._title, HistoParams< TH2F >._title, HistoParams< TProfile2D >._title, html.PageSet._title, plotting.Subtract._title, html.HtmlReport._title, plotting.Transform._title, plotting.FakeDuplicate._title, and FastTimerService_cff.range.

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

Member Data Documentation

◆ _assoc

plotting.FakeDuplicate._assoc
private

Definition at line 863 of file plotting.py.

Referenced by plotting.FakeDuplicate.create().

◆ _dup

plotting.FakeDuplicate._dup
private

Definition at line 864 of file plotting.py.

Referenced by plotting.FakeDuplicate.create().

◆ _name

plotting.FakeDuplicate._name
private

◆ _reco

plotting.FakeDuplicate._reco
private

Definition at line 865 of file plotting.py.

Referenced by plotting.FakeDuplicate.create().

◆ _title

plotting.FakeDuplicate._title
private