#"SU_350_300_0_10","SU_500_450_0_10","SU_700_650_0_10","SU_800_750_0_10",,"SU_1000_950_0_10","SU_1150_1100_0_10","SU_1200_1150_0_10",
# sigSamples = ["wino_1500_100", "wino_1500_150", "wino_1500_200", "wino_1500_250", "wino_1500_300", "wino_1500_350",
#               "wino_1000_100", "wino_1000_150", "wino_1000_200", "wino_1000_250", "wino_1000_300", "wino_1000_350",
#               "wino_900_100", "wino_900_150", "wino_900_200", "wino_900_250", "wino_900_300", "wino_900_350",
#               "wino_800_100", "wino_800_150", "wino_800_200", "wino_800_250", "wino_800_300", "wino_800_350",
#               "wino_800_400", "wino_800_500", "wino_800_600", "wino_800_700", "wino_800_780",
#               "wino_700_100", "wino_700_150", "wino_700_200", "wino_700_250", "wino_700_300", "wino_700_350",
#               "wino_700_400", "wino_700_500", "wino_700_600", "wino_700_680",
#               "wino_600_100", "wino_600_200", "wino_600_300", "wino_600_400", "wino_600_500", "wino_600_580"]

sigSamples = ["wino_1500_200"]


for sig in sigSamples:
    myTopLvl = configMgr.addTopLevelXMLClone(bkgOnly,"SimpleChannel_%s"%sig) #This is cloning the fit such that the systematics are also considered for the signal
    sigSample = Sample(sig,kRed)
#    sigSample.setNormFactor("mu_SIG",1.,0.,500.)
#    sigSample.setNormFactor("mu_SIG",0.5,0.,1.)
    sigSample.setNormFactor("mu_SIG",1,0.,10.)
    sigSample.setStatConfig(True)
    sigXsecPair = xsec[sig]
    sigXsec = sigXsecPair[0]
    sigXsecUnc = math.sqrt(sigXsecPair[1])
    relUnc = sigXsecUnc / sigXsec
    theory = Systematic("theory",configMgr.weights, 1+relUnc, 1-relUnc, "user","userOverallSys")
    # if mode != '_NoTheoryUncertsXsecNominal':
    #     sigSample.addSystematic(theory)

    # Decide whether to add theory systematics or not:
    sigSample.setNormByTheory()
# **************

# Fit config instance
exclusionFitConfig = configMgr.addTopLevelXML("Exclusion")
meas = exclusionFitConfig.addMeasurement(name="NormalMeasurement", lumi=1.0, lumiErr=0.039)
meas.addPOI("mu_SIG")

# Samples
exclusionFitConfig.addSamples([topSample, wzSample, dataSample])

# Systematics
exclusionFitConfig.getSample("Top").addSystematic(topKtScale)
exclusionFitConfig.getSample("WZ").addSystematic(wzKtScale)
exclusionFitConfig.addSystematic(jes)

# Channel
srBin = exclusionFitConfig.addChannel("met/meff2Jet", ["SR"], 6, 0.1, 0.7)
srBin.useOverflowBin = True
srBin.useUnderflowBin = True
exclusionFitConfig.setSignalChannels([srBin])

sigSample = Sample("SM_GG_onestepCC_425_385_345", kPink)
sigSample.setFileList(["samples/tutorial/SusyFitterTree_p832_GG-One-Step_soft_v1.root"])
sigSample.setNormByTheory()
sigSample.setNormFactor("mu_SIG", 1.0, 0.0, 5.0)
exclusionFitConfig.addSamples(sigSample)
exclusionFitConfig.setSignalSample(sigSample)

# 2nd cloned-copy just to accomodate -l option...
exclusionFitClone = configMgr.addTopLevelXMLClone(exclusionFitConfig, "ExclusionFitClone")
Example #3
0
    #    bkt.addValidationChannels([nJetSLVR2,metSLVR2,meffSLVR2,nBJetSLVR2,metmeffSLVR2,mm2J,srs1l2jTChannel])
    bkt.addValidationChannels([nJetSLVR2, srs1l2jTChannel, mm2J])

    dataSample.buildHisto([0., 1., 6., 16., 3., 0.], "SS", "metmeff2Jet", 0.1,
                          0.1)
    dataSample.buildHisto([25.], "SR1sl2j", "cuts", 0.5)
    dataSample.buildHisto([403., 202., 93., 39., 11., 10., 4., 1.], "SLVR2",
                          "nJet", 2)

