CMS 3D CMS Logo

Functions | Variables

makeLayoutFileForGui Namespace Reference

Functions

def defaults
def eleRej
def layDefaults
def muRej
def sCone
def sizeSumpt

Variables

dictionary datasetNames = {'RealData' : 'QCD Jets', 'RealMuonsData' : 'muons from Z', 'RealElectronsData' : 'electrons from Z'}
list defaultPlots
list elerejplots
tuple layout = open('shift_pftau_T0_layout.py','w')
list layoutDefaultPlots
list layoutscone
list layoutSizeSumpt
string layoutString = 'def pftaulayout(i, p, *rows): i["RecoTauV/Layouts/" + p] = DQMItem(layout=rows)\n\n%s'
 LAYOUTS.
list muonrejplots = ['RecoTauV/hpsPFTauProducerRealMuonsData_hpsPFTauDiscriminationByLooseMuonRejection/LooseMuonRejectionEff%s', 'RecoTauV/hpsPFTauProducerRealMuonsData_hpsPFTauDiscriminationByMediumMuonRejection/MediumMuonRejectionEff%s', 'RecoTauV/hpsPFTauProducerRealMuonsData_hpsPFTauDiscriminationByTightMuonRejection/TightMuonRejectionEff%s']
string outputFileString = 'def shiftpftaulayout(i, p, *rows): i["00 Shift/Tau/" + p] = DQMItem(layout=rows)\n\n%s'
tuple stdFill = Template('shiftpftaulayout(\n\tdqmitems,\n\t"$locpath",\n\t$rows\n\t)')
tuple stripDiscName = lambdax:(x.split('/')[-1])
tuple sumVar = dict( zip(string.letters,[elem for elem in ['signalPFCands','isolationPFChargedHadrCands','isolationPFGammaCands','isolationPFNeutrHadrCands'] ]) )
list toAdd = [ defaults('SingleMu/00%s - Fake rate from muons vs %s' % item,'RealMuonsData',item[1]) for item in variables.items() ]
dictionary variables = {'a':'pt','b':'pileup','c':'eta','d':'phi'}

Function Documentation

def makeLayoutFileForGui::defaults (   locpath,
  dataType,
  var 
)

Definition at line 35 of file makeLayoutFileForGui.py.

00036                                   :
00037     rows = [[{ 'path': plot % (dataType,var), 'description': '%s fake rate from %s' % (stripDiscName(plot), datasetNames[dataType]),'draw': {'drawopts': "e"}} for plot in row] for row in defaultPlots]
00038     strow = ',\n\t'.join([row.__repr__() for row in rows])
00039     return stdFill.substitute(locpath=locpath,rows=strow)

def makeLayoutFileForGui::eleRej (   locpath,
  var 
)

Definition at line 44 of file makeLayoutFileForGui.py.

00045                        :
00046     rows = [[{ 'path': plot % var, 'description': '%s fake rate' % (stripDiscName(plot)),'draw': {'drawopts': "e"}} for plot in row] for row in elerejplots]
00047     strow = ',\n\t'.join([row.__repr__() for row in rows])
00048     return stdFill.substitute(locpath=locpath,rows=strow)
00049 
00050 #
00051 #SingleMu
#
def makeLayoutFileForGui::layDefaults (   locpath,
  dataType,
  var 
)

Definition at line 110 of file makeLayoutFileForGui.py.

00111                                      :
00112     framerows = [[[{ 'path': plot % (dataType,var), 'description': '%s fake rate from %s' % (stripDiscName(plot), datasetNames[dataType]),'draw': {'drawopts': "e"}} for plot in row] for row in frame] for frame in layoutDefaultPlots]
00113     strows = [',\n\t'.join([row.__repr__() for row in rows]) for rows in framerows]
00114     ret = [stdFill.substitute(locpath=locpath % postfix, rows=strow) for postfix,strow in zip(string.letters,strows)]
00115     return '\n'.join(ret)

def makeLayoutFileForGui::muRej (   locpath,
  var 
)

Definition at line 40 of file makeLayoutFileForGui.py.

