Пример #1
0
def create2DHistoTool(name,
                      binning=None,
                      attributeInfo1=None,
                      attributeInfo2=None,
                      **otherArgs):
    attName1, attType1, attGeV1 = unpackto3(attributeInfo1)
    attName1, selectIndex1 = findSelectIndex(attName1)

    attName2, attType2, attGeV2 = unpackto3(attributeInfo2)
    attName2, selectIndex2 = findSelectIndex(attName2)

    # currently support only vector<float> vs float, so there can be only one selected index.
    selectIndex = max(selectIndex1, selectIndex2)

    #hname = name if selectIndex==-1 else (name+'_'+str(selectIndex))
    hname = sanitizeName(
        name)  # remove [ and ] which can be problematic in histo names

    return JetAttributeHisto(name,
                             HistoDef=hdef(hname, *binning),
                             AttributeTypes=[attType1, attType2],
                             AttributeNames=[attName1, attName2],
                             AttributeInGeV=[bool(attGeV1),
                                             bool(attGeV2)],
                             SelectIndex=selectIndex,
                             **otherArgs)
Пример #2
0
def create1DHistoTool(name, binning, attributeInfo, **otherArgs):

    attName, attType, attGeV = unpackto3(attributeInfo)
    attName, selectIndex = findSelectIndex(attName)  # 'JVF[1]' --> 'JVF', 1

    #hname = name if selectIndex==-1 else (name+'_'+str(selectIndex))
    hname = sanitizeName(
        name)  # remove [ and ] which can be problematic in histo names

    return JetAttributeHisto(name,
                             HistoDef=hdef(hname, *binning),
                             AttributeTypes=[attType],
                             AttributeNames=[attName],
                             AttributeInGeV=[bool(attGeV)],
                             SelectIndex=selectIndex,
                             **otherArgs)
Пример #3
0

# Translate the above specifications into proper histo tools
#   and add them to jhm
attributeHistoManager.buildKnownTools(compactSpecification)


# Jet histogramming tools
jhm.addTool( JetKinematicHistos("allkinematics",PlotOccupancy=True, PlotAveragePt=True, PlotNJet=True  , PlotNConstit = True) )
jhm.addTool( JetKinematicHistos("basickinematics")  )
#jhm.addTool( JetKinematicHistos("basickinematics_emscale", JetScale=0)  )
#jhm.addTool( JetKinematicHistos("basickinematics_constscale", JetScale=1)  )

jhm.addTool( LeadingJetsRelations("leadingjetrel",
                                  HistoDef = [
    hdef('ljrDeltaEta', "#Delta #eta (lead, sublead);#Delta#eta;Entries",100,-10,10 ),
    hdef('ljrDeltaPhi', "#Delta #Phi (lead, sublead);#Delta#Phi;Entries",100,0,3.142 ),
    hdef('ljrDeltaR', "#Delta R (lead, sublead);#Delta R;Entries",100,0,10 ),
    hdef('ljrFrac', "(sublead Pt)/(lead Pt);ratio;Entries",100,0,1. ),
    
    #hdef('ljrEta1Eta2', "sublead #eta vs lead #eta;lead #eta;sublead #eta",100,-5,5.,100,-5,5 ),

    ]
                                  )  )

jhm.addTool( HIEfficiencyResponseHistos("effresponse", 
                                        HistoDef = [
            hdef('erhEfficiencyR1', "Jet p_{T} Efficiency #DeltaR = 0.1;p_{T}^{Truth} (GeV);Efficiency",50,0,100 ),
            hdef('erhEfficiencyR2', "Jet p_{T} Efficiency #DeltaR = 0.2;p_{T}^{Truth} (GeV);Efficiency",50,0,100 ),
            hdef('erhEfficiencyR3', "Jet p_{T} Efficiency #DeltaR = 0.3;p_{T}^{Truth} (GeV);Efficiency",50,0,100 ),
            
Пример #4
0
jhm.addTool(
    JetKinematicHistos("allkinematics",
                       PlotOccupancy=True,
                       PlotAveragePt=True,
                       PlotNJet=True,
                       PlotNConstit=True))
jhm.addTool(JetKinematicHistos("basickinematics"))
jhm.addTool(JetKinematicHistos("basickinematics_emscale", JetScale=0))
jhm.addTool(JetKinematicHistos("basickinematics_constscale", JetScale=1))

jhm.addTool(
    LeadingJetsRelations(
        "leadingjetrel",
        HistoDef=[
            hdef('ljrDeltaEta',
                 "#Delta #eta (lead, sublead);#Delta#eta;Entries", 100, -10,
                 10),
            hdef('ljrDeltaPhi',
                 "#Delta #Phi (lead, sublead);#Delta#Phi;Entries", 100, 0,
                 3.142),
            hdef('ljrDeltaR', "#Delta R (lead, sublead);#Delta R;Entries", 100,
                 0, 10),
            hdef('ljrFrac', "(sublead Pt)/(lead Pt);ratio;Entries", 100, 0,
                 1.),

            #hdef('ljrEta1Eta2', "sublead #eta vs lead #eta;lead #eta;sublead #eta",100,-5,5.,100,-5,5 ),
        ]))

jhm.addTool(
    EfficiencyResponseHistos(
        "effresponse",