#**************
# Discovery fit
#**************

if doDiscovery:
    discovery = configMgr.addTopLevelXMLClone(bkt, "Discovery")

    # s1l2jT = signal region/channel
    ssChannel = discovery.addChannel("cuts", ["SS"], srNBins, srBinLow,
                                     srBinHigh)
    ssChannel.addSystematic(jes)
    ssChannel.addDiscoverySamples(["SS"], [1.], [0.], [100.], [kMagenta])
    discovery.addSignalChannels([ssChannel])
    dataSample.buildHisto([26.], "SS", "cuts", 0.5)

#-----------------------------
# Exclusion fits (1-step simplified model in this case)
#-----------------------------
if doExclusion:
    sigSamples = ["SM_GG_onestepCC_425_385_345"]
    dataSample.buildHisto([1., 6., 16., 3., 0.], "SS", "metmeff2Jet", 0.2, 0.1)
Example #4
0
    mm2Jl = bkt.addChannel("met/meff2Jet",["SSloose"],6,0.1,0.7)
    mm2Jl.useOverflowBin=True
    mm2Jl.addSystematic(jes)

    #    bkt.setValidationChannels([nJetSLVR2,metSLVR2,meffSLVR2,nBJetSLVR2,metmeffSLVR2,mm2J,srs1l2jTChannel])
    bkt.setValidationChannels([nJetSLVR2,srs1l2jTChannel,mm2J,mm2Jl])
   
   


#**************
# Discovery fit
#**************

if doDiscovery:
    discovery = configMgr.addTopLevelXMLClone(bkt,"Discovery")
    
    # s1l2jT = signal region/channel
    ssChannel = discovery.addChannel("cuts",["SS"],srNBins,srBinLow,srBinHigh)
    ssChannel.addSystematic(jes)
    ssChannel.addDiscoverySamples(["SS"],[1.],[0.],[100.],[kMagenta])
    discovery.setSignalChannels([ssChannel])


#-----------------------------
# Exclusion fits (1-step simplified model in this case)
#-----------------------------
if doExclusion:
    sigSamples=["SM_GG_onestepCC_425_385_345"]
                        
    for sig in sigSamples:
bkgOnly.addSystematic(jes)
meas = bkgOnly.addMeasurement(measName,measLumi,measLumiError)
meas.addPOI("mu_SIG")
cutsChannel = bkgOnly.addChannel("cuts",cutsRegions,cutsNBins,cutsBinLow,cutsBinHigh)

## Discovery fit
#discovery = configMgr.addTopLevelXMLClone(bkgOnly,"SimpleChannel_Discovery")
#discovery.clearSystematics()
#sigSample = Sample("discoveryMode",kBlue)
#sigSample.setNormFactor("mu_SIG",0.5,0.,1.)
#sigSample.setNormByTheory()
#discovery.addSamples(sigSample)
#discovery.setSignalSample(sigSample)

