Ejemplo n.º 1
0
    '--path',
    action='store',
    default=
    '/pnfs/iihe/cms/store/user/wverbeke/heavyNeutrino/DYJetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8/crab_MiniAOD2018-v1_dilepton_MC_2018_v5'
)
argParser.add_argument('--year', action='store', default='2016')
argParser.add_argument('--skim', action='store', default='ewkino')
argParser.add_argument('--isTest', action='store', default=False)

args = argParser.parse_args()

sample_name = args.path.rsplit('/')[-1].rsplit('.')[0]
print sample_name
sample = Sample(sample_name, args.path, sample_name, 1,
                '1')  #xsec not used here, so put to 1
Chain = sample.initTree()

#Create output file
output_dir = '/user/lwezenbe/public/ntuples/' + args.year + '/' + args.skim + '_v5wDeepCsvInvMET'
makeDirIfNeeded(output_dir)

output_file = TFile(output_dir + '/' + sample.output + '.root', 'recreate')
output_file.mkdir('blackJackAndHookers')
output_file.cd('blackJackAndHookers')

#Get hcounters
import eventSelection
isData = eventSelection.isData(sample.name)
if not isData: hCounter = sample.getHist('hCounter')
if 'TChi' in sample.name: hCounterSUSY = sample.getHist('hCounterSUSY')