From ccd0cb8dded79357393de3543b38be299b22dc20 Mon Sep 17 00:00:00 2001 From: Gianluca Date: Mon, 15 May 2023 16:05:51 +0200 Subject: [PATCH 01/18] try migration to newer tools --- python/collections.py | 14 +++++++----- python/l1THistos.py | 51 ++++++++++++++++++++++++++++++++++++++++++- python/tree_reader.py | 9 +++++--- 3 files changed, 65 insertions(+), 9 deletions(-) diff --git a/python/collections.py b/python/collections.py index e4bcd16d..20ff79c4 100644 --- a/python/collections.py +++ b/python/collections.py @@ -22,7 +22,7 @@ import math import sys -import root_numpy.tmva as rnptmva +# import root_numpy.tmva as rnptmva from .utils import debugPrintOut import python.clusterTools as clAlgo @@ -213,6 +213,7 @@ def fill(self, event, weight_file=None, debug=0): def fill_real(self, event, stride, weight_file=None, debug=0): self.clear_query_cache(debug) self.df = self.filler_function(event, stride) + print(self.df) if self.fixture_function is not None: # FIXME: wouldn't this be more efficient # self.fixture_function(self.df) @@ -339,10 +340,12 @@ def cl3d_fixtures(clusters): clusters['emax'] = clusters.emaxe*clusters.energy clusters.loc[clusters.hoe == -1, ['hoe']] = 999 # print(clusters[clusters.hoe == -1][['hoe']]) - clusters['bdt_pu'] = rnptmva.evaluate_reader( - classifiers.mva_pu_classifier_builder(), - 'BDT', - clusters[['emax', 'emaxe', 'spptot', 'srrtot', 'ntc90']]) + # FIXME: replace + clusters['bdt_pu'] = 0.5 + # clusters['bdt_pu'] = rnptmva.evaluate_reader( + # classifiers.mva_pu_classifier_builder(), + # 'BDT', + # clusters[['emax', 'emaxe', 'spptot', 'srrtot', 'ntc90']]) if False: clusters['bdt_pi'] = rnptmva.evaluate_reader( @@ -367,6 +370,7 @@ def get_mother_pdgid(particle, mc_particles): if particle.gen == -1: return -1 return mc_particles.df.loc[(particle.name[0], particle.gen-1)].firstmother_pdgid + # FIXME: temporary particles['firstmother_pdgid'] = particles.apply(func=lambda x: get_mother_pdgid(x, mc_particles), axis=1) return particles diff --git a/python/l1THistos.py b/python/l1THistos.py index c5423fc7..60909329 100644 --- a/python/l1THistos.py +++ b/python/l1THistos.py @@ -1,6 +1,6 @@ from __future__ import print_function import ROOT -import root_numpy as rnp +# import root_numpy as rnp import numpy as np from array import array # import pandas as pd @@ -128,6 +128,55 @@ def __repr__(self): return '<{} {}>'.format(self.__class__.__name__, self.name_) +class BaseBoostHistos(): + def __init__(self, name, root_file=None, debug=False): + self.name_ = name + # print name + # print self.__class__.__name__ + # # print 'BOOK histo: {}'.format(self) + if root_file is not None: + root_file.cd() + # print 'class: {}'.format(self.__class__.__name__) + # ROOT.gDirectory.pwd() + file_dir = root_file.GetDirectory(self.__class__.__name__) + # print '# keys in dir: {}'.format(len(file_dir.GetListOfKeys())) + # file_dir.cd() + selhistos = [(histo.ReadObj(), histo.GetName()) + for histo in file_dir.GetListOfKeys() + if histo.GetName().startswith(name+'_')] + if debug: + print(selhistos) + for hinst, histo_name in selhistos: + attr_name = 'h_'+histo_name.split(name+'_')[1] + setattr(self, attr_name, hinst) +# self.h_test = root_file.Get('h_EleReso_ptRes') + # print 'XXXXXX'+str(self.h_test) + else: + for histo in [a for a in dir(self) if a.startswith('h_')]: + getattr(self, histo).Sumw2() + hm = HistoManager() + hm.addHistos(self) + + def write(self): + if self.__class__.__name__ not in ROOT.gDirectory.GetListOfKeys(): + ROOT.gDirectory.mkdir(self.__class__.__name__) + newdir = ROOT.gDirectory.GetDirectory(self.__class__.__name__) + newdir.cd() + for histo in [a for a in dir(self) if a.startswith('h_')]: + # print ("Writing {}".format(histo)) + getattr(self, histo).Write("", ROOT.TObject.kOverwrite) + ROOT.gDirectory.cd('..') + + # def normalize(self, norm): + # className = self.__class__.__name__ + # ret = className() + # return ret + + def __repr__(self): + return '<{} {}>'.format(self.__class__.__name__, self.name_) + + + class GraphBuilder: def __init__(self, h_obj, h_name): self.h_obj = h_obj diff --git a/python/tree_reader.py b/python/tree_reader.py index 6155b6a2..08041f62 100644 --- a/python/tree_reader.py +++ b/python/tree_reader.py @@ -2,6 +2,7 @@ import datetime import resource import gc +import awkward as ak class TreeReader(object): def __init__(self, entry_range, max_events): @@ -93,14 +94,16 @@ def getDataFrame(self, prefix, entry_block, fallback=None): not br == '{}_n'.format(prefix)] names = ['_'.join(br.split('_')[1:]) for br in branches] name_map = dict(zip(branches, names)) - + print(branches) if len(branches) == 0: if fallback is not None: return self.getDataFrame(prefix=fallback, entry_block=entry_block) return pd.DataFrame() - + print(self.file_entry, self.file_entry+entry_block) + print(self.tree.arrays(branches, library='ak', entry_start=self.file_entry, entry_stop=self.file_entry+entry_block)) # FIXME: stride needs to be set somehow - df = self.tree.arrays(branches, library='pd', entry_start=self.file_entry, entry_stop=self.file_entry+entry_block) + df = ak.to_dataframe(self.tree.arrays(branches, library='ak', entry_start=self.file_entry, entry_stop=self.file_entry+entry_block), how="outer") + print(df) df.rename(columns=name_map, inplace=True) return df From 2bd78ea9de2efb56037b73a1d36834a877f44be0 Mon Sep 17 00:00:00 2001 From: Gianluca Date: Mon, 15 May 2023 16:32:32 +0200 Subject: [PATCH 02/18] avoid useless getitems --- python/l1THistos.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/l1THistos.py b/python/l1THistos.py index 60909329..a6773cef 100644 --- a/python/l1THistos.py +++ b/python/l1THistos.py @@ -1497,7 +1497,7 @@ def fill(self, reference, target): self.h_caloPhiResVabseta.Fill(reference.abseta, target_line.calophi - reference.exphi) self.h_caloEtaResVeta.Fill(reference_eta, target_line.caloeta - reference.exeta) # self.h_caloPhiResVeta.Fill(reference_eta, target_line.calophi - reference.exphi) - self.h_dzRes.Fill(target.z0 - reference.ovz) + self.h_dzRes.Fill(target_line.z0 - reference.ovz) def fill_nMatch(self, n_matches): self.h_nMatch.Fill(n_matches) @@ -1582,8 +1582,8 @@ def fill(self, reference, target): self.h_exetaRes.Fill(target_eta - reference_exeta, reference_weight) self.h_exphiRes.Fill(target_phi - reference_exphi, reference_weight) - if 'tkZ0' in target.columns: - self.h_dzRes.Fill(target.tkZ0 - reference.ovz) + if 'tkZ0' in target_line.columns: + self.h_dzRes.Fill(target_line.tkZ0 - reference.ovz) class ClusterConeHistos(BaseHistos): From cd1d8252fff5028745451490a3c5977e067e7518 Mon Sep 17 00:00:00 2001 From: Gianluca Date: Tue, 23 May 2023 14:13:15 +0200 Subject: [PATCH 03/18] port to new conversion syntax --- python/l1THistos.py | 2 +- python/tree_reader.py | 9 +++++++-- src/fastfilling.h | 14 +++++++++++--- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/python/l1THistos.py b/python/l1THistos.py index a6773cef..bb77f0a7 100644 --- a/python/l1THistos.py +++ b/python/l1THistos.py @@ -1582,7 +1582,7 @@ def fill(self, reference, target): self.h_exetaRes.Fill(target_eta - reference_exeta, reference_weight) self.h_exphiRes.Fill(target_phi - reference_exphi, reference_weight) - if 'tkZ0' in target_line.columns: + if 'tkZ0' in target.columns: self.h_dzRes.Fill(target_line.tkZ0 - reference.ovz) diff --git a/python/tree_reader.py b/python/tree_reader.py index 08041f62..cb73af3f 100644 --- a/python/tree_reader.py +++ b/python/tree_reader.py @@ -3,6 +3,7 @@ import resource import gc import awkward as ak +import awkward_pandas as akpd class TreeReader(object): def __init__(self, entry_range, max_events): @@ -27,7 +28,10 @@ def setTree(self, uptree): 'tc_cellu', 'tc_cellv', 'gen_PUNumInt', - 'gen_TrueNumInt'] + 'gen_TrueNumInt', + 'gen_daughters', + 'simpart_posx', 'simpart_posy', 'simpart_posz', + ] if len(self._branches) == 0: self._branches = [br for br in self.tree.keys() if br not in branch_blacklist] print(f'open new tree file with # entries: {self.tree.num_entries}') @@ -102,7 +106,8 @@ def getDataFrame(self, prefix, entry_block, fallback=None): print(self.file_entry, self.file_entry+entry_block) print(self.tree.arrays(branches, library='ak', entry_start=self.file_entry, entry_stop=self.file_entry+entry_block)) # FIXME: stride needs to be set somehow - df = ak.to_dataframe(self.tree.arrays(branches, library='ak', entry_start=self.file_entry, entry_stop=self.file_entry+entry_block), how="outer") + df = ak.to_dataframe(self.tree.arrays(branches, library='ak', entry_start=self.file_entry, entry_stop=self.file_entry+entry_block)) + # df = akpd.from_awkward(self.tree.arrays(branches, library='ak', entry_start=self.file_entry, entry_stop=self.file_entry+entry_block)) print(df) df.rename(columns=name_map, inplace=True) diff --git a/src/fastfilling.h b/src/fastfilling.h index 3d9d1b3a..28864798 100644 --- a/src/fastfilling.h +++ b/src/fastfilling.h @@ -66,8 +66,9 @@ class HistoFiller2D : public HistoFiller { sourceX(sourceX), sourceY(sourceY) { // std::cout << "Add histo: " << histo->GetName() << ": " << histo << std::endl; - // std::cout << "# of events: " << source.size() << std::endl; - // std::cout << &source << std::endl; + // std::cout << "# of events: " << sourceX.size() << std::endl; + // std::cout << &sourceX << std::endl; + // std::cout << &sourceY << std::endl; } @@ -82,7 +83,7 @@ class HistoFiller2D : public HistoFiller { void fill(unsigned int id) { // std::cout << "FILL histo: " << histo->GetName() << ": " << histo << std::endl; - // std::cout << " entry: " << id << " value: " << source[id] << std::endl; + // std::cout << " entry: " << id << " value X: " << sourceX[id] << " Y: " << sourceY[id] << std::endl; if(filter[id]) histo->Fill(sourceX[id], sourceY[id]); } @@ -190,3 +191,10 @@ void fill1D_rate(TH1* histo, const std::vector& values) { // if rateplot.GetBinContent(ix) <= rate: // cut = rateplot.GetXaxis().GetBinLowEdge(ix) // break + + +void fill_hist(TH1* hist, const std::vector& array, const std::vector& weights) { + for (auto value: array) + hist->Fill(value); +} + From f71f4248db3df9b747f362ee04276c495c532b6a Mon Sep 17 00:00:00 2001 From: Gianluca Date: Fri, 26 May 2023 15:11:53 +0200 Subject: [PATCH 04/18] Start the move to boost histograms and awkward arrays --- analyzeHgcalL1Tntuple.py | 12 +-- python/boost_hist.py | 56 ++++++++++ python/collections.py | 95 ++++------------- python/l1THistos.py | 221 ++++++++++++++++++++------------------- python/plotters.py | 130 ++++++++++------------- python/selections.py | 207 ++++++++++++++++++------------------ python/tree_reader.py | 20 ++-- src/fastfilling.h | 24 ++++- 8 files changed, 386 insertions(+), 379 deletions(-) create mode 100644 python/boost_hist.py diff --git a/analyzeHgcalL1Tntuple.py b/analyzeHgcalL1Tntuple.py index ba8c3410..ad3d03d1 100644 --- a/analyzeHgcalL1Tntuple.py +++ b/analyzeHgcalL1Tntuple.py @@ -122,10 +122,9 @@ def analyze(params, batch_idx=-1): if params.rate_pt_wps: calib_manager.set_pt_wps_version(params.rate_pt_wps) - - output = ROOT.TFile(params.output_filename, "RECREATE") - output.cd() + output = up.recreate(params.output_filename) hm = histos.HistoManager() + hm.file = output # instantiate all the plotters plotter_collection = [] @@ -180,7 +179,7 @@ def analyze(params, batch_idx=-1): # if tree_reader.global_entry % 100 == 0: # tr.collect_stats() - if tree_reader.global_entry != 0 and tree_reader.global_entry % 1000 == 0: + if tree_reader.global_entry != 0 and tree_reader.global_entry % 10000 == 0: print("Writing histos to file") hm.writeHistos() @@ -205,11 +204,8 @@ def analyze(params, batch_idx=-1): # print("Processed {} events/{} TOT events".format(nev, ntuple.nevents())) print("Writing histos to file {}".format(params.output_filename)) - - output.cd() hm.writeHistos() - - output.Close() + output.close() # ROOT.ROOT.DisableImplicitMT() return tree_reader.n_tot_entries diff --git a/python/boost_hist.py b/python/boost_hist.py new file mode 100644 index 00000000..12ef0134 --- /dev/null +++ b/python/boost_hist.py @@ -0,0 +1,56 @@ +import hist +from hist import Hist +import awkward as ak + +def TH1F(name, title, nbins, bin_low, bin_high): + b_axis_name = 'X' + title_split = title.split(';') + if len(title_split) > 1: + b_axis_name = title_split[1] + b_name = title_split[0] + b_label = name + return Hist( + hist.axis.Regular(bins=nbins, start=bin_low, stop=bin_high, name=b_axis_name), + label=b_label, + name=b_name, + storage=hist.storage.Weight() + ) + +def TH2F(name, title, x_nbins, x_bin_low, x_bin_high, y_nbins, y_bin_low, y_bin_high): + b_x_axis_name = 'X' + b_y_axis_name = 'Y' + title_split = title.split(';') + if len(title_split) > 1: + b_x_axis_name = title_split[1] + if len(title_split) > 2: + b_y_axis_name = title_split[2] + b_name = title_split[0] + b_label = name + return Hist( + hist.axis.Regular(bins=x_nbins, start=x_bin_low, stop=x_bin_high, name=b_x_axis_name), + hist.axis.Regular(bins=y_nbins, start=y_bin_low, stop=y_bin_high, name=b_y_axis_name), + label=b_label, + name=b_name, + storage=hist.storage.Weight() + ) + +def fill_1Dhist(hist, array, weights=None): + flar = ak.drop_none(ak.flatten(array)) + if weights is None: + hist.fill(flar) + # ROOT.fill_1Dhist(hist=hist, array=flar) + else: + hist.fill(flar, weights) + # ROOT.fill_1Dhist(hist=hist, array=flar, weights=weights) + +def fill_2Dhist(hist, arrayX, arrayY, weights=None): + flar_x = ak.drop_none(ak.flatten(arrayX)) + flar_y = ak.drop_none(ak.flatten(arrayY)) + + if weights is None: + # ROOT.fill_2Dhist(hist=hist, arrayX=flar_x, arrayY=flar_y) + hist.fill(flar_x, flar_y) + else: + # ROOT.fill_2Dhist(hist=hist, arrayX=flar_x, arrayY=flar_y, weights=weights) + hist.fill(flar_x, flar_y, weights) + diff --git a/python/collections.py b/python/collections.py index 20ff79c4..c4845254 100644 --- a/python/collections.py +++ b/python/collections.py @@ -18,6 +18,7 @@ from __future__ import absolute_import import pandas as pd import numpy as np +import awkward as ak import ROOT import math import sys @@ -125,7 +126,7 @@ class DFCollection(object): def __init__(self, name, label, filler_function, fixture_function=None, - read_entry_block=1000, + read_entry_block=10000, depends_on=[], debug=0, print_function=lambda df: df, @@ -142,11 +143,7 @@ def __init__(self, name, label, self.print_function = print_function self.max_print_lines = max_print_lines self.weight_function = weight_function - self.n_queries = 0 - self.cached_queries = dict() - self.cached_entries = dict() self.entries = None - self.empty_df = None self.next_entry_read = 0 self.read_entry_block = read_entry_block # print (f'Create collection: {self.name} with read_entry_block: {read_entry_block}') @@ -202,7 +199,6 @@ def fill(self, event, weight_file=None, debug=0): self.new_read = False if self.debug > 0: - df_print = self.empty_df if event.file_entry in self.df.index.get_level_values('entry'): df_print = self.df.loc[event.file_entry] debugPrintOut(max(debug, self.debug), self.label, @@ -211,65 +207,15 @@ def fill(self, event, weight_file=None, debug=0): max_lines=self.max_print_lines) def fill_real(self, event, stride, weight_file=None, debug=0): - self.clear_query_cache(debug) self.df = self.filler_function(event, stride) - print(self.df) if self.fixture_function is not None: - # FIXME: wouldn't this be more efficient - # self.fixture_function(self.df) - self.df = self.fixture_function(self.df) + self.fixture_function(self.df) if self.weight_function is not None: self.df = self.weight_function(self.df, weight_file) - self.empty_df = pd.DataFrame(columns=self.df.columns) - self.entries = self.df.index.get_level_values('entry').unique() + self.entries = range(0,1000)# FIXME: self.df.index.get_level_values('entry').unique() if debug > 2: print(f'read coll. {self.name} from entry: {event.file_entry} to entry: {event.file_entry+stride} (stride: {stride}), # rows: {self.df.shape[0]}, # entries: {len(self.entries)}') - def query(self, selection): - self.n_queries += 1 - if selection.all or self.df.empty: - return self.df - if selection.selection not in self.cached_queries: - ret = self.df.query(selection.selection) - self.cached_queries[sys.intern(selection.selection)] = ret - entries = ret.index.get_level_values('entry').unique() - self.cached_entries[selection.hash] = entries - return ret - return self.cached_queries[selection.selection] - - def query_event(self, selection, idx): - self.n_queries += 1 - # print (f'coll: {self.name}, query selection: {selection.selection} for entry: {idx}') - if idx not in self.entries: - # print (' enrty not in frame!') - return self.empty_df - if selection.all or self.df.empty: - # print (' frame is empty') - return self.df.loc[idx] - if selection.selection not in self.cached_queries: - # print (' query already cached') - ret = self.df.query(selection.selection) - self.cached_queries[sys.intern(selection.selection)] = ret - entries = ret.index.get_level_values('entry').unique() - self.cached_entries[selection.hash] = entries - if idx not in entries: - return self.empty_df - return ret.loc[idx] - # print (' query not cached') - # print (f' {self.cached_queries.keys()}') - entries = self.cached_entries[selection.hash] - if idx not in entries: - return self.empty_df - return self.cached_queries[selection.selection].loc[idx] - - def clear_query_cache(self, debug=0): - if (debug > 5): - print('Coll: {} # queries: {} # unique queries: {}'.format( - self.name, self.n_queries, len(self.cached_queries.keys()))) - self.n_queries = 0 - self.cached_entries.clear() - self.cached_queries.clear() - def tkeg_fromcluster_fixture(tkegs): # print tkegs @@ -360,23 +306,19 @@ def cl3d_fixtures(clusters): def gen_fixtures(particles, mc_particles): - if particles.empty: - return particles + # if particles.empty: + # return particles # print particles.columns particles['pdgid'] = particles.pid particles['abseta'] = np.abs(particles.eta) - - def get_mother_pdgid(particle, mc_particles): - if particle.gen == -1: - return -1 - return mc_particles.df.loc[(particle.name[0], particle.gen-1)].firstmother_pdgid - # FIXME: temporary - particles['firstmother_pdgid'] = particles.apply(func=lambda x: get_mother_pdgid(x, mc_particles), axis=1) + particles['firstmother_pdgid'] = mc_particles.df.pdgid[particles[particles.gen != -1].gen-1] return particles def mc_fixtures(particles): - particles['firstmother'] = particles.index.to_numpy() + # print(['mc_fixtures']) + # print(particles) + # # particles['firstmother'] = particles.index.to_numpy() particles['firstmother_pdgid'] = particles.pdgid return particles # FIXME: this is broken @@ -749,20 +691,21 @@ def tkele_fixture_eb(electrons): def quality_flags(objs): - hwqual = pd.to_numeric(objs['hwQual'], downcast='integer') + print(objs.hwQual) + objs['hwQual'] = ak.values_astype(objs.hwQual, np.int32) mask_tight_sta = 0b0001 mask_tight_ele = 0b0010 mask_tight_pho = 0b0100 mask_no_brem = 0b1000 - objs['IDTightSTA'] = np.bitwise_and(hwqual.values, mask_tight_sta) > 0 - objs['IDTightEle'] = np.bitwise_and(hwqual.values, mask_tight_ele) > 0 - objs['IDTightPho'] = np.bitwise_and(hwqual.values, mask_tight_pho) > 0 - objs['IDNoBrem'] = np.bitwise_and(hwqual.values, mask_no_brem) > 0 - objs['IDBrem'] = np.bitwise_and(hwqual.values, mask_no_brem) == 0 - + objs['IDTightSTA'] = np.bitwise_and(objs.hwQual, mask_tight_sta) > 0 + objs['IDTightEle'] = np.bitwise_and(objs.hwQual, mask_tight_ele) > 0 + objs['IDTightPho'] = np.bitwise_and(objs.hwQual, mask_tight_pho) > 0 + objs['IDNoBrem'] = np.bitwise_and(objs.hwQual, mask_no_brem) > 0 + objs['IDBrem'] = np.bitwise_and(objs.hwQual, mask_no_brem) == 0 return objs def quality_ele_fixtures(objs): + print(objs) objs['dpt'] = objs.tkPt - objs.pt return quality_flags(objs) @@ -1510,7 +1453,7 @@ def build_double_obj(obj): filler_function=lambda event, entry_block: event.getDataFrame( prefix='TkEmEB', entry_block=entry_block), fixture_function=quality_flags, - read_entry_block=200, + # read_entry_block=200, debug=0) TkEmL2 = DFCollection( diff --git a/python/l1THistos.py b/python/l1THistos.py index bb77f0a7..6e2730e1 100644 --- a/python/l1THistos.py +++ b/python/l1THistos.py @@ -4,7 +4,11 @@ import numpy as np from array import array # import pandas as pd - +import uproot4 as up +import awkward as ak +import hist +from hist import Hist +import python.boost_hist as bh import python.pf_regions as pf_regions stuff = [] @@ -14,12 +18,12 @@ class HistoLazyFiller(object): def __init__(self, dataframe): self.df = dataframe self.manager = ROOT.FillerManager() - self.columns = dataframe.columns + self.columns = dataframe.fields def fill1d_lazy(self, histo, col_name, sel_name): if not self.manager.knowsVariable(col_name): # print (" - add variable {}".format(col_name)) - self.manager.addVariable(col_name, self.df[col_name].values) + self.manager.addVariable(col_name, ak.flatten(self.df[col_name])) if not self.manager.knowsSelection(sel_name): print("*** [HistoLazyFiller] ERROR: selection: {} not known!".format(sel_name)) @@ -30,11 +34,11 @@ def fill1d_lazy(self, histo, col_name, sel_name): def fill2d_lazy(self, histo, x_col_name, y_col_name, sel_name): if not self.manager.knowsVariable(x_col_name): # print (" - add variable {}".format(col_name)) - self.manager.addVariable(x_col_name, self.df[x_col_name].values) + self.manager.addVariable(x_col_name, ak.flatten(self.df[x_col_name])) if not self.manager.knowsVariable(y_col_name): # print (" - add variable {}".format(col_name)) - self.manager.addVariable(y_col_name, self.df[y_col_name].values) + self.manager.addVariable(y_col_name, ak.flatten(self.df[y_col_name])) if not self.manager.knowsSelection(sel_name): print("*** [HistoLazyFiller] ERROR: selection: {} not known!".format(sel_name)) @@ -54,17 +58,20 @@ class __TheManager: def __init__(self): self.val = None self.histoList = list() + self.file = None def __str__(self): return 'self' + self.val + + def addHistos(self, histo): # print 'ADD histo: {}'.format(histo) self.histoList.append(histo) def writeHistos(self): for histo in self.histoList: - histo.write() + histo.write(self.file) instance = None @@ -104,20 +111,31 @@ def __init__(self, name, root_file=None, debug=False): # self.h_test = root_file.Get('h_EleReso_ptRes') # print 'XXXXXX'+str(self.h_test) else: - for histo in [a for a in dir(self) if a.startswith('h_')]: - getattr(self, histo).Sumw2() + # for histo in [a for a in dir(self) if a.startswith('h_')]: + # FIXME + # getattr(self, histo).Sumw2() hm = HistoManager() hm.addHistos(self) - def write(self): - if self.__class__.__name__ not in ROOT.gDirectory.GetListOfKeys(): - ROOT.gDirectory.mkdir(self.__class__.__name__) - newdir = ROOT.gDirectory.GetDirectory(self.__class__.__name__) - newdir.cd() + def write(self, upfile): + # pyroot_hist = ROOT.TH1F("h", "", 100, -3, 3) + # pyroot_hist.FillRandom("gaus", 100000) + # upfile["from_pyroot"] = pyroot_hist + + dir_name = self.__class__.__name__ for histo in [a for a in dir(self) if a.startswith('h_')]: - # print ("Writing {}".format(histo)) - getattr(self, histo).Write("", ROOT.TObject.kOverwrite) - ROOT.gDirectory.cd('..') + writeable_hist = getattr(self, histo) + # print (f"Writing {histo} class {writeable_hist.__class__.__name__}") + if 'GraphBuilder' in writeable_hist.__class__.__name__ : + continue + elif 'TH1' in writeable_hist.__class__.__name__ or 'TH2' in writeable_hist.__class__.__name__: + # print('start') + # FIXME: this somehow fails randomply. ROOT not lining the right python??? + upfile[f'{dir_name}/{writeable_hist.GetName()}'] = writeable_hist + # print('ok') + else: + up_writeable_hist = up.to_writable(writeable_hist) + upfile[f'{dir_name}/{writeable_hist.label}'] = up_writeable_hist # def normalize(self, norm): # className = self.__class__.__name__ @@ -246,9 +264,9 @@ def computeEResolution(): def __init__(self, name, root_file=None, debug=False): BaseHistos.__init__(self, name, root_file, debug) - if root_file is not None or True: + if root_file is not None: # print dir(self) - for attr_2d in [attr for attr in dir(self) if (attr.startswith('h_') and 'TH2' in getattr(self, attr).ClassName())]: + for attr_2d in [attr for attr in dir(self) if (attr.startswith('h_') and 'TH2' in getattr(self, attr).__class__.__name__)]: setattr(self, attr_2d+'_graph', GraphBuilder(self, attr_2d)) @@ -300,34 +318,39 @@ def __init__(self, name, root_file=None, extended_range=False, debug=False): # print ('bins: {}'.format(pt_bins)) # print ("# bins: {}".format(n_pt_bins)) - self.h_eta = ROOT.TH1F(name+'_eta', 'Gen Part eta; #eta^{GEN};', 50, -3, 3) - self.h_abseta = ROOT.TH1F(name+'_abseta', 'Gen Part |eta|; |#eta^{GEN}|;', 40, 0, 4) - self.h_pt = ROOT.TH1F(name+'_pt', 'Gen Part P_{T} (GeV); p_{T}^{GEN} [GeV];', n_pt_bins, array('d', pt_bins)) + self.h_eta = bh.TH1F(name+'_eta', 'Gen Part eta; #eta^{GEN};', 50, -3, 3) + self.h_abseta = bh.TH1F(name+'_abseta', 'Gen Part |eta|; |#eta^{GEN}|;', 40, 0, 4) + # FIXME: address in hist migration + # self.h_pt = ROOT.TH1F(name+'_pt', 'Gen Part P_{T} (GeV); p_{T}^{GEN} [GeV];', n_pt_bins, array('d', pt_bins)) + self.h_pt = bh.TH1F(name+'_pt', 'Gen Part P_{T} (GeV); p_{T}^{GEN} [GeV];', 50, 0, 100) # self.h_energy = ROOT.TH1F(name+'_energy', 'Gen Part Energy (GeV); E [GeV];', 100, 0, 1000) - self.h_reachedEE = ROOT.TH1F(name+'_reachedEE', 'Gen Part reachedEE', 4, 0, 4) - self.h_fBrem = ROOT.TH1F(name+'_fBrem', 'Brem. p_{T} fraction', 30, 0, 1) + self.h_reachedEE = bh.TH1F(name+'_reachedEE', 'Gen Part reachedEE', 4, 0, 4) + self.h_fBrem = bh.TH1F(name+'_fBrem', 'Brem. p_{T} fraction', 30, 0, 1) + BaseHistos.__init__(self, name, root_file, debug) def fill(self, particles): - particles_weight = particles.weight - rnp.fill_hist(hist=self.h_eta, - array=particles.eta, - weights=particles_weight) - rnp.fill_hist(hist=self.h_abseta, - array=particles.abseta, - weights=particles_weight) - rnp.fill_hist(hist=self.h_pt, - array=particles.pt, - weights=particles_weight) - # rnp.fill_hist(hist=self.h_energy, + weights = None + if 'weights' in particles.fields: + weights = particles.weights + + bh.fill_1Dhist(hist=self.h_eta, + array=particles.eta) + bh.fill_1Dhist(hist=self.h_abseta, + array=particles.abseta) + bh.fill_1Dhist(hist=self.h_pt, + array=particles.pt) + # bh.fill_1Dhist(hist=self.h_energy, # array=particles.energy, # weights=particles_weight) - rnp.fill_hist(hist=self.h_reachedEE, - array=particles.reachedEE, - weights=particles_weight) - rnp.fill_hist(hist=self.h_fBrem, - array=particles.fbrem, - weights=particles_weight) + bh.fill_1Dhist(hist=self.h_reachedEE, + array=particles.reachedEE) + bh.fill_1Dhist(hist=self.h_fBrem, + array=particles.fbrem) + + + + def fill_lazy(self, filler, sel_name): filler.fill1d_lazy(self.h_eta, 'eta', sel_name) @@ -606,36 +629,36 @@ def fill_lazy(self, filler, sel_name): class EGHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_pt = ROOT.TH1F(name+'_pt', 'EG Pt (GeV); p_{T} [GeV]', 100, 0, 100) - self.h_eta = ROOT.TH1F(name+'_eta', 'EG eta; #eta;', 100, -4, 4) - self.h_energy = ROOT.TH1F(name+'_energy', 'EG energy (GeV); E [GeV]', 1000, 0, 1000) - self.h_hwQual = ROOT.TH1F(name+'_hwQual', 'EG energy (GeV); hwQual', 5, 0, 5) - self.h_tkIso = ROOT.TH1F(name+'_tkIso', 'Iso; rel-iso_{tk}', 100, 0, 2) - self.h_pfIso = ROOT.TH1F(name+'_pfIso', 'Iso; rel-iso_{pf}', 100, 0, 2) - self.h_tkIsoPV = ROOT.TH1F(name+'_tkIsoPV', 'Iso; rel-iso^{PV}_{tk}', 100, 0, 2) - self.h_pfIsoPV = ROOT.TH1F(name+'_pfIsoPV', 'Iso; rel-iso^{PV}_{pf}', 100, 0, 2) - self.h_n = ROOT.TH1F(name+'_n', '# objects per event', 100, 0, 100) - self.h_compBdt = ROOT.TH1F(name+'_compBdt', 'BDT Score Comp ID', 100, -4, 4) + self.h_pt = bh.TH1F(name+'_pt', 'EG Pt (GeV); p_{T} [GeV]', 100, 0, 100) + self.h_eta = bh.TH1F(name+'_eta', 'EG eta; #eta;', 100, -4, 4) + self.h_energy = bh.TH1F(name+'_energy', 'EG energy (GeV); E [GeV]', 1000, 0, 1000) + self.h_hwQual = bh.TH1F(name+'_hwQual', 'EG energy (GeV); hwQual', 5, 0, 5) + self.h_tkIso = bh.TH1F(name+'_tkIso', 'Iso; rel-iso_{tk}', 100, 0, 2) + self.h_pfIso = bh.TH1F(name+'_pfIso', 'Iso; rel-iso_{pf}', 100, 0, 2) + self.h_tkIsoPV = bh.TH1F(name+'_tkIsoPV', 'Iso; rel-iso^{PV}_{tk}', 100, 0, 2) + self.h_pfIsoPV = bh.TH1F(name+'_pfIsoPV', 'Iso; rel-iso^{PV}_{pf}', 100, 0, 2) + self.h_n = bh.TH1F(name+'_n', '# objects per event', 100, 0, 100) + self.h_compBdt = bh.TH1F(name+'_compBdt', 'BDT Score Comp ID', 100, -4, 4) BaseHistos.__init__(self, name, root_file, debug) def fill(self, egs): weight = None - if 'weight' in egs.columns: + if 'weight' in egs.fields: weight = egs.weight - else: - weight = np.ones(egs.shape[0]) - - rnp.fill_hist(hist=self.h_pt, array=egs.pt, weights=weight) - rnp.fill_hist(hist=self.h_eta, array=egs.eta, weights=weight) - rnp.fill_hist(hist=self.h_energy, array=egs.energy, weights=weight) - rnp.fill_hist(hist=self.h_hwQual, array=egs.hwQual, weights=weight) - if 'tkIso' in egs.columns: - rnp.fill_hist(hist=self.h_tkIso, array=egs.tkIso, weights=weight) - rnp.fill_hist(hist=self.h_pfIso, array=egs.pfIso, weights=weight) - if 'tkIsoPV' in egs.columns: - rnp.fill_hist(hist=self.h_tkIsoPV, array=egs.tkIsoPV, weights=weight) - rnp.fill_hist(hist=self.h_pfIsoPV, array=egs.pfIsoPV, weights=weight) + + bh.fill_1Dhist(hist=self.h_pt, array=egs.pt, weights=weight) + bh.fill_1Dhist(hist=self.h_eta, array=egs.eta, weights=weight) + bh.fill_1Dhist(hist=self.h_energy, array=egs.energy, weights=weight) + bh.fill_1Dhist(hist=self.h_hwQual, array=egs.hwQual, weights=weight) + if 'tkIso' in egs.fields: + bh.fill_1Dhist(hist=self.h_tkIso, array=egs.tkIso, weights=weight) + bh.fill_1Dhist(hist=self.h_pfIso, array=egs.pfIso, weights=weight) + if 'tkIsoPV' in egs.fields: + bh.fill_1Dhist(hist=self.h_tkIsoPV, array=egs.tkIsoPV, weights=weight) + bh.fill_1Dhist(hist=self.h_pfIsoPV, array=egs.pfIsoPV, weights=weight) + if 'compBDTScore' in egs.fields: + bh.fill_1Dhist(hist=self.h_compBdt, array=egs.compBDTScore, weights=weight) def fill_lazy(self, filler, sel_name): filler.fill1d_lazy(self.h_pt, 'pt', sel_name) @@ -651,11 +674,10 @@ def fill_lazy(self, filler, sel_name): if 'compBDTScore' in filler.columns: filler.fill1d_lazy(self.h_compBdt, 'compBDTScore', sel_name) - def fill_event(self, objects): - if objects.empty: - self.h_n.Fill(0) - else: - self.h_n.Fill(objects.pt.count()) + # FIXME: [FIXME-AK] implement this in the normal fill + # def fill_event(self, objects): + # print(objects.pt) + # self.h_n.Fill(len(objects.pt)) def add_histos(self): self.h_pt.Add(self.h_pt_temp.GetValue()) @@ -1507,50 +1529,49 @@ class EGResoHistos(BaseResoHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_ptResVpt = ROOT.TH2F( + self.h_ptResVpt = bh.TH2F( name+'_ptResVpt', 'EG Pt reso. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}-p_{T}^{GEN} [GeV];', 50, 0, 100, 100, -10, 10) - self.h_ptRes = ROOT.TH1F( + self.h_ptRes = bh.TH1F( name+'_ptRes', 'EG Pt res.; (p_{T}^{L1}-p_{T}^{GEN})/p_{T}^{GEN}', 100, -1, 1) - - self.h_ptResp = ROOT.TH1F( + self.h_ptResp = bh.TH1F( name+'_ptResp', 'EG Pt resp.; p_{T}^{L1}/p_{T}^{GEN}', 100, 0, 3) - self.h_ptRespVpt = ROOT.TH2F( + self.h_ptRespVpt = bh.TH2F( name+'_ptRespVpt', 'EG Pt resp. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}/p_{T}^{GEN};', 50, 0, 100, 100, 0, 3) - self.h_ptRespVeta = ROOT.TH2F( + self.h_ptRespVeta = bh.TH2F( name+'_ptRespVeta', 'EG Pt resp. vs #eta; #eta^{GEN}; p_{T}^{L1}/p_{T}^{GEN};', 50, -4, 4, 100, 0, 3) - self.h_etaRes = ROOT.TH1F( + self.h_etaRes = bh.TH1F( name+'_etaRes', 'EG eta reso; #eta^{L1}-#eta^{GEN}', 100, -0.1, 0.1) - self.h_phiRes = ROOT.TH1F( + self.h_phiRes = bh.TH1F( name+'_phiRes', 'EG phi reso; #phi^{L1}-#phi^{GEN}', 100, -0.1, 0.1) - self.h_exetaRes = ROOT.TH1F( + self.h_exetaRes = bh.TH1F( name+'_exetaRes', 'EG eta reso; #eta^{L1}-#eta^{GEN}_{calo}', 100, -0.1, 0.1) - self.h_exphiRes = ROOT.TH1F( + self.h_exphiRes = bh.TH1F( name+'_exphiRes', 'EG phi reso; #phi^{L1}-#phi^{GEN}_{calo}', 100, -0.1, 0.1) - self.h_dzRes = ROOT.TH1F( + self.h_dzRes = bh.TH1F( name+'_dzRes', '#DeltaZ_{0} res; #DeltaZ_{0}^{L1}-#DeltaZ_{0}^{GEN}', 100, -10, 10) @@ -1558,32 +1579,20 @@ def __init__(self, name, root_file=None, debug=False): BaseResoHistos.__init__(self, name, root_file, debug) def fill(self, reference, target): - # FIXME: reference is a series while target is a DF -> moving to a series saves a lot of time - target_line = target.iloc[0] - target_pt = target_line.pt - target_eta = target_line.eta - target_phi = target_line.phi - - reference_pt = reference.pt - reference_eta = reference.eta - reference_phi = reference.phi - reference_exeta = reference.exeta - reference_exphi = reference.exphi - reference_weight = reference.weight - - self.h_ptRes.Fill((target_pt-reference_pt)/reference_pt, reference_weight) - self.h_ptResVpt.Fill(reference_pt, target_pt-reference_pt, reference_weight) - self.h_ptResp.Fill(target_pt/reference_pt, reference_weight) - self.h_ptRespVeta.Fill(reference_eta, target_pt/reference_pt, reference_weight) - self.h_ptRespVpt.Fill(reference_pt, target_pt/reference_pt, reference_weight) - self.h_etaRes.Fill(target_eta - reference_eta, reference_weight) - self.h_phiRes.Fill(target_phi - reference_phi, reference_weight) - - self.h_exetaRes.Fill(target_eta - reference_exeta, reference_weight) - self.h_exphiRes.Fill(target_phi - reference_exphi, reference_weight) - - if 'tkZ0' in target.columns: - self.h_dzRes.Fill(target_line.tkZ0 - reference.ovz) + # FIXME: weights + + bh.fill_1Dhist(self.h_ptRes, (target.pt-reference.pt)/reference.pt) + bh.fill_2Dhist(self.h_ptResVpt, reference.pt, target.pt-reference.pt) + bh.fill_1Dhist(self.h_ptResp, target.pt/reference.pt) + bh.fill_2Dhist(self.h_ptRespVeta, reference.eta, target.pt/reference.pt) + bh.fill_2Dhist(self.h_ptRespVpt, reference.pt, target.pt/reference.pt) + bh.fill_1Dhist(self.h_etaRes, target.eta - reference.eta) + bh.fill_1Dhist(self.h_phiRes, target.phi - reference.phi) + bh.fill_1Dhist(self.h_exetaRes, target.eta - reference.exeta) + bh.fill_1Dhist(self.h_exphiRes, target.phi - reference.exphi) + + # if 'tkZ0' in target.columns: + # self.h_dzRes.Fill(target_line.tkZ0 - reference.ovz) class ClusterConeHistos(BaseHistos): diff --git a/python/plotters.py b/python/plotters.py index 2a182942..538c86aa 100644 --- a/python/plotters.py +++ b/python/plotters.py @@ -24,6 +24,7 @@ import ROOT import pandas as pd import numpy as np +import awkward as ak from . import l1THistos as histos from . import utils as utils from . import clusterTools as clAlgo @@ -206,17 +207,20 @@ def fill_histos(self, debug=0): # if not (idx, 0) in self.data_set.df.index: # return dataframe = self.data_set.df - if dataframe.empty: - return + # if dataframe.empty: + # return filler = histos.HistoLazyFiller(dataframe) # print (self.data_set.name) # print (self.data_set.df.columns) for data_sel in self.data_selections: if data_sel.all: - filler.add_selection(data_sel.name, np.full(dataframe.shape[0], True, dtype=bool)) + filler.add_selection(data_sel.name, np.full(len(dataframe), True, dtype=bool)) else: - filler.add_selection(data_sel.name, dataframe.eval(data_sel.selection).values) + # FIXME: add selection + print(data_sel.name) + print(data_sel.selection(dataframe)) + filler.add_selection(data_sel.name, ak.flatten(data_sel.selection(dataframe))) self.h_set[data_sel.name].fill_lazy(filler, data_sel.name) filler.fill() @@ -602,13 +606,13 @@ def __init__(self, ObjectHistoClass, ResoHistoClass, gen_set, selections.multiply_selections( gen_selections, - [selections.Selection('', '', 'gen > 0')])) + [selections.Selection('', '', lambda ar: ar.gen > 0)])) # print self # print gen_selections def plotObjectMatch(self, - genParticles, + gen, objects, h_gen, h_gen_matched, @@ -617,68 +621,39 @@ def plotObjectMatch(self, algoname, debug): - gen_filler = histos.HistoLazyFiller(genParticles) - den_sel = np.full(genParticles.shape[0], True, dtype=bool) - num_sel = np.full(genParticles.shape[0], False, dtype=bool) # fill histo with all selected GEN particles before any match - gen_filler.add_selection('den', den_sel) - if h_gen: - h_gen.fill_lazy(gen_filler, 'den') - - best_match_indexes = {} - positional = True - if not objects.empty: - obj_filler = histos.HistoLazyFiller(objects) - obj_ismatch = np.full(objects.shape[0], False, dtype=bool) - - best_match_indexes, allmatches = utils.match_etaphi( - genParticles[self.gen_eta_phi_columns], - objects[['eta', 'phi']], - objects['pt'], - deltaR=0.1, - return_positional=positional) + h_gen.fill(gen) + + # perform the matching + match_eta = ak.cartesian([objects.eta, gen[self.gen_eta_phi_columns[0]]]) + match_phi = ak.cartesian([objects.phi, gen[self.gen_eta_phi_columns[1]]]) + match_pt = ak.cartesian([objects.pt, gen.pt]) + match_idx = ak.argcartesian([objects.eta, gen.eta]) + + obj_eta, gen_eta = ak.unzip(match_eta) + obj_phi, gen_phi = ak.unzip(match_phi) + obj_pt, gen_pt = ak.unzip(match_pt) + obj_idx, gen_idx = ak.unzip(match_idx) + dpt = np.abs(obj_pt - gen_pt) + dr2 = (obj_eta-gen_eta)**2+(obj_phi-gen_phi)**2 + match = ak.Array(data={'ele_idx': obj_idx, 'gen_idx': gen_idx, 'dpt': dpt, 'dr2': dr2}) + dr_match=match[match.dr2<0.01] + for genid in np.unique(ak.flatten(dr_match.gen_idx)): + gen_match_id = dr_match[dr_match.gen_idx == genid] + dpt_min_index = ak.Array(ak.argmin(gen_match_id.dpt, axis=1, keepdims=True)) + best_match_id = gen_match_id[dpt_min_index] + matched_obj = objects[best_match_id.ele_idx] + matched_gen = gen[best_match_id.gen_idx] + h_object_matched.fill(matched_obj) + if h_gen_matched is not None: + h_gen_matched.fill(matched_gen) + h_reso.fill(reference=matched_gen, + target=matched_obj) + # FIXME: [AWKWARD] + # if hasattr(h_reso, 'fill_nMatch'): + # h_reso.fill_nMatch(len(allmatches[idx])) - # print (objects) - # print (best_match_indexes) - # print (best_match_iloc) - for idx in list(best_match_indexes.keys()): - if positional: - obj_matched = objects.iloc[[best_match_indexes[idx]]] - obj_ismatch[best_match_indexes[idx]] = True - else: - obj_matched = objects.loc[[best_match_indexes[idx]]] - obj_ismatch[objects.index.get_loc(best_match_indexes[idx])] = True - - # h_object_matched.fill(obj_matched) - num_sel[genParticles.index.get_loc(idx)] = True - h_reso.fill(reference=genParticles.loc[idx], target=obj_matched) - - if hasattr(h_reso, 'fill_nMatch'): - h_reso.fill_nMatch(len(allmatches[idx])) - - # print('GEN') - # print(gen_matched) - # print('ALL matches: {}'.format(len(allmatches[idx]))) - # print (objects.loc[allmatches[idx]]) - # print('--------') - # print('best match index: {}'.format(best_match_indexes[idx])) - # print(obj_matched) - # print('best match iloc: {}'.format(best_match_iloc[idx])) - # print(objects.iloc[[best_match_iloc[idx]]]) - # print ("--") - - # if h_gen_matched is not None: - # h_gen_matched.fill(gen_matched) - obj_filler.add_selection('match', obj_ismatch) - h_object_matched.fill_lazy(obj_filler, 'match') - obj_filler.fill() - - if h_gen_matched is not None: - gen_filler.add_selection('num', num_sel) - h_gen_matched.fill_lazy(gen_filler, 'num') - - gen_filler.fill() def book_histos(self): self.gen_set.activate() @@ -692,15 +667,19 @@ def book_histos(self): self.h_effset[histo_name] = histos.HistoSetEff(histo_name) def fill_histos(self, debug=0): - pass - - def fill_histos_event(self, idx, debug=0): + # FIXME: we need to reduce the # of jugged dimensions for the selection slicing to work in AWKWARD.... + gen = self.gen_set.df[['eta', 'abseta', 'phi', 'pt', 'energy', 'exeta', 'exphi', 'fbrem', 'gen', 'pid', 'reachedEE', 'pdgid']] for tp_sel in self.data_selections: - objects = self.data_set.query_event(tp_sel, idx) + # print(tp_sel) + if tp_sel.all: + # FIXME: workaround for now + objects = self.data_set.df + else: + objects = self.data_set.df[tp_sel.selection(self.data_set.df)] for gen_sel in self.gen_selections: - genReference = self.gen_set.query_event(gen_sel, idx) - if genReference.empty: - continue + # print(gen_sel) + # print(gen_sel.selection(gen)) + genReference = gen[gen_sel.selection(gen)] histo_name = '{}_{}_{}'.format(self.data_set.name, tp_sel.name, gen_sel.name) # print (histo_name) # print (f'# data: {objects.shape[0]}') @@ -709,7 +688,6 @@ def fill_histos_event(self, idx, debug=0): h_obj_match = self.h_dataset[histo_name] h_resoset = self.h_resoset[histo_name] h_genseleff = self.h_effset[histo_name] - # print ('TPsel: {}, GENsel: {}'.format(tp_sel.name, gen_sel.name)) self.plotObjectMatch(genReference, objects, h_genseleff.h_den, @@ -718,8 +696,10 @@ def fill_histos_event(self, idx, debug=0): h_resoset, self.data_set.name, debug) - # print (f'Filling histof for data: {self.data_set.name}, entry: {idx}') - # print ("# of queries: {}".format(qcounter)) + + def fill_histos_event(self, idx, debug=0): + if self.data_set.new_read: + self.fill_histos(debug) class TrackGenMatchPlotter(GenericGenMatchPlotter): diff --git a/python/selections.py b/python/selections.py index f99db3d9..e0af30a0 100644 --- a/python/selections.py +++ b/python/selections.py @@ -12,6 +12,7 @@ import os import re import python.pf_regions as pf_regions +import numpy as np class PID: electron = 11 @@ -70,10 +71,12 @@ class Selection: selection (string): see pandas.DataFrame.query syntax """ - def __init__(self, name, label='', selection=''): + def __init__(self, name, label='', selection=None): self.name = name self.label_ = label self.selection = selection + if self.name == 'all': + self.selection = lambda ar: True; self.hash = hash(selection) self.register() @@ -106,7 +109,7 @@ def __and__(self, other): return Selection( name='{}{}'.format(self.name, other.name), label=new_label, - selection='({}) & ({})'.format(self.selection, other.selection)) + selection=lambda array : self.selection(array) & other.selection(array)) def __or__(self, other): @@ -127,7 +130,7 @@ def __or__(self, other): return Selection( name='{}Or{}'.format(self.name, other.name), label=new_label, - selection='({}) | ({})'.format(self.selection, other.selection)) + selection=lambda array : self.selection(array) | other.selection(array)) def rename(self, new_name, new_label = None): self.name = new_name @@ -135,15 +138,15 @@ def rename(self, new_name, new_label = None): self.label_ = new_label self.register() - def __mul__(self, other): - return self.__add__(other) + # def __mul__(self, other): + # return self.__add__(other) - def __add__(self, other): - return self.__and__(other) + # def __add__(self, other): + # return self.__and__(other) def __str__(self): - return 'n: {}, \n\t s: {}, \n\t l:{}'.format( - self.name, self.selection, self.label) + return 'n: {}, \n\t l:{}'.format( + self.name, self.label) def __repr__(self): return '<{} {}> '.format( @@ -158,11 +161,7 @@ def all(self): def multiply_selections(list1, list2): - ret = [] - for sel1 in list1: - for sel2 in list2: - ret.append(sel1*sel2) - return ret + return and_selections(list1, list2) def and_selections(list1, list2): ret = [] @@ -357,24 +356,26 @@ def compare_selections(sel1, sel2): # Selection('Pt5to10', '5<=p_{T}^{TOBJ}<10GeV', '(pt >= 5) & (pt < 10)'), # Selection('Pt10to20', '10<=p_{T}^{TOBJ}<20GeV', '(pt >= 10) & (pt < 20)'), # Selection('Pt10', 'p_{T}^{TOBJ}>=10GeV', 'pt >= 10'), - Selection('Pt10', 'p_{T}^{TOBJ}>=10GeV', 'pt >= 10'), - Selection('Pt20', 'p_{T}^{TOBJ}>=20GeV', 'pt >= 20'), - # Selection('Pt25', 'p_{T}^{TOBJ}>=25GeV', 'pt >= 25'), - Selection('Pt30', 'p_{T}^{TOBJ}>=30GeV', 'pt >= 30') + Selection('Pt10', 'p_{T}^{TOBJ}>=10GeV', lambda array: array.pt >= 10), + Selection('Pt20', 'p_{T}^{TOBJ}>=20GeV', lambda array: array.pt >= 20), + Selection('Pt25', 'p_{T}^{TOBJ}>=25GeV', lambda array: array.pt >= 25), + Selection('Pt30', 'p_{T}^{TOBJ}>=30GeV', lambda array: array.pt >= 30) ] tp_pt_sel_ext = [ Selection('all', '', ''), - Selection('Pt10', 'p_{T}^{TOBJ}>=10GeV', 'pt >= 10'), - Selection('Pt15', 'p_{T}^{TOBJ}>=15GeV', 'pt >= 15'), - Selection('Pt20', 'p_{T}^{TOBJ}>=20GeV', 'pt >= 20'), - Selection('Pt25', 'p_{T}^{TOBJ}>=25GeV', 'pt >= 25'), - Selection('Pt30', 'p_{T}^{TOBJ}>=30GeV', 'pt >= 30'), - Selection('Pt40', 'p_{T}^{TOBJ}>=40GeV', 'pt >= 40') + Selection('Pt2', 'p_{T}^{TOBJ}>=2GeV', lambda array: array.pt >= 2), + Selection('Pt5', 'p_{T}^{TOBJ}>=5GeV', lambda array: array.pt >= 5), + Selection('Pt10', 'p_{T}^{TOBJ}>=10GeV', lambda array: array.pt >= 10), + Selection('Pt15', 'p_{T}^{TOBJ}>=15GeV', lambda array: array.pt >= 15), + Selection('Pt20', 'p_{T}^{TOBJ}>=20GeV', lambda array: array.pt >= 20), + Selection('Pt25', 'p_{T}^{TOBJ}>=25GeV', lambda array: array.pt >= 25), + Selection('Pt30', 'p_{T}^{TOBJ}>=30GeV', lambda array: array.pt >= 30), + Selection('Pt40', 'p_{T}^{TOBJ}>=40GeV', lambda array: array.pt >= 40) ] tp_tccluster_match_selections = [Selection('all', '', ''), - Selection('Pt5to10', '5 <= p_{T}^{TOBJ} < 10GeV', '(pt < 10) & (pt >= 5)'), - Selection('Pt10to20', '10 <= p_{T}^{TOBJ} < 20GeV', '(pt < 20) & (pt >= 10)') + Selection('Pt5to10', '5 <= p_{T}^{TOBJ} < 10GeV', lambda array: (array.pt < 10) & (array.pt >= 5)), + Selection('Pt10to20', '10 <= p_{T}^{TOBJ} < 20GeV', lambda array: (array.pt < 20) & (array.pt >= 10)) ] tp_eta_ee_sel = [ Selection('all', '', ''), @@ -386,21 +387,21 @@ def compare_selections(sel1, sel2): # Selection('EtaE', '|#eta^{TOBJ}| > 2.8', 'abs(eta) > 2.8'), # Selection('EtaAB', '|#eta^{TOBJ}| <= 1.7', 'abs(eta) <= 1.7'), # Selection('EtaABC', '|#eta^{TOBJ}| <= 2.4', 'abs(eta) <= 2.4'), - Selection('EtaBC', '1.52 < |#eta^{TOBJ}| <= 2.4', '1.52 < abs(eta) <= 2.4'), - Selection('EtaBCD', '1.52 < |#eta^{TOBJ}| <= 2.8', '1.52 < abs(eta) <= 2.8'), + Selection('EtaBC', '1.52 < |#eta^{TOBJ}| <= 2.4', lambda array: (1.52 < abs(array.eta)) & (abs(array.eta) <= 2.4)), + Selection('EtaBCD', '1.52 < |#eta^{TOBJ}| <= 2.8', lambda array: (1.52 < abs(array.eta)) & (abs(array.eta) <= 2.8)), # Selection('EtaBCDE', '1.52 < |#eta^{TOBJ}| < 3', '1.52 < abs(eta) < 3') ] genpart_ele_selections = [ - Selection('Ele', 'e^{#pm}', 'abs(pdgid) == {}'.format(PID.electron))] + Selection('Ele', 'e^{#pm}', lambda array: abs(array.pdgid) == PID.electron)] genpart_photon_selections = [ - Selection('Phot', '#gamma', 'abs(pdgid) == {}'.format(PID.photon))] + Selection('Phot', '#gamma', lambda array: abs(array.pdgid) == PID.photon)] genpart_pion_selections = [ - Selection('Pion', '#pi', 'abs(pdgid) == {}'.format(PID.pion))] + Selection('Pion', '#pi', lambda array: abs(array.pdgid) == PID.pion)] gen_ee_sel = [ - Selection('Ee', '', 'reachedEE >0'), + Selection('Ee', '', lambda array: array.reachedEE > 0), # # FIXME: remove after test (or pick one) # Selection('R0', 'R0', 'reachedEE >0 ') ] @@ -412,69 +413,71 @@ def compare_selections(sel1, sel2): # ] other_selections = [ - Selection('EtaA', '1.49 < |#eta^{TOBJ}| <= 1.52', '1.49 < abs(eta) <= 1.52'), - Selection('EtaB', '1.52 < |#eta^{TOBJ}| <= 1.7', '1.52 < abs(eta) <= 1.7'), - Selection('EtaC', '1.7 < |#eta^{TOBJ}| <= 2.4', '1.7 < abs(eta) <= 2.4'), - Selection('EtaD', '2.4 < |#eta^{TOBJ}| <= 2.8', '2.4 < abs(eta) <= 2.8'), - Selection('EtaDE', '2.4 < |#eta^{TOBJ}| <= 3.0', '2.4 < abs(eta) <= 3.0'), - Selection('EtaE', '|#eta^{TOBJ}| > 2.8', 'abs(eta) > 2.8'), - Selection('EtaAB', '1.49 < |#eta^{TOBJ}| <= 1.7', '1.49 < abs(eta) <= 1.7'), - Selection('EtaABC', '1.49 < |#eta^{TOBJ}| <= 2.4', '1.49 < abs(eta) <= 2.4'), - Selection('EtaABCD', '1.49 < |#eta^{TOBJ}| <= 2.8', '1.49 < abs(eta) <= 2.8'), - Selection('EtaFABCD', '|#eta^{TOBJ}| <= 2.8', 'abs(eta) <= 2.8'), - Selection('EtaFABC', '|#eta^{TOBJ}| <= 2.4', 'abs(eta) <= 2.4'), - Selection('EtaBCDE', '1.52 < |#eta^{TOBJ}|', '1.52 < abs(eta)') + Selection('EtaA', '1.49 < |#eta^{TOBJ}| <= 1.52', lambda array: (1.49 < abs(array.eta)) & (abs(array.eta) <= 1.52)), + Selection('EtaB', '1.52 < |#eta^{TOBJ}| <= 1.7', lambda array: (1.52 < abs(array.eta)) & (abs(array.eta) <= 1.7)), + Selection('EtaC', '1.7 < |#eta^{TOBJ}| <= 2.4', lambda array: (1.7 < abs(array.eta)) & (abs(array.eta) <= 2.4)), + Selection('EtaD', '2.4 < |#eta^{TOBJ}| <= 2.8', lambda array: (2.4 < abs(array.eta)) & (abs(array.eta) <= 2.8)), + Selection('EtaDE', '2.4 < |#eta^{TOBJ}| <= 3.0', lambda array: (2.4 < abs(array.eta)) & (abs(array.eta) <= 3.0)), + Selection('EtaE', '|#eta^{TOBJ}| > 2.8', lambda array: abs(array.eta) > 2.8), + Selection('EtaAB', '1.49 < |#eta^{TOBJ}| <= 1.7', lambda array: (1.49 < abs(array.eta)) & (abs(array.eta) <= 1.7)), + Selection('EtaABC', '1.49 < |#eta^{TOBJ}| <= 2.4', lambda array: (1.49 < abs(array.eta)) & (abs(array.eta) <= 2.4)), + Selection('EtaABCD', '1.49 < |#eta^{TOBJ}| <= 2.8', lambda array: (1.49 < abs(array.eta)) & (abs(array.eta) <= 2.8)), + Selection('EtaFABCD', '|#eta^{TOBJ}| <= 2.8', lambda array: abs(array.eta) <= 2.8), + Selection('EtaFABC', '|#eta^{TOBJ}| <= 2.4', lambda array: abs(array.eta) <= 2.4), + Selection('EtaBCDE', '1.52 < |#eta^{TOBJ}|', lambda array: 1.52 < abs(array.eta)) ] -# gen_ee_sel = [ -# Selection('', '', 'reachedEE >0 ')] -gen_eta_ee_sel = [ - # Selection('EtaA', '|#eta^{TOBJ}| <= 1.52', 'abs(eta) <= 1.52'), - # Selection('EtaB', '1.52 < |#eta^{TOBJ}| <= 1.7', '1.52 < abs(eta) <= 1.7'), - # Selection('EtaC', '1.7 < |#eta^{TOBJ}| <= 2.4', '1.7 < abs(eta) <= 2.4'), - # Selection('EtaD', '2.4 < |#eta^{TOBJ}| <= 2.8', '2.4 < abs(eta) <= 2.8'), - # Selection('EtaDE', '2.4 < |#eta^{TOBJ}| <= 3.0', '2.4 < abs(eta) <= 3.0'), - # Selection('EtaE', '|#eta^{TOBJ}| > 2.8', 'abs(eta) > 2.8'), - # Selection('EtaAB', '|#eta^{TOBJ}| <= 1.7', 'abs(eta) <= 1.7'), - # Selection('EtaABC', '|#eta^{TOBJ}| <= 2.4', 'abs(eta) <= 2.4'), - Selection('EtaBC', '1.52 < |#eta^{TOBJ}| <= 2.4', '1.52 < abs(eta) <= 2.4'), - Selection('EtaBCD', '1.52 < |#eta^{TOBJ}| <= 2.8', '1.52 < abs(eta) <= 2.8'), - # Selection('EtaBCDE', '1.52 < |#eta^{TOBJ}|', '1.52 < abs(eta)') - ] -gen_eta_eb_sel = [ - Selection('EtaF', '|#eta^{TOBJ}| <= 1.479', 'abs(eta) <= 1.479')] -gen_eta_sel = [ - Selection('EtaF', '|#eta^{TOBJ}| <= 1.479', 'abs(eta) <= 1.479'), - Selection('EtaD', '2.4 < |#eta^{TOBJ}| <= 2.8', '2.4 < abs(eta) <= 2.8'), - Selection('EtaBC', '1.52 < |#eta^{TOBJ}| <= 2.4', '1.52 < abs(eta) <= 2.4'), - Selection('EtaBCD', '1.52 < |#eta^{TOBJ}| <= 2.8', '1.52 < abs(eta) <= 2.8') -] +# # gen_ee_sel = [ +# # Selection('', '', 'reachedEE >0 ')] +# gen_eta_ee_sel = [ +# # Selection('EtaA', '|#eta^{TOBJ}| <= 1.52', 'abs(eta) <= 1.52'), +# # Selection('EtaB', '1.52 < |#eta^{TOBJ}| <= 1.7', '1.52 < abs(eta) <= 1.7'), +# # Selection('EtaC', '1.7 < |#eta^{TOBJ}| <= 2.4', '1.7 < abs(eta) <= 2.4'), +# # Selection('EtaD', '2.4 < |#eta^{TOBJ}| <= 2.8', '2.4 < abs(eta) <= 2.8'), +# # Selection('EtaDE', '2.4 < |#eta^{TOBJ}| <= 3.0', '2.4 < abs(eta) <= 3.0'), +# # Selection('EtaE', '|#eta^{TOBJ}| > 2.8', 'abs(eta) > 2.8'), +# # Selection('EtaAB', '|#eta^{TOBJ}| <= 1.7', 'abs(eta) <= 1.7'), +# # Selection('EtaABC', '|#eta^{TOBJ}| <= 2.4', 'abs(eta) <= 2.4'), +# Selection('EtaBC', '1.52 < |#eta^{TOBJ}| <= 2.4', '1.52 < abs(eta) <= 2.4'), +# Selection('EtaBCD', '1.52 < |#eta^{TOBJ}| <= 2.8', '1.52 < abs(eta) <= 2.8'), +# # Selection('EtaBCDE', '1.52 < |#eta^{TOBJ}|', '1.52 < abs(eta)') +# ] +# gen_eta_eb_sel = [ +# Selection('EtaF', '|#eta^{TOBJ}| <= 1.479', 'abs(eta) <= 1.479')] +# gen_eta_sel = [ +# Selection('EtaF', '|#eta^{TOBJ}| <= 1.479', 'abs(eta) <= 1.479'), +# Selection('EtaD', '2.4 < |#eta^{TOBJ}| <= 2.8', '2.4 < abs(eta) <= 2.8'), +# Selection('EtaBC', '1.52 < |#eta^{TOBJ}| <= 2.4', '1.52 < abs(eta) <= 2.4'), +# Selection('EtaBCD', '1.52 < |#eta^{TOBJ}| <= 2.8', '1.52 < abs(eta) <= 2.8') +# ] -gen_pt_sel = [ - Selection('all'), - Selection('Pt15', 'p_{T}^{TOBJ}>=15GeV', 'pt >= 15'), - # Selection('Pt10to25', '10 #leq p_{T}^{TOBJ} < 25GeV', '(pt >= 10) & (pt < 25)'), - # Selection('Pt20', 'p_{T}^{TOBJ}>=20GeV', 'pt >= 20'), - Selection('Pt30', 'p_{T}^{TOBJ}>=30GeV', 'pt >= 30'), - # Selection('Pt35', 'p_{T}^{TOBJ}>=35GeV', 'pt >= 35'), - # Selection('Pt40', 'p_{T}^{TOBJ}>=40GeV', 'pt >= 40') -] -gen_pt_sel_red = [ - Selection('all'), - Selection('Pt15', 'p_{T}^{TOBJ}>=15GeV', 'pt >= 15') -] +# gen_pt_sel = [ +# Selection('all'), +# Selection('Pt15', 'p_{T}^{TOBJ}>=15GeV', 'pt >= 15'), +# # Selection('Pt10to25', '10 #leq p_{T}^{TOBJ} < 25GeV', '(pt >= 10) & (pt < 25)'), +# # Selection('Pt20', 'p_{T}^{TOBJ}>=20GeV', 'pt >= 20'), +# Selection('Pt30', 'p_{T}^{TOBJ}>=30GeV', 'pt >= 30'), +# # Selection('Pt35', 'p_{T}^{TOBJ}>=35GeV', 'pt >= 35'), +# # Selection('Pt40', 'p_{T}^{TOBJ}>=40GeV', 'pt >= 40') +# ] +# gen_pt_sel_red = [ +# Selection('all'), +# Selection('Pt15', 'p_{T}^{TOBJ}>=15GeV', 'pt >= 15') +# ] -gen_pt_upper = [ - Selection('', '', 'pt <= 100') -] +# gen_pt_upper = [ +# Selection('', '', 'pt <= 100') +# ] gen_pid_sel = [ - Selection('GEN', '', '(((abs(pdgid) == {}) & (abs(firstmother_pdgid) == {})) | \ - ((abs(pdgid) == {}) & (abs(firstmother_pdgid) == {})))'.format( - PID.electron, PID.electron, - PID.photon, PID.photon)) + Selection('GEN', '', + lambda ar: ((np.abs(ar.pdgid) == PID.electron ) | (np.abs(ar.pdgid) == PID.photon)) & (ar.gen != -1)) + # '(((abs(pdgid) == {}) & (abs(firstmother_pdgid) == {})) | \ + # ((abs(pdgid) == {}) & (abs(firstmother_pdgid) == {})))'.format( + # PID.electron, PID.electron, + # PID.photon, PID.photon)) ] gen_ele_sel = [ Selection('GEN11', '', '((abs(pdgid) == {}) & (abs(firstmother_pdgid) == {}))'.format( @@ -489,12 +492,12 @@ def compare_selections(sel1, sel2): eg_eta_eb_sel = [ Selection('all'), - Selection('EtaF', '|#eta^{TOBJ}| <= 1.479', 'abs(eta) <= 1.479') + Selection('EtaF', '|#eta^{TOBJ}| <= 1.479', lambda ar: abs(ar.eta) <= 1.479) ] eg_eta_sel = [ Selection('all'), - Selection('EtaF', '|#eta^{TOBJ}| <= 1.479', 'abs(eta) <= 1.479'), - Selection('EtaA', ' 1.479 < |#eta^{TOBJ}| <= 1.52', '(abs(eta) <= 1.52) & abs(eta) > 1.479'), + # Selection('EtaF', '|#eta^{TOBJ}| <= 1.479', 'abs(eta) <= 1.479'), + # Selection('EtaA', ' 1.479 < |#eta^{TOBJ}| <= 1.52', '(abs(eta) <= 1.52) & abs(eta) > 1.479'), Selection('EtaBC', '1.52 < |#eta^{TOBJ}| <= 2.4', '1.52 < abs(eta) <= 2.4'), Selection('EtaEB', '|#eta^{TOBJ}| <= 1.479', 'abs(eta) <= 1.479'), Selection('EtaEE', '1.479 < |#eta^{TOBJ}| <= 2.4', '(abs(eta) > 1.479) & (abs(eta) <= 2.4)'), @@ -517,10 +520,10 @@ def compare_selections(sel1, sel2): tracks_quality_sels = [Selection('all'), Selection('St4', '# stubs > 3', 'nStubs > 3')] -tracks_pt_sels = [Selection('all'), - Selection('Pt2', 'p_{T}^{TOBJ}>=2GeV', 'pt >= 2'), - Selection('Pt5', 'p_{T}^{TOBJ}>=5GeV', 'pt >= 5'), - Selection('Pt10', 'p_{T}^{TOBJ}>=10GeV', 'pt >= 10')] +# tracks_pt_sels = [Selection('all'), +# Selection('Pt2', 'p_{T}^{TOBJ}>=2GeV', 'pt >= 2'), +# Selection('Pt5', 'p_{T}^{TOBJ}>=5GeV', 'pt >= 5'), +# Selection('Pt10', 'p_{T}^{TOBJ}>=10GeV', 'pt >= 10')] pfinput_regions = [ Selection('all'), @@ -598,25 +601,25 @@ def compare_selections(sel1, sel2): eg_id_sel = [ Selection('all'), - Selection('IDTightS', 'Tight-STA', 'IDTightSTA'), - Selection('IDTightE', 'Tight-TkEle', 'IDTightEle'), - Selection('IDTightP', 'Tight-TkEm', 'IDTightPho'), - Selection('IDNoBrem', 'NoBrem', 'IDNoBrem'), - Selection('IDBrem', 'Brem', 'IDNoBrem == False'), + Selection('IDTightS', 'Tight-STA', lambda array: array.IDTightSTA), + Selection('IDTightE', 'Tight-TkEle', lambda array: array.IDTightEle), + Selection('IDTightP', 'Tight-TkEm', lambda array: array.IDTightPho), + Selection('IDNoBrem', 'NoBrem', lambda array: array.IDNoBrem), + Selection('IDBrem', 'Brem', lambda array: array.IDNoBrem == False), Selection('IDEleH', 'TkEle ID (H)', ''), ] comp_id_sel = [ - Selection('IDCompWP955', 'CompID WP 0.955', 'compBDTScore > -0.7318549872638138'), #, epsilon_b = 0.0985 + Selection('IDCompWP955', 'CompID WP 0.955', lambda ar: ar.compBDTScore > -0.7318549872638138), #, epsilon_b = 0.0985 # Selection('IDCompWP950', 'CompID WP 0.950', 'compBDTScore > -0.5871849', #, epsilon_b = 0.0917 # Selection('IDCompWP940', 'CompID WP 0.940', 'compBDTScore > -0.4392925', #, epsilon_b = 0.0788 # Selection('IDCompWP930', 'CompID WP 0.930', 'compBDTScore > -0.2919413', #, epsilon_b = 0.0638 # Selection('IDCompWP920', 'CompID WP 0.920', 'compBDTScore > -0.1440416', #, epsilon_b = 0.0531 # Selection('IDCompWP910', 'CompID WP 0.910', 'compBDTScore > 0.0825459', # epsilon_b = 0.0437 - Selection('IDCompWP900', 'CompID WP 0.900', 'compBDTScore > 0.2157780720764229'), # epsilon_b = 0.0373 - Selection('IDCompWP800', 'CompID WP 0.800', 'compBDTScore > 1.694870131268548'), # epsilon_b = 0.0081 + Selection('IDCompWP900', 'CompID WP 0.900', lambda ar: ar.compBDTScore > 0.2157780720764229), # epsilon_b = 0.0373 + Selection('IDCompWP800', 'CompID WP 0.800', lambda ar: ar.compBDTScore > 1.694870131268548), # epsilon_b = 0.0081 # Selection('IDCompWP700', 'CompID WP 0.700', 'compBDTScore > 0.9914881', # epsilon_b = 0.0034 # Selection('IDCompWP650', 'CompID WP 0.650', 'compBDTScore > 0.9954325', # epsilon_b = 0.0021 # Selection('IDCompWP600', 'CompID WP 0.600', 'compBDTScore > 0.9958264', # epsilon_b = 0.0017 diff --git a/python/tree_reader.py b/python/tree_reader.py index cb73af3f..852128c5 100644 --- a/python/tree_reader.py +++ b/python/tree_reader.py @@ -97,18 +97,16 @@ def getDataFrame(self, prefix, entry_block, fallback=None): if br.startswith(prefix+'_') and not br == '{}_n'.format(prefix)] names = ['_'.join(br.split('_')[1:]) for br in branches] - name_map = dict(zip(branches, names)) - print(branches) + name_map = dict(zip(names, branches)) if len(branches) == 0: if fallback is not None: return self.getDataFrame(prefix=fallback, entry_block=entry_block) - return pd.DataFrame() - print(self.file_entry, self.file_entry+entry_block) - print(self.tree.arrays(branches, library='ak', entry_start=self.file_entry, entry_stop=self.file_entry+entry_block)) - # FIXME: stride needs to be set somehow - df = ak.to_dataframe(self.tree.arrays(branches, library='ak', entry_start=self.file_entry, entry_stop=self.file_entry+entry_block)) - # df = akpd.from_awkward(self.tree.arrays(branches, library='ak', entry_start=self.file_entry, entry_stop=self.file_entry+entry_block)) - print(df) - df.rename(columns=name_map, inplace=True) + raise ValueError(f'[TreeReader::getDataFrame] No branches with prefix: {prefix}') + + akarray = self.tree.arrays(names, + library='ak', + aliases=name_map, + entry_start=self.file_entry, + entry_stop=self.file_entry+entry_block) + return akarray - return df diff --git a/src/fastfilling.h b/src/fastfilling.h index 28864798..af301f45 100644 --- a/src/fastfilling.h +++ b/src/fastfilling.h @@ -193,8 +193,30 @@ void fill1D_rate(TH1* histo, const std::vector& values) { // break -void fill_hist(TH1* hist, const std::vector& array, const std::vector& weights) { +void fill_1Dhist(TH1* hist, const std::vector& array, const std::vector& weights) { + // FIXME: check sizes + + for (unsigned i =0; i < array.size(); ++i) + hist->Fill(array[i], weights[i]); +} + +void fill_1Dhist(TH1* hist, const std::vector& array) { + for (auto value: array) hist->Fill(value); } +void fill_2Dhist(TH2* hist, const std::vector& arrayX, const std::vector& arrayY, const std::vector& weights) { + // FIXME: check sizes + + for(unsigned i =0; i < arrayX.size(); ++i) { + hist->Fill(arrayX[i], arrayY[i], weights[i]); + } +} + +void fill_2Dhist(TH2* hist, const std::vector& arrayX, const std::vector& arrayY) { + // FIXME: check sizes + for(unsigned i =0; i < arrayX.size(); ++i) { + hist->Fill(arrayX[i], arrayY[i]); + } +} From 83bb6e88eabb4dad82739e235c1480ec8c56c79d Mon Sep 17 00:00:00 2001 From: Gianluca Date: Fri, 26 May 2023 15:51:32 +0200 Subject: [PATCH 05/18] Complete move to boost histos and remove lazy filling --- python/l1THistos.py | 794 +++++++++++++++++--------------------------- python/plotters.py | 63 +--- 2 files changed, 318 insertions(+), 539 deletions(-) diff --git a/python/l1THistos.py b/python/l1THistos.py index 6e2730e1..e9ec6a65 100644 --- a/python/l1THistos.py +++ b/python/l1THistos.py @@ -6,53 +6,11 @@ # import pandas as pd import uproot4 as up import awkward as ak -import hist -from hist import Hist import python.boost_hist as bh import python.pf_regions as pf_regions stuff = [] - -class HistoLazyFiller(object): - def __init__(self, dataframe): - self.df = dataframe - self.manager = ROOT.FillerManager() - self.columns = dataframe.fields - - def fill1d_lazy(self, histo, col_name, sel_name): - if not self.manager.knowsVariable(col_name): - # print (" - add variable {}".format(col_name)) - self.manager.addVariable(col_name, ak.flatten(self.df[col_name])) - - if not self.manager.knowsSelection(sel_name): - print("*** [HistoLazyFiller] ERROR: selection: {} not known!".format(sel_name)) - raise ValueError('[HistoLazyFiller] selection {} not known'.format(sel_name)) - - self.manager.add_1Dhisto(histo, col_name, sel_name) - - def fill2d_lazy(self, histo, x_col_name, y_col_name, sel_name): - if not self.manager.knowsVariable(x_col_name): - # print (" - add variable {}".format(col_name)) - self.manager.addVariable(x_col_name, ak.flatten(self.df[x_col_name])) - - if not self.manager.knowsVariable(y_col_name): - # print (" - add variable {}".format(col_name)) - self.manager.addVariable(y_col_name, ak.flatten(self.df[y_col_name])) - - if not self.manager.knowsSelection(sel_name): - print("*** [HistoLazyFiller] ERROR: selection: {} not known!".format(sel_name)) - raise ValueError('[HistoLazyFiller] selection {} not known'.format(sel_name)) - - self.manager.add_2Dhisto(histo, x_col_name, y_col_name, sel_name) - - def add_selection(self, sel_name, sel_values): - self.manager.addFilter(sel_name, sel_values) - - def fill(self): - self.manager.fill() - - class HistoManager(object): class __TheManager: def __init__(self): @@ -118,7 +76,7 @@ def __init__(self, name, root_file=None, debug=False): hm.addHistos(self) def write(self, upfile): - # pyroot_hist = ROOT.TH1F("h", "", 100, -3, 3) + # pyroot_hist = bh.TH1F("h", "", 100, -3, 3) # pyroot_hist.FillRandom("gaus", 100000) # upfile["from_pyroot"] = pyroot_hist @@ -146,55 +104,6 @@ def __repr__(self): return '<{} {}>'.format(self.__class__.__name__, self.name_) -class BaseBoostHistos(): - def __init__(self, name, root_file=None, debug=False): - self.name_ = name - # print name - # print self.__class__.__name__ - # # print 'BOOK histo: {}'.format(self) - if root_file is not None: - root_file.cd() - # print 'class: {}'.format(self.__class__.__name__) - # ROOT.gDirectory.pwd() - file_dir = root_file.GetDirectory(self.__class__.__name__) - # print '# keys in dir: {}'.format(len(file_dir.GetListOfKeys())) - # file_dir.cd() - selhistos = [(histo.ReadObj(), histo.GetName()) - for histo in file_dir.GetListOfKeys() - if histo.GetName().startswith(name+'_')] - if debug: - print(selhistos) - for hinst, histo_name in selhistos: - attr_name = 'h_'+histo_name.split(name+'_')[1] - setattr(self, attr_name, hinst) -# self.h_test = root_file.Get('h_EleReso_ptRes') - # print 'XXXXXX'+str(self.h_test) - else: - for histo in [a for a in dir(self) if a.startswith('h_')]: - getattr(self, histo).Sumw2() - hm = HistoManager() - hm.addHistos(self) - - def write(self): - if self.__class__.__name__ not in ROOT.gDirectory.GetListOfKeys(): - ROOT.gDirectory.mkdir(self.__class__.__name__) - newdir = ROOT.gDirectory.GetDirectory(self.__class__.__name__) - newdir.cd() - for histo in [a for a in dir(self) if a.startswith('h_')]: - # print ("Writing {}".format(histo)) - getattr(self, histo).Write("", ROOT.TObject.kOverwrite) - ROOT.gDirectory.cd('..') - - # def normalize(self, norm): - # className = self.__class__.__name__ - # ret = className() - # return ret - - def __repr__(self): - return '<{} {}>'.format(self.__class__.__name__, self.name_) - - - class GraphBuilder: def __init__(self, h_obj, h_name): self.h_obj = h_obj @@ -292,13 +201,13 @@ def write(self): class GenPartHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): - self.h_pt = ROOT.TH1F(name+'_pt', 'Gen Part Pt (GeV)', 100, 0, 100) - self.h_energy = ROOT.TH1F(name+'_energy', 'Gen Part Energy (GeV)', 100, 0, 1000) + self.h_pt = bh.TH1F(name+'_pt', 'Gen Part Pt (GeV)', 100, 0, 100) + self.h_energy = bh.TH1F(name+'_energy', 'Gen Part Energy (GeV)', 100, 0, 1000) BaseHistos.__init__(self, name, root_file, debug) def fill(self, gps): - rnp.fill_hist(self.h_pt, gps.pt) - rnp.fill_hist(self.h_energy, gps.energy) + bh.fill_1Dhist(self.h_pt, gps.pt) + bh.fill_1Dhist(self.h_energy, gps.energy) def write(self): for histo in [a for a in dir(self) if a.startswith('h_')]: @@ -321,9 +230,9 @@ def __init__(self, name, root_file=None, extended_range=False, debug=False): self.h_eta = bh.TH1F(name+'_eta', 'Gen Part eta; #eta^{GEN};', 50, -3, 3) self.h_abseta = bh.TH1F(name+'_abseta', 'Gen Part |eta|; |#eta^{GEN}|;', 40, 0, 4) # FIXME: address in hist migration - # self.h_pt = ROOT.TH1F(name+'_pt', 'Gen Part P_{T} (GeV); p_{T}^{GEN} [GeV];', n_pt_bins, array('d', pt_bins)) + # self.h_pt = bh.TH1F(name+'_pt', 'Gen Part P_{T} (GeV); p_{T}^{GEN} [GeV];', n_pt_bins, array('d', pt_bins)) self.h_pt = bh.TH1F(name+'_pt', 'Gen Part P_{T} (GeV); p_{T}^{GEN} [GeV];', 50, 0, 100) - # self.h_energy = ROOT.TH1F(name+'_energy', 'Gen Part Energy (GeV); E [GeV];', 100, 0, 1000) + # self.h_energy = bh.TH1F(name+'_energy', 'Gen Part Energy (GeV); E [GeV];', 100, 0, 1000) self.h_reachedEE = bh.TH1F(name+'_reachedEE', 'Gen Part reachedEE', 4, 0, 4) self.h_fBrem = bh.TH1F(name+'_fBrem', 'Brem. p_{T} fraction', 30, 0, 1) @@ -349,36 +258,24 @@ def fill(self, particles): array=particles.fbrem) - - - - def fill_lazy(self, filler, sel_name): - filler.fill1d_lazy(self.h_eta, 'eta', sel_name) - filler.fill1d_lazy(self.h_abseta, 'abseta', sel_name) - filler.fill1d_lazy(self.h_pt, 'pt', sel_name) - # filler.fill1d_lazy(self.h_energy, 'energy', sel_name) - filler.fill1d_lazy(self.h_reachedEE, 'reachedEE', sel_name) - filler.fill1d_lazy(self.h_fBrem, 'fbrem', sel_name) - - class DigiHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_layer = ROOT.TH1F(name+'_layer', 'Digi layer #', 60, 0, 60) - # self.h_simenergy = ROOT.TH1F(name+'_energy', 'Digi sim-energy (GeV)', 100, 0, 2) + self.h_layer = bh.TH1F(name+'_layer', 'Digi layer #', 60, 0, 60) + # self.h_simenergy = bh.TH1F(name+'_energy', 'Digi sim-energy (GeV)', 100, 0, 2) BaseHistos.__init__(self, name, root_file, debug) def fill(self, digis): - rnp.fill_hist(self.h_layer, digis.layer) + bh.fill_1Dhist(self.h_layer, digis.layer) # rnp.fill_hist(self.h_simenergy, digis.simenergy) class RateHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_norm = ROOT.TH1F(name+'_norm', '# of events', 1, 1, 2) - self.h_pt = ROOT.TH1F(name+'_pt', 'rate above p_{T} thresh.; p_{T} [GeV]; rate [kHz];', 100, 0, 100) - self.h_ptVabseta = ROOT.TH2F(name+'_ptVabseta', 'Candidate p_{T} vs |#eta|; |#eta|; p_{T} [GeV];', 34, 1.4, 3.1, 100, 0, 100) + self.h_norm = bh.TH1F(name+'_norm', '# of events', 1, 1, 2) + self.h_pt = bh.TH1F(name+'_pt', 'rate above p_{T} thresh.; p_{T} [GeV]; rate [kHz];', 100, 0, 100) + self.h_ptVabseta = bh.TH2F(name+'_ptVabseta', 'Candidate p_{T} vs |#eta|; |#eta|; p_{T} [GeV];', 34, 1.4, 3.1, 100, 0, 100) BaseHistos.__init__(self, name, root_file, debug) @@ -388,7 +285,7 @@ def __init__(self, name, root_file=None, debug=False): if root_file is not None: self.normalize(31000) - # self.h_simenergy = ROOT.TH1F(name+'_energy', 'Digi sim-energy (GeV)', 100, 0, 2) + # self.h_simenergy = bh.TH1F(name+'_energy', 'Digi sim-energy (GeV)', 100, 0, 2) def fill(self, pt, eta): for ptf in range(0, int(pt)+1): @@ -421,8 +318,8 @@ def fill_many(self, data): class RateHistoCounter(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_norm = ROOT.TH1F(name+'_norm', '# of events', 1, 1, 2) - self.h_rate = ROOT.TH1F(name+'_rate', '# passing events; rate [kHz];', 1, 1, 2) + self.h_norm = bh.TH1F(name+'_norm', '# of events', 1, 1, 2) + self.h_rate = bh.TH1F(name+'_rate', '# passing events; rate [kHz];', 1, 1, 2) BaseHistos.__init__(self, name, root_file, debug) @@ -432,7 +329,7 @@ def __init__(self, name, root_file=None, debug=False): if root_file is not None: self.normalize(31000) - # self.h_simenergy = ROOT.TH1F(name+'_energy', 'Digi sim-energy (GeV)', 100, 0, 2) + # self.h_simenergy = bh.TH1F(name+'_energy', 'Digi sim-energy (GeV)', 100, 0, 2) def fill(self, count): self.h_rate.Fill(1, count) @@ -477,19 +374,19 @@ def fill(self, df): class TCHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_energy = ROOT.TH1F(name+'_energy', 'TC energy (GeV)', 100, 0, 2) - self.h_subdet = ROOT.TH1F(name+'_subdet', 'TC subdet #', 8, 0, 8) - self.h_mipPt = ROOT.TH1F(name+'_mipPt', 'TC MIP Pt', 50, 0, 10) + self.h_energy = bh.TH1F(name+'_energy', 'TC energy (GeV)', 100, 0, 2) + self.h_subdet = bh.TH1F(name+'_subdet', 'TC subdet #', 8, 0, 8) + self.h_mipPt = bh.TH1F(name+'_mipPt', 'TC MIP Pt', 50, 0, 10) self.h_layer = ROOT.TProfile(name+'_layer', 'TC layer #', 60, 0, 60, 's') - self.h_absz = ROOT.TH1F(name+'_absz', 'TC z(cm)', 100, 300, 500) - self.h_wafertype = ROOT.TH1F(name+'_wafertype', 'Wafer type', 10, 0, 10) - self.h_layerVenergy = ROOT.TH2F(name+'_layerVenergy', "Energy (GeV) vs Layer #", 60, 0, 60, 100, 0, 2) - self.h_energyVeta = ROOT.TH2F(name+'_energyVeta', "Energy (GeV) vs Eta", 100, -3.5, 3.5, 100, 0, 2) - # self.h_energyVetaL1t5 = ROOT.TH2F(name+'_energyVetaL1t5', "Energy (GeV) vs Eta (layers 1 to 5)", 100, -3.5, 3.5, 100, 0, 2) - # self.h_energyVetaL6t10 = ROOT.TH2F(name+'_energyVetaL6t10', "Energy (GeV) vs Eta (layers 6 to 10)", 100, -3.5, 3.5, 100, 0, 2) - # self.h_energyVetaL11t20 = ROOT.TH2F(name+'_energyVetaL11t20', "Energy (GeV) vs Eta (layers 11 to 20)", 100, -3.5, 3.5, 100, 0, 2) - # self.h_energyVetaL21t60 = ROOT.TH2F(name+'_energyVetaL21t60', "Energy (GeV) vs Eta (layers 21 to 60)", 100, -3.5, 3.5, 100, 0, 2) + self.h_absz = bh.TH1F(name+'_absz', 'TC z(cm)', 100, 300, 500) + self.h_wafertype = bh.TH1F(name+'_wafertype', 'Wafer type', 10, 0, 10) + self.h_layerVenergy = bh.TH2F(name+'_layerVenergy', "Energy (GeV) vs Layer #", 60, 0, 60, 100, 0, 2) + self.h_energyVeta = bh.TH2F(name+'_energyVeta', "Energy (GeV) vs Eta", 100, -3.5, 3.5, 100, 0, 2) + # self.h_energyVetaL1t5 = bh.TH2F(name+'_energyVetaL1t5', "Energy (GeV) vs Eta (layers 1 to 5)", 100, -3.5, 3.5, 100, 0, 2) + # self.h_energyVetaL6t10 = bh.TH2F(name+'_energyVetaL6t10', "Energy (GeV) vs Eta (layers 6 to 10)", 100, -3.5, 3.5, 100, 0, 2) + # self.h_energyVetaL11t20 = bh.TH2F(name+'_energyVetaL11t20', "Energy (GeV) vs Eta (layers 11 to 20)", 100, -3.5, 3.5, 100, 0, 2) + # self.h_energyVetaL21t60 = bh.TH2F(name+'_energyVetaL21t60', "Energy (GeV) vs Eta (layers 21 to 60)", 100, -3.5, 3.5, 100, 0, 2) self.h_energyPetaVphi = ROOT.TProfile2D(name+'_energyPetaVphi', "Energy profile (GeV) vs Eta and Phi", 100, -3.5, 3.5, 100, -3.2, 3.2) BaseHistos.__init__(self, name, root_file, debug) @@ -518,14 +415,14 @@ def fill(self, tcs): class ClusterHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_energy = ROOT.TH1F(name+'_energy', 'Cluster energy (GeV); E [GeV];', 100, 0, 30) - self.h_layer = ROOT.TH1F(name+'_layer', 'Cluster layer #; layer #;', 60, 0, 60) - # self.h_nCoreCells = ROOT.TH1F(name+'_nCoreCells', 'Cluster # cells (core)', 30, 0, 30) + self.h_energy = bh.TH1F(name+'_energy', 'Cluster energy (GeV); E [GeV];', 100, 0, 30) + self.h_layer = bh.TH1F(name+'_layer', 'Cluster layer #; layer #;', 60, 0, 60) + # self.h_nCoreCells = bh.TH1F(name+'_nCoreCells', 'Cluster # cells (core)', 30, 0, 30) - self.h_layerVenergy = ROOT.TH2F(name+'_layerVenergy', "Cluster Energy (GeV) vs Layer #; layer; E [GeV];", 50, 0, 50, 100, 0, 20) - self.h_ncells = ROOT.TH1F(name+'_ncells', 'Cluster # cells; # TC components;', 30, 0, 30) - self.h_layerVncells = ROOT.TH2F(name+'_layerVncells', "Cluster #cells vs Layer #; layer; # TC components;", 50, 0, 50, 30, 0, 30) - # self.h_layerVnCoreCells = ROOT.TH2F(name+'_layerVnCoreCells', "Cluster #cells vs Layer #", 50, 0, 50, 30, 0, 30) + self.h_layerVenergy = bh.TH2F(name+'_layerVenergy', "Cluster Energy (GeV) vs Layer #; layer; E [GeV];", 50, 0, 50, 100, 0, 20) + self.h_ncells = bh.TH1F(name+'_ncells', 'Cluster # cells; # TC components;', 30, 0, 30) + self.h_layerVncells = bh.TH2F(name+'_layerVncells', "Cluster #cells vs Layer #; layer; # TC components;", 50, 0, 50, 30, 0, 30) + # self.h_layerVnCoreCells = bh.TH2F(name+'_layerVnCoreCells', "Cluster #cells vs Layer #", 50, 0, 50, 30, 0, 30) BaseHistos.__init__(self, name, root_file, debug) @@ -544,30 +441,30 @@ def fill(self, clsts): class Cluster3DHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - # self.h_npt05 = ROOT.TH1F( + # self.h_npt05 = bh.TH1F( # name+'_npt05', '# 3D Cluster Pt > 0.5 GeV; # 3D clusters in cone;', 1000, 0, 1000) - # self.h_npt20 = ROOT.TH1F( + # self.h_npt20 = bh.TH1F( # name+'_npt20', '# 3D Cluster Pt > 2.0 GeV; # 3D clusters in cone;', 1000, 0, 1000) - self.h_pt = ROOT.TH1F( + self.h_pt = bh.TH1F( name+'_pt', '3D Cluster Pt (GeV); p_{T} [GeV]', 100, 0, 100) - self.h_eta = ROOT.TH1F(name+'_eta', '3D Cluster eta; #eta;', 100, -4, 4) - # self.h_energy = ROOT.TH1F(name+'_energy', '3D Cluster energy (GeV); E [GeV]', 1000, 0, 1000) - # self.h_nclu = ROOT.TH1F(name+'_nclu', '3D Cluster # clusters; # 2D components;', 60, 0, 60) - # self.h_ncluVpt = ROOT.TH2F(name+'_ncluVpt', '3D Cluster # clusters vs pt; # 2D components; p_{T} [GeV]', 60, 0, 60, 100, 0, 100) - # self.h_showlenght = ROOT.TH1F(name+'_showlenght', '3D Cluster showerlenght', 60, 0, 60) - # self.h_firstlayer = ROOT.TH1F(name+'_firstlayer', '3D Cluster first layer', 30, 0, 30) - # self.h_sEtaEtaTot = ROOT.TH1F(name+'_sEtaEtaTot', '3D Cluster RMS Eta', 100, 0, 0.1) - # self.h_sEtaEtaMax = ROOT.TH1F(name+'_sEtaEtaMax', '3D Cluster RMS Eta (max)', 100, 0, 0.1) - # self.h_sPhiPhiTot = ROOT.TH1F(name+'_sPhiPhiTot', '3D Cluster RMS Phi', 100, 0, 2) - # self.h_sPhiPhiMax = ROOT.TH1F(name+'_sPhiPhiMax', '3D Cluster RMS Phi (max)', 100, 0, 2) - # self.h_sZZ = ROOT.TH1F(name+'_sZZ', '3D Cluster RMS Z ???', 100, 0, 10) - # self.h_eMaxOverE = ROOT.TH1F(name+'_eMaxOverE', '3D Cluster Emax/E', 100, 0, 1) - # self.h_HoE = ROOT.TH1F(name+'_HoE', '3D Cluster H/E', 20, 0, 2) - # self.h_iso0p2 = ROOT.TH1F(name+'_iso0p2', '3D Cluster iso DR 0.2(GeV); Iso p_{T} [GeV];', 100, 0, 100) - # self.h_isoRel0p2 = ROOT.TH1F(name+'_isoRel0p2', '3D Cluster relative iso DR 0.2; Rel. Iso;', 100, 0, 1) - # self.h_bdtPU = ROOT.TH1F(name+'_bdtPU', '3D Cluster bdt PU out; BDT-PU out;', 100, -1, 1) - # self.h_bdtPi = ROOT.TH1F(name+'_bdtPi', '3D Cluster bdt Pi out; BDT-Pi out;', 100, -1, 1) - self.h_bdtEg = ROOT.TH1F(name+'_bdtEg', '3D Cluster bdt Pi out; BDT-EG out;', 100, -1, 1) + self.h_eta = bh.TH1F(name+'_eta', '3D Cluster eta; #eta;', 100, -4, 4) + # self.h_energy = bh.TH1F(name+'_energy', '3D Cluster energy (GeV); E [GeV]', 1000, 0, 1000) + # self.h_nclu = bh.TH1F(name+'_nclu', '3D Cluster # clusters; # 2D components;', 60, 0, 60) + # self.h_ncluVpt = bh.TH2F(name+'_ncluVpt', '3D Cluster # clusters vs pt; # 2D components; p_{T} [GeV]', 60, 0, 60, 100, 0, 100) + # self.h_showlenght = bh.TH1F(name+'_showlenght', '3D Cluster showerlenght', 60, 0, 60) + # self.h_firstlayer = bh.TH1F(name+'_firstlayer', '3D Cluster first layer', 30, 0, 30) + # self.h_sEtaEtaTot = bh.TH1F(name+'_sEtaEtaTot', '3D Cluster RMS Eta', 100, 0, 0.1) + # self.h_sEtaEtaMax = bh.TH1F(name+'_sEtaEtaMax', '3D Cluster RMS Eta (max)', 100, 0, 0.1) + # self.h_sPhiPhiTot = bh.TH1F(name+'_sPhiPhiTot', '3D Cluster RMS Phi', 100, 0, 2) + # self.h_sPhiPhiMax = bh.TH1F(name+'_sPhiPhiMax', '3D Cluster RMS Phi (max)', 100, 0, 2) + # self.h_sZZ = bh.TH1F(name+'_sZZ', '3D Cluster RMS Z ???', 100, 0, 10) + # self.h_eMaxOverE = bh.TH1F(name+'_eMaxOverE', '3D Cluster Emax/E', 100, 0, 1) + # self.h_HoE = bh.TH1F(name+'_HoE', '3D Cluster H/E', 20, 0, 2) + # self.h_iso0p2 = bh.TH1F(name+'_iso0p2', '3D Cluster iso DR 0.2(GeV); Iso p_{T} [GeV];', 100, 0, 100) + # self.h_isoRel0p2 = bh.TH1F(name+'_isoRel0p2', '3D Cluster relative iso DR 0.2; Rel. Iso;', 100, 0, 1) + # self.h_bdtPU = bh.TH1F(name+'_bdtPU', '3D Cluster bdt PU out; BDT-PU out;', 100, -1, 1) + # self.h_bdtPi = bh.TH1F(name+'_bdtPi', '3D Cluster bdt Pi out; BDT-Pi out;', 100, -1, 1) + self.h_bdtEg = bh.TH1F(name+'_bdtEg', '3D Cluster bdt Pi out; BDT-EG out;', 100, -1, 1) BaseHistos.__init__(self, name, root_file, debug) @@ -575,55 +472,28 @@ def fill(self, cl3ds): # self.h_npt05.Fill(len(cl3ds[cl3ds.pt > 0.5].index)) # self.h_npt20.Fill(len(cl3ds[cl3ds.pt > 2.0].index)) - rnp.fill_hist(self.h_pt, cl3ds.pt) - rnp.fill_hist(self.h_eta, cl3ds.eta) - # rnp.fill_hist(self.h_energy, cl3ds.energy) - # rnp.fill_hist(self.h_nclu, cl3ds.nclu) - # rnp.fill_hist(self.h_ncluVpt, cl3ds[['nclu', 'pt']]) - # rnp.fill_hist(self.h_showlenght, cl3ds.showerlength) - # rnp.fill_hist(self.h_firstlayer, cl3ds.firstlayer) - # rnp.fill_hist(self.h_sEtaEtaTot, cl3ds.seetot) - # rnp.fill_hist(self.h_sEtaEtaMax, cl3ds.seemax) - # rnp.fill_hist(self.h_sPhiPhiTot, cl3ds.spptot) - # rnp.fill_hist(self.h_sPhiPhiMax, cl3ds.sppmax) - # rnp.fill_hist(self.h_sZZ, cl3ds.szz) - # rnp.fill_hist(self.h_eMaxOverE, cl3ds.emaxe) - # rnp.fill_hist(self.h_HoE, cl3ds.hoe) - # if 'iso0p2' in cl3ds.columns: - # rnp.fill_hist(self.h_iso0p2, cl3ds.iso0p2) - # rnp.fill_hist(self.h_isoRel0p2, cl3ds.isoRel0p2) - # if 'bdt_pu' in cl3ds.columns: - # rnp.fill_hist(self.h_bdtPU, cl3ds.bdt_pu) - # if 'bdt_pi' in cl3ds.columns: - # rnp.fill_hist(self.h_bdtPi, cl3ds.bdt_pi) - rnp.fill_hist(self.h_bdtEg, cl3ds.bdteg) - - def fill_lazy(self, filler, sel_name): - # self.h_npt05.Fill(len(cl3ds[cl3ds.pt > 0.5].index)) - # self.h_npt20.Fill(len(cl3ds[cl3ds.pt > 2.0].index)) - - filler.fill1d_lazy(self.h_pt, 'pt', sel_name) - filler.fill1d_lazy(self.h_eta, 'eta', sel_name) - # filler.fill1d_lazy(self.h_energy, 'energy', sel_name) - # filler.fill1d_lazy(self.h_nclu, 'nclu', sel_name) - # # filler.fill2d_lazy(self.h_ncluVpt, cl3ds[['nclu', 'pt']], sel_name) - # filler.fill1d_lazy(self.h_showlenght, 'showerlength', sel_name) - # filler.fill1d_lazy(self.h_firstlayer, 'firstlayer', sel_name) - # filler.fill1d_lazy(self.h_sEtaEtaTot, 'seetot', sel_name) - # filler.fill1d_lazy(self.h_sEtaEtaMax, 'seemax', sel_name) - # filler.fill1d_lazy(self.h_sPhiPhiTot, 'spptot', sel_name) - # filler.fill1d_lazy(self.h_sPhiPhiMax, 'sppmax', sel_name) - # filler.fill1d_lazy(self.h_sZZ, 'szz', sel_name) - # filler.fill1d_lazy(self.h_eMaxOverE, 'emaxe', sel_name) - # filler.fill1d_lazy(self.h_HoE, 'hoe', sel_name) - # if 'iso0p2' in filler.columns: - # filler.fill1d_lazy(self.h_iso0p2, 'iso0p2', sel_name) - # filler.fill1d_lazy(self.h_isoRel0p2, 'isoRel0p2', sel_name) - # if 'bdt_pu' in filler.columns: - # filler.fill1d_lazy(self.h_bdtPU, 'bdt_pu', sel_name) - # if 'bdt_pi' in filler.columns: - # filler.fill1d_lazy(self.h_bdtPi, 'bdt_pi', sel_name) - filler.fill1d_lazy(self.h_bdtEg, 'bdteg', sel_name) + bh.fill_1Dhist(self.h_pt, cl3ds.pt) + bh.fill_1Dhist(self.h_eta, cl3ds.eta) + # bh.fill_1Dhist(self.h_energy, cl3ds.energy) + # bh.fill_1Dhist(self.h_nclu, cl3ds.nclu) + # bh.fill_2Dhist(self.h_ncluVpt, cl3ds[['nclu', 'pt']]) + # bh.fill_1Dhist(self.h_showlenght, cl3ds.showerlength) + # bh.fill_1Dhist(self.h_firstlayer, cl3ds.firstlayer) + # bh.fill_1Dhist(self.h_sEtaEtaTot, cl3ds.seetot) + # bh.fill_1Dhist(self.h_sEtaEtaMax, cl3ds.seemax) + # bh.fill_1Dhist(self.h_sPhiPhiTot, cl3ds.spptot) + # bh.fill_1Dhist(self.h_sPhiPhiMax, cl3ds.sppmax) + # bh.fill_1Dhist(self.h_sZZ, cl3ds.szz) + # bh.fill_1Dhist(self.h_eMaxOverE, cl3ds.emaxe) + # bh.fill_1Dhist(self.h_HoE, cl3ds.hoe) + # if 'iso0p2' in cl3ds.fields: + # bh.fill_1Dhist(self.h_iso0p2, cl3ds.iso0p2) + # bh.fill_1Dhist(self.h_isoRel0p2, cl3ds.isoRel0p2) + # if 'bdt_pu' in cl3ds.fields: + # bh.fill_1Dhist(self.h_bdtPU, cl3ds.bdt_pu) + # if 'bdt_pi' in cl3ds.fields: + # bh.fill_1Dhist(self.h_bdtPi, cl3ds.bdt_pi) + bh.fill_1Dhist(self.h_bdtEg, cl3ds.bdteg) class EGHistos(BaseHistos): @@ -660,20 +530,6 @@ def fill(self, egs): if 'compBDTScore' in egs.fields: bh.fill_1Dhist(hist=self.h_compBdt, array=egs.compBDTScore, weights=weight) - def fill_lazy(self, filler, sel_name): - filler.fill1d_lazy(self.h_pt, 'pt', sel_name) - filler.fill1d_lazy(self.h_eta, 'eta', sel_name) - filler.fill1d_lazy(self.h_energy, 'energy', sel_name) - filler.fill1d_lazy(self.h_hwQual, 'hwQual', sel_name) - if 'tkIso' in filler.columns: - filler.fill1d_lazy(self.h_tkIso, 'tkIso', sel_name) - filler.fill1d_lazy(self.h_pfIso, 'pfIso', sel_name) - if 'tkIsoPV' in filler.columns: - filler.fill1d_lazy(self.h_tkIsoPV, 'tkIsoPV', sel_name) - filler.fill1d_lazy(self.h_pfIsoPV, 'pfIsoPV', sel_name) - if 'compBDTScore' in filler.columns: - filler.fill1d_lazy(self.h_compBdt, 'compBDTScore', sel_name) - # FIXME: [FIXME-AK] implement this in the normal fill # def fill_event(self, objects): # print(objects.pt) @@ -684,83 +540,83 @@ def add_histos(self): self.h_eta.Add(self.h_eta_temp.GetValue()) self.h_energy.Add(self.h_energy_temp.GetValue()) self.h_hwQual.Add(self.h_hwQual_temp.GetValue()) - # self.h_tkIso = ROOT.TH1F(name+'_tkIso', 'Iso; rel-iso_{tk}', 100, 0, 2) - # self.h_pfIso = ROOT.TH1F(name+'_pfIso', 'Iso; rel-iso_{pf}', 100, 0, 2) - # self.h_tkIsoPV = ROOT.TH1F(name+'_tkIsoPV', 'Iso; rel-iso^{PV}_{tk}', 100, 0, 2) - # self.h_pfIsoPV = ROOT.TH1F(name+'_pfIsoPV', 'Iso; rel-iso^{PV}_{pf}', 100, 0, 2) + # self.h_tkIso = bh.TH1F(name+'_tkIso', 'Iso; rel-iso_{tk}', 100, 0, 2) + # self.h_pfIso = bh.TH1F(name+'_pfIso', 'Iso; rel-iso_{pf}', 100, 0, 2) + # self.h_tkIsoPV = bh.TH1F(name+'_tkIsoPV', 'Iso; rel-iso^{PV}_{tk}', 100, 0, 2) + # self.h_pfIsoPV = bh.TH1F(name+'_pfIsoPV', 'Iso; rel-iso^{PV}_{pf}', 100, 0, 2) class DecTkHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_pt = ROOT.TH1F( + self.h_pt = bh.TH1F( name+'_pt', 'Pt (GeV); p_{T} [GeV]', 100, 0, 100) - self.h_deltaPt = ROOT.TH1F( + self.h_deltaPt = bh.TH1F( name+'_deltaPt', 'Pt (GeV); p_{T}^{decoded}-p_{T}^{float} [GeV]', 100, -10, 10) - self.h_deltaPtVeta = ROOT.TH2F( + self.h_deltaPtVeta = bh.TH2F( name+'_deltaPtVeta', 'Pt (GeV); #eta^{float}; p_{T}^{decoded}-p_{T}^{float} [GeV]', 50, -2.5, 2.5, 50, -0.25, 0.25) - self.h_deltaPtVabseta = ROOT.TH2F( + self.h_deltaPtVabseta = bh.TH2F( name+'_deltaPtVabseta', 'Pt (GeV); |#eta^{float}|; p_{T}^{decoded}-p_{T}^{float} [GeV]', 50, 0, 2.5, 50, -0.25, 0.25) - self.h_eta = ROOT.TH1F( + self.h_eta = bh.TH1F( name+'_eta', '#eta; #eta;', 100, -4, 4) - self.h_z0 = ROOT.TH1F( + self.h_z0 = bh.TH1F( name+'_z0', 'z0; z_{0} [cm];', 100, -10, 10) - self.h_deltaZ0 = ROOT.TH1F( + self.h_deltaZ0 = bh.TH1F( name+'_deltaZ0', '#Delta z0; z0^{decoded}-z0^{float};', 50, -0.2, 0.2) - self.h_deltaZ0Veta = ROOT.TH2F( + self.h_deltaZ0Veta = bh.TH2F( name+'_deltaZ0Veta', '#Delta z0; #eta^{float}; z0^{decoded}-z0^{float};', 100, -2.5, 2.5, 50, -0.05, 0.05) - self.h_deltaEta = ROOT.TH1F( + self.h_deltaEta = bh.TH1F( name+'_deltaEta', '#Delta #eta_{@vtx}; #eta_{@vtx}^{decoded}-#eta_{@vtx}^{float};', 100, -1, 1) - self.h_deltaEtaVabseta = ROOT.TH2F( + self.h_deltaEtaVabseta = bh.TH2F( name+'_deltaEtaVabseta', '#Delta #eta_{@vtx} vs |#eta^{float}|; |#eta^{float}|; #eta_{@vtx}^{decoded}-#eta_{@vtx}^{float};', 25, 0, 2.5, 100, -0.004, 0.004) - self.h_deltaEtaVeta = ROOT.TH2F( + self.h_deltaEtaVeta = bh.TH2F( name+'_deltaEtaVeta', '#Delta #eta_{@vtx} vs #eta^{float}; #eta^{float}; #eta_{@vtx}^{decoded}-#eta_{@vtx}^{float};', 50, -2.5, 2.5, 50, -0.004, 0.004) - self.h_deltaCaloEta = ROOT.TH1F( + self.h_deltaCaloEta = bh.TH1F( name+'_deltaCaloEta', '#Delta #eta_{@calo}; #eta_{@calo}^{decoded}-#eta_{@calo}^{float};', 100, -1, 1) - self.h_deltaCaloEtaVabseta = ROOT.TH2F( + self.h_deltaCaloEtaVabseta = bh.TH2F( name+'_deltaCaloEtaVabseta', '#Delta #eta_{@calo} vs |#eta^{float}|; |#eta^{float}|; #eta_{@calo}^{decoded}-#eta_{@calo}^{float};', 50, 0, 2.5, 100, -0.04, 0.04) - self.h_deltaCaloEtaVeta = ROOT.TH2F( + self.h_deltaCaloEtaVeta = bh.TH2F( name+'_deltaCaloEtaVeta', '#Delta #eta_{@calo} vs #eta^{float}; #eta^{float}; #eta_{@calo}^{decoded}-#eta_{@calo}^{float};', 100, -2.5, 2.5, 100, -0.04, 0.04) - self.h_deltaCaloPhi = ROOT.TH1F( + self.h_deltaCaloPhi = bh.TH1F( name+'_deltaCaloPhi', '#Delta #phi_{@calo}; #phi_{@calo}^{decoded}-#phi_{@calo}^{float};', 100, -1, 1) - self.h_deltaCaloPhiVabseta = ROOT.TH2F( + self.h_deltaCaloPhiVabseta = bh.TH2F( name+'_deltaCaloPhiVabseta', '#Delta #phi_{@calo} vs |#eta^{float}|; |#phi^{float}|; #phi_{@calo}^{decoded}-#phi_{@calo}^{float};', 100, 0, 2.5, @@ -769,127 +625,102 @@ def __init__(self, name, root_file=None, debug=False): BaseHistos.__init__(self, name, root_file, debug) def fill(self, egs): - pass - - def fill_lazy(self, filler, sel_name): - filler.fill1d_lazy(self.h_pt, 'pt', sel_name) - filler.fill1d_lazy(self.h_deltaPt, 'deltaPt', sel_name) - filler.fill2d_lazy(self.h_deltaPtVeta, 'simeta', 'deltaPt', sel_name) - filler.fill2d_lazy(self.h_deltaPtVabseta, 'simabseta', 'deltaPt', sel_name) - filler.fill1d_lazy(self.h_eta, 'eta', sel_name) - filler.fill1d_lazy(self.h_z0, 'z0', sel_name) - filler.fill1d_lazy(self.h_deltaZ0, 'deltaZ0', sel_name) - filler.fill2d_lazy(self.h_deltaZ0Veta, 'simeta', 'deltaZ0', sel_name) - filler.fill1d_lazy(self.h_deltaEta, 'deltaEta', sel_name) - filler.fill2d_lazy(self.h_deltaEtaVabseta, 'simabseta', 'deltaEta', sel_name) - filler.fill2d_lazy(self.h_deltaEtaVeta, 'simeta', 'deltaEta', sel_name) - filler.fill1d_lazy(self.h_deltaCaloEta, 'deltaCaloEta', sel_name) - filler.fill2d_lazy(self.h_deltaCaloEtaVabseta, 'simabseta', 'deltaCaloEta', sel_name) - filler.fill2d_lazy(self.h_deltaCaloEtaVeta, 'simeta', 'deltaCaloEta', sel_name) - filler.fill1d_lazy(self.h_deltaCaloPhi, 'deltaCaloPhi', sel_name) - filler.fill2d_lazy(self.h_deltaCaloPhiVabseta, 'simabseta', 'deltaCaloPhi', sel_name) + bh.fill_1Dhist(self.h_pt, egs.pt) + bh.fill_1Dhist(self.h_deltaPt, egs.deltaPt) + bh.fill_2Dhist(self.h_deltaPtVeta, egs.simeta, egs.deltaPt) + bh.fill_2Dhist(self.h_deltaPtVabseta, egs.simabseta, egs.deltaPt) + bh.fill_1Dhist(self.h_eta, egs.eta) + bh.fill_1Dhist(self.h_z0, egs.z0) + bh.fill_1Dhist(self.h_deltaZ0, egs.deltaZ0) + bh.fill_2Dhist(self.h_deltaZ0Veta, egs.simeta, egs.deltaZ0) + bh.fill_1Dhist(self.h_deltaEta, egs.deltaEta) + bh.fill_2Dhist(self.h_deltaEtaVabseta, egs.simabseta, egs.deltaEta) + bh.fill_2Dhist(self.h_deltaEtaVeta, egs.simeta, egs.deltaEta) + bh.fill_1Dhist(self.h_deltaCaloEta, egs.deltaCaloEta) + bh.fill_2Dhist(self.h_deltaCaloEtaVabseta, egs.simabseta, egs.deltaCaloEta) + bh.fill_2Dhist(self.h_deltaCaloEtaVeta, egs.simeta, egs.deltaCaloEta) + bh.fill_1Dhist(self.h_deltaCaloPhi, egs.deltaCaloPhi) + bh.fill_2Dhist(self.h_deltaCaloPhiVabseta, egs.simabseta, egs.deltaCaloPhi) class TkEleHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_pt = ROOT.TH1F(name+'_pt', 'Pt (GeV); p_{T} [GeV]', 100, 0, 100) - self.h_eta = ROOT.TH1F(name+'_eta', 'eta; #eta;', 100, -2.5, 2.5) - self.h_energy = ROOT.TH1F(name+'_energy', 'energy (GeV); E [GeV]', 1000, 0, 1000) - self.h_hwQual = ROOT.TH1F(name+'_hwQual', 'quality; hwQual', 10, 0, 10) - self.h_tkpt = ROOT.TH1F(name+'_tkpt', 'Tk Pt (GeV); p_{T}^{L1Tk} [GeV]', 100, 0, 100) - self.h_dpt = ROOT.TH1F(name+'_dpt', 'Delta Tk Pt (GeV); #Delta p_{T}^{L1Tk-Calo} [GeV]', 100, -50, 50) - self.h_tkchi2 = ROOT.TH1F(name+'_tkchi2', 'Tk chi2; #Chi^{2}', 1000, 0, 1000) - self.h_ptVtkpt = ROOT.TH2F(name+'_ptVtkpt', 'TkEG Pt (GeV) vs TkPt; p_{T}^{Tk} [GeV]; p_{T}^{EG} [GeV]', 100, 0, 100, 100, 0, 100) - self.h_tkIso = ROOT.TH1F(name+'_tkIso', 'Iso; rel-iso_{tk}', 100, 0, 2) - self.h_pfIso = ROOT.TH1F(name+'_pfIso', 'Iso; rel-iso_{pf}', 100, 0, 2) + self.h_pt = bh.TH1F(name+'_pt', 'Pt (GeV); p_{T} [GeV]', 100, 0, 100) + self.h_eta = bh.TH1F(name+'_eta', 'eta; #eta;', 100, -2.5, 2.5) + self.h_energy = bh.TH1F(name+'_energy', 'energy (GeV); E [GeV]', 1000, 0, 1000) + self.h_hwQual = bh.TH1F(name+'_hwQual', 'quality; hwQual', 10, 0, 10) + self.h_tkpt = bh.TH1F(name+'_tkpt', 'Tk Pt (GeV); p_{T}^{L1Tk} [GeV]', 100, 0, 100) + self.h_dpt = bh.TH1F(name+'_dpt', 'Delta Tk Pt (GeV); #Delta p_{T}^{L1Tk-Calo} [GeV]', 100, -50, 50) + self.h_tkchi2 = bh.TH1F(name+'_tkchi2', 'Tk chi2; #Chi^{2}', 1000, 0, 1000) + self.h_ptVtkpt = bh.TH2F(name+'_ptVtkpt', 'TkEG Pt (GeV) vs TkPt; p_{T}^{Tk} [GeV]; p_{T}^{EG} [GeV]', 100, 0, 100, 100, 0, 100) + self.h_tkIso = bh.TH1F(name+'_tkIso', 'Iso; rel-iso_{tk}', 100, 0, 2) + self.h_pfIso = bh.TH1F(name+'_pfIso', 'Iso; rel-iso_{pf}', 100, 0, 2) BaseHistos.__init__(self, name, root_file, debug) def fill(self, tkegs): - rnp.fill_hist(self.h_pt, tkegs.pt) - rnp.fill_hist(self.h_eta, tkegs.eta) - rnp.fill_hist(self.h_energy, tkegs.energy) - rnp.fill_hist(self.h_hwQual, tkegs.hwQual) - rnp.fill_hist(self.h_tkpt, tkegs.tkPt) - rnp.fill_hist(self.h_dpt, tkegs.dpt) - rnp.fill_hist(self.h_tkchi2, tkegs.tkChi2) - # rnp.fill_hist(self.h_ptVtkpt, tkegs[['tkPt', 'pt']]) - if 'tkIso' in tkegs.columns: - rnp.fill_hist(self.h_tkIso, tkegs.tkIso) - rnp.fill_hist(self.h_pfIso, tkegs.pfIso) - - def fill_lazy(self, filler, sel_name): - filler.fill1d_lazy(self.h_pt, 'pt', sel_name) - filler.fill1d_lazy(self.h_eta, 'eta', sel_name) - filler.fill1d_lazy(self.h_energy, 'energy', sel_name) - filler.fill1d_lazy(self.h_hwQual, 'hwQual', sel_name) - filler.fill1d_lazy(self.h_tkpt, 'tkPt', sel_name) - filler.fill1d_lazy(self.h_dpt, 'dpt', sel_name) - filler.fill1d_lazy(self.h_tkchi2, 'tkChi2', sel_name) - filler.fill1d_lazy(self.h_tkIso, 'tkIso', sel_name) - filler.fill1d_lazy(self.h_pfIso, 'pfIso', sel_name) + bh.fill_1Dhist(self.h_pt, tkegs.pt) + bh.fill_1Dhist(self.h_eta, tkegs.eta) + bh.fill_1Dhist(self.h_energy, tkegs.energy) + bh.fill_1Dhist(self.h_hwQual, tkegs.hwQual) + bh.fill_1Dhist(self.h_tkpt, tkegs.tkPt) + bh.fill_1Dhist(self.h_dpt, tkegs.dpt) + bh.fill_1Dhist(self.h_tkchi2, tkegs.tkChi2) + bh.fill_1Dhist(self.h_tkIso, tkegs.tkIso) + bh.fill_1Dhist(self.h_pfIso, tkegs.pfIso) + class TkEmHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_pt = ROOT.TH1F(name+'_pt', 'Pt (GeV); p_{T} [GeV]', 100, 0, 100) - self.h_eta = ROOT.TH1F(name+'_eta', 'eta; #eta;', 100, -2.5, 2.5) - self.h_energy = ROOT.TH1F(name+'_energy', 'energy (GeV); E [GeV]', 1000, 0, 1000) - self.h_hwQual = ROOT.TH1F(name+'_hwQual', 'quality; hwQual', 10, 0, 10) - self.h_tkIso = ROOT.TH1F(name+'_tkIso', 'Iso; rel-iso_{tk}', 100, 0, 2) - self.h_pfIso = ROOT.TH1F(name+'_pfIso', 'Iso; rel-iso_{pf}', 100, 0, 2) - self.h_tkIsoPV = ROOT.TH1F(name+'_tkIsoPV', 'Iso; rel-iso^{PV}_{tk}', 100, 0, 2) - self.h_pfIsoPV = ROOT.TH1F(name+'_pfIsoPV', 'Iso; rel-iso^{PV}_{pf}', 100, 0, 2) + self.h_pt = bh.TH1F(name+'_pt', 'Pt (GeV); p_{T} [GeV]', 100, 0, 100) + self.h_eta = bh.TH1F(name+'_eta', 'eta; #eta;', 100, -2.5, 2.5) + self.h_energy = bh.TH1F(name+'_energy', 'energy (GeV); E [GeV]', 1000, 0, 1000) + self.h_hwQual = bh.TH1F(name+'_hwQual', 'quality; hwQual', 10, 0, 10) + self.h_tkIso = bh.TH1F(name+'_tkIso', 'Iso; rel-iso_{tk}', 100, 0, 2) + self.h_pfIso = bh.TH1F(name+'_pfIso', 'Iso; rel-iso_{pf}', 100, 0, 2) + self.h_tkIsoPV = bh.TH1F(name+'_tkIsoPV', 'Iso; rel-iso^{PV}_{tk}', 100, 0, 2) + self.h_pfIsoPV = bh.TH1F(name+'_pfIsoPV', 'Iso; rel-iso^{PV}_{pf}', 100, 0, 2) BaseHistos.__init__(self, name, root_file, debug) def fill(self, tkegs): - rnp.fill_hist(self.h_pt, tkegs.pt) - rnp.fill_hist(self.h_eta, tkegs.eta) - rnp.fill_hist(self.h_energy, tkegs.energy) - rnp.fill_hist(self.h_hwQual, tkegs.hwQual) - rnp.fill_hist(self.h_tkIso, tkegs.tkIso) - rnp.fill_hist(self.h_pfIso, tkegs.pfIso) - rnp.fill_hist(self.h_tkIsoPV, tkegs.tkIsoPV) - rnp.fill_hist(self.h_pfIsoPV, tkegs.pfIsoPV) - - def fill_lazy(self, filler, sel_name): - filler.fill1d_lazy(self.h_pt, 'pt', sel_name) - filler.fill1d_lazy(self.h_eta, 'eta', sel_name) - filler.fill1d_lazy(self.h_energy, 'energy', sel_name) - filler.fill1d_lazy(self.h_hwQual, 'hwQual', sel_name) - filler.fill1d_lazy(self.h_tkIso, 'tkIso', sel_name) - filler.fill1d_lazy(self.h_pfIso, 'pfIso', sel_name) - filler.fill1d_lazy(self.h_tkIsoPV, 'tkIsoPV', sel_name) - filler.fill1d_lazy(self.h_pfIsoPV, 'pfIsoPV', sel_name) + bh.fill_1Dhist(self.h_pt, tkegs.pt) + bh.fill_1Dhist(self.h_eta, tkegs.eta) + bh.fill_1Dhist(self.h_energy, tkegs.energy) + bh.fill_1Dhist(self.h_hwQual, tkegs.hwQual) + bh.fill_1Dhist(self.h_tkIso, tkegs.tkIso) + bh.fill_1Dhist(self.h_pfIso, tkegs.pfIso) + bh.fill_1Dhist(self.h_tkIsoPV, tkegs.tkIsoPV) + bh.fill_1Dhist(self.h_pfIsoPV, tkegs.pfIsoPV) class TkEGHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_pt = ROOT.TH1F(name+'_pt', 'TkEG Pt (GeV); p_{T} [GeV]', 100, 0, 100) - self.h_eta = ROOT.TH1F(name+'_eta', 'TkEG eta; #eta;', 100, -4, 4) - self.h_energy = ROOT.TH1F(name+'_energy', 'TkEG energy (GeV); E [GeV]', 1000, 0, 1000) - self.h_hwQual = ROOT.TH1F(name+'_hwQual', 'TkEG energy (GeV); hwQual', 5, 0, 5) - - self.h_tkpt = ROOT.TH1F(name+'_tkpt', 'TkEG Pt (GeV); p_{T} [GeV]', 100, 0, 100) - self.h_tketa = ROOT.TH1F(name+'_tketa', 'TkEG eta; #eta;', 100, -4, 4) - self.h_tkchi2 = ROOT.TH1F(name+'_tkchi2', 'TkEG chi2; #Chi^{2}', 1000, 0, 1000) - self.h_tkchi2Red = ROOT.TH1F(name+'_tkchi2Red', 'TkEG chi2 red; reduced #Chi^{2}', 100, 0, 100) - self.h_tknstubs = ROOT.TH1F(name+'_tknstubs', 'TkEG # stubs; # stubs', 10, 0, 10) - self.h_tkz0 = ROOT.TH1F(name+'_tkz0', 'TkEG z0; z_{0} [cm]', 100, -10, 10) - self.h_tkchi2RedVeta = ROOT.TH2F(name+'_tkchi2RedVeta', 'TkEG chi2 red. v eta; #eta; red. #Chi^{2}', 100, -4, 4, 100, 0, 100) - self.h_tknstubsVeta = ROOT.TH2F(name+'_tknstubsVeta', 'TkEG # stubs vs eta; #eta; # stubs', 100, -4, 4, 10, 0, 10) - self.h_tkz0Veta = ROOT.TH2F(name+'_tkz0Veta', 'TkEG z0 vs eta; #eta; z_{0} [cm]', 100, -4, 4, 100, -10, 10) - self.h_dphi = ROOT.TH1F(name+'_dphi', 'TkEG #Delta #phi; #Delta #phi [rad]', 100, -0.2, 0.2) - self.h_dphiVpt = ROOT.TH2F(name+'_dphiVpt', 'TkEG #Delta #phi vs p_{T}^{EG}; p_{T}^{EG} [GeV]; #Delta #phi [rad]', 100, 0, 100, 100, -0.2, 0.2) - self.h_deta = ROOT.TH1F(name+'_deta', 'TkEG #Delta #eta; #Delta #eta', 100, -0.2, 0.2) - self.h_detaVpt = ROOT.TH2F(name+'_detaVpt', 'TkEG #Delta #eta vs p_{T}^{EG}; p_{T}^{EG} [GeV]; #Delta #eta', 100, 0, 100, 100, -0.2, 0.2) - - self.h_dr = ROOT.TH1F(name+'_dr', 'TkEG #Delta R; #Delta R', 100, 0, 0.2) - self.h_ptVtkpt = ROOT.TH2F(name+'_ptVtkpt', 'TkEG Pt (GeV) vs TkPt; p_{T}^{Tk} [GeV]; p_{T}^{EG} [GeV]', 100, 0, 100, 100, 0, 100) + self.h_pt = bh.TH1F(name+'_pt', 'TkEG Pt (GeV); p_{T} [GeV]', 100, 0, 100) + self.h_eta = bh.TH1F(name+'_eta', 'TkEG eta; #eta;', 100, -4, 4) + self.h_energy = bh.TH1F(name+'_energy', 'TkEG energy (GeV); E [GeV]', 1000, 0, 1000) + self.h_hwQual = bh.TH1F(name+'_hwQual', 'TkEG energy (GeV); hwQual', 5, 0, 5) + + self.h_tkpt = bh.TH1F(name+'_tkpt', 'TkEG Pt (GeV); p_{T} [GeV]', 100, 0, 100) + self.h_tketa = bh.TH1F(name+'_tketa', 'TkEG eta; #eta;', 100, -4, 4) + self.h_tkchi2 = bh.TH1F(name+'_tkchi2', 'TkEG chi2; #Chi^{2}', 1000, 0, 1000) + self.h_tkchi2Red = bh.TH1F(name+'_tkchi2Red', 'TkEG chi2 red; reduced #Chi^{2}', 100, 0, 100) + self.h_tknstubs = bh.TH1F(name+'_tknstubs', 'TkEG # stubs; # stubs', 10, 0, 10) + self.h_tkz0 = bh.TH1F(name+'_tkz0', 'TkEG z0; z_{0} [cm]', 100, -10, 10) + self.h_tkchi2RedVeta = bh.TH2F(name+'_tkchi2RedVeta', 'TkEG chi2 red. v eta; #eta; red. #Chi^{2}', 100, -4, 4, 100, 0, 100) + self.h_tknstubsVeta = bh.TH2F(name+'_tknstubsVeta', 'TkEG # stubs vs eta; #eta; # stubs', 100, -4, 4, 10, 0, 10) + self.h_tkz0Veta = bh.TH2F(name+'_tkz0Veta', 'TkEG z0 vs eta; #eta; z_{0} [cm]', 100, -4, 4, 100, -10, 10) + self.h_dphi = bh.TH1F(name+'_dphi', 'TkEG #Delta #phi; #Delta #phi [rad]', 100, -0.2, 0.2) + self.h_dphiVpt = bh.TH2F(name+'_dphiVpt', 'TkEG #Delta #phi vs p_{T}^{EG}; p_{T}^{EG} [GeV]; #Delta #phi [rad]', 100, 0, 100, 100, -0.2, 0.2) + self.h_deta = bh.TH1F(name+'_deta', 'TkEG #Delta #eta; #Delta #eta', 100, -0.2, 0.2) + self.h_detaVpt = bh.TH2F(name+'_detaVpt', 'TkEG #Delta #eta vs p_{T}^{EG}; p_{T}^{EG} [GeV]; #Delta #eta', 100, 0, 100, 100, -0.2, 0.2) + + self.h_dr = bh.TH1F(name+'_dr', 'TkEG #Delta R; #Delta R', 100, 0, 0.2) + self.h_ptVtkpt = bh.TH2F(name+'_ptVtkpt', 'TkEG Pt (GeV) vs TkPt; p_{T}^{Tk} [GeV]; p_{T}^{EG} [GeV]', 100, 0, 100, 100, 0, 100) BaseHistos.__init__(self, name, root_file, debug) @@ -918,18 +749,18 @@ def fill(self, tkegs): class TrackHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_pt = ROOT.TH1F(name+'_pt', 'Track Pt (GeV); p_{T} [GeV]', 100, 0, 100) - self.h_eta = ROOT.TH1F(name+'_eta', 'Track eta; #eta;', 100, -4, 4) - self.h_chi2 = ROOT.TH1F(name+'_chi2', 'Track chi2; #Chi^{2}', 1000, 0, 1000) - self.h_chi2Red = ROOT.TH1F(name+'_chi2Red', 'Track chi2 red; red. #Chi^{2}', 100, 0, 100) - self.h_nstubs = ROOT.TH1F(name+'_nstubs', 'Track # stubs; # stubs', 10, 0, 10) - self.h_z0 = ROOT.TH1F(name+'_z0', 'Track z0; z_{0} [cm]', 100, -10, 10) - self.h_chi2RedVeta = ROOT.TH2F(name+'_chi2RedVeta', 'Track chi2 red. v eta; #eta; red. #Chi^{2}', 100, -4, 4, 100, 0, 100) - self.h_nstubsVeta = ROOT.TH2F(name+'_nstubsVeta', 'Track # stubs vs eta; #eta; # stubs', 100, -4, 4, 10, 0, 10) - self.h_z0Veta = ROOT.TH2F(name+'_z0Veta', 'Track z0 vs eta; #eta; z_{0} [cm]', 100, -4, 4, 100, -10, 10) - self.h_chi2RedVpt = ROOT.TH2F(name+'_chi2RedVpt', 'Track chi2 red. v pT; p_{T} [GeV]; red. #Chi^{2}', 100, 0, 100, 100, 0, 100) - self.h_nstubsVpt = ROOT.TH2F(name+'_nstubsVpt', 'Track # stubs vs pT; p_{T} [GeV]; # stubs', 100, 0, 100, 10, 0, 10) - self.h_z0Vpt = ROOT.TH2F(name+'_z0Vpt', 'Track z0 vs pT; p_{T} [GeV]; z_{0} [cm]', 100, 0, 100, 100, -10, 10) + self.h_pt = bh.TH1F(name+'_pt', 'Track Pt (GeV); p_{T} [GeV]', 100, 0, 100) + self.h_eta = bh.TH1F(name+'_eta', 'Track eta; #eta;', 100, -4, 4) + self.h_chi2 = bh.TH1F(name+'_chi2', 'Track chi2; #Chi^{2}', 1000, 0, 1000) + self.h_chi2Red = bh.TH1F(name+'_chi2Red', 'Track chi2 red; red. #Chi^{2}', 100, 0, 100) + self.h_nstubs = bh.TH1F(name+'_nstubs', 'Track # stubs; # stubs', 10, 0, 10) + self.h_z0 = bh.TH1F(name+'_z0', 'Track z0; z_{0} [cm]', 100, -10, 10) + self.h_chi2RedVeta = bh.TH2F(name+'_chi2RedVeta', 'Track chi2 red. v eta; #eta; red. #Chi^{2}', 100, -4, 4, 100, 0, 100) + self.h_nstubsVeta = bh.TH2F(name+'_nstubsVeta', 'Track # stubs vs eta; #eta; # stubs', 100, -4, 4, 10, 0, 10) + self.h_z0Veta = bh.TH2F(name+'_z0Veta', 'Track z0 vs eta; #eta; z_{0} [cm]', 100, -4, 4, 100, -10, 10) + self.h_chi2RedVpt = bh.TH2F(name+'_chi2RedVpt', 'Track chi2 red. v pT; p_{T} [GeV]; red. #Chi^{2}', 100, 0, 100, 100, 0, 100) + self.h_nstubsVpt = bh.TH2F(name+'_nstubsVpt', 'Track # stubs vs pT; p_{T} [GeV]; # stubs', 100, 0, 100, 10, 0, 10) + self.h_z0Vpt = bh.TH2F(name+'_z0Vpt', 'Track z0 vs pT; p_{T} [GeV]; z_{0} [cm]', 100, 0, 100, 100, -10, 10) BaseHistos.__init__(self, name, root_file, debug) @@ -951,21 +782,21 @@ def fill(self, tracks): class TriggerTowerHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_pt = ROOT.TH1F(name+'_pt', 'Tower Pt (GeV); p_{T} [GeV];', 100, 0, 100) - self.h_etEm = ROOT.TH1F(name+'_etEm', 'Tower Et EM (GeV)', 100, 0, 100) - self.h_etHad = ROOT.TH1F(name+'_etHad', 'Tower Et Had (GeV)', 100, 0, 100) - self.h_HoE = ROOT.TH1F(name+'_HoE', 'Tower H/E', 20, 0, 2) - self.h_HoEVpt = ROOT.TH2F(name+'_HoEVpt', 'Tower H/E vs Pt (GeV); H/E;', 50, 0, 100, 20, 0, 2) - self.h_energy = ROOT.TH1F(name+'_energy', 'Tower energy (GeV)', 1000, 0, 1000) - self.h_eta = ROOT.TH1F(name+'_eta', 'Tower eta; #eta;', 75, -3.169, 3.169) - self.h_ieta = ROOT.TH1F(name+'_ieta', 'Tower eta; i#eta;', 18, 0, 18) - - self.h_ptVeta = ROOT.TH2F(name+'_ptVeta', 'Tower P_P{T} (GeV) vs #eta; #eta; p_{T} [GeV];', 75, -3.169, 3.169, 100, 0, 10) - self.h_etVieta = ROOT.TH2F(name+'_etVieta', 'Tower E_{T} (GeV) vs ieta; i#eta; E_{T} [GeV];', 18, 0, 18, 100, 0, 10) - self.h_etEmVieta = ROOT.TH2F(name+'_etEmVieta', 'Tower E_{T} EM (GeV) vs ieta; i#eta; E_{T}^{EM} [GeV];', 18, 0, 18, 100, 0, 10) - self.h_etHadVieta = ROOT.TH2F(name+'_etHadVieta', 'Tower E_{T} Had (GeV) vs ieta; i#eta; E_{T}^{HAD} [GeV];', 18, 0, 18, 100, 0, 10) - self.h_sumEt = ROOT.TH1F(name+'_sumEt', 'Tower SumEt (GeV); E_{T}^{TOT} [GeV];', 200, 0, 400) - self.h_sumEtCentral = ROOT.TH1F(name+'_sumEtCentral', 'Tower SumEt (GeV) (central); E_{T}^{TOT} [GeV];', 200, 0, 400) + self.h_pt = bh.TH1F(name+'_pt', 'Tower Pt (GeV); p_{T} [GeV];', 100, 0, 100) + self.h_etEm = bh.TH1F(name+'_etEm', 'Tower Et EM (GeV)', 100, 0, 100) + self.h_etHad = bh.TH1F(name+'_etHad', 'Tower Et Had (GeV)', 100, 0, 100) + self.h_HoE = bh.TH1F(name+'_HoE', 'Tower H/E', 20, 0, 2) + self.h_HoEVpt = bh.TH2F(name+'_HoEVpt', 'Tower H/E vs Pt (GeV); H/E;', 50, 0, 100, 20, 0, 2) + self.h_energy = bh.TH1F(name+'_energy', 'Tower energy (GeV)', 1000, 0, 1000) + self.h_eta = bh.TH1F(name+'_eta', 'Tower eta; #eta;', 75, -3.169, 3.169) + self.h_ieta = bh.TH1F(name+'_ieta', 'Tower eta; i#eta;', 18, 0, 18) + + self.h_ptVeta = bh.TH2F(name+'_ptVeta', 'Tower P_P{T} (GeV) vs #eta; #eta; p_{T} [GeV];', 75, -3.169, 3.169, 100, 0, 10) + self.h_etVieta = bh.TH2F(name+'_etVieta', 'Tower E_{T} (GeV) vs ieta; i#eta; E_{T} [GeV];', 18, 0, 18, 100, 0, 10) + self.h_etEmVieta = bh.TH2F(name+'_etEmVieta', 'Tower E_{T} EM (GeV) vs ieta; i#eta; E_{T}^{EM} [GeV];', 18, 0, 18, 100, 0, 10) + self.h_etHadVieta = bh.TH2F(name+'_etHadVieta', 'Tower E_{T} Had (GeV) vs ieta; i#eta; E_{T}^{HAD} [GeV];', 18, 0, 18, 100, 0, 10) + self.h_sumEt = bh.TH1F(name+'_sumEt', 'Tower SumEt (GeV); E_{T}^{TOT} [GeV];', 200, 0, 400) + self.h_sumEtCentral = bh.TH1F(name+'_sumEtCentral', 'Tower SumEt (GeV) (central); E_{T}^{TOT} [GeV];', 200, 0, 400) BaseHistos.__init__(self, name, root_file, debug) @@ -992,24 +823,24 @@ def fill(self, towers): class TriggerTowerResoHistos(BaseResoHistos): def __init__(self, name, root_file=None): if not root_file: - self.h_ptRes = ROOT.TH1F(name+'_ptRes', 'TT Pt reso (GeV); (p_{T}^{L1}-p_{T}^{GEN})/p_{T}^{GEN};', 100, -1, 2) + self.h_ptRes = bh.TH1F(name+'_ptRes', 'TT Pt reso (GeV); (p_{T}^{L1}-p_{T}^{GEN})/p_{T}^{GEN};', 100, -1, 2) - self.h_ptResVpt = ROOT.TH2F(name+'_ptResVpt', 'TT Pt reso (GeV) vs pt (GeV); p_{T}^{GEN} [GeV]; (p_{T}^{L1}-p_{T}^{GEN})/p_{T}^{GEN};', 50, 0, 100, 100, -1, 2) - self.h_ptResVeta = ROOT.TH2F(name+'_ptResVeta', 'TT Pt reso (GeV) vs eta; #eta^{GEN}; (p_{T}^{L1}-p_{T}^{GEN})/p_{T}^{GEN};', 100, -3.5, 3.5, 100, -1, 2) + self.h_ptResVpt = bh.TH2F(name+'_ptResVpt', 'TT Pt reso (GeV) vs pt (GeV); p_{T}^{GEN} [GeV]; (p_{T}^{L1}-p_{T}^{GEN})/p_{T}^{GEN};', 50, 0, 100, 100, -1, 2) + self.h_ptResVeta = bh.TH2F(name+'_ptResVeta', 'TT Pt reso (GeV) vs eta; #eta^{GEN}; (p_{T}^{L1}-p_{T}^{GEN})/p_{T}^{GEN};', 100, -3.5, 3.5, 100, -1, 2) - self.h_ptResp = ROOT.TH1F(name+'_ptResp', 'TT Pt resp.; p_{T}^{L1}/p_{T}^{GEN};', 100, 0, 2) - self.h_ptRespVpt = ROOT.TH2F(name+'_ptRespVpt', 'TT Pt resp. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}/p_{T}^{GEN};', 50, 0, 100, 100, 0, 2) - self.h_ptRespVeta = ROOT.TH2F(name+'_ptRespVeta', 'TT Pt resp. vs |#eta|; |#eta^{GEN}|; p_{T}^{L1}/p_{T}^{GEN};', 34, 1.4, 3.1, 100, 0, 2) + self.h_ptResp = bh.TH1F(name+'_ptResp', 'TT Pt resp.; p_{T}^{L1}/p_{T}^{GEN};', 100, 0, 2) + self.h_ptRespVpt = bh.TH2F(name+'_ptRespVpt', 'TT Pt resp. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}/p_{T}^{GEN};', 50, 0, 100, 100, 0, 2) + self.h_ptRespVeta = bh.TH2F(name+'_ptRespVeta', 'TT Pt resp. vs |#eta|; |#eta^{GEN}|; p_{T}^{L1}/p_{T}^{GEN};', 34, 1.4, 3.1, 100, 0, 2) - self.h_energyRes = ROOT.TH1F(name+'_energyRes', 'TT Energy reso (GeV)', 200, -100, 100) - self.h_energyResVeta = ROOT.TH2F(name+'_energyResVeta', 'TT E reso (GeV) vs eta', 100, -3.5, 3.5, 200, -100, 100) + self.h_energyRes = bh.TH1F(name+'_energyRes', 'TT Energy reso (GeV)', 200, -100, 100) + self.h_energyResVeta = bh.TH2F(name+'_energyResVeta', 'TT E reso (GeV) vs eta', 100, -3.5, 3.5, 200, -100, 100) # FIXME: add corresponding Pt plots - self.h_etaRes = ROOT.TH1F(name+'_etaRes', 'TT eta reso; #eta^{L1}-#eta^{GEN}', 100, -0.4, 0.4) - self.h_phiRes = ROOT.TH1F(name+'_phiRes', 'TT phi reso; #phi^{L1}-#phi^{GEN}', 100, -0.4, 0.4) - self.h_etalwRes = ROOT.TH1F(name+'_etalwRes', 'TT eta reso (lw)', 100, -0.4, 0.4) - self.h_philwRes = ROOT.TH1F(name+'_philwRes', 'TT phi reso (lw)', 100, -0.4, 0.4) + self.h_etaRes = bh.TH1F(name+'_etaRes', 'TT eta reso; #eta^{L1}-#eta^{GEN}', 100, -0.4, 0.4) + self.h_phiRes = bh.TH1F(name+'_phiRes', 'TT phi reso; #phi^{L1}-#phi^{GEN}', 100, -0.4, 0.4) + self.h_etalwRes = bh.TH1F(name+'_etalwRes', 'TT eta reso (lw)', 100, -0.4, 0.4) + self.h_philwRes = bh.TH1F(name+'_philwRes', 'TT phi reso (lw)', 100, -0.4, 0.4) - self.h_drRes = ROOT.TH1F(name+'_drRes', 'TT DR reso', 100, 0, 0.1) + self.h_drRes = bh.TH1F(name+'_drRes', 'TT DR reso', 100, 0, 0.1) BaseResoHistos.__init__(self, name, root_file) def fill(self, reference, target): @@ -1037,41 +868,41 @@ class ResoHistos(BaseResoHistos): # @profile def __init__(self, name, root_file=None, debug=False): if not root_file: - # self.h_ptRes = ROOT.TH1F( + # self.h_ptRes = bh.TH1F( # name+'_ptRes', '3D Cluster Pt reso (GeV); (p_{T}^{L1} - p_{T}^{GEN})/p_{T}^{GEN}', # 100, -1, 1) - # # self.h_energyRes = ROOT.TH1F(name+'_energyRes', '3D Cluster Energy reso (GeV); E^{L1} - E^{GEN} [GeV]', 200, -100, 100) - # self.h_ptResVeta = ROOT.TH2F( + # # self.h_energyRes = bh.TH1F(name+'_energyRes', '3D Cluster Energy reso (GeV); E^{L1} - E^{GEN} [GeV]', 200, -100, 100) + # self.h_ptResVeta = bh.TH2F( # name+'_ptResVeta', '3D Cluster Pt reso (GeV) vs eta; #eta^{GEN}; p_{T}^{L1} - p_{T}^{GEN} [GeV];', # 50, -3.5, 3.5, 20, -40, 40) - # # self.h_energyResVenergy = ROOT.TH2F( + # # self.h_energyResVenergy = bh.TH2F( # # name+'_energyResVenergy', # # '3D Cluster E reso vs E; E^{GEN} [GeV]; (E^{L1} - E^{GEN})/E^{GEN};', # # 100, 0, 1000, 100, -1.5, 1.5) - # # self.h_energyResVeta = ROOT.TH2F( + # # self.h_energyResVeta = bh.TH2F( # # name+'_energyResVeta', # # '3D Cluster E reso (GeV) vs eta; #eta^{GEN}; (E^{L1} - E^{GEN})/E^{GEN};', # # 100, -3.5, 3.5, 100, -1.5, 1.5) - # # self.h_energyResVnclu = ROOT.TH2F(name+'_energyResVnclu', '3D Cluster E reso (GeV) vs # clusters; # 2D clus.; E^{L1} - E^{GEN} [GeV];', 50, 0, 50, 200, -100, 100) - # self.h_ptResVpt = ROOT.TH2F( + # # self.h_energyResVnclu = bh.TH2F(name+'_energyResVnclu', '3D Cluster E reso (GeV) vs # clusters; # 2D clus.; E^{L1} - E^{GEN} [GeV];', 50, 0, 50, 200, -100, 100) + # self.h_ptResVpt = bh.TH2F( # name+'_ptResVpt', # '3D Cluster Pt reso (GeV) vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1} - p_{T}^{GEN} [GeV];', # 50, 0, 100, 200, -40, 40) - # self.h_ptResVnclu = ROOT.TH2F(name+'_ptResVnclu', '3D Cluster Pt reso (GeV) vs # clusters; # 2D clus.; p_{T}^{L1} - p_{T}^{GEN} [GeV];', 50, 0, 50, 200, -40, 40) + # self.h_ptResVnclu = bh.TH2F(name+'_ptResVnclu', '3D Cluster Pt reso (GeV) vs # clusters; # 2D clus.; p_{T}^{L1} - p_{T}^{GEN} [GeV];', 50, 0, 50, 200, -40, 40) - self.h_ptResp = ROOT.TH1F( + self.h_ptResp = bh.TH1F( name+'_ptResp', '3D Cluster Pt resp.; p_{T}^{L1}/p_{T}^{GEN}', 100, 0, 2) - self.h_ptRespVpt = ROOT.TH2F( + self.h_ptRespVpt = bh.TH2F( name+'_ptRespVpt', '3D Cluster Pt resp. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}/p_{T}^{GEN};', 50, 0, 100, 100, 0, 2) - self.h_ptRespVeta = ROOT.TH2F( + self.h_ptRespVeta = bh.TH2F( name+'_ptRespVeta', '3D Cluster Pt resp. vs #eta; #eta^{GEN}; p_{T}^{L1}/p_{T}^{GEN};', 20, -4, 4, 50, 0, 2) - # self.h_ptRespVnclu = ROOT.TH2F( + # self.h_ptRespVnclu = bh.TH2F( # name+'_ptRespVnclu', # '3D Cluster Pt resp. vs # clus.; # 2D clust. ; p_{T}^{L1}/p_{T}^{GEN};', # 50, 0, 100, 100, 0, 2) @@ -1080,39 +911,39 @@ def __init__(self, name, root_file=None, debug=False): # '3D Cluster Pt resp. vs #eta and vs pT; #eta^{L1}; p_{T}^{L1} [GeV]; p_{T}^{L1}/p_{T}^{GEN};', # 30, 1, 4, 50, 0, 100, 100, 0, 3) - # self.h_ptemResp = ROOT.TH1F( + # self.h_ptemResp = bh.TH1F( # name+'_ptemResp', # '3D Cluster Pt resp.; p_{T}^{L1}/p_{T}^{GEN}', # 100, 0, 3) - # self.h_ptemRespVpt = ROOT.TH2F( + # self.h_ptemRespVpt = bh.TH2F( # name+'_ptemRespVpt', # '3D Cluster Pt resp. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}/p_{T}^{GEN};', # 50, 0, 100, 100, 0, 3) - # self.h_coreEnergyResVnclu = ROOT.TH2F(name+'_coreEnergyResVnclu', '3D Cluster E reso (GeV) vs # clusters', 50, 0, 50, 200, -100, 100) - # self.h_corePtResVnclu = ROOT.TH2F(name+'_corePtResVnclu', '3D Cluster Pt reso (GeV) vs # clusters', 50, 0, 50, 200, -40, 40) + # self.h_coreEnergyResVnclu = bh.TH2F(name+'_coreEnergyResVnclu', '3D Cluster E reso (GeV) vs # clusters', 50, 0, 50, 200, -100, 100) + # self.h_corePtResVnclu = bh.TH2F(name+'_corePtResVnclu', '3D Cluster Pt reso (GeV) vs # clusters', 50, 0, 50, 200, -40, 40) # - # self.h_coreEnergyRes = ROOT.TH1F(name+'_coreEnergyRes', '3D Cluster Energy reso CORE (GeV)', 200, -100, 100) - # self.h_corePtRes = ROOT.TH1F(name+'_corePtRes', '3D Cluster Pt reso CORE (GeV)', 200, -40, 40) + # self.h_coreEnergyRes = bh.TH1F(name+'_coreEnergyRes', '3D Cluster Energy reso CORE (GeV)', 200, -100, 100) + # self.h_corePtRes = bh.TH1F(name+'_corePtRes', '3D Cluster Pt reso CORE (GeV)', 200, -40, 40) - # self.h_centralEnergyRes = ROOT.TH1F(name+'_centralEnergyRes', '3D Cluster Energy reso CENTRAL (GeV)', 200, -100, 100) - self.h_etaRes = ROOT.TH1F( + # self.h_centralEnergyRes = bh.TH1F(name+'_centralEnergyRes', '3D Cluster Energy reso CENTRAL (GeV)', 200, -100, 100) + self.h_etaRes = bh.TH1F( name+'_etaRes', '3D Cluster eta reso; #eta^{L1}-#eta^{GEN}', 100, -0.15, 0.15) - self.h_phiRes = ROOT.TH1F( + self.h_phiRes = bh.TH1F( name+'_phiRes', '3D Cluster phi reso; #phi^{L1}-#phi^{GEN}', 100, -0.15, 0.15) - self.h_drRes = ROOT.TH1F( + self.h_drRes = bh.TH1F( name+'_drRes', '3D Cluster DR reso; #DeltaR^{L1}-#DeltaR^{GEN}', 100, 0, 0.1) - # self.h_n010 = ROOT.TH1F( + # self.h_n010 = bh.TH1F( # name+'_n010', # '# of 3D clus in 0.2 cone with pt>0.1GeV', # 10, 0, 10) - # self.h_n025 = ROOT.TH1F( + # self.h_n025 = bh.TH1F( # name+'_n025', # '# of 3D clus in 0.2 cone with pt>0.25GeV', # 10, 0, 10) @@ -1174,13 +1005,13 @@ def fill(self, reference, target): class Reso2DHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - # self.h_etaRes = ROOT.TH1F(name+'_etaRes', 'Eta 2D cluster - GEN part', 100, -0.5, 0.5) - # self.h_phiRes = ROOT.TH1F(name+'_phiRes', 'Phi 2D cluster - GEN part', 100, -0.5, 0.5) - # self.h_phiPRes = ROOT.TH1F(name+'_phiPRes', 'Phi (+) 2D cluster - GEN part', 100, -0.5, 0.5) - # self.h_phiMRes = ROOT.TH1F(name+'_phiMRes', 'Phi (-) 2D cluster - GEN part', 100, -0.5, 0.5) - self.h_xResVlayer = ROOT.TH2F(name+'_xResVlayer', 'X resolution (cm) [(2D clus) - GEN]', 60, 0, 60, 100, -10, 10) - self.h_yResVlayer = ROOT.TH2F(name+'_yResVlayer', 'Y resolution (cm) [(2D clus) - GEN]', 60, 0, 60, 100, -10, 10) - # self.h_DRRes = ROOT.TH1F(name+'_DRRes', 'DR 2D cluster - GEN part', 100, -0.5, 0.5) + # self.h_etaRes = bh.TH1F(name+'_etaRes', 'Eta 2D cluster - GEN part', 100, -0.5, 0.5) + # self.h_phiRes = bh.TH1F(name+'_phiRes', 'Phi 2D cluster - GEN part', 100, -0.5, 0.5) + # self.h_phiPRes = bh.TH1F(name+'_phiPRes', 'Phi (+) 2D cluster - GEN part', 100, -0.5, 0.5) + # self.h_phiMRes = bh.TH1F(name+'_phiMRes', 'Phi (-) 2D cluster - GEN part', 100, -0.5, 0.5) + self.h_xResVlayer = bh.TH2F(name+'_xResVlayer', 'X resolution (cm) [(2D clus) - GEN]', 60, 0, 60, 100, -10, 10) + self.h_yResVlayer = bh.TH2F(name+'_yResVlayer', 'Y resolution (cm) [(2D clus) - GEN]', 60, 0, 60, 100, -10, 10) + # self.h_DRRes = bh.TH1F(name+'_DRRes', 'DR 2D cluster - GEN part', 100, -0.5, 0.5) BaseHistos.__init__(self, name, root_file, debug) @@ -1209,11 +1040,11 @@ def fill(self, reference, target): class GeomHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_maxNNDistVlayer = ROOT.TH2F(name+'_maxNNDistVlayer', 'Max dist between NN vs layer', 60, 0, 60, 100, 0, 10) - self.h_minNNDistVlayer = ROOT.TH2F(name+'_minNNDistVlayer', 'Max dist between NN vs layer', 60, 0, 60, 100, 0, 10) + self.h_maxNNDistVlayer = bh.TH2F(name+'_maxNNDistVlayer', 'Max dist between NN vs layer', 60, 0, 60, 100, 0, 10) + self.h_minNNDistVlayer = bh.TH2F(name+'_minNNDistVlayer', 'Max dist between NN vs layer', 60, 0, 60, 100, 0, 10) - self.h_nTCsPerLayer = ROOT.TH1F(name+'_nTCsPerLayer', '# of Trigger Cells per layer', 60, 0, 60) - self.h_radiusVlayer = ROOT.TH2F(name+'_radiusVlayer', '# of cells radius vs layer', 60, 0, 60, 200, 0, 200) + self.h_nTCsPerLayer = bh.TH1F(name+'_nTCsPerLayer', '# of Trigger Cells per layer', 60, 0, 60) + self.h_radiusVlayer = bh.TH2F(name+'_radiusVlayer', '# of cells radius vs layer', 60, 0, 60, 200, 0, 200) BaseHistos.__init__(self, name, root_file, debug) def fill(self, tcs): @@ -1230,8 +1061,8 @@ def fill(self, tcs): class DensityHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_eDensityVlayer = ROOT.TH2F(name+'_eDensityVlayer', 'E (GeV) Density per layer', 60, 0, 60, 600, 0, 30) - self.h_nTCDensityVlayer = ROOT.TH2F(name+'_nTCDensityVlayer', '# TC Density per layer', 60, 0, 60, 20, 0, 20) + self.h_eDensityVlayer = bh.TH2F(name+'_eDensityVlayer', 'E (GeV) Density per layer', 60, 0, 60, 600, 0, 30) + self.h_nTCDensityVlayer = bh.TH2F(name+'_nTCDensityVlayer', '# TC Density per layer', 60, 0, 60, 20, 0, 20) elif 'v7' in root_file.GetName() and "NuGun" not in root_file.GetName(): print("v7 hack") self.h_eDensityVlayer = root_file.Get(name+'eDensityVlayer') @@ -1320,47 +1151,47 @@ def computeTurnOn(self, denominator, debug=False): class TrackResoHistos(BaseResoHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_ptResVpt = ROOT.TH2F( + self.h_ptResVpt = bh.TH2F( name+'_ptResVpt', 'Track Pt reso. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}-p_{T}^{GEN} [GeV];', 50, 0, 100, 100, -20, 20) - self.h_ptResp = ROOT.TH1F( + self.h_ptResp = bh.TH1F( name+'_ptResp', 'Track Pt resp.; p_{T}^{L1}/p_{T}^{GEN}', 100, 0, 3) - self.h_ptRespVpt = ROOT.TH2F( + self.h_ptRespVpt = bh.TH2F( name+'_ptRespVpt', 'Track Pt resp. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}/p_{T}^{GEN};', 50, 0, 100, 100, 0, 3) - self.h_ptRespVeta = ROOT.TH2F( + self.h_ptRespVeta = bh.TH2F( name+'_ptRespVeta', 'Track Pt resp. vs #eta; #eta^{GEN}; p_{T}^{L1}/p_{T}^{GEN};', 50, -4, 4, 100, 0, 3) - self.h_etaRes = ROOT.TH1F( + self.h_etaRes = bh.TH1F( name+'_etaRes', 'Track eta reso', 100, -0.4, 0.4) - self.h_phiRes = ROOT.TH1F( + self.h_phiRes = bh.TH1F( name+'_phiRes', 'Track phi reso', 100, -0.4, 0.4) - self.h_drRes = ROOT.TH1F( + self.h_drRes = bh.TH1F( name+'_drRes', 'Track DR reso', 100, 0, 0.4) - self.h_nMatch = ROOT.TH1F( + self.h_nMatch = bh.TH1F( name+'_nMatch', '# matches', 100, 0, 100) - # self.h_pt2stResVpt = ROOT.TH2F(name+'_pt2stResVpt', 'EG Pt 2stubs reso. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}-p_{T}^{GEN} [GeV];', + # self.h_pt2stResVpt = bh.TH2F(name+'_pt2stResVpt', 'EG Pt 2stubs reso. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}-p_{T}^{GEN} [GeV];', # 50, 0, 100, 100, -20, 20) # - # self.h_pt2stResp = ROOT.TH1F(name+'_pt2stResp', 'Track Pt resp.; p_{T}^{L1}/p_{T}^{GEN}', + # self.h_pt2stResp = bh.TH1F(name+'_pt2stResp', 'Track Pt resp.; p_{T}^{L1}/p_{T}^{GEN}', # 100, 0, 3) - # self.h_pt2stRespVpt = ROOT.TH2F(name+'_pt2stRespVpt', 'Track Pt resp. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}/p_{T}^{GEN};', + # self.h_pt2stRespVpt = bh.TH2F(name+'_pt2stRespVpt', 'Track Pt resp. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}/p_{T}^{GEN};', # 50, 0, 100, 100, 0, 3) - # self.h_pt2stRespVeta = ROOT.TH2F(name+'_pt2stRespVeta', 'Track Pt resp. vs #eta; #eta^{GEN}; p_{T}^{L1}/p_{T}^{GEN};', + # self.h_pt2stRespVeta = bh.TH2F(name+'_pt2stRespVeta', 'Track Pt resp. vs #eta; #eta^{GEN}; p_{T}^{L1}/p_{T}^{GEN};', # 50, -4, 4, 100, 0, 3) BaseResoHistos.__init__(self, name, root_file, debug) @@ -1400,86 +1231,86 @@ def fill_nMatch(self, n_matches): class DecTkResoHistos(BaseResoHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_ptResVpt = ROOT.TH2F( + self.h_ptResVpt = bh.TH2F( name+'_ptResVpt', 'Track Pt reso. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}-p_{T}^{GEN} [GeV];', 50, 0, 100, 100, -20, 20) - self.h_ptResp = ROOT.TH1F( + self.h_ptResp = bh.TH1F( name+'_ptResp', 'Track Pt resp.; p_{T}^{L1}/p_{T}^{GEN}', 100, 0, 3) - self.h_ptRespVpt = ROOT.TH2F( + self.h_ptRespVpt = bh.TH2F( name+'_ptRespVpt', 'Track Pt resp. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}/p_{T}^{GEN};', 50, 0, 100, 100, 0, 3) - self.h_ptRespVeta = ROOT.TH2F( + self.h_ptRespVeta = bh.TH2F( name+'_ptRespVeta', 'Track Pt resp. vs #eta; #eta^{GEN}; p_{T}^{L1}/p_{T}^{GEN};', 50, -4, 4, 100, 0, 3) - self.h_etaRes = ROOT.TH1F( + self.h_etaRes = bh.TH1F( name+'_etaRes', 'Track eta reso', 100, -0.15, 0.15) - self.h_etaResVabseta = ROOT.TH2F( + self.h_etaResVabseta = bh.TH2F( name+'_etaResVabseta', '#eta_{@vtx} reso; |#eta^{GEN}|; #eta_{@vtx}^{L1} vs #eta_{@vtx}^{GEN}', 50, 0, 2.5, 100, -0.1, 0.1) - self.h_etaResVeta = ROOT.TH2F( + self.h_etaResVeta = bh.TH2F( name+'_etaResVeta', '#eta_{@vtx} reso; #eta^{GEN}; #eta_{@vtx}^{L1} vs #eta_{@vtx}^{GEN}', 200, -2.5, 2.5, 100, -0.1, 0.1) - self.h_phiRes = ROOT.TH1F( + self.h_phiRes = bh.TH1F( name+'_phiRes', 'Track phi reso', 100, -0.4, 0.4) - self.h_caloEtaRes = ROOT.TH1F( + self.h_caloEtaRes = bh.TH1F( name+'_caloEtaRes', '#eta_{@calo} reso; #eta_{@calo}^{L1} vs #eta_{@calo}^{GEN}', 100, -0.15, 0.15) - self.h_caloEtaResVabseta = ROOT.TH2F( + self.h_caloEtaResVabseta = bh.TH2F( name+'_caloEtaResVabseta', '#eta_{@calo} reso; |#eta^{GEN}|; #eta_{@calo}^{L1} vs #eta_{@calo}^{GEN}', 50, 0, 2.5, 100, -0.1, 0.1) - self.h_caloEtaResVeta = ROOT.TH2F( + self.h_caloEtaResVeta = bh.TH2F( name+'_caloEtaResVeta', '#eta_{@calo} reso; #eta^{GEN}; #eta_{@calo}^{L1} vs #eta_{@calo}^{GEN}', 200, -2.5, 2.5, 100, -0.1, 0.1) - self.h_caloPhiRes = ROOT.TH1F( + self.h_caloPhiRes = bh.TH1F( name+'_caloPhiRes', '#phi_{@calo} reso; #phi_{@calo}^{L1} vs #phi_{@calo}^{GEN}', 100, -0.4, 0.4) - self.h_caloPhiResVabseta = ROOT.TH2F( + self.h_caloPhiResVabseta = bh.TH2F( name+'_caloPhiResVabseta', '#phi_{@calo} reso; |#eta^{GEN}|; #phi_{@calo}^{L1} vs #phi_{@calo}^{GEN}', 50, 0, 3, 100, -0.4, 0.4) - self.h_dzRes = ROOT.TH1F( + self.h_dzRes = bh.TH1F( name+'_dzRes', '#DeltaZ_{0} res; #DeltaZ_{0}^{L1}-#DeltaZ_{0}^{GEN}', 100, -10, 10) - # self.h_caloPhiResVeta = ROOT.TH2F( + # self.h_caloPhiResVeta = bh.TH2F( # name+'_caloPhiResVabseta', # '#phi_{@calo} reso; #eta^{GEN}; #phi_{@calo}^{L1} vs #phi_{@calo}^{GEN}', # 50, 0, 3, # 100, -0.4, 0.4) - self.h_nMatch = ROOT.TH1F( + self.h_nMatch = bh.TH1F( name+'_nMatch', '# matches', 100, 0, 100) - # self.h_pt2stResVpt = ROOT.TH2F(name+'_pt2stResVpt', 'EG Pt 2stubs reso. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}-p_{T}^{GEN} [GeV];', + # self.h_pt2stResVpt = bh.TH2F(name+'_pt2stResVpt', 'EG Pt 2stubs reso. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}-p_{T}^{GEN} [GeV];', # 50, 0, 100, 100, -20, 20) # - # self.h_pt2stResp = ROOT.TH1F(name+'_pt2stResp', 'Track Pt resp.; p_{T}^{L1}/p_{T}^{GEN}', + # self.h_pt2stResp = bh.TH1F(name+'_pt2stResp', 'Track Pt resp.; p_{T}^{L1}/p_{T}^{GEN}', # 100, 0, 3) - # self.h_pt2stRespVpt = ROOT.TH2F(name+'_pt2stRespVpt', 'Track Pt resp. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}/p_{T}^{GEN};', + # self.h_pt2stRespVpt = bh.TH2F(name+'_pt2stRespVpt', 'Track Pt resp. vs pt (GeV); p_{T}^{GEN} [GeV]; p_{T}^{L1}/p_{T}^{GEN};', # 50, 0, 100, 100, 0, 3) - # self.h_pt2stRespVeta = ROOT.TH2F(name+'_pt2stRespVeta', 'Track Pt resp. vs #eta; #eta^{GEN}; p_{T}^{L1}/p_{T}^{GEN};', + # self.h_pt2stRespVeta = bh.TH2F(name+'_pt2stRespVeta', 'Track Pt resp. vs #eta; #eta^{GEN}; p_{T}^{L1}/p_{T}^{GEN};', # 50, -4, 4, 100, 0, 3) BaseResoHistos.__init__(self, name, root_file, debug) @@ -1598,15 +1429,15 @@ def fill(self, reference, target): class ClusterConeHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_ptRel = ROOT.TH1F(name+'_ptRel', + self.h_ptRel = bh.TH1F(name+'_ptRel', 'Pt best/Pt other; p_{T}^{best}/p_{T}^{other}', 100, 0, 5) - self.h_ptRelVpt = ROOT.TH2F(name+'_ptRelVpt', 'Pt best/Pt other vs pt (GeV); p_{T}^{best} [GeV]; p_{T}^{best}/p_{T}^{other};', 50, 0, 100, 100, 0, 5) - self.h_deltaEta = ROOT.TH1F(name+'_deltaEta', '#Delta eta; #eta^{best}-#eta^{other}', 100, -0.4, 0.4) - self.h_deltaPhi = ROOT.TH1F(name+'_deltaPhi', '#Delta phi; #phi^{best}-#phi^{other}', 100, -0.4, 0.4) - self.h_deltaPhiVq = ROOT.TH2F(name+'_deltaPhiVq', '#Delta phi; #phi^{best}-#phi^{other}; GEN charge;', 100, -0.4, 0.4, 3, -1, 2) + self.h_ptRelVpt = bh.TH2F(name+'_ptRelVpt', 'Pt best/Pt other vs pt (GeV); p_{T}^{best} [GeV]; p_{T}^{best}/p_{T}^{other};', 50, 0, 100, 100, 0, 5) + self.h_deltaEta = bh.TH1F(name+'_deltaEta', '#Delta eta; #eta^{best}-#eta^{other}', 100, -0.4, 0.4) + self.h_deltaPhi = bh.TH1F(name+'_deltaPhi', '#Delta phi; #phi^{best}-#phi^{other}', 100, -0.4, 0.4) + self.h_deltaPhiVq = bh.TH2F(name+'_deltaPhiVq', '#Delta phi; #phi^{best}-#phi^{other}; GEN charge;', 100, -0.4, 0.4, 3, -1, 2) - self.h_deltaR = ROOT.TH1F(name+'_deltaR', '#Delta R (best-other); #Delta R (best, other)', 100, 0, 0.4) - self.h_n = ROOT.TH1F(name+'_n', '# other clusters in cone; # others', 20, 0, 20) + self.h_deltaR = bh.TH1F(name+'_deltaR', '#Delta R (best-other); #Delta R (best, other)', 100, 0, 0.4) + self.h_n = bh.TH1F(name+'_n', '# other clusters in cone; # others', 20, 0, 20) BaseHistos.__init__(self, name, root_file, debug) def fill(self, reference, target, charge): @@ -1699,10 +1530,10 @@ def fill(self, reference, target): class CorrOccupancyHistos(BaseHistos): class CorrBoardOccupancyHistos(object): def __init__(self, name, board): - self.h_totOcc = ROOT.TH1F(f'{name}_{board}totOcc', f'{board} total occupancy; {board} total occ.', 500, 0, 500) - self.h_regOcc = ROOT.TH1F(f'{name}_{board}regOcc', f'{board} reg occupancy; {board} reg. occ.', 100, 0, 100) - self.h_maxOcc = ROOT.TH1F(f'{name}_{board}maxOcc', f'{board} max occupancy; {board} max occ.', 100, 0, 100) - self.h_maxMult = ROOT.TH1F(f'{name}_{board}maxMult', f'{board} max multiplicity per cluster; {board} max mult. per cluster', 100, 0, 100) + self.h_totOcc = bh.TH1F(f'{name}_{board}totOcc', f'{board} total occupancy; {board} total occ.', 500, 0, 500) + self.h_regOcc = bh.TH1F(f'{name}_{board}regOcc', f'{board} reg occupancy; {board} reg. occ.', 100, 0, 100) + self.h_maxOcc = bh.TH1F(f'{name}_{board}maxOcc', f'{board} max occupancy; {board} max occ.', 100, 0, 100) + self.h_maxMult = bh.TH1F(f'{name}_{board}maxMult', f'{board} max multiplicity per cluster; {board} max mult. per cluster', 100, 0, 100) self.eta_regions_idx = pf_regions.regions[board] self.max_count = 0 self.tot_count = 0 @@ -1791,7 +1622,7 @@ def fill(self, tcs, cl2ds, cl3ds): class TCClusterMatchHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_dEtaVdPhi = ROOT.TH2F( + self.h_dEtaVdPhi = bh.TH2F( name+'_dEtaVdPhi', '#Delta#eta vs #Delta#phi; #Delta#phi [rad]; #Delta#eta;', 100, -0.1, 0.1, 100, -0.1, 0.1) @@ -1819,53 +1650,53 @@ def __init__(self, name, root_file=None, debug=False): name+'_dRhoRMSVpt', 'RMS(#Delta#rho) vs pt; p_{T} [GeV]; RMS(#Delta#rho);', 100, 0, 100) - self.h_dRho = ROOT.TH1F( + self.h_dRho = bh.TH1F( name+'_dRho', '#Delta#rho; #Delta#rho;', 100, 0, 0.1) - self.h_dRho2 = ROOT.TH1F( + self.h_dRho2 = bh.TH1F( name+'_dRho2', '#Delta#rho (E fraction weighted); #Delta#rho;', 100, 0, 0.1) - self.h_dRhoVlayer = ROOT.TH2F( + self.h_dRhoVlayer = bh.TH2F( name+'_dRhoVlayer', '#Delta#rho; layer #; #Delta#rho;', 60, 0, 60, 100, 0, 0.1) - self.h_dRhoVabseta = ROOT.TH2F( + self.h_dRhoVabseta = bh.TH2F( name+'_dRhoVabseta', '#Delta#rho; |#eta|; #Delta#rho;', 100, 1.4, 3.1, 100, 0, 0.1) - # self.h_dRhoVfbrem = ROOT.TH2F(name+'_dRhoVfbrem', + # self.h_dRhoVfbrem = bh.TH2F(name+'_dRhoVfbrem', # '#Delta#rho vs f_{brem}; f_{brem}; #Delta#rho;', # 100, 0, 1, 100, 0, 0.1) - self.h_dtVlayer = ROOT.TH2F( + self.h_dtVlayer = bh.TH2F( name+'_dtVlayer', '#Deltat vs layer; layer #; #Deltat;', 60, 0, 60, 100, -0.05, 0.05) - self.h_duVlayer = ROOT.TH2F( + self.h_duVlayer = bh.TH2F( name+'_duVlayer', '#Delta#rho; layer #; #Deltau;', 60, 0, 60, 100, -0.05, 0.05) - self.h_dtVlayer2 = ROOT.TH2F( + self.h_dtVlayer2 = bh.TH2F( name+'_dtVlayer2', '#Deltat vs layer; layer #; #Deltat;', 60, 0, 60, 100, -0.05, 0.05) - self.h_duVlayer2 = ROOT.TH2F( + self.h_duVlayer2 = bh.TH2F( name+'_duVlayer2', '#Delta#rho; layer #; #Deltau;', 60, 0, 60, 100, -0.05, 0.05) - self.h_dtVdu = ROOT.TH2F( + self.h_dtVdu = bh.TH2F( name+'_dtVdu', '#Deltat vs #Deltau; #Deltat [cm]; #Deltau [cm];', 100, -0.05, 0.05, 100, -0.05, 0.05) - self.h_dtVdu2 = ROOT.TH2F( + self.h_dtVdu2 = bh.TH2F( name+'_dtVdu2', '#Deltat vs #Deltau (E fract. weighted); #Deltat [cm]; #Deltau [cm];', 100, -0.05, 0.05, 100, -0.05, 0.05) - # self.h_fbremVabseta = ROOT.TH2F(name+'_fbremVabseta', + # self.h_fbremVabseta = bh.TH2F(name+'_fbremVabseta', # 'f_{brem} vs |#eta|; |#eta|; f_{brem};', # 100, 1.4, 3.1, 100, 0, 1) @@ -1904,12 +1735,12 @@ class QuantizationHistos(BaseHistos): def __init__(self, name, features=None, root_file=None, debug=False): if not root_file: self.features = features - self.h_features = ROOT.TH2F( + self.h_features = bh.TH2F( name+'_features', 'features; feature; value', len(self.features), 0, len(self.features), 1000, -1000, 1000) - self.h_featuresLog2 = ROOT.TH2F( + self.h_featuresLog2 = bh.TH2F( name+'_featuresLog2', 'featuresLog2; features; log_{2}(value)', len(self.features), 0, len(self.features), @@ -1926,18 +1757,9 @@ def fill(self, df): for bin,ft in enumerate(self.features): fill[f'{ft}_bin'] = bin fill[f'{ft}_log2'] = np.log2(fill[[ft]]) - rnp.fill_hist(self.h_features, fill[[f'{ft}_bin', ft]]) - rnp.fill_hist(self.h_featuresLog2, fill[[f'{ft}_bin', f'{ft}_log2']]) - + bh.fill_2Dhist(self.h_features, fill[[f'{ft}_bin', ft]]) + bh.fill_2Dhist(self.h_featuresLog2, fill[[f'{ft}_bin', f'{ft}_log2']]) - def fill_lazy(self, filler, sel_name): - for bin,ft in enumerate(self.features): - # print(ft) - filler.df[f'{ft}_bin'] = bin - filler.df[f'{ft}_log2'] = np.log2(filler.df[[ft]]) - # print(filler.df[[ft, f'{ft}_log2', f'{ft}_bin']]) - filler.fill2d_lazy(self.h_features, f'{ft}_bin', ft, sel_name) - filler.fill2d_lazy(self.h_features, f'{ft}_bin', f'{ft}_log2', sel_name) # if __name__ == "__main__": # import sys diff --git a/python/plotters.py b/python/plotters.py index 538c86aa..2365f933 100644 --- a/python/plotters.py +++ b/python/plotters.py @@ -32,7 +32,7 @@ from . import calibrations as calib # import collections as collections -ROOT.gROOT.ProcessLine('#include "src/fastfilling.h"') +# ROOT.gROOT.ProcessLine('#include "src/fastfilling.h"') class Test(object): @@ -190,49 +190,6 @@ def fill_histos_event(self, idx, debug=0): self.fill_histos(debug) -class GenericDataFrameLazyPlotter(BasePlotter): - def __init__(self, HistoClass, data_set, selections=[selections.Selection('all')]): - self.HistoClass = HistoClass - self.h_set = {} - super(GenericDataFrameLazyPlotter, self).__init__(data_set, selections) - - def book_histos(self): - self.data_set.activate() - data_name = self.data_set.name - for selection in self.data_selections: - self.h_set[selection.name] = self.HistoClass(name='{}_{}_nomatch'.format(data_name, - selection.name)) - - def fill_histos(self, debug=0): - # if not (idx, 0) in self.data_set.df.index: - # return - dataframe = self.data_set.df - # if dataframe.empty: - # return - filler = histos.HistoLazyFiller(dataframe) - # print (self.data_set.name) - # print (self.data_set.df.columns) - - for data_sel in self.data_selections: - if data_sel.all: - filler.add_selection(data_sel.name, np.full(len(dataframe), True, dtype=bool)) - else: - # FIXME: add selection - print(data_sel.name) - print(data_sel.selection(dataframe)) - filler.add_selection(data_sel.name, ak.flatten(data_sel.selection(dataframe))) - self.h_set[data_sel.name].fill_lazy(filler, data_sel.name) - filler.fill() - - def fill_histos_event(self, idx, debug=0): - if self.data_set.new_read: - self.fill_histos(debug) - if hasattr(self.HistoClass, 'fill_event'): - for selection in self.data_selections: - objects = self.data_set.query_event(selection, idx) - self.h_set[selection.name].fill_event(objects) - - class GenericDataFramePlotter(BasePlotter): def __init__(self, HistoClass, data_set, selections=[selections.Selection('all')]): self.HistoClass = HistoClass @@ -247,10 +204,10 @@ def book_histos(self): selection.name)) def fill_histos(self, debug=0): - if self.data_set.df.empty: - return for data_sel in self.data_selections: - data = self.data_set.query(data_sel) + data = self.data_set.df + if not data_sel.all: + data = data[data_sel.selection(data)] self.h_set[data_sel.name].fill(data) def fill_histos_event(self, idx, debug=0): @@ -258,7 +215,7 @@ def fill_histos_event(self, idx, debug=0): self.fill_histos(debug) -class GenPlotter(GenericDataFrameLazyPlotter): +class GenPlotter(GenericDataFramePlotter): def __init__(self, gen_set, gen_selections=[selections.Selection('all')]): super(GenPlotter, self).__init__( histos.GenParticleHistos, @@ -268,12 +225,12 @@ def __init__(self, gen_set, gen_selections=[selections.Selection('all')]): [selections.Selection('', '', 'gen > 0')])) -class TkElePlotter(GenericDataFrameLazyPlotter): +class TkElePlotter(GenericDataFramePlotter): def __init__(self, tkeg_set, tkeg_selections=[selections.Selection('all')]): super(TkElePlotter, self).__init__(histos.TkEleHistos, tkeg_set, tkeg_selections) -class TkEmPlotter(GenericDataFrameLazyPlotter): +class TkEmPlotter(GenericDataFramePlotter): def __init__(self, tkeg_set, tkeg_selections=[selections.Selection('all')]): super(TkEmPlotter, self).__init__(histos.TkEmHistos, tkeg_set, tkeg_selections) @@ -288,7 +245,7 @@ def __init__(self, trk_set, track_selections=[selections.Selection('all')]): super(TrackPlotter, self).__init__(histos.TrackHistos, trk_set, track_selections) -class EGPlotter(GenericDataFrameLazyPlotter): +class EGPlotter(GenericDataFramePlotter): def __init__(self, eg_set, eg_selections=[selections.Selection('all')]): super(EGPlotter, self).__init__(histos.EGHistos, eg_set, eg_selections) @@ -298,11 +255,11 @@ def __init__(self, tt_set, tt_selections=[selections.Selection('all')]): super(TTPlotter, self).__init__(histos.TriggerTowerHistos, tt_set, tt_selections) -class DecTkPlotter(GenericDataFrameLazyPlotter): +class DecTkPlotter(GenericDataFramePlotter): def __init__(self, tk_set, tk_selections=[selections.Selection('all')]): super(DecTkPlotter, self).__init__(histos.DecTkHistos, tk_set, tk_selections) -class Cl3DPlotter(GenericDataFrameLazyPlotter): +class Cl3DPlotter(GenericDataFramePlotter): def __init__(self, data_set, data_selections=[selections.Selection('all')]): super(Cl3DPlotter, self).__init__(histos.Cluster3DHistos, data_set, data_selections) From f5a7fb4afa027578dcdcd5376a1b2d843fd04ab7 Mon Sep 17 00:00:00 2001 From: Gianluca Date: Wed, 31 May 2023 14:52:51 +0200 Subject: [PATCH 06/18] continue migratio to awkkward arrays (now include rates) --- cfg/egplots.yaml | 2 +- cfg/egvalid.yaml | 2 +- cfg/rate.yaml | 6 +++--- python/boost_hist.py | 4 ++-- python/calibrations.py | 4 ++-- python/collections.py | 45 ++++++++++++++++++++---------------------- python/l1THistos.py | 31 +++++++++++++---------------- python/plotters.py | 11 ++++++++--- python/selections.py | 16 +++++++-------- python/tree_reader.py | 5 +++-- 10 files changed, 63 insertions(+), 63 deletions(-) diff --git a/cfg/egplots.yaml b/cfg/egplots.yaml index 0e3fc59d..be274876 100644 --- a/cfg/egplots.yaml +++ b/cfg/egplots.yaml @@ -7,7 +7,7 @@ common: triolet: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v152B + plot_version: v160A run_clustering: False run_density_computation: False # +AccountingGroup = "group_u_CMS.u_zh.users" diff --git a/cfg/egvalid.yaml b/cfg/egvalid.yaml index e2940278..36e3a6db 100644 --- a/cfg/egvalid.yaml +++ b/cfg/egvalid.yaml @@ -7,7 +7,7 @@ common: triolet: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v152D + plot_version: v160A run_clustering: False run_density_computation: False # +AccountingGroup = "group_u_CMS.u_zh.users" diff --git a/cfg/rate.yaml b/cfg/rate.yaml index 1a72124f..20b2b002 100644 --- a/cfg/rate.yaml +++ b/cfg/rate.yaml @@ -7,7 +7,7 @@ common: triolet: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v152F + plot_version: v160A run_clustering: False run_density_computation: False # +AccountingGroup = "group_u_CMS.u_zh.users" @@ -84,8 +84,8 @@ collections: # - !!python/name:cfg.rate.eg_emu_plotters - !!python/name:cfg.rate.eg_emuCTl1_plotters - !!python/name:cfg.rate.eg_emuCTl2_plotters - - !!python/name:cfg.rate.eg_emuCTl1_ell_plotters - - !!python/name:cfg.rate.eg_emuCTl2_ell_plotters + # - !!python/name:cfg.rate.eg_emuCTl1_ell_plotters + # - !!python/name:cfg.rate.eg_emuCTl2_ell_plotters htc_jobflavor: microcentury priorities: diff --git a/python/boost_hist.py b/python/boost_hist.py index 12ef0134..6e6cbbf7 100644 --- a/python/boost_hist.py +++ b/python/boost_hist.py @@ -37,7 +37,7 @@ def TH2F(name, title, x_nbins, x_bin_low, x_bin_high, y_nbins, y_bin_low, y_bin_ def fill_1Dhist(hist, array, weights=None): flar = ak.drop_none(ak.flatten(array)) if weights is None: - hist.fill(flar) + hist.fill(flar, threads=None) # ROOT.fill_1Dhist(hist=hist, array=flar) else: hist.fill(flar, weights) @@ -49,7 +49,7 @@ def fill_2Dhist(hist, arrayX, arrayY, weights=None): if weights is None: # ROOT.fill_2Dhist(hist=hist, arrayX=flar_x, arrayY=flar_y) - hist.fill(flar_x, flar_y) + hist.fill(flar_x, flar_y, threads=None) else: # ROOT.fill_2Dhist(hist=hist, arrayX=flar_x, arrayY=flar_y, weights=weights) hist.fill(flar_x, flar_y, weights) diff --git a/python/calibrations.py b/python/calibrations.py index db957fb9..3ee92ed3 100644 --- a/python/calibrations.py +++ b/python/calibrations.py @@ -530,10 +530,10 @@ def rate_pt_wps_selections(wps, obj, pt_var='pt'): for rate, pt_cut in wps[obj][obj_sel_name].items(): # print(f' rate: {rate}kHz, pt cut: {pt_cut}GeV') pt_sel = selections.Selection( - f'@{rate}kHz', f'p_{{T}}^{{TOBJ}}>={pt_cut}GeV (@{rate}kHz)', f'{pt_var} >= {pt_cut}') + f'@{rate}kHz', f'p_{{T}}^{{TOBJ}}>={pt_cut}GeV (@{rate}kHz)', lambda ar: ar.pt >= pt_cut) obj_sel = selections.Selector(f'^{obj_sel_name}$', sm.selections)()[0] # print(obj_sel*pt_sel) - data_selections.append(obj_sel*pt_sel) + data_selections.append(obj_sel&pt_sel) # gen_selections.append(selections.Selection('all')) return data_selections diff --git a/python/collections.py b/python/collections.py index c4845254..a8ae7dd8 100644 --- a/python/collections.py +++ b/python/collections.py @@ -214,13 +214,12 @@ def fill_real(self, event, stride, weight_file=None, debug=0): self.df = self.weight_function(self.df, weight_file) self.entries = range(0,1000)# FIXME: self.df.index.get_level_values('entry').unique() if debug > 2: - print(f'read coll. {self.name} from entry: {event.file_entry} to entry: {event.file_entry+stride} (stride: {stride}), # rows: {self.df.shape[0]}, # entries: {len(self.entries)}') + print(f'read coll. {self.name} from entry: {event.file_entry} to entry: {event.file_entry+stride} (stride: {stride}), # rows: {len(self.df)}, # entries: {len(self.entries)}') def tkeg_fromcluster_fixture(tkegs): # print tkegs tkegs.loc[tkegs.hwQual == 1, 'hwQual'] = 3 - return tkegs # NOTE: scorporate the part wich computes the layer_weights @@ -302,7 +301,7 @@ def cl3d_fixtures(clusters): clusters.drop('ienergy', axis=1, inplace=True) clusters['meanz_scaled'] = np.abs(clusters.meanz) - 320 # return - return clusters + # return clusters def gen_fixtures(particles, mc_particles): @@ -312,7 +311,7 @@ def gen_fixtures(particles, mc_particles): particles['pdgid'] = particles.pid particles['abseta'] = np.abs(particles.eta) particles['firstmother_pdgid'] = mc_particles.df.pdgid[particles[particles.gen != -1].gen-1] - return particles + # return particles def mc_fixtures(particles): @@ -320,17 +319,15 @@ def mc_fixtures(particles): # print(particles) # # particles['firstmother'] = particles.index.to_numpy() particles['firstmother_pdgid'] = particles.pdgid - return particles - # FIXME: this is broken - # print(particles) - - for particle in particles.itertuples(): - print(particle.daughters) - if particle.daughters == [[], []]: - continue - particles.loc[particle.daughters, 'firstmother'] = particle.Index - particles.loc[particle.daughters, 'firstmother_pdgid'] = particle.pdgid - return particles + # return particles + # # FIXME: this is broken + # for particle in particles.itertuples(): + # print(particle.daughters) + # if particle.daughters == [[], []]: + # continue + # particles.loc[particle.daughters, 'firstmother'] = particle.Index + # particles.loc[particle.daughters, 'firstmother_pdgid'] = particle.pdgid + # return particles def tc_fixtures(tcs): @@ -341,14 +338,14 @@ def tc_fixtures(tcs): tcs['abseta'] = np.abs(tcs.eta) # tcs['xproj'] = tcs.x/tcs.z # tcs['yproj'] = tcs.y/tcs.z - return tcs + # return tcs def cl2d_fixtures(clusters): clusters['ncells'] = 1 if not clusters.empty: clusters['ncells'] = [len(x) for x in clusters.cells] - return clusters + # return clusters def tower_fixtures(towers): @@ -676,7 +673,7 @@ def tkele_fixture_ee(electrons): electrons['looseTkID'] = True electrons['photonID'] = True electrons['dpt'] = electrons.tkPt - electrons.pt - return electrons + # return electrons def tkele_fixture_eb(electrons): @@ -687,11 +684,11 @@ def tkele_fixture_eb(electrons): electrons['looseTkID'] = ((hwqual.values >> 1) & 1) > 0 electrons['photonID'] = ((hwqual.values >> 2) & 1) > 0 electrons['dpt'] = electrons.tkPt - electrons.pt - return electrons + # return electrons def quality_flags(objs): - print(objs.hwQual) + # print(objs.hwQual) objs['hwQual'] = ak.values_astype(objs.hwQual, np.int32) mask_tight_sta = 0b0001 mask_tight_ele = 0b0010 @@ -702,16 +699,16 @@ def quality_flags(objs): objs['IDTightPho'] = np.bitwise_and(objs.hwQual, mask_tight_pho) > 0 objs['IDNoBrem'] = np.bitwise_and(objs.hwQual, mask_no_brem) > 0 objs['IDBrem'] = np.bitwise_and(objs.hwQual, mask_no_brem) == 0 - return objs + # return objs def quality_ele_fixtures(objs): - print(objs) + # print(objs) objs['dpt'] = objs.tkPt - objs.pt - return quality_flags(objs) + quality_flags(objs) def print_columns(df): - print(df.columns) + print(df.fields) return df diff --git a/python/l1THistos.py b/python/l1THistos.py index e9ec6a65..874c5cc1 100644 --- a/python/l1THistos.py +++ b/python/l1THistos.py @@ -275,11 +275,11 @@ def __init__(self, name, root_file=None, debug=False): if not root_file: self.h_norm = bh.TH1F(name+'_norm', '# of events', 1, 1, 2) self.h_pt = bh.TH1F(name+'_pt', 'rate above p_{T} thresh.; p_{T} [GeV]; rate [kHz];', 100, 0, 100) - self.h_ptVabseta = bh.TH2F(name+'_ptVabseta', 'Candidate p_{T} vs |#eta|; |#eta|; p_{T} [GeV];', 34, 1.4, 3.1, 100, 0, 100) + # self.h_ptVabseta = bh.TH2F(name+'_ptVabseta', 'Candidate p_{T} vs |#eta|; |#eta|; p_{T} [GeV];', 34, 1.4, 3.1, 100, 0, 100) BaseHistos.__init__(self, name, root_file, debug) - if root_file is not None or True: + if root_file is not None: for attr_1d in [attr for attr in dir(self) if (attr.startswith('h_') and 'TH1' in getattr(self, attr).ClassName())]: setattr(self, attr_1d+'_graph', GraphBuilder(self, attr_1d)) @@ -287,33 +287,30 @@ def __init__(self, name, root_file=None, debug=False): self.normalize(31000) # self.h_simenergy = bh.TH1F(name+'_energy', 'Digi sim-energy (GeV)', 100, 0, 2) - def fill(self, pt, eta): - for ptf in range(0, int(pt)+1): - self.h_pt.Fill(ptf) - self.h_ptVabseta.Fill(abs(eta), pt) + def fill(self, data): + # print(self.h_pt.axes[0]) + pt_max = ak.max(data.pt, axis=1) + for thr,bin_center in zip(self.h_pt.axes[0].edges, self.h_pt.axes[0].centers): + # for thr,bin_center in zip(self.h_pt.axes[0].edges[1:], self.h_pt.axes[0].centers): + self.h_pt.fill(bin_center, weight=ak.sum(pt_max>=thr)) + + # for ptf in range(0, int(pt)+1): + # self.h_pt.Fill(ptf) + # self.h_ptVabseta.Fill(abs(eta), pt) def fill_norm(self, many=1): # print (f' fill rate norm: {many}') - self.h_norm.Fill(1, many) + self.h_norm.fill(1, weight=many) def normalize(self, norm): nev = self.h_norm.GetBinContent(1) - # print(f' . # ev: {nev}') + print(f' . # ev: {nev}') if(nev != norm): print('normalize to {}'.format(norm)) self.h_norm.Scale(norm/nev) self.h_pt.Scale(norm/nev) self.h_ptVabseta.Scale(norm/nev) - def fill_many(self, data): - if 'pt_em' in data.columns: - # for HGC clusters we use only the EM interpretation of the pT - ROOT.fill1D_rate(self.h_pt, data.pt_em.values) - # print('[RateHistos::fill_many] using pt_em') - else: - ROOT.fill1D_rate(self.h_pt, data.pt.values) - # print('[RateHistos::fill_many] using pt') - class RateHistoCounter(BaseHistos): def __init__(self, name, root_file=None, debug=False): diff --git a/python/plotters.py b/python/plotters.py index 2365f933..7f25eb13 100644 --- a/python/plotters.py +++ b/python/plotters.py @@ -115,8 +115,13 @@ def fill_histos(self, debug=0): # print '------------------' # print self.tp_set.name for selection in self.tp_selections: - sel_clusters = self.tp_set.query(selection) - self.h_rate[selection.name].fill_many(sel_clusters.loc[sel_clusters['pt'].groupby(level='entry', group_keys=False).nlargest(n=1).index, ['pt']]) + sel_clusters = self.tp_set.df + if not selection.all: + # print(selection) + sel_clusters = self.tp_set.df[selection.selection(self.tp_set.df)] + # max_pt_index = ak.argmax(sel_clusters.pt, axis=1, keepdims=True) + # max_pt_per_event = sel_clusters[max_pt_index] + self.h_rate[selection.name].fill(sel_clusters) self.h_rate[selection.name].fill_norm(self.tp_set.new_read_nentries) def fill_histos_event(self, idx, debug=0): @@ -598,7 +603,7 @@ def plotObjectMatch(self, dr_match=match[match.dr2<0.01] for genid in np.unique(ak.flatten(dr_match.gen_idx)): gen_match_id = dr_match[dr_match.gen_idx == genid] - dpt_min_index = ak.Array(ak.argmin(gen_match_id.dpt, axis=1, keepdims=True)) + dpt_min_index = ak.argmin(gen_match_id.dpt, axis=1, keepdims=True) best_match_id = gen_match_id[dpt_min_index] matched_obj = objects[best_match_id.ele_idx] matched_gen = gen[best_match_id.gen_idx] diff --git a/python/selections.py b/python/selections.py index e0af30a0..84bf3fab 100644 --- a/python/selections.py +++ b/python/selections.py @@ -412,7 +412,7 @@ def compare_selections(sel1, sel2): # # Selection('R0', 'R0', 'reachedEE >0 ') # ] -other_selections = [ +eta_sel = [ Selection('EtaA', '1.49 < |#eta^{TOBJ}| <= 1.52', lambda array: (1.49 < abs(array.eta)) & (abs(array.eta) <= 1.52)), Selection('EtaB', '1.52 < |#eta^{TOBJ}| <= 1.7', lambda array: (1.52 < abs(array.eta)) & (abs(array.eta) <= 1.7)), Selection('EtaC', '1.7 < |#eta^{TOBJ}| <= 2.4', lambda array: (1.7 < abs(array.eta)) & (abs(array.eta) <= 2.4)), @@ -630,13 +630,13 @@ def compare_selections(sel1, sel2): ] iso_sel = [ - Selection('Iso0p2', 'iso_{tk}<=0.2', 'tkIso <= 0.2'), - Selection('Iso0p1', 'iso_{tk}<=0.1', 'tkIso <= 0.1'), - Selection('Iso0p3', 'iso_{tk}<=0.3', 'tkIso <= 0.3'), - Selection('IsoEleEB', 'iso_{tk}<=0.13', 'tkIso <= 0.13'), - Selection('IsoEleEE', 'iso_{tk}<=0.28', 'tkIso <= 0.28'), - Selection('IsoPhoEB', 'iso_{tk}<=0.25', 'tkIso <= 0.25'), - Selection('IsoPhoEE', 'iso_{tk}<=0.205', 'tkIso <= 0.205'), + Selection('Iso0p2', 'iso_{tk}<=0.2', lambda ar: ar.tkIso <= 0.2), + Selection('Iso0p1', 'iso_{tk}<=0.1', lambda ar: ar.tkIso <= 0.1), + Selection('Iso0p3', 'iso_{tk}<=0.3', lambda ar: ar.tkIso <= 0.3), + Selection('IsoEleEB', 'iso_{tk}<=0.13', lambda ar: ar.tkIso <= 0.13), + Selection('IsoEleEE', 'iso_{tk}<=0.28', lambda ar: ar.tkIso <= 0.28), + Selection('IsoPhoEB', 'iso_{tk}<=0.25', lambda ar: ar.tkIso <= 0.25), + Selection('IsoPhoEE', 'iso_{tk}<=0.205', lambda ar: ar.tkIso <= 0.205), # Selection('IsoEleMenu', 'iso_{tk}<=(0.13,0.28)', '((abs(eta) < 1.479) & (tkIso <= 0.13)) | ((abs(eta) > 1.479) & (tkIso <= 0.28))'), # Selection('IsoPhoMenu', 'iso_{tk}<=(0.25,0.205)', '((abs(eta) < 1.479) & (tkIso <= 0.25)) | ((abs(eta) > 1.479) & (tkIso <= 0.205))'), ] diff --git a/python/tree_reader.py b/python/tree_reader.py index 852128c5..9997c2ce 100644 --- a/python/tree_reader.py +++ b/python/tree_reader.py @@ -58,11 +58,12 @@ def next(self, debug=0): else: self.file_entry += 1 self.global_entry += 1 - self.n_tot_entries += 1 # entry is the cursor in the file: when we open a new one (not the first) needs to be set to 0 again - if debug >= 2 or self.global_entry % 100 == 0: + if debug >= 2 or self.global_entry % 1000 == 0: self.printEntry() + + self.n_tot_entries += 1 return True def printEntry(self): From 7b4a59c60dd9115f1e4a31cf7e7c9b7e929ef1d4 Mon Sep 17 00:00:00 2001 From: Gianluca Date: Fri, 2 Jun 2023 11:55:42 +0200 Subject: [PATCH 07/18] Consolidate migration to awkward arrays, port more plotters and evolve configs --- cfg/datasets/ntp_v91.yaml | 2 +- cfg/decodedtk.py | 176 +++++--------------------------- cfg/decodedtk.yaml | 29 +++++- cfg/egplots.py | 6 +- cfg/egvalid.py | 24 +++-- cfg/egvalid.yaml | 8 +- cfg/rate.py | 16 ++- cfg/rate.yaml | 11 +- data/rate_pt_wps_v160A.91G.json | 1 + python/collections.py | 11 +- python/l1THistos.py | 93 +++++++++-------- python/plotters_config.py | 12 --- python/selections.py | 53 +++++----- python/tree_reader.py | 2 + 14 files changed, 180 insertions(+), 264 deletions(-) create mode 100644 data/rate_pt_wps_v160A.91G.json diff --git a/cfg/datasets/ntp_v91.yaml b/cfg/datasets/ntp_v91.yaml index a7897992..768baaf3 100644 --- a/cfg/datasets/ntp_v91.yaml +++ b/cfg/datasets/ntp_v91.yaml @@ -8,7 +8,7 @@ samples: # tree_name: hgcalTriggerNtuplizer/HGCalTriggerNtuple tree_name: l1EGTriggerNtuplizer_l1tCorr/L1TEGTriggerNtuple - rate_pt_wps: data/rate_pt_wps_v152B.90A.json + rate_pt_wps: data/rate_pt_wps_v160A.91G.json # tree_name: l1CaloTriggerNtuplizer/HGCalTriggerNtuple # doubleele_flat1to100_PU0: diff --git a/cfg/decodedtk.py b/cfg/decodedtk.py index 2bb71ed5..25ebce15 100644 --- a/cfg/decodedtk.py +++ b/cfg/decodedtk.py @@ -3,156 +3,32 @@ import python.collections as collections import python.selections as selections -sim_eg_match_ee_selections = (selections.Selector('^EGq[4-5]$')*('^Pt[1-3][0]$|all'))() -gen_ee_tk_selections = (selections.Selector('GEN$')*('Ee$')*('^Eta[A-C]$|EtaBC$|all')+selections.Selector('GEN$')*('Ee$')*('Pt15|Pt30'))() -gen_ee_selections = (selections.Selector('GEN$')*('Ee')*('^Eta[BC]+[CD]$|^Eta[A-D]$|all')+selections.Selector('GEN$')*('Ee')*('^Pt15|^Pt30'))() - -tdrsim_eg_genmatched = [ - plotters.EGGenMatchPlotter( - collections.egs_EE, collections.gen_parts, - sim_eg_match_ee_selections, gen_ee_selections), - # plotters.EGGenMatchPlotter( - # collections.egs_EB, collections.gen_parts, - # selections.eg_id_pt_eb_selections, selections.gen_eb_selections), - plotters.EGGenMatchPlotter( - collections.tkeles_EE, collections.gen_parts, - sim_eg_match_ee_selections, gen_ee_tk_selections), - plotters.EGGenMatchPlotter( - collections.tkeles_EB, collections.gen_parts, - selections.eg_id_pt_eb_selections, selections.gen_eb_selections), - plotters.EGGenMatchPlotter( - collections.tkem_EE, collections.gen_parts, - sim_eg_match_ee_selections, gen_ee_tk_selections), - plotters.EGGenMatchPlotter( - collections.tkem_EB, collections.gen_parts, - selections.eg_id_pt_eb_selections, selections.gen_eb_selections), +dectk_selections = (selections.Selector('^Eta[AB]*[BC]$|all')*('^Pt[1,2,5][0]$|all'))() +dectk_match_selections = (selections.Selector('^Pt5$|^Pt[1,2,5][0]$|all'))() +track_selections = (selections.Selector('^TkCTL1|all')&('^Pt5$|^Pt[1,2,5][0]$|all'))() + +decTk_plotters = [ + plotters.DecTkPlotter( + collections.decTk, + dectk_selections + ), + plotters.DecTrackGenMatchPlotter( + collections.decTk, + collections.sim_parts, + dectk_match_selections, + selections.gen_ee_tk_selections + ) ] -# FIXME: should become in newer versions -# l1tc_match_ee_selections = (selections.Selector('^EGq[1,3]$')*('^Pt[1-2][0]$|all'))() -l1tc_match_ee_selections = (selections.Selector('^EGq[1,3]$')*('^Pt[1-2][0]$|all'))() - -l1tc_eg_genmatched = [ - plotters.EGGenMatchPlotter( - collections.EGStaEE, collections.sim_parts, - l1tc_match_ee_selections, gen_ee_selections), - plotters.EGGenMatchPlotter( - collections.TkEleEE, collections.sim_parts, - l1tc_match_ee_selections, gen_ee_tk_selections), - plotters.EGGenMatchPlotter( - collections.TkEleEB, collections.sim_parts, - selections.eg_id_pt_eb_selections, selections.gen_eb_selections), - plotters.EGGenMatchPlotter( - collections.TkEmEE, collections.sim_parts, - l1tc_match_ee_selections, gen_ee_tk_selections), - plotters.EGGenMatchPlotter( - collections.TkEmEB, collections.sim_parts, - selections.eg_id_pt_eb_selections, selections.gen_eb_selections), +tk_plotters = [ + plotters.TrackPlotter( + collections.tracks, + track_selections + ), + plotters.TrackGenMatchPlotter( + collections.tracks, + collections.sim_parts, + track_selections, + selections.gen_ee_tk_selections + ) ] - -# FIXME: this one can be dropped in newer versions -l1tc_fw_match_ee_selections = (selections.Selector('^EGq[2,4]or[3,5]$')*('^Pt[1-2][0]$|all'))() - -l1tc_fw_eg_genmatched = [ - # plotters.EGGenMatchPlotter( - # collections.egs_EE_pfnf, collections.gen_parts, - # l1tc_fw_match_ee_selections, gen_ee_selections), - # plotters.EGGenMatchPlotter( - # collections.tkeles_EE_pfnf, collections.gen_parts, - # l1tc_fw_match_ee_selections, gen_ee_tk_selections), - plotters.EGGenMatchPlotter( - collections.tkeles_EB_pfnf, collections.gen_parts, - selections.eg_id_pt_eb_selections, selections.gen_eb_selections), - # plotters.EGGenMatchPlotter( - # collections.tkem_EE_pfnf, collections.gen_parts, - # l1tc_fw_match_ee_selections, gen_ee_tk_selections), - # plotters.EGGenMatchPlotter( - # collections.tkem_EB_pfnf, collections.gen_parts, - # selections.eg_id_pt_eb_selections, selections.gen_eb_selections), - -] - -l1tc_rate_pt_wps = [ - plotters.EGGenMatchPtWPSPlotter( - collections.EGStaEE, collections.sim_parts, - gen_ee_selections), - plotters.EGGenMatchPtWPSPlotter( - collections.TkEleEE, collections.sim_parts, - gen_ee_tk_selections), - plotters.EGGenMatchPtWPSPlotter( - collections.TkEleEB, collections.sim_parts, - selections.gen_eb_selections), - plotters.EGGenMatchPtWPSPlotter( - collections.TkEmEE, collections.sim_parts, - gen_ee_tk_selections), - plotters.EGGenMatchPtWPSPlotter( - collections.TkEmEB, collections.sim_parts, - selections.gen_eb_selections), -] - - -egid_sta_selections = (selections.Selector('^IDTightS|all')*('^Pt[1-4][0]$|all'))() -egid_iso_tkele_selections = (selections.Selector('^IDTight[E]|all')*('^Pt[1-4][0]$|all'))() -egid_iso_tkpho_selections = (selections.Selector('^IDTight[P]|all')*('^Pt[1-4][0]$|all'))() - - -gen_selections = (selections.Selector('GEN$')*('^Eta[F]$|^Eta[AF][ABCD]*[C]$|all')+selections.Selector('GEN$')*('^Ee|all')*('^Pt15|^Pt30'))() - -# for sels in [l1tc_match_ee_selections, gen_ee_selections, egid_sta_selections, egid_iso_tkele_selections, egid_iso_tkpho_selections,gen_selections]: -# print('--------------------') -# print(f'# of sels: {len(sels)}') -# for sel in sels: -# print(sel) - -l1tc_emu_genmatched = [ - # plotters.EGGenMatchPlotter( - # collections.EGStaEE, collections.sim_parts, - # egid_sta_selections, gen_ee_selections), - # plotters.EGGenMatchPlotter( - # collections.EGStaEB, collections.sim_parts, - # egid_sta_selections, selections.gen_eb_selections), - plotters.EGGenMatchPlotter( - collections.TkEleEE, collections.sim_parts, - egid_iso_tkele_selections, gen_ee_tk_selections), - plotters.EGGenMatchPlotter( - collections.TkEleEB, collections.sim_parts, - egid_iso_tkele_selections, selections.gen_eb_selections), - plotters.EGGenMatchPlotter( - collections.TkEmEE, collections.sim_parts, - egid_iso_tkpho_selections, gen_ee_tk_selections), - plotters.EGGenMatchPlotter( - collections.TkEmEB, collections.sim_parts, - egid_iso_tkpho_selections, selections.gen_eb_selections), - plotters.EGGenMatchPlotter( - collections.TkEmL2, collections.sim_parts, - egid_iso_tkpho_selections, selections.gen_selections), - plotters.EGGenMatchPlotter( - collections.TkEleL2, collections.sim_parts, - egid_iso_tkele_selections, selections.gen_selections), - -] - - -l1tc_emu_rate_pt_wps = [ - # plotters.EGGenMatchPtWPSPlotter( - # collections.EGStaEE, collections.sim_parts, - # gen_ee_selections), - # plotters.EGGenMatchPtWPSPlotter( - # collections.TkEleEE, collections.sim_parts, - # gen_ee_tk_selections), - # # plotters.EGGenMatchPtWPSPlotter( - # collections.TkEleEB, collections.sim_parts, - # selections.gen_eb_selections), - # plotters.EGGenMatchPtWPSPlotter( - # collections.TkEmEE, collections.sim_parts, - # gen_ee_tk_selections), - # plotters.EGGenMatchPtWPSPlotter( - # collections.TkEmEB, collections.sim_parts, - # selections.gen_eb_selections), - plotters.EGGenMatchPtWPSPlotter( - collections.TkEmL2, collections.sim_parts, - gen_selections), - plotters.EGGenMatchPtWPSPlotter( - collections.TkEleL2, collections.sim_parts, - gen_selections), -] \ No newline at end of file diff --git a/cfg/decodedtk.yaml b/cfg/decodedtk.yaml index 3d139c60..90514115 100644 --- a/cfg/decodedtk.yaml +++ b/cfg/decodedtk.yaml @@ -7,7 +7,7 @@ common: triolet: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v153A + plot_version: v160A run_clustering: False run_density_computation: False # +AccountingGroup = "group_u_CMS.u_zh.users" @@ -28,7 +28,7 @@ collections: # - photon_flat8to150_PU200 # - dyll_PU200 plotters: - - !!python/name:python.plotters_config.decTk_plotters + - !!python/name:cfg.decodedtk.decTk_plotters - !!python/name:cfg.egvalid.l1tc_emu_genmatched htc_jobflavor: microcentury @@ -40,3 +40,28 @@ collections: events_per_job: doubleele_flat1to100_PU0: 10000 doubleele_flat1to100_PU200: 30000 + + l1tk: + file_label: + dtk + samples: + # - ele_flat2to100_PU0 + # - ele_flat2to100_PU200 + # - doubleele_flat1to100_PU0 + - doubleele_flat1to100_PU200 + # - nugun_alleta_pu200 + # - photon_flat8to150_PU0 + # - photon_flat8to150_PU200 + # - dyll_PU200 + plotters: + - !!python/name:cfg.decodedtk.tk_plotters + htc_jobflavor: + microcentury + priorities: + ele_flat2to100_PU0: 1 + ele_flat2to100_PU200: 5 + doubleele_flat1to100_PU0: 2 + doubleele_flat1to100_PU200: 7 + events_per_job: + doubleele_flat1to100_PU0: 10000 + doubleele_flat1to100_PU200: 30000 diff --git a/cfg/egplots.py b/cfg/egplots.py index 6e0cf58d..163701f1 100644 --- a/cfg/egplots.py +++ b/cfg/egplots.py @@ -6,8 +6,8 @@ # simple_selections = (selections.Selector('^EGq[4-5]$')*('^Pt[1-3][0]$|all'))() -simple_selections = [selections.Selection("all", '', ''), - selections.Selection('Pt10', 'p_{T}^{TOBJ}>=10GeV', 'pt >= 10'),] +simple_selections = [selections.Selection("all", '', None), + selections.Selection('Pt5', 'p_{T}^{TOBJ}>=5GeV', lambda array : array.pt >= 5),] sta_selection = (selections.Selector('^IDTight[EPS]|all')*selections.Selector('^Pt5|all')*selections.Selector('^EtaABC$|all'))() # print(f"simple_selections: {simple_selections}") @@ -19,7 +19,9 @@ # plotters.TkElePlotter(collections.TkEleEE, egid_iso_etatk_selections), # plotters.TkElePlotter(collections.TkEleEB, egid_iso_etatk_selections), # plotters.TkElePlotter(collections.TkEleL2, egid_iso_etatk_selections), + plotters.EGPlotter(collections.TkEleEE, sta_selection), + # plotters.EGPlotter(collections.TkEleEE, simple_selections), # plotters.EGPlotter(collections.TkEmEE, sta_selection), # plotters.EGPlotter(collections.TkEmEB, sta_selection), diff --git a/cfg/egvalid.py b/cfg/egvalid.py index e8a122eb..998e6a7a 100644 --- a/cfg/egvalid.py +++ b/cfg/egvalid.py @@ -149,15 +149,15 @@ ] l1tc_l1emu_ee_genmatched = [ - plotters.EGGenMatchPlotter( - collections.EGStaEE, collections.sim_parts, - egid_sta_selections, gen_ee_selections), + # plotters.EGGenMatchPlotter( + # collections.EGStaEE, collections.sim_parts, + # egid_sta_selections, gen_ee_selections), plotters.EGGenMatchPlotter( collections.TkEleEE, collections.sim_parts, egid_iso_tkele_comp_selections, gen_ee_tk_selections), - plotters.EGGenMatchPlotter( - collections.TkEmEE, collections.sim_parts, - egid_iso_tkpho_selections, gen_ee_tk_selections), + # plotters.EGGenMatchPlotter( + # collections.TkEmEE, collections.sim_parts, + # egid_iso_tkpho_selections, gen_ee_tk_selections), ] l1tc_l1emu_ee_ell_genmatched = [ @@ -177,9 +177,9 @@ ] l1tc_l2emu_ell_genmatched = [ - plotters.EGGenMatchPlotter( - collections.TkEmL2Ell, collections.sim_parts, - egid_iso_tkpho_selections, selections.gen_selections), + # plotters.EGGenMatchPlotter( + # collections.TkEmL2Ell, collections.sim_parts, + # egid_iso_tkpho_selections, selections.gen_selections), plotters.EGGenMatchPlotter( collections.TkEleL2Ell, collections.sim_parts, egid_iso_tkele_selections, selections.gen_selections), @@ -215,6 +215,12 @@ # plotters.EGGenMatchPtWPSPlotter( # collections.TkEmEB, collections.sim_parts, # selections.gen_eb_selections), + plotters.EGGenMatchPtWPSPlotter( + collections.TkEleEE, collections.sim_parts, + gen_selections), + plotters.EGGenMatchPtWPSPlotter( + collections.TkEleEllEE, collections.sim_parts, + gen_selections), plotters.EGGenMatchPtWPSPlotter( collections.TkEmL2, collections.sim_parts, gen_selections), diff --git a/cfg/egvalid.yaml b/cfg/egvalid.yaml index 36e3a6db..b3037059 100644 --- a/cfg/egvalid.yaml +++ b/cfg/egvalid.yaml @@ -164,12 +164,12 @@ collections: # - photon_flat8to150_PU200 # - dyll_PU200 plotters: - - !!python/name:cfg.egvalid.l1tc_l1emu_eb_genmatched + # - !!python/name:cfg.egvalid.l1tc_l1emu_eb_genmatched - !!python/name:cfg.egvalid.l1tc_l1emu_ee_genmatched - !!python/name:cfg.egvalid.l1tc_l2emu_genmatched - - !!python/name:cfg.egvalid.l1tc_l1emu_ee_ell_genmatched - - !!python/name:cfg.egvalid.l1tc_l2emu_ell_genmatched - - !!python/name:cfg.egvalid.l1tc_emu_rate_pt_wps + # - !!python/name:cfg.egvalid.l1tc_l1emu_ee_ell_genmatched + # - !!python/name:cfg.egvalid.l1tc_l2emu_ell_genmatched + # - !!python/name:cfg.egvalid.l1tc_emu_rate_pt_wps htc_jobflavor: longlunch priorities: diff --git a/cfg/rate.py b/cfg/rate.py index f8719793..e5d6ddbc 100644 --- a/cfg/rate.py +++ b/cfg/rate.py @@ -91,7 +91,7 @@ egid_iso_etatk_selections = (selections.Selector('^IDTight[EP]|all')*selections.Selector('^Iso|all')*selections.Selector('^Eta[F]$|^Eta[AF][ABCD]*[C]$'))() egid_menu_ele_selections = (selections.Selector('^MenuEle')*selections.Selector('^EtaE[BE]$|all'))() -egid_menu_pho_selections = (selections.Selector('^MenuPho')*selections.Selector('^EtaE[BE]$|all'))() +egid_menu_pho_selections = (selections.Selector('^MenuPho|^MenuSta')*selections.Selector('^EtaE[BE]$|all'))() egid_menu_ele_rate_selections = (selections.Selector('^SingleIsoTkEle|^SingleTkEle')*selections.Selector('^EtaE[BE]$|all'))() egid_menu_pho_rate_selections = (selections.Selector('^SingleIsoTkPho|^SingleEGEle')*selections.Selector('^EtaE[BE]$|all'))() @@ -112,21 +112,33 @@ # for sel in egid_iso_etatk_selections: # print(sel) -eg_emuCTl1_plotters = [ +eg_emuCTl1_sta_plotters = [ plotters.RatePlotter( collections.EGStaEE, egid_eta_ee_selections), plotters.RatePlotter( collections.EGStaEB, egid_eta_eb_selections), +] + +eg_emuCTl1_pho_plotters = [ plotters.RatePlotter( collections.TkEmEE, egid_iso_eta_eetk_selections), plotters.RatePlotter( collections.TkEmEB, egid_iso_eta_eb_selections), +] + +eg_emuCTl1_ele_plotters = [ plotters.RatePlotter( collections.TkEleEE, egid_iso_eta_eetk_selections_comp), plotters.RatePlotter( collections.TkEleEB, egid_iso_eta_eb_selections), ] +eg_emuCTl1_plotters = [] +eg_emuCTl1_plotters.extend(eg_emuCTl1_sta_plotters) +eg_emuCTl1_plotters.extend(eg_emuCTl1_pho_plotters) +eg_emuCTl1_plotters.extend(eg_emuCTl1_ele_plotters) + + eg_emuCTl2_plotters = [ plotters.RatePlotter( collections.TkEmL2, egid_iso_etatk_selections), diff --git a/cfg/rate.yaml b/cfg/rate.yaml index 20b2b002..99888fe9 100644 --- a/cfg/rate.yaml +++ b/cfg/rate.yaml @@ -81,10 +81,11 @@ collections: samples: - nugun_alleta_pu200 plotters: - # - !!python/name:cfg.rate.eg_emu_plotters - - !!python/name:cfg.rate.eg_emuCTl1_plotters - - !!python/name:cfg.rate.eg_emuCTl2_plotters - # - !!python/name:cfg.rate.eg_emuCTl1_ell_plotters + # - !!python/name:cfg.rate.eg_emuCTl1_sta_plotters + - !!python/name:cfg.rate.eg_emuCTl1_ele_plotters + # - !!python/name:cfg.rate.eg_emuCTl1_pho_plotters + # - !!python/name:cfg.rate.eg_emuCTl2_plotters + - !!python/name:cfg.rate.eg_emuCTl1_ell_plotters # - !!python/name:cfg.rate.eg_emuCTl2_ell_plotters htc_jobflavor: microcentury @@ -110,7 +111,7 @@ collections: eg_rate_menu: file_label: - rate + ratemenu samples: - nugun_alleta_pu200 plotters: diff --git a/data/rate_pt_wps_v160A.91G.json b/data/rate_pt_wps_v160A.91G.json new file mode 100644 index 00000000..0aaa5983 --- /dev/null +++ b/data/rate_pt_wps_v160A.91G.json @@ -0,0 +1 @@ +{"TkEleEE": {"EtaABC": {"9": 41.0, "20": 32.0, "30": 29.0}, "IDTightEEtaABC": {"9": 27.0, "20": 99.0, "30": 99.0}, "IDCompWP955EtaABC": {"9": 32.0, "20": 24.0, "30": 19.0}}, "TkEleEllEE": {"IDTightEEtaABC": {"9": 28.0, "20": 22.0, "30": 19.0}, "EtaABC": {"9": 34.0, "20": 27.0, "30": 23.0}}, "TkEleEB": {"EtaF": {"9": 47.0, "20": 37.0, "30": 32.0}, "IDTightEEtaF": {"9": 37.0, "20": 28.0, "30": 26.0}}} \ No newline at end of file diff --git a/python/collections.py b/python/collections.py index a8ae7dd8..6dfa27f1 100644 --- a/python/collections.py +++ b/python/collections.py @@ -199,8 +199,7 @@ def fill(self, event, weight_file=None, debug=0): self.new_read = False if self.debug > 0: - if event.file_entry in self.df.index.get_level_values('entry'): - df_print = self.df.loc[event.file_entry] + df_print = ak.to_dataframe(self.df[event.file_entry]) debugPrintOut(max(debug, self.debug), self.label, toCount=df_print, toPrint=self.print_function(df_print), @@ -1343,8 +1342,16 @@ def build_double_obj(obj): filler_function=lambda event, entry_block: event.getDataFrame( prefix='TkEleEE', entry_block=entry_block), fixture_function=quality_ele_fixtures, + print_function=lambda df:df.columns, debug=0) +# Index(['pt', 'energy', 'eta', 'phi', 'tkIso', 'pfIso', 'puppiIso', 'tkChi2', +# 'tkPt', 'tkZ0', 'compBDTScore', 'compBdt', 'compHoe', 'compSrrtot', +# 'compDeta', 'compDphi', 'compDpt', 'compMeanz', 'compNstubs', +# 'compChi2RPhi', 'compChi2RZ', 'compChi2Bend', 'dpt', 'hwQual', +# 'IDTightSTA', 'IDTightEle', 'IDTightPho', 'IDNoBrem', 'IDBrem'], +# dtype='object') + TkEleEB = DFCollection( name='TkEleEB', label='TkEle EB', filler_function=lambda event, entry_block: event.getDataFrame( diff --git a/python/l1THistos.py b/python/l1THistos.py index 874c5cc1..7f186c5c 100644 --- a/python/l1THistos.py +++ b/python/l1THistos.py @@ -284,7 +284,7 @@ def __init__(self, name, root_file=None, debug=False): setattr(self, attr_1d+'_graph', GraphBuilder(self, attr_1d)) if root_file is not None: - self.normalize(31000) + self.normalize(2760.0*11246/1000) # self.h_simenergy = bh.TH1F(name+'_energy', 'Digi sim-energy (GeV)', 100, 0, 2) def fill(self, data): @@ -304,12 +304,11 @@ def fill_norm(self, many=1): def normalize(self, norm): nev = self.h_norm.GetBinContent(1) - print(f' . # ev: {nev}') if(nev != norm): - print('normalize to {}'.format(norm)) + print(f'normalize # ev {nev} to {norm}') self.h_norm.Scale(norm/nev) self.h_pt.Scale(norm/nev) - self.h_ptVabseta.Scale(norm/nev) + # self.h_ptVabseta.Scale(norm/nev) class RateHistoCounter(BaseHistos): @@ -746,34 +745,46 @@ def fill(self, tkegs): class TrackHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): if not root_file: - self.h_pt = bh.TH1F(name+'_pt', 'Track Pt (GeV); p_{T} [GeV]', 100, 0, 100) - self.h_eta = bh.TH1F(name+'_eta', 'Track eta; #eta;', 100, -4, 4) - self.h_chi2 = bh.TH1F(name+'_chi2', 'Track chi2; #Chi^{2}', 1000, 0, 1000) - self.h_chi2Red = bh.TH1F(name+'_chi2Red', 'Track chi2 red; red. #Chi^{2}', 100, 0, 100) - self.h_nstubs = bh.TH1F(name+'_nstubs', 'Track # stubs; # stubs', 10, 0, 10) - self.h_z0 = bh.TH1F(name+'_z0', 'Track z0; z_{0} [cm]', 100, -10, 10) - self.h_chi2RedVeta = bh.TH2F(name+'_chi2RedVeta', 'Track chi2 red. v eta; #eta; red. #Chi^{2}', 100, -4, 4, 100, 0, 100) - self.h_nstubsVeta = bh.TH2F(name+'_nstubsVeta', 'Track # stubs vs eta; #eta; # stubs', 100, -4, 4, 10, 0, 10) - self.h_z0Veta = bh.TH2F(name+'_z0Veta', 'Track z0 vs eta; #eta; z_{0} [cm]', 100, -4, 4, 100, -10, 10) - self.h_chi2RedVpt = bh.TH2F(name+'_chi2RedVpt', 'Track chi2 red. v pT; p_{T} [GeV]; red. #Chi^{2}', 100, 0, 100, 100, 0, 100) - self.h_nstubsVpt = bh.TH2F(name+'_nstubsVpt', 'Track # stubs vs pT; p_{T} [GeV]; # stubs', 100, 0, 100, 10, 0, 10) - self.h_z0Vpt = bh.TH2F(name+'_z0Vpt', 'Track z0 vs pT; p_{T} [GeV]; z_{0} [cm]', 100, 0, 100, 100, -10, 10) + self.h_pt = bh.TH1F(name+'_pt', + 'Track Pt (GeV); p_{T} [GeV]', 100, 0, 100) + self.h_eta = bh.TH1F(name+'_eta', + 'Track eta; #eta;', 100, -4, 4) + self.h_chi2 = bh.TH1F(name+'_chi2', + 'Track chi2; #Chi^{2}', 1000, 0, 1000) + self.h_chi2Red = bh.TH1F(name+'_chi2Red', + 'Track chi2 red; red. #Chi^{2}', 100, 0, 100) + self.h_nstubs = bh.TH1F(name+'_nstubs', + 'Track # stubs; # stubs', 10, 0, 10) + self.h_z0 = bh.TH1F(name+'_z0', + 'Track z0; z_{0} [cm]', 100, -10, 10) + self.h_chi2RedVeta = bh.TH2F(name+'_chi2RedVeta', + 'Track chi2 red. v eta; #eta; red. #Chi^{2}', 100, -4, 4, 100, 0, 100) + self.h_nstubsVeta = bh.TH2F(name+'_nstubsVeta', + 'Track # stubs vs eta; #eta; # stubs', 100, -4, 4, 10, 0, 10) + self.h_z0Veta = bh.TH2F(name+'_z0Veta', + 'Track z0 vs eta; #eta; z_{0} [cm]', 100, -4, 4, 100, -10, 10) + self.h_chi2RedVpt = bh.TH2F(name+'_chi2RedVpt', + 'Track chi2 red. v pT; p_{T} [GeV]; red. #Chi^{2}', 100, 0, 100, 100, 0, 100) + self.h_nstubsVpt = bh.TH2F(name+'_nstubsVpt', + 'Track # stubs vs pT; p_{T} [GeV]; # stubs', 100, 0, 100, 10, 0, 10) + self.h_z0Vpt = bh.TH2F(name+'_z0Vpt', + 'Track z0 vs pT; p_{T} [GeV]; z_{0} [cm]', 100, 0, 100, 100, -10, 10) BaseHistos.__init__(self, name, root_file, debug) def fill(self, tracks): - rnp.fill_hist(self.h_pt, tracks.pt) - rnp.fill_hist(self.h_eta, tracks.eta) - rnp.fill_hist(self.h_chi2, tracks.chi2) - rnp.fill_hist(self.h_chi2Red, tracks.chi2Red) - rnp.fill_hist(self.h_nstubs, tracks.nStubs) - rnp.fill_hist(self.h_z0, tracks.z0) - rnp.fill_hist(self.h_chi2RedVeta, tracks[['eta', 'chi2Red']]) - rnp.fill_hist(self.h_nstubsVeta, tracks[['eta', 'nStubs']]) - rnp.fill_hist(self.h_z0Veta, tracks[['eta', 'z0']]) - rnp.fill_hist(self.h_chi2RedVpt, tracks[['pt', 'chi2Red']]) - rnp.fill_hist(self.h_nstubsVpt, tracks[['pt', 'nStubs']]) - rnp.fill_hist(self.h_z0Vpt, tracks[['pt', 'z0']]) + bh.fill_1Dhist(self.h_pt, tracks.pt) + bh.fill_1Dhist(self.h_eta, tracks.eta) + bh.fill_1Dhist(self.h_chi2, tracks.chi2) + bh.fill_1Dhist(self.h_chi2Red, tracks.chi2Red) + bh.fill_1Dhist(self.h_nstubs, tracks.nStubs) + bh.fill_1Dhist(self.h_z0, tracks.z0) + bh.fill_2Dhist(self.h_chi2RedVeta, tracks.eta, tracks.chi2Red) + bh.fill_2Dhist(self.h_nstubsVeta, tracks.eta, tracks.nStubs) + bh.fill_2Dhist(self.h_z0Veta, tracks.eta, tracks.z0) + bh.fill_2Dhist(self.h_chi2RedVpt, tracks.pt, tracks.chi2Red) + bh.fill_2Dhist(self.h_nstubsVpt, tracks.pt, tracks.nStubs) + bh.fill_2Dhist(self.h_z0Vpt, tracks.pt, tracks.z0) class TriggerTowerHistos(BaseHistos): @@ -1194,32 +1205,20 @@ def __init__(self, name, root_file=None, debug=False): BaseResoHistos.__init__(self, name, root_file, debug) def fill(self, reference, target): - # target_pt, target_eta, target_phi = \ - # target[['pt', 'eta', 'phi']].values[0] - # reference_pt, reference_eta, reference_phi = \ - # reference[['pt', 'eta', 'phi']].values - target_line = target.iloc[0] - - target_pt = target_line.pt - target_eta = target_line.eta - target_phi = target_line.phi - reference_pt = reference.pt - reference_eta = reference.eta - reference_phi = reference.phi - self.h_ptResVpt.Fill(reference_pt, target_pt-reference_pt) - self.h_ptResp.Fill(target_pt/reference_pt) - self.h_ptRespVeta.Fill(reference_eta, target_pt/reference_pt) - self.h_ptRespVpt.Fill(reference_pt, target_pt/reference_pt) + bh.fill_2Dhist(self.h_ptResVpt, reference.pt, target.pt-reference.pt) + bh.fill_1Dhist(self.h_ptResp, target.pt/reference.pt) + bh.fill_2Dhist(self.h_ptRespVeta, reference.eta, target.pt/reference.pt) + bh.fill_2Dhist(self.h_ptRespVpt, reference.pt, target.pt/reference.pt) # self.h_pt2stResVpt.Fill(reference.pt, target.pt2stubs-reference.pt) # self.h_pt2stResp.Fill(target.pt2stubs/reference.pt) # self.h_pt2stRespVeta.Fill(reference.eta, target.pt2stubs/reference.pt) # self.h_pt2stRespVpt.Fill(reference.pt, target.pt2stubs/reference.pt) - self.h_etaRes.Fill(target_eta - reference_eta) - self.h_phiRes.Fill(target_phi - reference_phi) - self.h_drRes.Fill(np.sqrt((reference_phi-target_phi)**2+(reference_eta-target_eta)**2)) + bh.fill_1Dhist(self.h_etaRes, (target.eta - reference.eta)) + bh.fill_1Dhist(self.h_phiRes, (target.phi - reference.phi)) + bh.fill_1Dhist(self.h_drRes, np.sqrt((reference.phi-target.phi)**2+(reference.eta-target.eta)**2)) def fill_nMatch(self, n_matches): self.h_nMatch.Fill(n_matches) diff --git a/python/plotters_config.py b/python/plotters_config.py index 437ee74c..03073468 100644 --- a/python/plotters_config.py +++ b/python/plotters_config.py @@ -364,18 +364,6 @@ ), ] -decTk_plotters = [ - plotters.DecTkPlotter( - collections.decTk, - selections.dectk_selections - ), - plotters.DecTrackGenMatchPlotter( - collections.decTk, - collections.gen_parts, - selections.dectk_match_selections, - selections.gen_ee_tk_selections - ) -] diff --git a/python/selections.py b/python/selections.py index 84bf3fab..5cf88445 100644 --- a/python/selections.py +++ b/python/selections.py @@ -496,11 +496,8 @@ def compare_selections(sel1, sel2): ] eg_eta_sel = [ Selection('all'), - # Selection('EtaF', '|#eta^{TOBJ}| <= 1.479', 'abs(eta) <= 1.479'), - # Selection('EtaA', ' 1.479 < |#eta^{TOBJ}| <= 1.52', '(abs(eta) <= 1.52) & abs(eta) > 1.479'), - Selection('EtaBC', '1.52 < |#eta^{TOBJ}| <= 2.4', '1.52 < abs(eta) <= 2.4'), - Selection('EtaEB', '|#eta^{TOBJ}| <= 1.479', 'abs(eta) <= 1.479'), - Selection('EtaEE', '1.479 < |#eta^{TOBJ}| <= 2.4', '(abs(eta) > 1.479) & (abs(eta) <= 2.4)'), + Selection('EtaEB', '|#eta^{TOBJ}| <= 1.479', lambda ar: abs(ar.eta) <= 1.479), + Selection('EtaEE', '1.479 < |#eta^{TOBJ}| <= 2.4', lambda ar: (abs(ar.eta) > 1.479) & (abs(ar.eta) <= 2.4)), ] eg_id_ee_selections = [ @@ -544,6 +541,7 @@ def compare_selections(sel1, sel2): Selection('TkPt2Chi2Pt10', '(p_{T}^{TOBJ} > 2GeV & #Chi^{2}_{norm} < 15) | p_{T}^{TOBJ} > 10GeV ', '((pt > 2) & (chi2Red < 15) | (pt > 10)) & (nStubs >= 4)'), Selection('TkPt5', 'p_{T}^{TOBJ} > 5GeV', '(pt > 5)'), Selection('TkPt10', 'p_{T}^{TOBJ} > 10GeV', '(pt > 10)'), + Selection('TkCTL1', '(p_{T}^{TOBJ} > 2GeV & #Chi^{2}_{norm} < 15) | p_{T}^{TOBJ} > 5GeV ', lambda ar: ((ar.pt > 2) & (ar.chi2Red < 15) | (ar.pt > 5))) ] pf_matchedtk_input_quality = [ @@ -563,31 +561,31 @@ def compare_selections(sel1, sel2): pfeginput_pt = [ Selection('all'), - Selection('Pt1', 'p_{T}^{TOBJ}>=1GeV', 'pt >= 1'), - Selection('Pt2', 'p_{T}^{TOBJ}>=2GeV', 'pt >= 2'), - Selection('Pt5', 'p_{T}^{TOBJ}>=5GeV', 'pt >= 5'), + Selection('Pt1', 'p_{T}^{TOBJ}>=1GeV', lambda ar: ar.pt >= 1), + Selection('Pt2', 'p_{T}^{TOBJ}>=2GeV', lambda ar: ar.pt >= 2), + Selection('Pt5', 'p_{T}^{TOBJ}>=5GeV', lambda ar: ar.pt >= 5), ] # FIXME: these should be done using the actual online to offline threshold scaling from turn-ons menu_thresh_pt = [ - Selection('PtStaEB51', 'p_{T}^{TOBJ}>=51GeV', 'pt >= 40.7'), - Selection('PtStaEE51', 'p_{T}^{TOBJ}>=51GeV', 'pt >= 39.6'), - Selection('PtEleEB36', 'p_{T}^{TOBJ}>=36GeV', 'pt >= 29.8'), - Selection('PtEleEE36', 'p_{T}^{TOBJ}>=36GeV', 'pt >= 28.5'), - Selection('PtEleEB25', 'p_{T}^{TOBJ}>=25GeV', 'pt >= 20.3'), - Selection('PtEleEE25', 'p_{T}^{TOBJ}>=25GeV', 'pt >= 19.5'), - Selection('PtEleEB12', 'p_{T}^{TOBJ}>=12GeV', 'pt >= 9.1'), - Selection('PtEleEE12', 'p_{T}^{TOBJ}>=12GeV', 'pt >= 8.8'), - - Selection('PtIsoEleEB28', 'p_{T}^{TOBJ}>=28GeV', 'pt >= 23.'), - Selection('PtIsoEleEE28', 'p_{T}^{TOBJ}>=28GeV', 'pt >= 22.1'), - Selection('PtIsoPhoEB36', 'p_{T}^{TOBJ}>=36GeV', 'pt >= 30.4'), - Selection('PtIsoPhoEE36', 'p_{T}^{TOBJ}>=36GeV', 'pt >= 29.0'), - - Selection('PtIsoPhoEB22', 'p_{T}^{TOBJ}>=22GeV', 'pt >= 17.6'), - Selection('PtIsoPhoEE22', 'p_{T}^{TOBJ}>=22GeV', 'pt >= 15.9'), - Selection('PtIsoPhoEB12', 'p_{T}^{TOBJ}>=12GeV', 'pt >= 8.5'), - Selection('PtIsoPhoEE12', 'p_{T}^{TOBJ}>=12GeV', 'pt >= 6.'), + Selection('PtStaEB51', 'p_{T}^{TOBJ}>=51GeV', lambda ar: ar.pt >= 40.7), + Selection('PtStaEE51', 'p_{T}^{TOBJ}>=51GeV', lambda ar: ar.pt >= 39.6), + Selection('PtEleEB36', 'p_{T}^{TOBJ}>=36GeV', lambda ar: ar.pt >= 29.8), + Selection('PtEleEE36', 'p_{T}^{TOBJ}>=36GeV', lambda ar: ar.pt >= 28.5), + Selection('PtEleEB25', 'p_{T}^{TOBJ}>=25GeV', lambda ar: ar.pt >= 20.3), + Selection('PtEleEE25', 'p_{T}^{TOBJ}>=25GeV', lambda ar: ar.pt >= 19.5), + Selection('PtEleEB12', 'p_{T}^{TOBJ}>=12GeV', lambda ar: ar.pt >= 9.1), + Selection('PtEleEE12', 'p_{T}^{TOBJ}>=12GeV', lambda ar: ar.pt >= 8.8), + + Selection('PtIsoEleEB28', 'p_{T}^{TOBJ}>=28GeV', lambda ar: ar.pt >= 23.), + Selection('PtIsoEleEE28', 'p_{T}^{TOBJ}>=28GeV', lambda ar: ar.pt >= 22.1), + Selection('PtIsoPhoEB36', 'p_{T}^{TOBJ}>=36GeV', lambda ar: ar.pt >= 30.4), + Selection('PtIsoPhoEE36', 'p_{T}^{TOBJ}>=36GeV', lambda ar: ar.pt >= 29.0), + + Selection('PtIsoPhoEB22', 'p_{T}^{TOBJ}>=22GeV', lambda ar: ar.pt >= 17.6), + Selection('PtIsoPhoEE22', 'p_{T}^{TOBJ}>=22GeV', lambda ar: ar.pt >= 15.9), + Selection('PtIsoPhoEB12', 'p_{T}^{TOBJ}>=12GeV', lambda ar: ar.pt >= 8.5), + Selection('PtIsoPhoEE12', 'p_{T}^{TOBJ}>=12GeV', lambda ar: ar.pt >= 6.), ] @@ -693,6 +691,7 @@ def compare_selections(sel1, sel2): menu_sel = [ + ((Selector('^EtaEB')&('^IDTightE'))|(Selector('^EtaEE')&('^IDTightP'))).one('MenuSta', 'TightID'), ((Selector('^EtaEB')&('^IsoEleEB'))|(Selector('^EtaEE')&('^IsoEleEE')&('^IDTightE'))).one('MenuEleIsoTight', 'Iso TightID'), ((Selector('^EtaEB')&('^IsoEleEB'))|(Selector('^EtaEE')&('^IsoEleEE')&('^IDCompWP955'))).one('MenuEleIsoLoose', 'Iso LooseID'), ((Selector('^EtaEB')&('^IDTightE'))|(Selector('^EtaEE')&('^IDTightE'))).one('MenuEleTight', 'TightID'), @@ -751,8 +750,6 @@ def compare_selections(sel1, sel2): pfeg_eb_input_selections = (Selector('^PFinB|all')*('^Pt[1,2,5]$'))() pftkinput_selections = (Selector('^PFinBRL|^PFinHGC$')*('^TkPt'))() -dectk_selections = (Selector('^Eta[AB]*[BC]$|all')*('^Pt[1,2,5][0]$|all'))() -dectk_match_selections = (Selector('^Pt5$|^Pt[1,2,5][0]$|all'))() egid_ee_selections = (Selector('^EGq[4-5]'))() egid_ee_pfnf_selections = (Selector('^EGq[1-2]$'))() diff --git a/python/tree_reader.py b/python/tree_reader.py index 9997c2ce..7fea0257 100644 --- a/python/tree_reader.py +++ b/python/tree_reader.py @@ -102,6 +102,8 @@ def getDataFrame(self, prefix, entry_block, fallback=None): if len(branches) == 0: if fallback is not None: return self.getDataFrame(prefix=fallback, entry_block=entry_block) + prefs = set([br.split('_')[0] for br in self._branches]) + print(f'stored branch prefixes are: {prefs}') raise ValueError(f'[TreeReader::getDataFrame] No branches with prefix: {prefix}') akarray = self.tree.arrays(names, From 827e8dc2f402ea714437a8db355c5e0d798c95e8 Mon Sep 17 00:00:00 2001 From: Gianluca Date: Fri, 9 Jun 2023 16:46:53 +0200 Subject: [PATCH 08/18] Add base class and ipementations to produce ttrees in plotters --- cfg/compIDtuples.py | 16 ++++++ cfg/compIDtuples.yaml | 44 ++++++++++++++++ python/l1THistos.py | 116 +++++++++++++++++++++++++++++++++++++++--- python/plotters.py | 26 +++++++++- 4 files changed, 194 insertions(+), 8 deletions(-) create mode 100644 cfg/compIDtuples.py create mode 100644 cfg/compIDtuples.yaml diff --git a/cfg/compIDtuples.py b/cfg/compIDtuples.py new file mode 100644 index 00000000..d40fd0a7 --- /dev/null +++ b/cfg/compIDtuples.py @@ -0,0 +1,16 @@ +from __future__ import absolute_import +import python.plotters as plotters +import python.collections as collections +import python.selections as selections + + +# simple_selections = (selections.Selector('^EGq[4-5]$')*('^Pt[1-3][0]$|all'))() + +comp_selections = (selections.Selector('^Pt15|all')&('^EtaABC$|all'))() +sim_selections = (selections.Selector('GEN$')&('^Pt15|all')&('^EtaABC$|all'))() + +compid_plotters = [ + plotters.CompTuplesPlotter(collections.TkEleEE, comp_selections), + plotters.CompCatTuplePlotter(collections.TkEleEE, collections.sim_parts, comp_selections, sim_selections) +] + diff --git a/cfg/compIDtuples.yaml b/cfg/compIDtuples.yaml new file mode 100644 index 00000000..15a967e4 --- /dev/null +++ b/cfg/compIDtuples.yaml @@ -0,0 +1,44 @@ + +common: + output_dir: + default: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ + matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ + Matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ + triolet: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ + output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ + output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ + plot_version: v160A + run_clustering: False + run_density_computation: False +# +AccountingGroup = "group_u_CMS.u_zh.users" +# +AccountingGroup = "group_u_CMST3.all" + +collections: + + compid: + file_label: + compid + samples: + # - ele_flat2to100_PU0 + # - ele_flat2to100_PU200 + # - doubleele_flat1to100_PU0 + - doublephoton_flat1to100_PU200 + - doubleele_flat1to100_PU200 + - nugun_alleta_pu200 + # - photon_flat8to150_PU0 + # - photon_flat8to150_PU200 + # - dyll_PU200 + plotters: + - !!python/name:cfg.compIDtuples.compid_plotters + htc_jobflavor: + microcentury + priorities: + doubleele_flat1to100_PU0: 2 + doubleele_flat1to100_PU200: 7 + doublephoton_flat1to100_PU200: 6 + nugun_alleta_pu200: 6 + events_per_job: + doubleele_flat1to100_PU0: 10000 + doubleele_flat1to100_PU200: 10000 + doublephoton_flat1to100_PU200: 10000 + nugun_alleta_pu200: 10000 diff --git a/python/l1THistos.py b/python/l1THistos.py index 7f186c5c..456a2932 100644 --- a/python/l1THistos.py +++ b/python/l1THistos.py @@ -76,10 +76,6 @@ def __init__(self, name, root_file=None, debug=False): hm.addHistos(self) def write(self, upfile): - # pyroot_hist = bh.TH1F("h", "", 100, -3, 3) - # pyroot_hist.FillRandom("gaus", 100000) - # upfile["from_pyroot"] = pyroot_hist - dir_name = self.__class__.__name__ for histo in [a for a in dir(self) if a.startswith('h_')]: writeable_hist = getattr(self, histo) @@ -179,6 +175,40 @@ def __init__(self, name, root_file=None, debug=False): setattr(self, attr_2d+'_graph', GraphBuilder(self, attr_2d)) +class BaseUpTuples(BaseHistos): + def __init__(self, tuple_suffix, name, root_file=None, debug=False): + self.t_name = '{}_{}'.format(name, tuple_suffix) + self.init_ = False + # if not root_file: + # self.t_name = '{}_{}'.format(name, tuple_suffix) + if root_file: + # print(root_file) + # print(root_file.GetName()) + upfile = up.open(root_file.GetName(), num_workers=1) + # print(upfile.keys()) + dir_name = self.__class__.__name__ + self.tree = upfile[f'{dir_name}/{self.t_name}'] + BaseHistos.__init__(self, name, root_file, debug) + + def fill(self, data): + dir_name = self.__class__.__name__ + hm = HistoManager() + obj_name = f'{dir_name}/{self.t_name}' + # print( hm.file.keys()) + # print(f'OBJECT: {obj_name}') + if self.init_: + # print('extending') + hm.file[f'{dir_name}/{self.t_name}'].extend(data) + else: + # print('creating') + # hm.file.mktree(f'{dir_name}/{self.t_name}') + hm.file[f'{dir_name}/{self.t_name}'] = data + self.init_ = True + + def write(self, upfile): + return + + class BaseTuples(BaseHistos): def __init__(self, tuple_suffix, tuple_variables, name, root_file=None, debug=False): @@ -199,6 +229,78 @@ def write(self): return +class CompCatTuples(BaseUpTuples): + def __init__(self, name, root_file=None, debug=False): + BaseUpTuples.__init__( + self, "CompCatData", name, root_file, debug) + + def fill(self, reference, target): + target_vars = [ + 'pt', + 'eta', + 'phi', + 'compChi2RZ', + 'compChi2RPhi', + 'compChi2Bend', + 'compNstubs', + 'tkPt', + 'compDphi', + 'compDeta', + 'compDpt', + 'compSrrtot', + 'compHoe', + 'compMeanz',] + rference_vars = [ + 'pt', + 'eta', + 'phi',] + # FIXME: add dz0 gen-track + tree_data = {} + for var in target_vars: + tree_data[var] = ak.flatten(ak.drop_none(target[var])) + for var in rference_vars: + tree_data[f'gen_{var}'] = ak.flatten(ak.drop_none(reference[var])) + # print(reference.fields) + tree_data[f'gen_dz'] = ak.flatten(ak.drop_none(np.abs(reference.ovz-target.tkZ0))) + + BaseUpTuples.fill(self, tree_data) + + +class CompTuples(BaseUpTuples): + def __init__(self, name, root_file=None, debug=False): + BaseUpTuples.__init__( + self, "CompData", name, root_file, debug) + + def fill(self, data): +# Index(['pt', 'energy', 'eta', 'phi', 'tkIso', 'pfIso', 'puppiIso', 'tkChi2', +# 'tkPt', 'tkZ0', 'compBDTScore', 'compBdt', 'compHoe', 'compSrrtot', +# 'compDeta', 'compDphi', 'compDpt', 'compMeanz', 'compNstubs', +# 'compChi2RPhi', 'compChi2RZ', 'compChi2Bend', 'dpt', 'hwQual', +# 'IDTightSTA', 'IDTightEle', 'IDTightPho', 'IDNoBrem', 'IDBrem'], +# dtype='object') + # FIXME: here we do the selection of the tree branches and other manipulations + vars = [ + 'pt', + 'eta', + 'phi', + 'compChi2RZ', + 'compChi2RPhi', + 'compChi2Bend', + 'compNstubs', + 'tkPt', + 'compDphi', + 'compDeta', + 'compDpt', + 'compSrrtot', + 'compHoe', + 'compMeanz',] + tree_data = {} + for var in vars: + if var in data.fields: + tree_data[var] = data[var] + BaseUpTuples.fill(self, tree_data) + + class GenPartHistos(BaseHistos): def __init__(self, name, root_file=None, debug=False): self.h_pt = bh.TH1F(name+'_pt', 'Gen Part Pt (GeV)', 100, 0, 100) @@ -209,9 +311,9 @@ def fill(self, gps): bh.fill_1Dhist(self.h_pt, gps.pt) bh.fill_1Dhist(self.h_energy, gps.energy) - def write(self): - for histo in [a for a in dir(self) if a.startswith('h_')]: - getattr(self, histo).Write() + # def write(self): + # for histo in [a for a in dir(self) if a.startswith('h_')]: + # getattr(self, histo).Write() class GenParticleHistos(BaseHistos): diff --git a/python/plotters.py b/python/plotters.py index 7f25eb13..e7f2b92e 100644 --- a/python/plotters.py +++ b/python/plotters.py @@ -630,7 +630,8 @@ def book_histos(self): def fill_histos(self, debug=0): # FIXME: we need to reduce the # of jugged dimensions for the selection slicing to work in AWKWARD.... - gen = self.gen_set.df[['eta', 'abseta', 'phi', 'pt', 'energy', 'exeta', 'exphi', 'fbrem', 'gen', 'pid', 'reachedEE', 'pdgid']] + # print(self.gen_set.df.fields) + gen = self.gen_set.df[['eta', 'abseta', 'phi', 'pt', 'energy', 'exeta', 'exphi', 'fbrem', 'gen', 'pid', 'reachedEE', 'pdgid', 'ovx', 'ovy', 'ovz']] for tp_sel in self.data_selections: # print(tp_sel) if tp_sel.all: @@ -674,6 +675,16 @@ def __init__(self, data_set, gen_set, gen_eta_phi_columns=['eta', 'phi']) +class TrackGenMatchPlotter(GenericGenMatchPlotter): + def __init__(self, data_set, gen_set, + data_selections=[selections.Selection('all')], + gen_selections=[selections.Selection('all')]): + super(TrackGenMatchPlotter, self).__init__(histos.TrackHistos, histos.TrackResoHistos, + data_set, gen_set, + data_selections, gen_selections, + gen_eta_phi_columns=['eta', 'phi']) + + class DecTrackGenMatchPlotter(GenericGenMatchPlotter): def __init__(self, data_set, gen_set, data_selections=[selections.Selection('all')], @@ -1220,6 +1231,19 @@ def book_histos(self): features=self.features) +class CompTuplesPlotter(GenericDataFramePlotter): + def __init__(self, obj_set, obj_selections=[selections.Selection('all')]): + super(CompTuplesPlotter, self).__init__(histos.CompTuples, obj_set, obj_selections) + + +class CompCatTuplePlotter(GenericGenMatchPlotter): + def __init__(self, data_set, gen_set, + data_selections=[selections.Selection('all')], + gen_selections=[selections.Selection('all')]): + super(CompCatTuplePlotter, self).__init__(histos.EGHistos, histos.CompCatTuples, + data_set, gen_set, + data_selections, gen_selections) + if __name__ == "__main__": for sel in selections.multiply_selections( From 57aa7f09b96eb95fffcf72ed26bb25ff96b1d078 Mon Sep 17 00:00:00 2001 From: Gianluca Date: Wed, 5 Jul 2023 09:17:08 +0200 Subject: [PATCH 09/18] Updates and fixes --- analyzeHgcalL1Tntuple.py | 5 +- cfg/compIDtuples.py | 6 ++- cfg/datasets/ntp_v91.yaml | 8 +-- cfg/egplots.py | 4 +- cfg/egplots.yaml | 3 ++ cfg/egvalid.py | 19 +++++-- cfg/egvalid.yaml | 1 + data/compositeID.json | 1 + data/rate_pt_wps_v160A.91G.json | 2 +- python/calibrations.py | 2 +- python/file_manager.py | 2 +- python/l1THistos.py | 25 ++++++--- python/plotters.py | 8 +-- python/selections.py | 92 +++++++++++++++++---------------- src/fastfilling.h | 2 +- 15 files changed, 108 insertions(+), 72 deletions(-) create mode 100644 data/compositeID.json diff --git a/analyzeHgcalL1Tntuple.py b/analyzeHgcalL1Tntuple.py index ad3d03d1..811bd438 100644 --- a/analyzeHgcalL1Tntuple.py +++ b/analyzeHgcalL1Tntuple.py @@ -30,7 +30,7 @@ # import root_numpy as rnp import pandas as pd -import uproot4 as up +import uproot as up from python.main import main import python.l1THistos as histos @@ -155,7 +155,8 @@ def analyze(params, batch_idx=-1): for tree_file_name in files_with_protocol: if break_file_loop: break - tree_file = up.open(tree_file_name, num_workers=2) + # tree_file = up.open(tree_file_name, num_workers=2) + tree_file = up.open(tree_file_name, num_workers=1) print(f'opening file: {tree_file_name}') ttree = tree_file[params.tree_name.split('/')[0]][params.tree_name.split('/')[1]] diff --git a/cfg/compIDtuples.py b/cfg/compIDtuples.py index d40fd0a7..3fac5a85 100644 --- a/cfg/compIDtuples.py +++ b/cfg/compIDtuples.py @@ -6,11 +6,13 @@ # simple_selections = (selections.Selector('^EGq[4-5]$')*('^Pt[1-3][0]$|all'))() -comp_selections = (selections.Selector('^Pt15|all')&('^EtaABC$|all'))() -sim_selections = (selections.Selector('GEN$')&('^Pt15|all')&('^EtaABC$|all'))() +comp_selections = (selections.Selector('^Pt15|all')&('^EtaABC$|^EtaBC$|all'))() +sim_selections = (selections.Selector('^GEN$')&('^Ee$|all')&('^Pt15|all')&('^EtaABC$|^EtaBC$|all'))() compid_plotters = [ plotters.CompTuplesPlotter(collections.TkEleEE, comp_selections), plotters.CompCatTuplePlotter(collections.TkEleEE, collections.sim_parts, comp_selections, sim_selections) ] +for sel in sim_selections: + print(sel) \ No newline at end of file diff --git a/cfg/datasets/ntp_v91.yaml b/cfg/datasets/ntp_v91.yaml index 768baaf3..3d6b3722 100644 --- a/cfg/datasets/ntp_v91.yaml +++ b/cfg/datasets/ntp_v91.yaml @@ -58,10 +58,10 @@ samples: # input_sample_dir: NuGunAllEta_PU200/NTP/v80A/ # input_sample_dir: NeutrinoGun_E_10GeV/NuGunAllEta_PU200_v47/191105_135050/0000/ events_per_job: 300 - # - # ttbar_PU200: - # input_sample_dir: TT_TuneCP5_14TeV-powheg-pythia8/TT_PU200_v82B/ - # events_per_job: 200 + + ttbar_PU200: + input_sample_dir: TT_TuneCP5_14TeV-powheg-pythia8/TT_PU200_FWTest10k + events_per_job: 200 # zprime_ee_PU200: # input_sample_dir: ZprimeToEE_M-6000_TuneCP5_14TeV-pythia8/ZPrimeEE_PU200_v82 diff --git a/cfg/egplots.py b/cfg/egplots.py index 163701f1..578b63d4 100644 --- a/cfg/egplots.py +++ b/cfg/egplots.py @@ -20,8 +20,8 @@ # plotters.TkElePlotter(collections.TkEleEB, egid_iso_etatk_selections), # plotters.TkElePlotter(collections.TkEleL2, egid_iso_etatk_selections), - plotters.EGPlotter(collections.TkEleEE, sta_selection), - # plotters.EGPlotter(collections.TkEleEE, simple_selections), + # plotters.EGPlotter(collections.TkEleEE, sta_selection), + plotters.EGPlotter(collections.TkEleEE, simple_selections), # plotters.EGPlotter(collections.TkEmEE, sta_selection), # plotters.EGPlotter(collections.TkEmEB, sta_selection), diff --git a/cfg/egplots.yaml b/cfg/egplots.yaml index be274876..c9b23b75 100644 --- a/cfg/egplots.yaml +++ b/cfg/egplots.yaml @@ -25,6 +25,7 @@ collections: - doublephoton_flat1to100_PU200 - doubleele_flat1to100_PU200 - nugun_alleta_pu200 + - ttbar_PU200 # - photon_flat8to150_PU0 # - photon_flat8to150_PU200 # - dyll_PU200 @@ -37,11 +38,13 @@ collections: doubleele_flat1to100_PU200: 7 doublephoton_flat1to100_PU200: 6 nugun_alleta_pu200: 6 + ttbar_PU200: 6 events_per_job: doubleele_flat1to100_PU0: 10000 doubleele_flat1to100_PU200: 10000 doublephoton_flat1to100_PU200: 10000 nugun_alleta_pu200: 10000 + ttbar_PU200: 10000 quantization_plots: diff --git a/cfg/egvalid.py b/cfg/egvalid.py index 998e6a7a..6a262696 100644 --- a/cfg/egvalid.py +++ b/cfg/egvalid.py @@ -186,8 +186,8 @@ ] -egid_menu_ele_rate_selections = (selections.Selector('^SingleIsoTkEle|^SingleTkEle')*selections.Selector('^EtaE[BE]$|all'))() -egid_menu_pho_rate_selections = (selections.Selector('^SingleIsoTkPho|^SingleEGEle')*selections.Selector('^EtaE[BE]$|all'))() +egid_menu_ele_rate_selections = (selections.Selector('^SingleIsoTkEle|^SingleTkEle|^MenuEle')*selections.Selector('^EtaE[BE]$|all'))() +egid_menu_pho_rate_selections = (selections.Selector('^SingleIsoTkPho|^SingleEGEle|^MenuSta|^MenuPho')*selections.Selector('^EtaE[BE]$|all'))() l1tc_l2emu_singlelepton_genmatched = [ @@ -199,6 +199,16 @@ egid_menu_ele_rate_selections, gen_selections), ] + +l1tc_l2emu_singlelepton_rate_pt_wps = [ + plotters.EGGenMatchPtWPSPlotter( + collections.TkEmL2, collections.sim_parts, + gen_selections), + plotters.EGGenMatchPtWPSPlotter( + collections.TkEleL2, collections.sim_parts, + gen_selections), +] + l1tc_emu_rate_pt_wps = [ # plotters.EGGenMatchPtWPSPlotter( # collections.EGStaEE, collections.sim_parts, @@ -227,4 +237,7 @@ plotters.EGGenMatchPtWPSPlotter( collections.TkEleL2, collections.sim_parts, gen_selections), -] \ No newline at end of file +] + +# for sel in egid_menu_pho_rate_selections: +# print(sel) \ No newline at end of file diff --git a/cfg/egvalid.yaml b/cfg/egvalid.yaml index b3037059..672afdce 100644 --- a/cfg/egvalid.yaml +++ b/cfg/egvalid.yaml @@ -198,6 +198,7 @@ collections: # - dyll_PU200 plotters: - !!python/name:cfg.egvalid.l1tc_l2emu_singlelepton_genmatched + - !!python/name:cfg.egvalid.l1tc_l2emu_singlelepton_rate_pt_wps htc_jobflavor: longlunch priorities: diff --git a/data/compositeID.json b/data/compositeID.json new file mode 100644 index 00000000..53b57c43 --- /dev/null +++ b/data/compositeID.json @@ -0,0 +1 @@ +{"max_depth": 4, "n_trees": 10, "n_classes": 2, "n_features": 11, "trees": [[{"feature": [1, 2, 0, 3, 0, 8, 2, 3, 5, 5, 1, 5, 2, 1, 1, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2], "threshold": [0.140625, 0.264648438, 11.4795256, 3.5, 16.6602802, 8.5, 0.245117188, -2.5, 0.0630929098, 0.585964918, 0.109375, 0.594282091, 0.252929688, 0.171875, 0.171875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "children_left": [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "children_right": [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "value": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.415820152, 0.556879818, 0.25938049, -0.557010412, -0.523303628, 0.309383601, 0.345235407, -0.177057937, -0.577262163, -0.463166773, -0.295891047, -0.521123528, 0.248503745, -0.140788257, -0.208826631, -0.495121777], "parent": [-1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14], "depth": [0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], "iLeaf": [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}], [{"feature": [1, 1, 0, 4, 0, 8, 2, 8, 3, 8, 6, 0, 3, 5, 5, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2], "threshold": [0.140625, 0.109375, 12.9026089, -13.5, 15.8960209, 7.5, 0.256835938, 2.5, -2.5, 3.5, 19.5, 8.71144676, 2.5, 0.981220245, 1.01574898, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "children_left": [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "children_right": [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "value": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.358234763, 0.404870719, -0.173584998, 0.459649861, -0.37743035, -0.0318962, 0.344911397, -0.540425003, -0.450546473, -0.387152672, -0.232723728, -0.485472769, 0.149142668, -0.281907678, -0.319123685, -0.469176918], "parent": [-1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14], "depth": [0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], "iLeaf": [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}], [{"feature": [1, 2, 0, 0, 0, 8, 6, 1, 1, 0, 8, 5, 3, 2, 1, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2], "threshold": [0.140625, 0.256835938, 9.48655319, 6.65358782, 30.484045, 9.5, 16.5, 0.109375, 0.109375, 11.8594818, 9.5, 0.701351345, -2.5, 0.260742188, 0.171875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "children_left": [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "children_right": [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "value": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.17315872, -0.212719589, 0.398817331, 0.243386999, -0.380143821, -0.169372901, 0.430269539, -0.376156092, -0.378161937, 0.694794357, -0.450359076, -0.180556566, 0.0424509495, -0.275738239, -0.161556199, -0.390238196], "parent": [-1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14], "depth": [0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], "iLeaf": [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}], [{"feature": [1, 1, 0, 4, 0, 8, 2, 8, 2, 2, 5, 5, 3, 1, 6, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2], "threshold": [0.140625, 0.109375, 7.69071722, -13.5, 14.5519686, 8.5, 0.254882812, 2.5, 0.256835938, 0.219726562, 0.951564014, 0.0752535984, -1.5, 0.171875, 16.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "children_left": [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "children_right": [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "value": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.301308185, 0.304734617, 0.359152883, 0.0685707554, 0.139380425, -0.196517661, 0.26767078, -0.092287831, 0.0782259256, -0.350551367, -0.37530303, -0.175267071, 0.193004847, -0.116770878, -0.22124359, -0.341241091], "parent": [-1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14], "depth": [0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], "iLeaf": [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}], [{"feature": [1, 3, 1, 3, 5, 3, 3, 5, 4, 10, 5, 3, 5, 3, 3, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2], "threshold": [0.109375, 4.5, 0.171875, -2.5, 0.0630929098, 2.5, 2.5, 0.0503542498, -26.5, 1.5, 0.0889862627, -1.5, 0.0574394017, -2.5, 3.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "children_left": [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "children_right": [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "value": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.528415024, -0.341509908, -0.224257782, 0.332276493, 0.414823771, -0.166062027, -0.161982179, -0.427514702, -0.287400812, 0.144089252, 0.727860332, -0.371313125, -0.353289098, -0.11641188, -0.313981056, -0.364676535], "parent": [-1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14], "depth": [0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], "iLeaf": [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}], [{"feature": [1, 4, 2, 8, 10, 3, 2, 0, 4, 2, -2, 3, 3, 0, 0, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2], "threshold": [0.109375, -13.5, 0.262695312, 2.5, 6.5, 1.5, 0.290039062, 6.54269695, -39.5, 0.252929688, 0, -2.5, 3.5, 9.02065659, 47.6570053, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.0, -2.0], "children_left": [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 29, 21, 23, 25, 27, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "children_right": [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 30, 22, 24, 26, 28, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "value": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.20732594, 0, 0, 0, 0, -0.0745446905, -0.490941644, -0.30292502, 0.351926744, 0.317744046, 0.0299588144, -0.341244638, 0.0837424397, -0.1667739, -0.344421178, -0.299592078, -0.171457857, -0.324574828, 0.0762122124, -1.20732594, -1.20732594], "parent": [-1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 11, 11, 12, 12, 13, 13, 14, 14, 10, 10], "depth": [0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], "iLeaf": [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}], [{"feature": [1, 0, 2, 5, 2, 0, 0, 0, 8, 10, 3, 8, 5, 5, 6, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2], "threshold": [0.109375, 7.04383469, 0.254882812, 0.0827398598, 0.280273438, 14.939868, 9.47421837, 2.81626415, 9.5, 3.5, 1.5, 3.5, 1.05517507, 0.057422813, 16.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "children_left": [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "children_right": [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "value": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.0296402257, 0.372503281, -0.279174328, 0.221156016, 0.313555121, 0.181570679, 0.0492865816, -0.56892544, -0.23718825, -0.00179062958, 0.199230328, -0.261860698, 0.66392386, -0.278425187, -0.0756268799, -0.2803078], "parent": [-1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14], "depth": [0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], "iLeaf": [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}], [{"feature": [1, 0, 3, 10, 2, 3, 5, 3, 2, 10, 8, 0, 6, 2, 3, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2], "threshold": [0.109375, 20.5230389, 2.5, 5.5, 0.280273438, -2.5, 0.0702819526, 4.5, 0.241210938, 3.5, 9.5, 39.9494553, 17.5, 0.291992188, 3.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "children_left": [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "children_right": [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "value": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.183256373, -0.15534921, 0.0191810895, -1.47547853, 0.31037724, 0.204687983, 0.284539312, -0.43629247, -0.310324848, 0.889182568, 0.0579996705, -0.232304126, 0.737877786, -0.190356895, -0.212541878, -0.326160461], "parent": [-1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14], "depth": [0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], "iLeaf": [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}], [{"feature": [0, 3, 5, 1, 3, 6, 0, -2, 3, 1, 5, 4, 0, 6, 9, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2], "threshold": [20.5809975, -2.5, 1.04217935, 0.078125, 1.5, 19.5, 58.5983238, 0, -4.5, 0.234375, 0.0664517879, -10.0, 24.7252579, 11.5, 7.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.0, -2.0], "children_left": [1, 3, 5, 7, 9, 11, 13, 29, 15, 17, 19, 21, 23, 25, 27, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "children_right": [2, 4, 6, 8, 10, 12, 14, 30, 16, 18, 20, 22, 24, 26, 28, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "value": [0, 0, 0, 0, 0, 0, 0, 0.363402009, 0, 0, 0, 0, 0, 0, 0, -0.312803566, -0.204151258, 0.0456621125, -0.14882116, 0.20181866, -0.25203824, -1.20155859, 0.277422816, -0.404247284, 0.160260811, 0.580196619, -0.262717366, 0.406997979, -0.171044543, 0.363402009, 0.363402009], "parent": [-1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 7, 7], "depth": [0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], "iLeaf": [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}], [{"feature": [0, 2, 5, 3, 2, 2, 0, 1, 3, 4, 5, 6, 0, 9, 9, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2], "threshold": [30.4840431, 0.245117188, 1.16153455, -1.5, 0.282226562, 0.280273438, 58.5983238, 0.140625, 2.5, 9.5, 0.948028684, 11.5, 35.0835876, 3.5, 7.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "children_left": [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "children_right": [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], "value": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0297101662, -0.228048578, 0.0833817348, -0.235787436, -0.063608937, -0.25884518, -0.224756852, -0.356927872, -0.296937495, 0.299284011, 0.524167776, -0.222849742, -0.0959210619, -0.489832073, 0.43333599, -0.154233307], "parent": [-1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14], "depth": [0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], "iLeaf": [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}]], "init_predict": [0, 0], "norm": 1} \ No newline at end of file diff --git a/data/rate_pt_wps_v160A.91G.json b/data/rate_pt_wps_v160A.91G.json index 0aaa5983..b35056e3 100644 --- a/data/rate_pt_wps_v160A.91G.json +++ b/data/rate_pt_wps_v160A.91G.json @@ -1 +1 @@ -{"TkEleEE": {"EtaABC": {"9": 41.0, "20": 32.0, "30": 29.0}, "IDTightEEtaABC": {"9": 27.0, "20": 99.0, "30": 99.0}, "IDCompWP955EtaABC": {"9": 32.0, "20": 24.0, "30": 19.0}}, "TkEleEllEE": {"IDTightEEtaABC": {"9": 28.0, "20": 22.0, "30": 19.0}, "EtaABC": {"9": 34.0, "20": 27.0, "30": 23.0}}, "TkEleEB": {"EtaF": {"9": 47.0, "20": 37.0, "30": 32.0}, "IDTightEEtaF": {"9": 37.0, "20": 28.0, "30": 26.0}}} \ No newline at end of file +{"TkEmL2": {"MenuSta": {"9": 51.0, "20": 42.0, "30": 37.0}}, "TkEleL2": {"MenuEleTight": {"9": 43.0, "20": 32.0, "30": 28.0}, "MenuEleIsoTight": {"9": 36.0, "20": 26.0, "30": 23.0}}, "TkEleEE": {"EtaABC": {"9": 41.0, "20": 32.0, "30": 29.0}, "IDTightEEtaABC": {"9": 27.0, "20": 99.0, "30": 99.0}, "IDCompWP955EtaABC": {"9": 32.0, "20": 24.0, "30": 19.0}}, "TkEleEllEE": {"IDTightEEtaABC": {"9": 28.0, "20": 22.0, "30": 19.0}, "EtaABC": {"9": 34.0, "20": 27.0, "30": 23.0}}, "TkEleEB": {"EtaF": {"9": 47.0, "20": 37.0, "30": 32.0}, "IDTightEEtaF": {"9": 37.0, "20": 28.0, "30": 26.0}}} \ No newline at end of file diff --git a/python/calibrations.py b/python/calibrations.py index 3ee92ed3..9e606910 100644 --- a/python/calibrations.py +++ b/python/calibrations.py @@ -530,7 +530,7 @@ def rate_pt_wps_selections(wps, obj, pt_var='pt'): for rate, pt_cut in wps[obj][obj_sel_name].items(): # print(f' rate: {rate}kHz, pt cut: {pt_cut}GeV') pt_sel = selections.Selection( - f'@{rate}kHz', f'p_{{T}}^{{TOBJ}}>={pt_cut}GeV (@{rate}kHz)', lambda ar: ar.pt >= pt_cut) + f'@{rate}kHz', f'p_{{T}}^{{TOBJ}}>={pt_cut}GeV (@{rate}kHz)', lambda ar, pt_cut=pt_cut : ar.pt >= pt_cut) obj_sel = selections.Selector(f'^{obj_sel_name}$', sm.selections)()[0] # print(obj_sel*pt_sel) diff --git a/python/file_manager.py b/python/file_manager.py index 756d7ade..5e35aa3a 100644 --- a/python/file_manager.py +++ b/python/file_manager.py @@ -5,7 +5,7 @@ import time from unittest import result import subprocess as subproc -import uproot4 as up +import uproot as up import json import uuid from io import open diff --git a/python/l1THistos.py b/python/l1THistos.py index 456a2932..bf5c235b 100644 --- a/python/l1THistos.py +++ b/python/l1THistos.py @@ -4,10 +4,11 @@ import numpy as np from array import array # import pandas as pd -import uproot4 as up +import uproot as up import awkward as ak import python.boost_hist as bh import python.pf_regions as pf_regions +from scipy.special import expit stuff = [] @@ -235,6 +236,8 @@ def __init__(self, name, root_file=None, debug=False): self, "CompCatData", name, root_file, debug) def fill(self, reference, target): + # print(self.t_name) + # print(target.fields) target_vars = [ 'pt', 'eta', @@ -249,7 +252,8 @@ def fill(self, reference, target): 'compDpt', 'compSrrtot', 'compHoe', - 'compMeanz',] + 'compMeanz', + 'compBDTScore'] rference_vars = [ 'pt', 'eta', @@ -293,7 +297,8 @@ def fill(self, data): 'compDpt', 'compSrrtot', 'compHoe', - 'compMeanz',] + 'compMeanz', + 'compBDTScore'] tree_data = {} for var in vars: if var in data.fields: @@ -606,7 +611,7 @@ def __init__(self, name, root_file=None, debug=False): self.h_tkIsoPV = bh.TH1F(name+'_tkIsoPV', 'Iso; rel-iso^{PV}_{tk}', 100, 0, 2) self.h_pfIsoPV = bh.TH1F(name+'_pfIsoPV', 'Iso; rel-iso^{PV}_{pf}', 100, 0, 2) self.h_n = bh.TH1F(name+'_n', '# objects per event', 100, 0, 100) - self.h_compBdt = bh.TH1F(name+'_compBdt', 'BDT Score Comp ID', 100, -4, 4) + self.h_compBdt = bh.TH1F(name+'_compBdt', 'BDT Score Comp ID', 50, 0, 1) BaseHistos.__init__(self, name, root_file, debug) @@ -627,11 +632,15 @@ def fill(self, egs): bh.fill_1Dhist(hist=self.h_pfIsoPV, array=egs.pfIsoPV, weights=weight) if 'compBDTScore' in egs.fields: bh.fill_1Dhist(hist=self.h_compBdt, array=egs.compBDTScore, weights=weight) + if 'idScore' in egs.fields: + bh.fill_1Dhist(hist=self.h_compBdt, array=expit(egs.idScore), weights=weight) + # print(ak.count(egs.pt, axis=1)) + # print(egs.pt.type.show()) + # print(ak.count(egs.pt, axis=1).type.show()) + self.h_n.fill(ak.count(egs.pt, axis=1)) + # bh.fill_1Dhist(hist=self.h_n, array=ak.count(egs.pt, axis=1), weights=weight) + # self.h_n.Fill() - # FIXME: [FIXME-AK] implement this in the normal fill - # def fill_event(self, objects): - # print(objects.pt) - # self.h_n.Fill(len(objects.pt)) def add_histos(self): self.h_pt.Add(self.h_pt_temp.GetValue()) diff --git a/python/plotters.py b/python/plotters.py index e7f2b92e..0f98dc7c 100644 --- a/python/plotters.py +++ b/python/plotters.py @@ -551,7 +551,8 @@ def __init__(self, ObjectHistoClass, ResoHistoClass, data_set, gen_set, data_selections=[selections.Selection('all')], gen_selections=[selections.Selection('all')], - gen_eta_phi_columns=['exeta', 'exphi']): + gen_eta_phi_columns=['exeta', 'exphi'], + drcut=0.1): self.ObjectHistoClass = ObjectHistoClass self.ResoHistoClass = ResoHistoClass # self.data_set = data_set @@ -569,6 +570,7 @@ def __init__(self, ObjectHistoClass, ResoHistoClass, selections.multiply_selections( gen_selections, [selections.Selection('', '', lambda ar: ar.gen > 0)])) + self.dr2 = drcut*drcut # print self # print gen_selections @@ -600,7 +602,7 @@ def plotObjectMatch(self, dpt = np.abs(obj_pt - gen_pt) dr2 = (obj_eta-gen_eta)**2+(obj_phi-gen_phi)**2 match = ak.Array(data={'ele_idx': obj_idx, 'gen_idx': gen_idx, 'dpt': dpt, 'dr2': dr2}) - dr_match=match[match.dr2<0.01] + dr_match=match[match.dr2= 5) & (pt < 10)'), # Selection('Pt10to20', '10<=p_{T}^{TOBJ}<20GeV', '(pt >= 10) & (pt < 20)'), # Selection('Pt10', 'p_{T}^{TOBJ}>=10GeV', 'pt >= 10'), - Selection('Pt10', 'p_{T}^{TOBJ}>=10GeV', lambda array: array.pt >= 10), - Selection('Pt20', 'p_{T}^{TOBJ}>=20GeV', lambda array: array.pt >= 20), - Selection('Pt25', 'p_{T}^{TOBJ}>=25GeV', lambda array: array.pt >= 25), - Selection('Pt30', 'p_{T}^{TOBJ}>=30GeV', lambda array: array.pt >= 30) + Selection('Pt10', 'p_{T}^{TOBJ}#geq10GeV', lambda array: array.pt >= 10), + Selection('Pt20', 'p_{T}^{TOBJ}#geq20GeV', lambda array: array.pt >= 20), + Selection('Pt25', 'p_{T}^{TOBJ}#geq25GeV', lambda array: array.pt >= 25), + Selection('Pt30', 'p_{T}^{TOBJ}#geq30GeV', lambda array: array.pt >= 30) ] tp_pt_sel_ext = [ Selection('all', '', ''), - Selection('Pt2', 'p_{T}^{TOBJ}>=2GeV', lambda array: array.pt >= 2), - Selection('Pt5', 'p_{T}^{TOBJ}>=5GeV', lambda array: array.pt >= 5), - Selection('Pt10', 'p_{T}^{TOBJ}>=10GeV', lambda array: array.pt >= 10), - Selection('Pt15', 'p_{T}^{TOBJ}>=15GeV', lambda array: array.pt >= 15), - Selection('Pt20', 'p_{T}^{TOBJ}>=20GeV', lambda array: array.pt >= 20), - Selection('Pt25', 'p_{T}^{TOBJ}>=25GeV', lambda array: array.pt >= 25), - Selection('Pt30', 'p_{T}^{TOBJ}>=30GeV', lambda array: array.pt >= 30), - Selection('Pt40', 'p_{T}^{TOBJ}>=40GeV', lambda array: array.pt >= 40) + Selection('Pt2', 'p_{T}^{TOBJ}#geq2GeV', lambda array: array.pt >= 2), + Selection('Pt5', 'p_{T}^{TOBJ}#geq5GeV', lambda array: array.pt >= 5), + Selection('Pt10', 'p_{T}^{TOBJ}#geq10GeV', lambda array: array.pt >= 10), + Selection('Pt15', 'p_{T}^{TOBJ}#geq15GeV', lambda array: array.pt >= 15), + Selection('Pt20', 'p_{T}^{TOBJ}#geq20GeV', lambda array: array.pt >= 20), + + Selection('Pt23', 'p_{T}^{TOBJ}#geq23GeV', lambda array: array.pt >= 23), + Selection('Pt28', 'p_{T}^{TOBJ}#geq28GeV', lambda array: array.pt >= 28), + Selection('Pt24', 'p_{T}^{TOBJ}#geq23GeV', lambda array: array.pt >= 24), + Selection('Pt25', 'p_{T}^{TOBJ}#geq25GeV', lambda array: array.pt >= 25), + Selection('Pt30', 'p_{T}^{TOBJ}#geq30GeV', lambda array: array.pt >= 30), + Selection('Pt40', 'p_{T}^{TOBJ}#geq40GeV', lambda array: array.pt >= 40) ] tp_tccluster_match_selections = [Selection('all', '', ''), @@ -387,8 +391,8 @@ def compare_selections(sel1, sel2): # Selection('EtaE', '|#eta^{TOBJ}| > 2.8', 'abs(eta) > 2.8'), # Selection('EtaAB', '|#eta^{TOBJ}| <= 1.7', 'abs(eta) <= 1.7'), # Selection('EtaABC', '|#eta^{TOBJ}| <= 2.4', 'abs(eta) <= 2.4'), - Selection('EtaBC', '1.52 < |#eta^{TOBJ}| <= 2.4', lambda array: (1.52 < abs(array.eta)) & (abs(array.eta) <= 2.4)), - Selection('EtaBCD', '1.52 < |#eta^{TOBJ}| <= 2.8', lambda array: (1.52 < abs(array.eta)) & (abs(array.eta) <= 2.8)), + Selection('EtaBC', '1.52 < |#eta^{TOBJ}| #leq 2.4', lambda array: (1.52 < abs(array.eta)) & (abs(array.eta) <= 2.4)), + Selection('EtaBCD', '1.52 < |#eta^{TOBJ}| #leq 2.8', lambda array: (1.52 < abs(array.eta)) & (abs(array.eta) <= 2.8)), # Selection('EtaBCDE', '1.52 < |#eta^{TOBJ}| < 3', '1.52 < abs(eta) < 3') ] @@ -413,17 +417,17 @@ def compare_selections(sel1, sel2): # ] eta_sel = [ - Selection('EtaA', '1.49 < |#eta^{TOBJ}| <= 1.52', lambda array: (1.49 < abs(array.eta)) & (abs(array.eta) <= 1.52)), - Selection('EtaB', '1.52 < |#eta^{TOBJ}| <= 1.7', lambda array: (1.52 < abs(array.eta)) & (abs(array.eta) <= 1.7)), - Selection('EtaC', '1.7 < |#eta^{TOBJ}| <= 2.4', lambda array: (1.7 < abs(array.eta)) & (abs(array.eta) <= 2.4)), - Selection('EtaD', '2.4 < |#eta^{TOBJ}| <= 2.8', lambda array: (2.4 < abs(array.eta)) & (abs(array.eta) <= 2.8)), - Selection('EtaDE', '2.4 < |#eta^{TOBJ}| <= 3.0', lambda array: (2.4 < abs(array.eta)) & (abs(array.eta) <= 3.0)), + Selection('EtaA', '1.49 < |#eta^{TOBJ}| #leq 1.52', lambda array: (1.49 < abs(array.eta)) & (abs(array.eta) <= 1.52)), + Selection('EtaB', '1.52 < |#eta^{TOBJ}| #leq 1.7', lambda array: (1.52 < abs(array.eta)) & (abs(array.eta) <= 1.7)), + Selection('EtaC', '1.7 < |#eta^{TOBJ}| #leq 2.4', lambda array: (1.7 < abs(array.eta)) & (abs(array.eta) <= 2.4)), + Selection('EtaD', '2.4 < |#eta^{TOBJ}| #leq 2.8', lambda array: (2.4 < abs(array.eta)) & (abs(array.eta) <= 2.8)), + Selection('EtaDE', '2.4 < |#eta^{TOBJ}| #leq 3.0', lambda array: (2.4 < abs(array.eta)) & (abs(array.eta) <= 3.0)), Selection('EtaE', '|#eta^{TOBJ}| > 2.8', lambda array: abs(array.eta) > 2.8), - Selection('EtaAB', '1.49 < |#eta^{TOBJ}| <= 1.7', lambda array: (1.49 < abs(array.eta)) & (abs(array.eta) <= 1.7)), - Selection('EtaABC', '1.49 < |#eta^{TOBJ}| <= 2.4', lambda array: (1.49 < abs(array.eta)) & (abs(array.eta) <= 2.4)), - Selection('EtaABCD', '1.49 < |#eta^{TOBJ}| <= 2.8', lambda array: (1.49 < abs(array.eta)) & (abs(array.eta) <= 2.8)), - Selection('EtaFABCD', '|#eta^{TOBJ}| <= 2.8', lambda array: abs(array.eta) <= 2.8), - Selection('EtaFABC', '|#eta^{TOBJ}| <= 2.4', lambda array: abs(array.eta) <= 2.4), + Selection('EtaAB', '1.49 < |#eta^{TOBJ}| #leq 1.7', lambda array: (1.49 < abs(array.eta)) & (abs(array.eta) <= 1.7)), + Selection('EtaABC', '1.49 < |#eta^{TOBJ}| #leq 2.4', lambda array: (1.49 < abs(array.eta)) & (abs(array.eta) <= 2.4)), + Selection('EtaABCD', '1.49 < |#eta^{TOBJ}| #leq 2.8', lambda array: (1.49 < abs(array.eta)) & (abs(array.eta) <= 2.8)), + Selection('EtaFABCD', '|#eta^{TOBJ}| #leq 2.8', lambda array: abs(array.eta) <= 2.8), + Selection('EtaFABC', '|#eta^{TOBJ}| #leq 2.4', lambda array: abs(array.eta) <= 2.4), Selection('EtaBCDE', '1.52 < |#eta^{TOBJ}|', lambda array: 1.52 < abs(array.eta)) ] @@ -561,31 +565,31 @@ def compare_selections(sel1, sel2): pfeginput_pt = [ Selection('all'), - Selection('Pt1', 'p_{T}^{TOBJ}>=1GeV', lambda ar: ar.pt >= 1), - Selection('Pt2', 'p_{T}^{TOBJ}>=2GeV', lambda ar: ar.pt >= 2), - Selection('Pt5', 'p_{T}^{TOBJ}>=5GeV', lambda ar: ar.pt >= 5), + Selection('Pt1', 'p_{T}^{TOBJ}#geq1GeV', lambda ar: ar.pt >= 1), + Selection('Pt2', 'p_{T}^{TOBJ}#geq2GeV', lambda ar: ar.pt >= 2), + Selection('Pt5', 'p_{T}^{TOBJ}#geq5GeV', lambda ar: ar.pt >= 5), ] # FIXME: these should be done using the actual online to offline threshold scaling from turn-ons menu_thresh_pt = [ - Selection('PtStaEB51', 'p_{T}^{TOBJ}>=51GeV', lambda ar: ar.pt >= 40.7), - Selection('PtStaEE51', 'p_{T}^{TOBJ}>=51GeV', lambda ar: ar.pt >= 39.6), - Selection('PtEleEB36', 'p_{T}^{TOBJ}>=36GeV', lambda ar: ar.pt >= 29.8), - Selection('PtEleEE36', 'p_{T}^{TOBJ}>=36GeV', lambda ar: ar.pt >= 28.5), - Selection('PtEleEB25', 'p_{T}^{TOBJ}>=25GeV', lambda ar: ar.pt >= 20.3), - Selection('PtEleEE25', 'p_{T}^{TOBJ}>=25GeV', lambda ar: ar.pt >= 19.5), - Selection('PtEleEB12', 'p_{T}^{TOBJ}>=12GeV', lambda ar: ar.pt >= 9.1), - Selection('PtEleEE12', 'p_{T}^{TOBJ}>=12GeV', lambda ar: ar.pt >= 8.8), - - Selection('PtIsoEleEB28', 'p_{T}^{TOBJ}>=28GeV', lambda ar: ar.pt >= 23.), - Selection('PtIsoEleEE28', 'p_{T}^{TOBJ}>=28GeV', lambda ar: ar.pt >= 22.1), - Selection('PtIsoPhoEB36', 'p_{T}^{TOBJ}>=36GeV', lambda ar: ar.pt >= 30.4), - Selection('PtIsoPhoEE36', 'p_{T}^{TOBJ}>=36GeV', lambda ar: ar.pt >= 29.0), + Selection('PtStaEB51', 'p_{T}^{TOBJ}#geq51GeV', lambda ar: ar.pt >= 40.7), + Selection('PtStaEE51', 'p_{T}^{TOBJ}#geq51GeV', lambda ar: ar.pt >= 39.6), + Selection('PtEleEB36', 'p_{T}^{TOBJ}#geq36GeV', lambda ar: ar.pt >= 29.8), + Selection('PtEleEE36', 'p_{T}^{TOBJ}#geq36GeV', lambda ar: ar.pt >= 28.5), + Selection('PtEleEB25', 'p_{T}^{TOBJ}#geq25GeV', lambda ar: ar.pt >= 20.3), + Selection('PtEleEE25', 'p_{T}^{TOBJ}#geq25GeV', lambda ar: ar.pt >= 19.5), + Selection('PtEleEB12', 'p_{T}^{TOBJ}#geq12GeV', lambda ar: ar.pt >= 9.1), + Selection('PtEleEE12', 'p_{T}^{TOBJ}#geq12GeV', lambda ar: ar.pt >= 8.8), + + Selection('PtIsoEleEB28', 'p_{T}^{TOBJ}#geq28GeV', lambda ar: ar.pt >= 23.), + Selection('PtIsoEleEE28', 'p_{T}^{TOBJ}#geq28GeV', lambda ar: ar.pt >= 22.1), + Selection('PtIsoPhoEB36', 'p_{T}^{TOBJ}#geq36GeV', lambda ar: ar.pt >= 30.4), + Selection('PtIsoPhoEE36', 'p_{T}^{TOBJ}#geq36GeV', lambda ar: ar.pt >= 29.0), - Selection('PtIsoPhoEB22', 'p_{T}^{TOBJ}>=22GeV', lambda ar: ar.pt >= 17.6), - Selection('PtIsoPhoEE22', 'p_{T}^{TOBJ}>=22GeV', lambda ar: ar.pt >= 15.9), - Selection('PtIsoPhoEB12', 'p_{T}^{TOBJ}>=12GeV', lambda ar: ar.pt >= 8.5), - Selection('PtIsoPhoEE12', 'p_{T}^{TOBJ}>=12GeV', lambda ar: ar.pt >= 6.), + Selection('PtIsoPhoEB22', 'p_{T}^{TOBJ}#geq22GeV', lambda ar: ar.pt >= 17.6), + Selection('PtIsoPhoEE22', 'p_{T}^{TOBJ}#geq22GeV', lambda ar: ar.pt >= 15.9), + Selection('PtIsoPhoEB12', 'p_{T}^{TOBJ}#geq12GeV', lambda ar: ar.pt >= 8.5), + Selection('PtIsoPhoEE12', 'p_{T}^{TOBJ}#geq12GeV', lambda ar: ar.pt >= 6.), ] diff --git a/src/fastfilling.h b/src/fastfilling.h index af301f45..fb6a130e 100644 --- a/src/fastfilling.h +++ b/src/fastfilling.h @@ -5,7 +5,7 @@ // return corrArr.size(); // } // - +// #include class HistoFiller { public: From f5789ec5bb37497060c1db34d384ab52084674ae Mon Sep 17 00:00:00 2001 From: Gianluca Date: Wed, 5 Jul 2023 09:52:48 +0200 Subject: [PATCH 10/18] Update requirements --- requirements_py3.10.txt | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/requirements_py3.10.txt b/requirements_py3.10.txt index 09b31d55..60dd6b7e 100644 --- a/requirements_py3.10.txt +++ b/requirements_py3.10.txt @@ -1,8 +1,20 @@ -root_numpy==4.8.0 -numpy==1.22 -scipy -pandas==1.4.1 -six==1.16.0 +awkward==2.2.0 +awkward-cpp==15 +awkward-pandas==2022.12a1 +hist==2.6.3 +notebook==6.5.4 +numba==0.57.0 +hist==2.6.3 +numpy==1.24.1 +mplhep==0.3.28 +dask==2023.5.1 +dask-awkward==2023.5.1 +distributed==2023.5.1 +subprocess32==3.5.4 +tabulate==0.9.0 +PyYAML==6.0 +xgboost==1.7.5 +xrootd==5.4.3 +uproot==5.0.7 uproot4==4.0.0 -PyYAML==5.4.1 -scikit_learn==0.24.2 +snakeviz==2.2.0 From 8b301b42a4505d6b172c5000a0b8ddaa86c3505b Mon Sep 17 00:00:00 2001 From: Gianluca Date: Wed, 5 Jul 2023 15:16:21 +0200 Subject: [PATCH 11/18] add original xgb Comp.ID model --- ...mulator_12p5_Histomaxvardr_loweta_high.model | Bin 0 -> 13039 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 data/egid_emulator_12p5_Histomaxvardr_loweta_high.model diff --git a/data/egid_emulator_12p5_Histomaxvardr_loweta_high.model b/data/egid_emulator_12p5_Histomaxvardr_loweta_high.model new file mode 100644 index 0000000000000000000000000000000000000000..aa1f43d3ff75eb4a0d6c099b1d9c8d2e42875fbb GIT binary patch literal 13039 zcmdU$c~}(3)`y!Q3W~@k2reLsD6S}OEHl&H)o4(Z;7Zg8C?cqcfQlOq2nZ;$2qLHi zMR5aER9qPbT;mqEn`i_VTw*jT#yvs(`cyOJ^mLwY`R9H&^*lY(r_QNURXx_rue#fy z(C`@)Maf(7A5ip!FZ^xLbpG%9YSYwFP-u8ykOnijE8pZpmAk zLH@f2_J8RI#%8D0KyzWWs{ZY#pZNmg`iejJZzV;U%J@^IKL62-KlpkjrCbSh6#VE- zS6tbpWH1f!E%-V^{@~-46cwO=Tt@r>zXe~E^zcL)a==`T`Gb#D@}E#gwdM~K{=j`u zOJtA(erQwv5c1ipVH{@sVa^|X|H@l~;yn3rDJ^*0vZ?NZo|T-hquTO^6@Lixxa$e= z*1X-0Kj8e1LpwRl!G=F<`9qjnoQ$87vORBi;18i~Kd7TR@<%7FI)1K7xL#2BYAW#2 zbrsBCs1fQ)(@o?sNA0@AiwQEgM%r~A>rJZo>m-VEduIT3qPUeI1v36xisH&^_ClQ~ zu5{Eu6@QIIanWZis^Ge7_uIegGZp_kh~f;F=R%z*?%SCLRs8QGiaWV5RtCSBcD@VF zrYin76vY+)G!E)Sarw%RsR9e%GC+tzwn%)o^;O!QBN z_}@D<`6=ymF`he>@(TM+1A^FDN$1e1fD&wnKh;B1&{kCaBFh8D>+3z0eZ2Hv=+m#2 zLVmuEjw)k{!}bxI`~Eg(pZ`n_@ld*iJf~NVpF-^JgDx=Bc042TOX~dC3NK-P5O0Q( z?p80L$T4J{!G@W^9Wlh@atysX#8u^ykr=#bwJqk_{`=Z$x6coFZ*oJ@6 zXx+ry#6FV!mW?qPD~GApiYO z;GKpYFl=CjhIdx;Mu~U_45Fxs)i6hG-r0_i{TtpjC?vd7t`PA~;G(@kn|B%pYV%Hr z3s7kD4){e;8)w?3T@s&8->dfxi;^h&a_#)T$gvN!wyM!H+aO4 zz&6qPM`{<9F7MnXJeBG4E=^Xg(&b(5wy!F6dFQrX%DWN%ErD&Kep{410tSk>b9cyT z3GX_O4wvxme)@ZrF7Iv~ZYSZL>-Y=_@A^zHlJM@$;09Iw=q+9^2G8@#dFO+9x1;NE zboFi>m%qFauP5c)WhiObS6-2`Qt*0F99zz|_T0;jTdKl-*~FR1EWHAq%P+?~Qg_|N zx@I2c?wJ(h_)dD6sQfQ$u6SDuZ2#W;JC=%V!MYk7;CSVpw@gR967Ee+4bE3=HjGUu zw?(IpS>pJH0cmW(EI+i{p@}CI&*>H>%eV`cN3lO<^klZC`(re1XEe4Wjv1o!#oLf$ z@{gYUWu|;*BrS_O{j9Z!cf3pK^5nWi-;KHR>Th`0PNeSyJ|)n=AC11# za8{dlnmTRXLBA1dPgLBYLZJdFMT{R-*5cbJY@kH?N>t!n;U>;F>eArXU9o)5w0-Ud(ersmO?L2nJ zk>xo4NB_Hw_q!Bk_D(bGS32}!9(3Zkng@m0f7!bgd!GqI?SuWWJ@u9zx_G%Y*O=8s z1>?_{mdG4%O-0nheC&t14>CX2=7a^#2X<|p4eOIQkodzVui}>W*hT!64xwoO-qFO) zGxKDBcG*JWBPKj!ERs!$y=q{yqjeE7T8Aiv%sLg(|2{(XZ{WE{$@X`jQ=0?orb;Iyu)==piG;0 zz_$H)QNT9Qem1>RKJ0OI^qsm&n|H!|#rs(ek9GB(8J927cfFf$l<2$r^@k+9yB5CM zQ&-=qj+g)gMSAR+`_~fQIU1)(co(8qS*fegv0gCHp1%?y!?u!n;9>21s~k zTEt28U6$jEO5OczSz3^UcTR`OR9>Tg=N!Ks?A7)|i5ovns^3;0G@-PRo82rFuh+&~ zozbi2m$=5x0uSs>`mkZWqPYIanb_ZK%n>$u@0g(@FdD*_Le2xJ`II&_1E8Rxu|ok+dII_8G0o%pvXF zZl|+0oxkugd2=gNn%{+N;@=)>1%NPdQyf@YleAn_xY_dtc~GqL^8 z;N4yLTc`wG1q=~1P=#jXaE_v`SHrjF{vBu^ic*X2-$C1OS%v8SozRE6N}G2Om(9)c)aG5& zSk!zSxqm0r1t@fRH_)pE>~TeWn)XYXMBn|ZC>ZKQagO%8B>L{`wCfVyIU74mc(>!W zBh-oV4ZQ!0MBfeQwpOC=99CP%boHIdI5*IIqI}gIR1)5eu0H^EqPTBEpG$aWUsEXI zU46w-RqUc%ZutC;UWXROxbtbK%jHIFu^q#Gj!wku$!cggI{wQ|F4*EJUQdcUb<9|O zIXCuEGWLJ|!HCJS9L79*(+;nvb^7Kgx3N7J;$wmJTfdj_?7Z4l+#dsk^*6cG5a#s( zGbSp#8;)0}Rx!%s9-LjyDx5EKSUH^`+ec5@RE&9`FsPR2JgKFXAv>OA{m4A*UplsyeR6OT=Ty@k+f+l5yslLQs`MB9Fvs419#rVh7w$iT zJ>}^e`r|=?2VmDF-=b@$$c6U2J=egUi$0Ym2Okup>JIdkk9&!2eVn5&9%xPCjR!4K ztRC8u*w;=}(t0y1h`p?^irp!nPwZ_aw^7<}Z}5B|zX>x~anGy00?wg0blJ*|nA3EB zlee9z`6&1JI@12`{7#&G>1q7?Kz#gzYmDu?MB?{JABRHLZ@@ONpd$n|6=1;scY%A) zFfN`+#B;(r=eJAW8?M3@pfkl^rZ92SD%b`D5JLGwV zGFznYc$f0@lq(7;?>g0J^G+B`9M*T*_tAHxx>&oDF`1Kw$#VL-nd z$C}bGPt7w7JeEQkqszPdyVh6g^6tRoza+f-*lvS_cdEVzB)s$Avqi$YezV_r=<2ot zUMuP9w(fDeJ#{&D=Crd!w|$tfSHdxe>3I^46=(I8>{Cnn6iYbPt?fq7fpuQomOh4F zsb^9!$CTSIGY4DSa4(}{jVWEc5PpHN!4*!@8*O)Go&J zlR4*>8;9fjA9O}rcPDX4S6c|{>QY?x2mr_^eV5muYi~cPsZB%@y5u zgSr{(tVQ?TpsvKzRm3UH{WNV(2`m&pXAtgqC^ZDx|^42$nYN_dvO|H)BZo*C(n1g$30TN})iBs_cawuf9-msO>$k?;)F z=Yv)g<%>&5SAFe2E4JrkbG&{6&ZIG~8gHZG-3xJiUFR3o44| z6Z30nDKl`88IJ$M#g<9o<^KDGI-H++V8uLNQ;TFK%dr3XlRdOs+y>h8`(WID+2Atv zy-OReN7g|cKYHU!HZQLfO}9CN$3xvJqPG_O8`Igt z4YtHzJfT+(N8YZewE_q8A0H+)Lo4}pDB3<@(ylZN!=6yt$0b?3pq{E(*>_dgP3=!{eK58Lo zFr9sHw(!82h0=SW^T;Tq(12Q*?7F(4hQsLhA+-#k@HL3-r46Qb1g2N&gpqTSg*5_X|5m# zjrL!P`;Q1orS}dRPFH0j>{qP)NI(1Jgq&Kg!1i{>SL|07bGguY61!1}V&)`}_HHKK*;Bjv5Zm?Y6h-=_NMd)XF{Mv+J4*6L9&T&Zplc6cO7vn;p0C|-|?eT)^EdXQ}Sz^;<=(>o0>l*yaSFn%t(~; z^CA0CIH#yWk-if+f%lwbA1W|rqeS2BnI6VKytXd7-sULmO)1U2I3Zt#8hEF9mrm$6 z0`EgL_u^oDcde80eK*ZM6xvXfeKqh-n}K65p2EBnGjND#9}3R{_zUd8p-`M<%dg> zeQ0R=t}Hk}$U{UpKP;_kTqyM?se;&mN~&I5tO_Gw0)VVfWx?*57;vSFCiz@#?fEOnT}u zw6F6dIe*!x^fN=*9@F-*R?S~xKhywg#wb%wnAH^BNB}Zn+Cr zn|vO>&!(_k$OMh>LrIeaofDB!!L%H706otVo^RA&^<#1~!kDfP4RHH_7JHa0{<-YM zc^tN5ZaUH@ynUH&p9^t+(0^m%O?KIWFI+oaRl_6>?1SUMzkH_&*Q2&Q;fUeHR_Jx( zM>77&MK|d;gL{#D!(vCE_2v^u`>O*6DAJvkYRCm8qIN%eacnk;pV~{G$yqGCzlZ&2 zFVXSUhQuFP)PrtV{f^iNjkDM#eFI4T#%wRfaC<57hfZ#r*Dp(Xfw!y4x~1H4i?mu8DN)x@MKn4@?fnjzYU3c3gHO^Ggp{xqD@FiGH# zDdv=hNkSj?3Sf?gNdkY`iQfN!@qJYuDcXk$d>kTr-wpa*KhBr|Uwhtw_j?5<1t?&i z@HeFsscVotA2=TL%0qV_nwc0X(Pgbp?()>tWo+a;3C}{f_)1-#O>m|CZ+C5Lgv)aDRCC>+r^q(%#Wo+chO5J@Zcm7Wa&j#PFlkjZ(i;gPy zE)MACh~3W`<4tV`eoM^?qD-1*(MtI@%Q()l5S`F^bHJhJ- zb<5H@N0`cnr^xbx@P4VHive@BuL4>BYaWijk(|z~J!!x?g^$Mhy5{LKt+_JRb$@5P z{;Z2a*ywO`u4wiE{O@_|gx!qWyq)M|>`ol7uKt!b{M-z6`ppl=+Z%nPz4y7JiES6- z{Eb$zwBeO>T9tYN$1670(U+RtVDb;O!SRLTE$BeAOLTO%EjS+L*s{!*8Fuv?(Oo0@ zX0z|}7#t7&Y2%u4Mx(ym2eZx$WYb)~CVsuVR5Y%WKkg6WYpNHpx%Y(kW57=9d7G_2 zCnxd7-g}sq-s_27@cfD5ub^ebo^xv`%AK}c4sD@y?yRq9x9twG&)kfqk+Y1%PY*0- z(hd}n{&%IVqmO*LO#F80;@)Ru}f8}*4_=;gov1T6vu{suw`3XY1N8X6rO z85kWpHynrpWhlJ%4+Xo!;XiatogF$SG@3^WE-w9G@j#gy6c#)!I&?uW5^QRTLwMkv zU=Qy}6afq50I6HW1#N4Q<3xh*LW=8YPTpX4y F`!A@CJ0Ac5 literal 0 HcmV?d00001 From c7295a6036b72c1c19d287318f301187ab57c90f Mon Sep 17 00:00:00 2001 From: Gianluca Date: Fri, 22 Sep 2023 16:02:26 +0200 Subject: [PATCH 12/18] Cosmetics + adapt to new loose WP being the default. Also, now supports double objec selections with AK arrays. --- python/selections.py | 45 ++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/python/selections.py b/python/selections.py index 487535be..f11e9e3c 100644 --- a/python/selections.py +++ b/python/selections.py @@ -192,7 +192,8 @@ def build_DiObj_selection(name, label, selection_leg0, selection_leg1): return Selection( name, label, - f'((leg == 0) & ({selection_leg0.selection})) | ((leg == 1) & ({selection_leg1.selection}))') + lambda array: selection_leg0.selection(array.leg0) & selection_leg1.selection(array.leg1)) + # FIXME: it was (leg0 sel. | leg1 sel.) instead of & def fill_isowp_sel(sel_list, wps): @@ -356,25 +357,25 @@ def compare_selections(sel1, sel2): # Selection('Pt5to10', '5<=p_{T}^{TOBJ}<10GeV', '(pt >= 5) & (pt < 10)'), # Selection('Pt10to20', '10<=p_{T}^{TOBJ}<20GeV', '(pt >= 10) & (pt < 20)'), # Selection('Pt10', 'p_{T}^{TOBJ}>=10GeV', 'pt >= 10'), - Selection('Pt10', 'p_{T}^{TOBJ}#geq10GeV', lambda array: array.pt >= 10), - Selection('Pt20', 'p_{T}^{TOBJ}#geq20GeV', lambda array: array.pt >= 20), - Selection('Pt25', 'p_{T}^{TOBJ}#geq25GeV', lambda array: array.pt >= 25), - Selection('Pt30', 'p_{T}^{TOBJ}#geq30GeV', lambda array: array.pt >= 30) + Selection('Pt10', 'p_{T}^{TOBJ} #geq 10 GeV', lambda array: array.pt >= 10), + Selection('Pt20', 'p_{T}^{TOBJ} #geq 20 GeV', lambda array: array.pt >= 20), + Selection('Pt25', 'p_{T}^{TOBJ} #geq 25 GeV', lambda array: array.pt >= 25), + Selection('Pt30', 'p_{T}^{TOBJ} #geq 30 GeV', lambda array: array.pt >= 30) ] tp_pt_sel_ext = [ Selection('all', '', ''), - Selection('Pt2', 'p_{T}^{TOBJ}#geq2GeV', lambda array: array.pt >= 2), - Selection('Pt5', 'p_{T}^{TOBJ}#geq5GeV', lambda array: array.pt >= 5), - Selection('Pt10', 'p_{T}^{TOBJ}#geq10GeV', lambda array: array.pt >= 10), - Selection('Pt15', 'p_{T}^{TOBJ}#geq15GeV', lambda array: array.pt >= 15), - Selection('Pt20', 'p_{T}^{TOBJ}#geq20GeV', lambda array: array.pt >= 20), - - Selection('Pt23', 'p_{T}^{TOBJ}#geq23GeV', lambda array: array.pt >= 23), - Selection('Pt28', 'p_{T}^{TOBJ}#geq28GeV', lambda array: array.pt >= 28), - Selection('Pt24', 'p_{T}^{TOBJ}#geq23GeV', lambda array: array.pt >= 24), - Selection('Pt25', 'p_{T}^{TOBJ}#geq25GeV', lambda array: array.pt >= 25), - Selection('Pt30', 'p_{T}^{TOBJ}#geq30GeV', lambda array: array.pt >= 30), - Selection('Pt40', 'p_{T}^{TOBJ}#geq40GeV', lambda array: array.pt >= 40) + Selection('Pt2', 'p_{T}^{TOBJ} #geq 2GeV', lambda array: array.pt >= 2), + Selection('Pt5', 'p_{T}^{TOBJ} #geq 5GeV', lambda array: array.pt >= 5), + Selection('Pt10', 'p_{T}^{TOBJ} #geq 10 GeV', lambda array: array.pt >= 10), + Selection('Pt15', 'p_{T}^{TOBJ} #geq 15 GeV', lambda array: array.pt >= 15), + Selection('Pt20', 'p_{T}^{TOBJ} #geq 20 GeV', lambda array: array.pt >= 20), + + Selection('Pt23', 'p_{T}^{TOBJ} #geq 23 GeV', lambda array: array.pt >= 23), + Selection('Pt28', 'p_{T}^{TOBJ} #geq 28 GeV', lambda array: array.pt >= 28), + Selection('Pt24', 'p_{T}^{TOBJ} #geq 23 GeV', lambda array: array.pt >= 24), + Selection('Pt25', 'p_{T}^{TOBJ} #geq 25 GeV', lambda array: array.pt >= 25), + Selection('Pt30', 'p_{T}^{TOBJ} #geq 30 GeV', lambda array: array.pt >= 30), + Selection('Pt40', 'p_{T}^{TOBJ} #geq 40 GeV', lambda array: array.pt >= 40) ] tp_tccluster_match_selections = [Selection('all', '', ''), @@ -697,12 +698,12 @@ def compare_selections(sel1, sel2): menu_sel = [ ((Selector('^EtaEB')&('^IDTightE'))|(Selector('^EtaEE')&('^IDTightP'))).one('MenuSta', 'TightID'), ((Selector('^EtaEB')&('^IsoEleEB'))|(Selector('^EtaEE')&('^IsoEleEE')&('^IDTightE'))).one('MenuEleIsoTight', 'Iso TightID'), - ((Selector('^EtaEB')&('^IsoEleEB'))|(Selector('^EtaEE')&('^IsoEleEE')&('^IDCompWP955'))).one('MenuEleIsoLoose', 'Iso LooseID'), + ((Selector('^EtaEB')&('^IsoEleEB'))|(Selector('^EtaEE')&('^IsoEleEE'))).one('MenuEleIsoLoose', 'Iso LooseID'), ((Selector('^EtaEB')&('^IDTightE'))|(Selector('^EtaEE')&('^IDTightE'))).one('MenuEleTight', 'TightID'), - ((Selector('^EtaEB')&('^IDTightE'))|(Selector('^EtaEE')&('^IDCompWP955'))).one('MenuEleLoose', 'LooseID'), + ((Selector('^EtaEB')&('^IDTightE'))|(Selector('^EtaEE'))).one('MenuEleLoose', 'LooseID'), ((Selector('^EtaEB')&('^IsoPhoEB')&('^IDTightE'))|(Selector('^EtaEE')&('^IsoPhoEE')&('^IDTightP'))).one('MenuPhoIso', 'Iso'), # Rate selections - ((Selector('^EtaEB')&('^IsoEleEB')&('^PtIsoEleEB28'))|(Selector('^EtaEE')&('^IsoEleEE')&('^IDCompWP955')&('^PtIsoEleEE28'))).one('SingleIsoTkEle28', 'SingleIsoTkEle28'), + ((Selector('^EtaEB')&('^IsoEleEB')&('^PtIsoEleEB28'))|(Selector('^EtaEE')&('^IsoEleEE')&('^PtIsoEleEE28'))).one('SingleIsoTkEle28', 'SingleIsoTkEle28'), ((Selector('^EtaEB')&('^IsoEleEB')&('^PtIsoEleEB28'))|(Selector('^EtaEE')&('^IsoEleEE')&('^IDTightE')&('^PtIsoEleEE28'))).one('SingleIsoTkEle28Tight', 'SingleIsoTkEle28Tight'), ((Selector('^EtaEB')&('^IDTightE')&('^PtEleEB36'))|(Selector('^EtaEE')&('^IDTightE')&('^PtEleEE36'))).one('SingleTkEle36', 'SingleTkEle36'), ((Selector('^EtaEB')&('^IsoPhoEB')&('^IDTightE')&('^PtIsoPhoEB36'))|(Selector('^EtaEE')&('^IsoPhoEE')&('^IDTightP')&('^PtIsoPhoEE36'))).one('SingleIsoTkPho36', 'SingleIsoTkPho36'), @@ -711,8 +712,8 @@ def compare_selections(sel1, sel2): ((Selector('^EtaEB')&('^IsoPhoEB')&('^IDTightE')&('^PtIsoPhoEB22'))|(Selector('^EtaEE')&('^IsoPhoEE')&('^IDTightP')&('^PtIsoPhoEE22'))).one(), ((Selector('^EtaEB')&('^IsoPhoEB')&('^IDTightE')&('^PtIsoPhoEB12'))|(Selector('^EtaEE')&('^IsoPhoEE')&('^IDTightP')&('^PtIsoPhoEE12'))).one()), build_DiObj_selection('DoubleTkEle25-12', 'DoubleTkEle25-12', - ((Selector('^EtaEB')&('^IDTightE')&('^PtEleEB25'))|(Selector('^EtaEE')&('^IDCompWP955')&('^PtEleEE25'))).one(), - ((Selector('^EtaEB')&('^IDTightE')&('^PtEleEB12'))|(Selector('^EtaEE')&('^IDCompWP955')&('^PtEleEE12'))).one()) + ((Selector('^EtaEB')&('^IDTightE')&('^PtEleEB25'))|(Selector('^EtaEE')&('^PtEleEE25'))).one(), + ((Selector('^EtaEB')&('^IDTightE')&('^PtEleEB12'))|(Selector('^EtaEE')&('^PtEleEE12'))).one()) ] # repeat the call: we want the menu selections to be avaialble via the selectors From 1b33bd5126b6cf6ed5be4f0d90396e3c90efdd6c Mon Sep 17 00:00:00 2001 From: Gianluca Date: Fri, 22 Sep 2023 16:04:22 +0200 Subject: [PATCH 13/18] Add back support for resolution trees and add configuration for resolutions and mass plots. --- cfg/reso.py | 61 +++++++++++++++ cfg/reso.yaml | 70 +++++++++++++++++ python/collections.py | 62 +++++++++++++-- python/l1THistos.py | 58 ++++++++++---- python/plotters.py | 157 +++++++++++++++++++++----------------- python/plotters_config.py | 20 ----- python/tree_reader.py | 5 +- 7 files changed, 323 insertions(+), 110 deletions(-) create mode 100644 cfg/reso.py create mode 100644 cfg/reso.yaml diff --git a/cfg/reso.py b/cfg/reso.py new file mode 100644 index 00000000..69e353ed --- /dev/null +++ b/cfg/reso.py @@ -0,0 +1,61 @@ +from __future__ import absolute_import +import python.plotters as plotters +import python.collections as collections +import python.selections as selections + +# sim_eg_match_ee_selections = (selections.Selector('^EGq[4-5]$')*('^Pt[1-3][0]$|all'))() +# gen_ee_tk_selections = (selections.Selector('GEN$')*('Ee$')*('^Eta[A-C]$|EtaBC$|all')+selections.Selector('GEN$')*('Ee$')*('Pt15|Pt30'))() +gen_selections = (selections.Selector('GEN$')*('Ee|all')*('^EtaE[EB]$|all'))() +egid_tkele_selections = (selections.Selector('^IDTight[E]|all'))() + + +diobj_eta_selections = [ + selections.build_DiObj_selection('DoubleEtaEB', 'EtaEB', + (selections.Selector('^EtaEB$')).one(), + (selections.Selector('^EtaEB$')).one()), + selections.build_DiObj_selection('DoubleEtaEE', 'EE', + (selections.Selector('^EtaEE$')).one(), + (selections.Selector('^EtaEE$')).one()), +] + +double_gen_selections = [ + selections.build_DiObj_selection('DoubleGENEtaEB', 'GENEtaEB', + (selections.Selector('GEN$')*('^EtaEB$')).one(), + (selections.Selector('GEN$')*('^EtaEB$')).one()), + selections.build_DiObj_selection('DoubleGENEtaEE', 'GENEtaEE', + (selections.Selector('GEN$')*('^EtaEE$')).one(), + (selections.Selector('GEN$')*('^EtaEE$')).one()), +] + +diobj_mass = [ + plotters.DiObjMassPlotter( + collections.DoubleTkEleL2, + diobj_eta_selections + ), + plotters.DiObjMassPlotter( + collections.DoubleSimEle, + double_gen_selections + ), + +] + + + +eg_resotuples_plotters = [ + plotters.ResoNtupleMatchPlotter( + collections.TkEleL2, collections.sim_parts, + egid_tkele_selections, + gen_selections), + # plotters.ResoNtupleMatchPlotter( + # collections.egs_brl, collections.gen_parts, + # selections.barrel_quality_selections, + # selections.gen_eb_selections), + # plotters.ResoNtupleMatchPlotter( + # collections.tkelesEL, collections.gen_parts, + # selections.tkisoeg_selections, + # selections.gen_ee_tk_selections), + # plotters.ResoNtupleMatchPlotter( + # collections.tkelesEL_brl, collections.gen_parts, + # selections.barrel_quality_selections, + # selections.gen_eb_selections), + ] diff --git a/cfg/reso.yaml b/cfg/reso.yaml new file mode 100644 index 00000000..ef5e1cd6 --- /dev/null +++ b/cfg/reso.yaml @@ -0,0 +1,70 @@ + +common: + output_dir: + default: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ + matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ + Matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ + triolet: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ + output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ + output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ + plot_version: v160A + run_clustering: False + run_density_computation: False +# +AccountingGroup = "group_u_CMS.u_zh.users" +# +AccountingGroup = "group_u_CMST3.all" + +collections: + + mass: + file_label: + mass + samples: + # - ele_flat2to100_PU0 + # - ele_flat2to100_PU200 + # - doubleele_flat1to100_PU0 + # - doublephoton_flat1to100_PU200 + # - doubleele_flat1to100_PU200 + # - photon_flat8to150_PU0 + # - photon_flat8to150_PU200 + - dyll_PU200 + plotters: + - !!python/name:cfg.reso.diobj_mass + htc_jobflavor: + microcentury + priorities: + doubleele_flat1to100_PU0: 2 + doubleele_flat1to100_PU200: 7 + doublephoton_flat1to100_PU200: 6 + dyll_PU200: 7 + events_per_job: + doubleele_flat1to100_PU0: 10000 + doubleele_flat1to100_PU200: 5000 + doublephoton_flat1to100_PU200: 5000 + dyll_PU200: 50000 + + reso: + file_label: + reso + samples: + # - ele_flat2to100_PU0 + # - ele_flat2to100_PU200 + # - doubleele_flat1to100_PU0 + # - doublephoton_flat1to100_PU200 + - doubleele_flat1to100_PU200 + # - photon_flat8to150_PU0 + # - photon_flat8to150_PU200 + # - dyll_PU200 + plotters: + - !!python/name:cfg.reso.eg_resotuples_plotters + htc_jobflavor: + microcentury + priorities: + doubleele_flat1to100_PU0: 2 + doubleele_flat1to100_PU200: 7 + doublephoton_flat1to100_PU200: 6 + dyll_PU200: 7 + events_per_job: + doubleele_flat1to100_PU0: 10000 + doubleele_flat1to100_PU200: 5000 + doublephoton_flat1to100_PU200: 5000 + dyll_PU200: 50000 diff --git a/python/collections.py b/python/collections.py index 6dfa27f1..cb78dec8 100644 --- a/python/collections.py +++ b/python/collections.py @@ -22,7 +22,9 @@ import ROOT import math import sys +import vector +vector.register_awkward() # import root_numpy.tmva as rnptmva from .utils import debugPrintOut @@ -32,7 +34,7 @@ import python.calibrations as calib import python.pf_regions as pf_regions from scipy.spatial import cKDTree - +import python.selections as selections class WeightFile(object): def __init__(self, file_name): @@ -777,9 +779,27 @@ def decodedTk_fixtures(objects): def build_double_obj(obj): - ret = pd.concat([obj,obj], names=['leg'], keys=[0, 1]) - ret = ret.swaplevel(0,1) - ret = ret.swaplevel(1,2) + # we convert the ak.Array to ak.Record + # FIXME: this could be moved upstream for all collections! + obj['mass'] = 0.*obj.pt + data = {} + + # print(obj.fields) + for field in obj.fields: + + if field in ['energy', 'exx', 'exy', 'weight', 'energy', 'dvx', 'dvy', 'dvz', 'ovx', 'ovy', 'ovz', 'mother', 'exphi', 'exeta', 'exx', 'exy', 'fbrem', 'fromBeamPipe','firstmother_pdgid']: + continue + + data[field] = obj[field] + # print(field) + # print( obj[field]) + obj_rec = vector.zip(data) + ret = ak.combinations( + array=obj_rec, + n=2, + axis=1, + fields=['leg0', 'leg1']) + # ret.show() return ret @@ -790,7 +810,8 @@ def build_double_obj(obj): filler_function=lambda event, entry_block: event.getDataFrame( prefix='gen', entry_block=entry_block), fixture_function=mc_fixtures, - print_function=lambda df: df[['pdgid', 'pt', 'eta', 'phi', 'daughters']], + print_function=lambda df: df[['pdgid', 'pt', 'eta', 'phi']], + # print_function=lambda df: df[(df.pdgid==23 | (abs(df.pdgid)==15))], max_print_lines=None, debug=0) @@ -1503,6 +1524,37 @@ def build_double_obj(obj): debug=0) +def dy_gen_selection(gen): + vec_bos = gen[gen.pdgid == 23] + print(vec_bos.status) + print(gen) + + +selected_gen_parts = DFCollection( + name='SelectedSimParts', label='Double Sim e/g', + filler_function=lambda event, entry_block: dy_gen_selection(gen.df), + # fixture_function=, + depends_on=[gen], + debug=0) + + +SelectedSimParts = DFCollection( + name='SelectedSimParts', label='Double Sim e/g', + filler_function=lambda event, entry_block: sim_parts.df[selections.Selector('^GEN$').one().selection(sim_parts.df)], + # fixture_function=, + depends_on=[sim_parts], + debug=0) + + +DoubleSimEle = DFCollection( + name='DoubleSimEle', label='Double Sim e/g', + filler_function=lambda event, entry_block: build_double_obj(obj=selected_gen_parts), + # fixture_function=, + depends_on=[selected_gen_parts], + debug=0) + + + egs_EE_pf_reg = DFCollection( name='PFOutEgEE', label='EG EE (old EMU)', filler_function=lambda event, entry_block: egs_EE_pf.df, diff --git a/python/l1THistos.py b/python/l1THistos.py index bf5c235b..f98d7054 100644 --- a/python/l1THistos.py +++ b/python/l1THistos.py @@ -1593,22 +1593,34 @@ def fill(self, reference, target): self.t_values.Fill(array('f', values_fill)) -class ResoTuples(BaseTuples): +class ResoTuples(BaseUpTuples): def __init__(self, name, root_file=None, debug=False): - BaseTuples.__init__( - self, 'reso', 'e_gen:pt_gen:eta_gen:e:pt:eta', - name, root_file, debug) + BaseUpTuples.__init__( + self, "ResoData", name, root_file, debug) def fill(self, reference, target): - values_fill = [] - - values_fill.append(reference.energy) - values_fill.append(reference.pt) - values_fill.append(reference.eta) - values_fill.append(target.energy) - values_fill.append(target.pt) - values_fill.append(target.eta) - self.t_values.Fill(array('f', values_fill)) + # print(self.t_name) + # print(target.fields) + target_vars = [ + 'pt', + 'eta', + 'phi', + 'energy', + 'hwQual'] + rference_vars = [ + 'pt', + 'eta', + 'phi', + 'energy'] + tree_data = {} + for var in target_vars: + tree_data[var] = ak.flatten(ak.drop_none(target[var])) + for var in rference_vars: + tree_data[f'gen_{var}'] = ak.flatten(ak.drop_none(reference[var])) + # print(reference.fields) + # tree_data[f'gen_dz'] = ak.flatten(ak.drop_none(np.abs(reference.ovz-target.tkZ0))) + + BaseUpTuples.fill(self, tree_data) class CalibrationHistos(BaseTuples): @@ -1868,6 +1880,26 @@ def fill(self, df): bh.fill_2Dhist(self.h_featuresLog2, fill[[f'{ft}_bin', f'{ft}_log2']]) +class DiObjMassHistos(BaseHistos): + def __init__(self, name, root_file=None, debug=False): + if not root_file: + self.h_mass = bh.TH1F(name+'_mass', 'mass (GeV); M(ll) [GeV]', 100, 0, 200) + BaseHistos.__init__(self, name, root_file, debug) + + def fill(self, obj_pairs): + weight = None + if 'weight' in obj_pairs.fields: + weight = obj_pairs.weight + objs_sum = obj_pairs.leg0+obj_pairs.leg1 + # bh.fill_1Dhist( + # hist=self.h_mass, + # array=objs_sum[ak.count((objs_sum).pt, axis=1) > 0][:, 0].mass, + # weights=weight) + self.h_mass.fill(objs_sum[ak.count((objs_sum).pt, axis=1) > 0][:, 0].mass) + + + + # if __name__ == "__main__": # import sys # def createHisto(Class): diff --git a/python/plotters.py b/python/plotters.py index 0f98dc7c..24f5778a 100644 --- a/python/plotters.py +++ b/python/plotters.py @@ -755,81 +755,91 @@ def __init__(self, data_set, gen_set, data_selections, gen_selections) -class ResoNtupleMatchPlotter(BasePlotter): +class ResoNtupleMatchPlotter(GenericGenMatchPlotter): def __init__(self, data_set, gen_set, - data_selections=[selections.Selection('all')], gen_selections=[selections.Selection('all')]): - - self.h_calibration = {} - super(ResoNtupleMatchPlotter, self).__init__( - data_set, - data_selections, - gen_set, - selections.multiply_selections( - gen_selections, - [selections.Selection('', '', 'gen > 0')])) - - # print self - # print gen_selections - - def plotObjectMatch(self, - genParticles, - objects, - h_calibration, - algoname, - debug): - best_match_indexes = {} - if not objects.empty: - best_match_indexes, allmatches = utils.match_etaphi(genParticles[['exeta', 'exphi']], - objects[['eta', 'phi']], - objects['pt'], - deltaR=0.1) - - for idx, genParticle in genParticles.iterrows(): - if idx in best_match_indexes.keys(): - # print ('-----------------------') - # print(genParticle) - obj_matched = objects.loc[[best_match_indexes[idx]]] - # print obj_matched - # print obj_matched.clusters - # print obj_matched.clusters[0] - # print algoname - # print obj_matched[['energy', 'layer_energy']] - h_calibration.fill(reference=genParticle, target=obj_matched) - - if debug >= 4: - print(('--- Dump match for algo {} ---------------'.format(algoname))) - print(('GEN particle: idx: {}'.format(idx))) - print(genParticle) - print('Matched to track object:') - print(obj_matched) - else: - if debug >= 5: - print(('==== Warning no match found for algo {}, idx {} ======================'.format(algoname, idx))) - print(genParticle) - print(objects) + data_selections=[selections.Selection('all')], + gen_selections=[selections.Selection('all')]): + super(ResoNtupleMatchPlotter, self).__init__(histos.EGHistos, histos.ResoTuples, + data_set, gen_set, + data_selections, gen_selections, drcut=0.2) - def book_histos(self): - self.gen_set.activate() - self.data_set.activate() - for tp_sel in self.data_selections: - for gen_sel in self.gen_selections: - histo_name = '{}_{}_{}'.format(self.data_set.name, tp_sel.name, gen_sel.name) - self.h_calibration[histo_name] = histos.ResoTuples(histo_name) - def fill_histos(self, debug=0): - for tp_sel in self.data_selections: - objects = self.data_set.query(tp_sel) - for gen_sel in self.gen_selections: - genReference = self.gen_set.query(gen_sel) - histo_name = '{}_{}_{}'.format(self.data_set.name, tp_sel.name, gen_sel.name) - h_calib = self.h_calibration[histo_name] - # print 'TPsel: {}, GENsel: {}'.format(tp_sel.name, gen_sel.name) - self.plotObjectMatch(genReference, - objects, - h_calib, - self.data_set.name, - debug) +# class ResoNtupleMatchPlotter(BasePlotter): +# def __init__(self, data_set, gen_set, +# data_selections=[selections.Selection('all')], gen_selections=[selections.Selection('all')]): + +# self.h_calibration = {} +# super(ResoNtupleMatchPlotter, self).__init__( +# data_set, +# data_selections, +# gen_set, +# selections.multiply_selections( +# gen_selections, +# [selections.Selection('', '', 'gen > 0')])) + +# # print self +# # print gen_selections + +# def plotObjectMatch(self, +# genParticles, +# objects, +# h_calibration, +# algoname, +# debug): +# best_match_indexes = {} +# if not objects.empty: +# best_match_indexes, allmatches = utils.match_etaphi(genParticles[['exeta', 'exphi']], +# objects[['eta', 'phi']], +# objects['pt'], +# deltaR=0.1) + +# for idx, genParticle in genParticles.iterrows(): +# if idx in best_match_indexes.keys(): +# # print ('-----------------------') +# # print(genParticle) +# obj_matched = objects.loc[[best_match_indexes[idx]]] +# # print obj_matched +# # print obj_matched.clusters +# # print obj_matched.clusters[0] +# # print algoname +# # print obj_matched[['energy', 'layer_energy']] +# h_calibration.fill(reference=genParticle, target=obj_matched) + +# if debug >= 4: +# print(('--- Dump match for algo {} ---------------'.format(algoname))) +# print(('GEN particle: idx: {}'.format(idx))) +# print(genParticle) +# print('Matched to track object:') +# print(obj_matched) +# else: +# if debug >= 5: +# print(('==== Warning no match found for algo {}, idx {} ======================'.format(algoname, idx))) +# print(genParticle) +# print(objects) + +# def book_histos(self): +# self.gen_set.activate() +# self.data_set.activate() +# for tp_sel in self.data_selections: +# for gen_sel in self.gen_selections: +# histo_name = '{}_{}_{}'.format(self.data_set.name, tp_sel.name, gen_sel.name) +# self.h_calibration[histo_name] = histos.ResoTuples(histo_name) + +# def fill_histos(self, debug=0): +# for tp_sel in self.data_selections: +# objects = self.data_set.query(tp_sel) +# for gen_sel in self.gen_selections: +# genReference = self.gen_set.query(gen_sel) +# histo_name = '{}_{}_{}'.format(self.data_set.name, tp_sel.name, gen_sel.name) + +# h_calib = self.h_calibration[histo_name] +# # print 'TPsel: {}, GENsel: {}'.format(tp_sel.name, gen_sel.name) +# self.plotObjectMatch(genReference, +# objects, +# h_calib, +# self.data_set.name, +# debug) class CalibrationPlotter(BasePlotter): @@ -1247,6 +1257,11 @@ def __init__(self, data_set, gen_set, data_selections, gen_selections, drcut=0.2) +class DiObjMassPlotter(GenericDataFramePlotter): + def __init__(self, obj_set, obj_selections=[selections.Selection('all')]): + super(DiObjMassPlotter, self).__init__(histos.DiObjMassHistos, obj_set, obj_selections) + + if __name__ == "__main__": for sel in selections.multiply_selections( selections.tp_id_selections, diff --git a/python/plotters_config.py b/python/plotters_config.py index 03073468..1123fdd8 100644 --- a/python/plotters_config.py +++ b/python/plotters_config.py @@ -219,26 +219,6 @@ ] -eg_resotuples_plotters = [ - plotters.ResoNtupleMatchPlotter( - collections.egs, collections.gen_parts, - selections.eg_id_ee_selections, - selections.gen_ee_selections), - # plotters.ResoNtupleMatchPlotter( - # collections.egs_brl, collections.gen_parts, - # selections.barrel_quality_selections, - # selections.gen_eb_selections), - # plotters.ResoNtupleMatchPlotter( - # collections.tkelesEL, collections.gen_parts, - # selections.tkisoeg_selections, - # selections.gen_ee_tk_selections), - # plotters.ResoNtupleMatchPlotter( - # collections.tkelesEL_brl, collections.gen_parts, - # selections.barrel_quality_selections, - # selections.gen_eb_selections), - ] - - tp_resotuples_plotters = [ plotters.ResoNtupleMatchPlotter( collections.tp_hm_vdr, collections.gen_parts, diff --git a/python/tree_reader.py b/python/tree_reader.py index 7fea0257..a2d7ef38 100644 --- a/python/tree_reader.py +++ b/python/tree_reader.py @@ -29,7 +29,7 @@ def setTree(self, uptree): 'tc_cellv', 'gen_PUNumInt', 'gen_TrueNumInt', - 'gen_daughters', + # 'gen_daughters', 'simpart_posx', 'simpart_posy', 'simpart_posz', ] if len(self._branches) == 0: @@ -111,5 +111,8 @@ def getDataFrame(self, prefix, entry_block, fallback=None): aliases=name_map, entry_start=self.file_entry, entry_stop=self.file_entry+entry_block) + # FIXME: we should probably do an ak.Record using sometjhing along the lines of: + # ele_rec = ak.zip({'pt': tkele.pt, 'eta': tkele.eta, 'phi': tkele.phi}, with_name="pippo") + # this would allow to handle the records and assign behaviours.... return akarray From cd1c7ac17117e08d1165308c087dd181af518625 Mon Sep 17 00:00:00 2001 From: Gianluca Date: Fri, 22 Sep 2023 16:04:55 +0200 Subject: [PATCH 14/18] Update samples --- cfg/datasets/ntp_v92.yaml | 73 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 cfg/datasets/ntp_v92.yaml diff --git a/cfg/datasets/ntp_v92.yaml b/cfg/datasets/ntp_v92.yaml new file mode 100644 index 00000000..f24133d9 --- /dev/null +++ b/cfg/datasets/ntp_v92.yaml @@ -0,0 +1,73 @@ +# NOTE: fix of track extrapolation (digitized tracks with bitwise extrapolation) +# branch: + +samples: + input_dir: /eos/cms/store/cmst3/group/l1tr/cerminar/l1teg/ntuples/ + calib_version: calib-v134C + version: 92G + + # tree_name: hgcalTriggerNtuplizer/HGCalTriggerNtuple + tree_name: l1EGTriggerNtuplizer_l1tCorr/L1TEGTriggerNtuple + rate_pt_wps: data/rate_pt_wps_v152B.90A.json + # tree_name: l1CaloTriggerNtuplizer/HGCalTriggerNtuple + + # doubleele_flat1to100_PU0: + # input_sample_dir: DoubleElectron_FlatPt-1To100/DoubleElectron_FlatPt-1To100_PU0_v64E/ + # events_per_job : 500 + # # gen_selections: !!python/name:python.selections.genpart_photon_selections + + doubleele_flat1to100_PU200: + input_sample_dir: DoubleElectron_FlatPt-1To100-gun/DoubleElectron_FlatPt-1To100_PU200_v92G/ + events_per_job : 200 + + doublephoton_flat1to100_PU200: + input_sample_dir: DoublePhoton_FlatPt-1To100-gun/DoublePhoton_FlatPt-1To100_PU200_v92G/ + events_per_job : 200 + + # ele_flat2to100_PU0: + # input_sample_dir: SingleElectron_PT2to200/SingleE_FlatPt-2to200_PU0_v60G2/ + # events_per_job : 500 + # # gen_selections: !!python/name:python.selections.genpart_photon_selections + # + # ele_flat2to100_PU200: + # input_sample_dir: SingleElectron_PT2to200/SingleE_FlatPt-2to200_PU200_v60G2/ + # events_per_job : 200 + # + # photon_flat8to150_PU0: + # input_sample_dir: SinglePhoton_PT2to200/SinglePhoton_FlatPt-2to200_PU0_v60D/ + # events_per_job : 500 + # + # photon_flat8to150_PU200: + # input_sample_dir: SinglePhoton_PT2to200/SinglePhoton_FlatPt-2to200_PU200_v60D/ + # events_per_job : 200 + # + # pion_flat2to100_PU0: + # input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU0_v33/190911_081445/0000/ + # events_per_job : 500 + # + # pion_flat2to100_PU200: + # input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU200_v33/190911_081546/0000/ + # events_per_job : 200 + # # + # nugun_alleta_pu0: + # input_sample_dir: SingleNeutrino/NuGunAllEta_PU0_v14/190123_172948/0000/ + # events_per_job: 500 + + nugun_alleta_pu200: + input_sample_dir: MinBias_TuneCP5_14TeV-pythia8/NuGunAllEta_PU200_v92G/ + # input_sample_dir: NuGunAllEta_PU200/NTP/v80A/ + # input_sample_dir: NeutrinoGun_E_10GeV/NuGunAllEta_PU200_v47/191105_135050/0000/ + events_per_job: 300 + # + # ttbar_PU200: + # input_sample_dir: TT_TuneCP5_14TeV-powheg-pythia8/TT_PU200_v82B/ + # events_per_job: 200 + + + dyll_PU200: + input_sample_dir: DYToLL_M-50_TuneCP5_14TeV-pythia8/DYToLL_PU200_v92G + events_per_job: 200 + + dyll_M10to50_PU200: + input_sample_dir: DYToLL_M-10To50_TuneCP5_14TeV-pythia8/DYToLL_M10To50_PU200_v92G + events_per_job: 200 From de57fecc941d4ad4a8864d22e35fcd701e55adf3 Mon Sep 17 00:00:00 2001 From: Gianluca Date: Fri, 22 Sep 2023 16:48:24 +0200 Subject: [PATCH 15/18] cleanup --- selection_1061p2_v10geom.yaml | 264 ---------- selection_1061p2_v9geom.yaml | 264 ---------- selection_1061p2_v9geom_vanilla.yaml | 384 --------------- selection_1112_NT_v11geom.yaml | 350 ------------- selection_1112_v11geom.yaml | 492 ------------------- selection_111pre6_v10geom.yaml | 340 ------------- selection_111pre6_v11geom.yaml | 336 ------------- selection_111pre6_v11geom_giovannniTune.yaml | 336 ------------- selection_111pre6_v9geom.yaml | 340 ------------- selection_NF.yaml | 492 ------------------- selection_NF_v65B.yaml | 492 ------------------- selection_th20.yaml | 181 ------- selection_tps.yaml | 492 ------------------- selection_v11.yaml | 149 ------ selection_v9geom.yaml | 230 --------- 15 files changed, 5142 deletions(-) delete mode 100644 selection_1061p2_v10geom.yaml delete mode 100644 selection_1061p2_v9geom.yaml delete mode 100644 selection_1061p2_v9geom_vanilla.yaml delete mode 100644 selection_1112_NT_v11geom.yaml delete mode 100644 selection_1112_v11geom.yaml delete mode 100644 selection_111pre6_v10geom.yaml delete mode 100644 selection_111pre6_v11geom.yaml delete mode 100644 selection_111pre6_v11geom_giovannniTune.yaml delete mode 100644 selection_111pre6_v9geom.yaml delete mode 100644 selection_NF.yaml delete mode 100644 selection_NF_v65B.yaml delete mode 100644 selection_th20.yaml delete mode 100644 selection_tps.yaml delete mode 100644 selection_v11.yaml delete mode 100644 selection_v9geom.yaml diff --git a/selection_1061p2_v10geom.yaml b/selection_1061p2_v10geom.yaml deleted file mode 100644 index d9c0b3bc..00000000 --- a/selection_1061p2_v10geom.yaml +++ /dev/null @@ -1,264 +0,0 @@ - -common: - input_dir: /eos/cms/store/cmst3/group/l1tr/cerminar/hgcal/CMSSW1061p2/ - output_dir: - default: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - Matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v106 - run_clustering: False - run_density_computation: False - - -collections: - test_guns_tps: - file_label: - tps - samples: - - test_photons_PU0 - plotters: - # - tp_egm_plotters - # - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - workday - - nugun_tracks: - file_label: - tracks - samples: - - nugun_alleta_pu200 - plotters: - - track_plotters - - tkeg_plotters - - eg_rate_plotters - htc_jobflavor: - workday - - single_empart_guns_tracks: - file_label: - tracks - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - plotters: - - track_plotters - - track_genmatched_plotters - - tkeg_plotters - - eg_genmatched_plotters - htc_jobflavor: - workday - - single_part_tt: - file_label: - tt - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - # - tp_egm_plotters - # - tp_genmatched_plotters - # - genpart_plotters - - ttower_plotters - - ttower_genmatched_plotters - htc_jobflavor: - workday - - - - single_empart_guns_egvalid: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - - eg_plotters - - eg_genmatched_plotters - htc_jobflavor: - workday - - - single_empart_tpdebug: - file_label: - tpdebug - samples: - - all_flat5to80_PU0 - - all_flat5to80_PU200 - plotters: - - tp_genmatched_debug - htc_jobflavor: - workday - - - single_empart_guns_calibs: - file_label: - calibs - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - - tp_calib_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - workday - - single_empart_guns_tps: - file_label: - tps - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - # - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - - - single_had_guns_tps: - file_label: - tps - samples: - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - - - - nugun_rate: - file_label: - rate - samples: - - nugun_alleta_pu200 - plotters: - - rate_plotters - # - ttower_plotters - - tp_egm_plotters - - eg_rate_plotters - htc_jobflavor: - tomorrow - - noise_samples: - file_label: - noise - samples: - - nugun_alleta_pu0 - - nugun_alleta_pu200 - # - nugun_endcap_PU50 - # - nugun_endcap_PU100 - # - nugun_endcap_PU140 - # - nugun_endcap_PU200 - plotters: - # - rate_plotters - - ttower_plotters - # - tp_egm_plotters - # - eg_rate_plotters - htc_jobflavor: - workday - -plotters: - rate_plotters: !!python/name:python.plotters.rate_plotters - tp_egm_plotters: !!python/name:python.plotters.tp_plotters - tp_genmatched_debug: !!python/name:python.plotters.tp_genmatched_debug - tp_genmatched_plotters: !!python/name:python.plotters.tp_genmatched_plotters - genpart_plotters: !!python/name:python.plotters.genpart_plotters - ttower_plotters: !!python/name:python.plotters.ttower_plotters - ttower_genmatched_plotters: !!python/name:python.plotters.ttower_genmatched_plotters - eg_plotters: !!python/name:python.plotters.eg_plotters - eg_genmatched_plotters: !!python/name:python.plotters.eg_genmatched_plotters - eg_rate_plotters: !!python/name:python.plotters.eg_rate_plotters - track_plotters: !!python/name:python.plotters.track_plotters - track_genmatched_plotters: !!python/name:python.plotters.track_genmatched_plotters - tkeg_plotters: !!python/name:python.plotters.tkeg_plotters - tp_calib_plotters: !!python/name:python.plotters.tp_calib_plotters - # tp_set: !null, - # tp_selection: !!python/name:python.selections.tp_match_selections} -# gen_selection: gen_part_selections -# - plotter: TPPlotter -# tp_selection: tp_eta_selections -# gen_selection: gen_part_selections - -#test: !!python/name:python.selections.gen_part_selections -samples: - all_flat5to80_PU0: - input_sample_dir: CMSSW1050p1/PartGun_FlatPt-5to80_PU0/NTP/v20/ - events_per_job : 500 - - all_flat5to80_PU200: - input_sample_dir: CMSSW1050p1/PartGun_FlatPt-5to80_PU200/NTP/v20/ - events_per_job : 200 - - ele_flat2to100_PU0: - input_sample_dir: SingleElectron_PT2to100/SingleE_FlatPt-2to100_PU0_v31a/190903_144036/0000/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - ele_flat2to100_PU200: - input_sample_dir: SingleElectron_PT2to100/SingleE_FlatPt-2to100_PU200_v31/190903_100221/0000/ - events_per_job : 200 - - photon_flat8to150_PU0: - input_sample_dir: SinglePhoton_FlatPt-8to150/SinglePhoton_FlatPt-8to150_PU0_v29/190902_144518/0000/ - events_per_job : 500 - - photon_flat8to150_PU200: - input_sample_dir: PhotonFlatPt8To150/SinglePhoton_FlatPt-8to150_PU200_v31/190903_100420/0000/ - events_per_job : 200 - - pion_flat2to100_PU0: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU0_v28/190829_160529/0000/ - events_per_job : 500 - - pion_flat2to100_PU200: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU200_v28/190829_160620/0000/ - events_per_job : 200 - - nugun_alleta_pu0: - input_sample_dir: SingleNeutrino/NuGunAllEta_PU0_v14/190123_172948/0000/ - events_per_job: 500 - - nugun_alleta_pu200: - input_sample_dir: Nu_E10-pythia8-gun/NuGunAllEta_PU200_v31/190903_100518/0000/ - events_per_job: 200 - - - - nugun_endcap_PU100: - input_sample_dir: NuGun_PU100/NTP/v13/ - events_per_job: 500 - - nugun_endcap_PU140: - input_sample_dir: NuGun_PU140/NTP/v13/ - events_per_job: 500 - - nugun_endcap_PU200: - input_sample_dir: NuGun_PU200/NTP/v13/ - events_per_job: 200 - - test_photons_PU0: - input_sample_dir: test/ - events_per_job: 200 diff --git a/selection_1061p2_v9geom.yaml b/selection_1061p2_v9geom.yaml deleted file mode 100644 index b903c5cf..00000000 --- a/selection_1061p2_v9geom.yaml +++ /dev/null @@ -1,264 +0,0 @@ - -common: - input_dir: /eos/cms/store/cmst3/group/l1tr/cerminar/hgcal/CMSSW1061p2/ - output_dir: - default: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - Matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v107 - run_clustering: False - run_density_computation: False - - -collections: - test_guns_tps: - file_label: - tps - samples: - - test_photons_PU0 - plotters: - # - tp_egm_plotters - # - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - workday - - nugun_tracks: - file_label: - tracks - samples: - - nugun_alleta_pu200 - plotters: - - track_plotters - - tkeg_plotters - - eg_rate_plotters - htc_jobflavor: - workday - - single_empart_guns_tracks: - file_label: - tracks - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - plotters: - - track_plotters - - track_genmatched_plotters - - tkeg_plotters - - eg_genmatched_plotters - htc_jobflavor: - workday - - single_part_tt: - file_label: - tt - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - # - tp_egm_plotters - # - tp_genmatched_plotters - # - genpart_plotters - - ttower_plotters - - ttower_genmatched_plotters - htc_jobflavor: - workday - - - - single_empart_guns_egvalid: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - - eg_plotters - - eg_genmatched_plotters - htc_jobflavor: - tomorrow - - - single_empart_tpdebug: - file_label: - tpdebug - samples: - - all_flat5to80_PU0 - - all_flat5to80_PU200 - plotters: - - tp_genmatched_debug - htc_jobflavor: - workday - - - single_empart_guns_calibs: - file_label: - calibs - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - - tp_calib_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - workday - - single_empart_guns_tps: - file_label: - tps - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - - - single_had_guns_tps: - file_label: - tps - samples: - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - - - - nugun_rate: - file_label: - rate - samples: - - nugun_alleta_pu200 - plotters: - - rate_plotters - # - ttower_plotters - - tp_egm_plotters - - eg_rate_plotters - htc_jobflavor: - tomorrow - - noise_samples: - file_label: - noise - samples: - - nugun_alleta_pu0 - - nugun_alleta_pu200 - # - nugun_endcap_PU50 - # - nugun_endcap_PU100 - # - nugun_endcap_PU140 - # - nugun_endcap_PU200 - plotters: - # - rate_plotters - - ttower_plotters - # - tp_egm_plotters - # - eg_rate_plotters - htc_jobflavor: - workday - -plotters: - rate_plotters: !!python/name:python.plotters.rate_plotters - tp_egm_plotters: !!python/name:python.plotters.tp_plotters - tp_genmatched_debug: !!python/name:python.plotters.tp_genmatched_debug - tp_genmatched_plotters: !!python/name:python.plotters.tp_genmatched_plotters - genpart_plotters: !!python/name:python.plotters.genpart_plotters - ttower_plotters: !!python/name:python.plotters.ttower_plotters - ttower_genmatched_plotters: !!python/name:python.plotters.ttower_genmatched_plotters - eg_plotters: !!python/name:python.plotters.eg_plotters - eg_genmatched_plotters: !!python/name:python.plotters.eg_genmatched_plotters - eg_rate_plotters: !!python/name:python.plotters.eg_rate_plotters - track_plotters: !!python/name:python.plotters.track_plotters - track_genmatched_plotters: !!python/name:python.plotters.track_genmatched_plotters - tkeg_plotters: !!python/name:python.plotters.tkeg_plotters - tp_calib_plotters: !!python/name:python.plotters.tp_calib_plotters - # tp_set: !null, - # tp_selection: !!python/name:python.selections.tp_match_selections} -# gen_selection: gen_part_selections -# - plotter: TPPlotter -# tp_selection: tp_eta_selections -# gen_selection: gen_part_selections - -#test: !!python/name:python.selections.gen_part_selections -samples: - all_flat5to80_PU0: - input_sample_dir: CMSSW1050p1/PartGun_FlatPt-5to80_PU0/NTP/v20/ - events_per_job : 500 - - all_flat5to80_PU200: - input_sample_dir: CMSSW1050p1/PartGun_FlatPt-5to80_PU200/NTP/v20/ - events_per_job : 200 - - ele_flat2to100_PU0: - input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU0_v29/190902_144338/0000/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - ele_flat2to100_PU200: - input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU200_v29/190902_144430/0000/ - events_per_job : 200 - - photon_flat8to150_PU0: - input_sample_dir: SinglePhoton_FlatPt-8to150/SinglePhoton_FlatPt-8to150_PU0_v29/190902_144518/0000/ - events_per_job : 500 - - photon_flat8to150_PU200: - input_sample_dir: SinglePhoton_FlatPt-8to150/SinglePhoton_FlatPt-8to150_PU200_v29/190902_144614/0000/ - events_per_job : 200 - - pion_flat2to100_PU0: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU0_v28/190829_160529/0000/ - events_per_job : 500 - - pion_flat2to100_PU200: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU200_v28/190829_160620/0000/ - events_per_job : 200 - - nugun_alleta_pu0: - input_sample_dir: SingleNeutrino/NuGunAllEta_PU0_v14/190123_172948/0000/ - events_per_job: 500 - - nugun_alleta_pu200: - input_sample_dir: NeutrinoGun_E_10GeV/NuGunAllEta_PU200_v29/190902_144701/0000/ - events_per_job: 200 - - - - nugun_endcap_PU100: - input_sample_dir: NuGun_PU100/NTP/v13/ - events_per_job: 500 - - nugun_endcap_PU140: - input_sample_dir: NuGun_PU140/NTP/v13/ - events_per_job: 500 - - nugun_endcap_PU200: - input_sample_dir: NuGun_PU200/NTP/v13/ - events_per_job: 200 - - test_photons_PU0: - input_sample_dir: test/ - events_per_job: 200 diff --git a/selection_1061p2_v9geom_vanilla.yaml b/selection_1061p2_v9geom_vanilla.yaml deleted file mode 100644 index f79ee20e..00000000 --- a/selection_1061p2_v9geom_vanilla.yaml +++ /dev/null @@ -1,384 +0,0 @@ - -common: - input_dir: /eos/cms/store/cmst3/group/l1tr/cerminar/hgcal/CMSSW1061p2/ - output_dir: - default: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - Matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v128B - run_clustering: False - run_density_computation: False - calib_version: calib-v120 - -# +AccountingGroup = "group_u_CMS.u_zh.users" -# +AccountingGroup = "group_u_CMST3.all" - -collections: - test_guns_tps: - file_label: - tps - samples: - - test_photons_PU0 - - test_ele_PU0 - plotters: - - eg_genmatched_plotters - # - tp_egm_plotters - # - tp_genmatched_plotters - # - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - workday - priorities: - test_photons_PU0: 0 - test_ele_PU0: 0 - - nugun_tracks: - file_label: - tracks - samples: - - nugun_alleta_pu200 - plotters: - - track_plotters - - tkeg_plotters - - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu200: 0 - - single_empart_guns_tracks: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - plotters: - # - track_plotters - - track_genmatched_plotters - # - tkeg_plotters - - eg_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - - single_part_tt: - file_label: - tt - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - # - tp_egm_plotters - # - tp_genmatched_plotters - # - genpart_plotters - - ttower_plotters - - ttower_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 0 - ele_flat2to100_PU200: 0 - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - single_empart_guns_egvalid: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - - eg_plotters - - eg_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - # dyll_PU200: 5 - - electron_eff_eg: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - dyll_PU200 - plotters: - - ele_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - dyll_PU200: 4 - weights: - dyll_PU200: data/dyll_pt_weights.root - - - single_empart_guns_resotuples: - file_label: - reso - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - # - eg_resotuples_plotters - - tp_resotuples_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - - single_empart_guns_calibs: - file_label: - calibs - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - tp_calib_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 1 - - single_empart_guns_tps: - file_label: - tps - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - # - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 4 - - - single_had_guns_tps: - file_label: - tps - samples: - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - correlator_occupancy: - file_label: - pf - samples: - - ttbar_PU200 - - dyll_PU200 - plotters: - - correlator_occupancy_plotters - htc_jobflavor: - workday - priorities: - ttbar_PU200: 2 - dyll_PU200: 1 - - nugun_rate: - file_label: - rate - samples: - - nugun_alleta_pu200 - plotters: - - rate_plotters - # - ttower_plotters - # - tp_egm_plotters - - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu200: 3 - - noise_samples: - file_label: - noise - samples: - - nugun_alleta_pu0 - - nugun_alleta_pu200 - # - nugun_endcap_PU50 - # - nugun_endcap_PU100 - # - nugun_endcap_PU140 - # - nugun_endcap_PU200 - plotters: - # - rate_plotters - - ttower_plotters - # - tp_egm_plotters - # - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu0: 0 - nugun_alleta_pu200: 0 - - single_empart_guns_tccluster_matcher: - file_label: - tccl - samples: - - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - # - tp_egm_plotters - - tp_cluster_tc_match_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 2 - -plotters: - rate_plotters: !!python/name:python.plotters_config.rate_plotters - tp_egm_plotters: !!python/name:python.plotters_config.tp_plotters - tp_genmatched_debug: !!python/name:python.plotters_config.tp_genmatched_debug - tp_genmatched_plotters: !!python/name:python.plotters_config.tp_genmatched_plotters - genpart_plotters: !!python/name:python.plotters_config.genpart_plotters - ttower_plotters: !!python/name:python.plotters_config.ttower_plotters - ttower_genmatched_plotters: !!python/name:python.plotters_config.ttower_genmatched_plotters - eg_plotters: !!python/name:python.plotters_config.eg_plotters - eg_genmatched_plotters: !!python/name:python.plotters_config.eg_genmatched_plotters - ele_genmatched_plotters: !!python/name:python.plotters_config.ele_genmatched_plotters - eg_rate_plotters: !!python/name:python.plotters_config.eg_rate_plotters - track_plotters: !!python/name:python.plotters_config.track_plotters - track_genmatched_plotters: !!python/name:python.plotters_config.track_genmatched_plotters - tkeg_plotters: !!python/name:python.plotters_config.tkeg_plotters - tp_calib_plotters: !!python/name:python.plotters_config.tp_calib_plotters - correlator_occupancy_plotters: !!python/name:python.plotters_config.correlator_occupancy_plotters - eg_resotuples_plotters: !!python/name:python.plotters_config.eg_resotuples_plotters - tp_resotuples_plotters: !!python/name:python.plotters_config.tp_resotuples_plotters - tp_cluster_tc_match_plotters: !!python/name:python.plotters_config.tp_cluster_tc_match_plotters - # tp_set: !null, - # tp_selection: !!python/name:python.selections.tp_match_selections} -# gen_selection: gen_part_selections -# - plotter: TPPlotter -# tp_selection: tp_eta_selections -# gen_selection: gen_part_selections - -#test: !!python/name:python.selections.gen_part_selections -samples: - tree_name: hgcalTriggerNtuplizer/HGCalTriggerNtuple - # tree_name: l1CaloTriggerNtuplizer/HGCalTriggerNtuple - - ele_flat2to100_PU0: - input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU0_v48/200210_131917/0000/ - # input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU0_v43/191022_152328/0000/ - # input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU0_v47/191105_134845/0000/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - ele_flat2to100_PU200: - input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU200_v48/200210_132344/0000/ - # input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU200_v43/191022_152446/0000/ - # input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU200_v47/191105_134950/0000/ - events_per_job : 200 - - photon_flat8to150_PU0: - input_sample_dir: SinglePhoton_FlatPt-8to150/SinglePhoton_FlatPt-8to150_PU0_v48/200210_132919/0000/ - # input_sample_dir: SinglePhoton_FlatPt-8to150/SinglePhoton_FlatPt-8to150_PU0_v43/191022_152604/0000/ - # input_sample_dir: SinglePhoton_FlatPt-8to150/SinglePhoton_FlatPt-8to150_PU0_v46/191031_200300/0000/ - events_per_job : 500 - - photon_flat8to150_PU200: - input_sample_dir: SinglePhoton_FlatPt-8to150/SinglePhoton_FlatPt-8to150_PU200_v48/200210_133036/0000/ - # input_sample_dir: SinglePhoton_FlatPt-8to150/SinglePhoton_FlatPt-8to150_PU200_v43/191022_152721/0000/ - # input_sample_dir: SinglePhoton_FlatPt-8to150/SinglePhoton_FlatPt-8to150_PU200_v46/191031_200356/0000/ - events_per_job : 200 - - pion_flat2to100_PU0: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU0_v33/190911_081445/0000/ - events_per_job : 500 - - pion_flat2to100_PU200: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU200_v33/190911_081546/0000/ - events_per_job : 200 - - nugun_alleta_pu0: - input_sample_dir: SingleNeutrino/NuGunAllEta_PU0_v14/190123_172948/0000/ - events_per_job: 500 - - nugun_alleta_pu200: - input_sample_dir: NeutrinoGun_E_10GeV/NuGunAllEta_PU200_v43/191022_152856/0000/ - # input_sample_dir: NeutrinoGun_E_10GeV/NuGunAllEta_PU200_v47/191105_135050/0000/ - events_per_job: 200 - - nugun_endcap_PU100: - input_sample_dir: NuGun_PU100/NTP/v13/ - events_per_job: 500 - - nugun_endcap_PU140: - input_sample_dir: NuGun_PU140/NTP/v13/ - events_per_job: 500 - - nugun_endcap_PU200: - input_sample_dir: NuGun_PU200/NTP/v13/ - events_per_job: 200 - - ttbar_PU200: - input_sample_dir: TTbar_14TeV_TuneCP5_Pythia8/TTBar_PU200_v45/191105_102500/0000/ - events_per_job: 200 - - dyll_PU200: - input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v48/200210_133300/0000/ - # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v45/191105_102403/0000/ - events_per_job: 200 - - - test_photons_PU0: - input_sample_dir: test/ - events_per_job: 200 - - test_ele_PU0: - input_sample_dir: test_ele_pu0/ - events_per_job: 200 diff --git a/selection_1112_NT_v11geom.yaml b/selection_1112_NT_v11geom.yaml deleted file mode 100644 index 3bf96847..00000000 --- a/selection_1112_NT_v11geom.yaml +++ /dev/null @@ -1,350 +0,0 @@ - -common: - input_dir: /eos/cms/store/cmst3/group/l1tr/cerminar/hgcal/CMSSW1110pre6/ - output_dir: - default: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - Matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v142A - run_clustering: False - run_density_computation: False - calib_version: calib-v134C -# +AccountingGroup = "group_u_CMS.u_zh.users" -# +AccountingGroup = "group_u_CMST3.all" - -collections: - - nugun_tracks: - file_label: - tracks - samples: - - nugun_alleta_pu200 - plotters: - - track_plotters - - tkeg_plotters - - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu200: 0 - - single_empart_guns_tracks: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - plotters: - # - track_plotters - - track_genmatched_plotters - # - tkeg_plotters - - eg_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - - single_part_tt: - file_label: - tt - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - # - tp_egm_plotters - # - tp_genmatched_plotters - # - genpart_plotters - - ttower_plotters - - ttower_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 0 - ele_flat2to100_PU200: 0 - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - single_empart_guns_egvalid: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - doubleele_flat1to100_PU0 - - doubleele_flat1to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - - eg_plotters - - eg_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2 - doubleele_flat1to100_PU200: 4 - - # dyll_PU200: 5 - - electron_eff_eg: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - # - dyll_PU200 - plotters: - - ele_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - dyll_PU200: 4 - weights: - dyll_PU200: data/dyll_pt_weights.root - - - single_empart_guns_resotuples: - file_label: - reso - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - eg_resotuples_plotters - - tp_resotuples_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - - single_empart_guns_calibs: - file_label: - calibs - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - tp_calib_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 1 - - single_empart_guns_tps: - file_label: - tps - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 4 - - - single_had_guns_tps: - file_label: - tps - samples: - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - # correlator_occupancy: - # file_label: - # pf - # samples: - # - ttbar_PU200 - # - dyll_PU200 - # plotters: - # - correlator_occupancy_plotters - # htc_jobflavor: - # workday - # priorities: - # ttbar_PU200: 2 - # dyll_PU200: 1 - - nugun_rate: - file_label: - rate - samples: - - nugun_alleta_pu200 - plotters: - # - rate_plotters - # - ttower_plotters - # - tp_egm_plotters - - eg_rate_plotters - htc_jobflavor: - longlunch - priorities: - nugun_alleta_pu200: 6 - - noise_samples: - file_label: - noise - samples: - - nugun_alleta_pu0 - - nugun_alleta_pu200 - # - nugun_endcap_PU50 - # - nugun_endcap_PU100 - # - nugun_endcap_PU140 - # - nugun_endcap_PU200 - plotters: - # - rate_plotters - - ttower_plotters - # - tp_egm_plotters - # - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu0: 0 - nugun_alleta_pu200: 0 - - single_empart_guns_tccluster_matcher: - file_label: - tccl - samples: - - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - # - tp_egm_plotters - - tp_cluster_tc_match_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 2 - -plotters: - rate_plotters: !!python/name:python.plotters_config.rate_plotters - tp_egm_plotters: !!python/name:python.plotters_config.tp_plotters - tp_genmatched_debug: !!python/name:python.plotters_config.tp_genmatched_debug - tp_genmatched_plotters: !!python/name:python.plotters_config.tp_genmatched_plotters - genpart_plotters: !!python/name:python.plotters_config.genpart_plotters - ttower_plotters: !!python/name:python.plotters_config.ttower_plotters - ttower_genmatched_plotters: !!python/name:python.plotters_config.ttower_genmatched_plotters - eg_plotters: !!python/name:python.plotters_config.eg_plotters - eg_genmatched_plotters: !!python/name:python.plotters_config.eg_genmatched_plotters - ele_genmatched_plotters: !!python/name:python.plotters_config.ele_genmatched_plotters - eg_rate_plotters: !!python/name:python.plotters_config.eg_rate_plotters - track_plotters: !!python/name:python.plotters_config.track_plotters - track_genmatched_plotters: !!python/name:python.plotters_config.track_genmatched_plotters - tkeg_plotters: !!python/name:python.plotters_config.tkeg_plotters - tp_calib_plotters: !!python/name:python.plotters_config.tp_calib_plotters - correlator_occupancy_plotters: !!python/name:python.plotters_config.correlator_occupancy_plotters - eg_resotuples_plotters: !!python/name:python.plotters_config.eg_resotuples_plotters - tp_resotuples_plotters: !!python/name:python.plotters_config.tp_resotuples_plotters - tp_cluster_tc_match_plotters: !!python/name:python.plotters_config.tp_cluster_tc_match_plotters - # tp_set: !null, - # tp_selection: !!python/name:python.selections.tp_match_selections} -# gen_selection: gen_part_selections -# - plotter: TPPlotter -# tp_selection: tp_eta_selections -# gen_selection: gen_part_selections - -#test: !!python/name:python.selections.gen_part_selections -samples: - # tree_name: hgcalTriggerNtuplizer/HGCalTriggerNtuple - tree_name: l1CaloTriggerNtuplizer/HGCalTriggerNtuple - - doubleele_flat1to100_PU0: - input_sample_dir: DoubleElectron_FlatPt-1To100/DoubleElectron_FlatPt-1To100_PU0_v60H2/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - doubleele_flat1to100_PU200: - input_sample_dir: DoubleElectron_FlatPt-1To100/DoubleElectron_FlatPt-1To100_PU200_v60H2/ - events_per_job : 200 - - ele_flat2to100_PU0: - input_sample_dir: SingleElectron_PT2to200/SingleE_FlatPt-2to200_PU0_v60H2/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - ele_flat2to100_PU200: - input_sample_dir: SingleElectron_PT2to200/SingleE_FlatPt-2to200_PU200_v60H2/ - events_per_job : 200 - - photon_flat8to150_PU0: - input_sample_dir: SinglePhoton_PT2to200/SinglePhoton_FlatPt-2to200_PU0_v60D/ - events_per_job : 500 - - photon_flat8to150_PU200: - input_sample_dir: SinglePhoton_PT2to200/SinglePhoton_FlatPt-2to200_PU200_v60D/ - events_per_job : 200 - - pion_flat2to100_PU0: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU0_v33/190911_081445/0000/ - events_per_job : 500 - - pion_flat2to100_PU200: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU200_v33/190911_081546/0000/ - events_per_job : 200 - # - nugun_alleta_pu0: - input_sample_dir: SingleNeutrino/NuGunAllEta_PU0_v14/190123_172948/0000/ - events_per_job: 500 - - nugun_alleta_pu200: - input_sample_dir: MinBias_TuneCP5_14TeV-pythia8/NuGunAllEta_PU200_v60H2/ - # input_sample_dir: NeutrinoGun_E_10GeV/NuGunAllEta_PU200_v47/191105_135050/0000/ - events_per_job: 300 - - # ttbar_PU200: - # input_sample_dir: TTbar_14TeV_TuneCP5_Pythia8/TTBar_PU200_v45/191105_102500/0000/ - # events_per_job: 200 - # - # dyll_PU200: - # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v48/200210_133300/0000/ - # # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v45/191105_102403/0000/ - # events_per_job: 200 diff --git a/selection_1112_v11geom.yaml b/selection_1112_v11geom.yaml deleted file mode 100644 index f5a6af31..00000000 --- a/selection_1112_v11geom.yaml +++ /dev/null @@ -1,492 +0,0 @@ - -common: - input_dir: /eos/cms/store/cmst3/group/l1tr/cerminar/hgcal/CMSSW1110pre6/ - output_dir: - default: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - Matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v146F - run_clustering: False - run_density_computation: False - calib_version: calib-v134C -# +AccountingGroup = "group_u_CMS.u_zh.users" -# +AccountingGroup = "group_u_CMST3.all" - -collections: - - nugun_tracks: - file_label: - tracks - samples: - - nugun_alleta_pu200 - plotters: - - track_plotters - # - tkeg_plotters - - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu200: 0 - events_per_job: - nugun_alleta_pu200: 10 - - single_empart_guns_tracks: - file_label: - eg - samples: - - doubleele_flat1to100_PU0 - - doubleele_flat1to100_PU200 - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - plotters: - # - track_plotters - - track_genmatched_plotters - # - tkeg_plotters - # - eg_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - doubleele_flat1to100_PU0: 1 - doubleele_flat1to100_PU200: 5 - events_per_job: - # ele_flat2to100_PU0: 1 - # ele_flat2to100_PU200: 5 - # photon_flat8to150_PU0: 0 - # photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2100 - doubleele_flat1to100_PU200: 800 - doublephoton_flat1to100_PU200: 800 - - - single_part_tt: - file_label: - tt - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - # - tp_plotters - # - tp_genmatched_plotters - # - genpart_plotters - - ttower_plotters - - ttower_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 0 - ele_flat2to100_PU200: 0 - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - - single_empart_guns_isostudy: - file_label: - eg - samples: - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - # - doubleele_flat1to100_PU0 - - doubleele_flat1to100_PU200 - - doublephoton_flat1to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - # - eg_plotters - - eg_genmatched_plotters_iso - htc_jobflavor: - longlunch - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - doublephoton_flat1to100_PU200: 6 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2 - doubleele_flat1to100_PU200: 7 - events_per_job: - # ele_flat2to100_PU0: 1 - # ele_flat2to100_PU200: 5 - # photon_flat8to150_PU0: 0 - # photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2000 - doubleele_flat1to100_PU200: 10000 - doublephoton_flat1to100_PU200: 2000 - - - single_empart_guns_egvalid: - file_label: - eg - samples: - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - # - doubleele_flat1to100_PU0 - - doubleele_flat1to100_PU200 - # - doublephoton_flat1to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - - eg_plotters - - eg_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - doublephoton_flat1to100_PU200: 6 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2 - doubleele_flat1to100_PU200: 7 - events_per_job: - # ele_flat2to100_PU0: 1 - # ele_flat2to100_PU200: 5 - # photon_flat8to150_PU0: 0 - # photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2000 - doubleele_flat1to100_PU200: 4000 - doublephoton_flat1to100_PU200: 1000 - - # dyll_PU200: 5 - - electron_eff_eg: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - # - dyll_PU200 - plotters: - - ele_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - dyll_PU200: 4 - weights: - dyll_PU200: data/dyll_pt_weights.root - - - single_empart_guns_resotuples: - file_label: - reso - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - eg_resotuples_plotters - - tp_resotuples_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - - single_empart_guns_calibs: - file_label: - calibs - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - tp_calib_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 1 - - single_empart_guns_tps: - file_label: - tps - samples: - - doubleele_flat1to100_PU200 - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - tp_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 4 - doubleele_flat1to100_PU200: 5 - events_per_job: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2100 - doubleele_flat1to100_PU200: 800 - doublephoton_flat1to100_PU200: 800 - - - highpt_tps: - file_label: - tps - samples: - - zprime_ee_PU200 - plotters: - # - tp_plotters - - tp_genmatched_extrange_plotters - # - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - workday - priorities: - zprime_ee_PU200: 5 - events_per_job: - zprime_ee_PU200: 2000 - - single_had_guns_tps: - file_label: - tps - samples: - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - - tp_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - correlator_occupancy: - file_label: - pf - samples: - - ttbar_PU200 - # - dyll_PU200 - plotters: - - correlator_occupancy_plotters - - pftrack_plotters - htc_jobflavor: - microcentury - priorities: - ttbar_PU200: 3 - # dyll_PU200: 1 - events_per_job: - ttbar_PU200: 200 - - nugun_rate: - file_label: - rate - samples: - - nugun_alleta_pu200 - plotters: - # - rate_plotters - # - ttower_plotters - # - tp_plotters - # - eg_plotters - - eg_rate_plotters - htc_jobflavor: - microcentury - priorities: - nugun_alleta_pu200: 6 - events_per_job: - nugun_alleta_pu200: 20000 - - noise_samples: - file_label: - noise - samples: - - nugun_alleta_pu0 - - nugun_alleta_pu200 - # - nugun_endcap_PU50 - # - nugun_endcap_PU100 - # - nugun_endcap_PU140 - # - nugun_endcap_PU200 - plotters: - # - rate_plotters - - ttower_plotters - # - tp_plotters - # - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu0: 0 - nugun_alleta_pu200: 0 - - single_empart_guns_tccluster_matcher: - file_label: - tccl - samples: - - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - # - tp_plotters - - tp_cluster_tc_match_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 2 - - - isostudy_eg: - file_label: - iso - samples: - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - # - doubleele_flat1to100_PU0 - - doublephoton_flat1to100_PU200 - - doubleele_flat1to100_PU200 - - nugun_alleta_pu200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - - eg_isotuples_plotters - htc_jobflavor: - microcentury - priorities: - nugun_alleta_pu200: 6 - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2 - doubleele_flat1to100_PU200: 7 - doublephoton_flat1to100_PU200: 6 - events_per_job: - doubleele_flat1to100_PU0: 10000 - doubleele_flat1to100_PU200: 20000 - doublephoton_flat1to100_PU200: 20000 - nugun_alleta_pu200: 11000 - - - -plotters: - rate_plotters: !!python/name:python.plotters_config.rate_plotters - tp_plotters: !!python/name:python.plotters_config.tp_plotters - tp_genmatched_plotters: !!python/name:python.plotters_config.tp_genmatched_plotters - tp_genmatched_extrange_plotters: !!python/name:python.plotters_config.tp_genmatched_extrange_plotters - genpart_plotters: !!python/name:python.plotters_config.genpart_plotters - ttower_plotters: !!python/name:python.plotters_config.ttower_plotters - ttower_genmatched_plotters: !!python/name:python.plotters_config.ttower_genmatched_plotters - eg_plotters: !!python/name:python.plotters_config.eg_plotters - eg_genmatched_plotters: !!python/name:python.plotters_config.eg_genmatched_plotters - eg_genmatched_plotters_iso: !!python/name:python.plotters_config.eg_genmatched_plotters_iso - ele_genmatched_plotters: !!python/name:python.plotters_config.ele_genmatched_plotters - eg_rate_plotters: !!python/name:python.plotters_config.eg_rate_plotters - track_plotters: !!python/name:python.plotters_config.track_plotters - track_genmatched_plotters: !!python/name:python.plotters_config.track_genmatched_plotters - # tkeg_plotters: !!python/name:python.plotters_config.tkeg_plotters - tp_calib_plotters: !!python/name:python.plotters_config.tp_calib_plotters - correlator_occupancy_plotters: !!python/name:python.plotters_config.correlator_occupancy_plotters - pftrack_plotters: !!python/name:python.plotters_config.pftrack_plotters - eg_resotuples_plotters: !!python/name:python.plotters_config.eg_resotuples_plotters - tp_resotuples_plotters: !!python/name:python.plotters_config.tp_resotuples_plotters - tp_cluster_tc_match_plotters: !!python/name:python.plotters_config.tp_cluster_tc_match_plotters - eg_isotuples_plotters: !!python/name:python.plotters_config.eg_isotuples_plotters - # tp_set: !null, - # tp_selection: !!python/name:python.selections.tp_match_selections} -# gen_selection: gen_part_selections -# - plotter: TPPlotter -# tp_selection: tp_eta_selections -# gen_selection: gen_part_selections - -#test: !!python/name:python.selections.gen_part_selections -samples: - # tree_name: hgcalTriggerNtuplizer/HGCalTriggerNtuple - tree_name: l1CaloTriggerNtuplizer_egOnly/HGCalTriggerNtuple - # tree_name: l1CaloTriggerNtuplizer/HGCalTriggerNtuple - - doubleele_flat1to100_PU0: - input_sample_dir: DoubleElectron_FlatPt-1To100/DoubleElectron_FlatPt-1To100_PU0_v64E/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - doubleele_flat1to100_PU200: - input_sample_dir: DoubleElectron_FlatPt-1To100/DoubleElectron_FlatPt-1To100_PU200_v64E/ - events_per_job : 200 - - doublephoton_flat1to100_PU200: - input_sample_dir: DoublePhoton_FlatPt-1To100/DoublePhoton_FlatPt-1To100_PU200_v64E/ - events_per_job : 200 - - ele_flat2to100_PU0: - input_sample_dir: SingleElectron_PT2to200/SingleE_FlatPt-2to200_PU0_v60G2/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - ele_flat2to100_PU200: - input_sample_dir: SingleElectron_PT2to200/SingleE_FlatPt-2to200_PU200_v60G2/ - events_per_job : 200 - - photon_flat8to150_PU0: - input_sample_dir: SinglePhoton_PT2to200/SinglePhoton_FlatPt-2to200_PU0_v60D/ - events_per_job : 500 - - photon_flat8to150_PU200: - input_sample_dir: SinglePhoton_PT2to200/SinglePhoton_FlatPt-2to200_PU200_v60D/ - events_per_job : 200 - - pion_flat2to100_PU0: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU0_v33/190911_081445/0000/ - events_per_job : 500 - - pion_flat2to100_PU200: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU200_v33/190911_081546/0000/ - events_per_job : 200 - # - nugun_alleta_pu0: - input_sample_dir: SingleNeutrino/NuGunAllEta_PU0_v14/190123_172948/0000/ - events_per_job: 500 - - nugun_alleta_pu200: - input_sample_dir: MinBias_TuneCP5_14TeV-pythia8/NuGunAllEta_PU200_v64E/ - # input_sample_dir: NeutrinoGun_E_10GeV/NuGunAllEta_PU200_v47/191105_135050/0000/ - events_per_job: 300 - - ttbar_PU200: - input_sample_dir: TT_TuneCP5_14TeV-powheg-pythia8/TT_PU200_v64D/ - events_per_job: 200 - - zprime_ee_PU200: - input_sample_dir: ZprimeToEE_M-6000_TuneCP5_14TeV-pythia8/ZPrimeEE_PU200_v64C/ - events_per_job: 200 - # - # dyll_PU200: - # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v48/200210_133300/0000/ - # # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v45/191105_102403/0000/ - # events_per_job: 200 diff --git a/selection_111pre6_v10geom.yaml b/selection_111pre6_v10geom.yaml deleted file mode 100644 index d13ac6ec..00000000 --- a/selection_111pre6_v10geom.yaml +++ /dev/null @@ -1,340 +0,0 @@ - -common: - input_dir: /eos/cms/store/cmst3/group/l1tr/cerminar/hgcal/CMSSW1110pre6/ - output_dir: - default: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - Matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v133D - run_clustering: False - run_density_computation: False - calib_version: calib-v131 -# +AccountingGroup = "group_u_CMS.u_zh.users" -# +AccountingGroup = "group_u_CMST3.all" - -collections: - - nugun_tracks: - file_label: - tracks - samples: - - nugun_alleta_pu200 - plotters: - - track_plotters - - tkeg_plotters - - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu200: 0 - - single_empart_guns_tracks: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - plotters: - # - track_plotters - - track_genmatched_plotters - # - tkeg_plotters - - eg_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - - single_part_tt: - file_label: - tt - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - # - tp_egm_plotters - # - tp_genmatched_plotters - # - genpart_plotters - - ttower_plotters - - ttower_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 0 - ele_flat2to100_PU200: 0 - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - single_empart_guns_egvalid: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - - eg_plotters - - eg_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - # dyll_PU200: 5 - - electron_eff_eg: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - # - dyll_PU200 - plotters: - - ele_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - dyll_PU200: 4 - weights: - dyll_PU200: data/dyll_pt_weights.root - - - single_empart_guns_resotuples: - file_label: - reso - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - # - eg_resotuples_plotters - - tp_resotuples_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - - single_empart_guns_calibs: - file_label: - calibs - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - - tp_calib_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 1 - - single_empart_guns_tps: - file_label: - tps - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 4 - - - single_had_guns_tps: - file_label: - tps - samples: - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - # correlator_occupancy: - # file_label: - # pf - # samples: - # - ttbar_PU200 - # - dyll_PU200 - # plotters: - # - correlator_occupancy_plotters - # htc_jobflavor: - # workday - # priorities: - # ttbar_PU200: 2 - # dyll_PU200: 1 - - nugun_rate: - file_label: - rate - samples: - - nugun_alleta_pu200 - plotters: - - rate_plotters - # - ttower_plotters - # - tp_egm_plotters - - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu200: 3 - - noise_samples: - file_label: - noise - samples: - - nugun_alleta_pu0 - - nugun_alleta_pu200 - # - nugun_endcap_PU50 - # - nugun_endcap_PU100 - # - nugun_endcap_PU140 - # - nugun_endcap_PU200 - plotters: - # - rate_plotters - - ttower_plotters - # - tp_egm_plotters - # - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu0: 0 - nugun_alleta_pu200: 0 - - single_empart_guns_tccluster_matcher: - file_label: - tccl - samples: - - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - # - tp_egm_plotters - - tp_cluster_tc_match_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 2 - -plotters: - rate_plotters: !!python/name:python.plotters_config.rate_plotters - tp_egm_plotters: !!python/name:python.plotters_config.tp_plotters - tp_genmatched_debug: !!python/name:python.plotters_config.tp_genmatched_debug - tp_genmatched_plotters: !!python/name:python.plotters_config.tp_genmatched_plotters - genpart_plotters: !!python/name:python.plotters_config.genpart_plotters - ttower_plotters: !!python/name:python.plotters_config.ttower_plotters - ttower_genmatched_plotters: !!python/name:python.plotters_config.ttower_genmatched_plotters - eg_plotters: !!python/name:python.plotters_config.eg_plotters - eg_genmatched_plotters: !!python/name:python.plotters_config.eg_genmatched_plotters - ele_genmatched_plotters: !!python/name:python.plotters_config.ele_genmatched_plotters - eg_rate_plotters: !!python/name:python.plotters_config.eg_rate_plotters - track_plotters: !!python/name:python.plotters_config.track_plotters - track_genmatched_plotters: !!python/name:python.plotters_config.track_genmatched_plotters - tkeg_plotters: !!python/name:python.plotters_config.tkeg_plotters - tp_calib_plotters: !!python/name:python.plotters_config.tp_calib_plotters - correlator_occupancy_plotters: !!python/name:python.plotters_config.correlator_occupancy_plotters - eg_resotuples_plotters: !!python/name:python.plotters_config.eg_resotuples_plotters - tp_resotuples_plotters: !!python/name:python.plotters_config.tp_resotuples_plotters - tp_cluster_tc_match_plotters: !!python/name:python.plotters_config.tp_cluster_tc_match_plotters - # tp_set: !null, - # tp_selection: !!python/name:python.selections.tp_match_selections} -# gen_selection: gen_part_selections -# - plotter: TPPlotter -# tp_selection: tp_eta_selections -# gen_selection: gen_part_selections - -#test: !!python/name:python.selections.gen_part_selections -samples: - # tree_name: hgcalTriggerNtuplizer/HGCalTriggerNtuple - tree_name: l1CaloTriggerNtuplizer/HGCalTriggerNtuple - - ele_flat2to100_PU0: - input_sample_dir: SingleElectron_PT2to100/SingleE_FlatPt-2to100_PU0_v54/ - # input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU0_v43/191022_152328/0000/ - # input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU0_v47/191105_134845/0000/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - ele_flat2to100_PU200: - input_sample_dir: SingleElectron_PT2to100/SingleE_FlatPt-2to100_PU200_v54/ - # input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU200_v43/191022_152446/0000/ - # input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU200_v47/191105_134950/0000/ - events_per_job : 200 - - photon_flat8to150_PU0: - input_sample_dir: PhotonFlatPt8To150/SinglePhoton_FlatPt-8to150_PU0_v54/ - events_per_job : 500 - - photon_flat8to150_PU200: - input_sample_dir: PhotonFlatPt8To150/SinglePhoton_FlatPt-8to150_PU200_v54/ - events_per_job : 200 - - pion_flat2to100_PU0: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU0_v33/190911_081445/0000/ - events_per_job : 500 - - pion_flat2to100_PU200: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU200_v33/190911_081546/0000/ - events_per_job : 200 - # - nugun_alleta_pu0: - input_sample_dir: SingleNeutrino/NuGunAllEta_PU0_v14/190123_172948/0000/ - events_per_job: 500 - - nugun_alleta_pu200: - input_sample_dir: Nu_E10-pythia8-gun/NuGunAllEta_PU200_v54/ - # input_sample_dir: NeutrinoGun_E_10GeV/NuGunAllEta_PU200_v47/191105_135050/0000/ - events_per_job: 200 - - # ttbar_PU200: - # input_sample_dir: TTbar_14TeV_TuneCP5_Pythia8/TTBar_PU200_v45/191105_102500/0000/ - # events_per_job: 200 - # - # dyll_PU200: - # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v48/200210_133300/0000/ - # # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v45/191105_102403/0000/ - # events_per_job: 200 diff --git a/selection_111pre6_v11geom.yaml b/selection_111pre6_v11geom.yaml deleted file mode 100644 index 76434069..00000000 --- a/selection_111pre6_v11geom.yaml +++ /dev/null @@ -1,336 +0,0 @@ - -common: - input_dir: /eos/cms/store/cmst3/group/l1tr/cerminar/hgcal/CMSSW1110pre6/ - output_dir: - default: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - Matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v134F - run_clustering: False - run_density_computation: False - calib_version: calib-v134C -# +AccountingGroup = "group_u_CMS.u_zh.users" -# +AccountingGroup = "group_u_CMST3.all" - -collections: - - nugun_tracks: - file_label: - tracks - samples: - - nugun_alleta_pu200 - plotters: - - track_plotters - - tkeg_plotters - - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu200: 0 - - single_empart_guns_tracks: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - plotters: - # - track_plotters - - track_genmatched_plotters - # - tkeg_plotters - - eg_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - - single_part_tt: - file_label: - tt - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - # - tp_egm_plotters - # - tp_genmatched_plotters - # - genpart_plotters - - ttower_plotters - - ttower_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 0 - ele_flat2to100_PU200: 0 - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - single_empart_guns_egvalid: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - - eg_plotters - - eg_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - # dyll_PU200: 5 - - electron_eff_eg: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - # - dyll_PU200 - plotters: - - ele_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - dyll_PU200: 4 - weights: - dyll_PU200: data/dyll_pt_weights.root - - - single_empart_guns_resotuples: - file_label: - reso - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - - eg_resotuples_plotters - - tp_resotuples_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - - single_empart_guns_calibs: - file_label: - calibs - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - tp_calib_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 1 - - single_empart_guns_tps: - file_label: - tps - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 4 - - - single_had_guns_tps: - file_label: - tps - samples: - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - # correlator_occupancy: - # file_label: - # pf - # samples: - # - ttbar_PU200 - # - dyll_PU200 - # plotters: - # - correlator_occupancy_plotters - # htc_jobflavor: - # workday - # priorities: - # ttbar_PU200: 2 - # dyll_PU200: 1 - - nugun_rate: - file_label: - rate - samples: - - nugun_alleta_pu200 - plotters: - - rate_plotters - # - ttower_plotters - # - tp_egm_plotters - - eg_rate_plotters - htc_jobflavor: - longlunch - priorities: - nugun_alleta_pu200: 6 - - noise_samples: - file_label: - noise - samples: - - nugun_alleta_pu0 - - nugun_alleta_pu200 - # - nugun_endcap_PU50 - # - nugun_endcap_PU100 - # - nugun_endcap_PU140 - # - nugun_endcap_PU200 - plotters: - # - rate_plotters - - ttower_plotters - # - tp_egm_plotters - # - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu0: 0 - nugun_alleta_pu200: 0 - - single_empart_guns_tccluster_matcher: - file_label: - tccl - samples: - - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - # - tp_egm_plotters - - tp_cluster_tc_match_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 2 - -plotters: - rate_plotters: !!python/name:python.plotters_config.rate_plotters - tp_egm_plotters: !!python/name:python.plotters_config.tp_plotters - tp_genmatched_debug: !!python/name:python.plotters_config.tp_genmatched_debug - tp_genmatched_plotters: !!python/name:python.plotters_config.tp_genmatched_plotters - genpart_plotters: !!python/name:python.plotters_config.genpart_plotters - ttower_plotters: !!python/name:python.plotters_config.ttower_plotters - ttower_genmatched_plotters: !!python/name:python.plotters_config.ttower_genmatched_plotters - eg_plotters: !!python/name:python.plotters_config.eg_plotters - eg_genmatched_plotters: !!python/name:python.plotters_config.eg_genmatched_plotters - ele_genmatched_plotters: !!python/name:python.plotters_config.ele_genmatched_plotters - eg_rate_plotters: !!python/name:python.plotters_config.eg_rate_plotters - track_plotters: !!python/name:python.plotters_config.track_plotters - track_genmatched_plotters: !!python/name:python.plotters_config.track_genmatched_plotters - tkeg_plotters: !!python/name:python.plotters_config.tkeg_plotters - tp_calib_plotters: !!python/name:python.plotters_config.tp_calib_plotters - correlator_occupancy_plotters: !!python/name:python.plotters_config.correlator_occupancy_plotters - eg_resotuples_plotters: !!python/name:python.plotters_config.eg_resotuples_plotters - tp_resotuples_plotters: !!python/name:python.plotters_config.tp_resotuples_plotters - tp_cluster_tc_match_plotters: !!python/name:python.plotters_config.tp_cluster_tc_match_plotters - # tp_set: !null, - # tp_selection: !!python/name:python.selections.tp_match_selections} -# gen_selection: gen_part_selections -# - plotter: TPPlotter -# tp_selection: tp_eta_selections -# gen_selection: gen_part_selections - -#test: !!python/name:python.selections.gen_part_selections -samples: - # tree_name: hgcalTriggerNtuplizer/HGCalTriggerNtuple - tree_name: l1CaloTriggerNtuplizer/HGCalTriggerNtuple - - ele_flat2to100_PU0: - input_sample_dir: SingleElectron_PT2to200/SingleE_FlatPt-2to200_PU0_v55/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - ele_flat2to100_PU200: - input_sample_dir: SingleElectron_PT2to200/SingleE_FlatPt-2to200_PU200_v55/ - events_per_job : 200 - - photon_flat8to150_PU0: - input_sample_dir: SinglePhoton_PT2to200/SinglePhoton_FlatPt-2to200_PU0_v55/ - events_per_job : 500 - - photon_flat8to150_PU200: - input_sample_dir: SinglePhoton_PT2to200/SinglePhoton_FlatPt-2to200_PU200_v55B/ - events_per_job : 200 - - pion_flat2to100_PU0: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU0_v33/190911_081445/0000/ - events_per_job : 500 - - pion_flat2to100_PU200: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU200_v33/190911_081546/0000/ - events_per_job : 200 - # - nugun_alleta_pu0: - input_sample_dir: SingleNeutrino/NuGunAllEta_PU0_v14/190123_172948/0000/ - events_per_job: 500 - - nugun_alleta_pu200: - input_sample_dir: MinBias_TuneCP5_14TeV-pythia8/NuGunAllEta_PU200_v55/ - # input_sample_dir: NeutrinoGun_E_10GeV/NuGunAllEta_PU200_v47/191105_135050/0000/ - events_per_job: 300 - - # ttbar_PU200: - # input_sample_dir: TTbar_14TeV_TuneCP5_Pythia8/TTBar_PU200_v45/191105_102500/0000/ - # events_per_job: 200 - # - # dyll_PU200: - # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v48/200210_133300/0000/ - # # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v45/191105_102403/0000/ - # events_per_job: 200 diff --git a/selection_111pre6_v11geom_giovannniTune.yaml b/selection_111pre6_v11geom_giovannniTune.yaml deleted file mode 100644 index 3cbe8e9b..00000000 --- a/selection_111pre6_v11geom_giovannniTune.yaml +++ /dev/null @@ -1,336 +0,0 @@ - -common: - input_dir: /eos/cms/store/cmst3/group/l1tr/cerminar/hgcal/CMSSW1110pre6/ - output_dir: - default: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - Matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v135 - run_clustering: False - run_density_computation: False - calib_version: calib-v131 -# +AccountingGroup = "group_u_CMS.u_zh.users" -# +AccountingGroup = "group_u_CMST3.all" - -collections: - - nugun_tracks: - file_label: - tracks - samples: - - nugun_alleta_pu200 - plotters: - - track_plotters - - tkeg_plotters - - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu200: 0 - - single_empart_guns_tracks: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - plotters: - # - track_plotters - - track_genmatched_plotters - # - tkeg_plotters - - eg_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - - single_part_tt: - file_label: - tt - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - # - tp_egm_plotters - # - tp_genmatched_plotters - # - genpart_plotters - - ttower_plotters - - ttower_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 0 - ele_flat2to100_PU200: 0 - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - single_empart_guns_egvalid: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - - eg_plotters - - eg_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - # dyll_PU200: 5 - - electron_eff_eg: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - # - dyll_PU200 - plotters: - - ele_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - dyll_PU200: 4 - weights: - dyll_PU200: data/dyll_pt_weights.root - - - single_empart_guns_resotuples: - file_label: - reso - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - # - eg_resotuples_plotters - - tp_resotuples_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - - single_empart_guns_calibs: - file_label: - calibs - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - tp_calib_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 1 - - single_empart_guns_tps: - file_label: - tps - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - # - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 4 - - - single_had_guns_tps: - file_label: - tps - samples: - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - # correlator_occupancy: - # file_label: - # pf - # samples: - # - ttbar_PU200 - # - dyll_PU200 - # plotters: - # - correlator_occupancy_plotters - # htc_jobflavor: - # workday - # priorities: - # ttbar_PU200: 2 - # dyll_PU200: 1 - - nugun_rate: - file_label: - rate - samples: - - nugun_alleta_pu200 - plotters: - - rate_plotters - # - ttower_plotters - # - tp_egm_plotters - - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu200: 3 - - noise_samples: - file_label: - noise - samples: - - nugun_alleta_pu0 - - nugun_alleta_pu200 - # - nugun_endcap_PU50 - # - nugun_endcap_PU100 - # - nugun_endcap_PU140 - # - nugun_endcap_PU200 - plotters: - # - rate_plotters - - ttower_plotters - # - tp_egm_plotters - # - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu0: 0 - nugun_alleta_pu200: 0 - - single_empart_guns_tccluster_matcher: - file_label: - tccl - samples: - - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - # - tp_egm_plotters - - tp_cluster_tc_match_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 2 - -plotters: - rate_plotters: !!python/name:python.plotters_config.rate_plotters - tp_egm_plotters: !!python/name:python.plotters_config.tp_plotters - tp_genmatched_debug: !!python/name:python.plotters_config.tp_genmatched_debug - tp_genmatched_plotters: !!python/name:python.plotters_config.tp_genmatched_plotters - genpart_plotters: !!python/name:python.plotters_config.genpart_plotters - ttower_plotters: !!python/name:python.plotters_config.ttower_plotters - ttower_genmatched_plotters: !!python/name:python.plotters_config.ttower_genmatched_plotters - eg_plotters: !!python/name:python.plotters_config.eg_plotters - eg_genmatched_plotters: !!python/name:python.plotters_config.eg_genmatched_plotters - ele_genmatched_plotters: !!python/name:python.plotters_config.ele_genmatched_plotters - eg_rate_plotters: !!python/name:python.plotters_config.eg_rate_plotters - track_plotters: !!python/name:python.plotters_config.track_plotters - track_genmatched_plotters: !!python/name:python.plotters_config.track_genmatched_plotters - tkeg_plotters: !!python/name:python.plotters_config.tkeg_plotters - tp_calib_plotters: !!python/name:python.plotters_config.tp_calib_plotters - correlator_occupancy_plotters: !!python/name:python.plotters_config.correlator_occupancy_plotters - eg_resotuples_plotters: !!python/name:python.plotters_config.eg_resotuples_plotters - tp_resotuples_plotters: !!python/name:python.plotters_config.tp_resotuples_plotters - tp_cluster_tc_match_plotters: !!python/name:python.plotters_config.tp_cluster_tc_match_plotters - # tp_set: !null, - # tp_selection: !!python/name:python.selections.tp_match_selections} -# gen_selection: gen_part_selections -# - plotter: TPPlotter -# tp_selection: tp_eta_selections -# gen_selection: gen_part_selections - -#test: !!python/name:python.selections.gen_part_selections -samples: - # tree_name: hgcalTriggerNtuplizer/HGCalTriggerNtuple - tree_name: l1CaloTriggerNtuplizer/HGCalTriggerNtuple - - ele_flat2to100_PU0: - input_sample_dir: SingleElectron_PT2to200/SingleE_FlatPt-2to200_PU0_v56/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - ele_flat2to100_PU200: - input_sample_dir: SingleElectron_PT2to200/SingleE_FlatPt-2to200_PU200_v56/ - events_per_job : 200 - - photon_flat8to150_PU0: - input_sample_dir: SinglePhoton_PT2to200/SinglePhoton_FlatPt-2to200_PU0_v56/ - events_per_job : 500 - - photon_flat8to150_PU200: - input_sample_dir: SinglePhoton_PT2to200/SinglePhoton_FlatPt-2to200_PU200_v56/ - events_per_job : 200 - - pion_flat2to100_PU0: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU0_v33/190911_081445/0000/ - events_per_job : 500 - - pion_flat2to100_PU200: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU200_v33/190911_081546/0000/ - events_per_job : 200 - # - nugun_alleta_pu0: - input_sample_dir: SingleNeutrino/NuGunAllEta_PU0_v14/190123_172948/0000/ - events_per_job: 500 - - nugun_alleta_pu200: - input_sample_dir: MinBias_TuneCP5_14TeV-pythia8/NuGunAllEta_PU200_v56/ - # input_sample_dir: NeutrinoGun_E_10GeV/NuGunAllEta_PU200_v47/191105_135050/0000/ - events_per_job: 200 - - # ttbar_PU200: - # input_sample_dir: TTbar_14TeV_TuneCP5_Pythia8/TTBar_PU200_v45/191105_102500/0000/ - # events_per_job: 200 - # - # dyll_PU200: - # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v48/200210_133300/0000/ - # # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v45/191105_102403/0000/ - # events_per_job: 200 diff --git a/selection_111pre6_v9geom.yaml b/selection_111pre6_v9geom.yaml deleted file mode 100644 index 355a5916..00000000 --- a/selection_111pre6_v9geom.yaml +++ /dev/null @@ -1,340 +0,0 @@ - -common: - input_dir: /eos/cms/store/cmst3/group/l1tr/cerminar/hgcal/CMSSW1110pre6/ - output_dir: - default: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - Matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v132D - run_clustering: False - run_density_computation: False - calib_version: calib-v130 -# +AccountingGroup = "group_u_CMS.u_zh.users" -# +AccountingGroup = "group_u_CMST3.all" - -collections: - - nugun_tracks: - file_label: - tracks - samples: - - nugun_alleta_pu200 - plotters: - - track_plotters - - tkeg_plotters - - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu200: 0 - - single_empart_guns_tracks: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - plotters: - # - track_plotters - - track_genmatched_plotters - # - tkeg_plotters - - eg_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - - single_part_tt: - file_label: - tt - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - # - tp_egm_plotters - # - tp_genmatched_plotters - # - genpart_plotters - - ttower_plotters - - ttower_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 0 - ele_flat2to100_PU200: 0 - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - single_empart_guns_egvalid: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - - eg_plotters - - eg_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - # dyll_PU200: 5 - - electron_eff_eg: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - # - dyll_PU200 - plotters: - - ele_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - dyll_PU200: 4 - weights: - dyll_PU200: data/dyll_pt_weights.root - - - single_empart_guns_resotuples: - file_label: - reso - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - # - eg_resotuples_plotters - - tp_resotuples_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - - single_empart_guns_calibs: - file_label: - calibs - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - - tp_calib_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 1 - - single_empart_guns_tps: - file_label: - tps - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 4 - - - single_had_guns_tps: - file_label: - tps - samples: - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - # correlator_occupancy: - # file_label: - # pf - # samples: - # - ttbar_PU200 - # - dyll_PU200 - # plotters: - # - correlator_occupancy_plotters - # htc_jobflavor: - # workday - # priorities: - # ttbar_PU200: 2 - # dyll_PU200: 1 - - nugun_rate: - file_label: - rate - samples: - - nugun_alleta_pu200 - plotters: - - rate_plotters - # - ttower_plotters - # - tp_egm_plotters - # - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu200: 3 - - noise_samples: - file_label: - noise - samples: - - nugun_alleta_pu0 - - nugun_alleta_pu200 - # - nugun_endcap_PU50 - # - nugun_endcap_PU100 - # - nugun_endcap_PU140 - # - nugun_endcap_PU200 - plotters: - # - rate_plotters - - ttower_plotters - # - tp_egm_plotters - # - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu0: 0 - nugun_alleta_pu200: 0 - - single_empart_guns_tccluster_matcher: - file_label: - tccl - samples: - - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - # - tp_egm_plotters - - tp_cluster_tc_match_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 2 - -plotters: - rate_plotters: !!python/name:python.plotters_config.rate_plotters - tp_egm_plotters: !!python/name:python.plotters_config.tp_plotters - tp_genmatched_debug: !!python/name:python.plotters_config.tp_genmatched_debug - tp_genmatched_plotters: !!python/name:python.plotters_config.tp_genmatched_plotters - genpart_plotters: !!python/name:python.plotters_config.genpart_plotters - ttower_plotters: !!python/name:python.plotters_config.ttower_plotters - ttower_genmatched_plotters: !!python/name:python.plotters_config.ttower_genmatched_plotters - eg_plotters: !!python/name:python.plotters_config.eg_plotters - eg_genmatched_plotters: !!python/name:python.plotters_config.eg_genmatched_plotters - ele_genmatched_plotters: !!python/name:python.plotters_config.ele_genmatched_plotters - eg_rate_plotters: !!python/name:python.plotters_config.eg_rate_plotters - track_plotters: !!python/name:python.plotters_config.track_plotters - track_genmatched_plotters: !!python/name:python.plotters_config.track_genmatched_plotters - tkeg_plotters: !!python/name:python.plotters_config.tkeg_plotters - tp_calib_plotters: !!python/name:python.plotters_config.tp_calib_plotters - correlator_occupancy_plotters: !!python/name:python.plotters_config.correlator_occupancy_plotters - eg_resotuples_plotters: !!python/name:python.plotters_config.eg_resotuples_plotters - tp_resotuples_plotters: !!python/name:python.plotters_config.tp_resotuples_plotters - tp_cluster_tc_match_plotters: !!python/name:python.plotters_config.tp_cluster_tc_match_plotters - # tp_set: !null, - # tp_selection: !!python/name:python.selections.tp_match_selections} -# gen_selection: gen_part_selections -# - plotter: TPPlotter -# tp_selection: tp_eta_selections -# gen_selection: gen_part_selections - -#test: !!python/name:python.selections.gen_part_selections -samples: - # tree_name: hgcalTriggerNtuplizer/HGCalTriggerNtuple - tree_name: l1CaloTriggerNtuplizer/HGCalTriggerNtuple - - ele_flat2to100_PU0: - input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU0_v53/ - # input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU0_v43/191022_152328/0000/ - # input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU0_v47/191105_134845/0000/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - ele_flat2to100_PU200: - input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU200_v53/ - # input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU200_v43/191022_152446/0000/ - # input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU200_v47/191105_134950/0000/ - events_per_job : 200 - - photon_flat8to150_PU0: - input_sample_dir: SinglePhoton_FlatPt-8to150/SinglePhoton_FlatPt-8to150_PU0_v53/ - events_per_job : 500 - - photon_flat8to150_PU200: - input_sample_dir: SinglePhoton_FlatPt-8to150/SinglePhoton_FlatPt-8to150_PU200_v53/ - events_per_job : 200 - - pion_flat2to100_PU0: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU0_v33/190911_081445/0000/ - events_per_job : 500 - - pion_flat2to100_PU200: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU200_v33/190911_081546/0000/ - events_per_job : 200 - # - nugun_alleta_pu0: - input_sample_dir: SingleNeutrino/NuGunAllEta_PU0_v14/190123_172948/0000/ - events_per_job: 500 - - nugun_alleta_pu200: - input_sample_dir: NeutrinoGun_E_10GeV/NuGunAllEta_PU200_v53/ - # input_sample_dir: NeutrinoGun_E_10GeV/NuGunAllEta_PU200_v47/191105_135050/0000/ - events_per_job: 200 - - # ttbar_PU200: - # input_sample_dir: TTbar_14TeV_TuneCP5_Pythia8/TTBar_PU200_v45/191105_102500/0000/ - # events_per_job: 200 - # - # dyll_PU200: - # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v48/200210_133300/0000/ - # # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v45/191105_102403/0000/ - # events_per_job: 200 diff --git a/selection_NF.yaml b/selection_NF.yaml deleted file mode 100644 index c1d68133..00000000 --- a/selection_NF.yaml +++ /dev/null @@ -1,492 +0,0 @@ - -common: - input_dir: /eos/cms/store/cmst3/group/l1tr/cerminar/hgcal/CMSSW1110pre6/ - output_dir: - default: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - Matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v148B - run_clustering: False - run_density_computation: False - calib_version: calib-v134C -# +AccountingGroup = "group_u_CMS.u_zh.users" -# +AccountingGroup = "group_u_CMST3.all" - -collections: - - nugun_tracks: - file_label: - tracks - samples: - - nugun_alleta_pu200 - plotters: - - track_plotters - # - tkeg_plotters - - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu200: 0 - events_per_job: - nugun_alleta_pu200: 10 - - single_empart_guns_tracks: - file_label: - eg - samples: - - doubleele_flat1to100_PU0 - - doubleele_flat1to100_PU200 - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - plotters: - # - track_plotters - - track_genmatched_plotters - # - tkeg_plotters - # - eg_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - doubleele_flat1to100_PU0: 1 - doubleele_flat1to100_PU200: 5 - events_per_job: - # ele_flat2to100_PU0: 1 - # ele_flat2to100_PU200: 5 - # photon_flat8to150_PU0: 0 - # photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2100 - doubleele_flat1to100_PU200: 800 - doublephoton_flat1to100_PU200: 800 - - - single_part_tt: - file_label: - tt - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - # - tp_plotters - # - tp_genmatched_plotters - # - genpart_plotters - - ttower_plotters - - ttower_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 0 - ele_flat2to100_PU200: 0 - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - - single_empart_guns_isostudy: - file_label: - eg - samples: - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - # - doubleele_flat1to100_PU0 - - doubleele_flat1to100_PU200 - - doublephoton_flat1to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - # - eg_plotters - - eg_genmatched_plotters_iso - htc_jobflavor: - longlunch - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - doublephoton_flat1to100_PU200: 6 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2 - doubleele_flat1to100_PU200: 7 - events_per_job: - # ele_flat2to100_PU0: 1 - # ele_flat2to100_PU200: 5 - # photon_flat8to150_PU0: 0 - # photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2000 - doubleele_flat1to100_PU200: 10000 - doublephoton_flat1to100_PU200: 2000 - - - single_empart_guns_egvalid: - file_label: - eg - samples: - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - # - doubleele_flat1to100_PU0 - - doubleele_flat1to100_PU200 - - doublephoton_flat1to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - - eg_plotters - - eg_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - doublephoton_flat1to100_PU200: 6 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2 - doubleele_flat1to100_PU200: 7 - events_per_job: - # ele_flat2to100_PU0: 1 - # ele_flat2to100_PU200: 5 - # photon_flat8to150_PU0: 0 - # photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 5000 - doubleele_flat1to100_PU200: 3000 - doublephoton_flat1to100_PU200: 5000 - - # dyll_PU200: 5 - - electron_eff_eg: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - # - dyll_PU200 - plotters: - - ele_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - dyll_PU200: 4 - weights: - dyll_PU200: data/dyll_pt_weights.root - - - single_empart_guns_resotuples: - file_label: - reso - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - eg_resotuples_plotters - - tp_resotuples_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - - single_empart_guns_calibs: - file_label: - calibs - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - tp_calib_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 1 - - single_empart_guns_tps: - file_label: - tps - samples: - - doubleele_flat1to100_PU200 - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - tp_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 4 - doubleele_flat1to100_PU200: 5 - events_per_job: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2100 - doubleele_flat1to100_PU200: 800 - doublephoton_flat1to100_PU200: 800 - - - highpt_tps: - file_label: - tps - samples: - - zprime_ee_PU200 - plotters: - # - tp_plotters - - tp_genmatched_extrange_plotters - # - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - workday - priorities: - zprime_ee_PU200: 5 - events_per_job: - zprime_ee_PU200: 2000 - - single_had_guns_tps: - file_label: - tps - samples: - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - - tp_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - correlator_occupancy: - file_label: - pf - samples: - - ttbar_PU200 - # - dyll_PU200 - plotters: - - correlator_occupancy_plotters - - pftrack_plotters - htc_jobflavor: - microcentury - priorities: - ttbar_PU200: 3 - # dyll_PU200: 1 - events_per_job: - ttbar_PU200: 200 - - nugun_rate: - file_label: - rate - samples: - - nugun_alleta_pu200 - plotters: - # - rate_plotters - # - ttower_plotters - # - tp_plotters - # - eg_plotters - - eg_rate_plotters - htc_jobflavor: - microcentury - priorities: - nugun_alleta_pu200: 6 - events_per_job: - nugun_alleta_pu200: 20000 - - noise_samples: - file_label: - noise - samples: - - nugun_alleta_pu0 - - nugun_alleta_pu200 - # - nugun_endcap_PU50 - # - nugun_endcap_PU100 - # - nugun_endcap_PU140 - # - nugun_endcap_PU200 - plotters: - # - rate_plotters - - ttower_plotters - # - tp_plotters - # - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu0: 0 - nugun_alleta_pu200: 0 - - single_empart_guns_tccluster_matcher: - file_label: - tccl - samples: - - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - # - tp_plotters - - tp_cluster_tc_match_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 2 - - - isostudy_eg: - file_label: - iso - samples: - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - # - doubleele_flat1to100_PU0 - - doublephoton_flat1to100_PU200 - - doubleele_flat1to100_PU200 - - nugun_alleta_pu200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - - eg_isotuples_plotters - htc_jobflavor: - microcentury - priorities: - nugun_alleta_pu200: 6 - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2 - doubleele_flat1to100_PU200: 7 - doublephoton_flat1to100_PU200: 6 - events_per_job: - doubleele_flat1to100_PU0: 10000 - doubleele_flat1to100_PU200: 20000 - doublephoton_flat1to100_PU200: 20000 - nugun_alleta_pu200: 11000 - - - -plotters: - rate_plotters: !!python/name:python.plotters_config.rate_plotters - tp_plotters: !!python/name:python.plotters_config.tp_plotters - tp_genmatched_plotters: !!python/name:python.plotters_config.tp_genmatched_plotters - tp_genmatched_extrange_plotters: !!python/name:python.plotters_config.tp_genmatched_extrange_plotters - genpart_plotters: !!python/name:python.plotters_config.genpart_plotters - ttower_plotters: !!python/name:python.plotters_config.ttower_plotters - ttower_genmatched_plotters: !!python/name:python.plotters_config.ttower_genmatched_plotters - eg_plotters: !!python/name:python.plotters_config.eg_plotters - eg_genmatched_plotters: !!python/name:python.plotters_config.eg_genmatched_plotters - eg_genmatched_plotters_iso: !!python/name:python.plotters_config.eg_genmatched_plotters_iso - ele_genmatched_plotters: !!python/name:python.plotters_config.ele_genmatched_plotters - eg_rate_plotters: !!python/name:python.plotters_config.eg_rate_plotters - track_plotters: !!python/name:python.plotters_config.track_plotters - track_genmatched_plotters: !!python/name:python.plotters_config.track_genmatched_plotters - # tkeg_plotters: !!python/name:python.plotters_config.tkeg_plotters - tp_calib_plotters: !!python/name:python.plotters_config.tp_calib_plotters - correlator_occupancy_plotters: !!python/name:python.plotters_config.correlator_occupancy_plotters - pftrack_plotters: !!python/name:python.plotters_config.pftrack_plotters - eg_resotuples_plotters: !!python/name:python.plotters_config.eg_resotuples_plotters - tp_resotuples_plotters: !!python/name:python.plotters_config.tp_resotuples_plotters - tp_cluster_tc_match_plotters: !!python/name:python.plotters_config.tp_cluster_tc_match_plotters - eg_isotuples_plotters: !!python/name:python.plotters_config.eg_isotuples_plotters - # tp_set: !null, - # tp_selection: !!python/name:python.selections.tp_match_selections} -# gen_selection: gen_part_selections -# - plotter: TPPlotter -# tp_selection: tp_eta_selections -# gen_selection: gen_part_selections - -#test: !!python/name:python.selections.gen_part_selections -samples: - # tree_name: hgcalTriggerNtuplizer/HGCalTriggerNtuple - tree_name: l1CaloTriggerNtuplizer_egOnly/HGCalTriggerNtuple - # tree_name: l1CaloTriggerNtuplizer/HGCalTriggerNtuple - - doubleele_flat1to100_PU0: - input_sample_dir: DoubleElectron_FlatPt-1To100/DoubleElectron_FlatPt-1To100_PU0_v64E/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - doubleele_flat1to100_PU200: - input_sample_dir: DoubleElectron_FlatPt-1To100/DoubleElectron_FlatPt-1To100_PU200_v66/ - events_per_job : 200 - - doublephoton_flat1to100_PU200: - input_sample_dir: DoublePhoton_FlatPt-1To100/DoublePhoton_FlatPt-1To100_PU200_v66/ - events_per_job : 200 - - ele_flat2to100_PU0: - input_sample_dir: SingleElectron_PT2to200/SingleE_FlatPt-2to200_PU0_v60G2/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - ele_flat2to100_PU200: - input_sample_dir: SingleElectron_PT2to200/SingleE_FlatPt-2to200_PU200_v60G2/ - events_per_job : 200 - - photon_flat8to150_PU0: - input_sample_dir: SinglePhoton_PT2to200/SinglePhoton_FlatPt-2to200_PU0_v60D/ - events_per_job : 500 - - photon_flat8to150_PU200: - input_sample_dir: SinglePhoton_PT2to200/SinglePhoton_FlatPt-2to200_PU200_v60D/ - events_per_job : 200 - - pion_flat2to100_PU0: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU0_v33/190911_081445/0000/ - events_per_job : 500 - - pion_flat2to100_PU200: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU200_v33/190911_081546/0000/ - events_per_job : 200 - # - nugun_alleta_pu0: - input_sample_dir: SingleNeutrino/NuGunAllEta_PU0_v14/190123_172948/0000/ - events_per_job: 500 - - nugun_alleta_pu200: - input_sample_dir: MinBias_TuneCP5_14TeV-pythia8/NuGunAllEta_PU200_v65B/ - # input_sample_dir: NeutrinoGun_E_10GeV/NuGunAllEta_PU200_v47/191105_135050/0000/ - events_per_job: 300 - - ttbar_PU200: - input_sample_dir: TT_TuneCP5_14TeV-powheg-pythia8/TT_PU200_v64D/ - events_per_job: 200 - - zprime_ee_PU200: - input_sample_dir: ZprimeToEE_M-6000_TuneCP5_14TeV-pythia8/ZPrimeEE_PU200_v64C/ - events_per_job: 200 - # - # dyll_PU200: - # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v48/200210_133300/0000/ - # # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v45/191105_102403/0000/ - # events_per_job: 200 diff --git a/selection_NF_v65B.yaml b/selection_NF_v65B.yaml deleted file mode 100644 index 03c89e8e..00000000 --- a/selection_NF_v65B.yaml +++ /dev/null @@ -1,492 +0,0 @@ - -common: - input_dir: /eos/cms/store/cmst3/group/l1tr/cerminar/hgcal/CMSSW1110pre6/ - output_dir: - default: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - Matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v147D - run_clustering: False - run_density_computation: False - calib_version: calib-v134C -# +AccountingGroup = "group_u_CMS.u_zh.users" -# +AccountingGroup = "group_u_CMST3.all" - -collections: - - nugun_tracks: - file_label: - tracks - samples: - - nugun_alleta_pu200 - plotters: - - track_plotters - # - tkeg_plotters - - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu200: 0 - events_per_job: - nugun_alleta_pu200: 10 - - single_empart_guns_tracks: - file_label: - eg - samples: - - doubleele_flat1to100_PU0 - - doubleele_flat1to100_PU200 - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - plotters: - # - track_plotters - - track_genmatched_plotters - # - tkeg_plotters - # - eg_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - doubleele_flat1to100_PU0: 1 - doubleele_flat1to100_PU200: 5 - events_per_job: - # ele_flat2to100_PU0: 1 - # ele_flat2to100_PU200: 5 - # photon_flat8to150_PU0: 0 - # photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2100 - doubleele_flat1to100_PU200: 800 - doublephoton_flat1to100_PU200: 800 - - - single_part_tt: - file_label: - tt - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - # - tp_plotters - # - tp_genmatched_plotters - # - genpart_plotters - - ttower_plotters - - ttower_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 0 - ele_flat2to100_PU200: 0 - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - - single_empart_guns_isostudy: - file_label: - eg - samples: - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - # - doubleele_flat1to100_PU0 - - doubleele_flat1to100_PU200 - - doublephoton_flat1to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - # - eg_plotters - - eg_genmatched_plotters_iso - htc_jobflavor: - longlunch - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - doublephoton_flat1to100_PU200: 6 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2 - doubleele_flat1to100_PU200: 7 - events_per_job: - # ele_flat2to100_PU0: 1 - # ele_flat2to100_PU200: 5 - # photon_flat8to150_PU0: 0 - # photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2000 - doubleele_flat1to100_PU200: 10000 - doublephoton_flat1to100_PU200: 2000 - - - single_empart_guns_egvalid: - file_label: - eg - samples: - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - # - doubleele_flat1to100_PU0 - - doubleele_flat1to100_PU200 - - doublephoton_flat1to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - - eg_plotters - - eg_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - doublephoton_flat1to100_PU200: 6 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2 - doubleele_flat1to100_PU200: 7 - events_per_job: - # ele_flat2to100_PU0: 1 - # ele_flat2to100_PU200: 5 - # photon_flat8to150_PU0: 0 - # photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 5000 - doubleele_flat1to100_PU200: 3000 - doublephoton_flat1to100_PU200: 5000 - - # dyll_PU200: 5 - - electron_eff_eg: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - # - dyll_PU200 - plotters: - - ele_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - dyll_PU200: 4 - weights: - dyll_PU200: data/dyll_pt_weights.root - - - single_empart_guns_resotuples: - file_label: - reso - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - eg_resotuples_plotters - - tp_resotuples_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - - single_empart_guns_calibs: - file_label: - calibs - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - tp_calib_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 1 - - single_empart_guns_tps: - file_label: - tps - samples: - - doubleele_flat1to100_PU200 - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - tp_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 4 - doubleele_flat1to100_PU200: 5 - events_per_job: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2100 - doubleele_flat1to100_PU200: 800 - doublephoton_flat1to100_PU200: 800 - - - highpt_tps: - file_label: - tps - samples: - - zprime_ee_PU200 - plotters: - # - tp_plotters - - tp_genmatched_extrange_plotters - # - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - workday - priorities: - zprime_ee_PU200: 5 - events_per_job: - zprime_ee_PU200: 2000 - - single_had_guns_tps: - file_label: - tps - samples: - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - - tp_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - correlator_occupancy: - file_label: - pf - samples: - - ttbar_PU200 - # - dyll_PU200 - plotters: - - correlator_occupancy_plotters - - pftrack_plotters - htc_jobflavor: - microcentury - priorities: - ttbar_PU200: 3 - # dyll_PU200: 1 - events_per_job: - ttbar_PU200: 200 - - nugun_rate: - file_label: - rate - samples: - - nugun_alleta_pu200 - plotters: - # - rate_plotters - # - ttower_plotters - # - tp_plotters - # - eg_plotters - - eg_rate_plotters - htc_jobflavor: - microcentury - priorities: - nugun_alleta_pu200: 6 - events_per_job: - nugun_alleta_pu200: 20000 - - noise_samples: - file_label: - noise - samples: - - nugun_alleta_pu0 - - nugun_alleta_pu200 - # - nugun_endcap_PU50 - # - nugun_endcap_PU100 - # - nugun_endcap_PU140 - # - nugun_endcap_PU200 - plotters: - # - rate_plotters - - ttower_plotters - # - tp_plotters - # - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu0: 0 - nugun_alleta_pu200: 0 - - single_empart_guns_tccluster_matcher: - file_label: - tccl - samples: - - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - # - tp_plotters - - tp_cluster_tc_match_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 2 - - - isostudy_eg: - file_label: - iso - samples: - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - # - doubleele_flat1to100_PU0 - - doublephoton_flat1to100_PU200 - - doubleele_flat1to100_PU200 - - nugun_alleta_pu200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - - eg_isotuples_plotters - htc_jobflavor: - microcentury - priorities: - nugun_alleta_pu200: 6 - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2 - doubleele_flat1to100_PU200: 7 - doublephoton_flat1to100_PU200: 6 - events_per_job: - doubleele_flat1to100_PU0: 10000 - doubleele_flat1to100_PU200: 20000 - doublephoton_flat1to100_PU200: 20000 - nugun_alleta_pu200: 11000 - - - -plotters: - rate_plotters: !!python/name:python.plotters_config.rate_plotters - tp_plotters: !!python/name:python.plotters_config.tp_plotters - tp_genmatched_plotters: !!python/name:python.plotters_config.tp_genmatched_plotters - tp_genmatched_extrange_plotters: !!python/name:python.plotters_config.tp_genmatched_extrange_plotters - genpart_plotters: !!python/name:python.plotters_config.genpart_plotters - ttower_plotters: !!python/name:python.plotters_config.ttower_plotters - ttower_genmatched_plotters: !!python/name:python.plotters_config.ttower_genmatched_plotters - eg_plotters: !!python/name:python.plotters_config.eg_plotters - eg_genmatched_plotters: !!python/name:python.plotters_config.eg_genmatched_plotters - eg_genmatched_plotters_iso: !!python/name:python.plotters_config.eg_genmatched_plotters_iso - ele_genmatched_plotters: !!python/name:python.plotters_config.ele_genmatched_plotters - eg_rate_plotters: !!python/name:python.plotters_config.eg_rate_plotters - track_plotters: !!python/name:python.plotters_config.track_plotters - track_genmatched_plotters: !!python/name:python.plotters_config.track_genmatched_plotters - # tkeg_plotters: !!python/name:python.plotters_config.tkeg_plotters - tp_calib_plotters: !!python/name:python.plotters_config.tp_calib_plotters - correlator_occupancy_plotters: !!python/name:python.plotters_config.correlator_occupancy_plotters - pftrack_plotters: !!python/name:python.plotters_config.pftrack_plotters - eg_resotuples_plotters: !!python/name:python.plotters_config.eg_resotuples_plotters - tp_resotuples_plotters: !!python/name:python.plotters_config.tp_resotuples_plotters - tp_cluster_tc_match_plotters: !!python/name:python.plotters_config.tp_cluster_tc_match_plotters - eg_isotuples_plotters: !!python/name:python.plotters_config.eg_isotuples_plotters - # tp_set: !null, - # tp_selection: !!python/name:python.selections.tp_match_selections} -# gen_selection: gen_part_selections -# - plotter: TPPlotter -# tp_selection: tp_eta_selections -# gen_selection: gen_part_selections - -#test: !!python/name:python.selections.gen_part_selections -samples: - # tree_name: hgcalTriggerNtuplizer/HGCalTriggerNtuple - tree_name: l1CaloTriggerNtuplizer_egOnly/HGCalTriggerNtuple - # tree_name: l1CaloTriggerNtuplizer/HGCalTriggerNtuple - - doubleele_flat1to100_PU0: - input_sample_dir: DoubleElectron_FlatPt-1To100/DoubleElectron_FlatPt-1To100_PU0_v64E/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - doubleele_flat1to100_PU200: - input_sample_dir: DoubleElectron_FlatPt-1To100/DoubleElectron_FlatPt-1To100_PU200_v65B/ - events_per_job : 200 - - doublephoton_flat1to100_PU200: - input_sample_dir: DoublePhoton_FlatPt-1To100/DoublePhoton_FlatPt-1To100_PU200_v65B/ - events_per_job : 200 - - ele_flat2to100_PU0: - input_sample_dir: SingleElectron_PT2to200/SingleE_FlatPt-2to200_PU0_v60G2/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - ele_flat2to100_PU200: - input_sample_dir: SingleElectron_PT2to200/SingleE_FlatPt-2to200_PU200_v60G2/ - events_per_job : 200 - - photon_flat8to150_PU0: - input_sample_dir: SinglePhoton_PT2to200/SinglePhoton_FlatPt-2to200_PU0_v60D/ - events_per_job : 500 - - photon_flat8to150_PU200: - input_sample_dir: SinglePhoton_PT2to200/SinglePhoton_FlatPt-2to200_PU200_v60D/ - events_per_job : 200 - - pion_flat2to100_PU0: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU0_v33/190911_081445/0000/ - events_per_job : 500 - - pion_flat2to100_PU200: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU200_v33/190911_081546/0000/ - events_per_job : 200 - # - nugun_alleta_pu0: - input_sample_dir: SingleNeutrino/NuGunAllEta_PU0_v14/190123_172948/0000/ - events_per_job: 500 - - nugun_alleta_pu200: - input_sample_dir: MinBias_TuneCP5_14TeV-pythia8/NuGunAllEta_PU200_v65B/ - # input_sample_dir: NeutrinoGun_E_10GeV/NuGunAllEta_PU200_v47/191105_135050/0000/ - events_per_job: 300 - - ttbar_PU200: - input_sample_dir: TT_TuneCP5_14TeV-powheg-pythia8/TT_PU200_v64D/ - events_per_job: 200 - - zprime_ee_PU200: - input_sample_dir: ZprimeToEE_M-6000_TuneCP5_14TeV-pythia8/ZPrimeEE_PU200_v64C/ - events_per_job: 200 - # - # dyll_PU200: - # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v48/200210_133300/0000/ - # # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v45/191105_102403/0000/ - # events_per_job: 200 diff --git a/selection_th20.yaml b/selection_th20.yaml deleted file mode 100644 index 8cb6ade1..00000000 --- a/selection_th20.yaml +++ /dev/null @@ -1,181 +0,0 @@ - -common: - input_dir: /eos/cms/store/cmst3/group/l1tr/cerminar/hgcal/CMSSW1015/ - output_dir: - default: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - Matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v68 - run_clustering: False - run_density_computation: False - - -collections: - nugun_tracks: - samples: - - nugun_alleta_pu200 - plotters: - - track_plotters - - tkeg_plotters - - eg_rate_plotters - - single_empart_guns_tracks: - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - plotters: - - track_plotters - - track_genmatched_plotters - - tkeg_plotters - - eg_genmatched_plotters - - single_part_tt: - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - # - tp_egm_plotters - # - tp_genmatched_plotters - # - genpart_plotters - - ttower_plotters - - ttower_genmatched_plotters - - - - single_empart_guns_egvalid: - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - - eg_plotters - - eg_genmatched_plotters - - - single_empart_guns: - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - - - single_part_guns: - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - - nugun_rate: - samples: - - nugun_alleta_pu200 - plotters: - - rate_plotters - # - ttower_plotters - - tp_egm_plotters - - eg_rate_plotters - - noise_samples: - samples: - - nugun_alleta_pu0 - - nugun_alleta_pu200 - # - nugun_endcap_PU50 - # - nugun_endcap_PU100 - # - nugun_endcap_PU140 - # - nugun_endcap_PU200 - plotters: - # - rate_plotters - - ttower_plotters - # - tp_egm_plotters - # - eg_rate_plotters - -plotters: - rate_plotters: !!python/name:python.plotters.rate_plotters - tp_egm_plotters: !!python/name:python.plotters.tp_plotters - tp_genmatched_plotters: !!python/name:python.plotters.tp_genmatched_plotters - genpart_plotters: !!python/name:python.plotters.genpart_plotters - ttower_plotters: !!python/name:python.plotters.ttower_plotters - ttower_genmatched_plotters: !!python/name:python.plotters.ttower_genmatched_plotters - eg_plotters: !!python/name:python.plotters.eg_plotters - eg_genmatched_plotters: !!python/name:python.plotters.eg_genmatched_plotters - eg_rate_plotters: !!python/name:python.plotters.eg_rate_plotters - track_plotters: !!python/name:python.plotters.track_plotters - track_genmatched_plotters: !!python/name:python.plotters.track_genmatched_plotters - tkeg_plotters: !!python/name:python.plotters.tkeg_plotters - # tp_set: !null, - # tp_selection: !!python/name:python.selections.tp_match_selections} -# gen_selection: gen_part_selections -# - plotter: TPPlotter -# tp_selection: tp_eta_selections -# gen_selection: gen_part_selections - - -#test: !!python/name:python.selections.gen_part_selections -samples: - ele_flat2to100_PU0: - input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU0_v15/190222_164623/0000/ - events_per_job : 500 - - ele_flat2to100_PU200: - input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU200_v15/190222_164647/0000/ - events_per_job : 200 - - photon_flat8to150_PU0: - input_sample_dir: SinglePhoton_FlatPt-8to150/SinglePhoton_FlatPt-8to150_PU0_v17/190225_205316/0000/ - events_per_job : 500 - - photon_flat8to150_PU200: - input_sample_dir: SinglePhoton_FlatPt-8to150/SinglePhoton_FlatPt-8to150_PU200_v17/190225_205341/0000/ - events_per_job : 200 - - pion_flat2to100_PU0: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU0_v13/181116_090611/0000/ - events_per_job : 500 - - pion_flat2to100_PU200: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU200_v13/181126_123358/0000/ - events_per_job : 200 - - nugun_alleta_pu0: - input_sample_dir: SingleNeutrino/NuGunAllEta_PU0_v14/190123_172948/0000/ - events_per_job: 500 - - nugun_alleta_pu200: - input_sample_dir: SingleNeutrino/NuGunAllEta_PU200_v17/190225_205406/0000/ - events_per_job: 200 - - nugun_endcap_PU50: - input_sample_dir: NuGun_PU50/NTP/v13/ - events_per_job: 500 - - nugun_endcap_PU100: - input_sample_dir: NuGun_PU100/NTP/v13/ - events_per_job: 500 - - nugun_endcap_PU140: - input_sample_dir: NuGun_PU140/NTP/v13/ - events_per_job: 500 - - nugun_endcap_PU200: - input_sample_dir: NuGun_PU200/NTP/v13/ - events_per_job: 200 diff --git a/selection_tps.yaml b/selection_tps.yaml deleted file mode 100644 index 5fbaa7fb..00000000 --- a/selection_tps.yaml +++ /dev/null @@ -1,492 +0,0 @@ - -common: - input_dir: /eos/cms/store/cmst3/group/l1tr/cerminar/hgcal/CMSSW1110pre6/ - output_dir: - default: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - Matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v146E - run_clustering: False - run_density_computation: False - calib_version: calib-v134C -# +AccountingGroup = "group_u_CMS.u_zh.users" -# +AccountingGroup = "group_u_CMST3.all" - -collections: - - nugun_tracks: - file_label: - tracks - samples: - - nugun_alleta_pu200 - plotters: - - track_plotters - # - tkeg_plotters - - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu200: 0 - events_per_job: - nugun_alleta_pu200: 10 - - single_empart_guns_tracks: - file_label: - eg - samples: - - doubleele_flat1to100_PU0 - - doubleele_flat1to100_PU200 - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - plotters: - # - track_plotters - - track_genmatched_plotters - # - tkeg_plotters - # - eg_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - doubleele_flat1to100_PU0: 1 - doubleele_flat1to100_PU200: 5 - events_per_job: - # ele_flat2to100_PU0: 1 - # ele_flat2to100_PU200: 5 - # photon_flat8to150_PU0: 0 - # photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2100 - doubleele_flat1to100_PU200: 800 - doublephoton_flat1to100_PU200: 800 - - - single_part_tt: - file_label: - tt - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - # - tp_plotters - # - tp_genmatched_plotters - # - genpart_plotters - - ttower_plotters - - ttower_genmatched_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 0 - ele_flat2to100_PU200: 0 - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - - single_empart_guns_isostudy: - file_label: - eg - samples: - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - # - doubleele_flat1to100_PU0 - - doubleele_flat1to100_PU200 - - doublephoton_flat1to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - # - eg_plotters - - eg_genmatched_plotters_iso - htc_jobflavor: - longlunch - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - doublephoton_flat1to100_PU200: 6 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2 - doubleele_flat1to100_PU200: 7 - events_per_job: - # ele_flat2to100_PU0: 1 - # ele_flat2to100_PU200: 5 - # photon_flat8to150_PU0: 0 - # photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2000 - doubleele_flat1to100_PU200: 10000 - doublephoton_flat1to100_PU200: 2000 - - - single_empart_guns_egvalid: - file_label: - eg - samples: - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - # - doubleele_flat1to100_PU0 - - doubleele_flat1to100_PU200 - - doublephoton_flat1to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - - eg_plotters - - eg_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - doublephoton_flat1to100_PU200: 6 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2 - doubleele_flat1to100_PU200: 7 - events_per_job: - # ele_flat2to100_PU0: 1 - # ele_flat2to100_PU200: 5 - # photon_flat8to150_PU0: 0 - # photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2000 - doubleele_flat1to100_PU200: 1000 - doublephoton_flat1to100_PU200: 1000 - - # dyll_PU200: 5 - - electron_eff_eg: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - # - dyll_PU200 - plotters: - - ele_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - dyll_PU200: 4 - weights: - dyll_PU200: data/dyll_pt_weights.root - - - single_empart_guns_resotuples: - file_label: - reso - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - eg_resotuples_plotters - - tp_resotuples_plotters - htc_jobflavor: - workday - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - - single_empart_guns_calibs: - file_label: - calibs - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - tp_calib_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 1 - - single_empart_guns_tps: - file_label: - tps - samples: - - doubleele_flat1to100_PU200 - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - # - tp_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 4 - doubleele_flat1to100_PU200: 5 - events_per_job: - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2100 - doubleele_flat1to100_PU200: 10000 - doublephoton_flat1to100_PU200: 5000 - - - highpt_tps: - file_label: - tps - samples: - - zprime_ee_PU200 - plotters: - # - tp_plotters - - tp_genmatched_extrange_plotters - # - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - workday - priorities: - zprime_ee_PU200: 5 - events_per_job: - zprime_ee_PU200: 2000 - - single_had_guns_tps: - file_label: - tps - samples: - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - - tp_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - priorities: - pion_flat2to100_PU0: 0 - pion_flat2to100_PU200: 0 - - correlator_occupancy: - file_label: - pf - samples: - - ttbar_PU200 - # - dyll_PU200 - plotters: - - correlator_occupancy_plotters - - pftrack_plotters - htc_jobflavor: - microcentury - priorities: - ttbar_PU200: 3 - # dyll_PU200: 1 - events_per_job: - ttbar_PU200: 200 - - nugun_rate: - file_label: - rate - samples: - - nugun_alleta_pu200 - plotters: - # - rate_plotters - # - ttower_plotters - # - tp_plotters - # - eg_plotters - - eg_rate_plotters - htc_jobflavor: - microcentury - priorities: - nugun_alleta_pu200: 6 - events_per_job: - nugun_alleta_pu200: 20000 - - noise_samples: - file_label: - noise - samples: - - nugun_alleta_pu0 - - nugun_alleta_pu200 - # - nugun_endcap_PU50 - # - nugun_endcap_PU100 - # - nugun_endcap_PU140 - # - nugun_endcap_PU200 - plotters: - # - rate_plotters - - ttower_plotters - # - tp_plotters - # - eg_rate_plotters - htc_jobflavor: - workday - priorities: - nugun_alleta_pu0: 0 - nugun_alleta_pu200: 0 - - single_empart_guns_tccluster_matcher: - file_label: - tccl - samples: - - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - # - tp_plotters - - tp_cluster_tc_match_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - microcentury - priorities: - ele_flat2to100_PU0: 5 - ele_flat2to100_PU200: 3 - photon_flat8to150_PU0: 4 - photon_flat8to150_PU200: 2 - - - isostudy_eg: - file_label: - iso - samples: - # - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - # - doubleele_flat1to100_PU0 - - doublephoton_flat1to100_PU200 - - doubleele_flat1to100_PU200 - - nugun_alleta_pu200 - # - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - # - dyll_PU200 - plotters: - - eg_isotuples_plotters - htc_jobflavor: - microcentury - priorities: - nugun_alleta_pu200: 6 - ele_flat2to100_PU0: 1 - ele_flat2to100_PU200: 5 - photon_flat8to150_PU0: 0 - photon_flat8to150_PU200: 0 - doubleele_flat1to100_PU0: 2 - doubleele_flat1to100_PU200: 7 - doublephoton_flat1to100_PU200: 6 - events_per_job: - doubleele_flat1to100_PU0: 10000 - doubleele_flat1to100_PU200: 20000 - doublephoton_flat1to100_PU200: 20000 - nugun_alleta_pu200: 11000 - - - -plotters: - rate_plotters: !!python/name:python.plotters_config.rate_plotters - tp_plotters: !!python/name:python.plotters_config.tp_plotters - tp_genmatched_plotters: !!python/name:python.plotters_config.tp_genmatched_plotters - tp_genmatched_extrange_plotters: !!python/name:python.plotters_config.tp_genmatched_extrange_plotters - genpart_plotters: !!python/name:python.plotters_config.genpart_plotters - ttower_plotters: !!python/name:python.plotters_config.ttower_plotters - ttower_genmatched_plotters: !!python/name:python.plotters_config.ttower_genmatched_plotters - eg_plotters: !!python/name:python.plotters_config.eg_plotters - eg_genmatched_plotters: !!python/name:python.plotters_config.eg_genmatched_plotters - eg_genmatched_plotters_iso: !!python/name:python.plotters_config.eg_genmatched_plotters_iso - ele_genmatched_plotters: !!python/name:python.plotters_config.ele_genmatched_plotters - eg_rate_plotters: !!python/name:python.plotters_config.eg_rate_plotters - track_plotters: !!python/name:python.plotters_config.track_plotters - track_genmatched_plotters: !!python/name:python.plotters_config.track_genmatched_plotters - # tkeg_plotters: !!python/name:python.plotters_config.tkeg_plotters - tp_calib_plotters: !!python/name:python.plotters_config.tp_calib_plotters - correlator_occupancy_plotters: !!python/name:python.plotters_config.correlator_occupancy_plotters - pftrack_plotters: !!python/name:python.plotters_config.pftrack_plotters - eg_resotuples_plotters: !!python/name:python.plotters_config.eg_resotuples_plotters - tp_resotuples_plotters: !!python/name:python.plotters_config.tp_resotuples_plotters - tp_cluster_tc_match_plotters: !!python/name:python.plotters_config.tp_cluster_tc_match_plotters - eg_isotuples_plotters: !!python/name:python.plotters_config.eg_isotuples_plotters - # tp_set: !null, - # tp_selection: !!python/name:python.selections.tp_match_selections} -# gen_selection: gen_part_selections -# - plotter: TPPlotter -# tp_selection: tp_eta_selections -# gen_selection: gen_part_selections - -#test: !!python/name:python.selections.gen_part_selections -samples: - # tree_name: hgcalTriggerNtuplizer/HGCalTriggerNtuple - # tree_name: l1CaloTriggerNtuplizer_egOnly/HGCalTriggerNtuple - tree_name: l1CaloTriggerNtuplizer/HGCalTriggerNtuple - - doubleele_flat1to100_PU0: - input_sample_dir: DoubleElectron_FlatPt-1To100/DoubleElectron_FlatPt-1To100_PU0_v64D/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - doubleele_flat1to100_PU200: - input_sample_dir: DoubleElectron_FlatPt-1To100/DoubleElectron_FlatPt-1To100_PU200_v63H/ - events_per_job : 200 - - doublephoton_flat1to100_PU200: - input_sample_dir: DoublePhoton_FlatPt-1To100/DoublePhoton_FlatPt-1To100_PU200_v64D/ - events_per_job : 200 - - ele_flat2to100_PU0: - input_sample_dir: SingleElectron_PT2to200/SingleE_FlatPt-2to200_PU0_v60G2/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - ele_flat2to100_PU200: - input_sample_dir: SingleElectron_PT2to200/SingleE_FlatPt-2to200_PU200_v60G2/ - events_per_job : 200 - - photon_flat8to150_PU0: - input_sample_dir: SinglePhoton_PT2to200/SinglePhoton_FlatPt-2to200_PU0_v60D/ - events_per_job : 500 - - photon_flat8to150_PU200: - input_sample_dir: SinglePhoton_PT2to200/SinglePhoton_FlatPt-2to200_PU200_v60D/ - events_per_job : 200 - - pion_flat2to100_PU0: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU0_v33/190911_081445/0000/ - events_per_job : 500 - - pion_flat2to100_PU200: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU200_v33/190911_081546/0000/ - events_per_job : 200 - # - nugun_alleta_pu0: - input_sample_dir: SingleNeutrino/NuGunAllEta_PU0_v14/190123_172948/0000/ - events_per_job: 500 - - nugun_alleta_pu200: - input_sample_dir: MinBias_TuneCP5_14TeV-pythia8/NuGunAllEta_PU200_v64D/ - # input_sample_dir: NeutrinoGun_E_10GeV/NuGunAllEta_PU200_v47/191105_135050/0000/ - events_per_job: 300 - - ttbar_PU200: - input_sample_dir: TT_TuneCP5_14TeV-powheg-pythia8/TT_PU200_v64D/ - events_per_job: 200 - - zprime_ee_PU200: - input_sample_dir: ZprimeToEE_M-6000_TuneCP5_14TeV-pythia8/ZPrimeEE_PU200_v64C/ - events_per_job: 200 - # - # dyll_PU200: - # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v48/200210_133300/0000/ - # # input_sample_dir: DYToLL_M-50_14TeV_TuneCP5_pythia8/DYToLL_PU200_v45/191105_102403/0000/ - # events_per_job: 200 diff --git a/selection_v11.yaml b/selection_v11.yaml deleted file mode 100644 index a46f4968..00000000 --- a/selection_v11.yaml +++ /dev/null @@ -1,149 +0,0 @@ - -common: - input_dir: /eos/cms/store/cmst3/group/l1tr/cerminar/hgcal/CMSSW1015/ - output_dir: - default: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - Matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v53a - run_clustering: False - run_density_computation: False - - -collections: - test_ele: - samples: - - test_ele_flat2to100_PU0 - - test_ele_flat2to100_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - - ttower_plotters - - ttower_genmatched_plotters - - single_empart_guns: - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - - ttower_plotters - - ttower_genmatched_plotters - - - single_part_guns: - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - - ttower_plotters - - ttower_genmatched_plotters - - nugun_rate: - samples: - - nugun_alleta_pu200 - plotters: - - rate_plotters - - ttower_plotters - - tp_egm_plotters - - eg_rate_plotters - - noise_samples: - samples: - - nugun_alleta_pu0 - - nugun_alleta_pu200 - - nugun_endcap_PU50 - - nugun_endcap_PU100 - - nugun_endcap_PU140 - - nugun_endcap_PU200 - plotters: - - rate_plotters - - ttower_plotters - - tp_egm_plotters - - eg_rate_plotters - -plotters: - rate_plotters: !!python/name:python.plotters.rate_plotters - tp_egm_plotters: !!python/name:python.plotters.tp_plotters - tp_genmatched_plotters: !!python/name:python.plotters.tp_genmatched_plotters - genpart_plotters: !!python/name:python.plotters.genpart_plotters - ttower_plotters: !!python/name:python.plotters.ttower_plotters - ttower_genmatched_plotters: !!python/name:python.plotters.ttower_genmatched_plotters - eg_rate_plotters: !!python/name:python.plotters.eg_rate_plotters - # tp_set: !null, - # tp_selection: !!python/name:python.selections.tp_match_selections} -# gen_selection: gen_part_selections -# - plotter: TPPlotter -# tp_selection: tp_eta_selections -# gen_selection: gen_part_selections - - -#test: !!python/name:python.selections.gen_part_selections -samples: - test_ele_flat2to100_PU0: - input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU0_v11/180814_140939/0000/ - events_per_job: 500 - - test_ele_flat2to100_PU200: - input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU200_v11/180814_141012/0000/ - events_per_job : 200 - - ele_flat2to100_PU0: - input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU0_v11/180814_140939/0000/ - events_per_job : 500 - - ele_flat2to100_PU200: - input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU200_v11/180814_141012/0000/ - events_per_job : 200 - - photon_flat8to150_PU0: - input_sample_dir: SinglePhoton_FlatPt-8to150/SinglePhoton_FlatPt-8to150_PU0_v12/181018_145447/0000/ - events_per_job : 500 - - photon_flat8to150_PU200: - input_sample_dir: SinglePhoton_FlatPt-8to150/SinglePhoton_FlatPt-8to150_PU200_v12/181018_145549/0000/ - events_per_job : 200 - - pion_flat2to100_PU0: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU0_v12/181018_145226/0000/ - events_per_job : 500 - - pion_flat2to100_PU200: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU200_v12/181018_145337/0000/ - events_per_job : 200 - - nugun_alleta_pu0: - input_sample_dir: SingleNeutrino/NuGunAllEta_PU0_v12/181018_145649/0000/ - events_per_job: 500 - - nugun_alleta_pu200: - input_sample_dir: SingleNeutrino/NuGunAllEta_PU200_v12/181018_145755/0000/ - events_per_job: 200 - - nugun_endcap_PU50: - input_sample_dir: NuGun_PU50/NTP/v12/ - events_per_job: 500 - - nugun_endcap_PU100: - input_sample_dir: NuGun_PU100/NTP/v12/ - events_per_job: 500 - - nugun_endcap_PU140: - input_sample_dir: NuGun_PU140/NTP/v12/ - events_per_job: 500 - - nugun_endcap_PU200: - input_sample_dir: NuGun_PU200/NTP/v12/ - events_per_job: 200 diff --git a/selection_v9geom.yaml b/selection_v9geom.yaml deleted file mode 100644 index 091cfa3e..00000000 --- a/selection_v9geom.yaml +++ /dev/null @@ -1,230 +0,0 @@ - -common: - input_dir: /eos/cms/store/cmst3/group/l1tr/cerminar/hgcal/CMSSW1050p1/ - output_dir: - default: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - Matterhorn: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ - output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v97 - run_clustering: False - run_density_computation: False - - -collections: - nugun_tracks: - file_label: - tracks - samples: - - nugun_alleta_pu200 - plotters: - - track_plotters - - tkeg_plotters - - eg_rate_plotters - htc_jobflavor: - workday - - single_empart_guns_tracks: - file_label: - tracks - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - plotters: - - track_plotters - - track_genmatched_plotters - - tkeg_plotters - - eg_genmatched_plotters - htc_jobflavor: - workday - - single_part_tt: - file_label: - tt - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - pion_flat2to100_PU0 - - pion_flat2to100_PU200 - plotters: - # - tp_egm_plotters - # - tp_genmatched_plotters - # - genpart_plotters - - ttower_plotters - - ttower_genmatched_plotters - htc_jobflavor: - workday - - - - single_empart_guns_egvalid: - file_label: - eg - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - - eg_plotters - - eg_genmatched_plotters - htc_jobflavor: - workday - - - single_empart_tpdebug: - file_label: - tpdebug - samples: - - all_flat5to80_PU0 - - all_flat5to80_PU200 - plotters: - - tp_genmatched_debug - htc_jobflavor: - workday - - - single_empart_guns_calibs: - file_label: - calibs - samples: - - ele_flat2to100_PU0 - # - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - # - photon_flat8to150_PU200 - plotters: - - tp_calib_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - workday - - single_empart_guns_tps: - file_label: - tps - samples: - - ele_flat2to100_PU0 - - ele_flat2to100_PU200 - - photon_flat8to150_PU0 - - photon_flat8to150_PU200 - plotters: - - tp_egm_plotters - - tp_genmatched_plotters - - genpart_plotters - # - ttower_plotters - # - ttower_genmatched_plotters - htc_jobflavor: - tomorrow - - nugun_rate: - file_label: - rate - samples: - - nugun_alleta_pu200 - plotters: - - rate_plotters - # - ttower_plotters - - tp_egm_plotters - - eg_rate_plotters - htc_jobflavor: - tomorrow - - noise_samples: - file_label: - noise - samples: - - nugun_alleta_pu0 - - nugun_alleta_pu200 - # - nugun_endcap_PU50 - # - nugun_endcap_PU100 - # - nugun_endcap_PU140 - # - nugun_endcap_PU200 - plotters: - # - rate_plotters - - ttower_plotters - # - tp_egm_plotters - # - eg_rate_plotters - htc_jobflavor: - workday - -plotters: - rate_plotters: !!python/name:python.plotters.rate_plotters - tp_egm_plotters: !!python/name:python.plotters.tp_plotters - tp_genmatched_debug: !!python/name:python.plotters.tp_genmatched_debug - tp_genmatched_plotters: !!python/name:python.plotters.tp_genmatched_plotters - genpart_plotters: !!python/name:python.plotters.genpart_plotters - ttower_plotters: !!python/name:python.plotters.ttower_plotters - ttower_genmatched_plotters: !!python/name:python.plotters.ttower_genmatched_plotters - eg_plotters: !!python/name:python.plotters.eg_plotters - eg_genmatched_plotters: !!python/name:python.plotters.eg_genmatched_plotters - eg_rate_plotters: !!python/name:python.plotters.eg_rate_plotters - track_plotters: !!python/name:python.plotters.track_plotters - track_genmatched_plotters: !!python/name:python.plotters.track_genmatched_plotters - tkeg_plotters: !!python/name:python.plotters.tkeg_plotters - tp_calib_plotters: !!python/name:python.plotters.tp_calib_plotters - # tp_set: !null, - # tp_selection: !!python/name:python.selections.tp_match_selections} -# gen_selection: gen_part_selections -# - plotter: TPPlotter -# tp_selection: tp_eta_selections -# gen_selection: gen_part_selections - -#test: !!python/name:python.selections.gen_part_selections -samples: - all_flat5to80_PU0: - input_sample_dir: CMSSW1050p1/PartGun_FlatPt-5to80_PU0/NTP/v20/ - events_per_job : 500 - - all_flat5to80_PU200: - input_sample_dir: CMSSW1050p1/PartGun_FlatPt-5to80_PU200/NTP/v20/ - events_per_job : 200 - - ele_flat2to100_PU0: - input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU0_v25/190619_130938/0000/ - events_per_job : 500 - # gen_selections: !!python/name:python.selections.genpart_photon_selections - - ele_flat2to100_PU200: - input_sample_dir: SingleE_FlatPt-2to100/SingleE_FlatPt-2to100_PU200_v26/190620_132813/0000/ - events_per_job : 200 - - photon_flat8to150_PU0: - input_sample_dir: SinglePhoton_FlatPt-8to150/SinglePhoton_FlatPt-8to150_PU0_v25/190619_131521/0000/ - events_per_job : 500 - - photon_flat8to150_PU200: - input_sample_dir: SinglePhoton_FlatPt-8to150/SinglePhoton_FlatPt-8to150_PU200_v26/190620_133645/0000/ - events_per_job : 200 - - pion_flat2to100_PU0: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU0_v13/181116_090611/0000/ - events_per_job : 500 - - pion_flat2to100_PU200: - input_sample_dir: SinglePion_FlatPt-2to100/SinglePion_FlatPt-2to100_PU200_v13/181126_123358/0000/ - events_per_job : 200 - - nugun_alleta_pu0: - input_sample_dir: SingleNeutrino/NuGunAllEta_PU0_v14/190123_172948/0000/ - events_per_job: 500 - - nugun_alleta_pu200: - input_sample_dir: NeutrinoGun_E_10GeV/NuGunAllEta_PU200_v25/190619_132046/0000/ - events_per_job: 200 - - nugun_endcap_PU50: - input_sample_dir: NuGun_PU50/NTP/v13/ - events_per_job: 500 - - nugun_endcap_PU100: - input_sample_dir: NuGun_PU100/NTP/v13/ - events_per_job: 500 - - nugun_endcap_PU140: - input_sample_dir: NuGun_PU140/NTP/v13/ - events_per_job: 500 - - nugun_endcap_PU200: - input_sample_dir: NuGun_PU200/NTP/v13/ - events_per_job: 200 From 6df72e9ae2a56b436614d03f658f41d75865851e Mon Sep 17 00:00:00 2001 From: Gianluca Date: Fri, 22 Sep 2023 16:49:01 +0200 Subject: [PATCH 16/18] Rename main script --- analyzeHgcalL1Tntuple.py => analyzeNtuples.py | 0 templates/run_batch.sh | 2 +- templates/run_local.sh | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename analyzeHgcalL1Tntuple.py => analyzeNtuples.py (100%) diff --git a/analyzeHgcalL1Tntuple.py b/analyzeNtuples.py similarity index 100% rename from analyzeHgcalL1Tntuple.py rename to analyzeNtuples.py diff --git a/templates/run_batch.sh b/templates/run_batch.sh index f28c5640..6d5a897d 100644 --- a/templates/run_batch.sh +++ b/templates/run_batch.sh @@ -18,4 +18,4 @@ source ./setVirtualEnvWrapper.sh workon TEMPL_VIRTUALENV # cd ${BATCH_DIR} date -python analyzeHgcalL1Tntuple.py -f TEMPL_CFG -i TEMPL_INPUT -c TEMPL_COLL -s TEMPL_SAMPLE -n -1 -o ${BATCH_DIR} -r ${PROCID} -b +python analyzeNtuples.py -f TEMPL_CFG -i TEMPL_INPUT -c TEMPL_COLL -s TEMPL_SAMPLE -n -1 -o ${BATCH_DIR} -r ${PROCID} -b diff --git a/templates/run_local.sh b/templates/run_local.sh index 654d7629..ce691dc3 100644 --- a/templates/run_local.sh +++ b/templates/run_local.sh @@ -24,4 +24,4 @@ source ./setVirtualEnvWrapper.sh workon TEMPL_VIRTUALENV # cd ${BATCH_DIR} date -python analyzeHgcalL1Tntuple.py -f TEMPL_CFG -i TEMPL_INPUT -c TEMPL_COLL -s TEMPL_SAMPLE -n -1 -o ${BATCH_DIR} -r ${PROCID} -b +python analyzeNtuples.py -f TEMPL_CFG -i TEMPL_INPUT -c TEMPL_COLL -s TEMPL_SAMPLE -n -1 -o ${BATCH_DIR} -r ${PROCID} -b From 73551474f8c98e4dabf1b1c3ccf8ca8205b07a35 Mon Sep 17 00:00:00 2001 From: Gianluca Date: Mon, 25 Sep 2023 11:53:27 +0200 Subject: [PATCH 17/18] Move GEN seelction for added flexibility --- cfg/decodedtk.py | 6 +++++- cfg/decodedtk.yaml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cfg/decodedtk.py b/cfg/decodedtk.py index 25ebce15..3b1af005 100644 --- a/cfg/decodedtk.py +++ b/cfg/decodedtk.py @@ -6,6 +6,7 @@ dectk_selections = (selections.Selector('^Eta[AB]*[BC]$|all')*('^Pt[1,2,5][0]$|all'))() dectk_match_selections = (selections.Selector('^Pt5$|^Pt[1,2,5][0]$|all'))() track_selections = (selections.Selector('^TkCTL1|all')&('^Pt5$|^Pt[1,2,5][0]$|all'))() +gen_tk_selections = (selections.Selector('GEN$')*('Eta[AB]*C$|EtaF$|all')+selections.Selector('GEN$')*('Pt15|Pt30'))() decTk_plotters = [ plotters.DecTkPlotter( @@ -29,6 +30,9 @@ collections.tracks, collections.sim_parts, track_selections, - selections.gen_ee_tk_selections + gen_tk_selections ) ] + +# for sel in gen_tk_selections: +# print (sel) \ No newline at end of file diff --git a/cfg/decodedtk.yaml b/cfg/decodedtk.yaml index 90514115..5a57464a 100644 --- a/cfg/decodedtk.yaml +++ b/cfg/decodedtk.yaml @@ -7,7 +7,7 @@ common: triolet: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ output_dir_local: /Users/cerminar/cernbox/hgcal/CMSSW1015/plots/ output_dir_lx: /eos/user/c/cerminar/hgcal/CMSSW1015/plots/ - plot_version: v160A + plot_version: v160B run_clustering: False run_density_computation: False # +AccountingGroup = "group_u_CMS.u_zh.users" From cc2d595ae9b427b83c22d6fd8c0c8492a089d2ba Mon Sep 17 00:00:00 2001 From: Gianluca Date: Mon, 25 Sep 2023 15:50:45 +0200 Subject: [PATCH 18/18] Update the instructions and doc --- README.md | 46 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8bd6f914..ad3acc27 100755 --- a/README.md +++ b/README.md @@ -1,9 +1,14 @@ # ntuple-tools -The python scripts in this repository should help you get started analysing the [HGCAL L1 TP ntuples](https://github.com/PFCal-dev/cmssw/tree/hgc-tpg-devel-CMSSW_10_3_0_pre4/L1Trigger/L1THGCal/plugins/ntuples) +PYTHON framework for the analysis of [ROOT](https://root.cern/) `TTree` data using [uproot](https://uproot.readthedocs.io/en/latest/) for the IO and [awkward-array](https://awkward-array.org/doc/main/) for the columnar data analysis. + +The tool is originally developed for the analysis of [L1T ntuples for Phase-2 e/g](https://github.com/cerminar/Phase2EGTriggerAnalysis) but should work with any kind of flat ntuples. ## Pre-requisites: first time setup +The tool can be run on any private machines using just `python`, `pip` and `virtualenvwrapper`. +If you plan to run it on lxplus you might want to look at the point `1` below. + ### 1. lxplus setup This step is `lxplus` specific, givin access to a more recent `python` and `root` version. @@ -39,7 +44,7 @@ The **first time** you will have to create the actual instance of the `virtualen and -[requirements_py3.8.txt](requirements_py3.10.txt) +[requirements_py3.10.txt](requirements_py3.10.txt) for python 3.8 and 3.10 respectively. @@ -57,7 +62,6 @@ Edit/skip it accordingly for your specific system. `source setup_lxplus.sh` - ### 2. setup `virtualenvwrapper` For starting using virtualenvwrapper @@ -75,16 +79,22 @@ After this initial (once in a time) setup is done you can just activate the virt ## Running the analysis -The main script is `analyzeHgcalL1Tntuple.py`: +The main script is `analyzeNtuples.py`: -`python analyzeHgcalL1Tntuple.py --help` +`python analyzeNtuples.py --help` An example of how to run it: -`python analyzeHgcalL1Tntuple.py -f cfg/hgctps.yaml -i cfg/datasets/ntp_v81.yaml -c tps -s doubleele_flat1to100_PU200 -n 1000 -d 0` +`python analyzeNtuples.py -f cfg/hgctps.yaml -i cfg/datasets/ntp_v81.yaml -c tps -s doubleele_flat1to100_PU200 -n 1000 -d 0` + +## General idea + +Data are read in `collections` of objects corresponding to an `array` and are processed by `plotters` which creates set of histograms for different `selections` of the data `collections`. + ### Configuration file The configuration is handled by 2 yaml files. + One specifying - output directories - versioning of the plots @@ -94,12 +104,13 @@ The other prividing - details of the input samples (location of the ntuple files) Example of configuration file can be found in: - - [cfg/default.yaml](cfg/default.yaml) - - [cfg/datasets/ntp_v66.yaml](cfg/datasets/ntp_v66.yaml) + - [cfg/egplots.yaml](cfg/egplots.yaml) + - [cfg/datasets/ntp_v92.yaml](cfg/datasets/ntp_v92.yaml) ### Reading ntuple branches or creating derived ones -The list of branches to be read and converted in pandas `DataFrame` format is specified in the module + +The list of branches to be read and converted to `Awkward Arrays` format is specified in the module [collections](python/collections.py) @@ -111,7 +122,7 @@ Selections are defined as strings in the module: [selections](python/selections.py) Different collections are defined for different objects and/or different purposes. The selections have a `name` whcih is used for the histogram naming (see below). Selections are used by the plotters. - +Selections can be combined and retrieved via regular expressions in the configuration of the plotters. ### Adding a new plotter The actual functionality of accessing the objects, filtering them according to the `selections` and filling `histograms` is provided by the plotter classes defined in the module: @@ -137,9 +148,22 @@ The histogram naming follows the convention: This is assumed in all the `plotters` and in the code to actually draw the histograms. +## Histogram drawing + +Of course you can use your favorite set of tools. I use mine [plot-drawing-tools](https://github.com/cerminar/plot-drawing-tools), which is based on `jupyter notebooks`. + +`cd ntuple-tools` +`git clone git@github.com:cerminar/plot-drawing-tools.git` +`jupyter-notebook` + +## HELP + +I can't figure out how to do some manipulation using the `awkward array` or `uproot`....you can take a look at examples and play witht the arrays in: +[plot-drawing-tools/blob/master/eventloop-uproot-ak.ipynb](https://github.com/cerminar/plot-drawing-tools/blob/master/eventloop-uproot-ak.ipynb) + ## Submitting to the batch system -Note that the script `analyzeHgcalL1Tntuple.py` can be used to submit the jobs to the HTCondor batch system invoking the `-b` option. A dag configuration is created and you can actually submit it following the script output. +Note that the script `analyzeNtuples.py` can be used to submit the jobs to the HTCondor batch system invoking the `-b` option. A dag configuration is created and you can actually submit it following the script output. ### Note about hadd job. For each sample injected in the batch system a DAG is created. The DAG will submitt an `hadd` command once all the jobs will succeed.