## Exclusion fits (MSUGRA grid)
#sigSamples=["SU_180_360_0_10","SU_580_240_0_10","SU_740_330_0_10","SU_900_420_0_10","SU_1300_210_0_10"]
sigSamples = ["SU_680_310_0_10","SU_440_145_0_10","SU_200_160_0_10","SU_440_340_0_10","SU_440_100_0_10","SU_120_130_0_10","SU_600_280_0_10","SU_320_115_0_10","SU_360_175_0_10","SU_920_310_0_10","SU_280_205_0_10","SU_1080_340_0_10","SU_40_280_0_10","SU_760_160_0_10","SU_200_115_0_10","SU_280_280_0_10","SU_40_160_0_10","SU_520_280_0_10","SU_120_220_0_10","SU_680_220_0_10","SU_40_115_0_10","SU_920_190_0_10","SU_320_130_0_10","SU_440_280_0_10","SU_360_100_0_10","SU_120_160_0_10","SU_1080_190_0_10","SU_840_250_0_10","SU_120_100_0_10","SU_120_340_0_10","SU_840_280_0_10","SU_80_115_0_10","SU_840_130_0_10","SU_320_175_0_10","SU_120_205_0_10","SU_520_100_0_10","SU_400_130_0_10","SU_360_310_0_10","SU_160_115_0_10","SU_1000_310_0_10","SU_40_220_0_10","SU_440_130_0_10","SU_1000_190_0_10","SU_80_220_0_10","SU_840_160_0_10","SU_120_145_0_10","SU_440_175_0_10","SU_360_280_0_10","SU_320_145_0_10","SU_400_160_0_10","SU_1000_340_0_10","SU_600_310_0_10","SU_320_190_0_10","SU_840_310_0_10","SU_200_220_0_10","SU_440_205_0_10","SU_360_205_0_10","SU_120_280_0_10","SU_1080_130_0_10","SU_160_145_0_10","SU_520_250_0_10","SU_840_100_0_10","SU_160_220_0_10","SU_120_190_0_10","SU_40_205_0_10","SU_280_250_0_10","SU_80_145_0_10","SU_200_175_0_10","SU_840_190_0_10","SU_240_145_0_10","SU_160_205_0_10","SU_400_115_0_10","SU_440_250_0_10","SU_600_340_0_10","SU_80_100_0_10","SU_520_190_0_10","SU_1160_190_0_10","SU_80_130_0_10","SU_400_190_0_10","SU_400_175_0_10","SU_600_130_0_10","SU_1080_100_0_10","SU_200_340_0_10","SU_1160_310_0_10","SU_440_160_0_10","SU_240_220_0_10","SU_200_100_0_10","SU_240_130_0_10","SU_360_130_0_10","SU_1000_250_0_10","SU_920_130_0_10","SU_240_190_0_10","SU_520_340_0_10","SU_40_175_0_10","SU_240_100_0_10","SU_400_145_0_10","SU_40_145_0_10","SU_240_205_0_10","SU_1080_280_0_10","SU_600_250_0_10","SU_360_145_0_10","SU_520_130_0_10","SU_1000_130_0_10","SU_440_310_0_10","SU_600_160_0_10","SU_920_280_0_10","SU_760_280_0_10","SU_280_190_0_10","SU_280_175_0_10","SU_120_310_0_10","SU_440_220_0_10","SU_1000_220_0_10","SU_1160_250_0_10","SU_400_205_0_10","SU_160_160_0_10","SU_1000_280_0_10","SU_1000_160_0_10","SU_400_100_0_10","SU_760_190_0_10","SU_680_160_0_10","SU_840_220_0_10","SU_360_340_0_10","SU_1080_220_0_10","SU_360_250_0_10","SU_760_130_0_10","SU_440_115_0_10","SU_240_160_0_10","SU_200_310_0_10","SU_200_145_0_10","SU_600_220_0_10","SU_280_130_0_10","SU_520_220_0_10","SU_1080_160_0_10","SU_40_190_0_10","SU_1160_160_0_10","SU_280_310_0_10","SU_920_160_0_10","SU_80_190_0_10","SU_40_310_0_10","SU_1160_130_0_10","SU_40_250_0_10","SU_40_100_0_10","SU_400_220_0_10","SU_40_340_0_10","SU_1000_100_0_10","SU_120_175_0_10","SU_280_220_0_10","SU_760_340_0_10","SU_240_115_0_10","SU_440_190_0_10","SU_1160_340_0_10","SU_600_100_0_10","SU_200_250_0_10","SU_280_145_0_10","SU_200_190_0_10","SU_200_205_0_10","SU_760_250_0_10","SU_120_250_0_10","SU_80_175_0_10","SU_40_130_0_10","SU_920_250_0_10","SU_80_160_0_10","SU_240_175_0_10","SU_280_100_0_10","SU_1080_310_0_10","SU_920_340_0_10","SU_120_115_0_10","SU_1160_100_0_10","SU_280_340_0_10","SU_1160_220_0_10","SU_200_130_0_10","SU_160_175_0_10","SU_360_220_0_10"]


