コード例 #1
0
def haddFastsimFiles(fileLists, smsName, inDir, outDir, OneDScan=False, dryRun=True):
    """
    fileLists: dictionary in which keys are (mGluino, mLSP) pairs
        and values are lists of ntuple files for the corresponding mass point
    smsName: name of signal model
    outDir: directory where output files should go

    Runs hadd on the files for each signal mass point and puts the output in
        the specified directory
    """
    for pair in fileLists:
        print "Signal:",smsName,pair
        if not OneDScan:
            if (os.path.isfile(outDir+'/'+smsName+'_'+pair[0]+'_'+pair[1]+'.root')):
                print "output file exists already. skip"
            else:
                exec_me('hadd -f '+outDir+'/'+smsName+'_'+pair[0]+'_'+pair[1]+'.root '
                        +' '.join([inDir+'/'+f+' ' for f in fileLists[pair]]), dryRun)
        else:
            if (os.path.isfile(outDir+'/'+smsName+'_'+pair+'.root')):
                print "output file exists already. skip"
            else:
                exec_me('hadd -f '+outDir+'/'+smsName+'_'+pair+'.root '
                        +' '.join([inDir+'/'+f+' ' for f in fileLists[pair]]), dryRun)
コード例 #2
0
        signalFilename = dirToUse + '/' + modelName + '.root'

        #to modify branching ratios in T1ttbb sample
        brString = ""
        if 'T1x' in args.model:
            xBR = float(args.model[args.model.find('x') +
                                   1:args.model.find('y')].replace('p', '.'))
            yBR = float(args.model[args.model.find('y') + 1:].replace(
                'p', '.'))
            brString = '--xBR %.2f --yBR %.2f' % (xBR, yBR)
            signalFilename = dirToUse + '/SMS-T1ttbb_' + str(
                args.mGluino) + '_' + str(args.mLSP) + '.root'

        exec_me(
            'python python/SMSTemplates.py --merge-bins -c %s -d %s --lumi %d --box %s %s %s %s --max-events %d'
            % (config, outDir, LUMI, curBox,
               ((args.noSys) * ('--no-signal-sys')), signalFilename, brString,
               args.maxSignalEvents), False)
        #load SMS template histograms
        signalHistFilename = '%s/%s_lumi-%.3f_0-3btag_%s.root' % (
            outDir, modelName, LUMI * 1.0 / 1000, curBox)
        signalHists = macro.importHists(signalHistFilename)
        #update with correct names
        for x, h in signalHists.items():
            h.SetName(h.GetName().replace(curBox + '_' + args.model,
                                          modelName))
            signalHists[h.GetName()] = signalHists.pop(x)

        #apply reduced efficiency method to correct for the presence of signal in the control regions
        if args.reducedEff:
            macro.doDeltaBForReducedEfficiencyMethod(backgroundHists,
コード例 #3
0
ファイル: RunFits.py プロジェクト: RazorCMS/RazorAnalyzer
if __name__ == '__main__':
    
    boxes = ['MultiJet']
    fits = ['Sideband']
    weights = ['unweighted']
    configs = ['config/run2_20151108_Preapproval_2b3b.config']

    dryRun = False
    
    lumi = 17000
    btag = '0-3btag'
    
    dateString = str(datetime.date.today()).replace("-","_")
    dateString = '2015_11_17'
    outDir = "fits_%s"%dateString
    exec_me('mkdir -p %s'%outDir,dryRun)
    
    for box in boxes:        
        for cfg in configs:                
            backgroundDsName = 'Datasets/RazorInclusive_SMCocktail_weighted_lumi-%.3f_%s_%s.root'%(lumi/1000.,btag,box)
            #exec_me('python python/DustinTuple2RooDataSet.py -c %s -b %s -d Datasets/ Backgrounds/*.root -l %f -w'%(cfg,box,lumi),dryRun)
            
            if 'unweighted' in weights:
                backgroundDsName = 'Datasets/RazorInclusive_SMCocktail_unweighted_lumi-%.3f_%s_%s.root'%(lumi/1000.,btag,box)
                #exec_me('python python/RooDataSet2UnweightedDataset.py -c %s -b %s -d Datasets/ Datasets/RazorInclusive_SMCocktail_weighted_lumi-%.3f_%s_%s.root'%(cfg,box,lumi/1000.,btag,box),dryRun)
                
            for weight in weights:                
                outDir = "fits_%s/%s_%iifb/"%(dateString,weight,lumi/1000.)
                exec_me('mkdir -p %s'%outDir,dryRun)
                outDir = "fits_%s/%s_%iifb/%s"%(dateString,weight,lumi/1000.,box)
                exec_me('mkdir -p %s'%outDir,dryRun)
コード例 #4
0
                exec_me('hadd -f '+outDir+'/'+smsName+'_'+pair[0]+'_'+pair[1]+'.root '
                        +' '.join([inDir+'/'+f+' ' for f in fileLists[pair]]), dryRun)
        else:
            if (os.path.isfile(outDir+'/'+smsName+'_'+pair+'.root')):
                print "output file exists already. skip"
            else:
                exec_me('hadd -f '+outDir+'/'+smsName+'_'+pair+'.root '
                        +' '.join([inDir+'/'+f+' ' for f in fileLists[pair]]), dryRun)


if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument("inDir", help="input path")
    parser.add_argument("-s", "--smsName", required=True, help="SMS name, e.g. T1bbbb")
    parser.add_argument("--dryRun", action="store_true")
    parser.add_argument("--OneDScan", action="store_true")
    args = parser.parse_args()

    inDir=args.inDir
    smsName=args.smsName
    dryRun=args.dryRun
    OneDScan = args.OneDScan

    fileLists = makeFileLists(inDir, smsName, OneDScan)

    #output directory
    outDir = inDir+'/combined'
    exec_me('mkdir '+outDir, dryRun)

    haddFastsimFiles(fileLists, smsName, inDir, outDir, OneDScan, dryRun=dryRun)
コード例 #5
0
ファイル: RunCRFits.py プロジェクト: RazorCMS/RazorAnalyzer
    boxes = ['TTBarSingleLepton','WSingleLepton']
    #fits = ['Sideband']
    #fits = ['Full']
    fits = ['Sideband','Full']
    configs = ['config/controlsample.config']
    
    
    lumi = 23.8

    dryRun=False
    
    for box in boxes:
        for cfg in configs:            

            exec_me('python python/CRTuple2RooDataSet.py -c %s -b %s -d ControlSampleFits/ ControlSampleFits/SingleMuonAndElectron_Run2015B-GOLDEN.root -l %f'%(cfg,box,lumi),dryRun)
            #exec_me('python python/CRTuple2RooDataSet.py -c %s -b %s -d ControlSampleFits/ ControlSampleFits/RunTwoRazorControlRegions_OneLeptonFull_Run2015B_GoodLumiDCS_NoDuplicates.root -l %f'%(cfg,box,lumi),dryRun)
            
            for fit in fits:                
                if box in ['TTBarSingleLepton']:
                    btag = '1btag'
                else:
                    btag = '0btag'
                
                lumiString = '%.4f'%(lumi/1000)
                #lumiString = lumiString.replace('.','p')

                fitString = ''
                if fit=='Sideband':
                    fitString = '--fit-region LowMR,LowRsq'
                    
コード例 #6
0
            dirToUse = NOPILEUPWEIGHTS_SIGNAL_DIR
        if 'T1' in args.model or 'T5' in args.model:
            modelName = 'SMS-'+args.model+'_'+str(args.mGluino)+'_'+str(args.mLSP)
        else:
            modelName = 'SMS-'+args.model+'_'+str(args.mStop)+'_'+str(args.mLSP)
        signalFilename=dirToUse+'/'+modelName+'.root'

        #to modify branching ratios in T1ttbb sample
        brString = ""
        if 'T1x' in args.model:
            xBR = float(args.model[args.model.find('x')+1:args.model.find('y')].replace('p','.'))
            yBR = float(args.model[args.model.find('y')+1:].replace('p','.'))
            brString = '--xBR %.2f --yBR %.2f'%(xBR,yBR)
            signalFilename = dirToUse+'/SMS-T1ttbb_'+str(args.mGluino)+'_'+str(args.mLSP)+'.root'

        exec_me('python python/SMSTemplates.py --merge-bins -c %s -d %s --lumi %d --box %s %s %s %s --max-events %d'%(config, outDir, LUMI, curBox, ((args.noSys)*('--no-signal-sys')), signalFilename, brString, args.maxSignalEvents), False) 
        #load SMS template histograms
        signalHistFilename = '%s/%s_lumi-%.3f_0-3btag_%s.root'%(outDir,modelName,LUMI*1.0/1000,curBox)
        signalHists = macro.importHists(signalHistFilename)
        #update with correct names
        for x,h in signalHists.items():
            h.SetName(h.GetName().replace(curBox+'_'+args.model,modelName))
            signalHists[h.GetName()] = signalHists.pop(x)
    
        #apply reduced efficiency method to correct for the presence of signal in the control regions
        if args.reducedEff:
            macro.doDeltaBForReducedEfficiencyMethod(backgroundHists, signalHists, contamHists, sfHists, unrollBins=unrollBins, debugLevel=debugLevel)

        #combine signal and background dictionaries
        hists = backgroundHists.copy()
        hists.update(signalHists)
コード例 #7
0
                args.mStop) + '_' + str(args.mLSP)
        signalFilename = dirToUse + '/' + modelName + '.root'
        brString = ""
        if 'T1x' in args.model:
            xBR = float(args.model[args.model.find('x') +
                                   1:args.model.find('y')].replace('p', '.'))
            yBR = float(args.model[args.model.find('y') + 1:].replace(
                'p', '.'))
            brString = '--xBR %.2f --yBR %.2f' % (xBR, yBR)
            signalFilename = dirToUse + '/SMS-T1ttbb_' + str(
                args.mGluino) + '_' + str(args.mLSP) + '.root'
        signalHistFilename = '%s/%s_lumi-%.3f_0-3btag_%s.root' % (
            outDir, modelName, LUMI * 1.0 / 1000, curBox)
        if not glob.glob(signalHistFilename):
            exec_me(
                'python python/SMSTemplates.py --merge-bins -c %s -d %s --lumi %d --box %s %s %s --no-signal-sys'
                % (config, outDir, LUMI, curBox, signalFilename, brString),
                False)
        #load SMS template histograms
        signalHists = macro.importHists(signalHistFilename)
        #update with correct names
        for x, h in signalHists.items():
            h.SetName(h.GetName().replace(curBox + '_' + args.model,
                                          modelName))
            signalHists[h.GetName()] = signalHists.pop(x)
        signalHist = signalHists[modelName]

        #make combined unrolled histograms for background
        makeRazorBinEvidencePlots(curBox,
                                  samples=samples,
                                  inDir=BACKGROUND_DIR,
                                  outDir=outDir,
コード例 #8
0
                int(splitF[-1])
                mGluino = splitF[-1]
            except ValueError:
                print "Cannot parse gluino mass from", f, ": skipping"
                continue

            if mGluino not in fileLists:
                fileLists[mGluino] = []

            #add this file to appropriate list
            fileLists[mGluino].append(f)
            print "Adding", f, "to list of files for model point", mGluino

    #output directory
    outDir = inDir + '/combined'
    exec_me('mkdir ' + outDir, dryRun)

    #hadd the files for each signal mass point
    for pair in fileLists:
        print "Signal:", smsName, pair
        if not OneDScan:
            if (os.path.isfile(outDir + '/SMS-' + smsName + '_' + pair[0] +
                               '_' + pair[1] + '.root')):
                print "output file exists already. skip"
            else:
                exec_me(
                    'hadd -f ' + outDir + '/SMS-' + smsName + '_' + pair[0] +
                    '_' + pair[1] + '.root ' +
                    ' '.join([inDir + '/' + f + ' '
                              for f in fileLists[pair]]), dryRun)
        else:
コード例 #9
0
ファイル: haddFastsimSMS.py プロジェクト: shtan/RazorAnalyzer
            mGluino = splitF[-2]
        except ValueError:
            print "Cannot parse gluino mass from",f,": skipping"
            continue

        try:
            int(splitF[-1])
            mLSP = splitF[-1]
        except ValueError:
            print "Cannot parse LSP mass from",f,": skipping"
            continue

        pair = (mGluino, mLSP)

        #add to dictionary if not present
        if pair not in fileLists:
            fileLists[pair] = []

        #add this file to appropriate list
        fileLists[pair].append(f)
        print "Adding",f,"to list of files for model point",pair

    #output directory
    outDir = inDir+'/combined'
    exec_me('mkdir '+outDir, dryRun)
    
    #hadd the files for each signal mass point
    for pair in fileLists:
        print "Signal:",smsName,pair
        exec_me('hadd -f '+outDir+'/SMS-'+smsName+'_'+pair[0]+'_'+pair[1]+'.root '+' '.join([inDir+'/'+f+' ' for f in fileLists[pair]]), dryRun)
コード例 #10
0
    boxes = ['TTBarSingleLepton', 'WSingleLepton']
    #fits = ['Sideband']
    #fits = ['Full']
    fits = ['Sideband', 'Full']
    configs = ['config/controlsample.config']

    lumi = 23.8

    dryRun = False

    for box in boxes:
        for cfg in configs:

            exec_me(
                'python python/CRTuple2RooDataSet.py -c %s -b %s -d ControlSampleFits/ ControlSampleFits/SingleMuonAndElectron_Run2015B-GOLDEN.root -l %f'
                % (cfg, box, lumi), dryRun)
            #exec_me('python python/CRTuple2RooDataSet.py -c %s -b %s -d ControlSampleFits/ ControlSampleFits/RunTwoRazorControlRegions_OneLeptonFull_Run2015B_GoodLumiDCS_NoDuplicates.root -l %f'%(cfg,box,lumi),dryRun)

            for fit in fits:
                if box in ['TTBarSingleLepton']:
                    btag = '1btag'
                else:
                    btag = '0btag'

                lumiString = '%.4f' % (lumi / 1000)
                #lumiString = lumiString.replace('.','p')

                fitString = ''
                if fit == 'Sideband':
                    fitString = '--fit-region LowMR,LowRsq'
コード例 #11
0
        #call SMS template maker
        if 'T1' in args.model or 'T5' in args.model:
            modelName = 'SMS-'+args.model+'_'+str(args.mGluino)+'_'+str(args.mLSP)
        else:
            modelName = 'SMS-'+args.model+'_'+str(args.mStop)+'_'+str(args.mLSP)
        signalFilename=dirToUse+'/'+modelName+'.root'
        brString = ""
        if 'T1x' in args.model:
            xBR = float(args.model[args.model.find('x')+1:args.model.find('y')].replace('p','.'))
            yBR = float(args.model[args.model.find('y')+1:].replace('p','.'))
            brString = '--xBR %.2f --yBR %.2f'%(xBR,yBR)
            signalFilename = dirToUse+'/SMS-T1ttbb_'+str(args.mGluino)+'_'+str(args.mLSP)+'.root'
        signalHistFilename = '%s/%s_lumi-%.3f_0-3btag_%s.root'%(outDir,modelName,LUMI*1.0/1000,curBox)
        if not glob.glob(signalHistFilename):
            exec_me('python python/SMSTemplates.py --merge-bins -c %s -d %s --lumi %d --box %s %s %s --no-signal-sys'%(config, outDir, LUMI, curBox, signalFilename, brString), False) 
        #load SMS template histograms
        signalHists = macro.importHists(signalHistFilename)
        #update with correct names
        for x,h in signalHists.items():
            h.SetName(h.GetName().replace(curBox+'_'+args.model,modelName))
            signalHists[h.GetName()] = signalHists.pop(x)
        signalHist = signalHists[modelName]

        #make combined unrolled histograms for background
        makeRazorBinEvidencePlots(curBox, samples=samples, inDir=BACKGROUND_DIR, outDir=outDir, 
                signalHist=signalHist, unrollBins=unrollBins, debugLevel=debugLevel, zmin=1e-3)
        #draw signal and background in unrolled format
        if args.model == 'T2tt':
            signalString = 'pp #rightarrow #tilde{t}#tilde{t}, #mu = 1.0, #tilde{t} #rightarrow t#tilde{#chi}^{0}_{1}'
        elif args.model == 'T1bbbb':
コード例 #12
0
            btag = '0-3btag'
            if box in ['DiJet', 'LeptonJet']:
                btag = '0-2btag'

            fitString = '--fit-region Full'
            plotString = '--plot-region Full'
            if fit == 'Sideband':
                fitString = '--fit-region LowMR,LowRsq'
                plotString = '--plot-region LowMR,LowRsq'
            #exec_me('python python/DustinTuple2RooDataSet.py -b %s -c %s -d Datasets/ Run2016BCD/%s --data -l %i'% (box, config, dataset[box], lumi ), dryRun )
            outDir = 'fits_%s/Run2016BCD/%s/%s/' % (dateString, box, fit)
            roodataset = dataset[box].replace(
                '.root', '_lumi-%.3f_%s_%s.root' % (lumi / 1000., btag, box))
            #exec_me('python python/BinnedFit.py -b %s -c %s -d %s Datasets/%s --data -l %i %s %s'% (box, config, outDir, roodataset, lumi, fitString, plotString), dryRun )

            #exec_me('python python/PlotFit.py -b %s -c %s -d %s -i %s/BinnedFitResults_%s.root --data -l %i'% (box, config, outDir, outDir, box, lumi), dryRun )
            varyNString = ''
            #if fit=='Sideband':
            #    varyNString = '--vary-n'

            #exec_me('python python/RunToys.py -c %s -d %s -b %s -l %i -i %s/BinnedFitResults_%s.root %s --no-stat -t 10000 %s' %(config,outDir,box,lumi,outDir,box,varyNString,fitString), dryRun )
            #exec_me('python python/RunToys.py -c %s -d %s -b %s -l %i -i %s/BinnedFitResults_%s.root %s -t 10000 %s' %(config,outDir,box,lumi,outDir,box,varyNString,fitString), dryRun )
            exec_me(
                'python python/PlotFit.py -b %s -c %s -d %s -i %s/BinnedFitResults_%s.root --data -l %i -t %s/toys_Bayes_%s.root -s %s/toys_Bayes_noStat_%s.root %s --no-stat'
                % (box, config, outDir, outDir, box, lumi, outDir, box, outDir,
                   box, fitString), dryRun)
            #exec_me('python python/PlotFit.py -b %s -c %s -d %s -i %s/BinnedFitResults_%s.root --data -l %i -t %s/toys_Bayes_%s.root -s %s/toys_Bayes_noStat_%s.root %s --no-stat --print-errors %s'% (box, config, outDir, outDir, box, lumi, outDir, box, outDir,box,fitString,plotString), dryRun )

            #exec_me('python python/RunToys.py -c %s -d %s -b %s -l %i -i %s/BinnedFitResults_%s.root --freq -t 200 -s 0 %s' %(config,outDir,box,lumi,outDir,box,fitString), dryRun )
            #exec_me('python python/PlotGOF.py -c %s -d %s -b %s -l %f -t %s/toys_Freq_s0_%s.root %s --data' %(config,outDir,box,lumi,outDir,box,fitString),dryRun)
コード例 #13
0
    # get combine parameters
    if args.signif:
        combineMethod = 'ProfileLikelihood'
        combineFlags = '--signif -t -1 --toysFreq'
    else:
        combineMethod = 'Asymptotic'
        combineFlags = ''
    if args.saveWorkspace:
        combineFlags += ' --saveWorkspace'

    # run combine 
    if len(boxList) == 1:
        cardName = getCardName(modelName, boxList[0], outDir)
        combineName = 'MADD_'+boxList[0]+'_'+modelName
        exec_me('combine -M %s %s -n %s %s'%(
            combineMethod,cardName,combineName,combineFlags), False)
        exec_me('mv higgsCombine%s.%s.mH120.root %s/'%(
            combineName,combineMethod,outDir),False)
    elif len(boxList) > 1:
        cardNames = []
        combineName = 'MADD_'+('_'.join(boxList))+'_'+modelName
        for curBox in boxList:
            cardName = getCardName(modelName, curBox, outDir)
            cardNames.append(os.path.basename(cardName))
        combinedCardName = ('RazorInclusiveMADD_%s_%s.txt'%(
            modelName, '_'.join(boxList)))
        exec_me('cd '+outDir+'; combineCards.py '+(' '.join(cardNames))
                +' > '+combinedCardName+'; cd ..', False)
        exec_me('combine -M '+combineMethod+' '+outDir+'/'
                +combinedCardName+' -n '+combineName+' '+combineFlags, 
                False)
コード例 #14
0
ファイル: RunFits.py プロジェクト: RazorCMS/RazorAnalyzerRun1
    
    
    lumi = 3000
    
    for box in boxes:
        for cfg in configs:
            if box in ['MuEle','EleEle','MuMu']:
                btag = '0-1btag'
            elif '1-3btag' in cfg:
                btag = '1-3btag'
            else:
                btag = '0-3btag'
                
            backgroundDsName = 'Datasets/RazorInclusive_SMCocktail_weighted_lumi-%.1f_%s_%s.root'%(lumi/1000.,btag,box)
            if not glob.glob(backgroundDsName):                
                exec_me('python python/DustinTuple2RooDataSet.py -c %s -b %s -d Datasets/ -w -q Backgrounds/*.root'%(cfg,box),False)
            backgroundDsName = 'Datasets/RazorInclusive_SMCocktail_unweighted_lumi-%.1f_%s_%s.root'%(lumi/1000.,btag,box)
            if not glob.glob(backgroundDsName):
                exec_me('python python/RooDataSet2UnweightedDataset.py -c %s -b %s -d Datasets/ Datasets/RazorInclusive_SMCocktail_weighted_lumi-%.1f_%s_%s.root'%(cfg,box,lumi/1000.,btag,box),False)
            
            exec_me('mkdir -p fits_07102015/weighted/%s_%s/' %(box,btag),False)
            exec_me('mkdir -p fits_07102015/unweighted/%s_%s/' %(box,btag),False)
            #  --fit-region LowMR,LowRsq 
            #exec_me('python python/Fit.py -c %s -d fits_06212015/unbinned/%s_%s/ --fit-region LowMR,LowRsq -b %s Datasets/RazorInclusive_SMCocktail_unweighted_lumi-%.1f_%s_%s.root' %(cfg,box,btag,box,lumi/1000,btag,box),False)

            #exec_me('python python/BinnedFit.py -c %s -d fits_07102015/weighted/%s_%s/ -b %s Datasets/RazorInclusive_SMCocktail_weighted_lumi-%.1f_%s_%s.root' %(cfg,box,btag,box,lumi/1000,btag,box),False)
            #exec_me('python python/RunToys.py -c %s -d fits_07102015/weighted/%s_%s/ -b %s -i fits_07102015/weighted/%s_%s/BinnedFitResults_%s.root -t 10000' %(cfg,box,btag,box,box,btag,box),False)
            exec_me('python python/PlotFit.py -c %s -d fits_07102015/weighted/%s_%s/ -b %s -i fits_07102015/weighted/%s_%s/BinnedFitResults_%s.root -t fits_07102015/weighted/%s_%s/toys_Bayes_%s.root --print-errors' %(cfg,box,btag,box,box,btag,box,box,btag,box),False)
                        
            #exec_me('python python/BinnedFit.py -c %s -d fits_07102015/unweighted/%s_%s/ -b %s Datasets/RazorInclusive_SMCocktail_unweighted_lumi-%.1f_%s_%s.root' %(cfg,box,btag,box,lumi/1000,btag,box),False)
            #exec_me('python python/RunToys.py -c %s -d fits_07102015/unweighted/%s_%s/ -b %s -i fits_07102015/unweighted/%s_%s/BinnedFitResults_%s.root -t 10000' %(cfg,box,btag,box,box,btag,box),False)
コード例 #15
0
ファイル: RunFits.py プロジェクト: shtan/RazorAnalyzer
if __name__ == '__main__':
    
    boxes = ['MultiJet','MuMultiJet','EleMultiJet','LooseLeptonMultiJet','DiJet']
    fits = ['Sideband','Full']
    configs = ['config/run2.config']
    
    lumi = 3000
    dryRun = False
    btag = '0-3btag'
    
    for box in boxes:
        for cfg in configs:
                
            backgroundDsName = 'Datasets/RazorInclusive_SMCocktail_weighted_lumi-%.1f_%s_%s.root'%(lumi/1000.,btag,box)
            exec_me('python python/DustinTuple2RooDataSet.py -c %s -b %s -d Datasets/ -w -q Backgrounds/*.root'%(cfg,box),dryRun)
            backgroundDsName = 'Datasets/RazorInclusive_SMCocktail_unweighted_lumi-%.1f_%s_%s.root'%(lumi/1000.,btag,box)
            exec_me('python python/RooDataSet2UnweightedDataset.py -c %s -b %s -d Datasets/ Datasets/RazorInclusive_SMCocktail_weighted_lumi-%.1f_%s_%s.root'%(cfg,box,lumi/1000.,btag,box),dryRun)
            lumiString = '%.1f'%(lumi/1000)
            lumiString = lumiString.replace('.','p')

            for weight in ["weighted","unweighted"]:
                backgroundDsName = 'Datasets/RazorInclusive_SMCocktail_%s_lumi-%.1f_%s_%s.root'%(weight,lumi/1000.,btag,box)
                for fit in fits:                    
                    
                    fitString = ''
                    if fit=='Sideband':
                        fitString = '--fit-region LowMR,LowRsq'

                    dateString = str(datetime.date.today())