00041                       :
00042     rows = [{ 'path': plot % var, 'description': '%s fake rate' % (stripDiscName(plot)),'draw': {'drawopts': "e"}} for plot in muonrejplots]
00043     return stdFill.substitute(locpath=locpath,rows=rows.__repr__())

def makeLayoutFileForGui::sCone (   locpath,
  dataType,
  var 
)

Definition at line 116 of file makeLayoutFileForGui.py.

00117                                :
00118     rows = [[{ 'path': plot % (dataType,var), 'description': '%s fake rate from %s' % (stripDiscName(plot), datasetNames[dataType]),'draw': {'drawopts': "e"}} for plot in row] for row in layoutscone]
00119     strow = ',\n\t'.join([row.__repr__() for row in rows])
00120     return stdFill.substitute(locpath=locpath,rows=strow)

def makeLayoutFileForGui::sizeSumpt (   locpath,
  dataType,
  var 
)

Definition at line 121 of file makeLayoutFileForGui.py.

00122                                    :
00123     typ = lambda x: x.split('_')[-2]
00124     if typ == 'SumPt':
00125         typ += ' distribution'
00126     rows = [[{ 'path': plot % (dataType,var), 'description': '%s faking taus %s of %s' % (datasetNames[dataType],typ(plot), var),'draw': {'drawopts': "e"}} for plot in row] for row in layoutSizeSumpt]
00127     strow = ',\n\t'.join([row.__repr__() for row in rows])
00128     return stdFill.substitute(locpath=locpath,rows=strow)


Variable Documentation

dictionary makeLayoutFileForGui::datasetNames = {'RealData' : 'QCD Jets', 'RealMuonsData' : 'muons from Z', 'RealElectronsData' : 'electrons from Z'}
Initial value:
00001 [
00002     ['RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByDecayModeFinding/DecayModeFindingEff%s',
00003     'RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByLooseChargedIsolation/LooseChargedIsolationEff%s',
00004     'RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr/LooseCombinedIsolationDBSumPtCorrEff%s'],
00005     ['RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr/MediumCombinedIsolationDBSumPtCorrEff%s',
00006     'RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr/TightCombinedIsolationDBSumPtCorrEff%s',
00007     'RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByVLooseCombinedIsolationDBSumPtCorr/VLooseCombinedIsolationDBSumPtCorrEff%s'],
00008     ]

Definition at line 10 of file makeLayoutFileForGui.py.

Initial value:
00001 [
00002     ['RecoTauV/hpsPFTauProducerRealElectronsData_hpsPFTauDiscriminationByLooseElectronRejection/LooseElectronRejectionEff%s',
00003      'RecoTauV/hpsPFTauProducerRealElectronsData_hpsPFTauDiscriminationByMVAElectronRejection/MVAElectronRejectionEff%s',],
00004     ['RecoTauV/hpsPFTauProducerRealElectronsData_hpsPFTauDiscriminationByMediumElectronRejection/MediumElectronRejectionEff%s',
00005      'RecoTauV/hpsPFTauProducerRealElectronsData_hpsPFTauDiscriminationByTightElectronRejection/TightElectronRejectionEff%s']
00006      ]

Definition at line 21 of file makeLayoutFileForGui.py.

tuple makeLayoutFileForGui::layout = open('shift_pftau_T0_layout.py','w')
Initial value:
00001 [
00002     [
00003         ['RecoTauV/hpsPFTauProducer%s_Matched/PFJetMatchingEff%s',
00004         'RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByDecayModeFinding/DecayModeFindingEff%s'],
00005         ['RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByLooseChargedIsolation/LooseChargedIsolationEff%s',
00006          'RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr/LooseCombinedIsolationDBSumPtCorrEff%s'],
00007          ],
00008     [
00009          ['RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByLooseIsolation/LooseIsolationEff%s',
00010          'RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr/MediumCombinedIsolationDBSumPtCorrEff%s'],
00011          ['RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr/TightCombinedIsolationDBSumPtCorrEff%s',
00012          'RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByVLooseCombinedIsolationDBSumPtCorr/VLooseCombinedIsolationDBSumPtCorrEff%s'],
00013          ]
00014     ]