for sig in sigSamples:
    myTopLvl = configMgr.addTopLevelXMLClone(bkgOnly,"SimpleChannel_%s"%sig)
    #myTopLvl.removeSystematic(jes)
    sigSample = Sample(sig,kBlue)
    sigSample.setNormFactor("mu_SIG",0.5,0.,1.)
    sigXSSyst = Systematic("SigXSec",None,None,None,"user","overallSys")
    sigSample.addSystematic(sigXSSyst)
    #sigSample.addSystematic(jesSig)
    sigSample.setNormByTheory()
    myTopLvl.addSamples(sigSample)
    myTopLvl.setSignalSample(sigSample)
    "SU_160_160_0_10", "SU_1000_280_0_10", "SU_1000_160_0_10",
    "SU_400_100_0_10", "SU_760_190_0_10", "SU_680_160_0_10", "SU_840_220_0_10",
    "SU_360_340_0_10", "SU_1080_220_0_10", "SU_360_250_0_10",
    "SU_760_130_0_10", "SU_440_115_0_10", "SU_240_160_0_10", "SU_200_310_0_10",
    "SU_200_145_0_10", "SU_600_220_0_10", "SU_280_130_0_10", "SU_520_220_0_10",
    "SU_1080_160_0_10", "SU_40_190_0_10", "SU_1160_160_0_10",
    "SU_280_310_0_10", "SU_920_160_0_10", "SU_80_190_0_10", "SU_40_310_0_10",
    "SU_1160_130_0_10", "SU_40_250_0_10", "SU_40_100_0_10", "SU_400_220_0_10",
    "SU_40_340_0_10", "SU_1000_100_0_10", "SU_120_175_0_10", "SU_280_220_0_10",
    "SU_760_340_0_10", "SU_240_115_0_10", "SU_440_190_0_10",
    "SU_1160_340_0_10", "SU_600_100_0_10", "SU_200_250_0_10",
    "SU_280_145_0_10", "SU_200_190_0_10", "SU_200_205_0_10", "SU_760_250_0_10",
    "SU_120_250_0_10", "SU_80_175_0_10", "SU_40_130_0_10", "SU_920_250_0_10",
    "SU_80_160_0_10", "SU_240_175_0_10", "SU_280_100_0_10", "SU_1080_310_0_10",
    "SU_920_340_0_10", "SU_120_115_0_10", "SU_1160_100_0_10",
    "SU_280_340_0_10", "SU_1160_220_0_10", "SU_200_130_0_10",
    "SU_160_175_0_10", "SU_360_220_0_10"
]

for sig in sigSamples:
    myTopLvl = configMgr.addTopLevelXMLClone(bkgOnly, "SimpleChannel_%s" % sig)
    #myTopLvl.removeSystematic(jes)
    sigSample = Sample(sig, kBlue)
    sigSample.setNormFactor("mu_SIG", 0.5, 0., 1.)
    sigXSSyst = Systematic("SigXSec", None, None, None, "user", "overallSys")
    sigSample.addSystematic(sigXSSyst)
    #sigSample.addSystematic(jesSig)
    sigSample.setNormByTheory()
    myTopLvl.addSamples(sigSample)
    myTopLvl.setSignalSample(sigSample)
meas = exclusionFitConfig.addMeasurement(name="NormalMeasurement",
                                         lumi=1.0,
                                         lumiErr=0.039)
meas.addPOI("mu_SIG")

#Samples
exclusionFitConfig.addSamples([topSample, wzSample, dataSample])

# Systematics
exclusionFitConfig.getSample("Top").addSystematic(topKtScale)
exclusionFitConfig.getSample("WZ").addSystematic(wzKtScale)
exclusionFitConfig.addSystematic(jes)

#Channel
srBin = exclusionFitConfig.addChannel("met/meff2Jet", ["SR"], 6, 0.1, 0.7)
srBin.useOverflowBin = True
srBin.useUnderflowBin = True
exclusionFitConfig.setSignalChannels([srBin])

sigSample = Sample("SM_GG_onestepCC_425_385_345", kPink)
sigSample.setFileList(
    ["samples/tutorial/SusyFitterTree_p832_GG-One-Step_soft_v1.root"])
sigSample.setNormByTheory()
sigSample.setNormFactor("mu_SIG", 1., 0., 5.)
exclusionFitConfig.addSamples(sigSample)
exclusionFitConfig.setSignalSample(sigSample)

#2nd cloned-copy just to accomodate -l option...
exclusionFitClone = configMgr.addTopLevelXMLClone(exclusionFitConfig,
                                                  "ExclusionFitClone")