#################
# Configuration #
#################
import ROOT
import numpy as np
import plotfactory as pf
from glob import glob

pf.setpfstyle()
tt = pf.makechain(False)

#file = ROOT.TFile('tree.root')
#tt = file.Get('tree')
ntries = tt.GetEntries()

print('Number of entries: ' + str(ntries))

#################
# Define x-axes #
#################
pTbins = np.arange(3., 65, 1)
dxybins = np.arange(0., 600, 10)

###################
# Create canvases #
###################
print('Preparing canvas')
t = ROOT.TCanvas('t', 'd')
t1 = ROOT.TCanvas('t1', 'd1')
t2 = ROOT.TCanvas('t2', 'd2')
t3 = ROOT.TCanvas('t3', 'd3')
Example #2
0
import ROOT as rt
import numpy as np
import plotfactory as pf
import ntup_dir as nt
from glob import glob
import sys
from pdb import set_trace
from os.path import normpath, basename
####################################################################################################
outdir = '/eos/user/v/vstampf/ntuples/plots/id_efficiency/'
indir = nt.getntupdir()
####################################################################################################
ntdr = basename(normpath(indir))
####################################################################################################
t = pf.makechain(True)
####################################################################################################
####################################################################################################
pf.setpfstyle()
####################################################################################################
####################################################################################################
inc   = 'is_in_acc == 1 & l0_matched_electron_pt > 30 & l1_matched_muon_pt > 4 & l2_matched_muon_pt > 4'
loose = ' & l1_matched_muon_id_l & l2_matched_muon_id_l'
globl = ' & l1_matched_muon_is_gl & l2_matched_muon_is_gl'
emumu = ' & abs(l0_pdgId) == 11 & abs(l1_pdgId)==13 & abs(l2_pdgId) == 13 '
####################################################################################################
idgl  = inc + globl + emumu
idL   = inc + loose + emumu
denom = inc + emumu
####################################################################################################
b_2disp = np.arange(0.,200, 5)
####################################################################################################
Example #3
0
#################
# Configuration #
#################
import ROOT
import numpy as np
import plotfactory as pf
from glob import glob

pf.setpfstyle()
bewl = input("Makechain: True or False\n")
tt = pf.makechain(bewl)

#file = ROOT.TFile('tree.root')
#tt = file.Get('tree')
ntries = tt.GetEntries()

print('Number of entries: ' + str(ntries))

#################
# Define x-axes #
#################
pTbins = np.arange(5., 73, 5)

###################
# Create canvases #
###################
print('Preparing canvas')
t = ROOT.TCanvas('t', 'cap_d1')

#####################
# Create histograms #
Example #4
0
fout = rt.TFile('histoseffpurmassd3.root', 'recreate')

#########################################
# Make Chain from selection of samples
#########################################

# Get the option from the command line, using 'True' as a fallback.

if len(sys.argv) > 1 and sys.argv[1] == 'test':
    setting = False
    print('Using a selection of samples')
else:
    setting = True
    print('Using all samples')

tt = pf.makechain(setting)

nentries = tt.GetEntries()
print('number of total entries in chain:\t\t\t%d' % (nentries))

#########################################
# Produce KPIs
#########################################

n_2OrMoreMuons = tt.GetEntries()
print('number of all events with 2 or more muons:\t\t%d' % (n_2OrMoreMuons))

n_reconstructable = tt.GetEntries(
    'flag_hnl_reconstructable == 1 & abs(l1_pdgId) == 13 & abs(l1_eta) < 2.4 & abs(l2_pdgId) == 13 & abs(l2_eta) < 2.4'
)
print('number of events with reconstructable HNLs:\t\t%d' %