Definition at line 77 of file makeLayoutFileForGui.py.

Initial value:
00001 [
00002     ['RecoTauV/shrinkingConePFTauProducerLeadingPion%s_shrinkingConePFTauDiscriminationByECALIsolationUsingLeadingPion/ECALIsolationUsingLeadingPionEff%s',
00003      'RecoTauV/shrinkingConePFTauProducerLeadingPion%s_shrinkingConePFTauDiscriminationByLeadingPionPtCut/LeadingPionPtCutEff%s'],
00004     ['RecoTauV/shrinkingConePFTauProducerLeadingPion%s_shrinkingConePFTauDiscriminationByLeadingTrackFinding/LeadingTrackFindingEff%s',
00005      'RecoTauV/shrinkingConePFTauProducerLeadingPion%s_shrinkingConePFTauDiscriminationByTrackIsolationUsingLeadingPion/TrackIsolationUsingLeadingPionEff%s']
00006     ]

Definition at line 92 of file makeLayoutFileForGui.py.

Initial value:
00001 [
00002     ['RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByDecayModeFinding/hpsPFTauDiscriminationByDecayModeFinding_Size_%s',
00003     'RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByLooseChargedIsolation/hpsPFTauDiscriminationByLooseChargedIsolation_Size_%s',
00004     'RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr/hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr_Size_%s'],
00005     ['RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByDecayModeFinding/hpsPFTauDiscriminationByDecayModeFinding_SumPt_%s',
00006     'RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByLooseChargedIsolation/hpsPFTauDiscriminationByLooseChargedIsolation_SumPt_%s',
00007     'RecoTauV/hpsPFTauProducer%s_hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr/hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr_SumPt_%s'],
00008     ]

Definition at line 99 of file makeLayoutFileForGui.py.

string makeLayoutFileForGui::layoutString = 'def pftaulayout(i, p, *rows): i["RecoTauV/Layouts/" + p] = DQMItem(layout=rows)\n\n%s'

LAYOUTS.

Definition at line 74 of file makeLayoutFileForGui.py.

list makeLayoutFileForGui::muonrejplots = ['RecoTauV/hpsPFTauProducerRealMuonsData_hpsPFTauDiscriminationByLooseMuonRejection/LooseMuonRejectionEff%s', 'RecoTauV/hpsPFTauProducerRealMuonsData_hpsPFTauDiscriminationByMediumMuonRejection/MediumMuonRejectionEff%s', 'RecoTauV/hpsPFTauProducerRealMuonsData_hpsPFTauDiscriminationByTightMuonRejection/TightMuonRejectionEff%s']

Definition at line 19 of file makeLayoutFileForGui.py.

string makeLayoutFileForGui::outputFileString = 'def shiftpftaulayout(i, p, *rows): i["00 Shift/Tau/" + p] = DQMItem(layout=rows)\n\n%s'

Definition at line 32 of file makeLayoutFileForGui.py.

tuple makeLayoutFileForGui::stdFill = Template('shiftpftaulayout(\n\tdqmitems,\n\t"$locpath",\n\t$rows\n\t)')

Definition at line 33 of file makeLayoutFileForGui.py.

tuple makeLayoutFileForGui::stripDiscName = lambdax:(x.split('/')[-1])

Definition at line 8 of file makeLayoutFileForGui.py.

tuple makeLayoutFileForGui::sumVar = dict( zip(string.letters,[elem for elem in ['signalPFCands','isolationPFChargedHadrCands','isolationPFGammaCands','isolationPFNeutrHadrCands'] ]) )

Definition at line 130 of file makeLayoutFileForGui.py.

list makeLayoutFileForGui::toAdd = [ defaults('SingleMu/00%s - Fake rate from muons vs %s' % item,'RealMuonsData',item[1]) for item in variables.items() ]
dictionary makeLayoutFileForGui::variables = {'a':'pt','b':'pileup','c':'eta','d':'phi'}