From 10c0b32b1f9e46692b6e19c6f577f8ba10543f32 Mon Sep 17 00:00:00 2001 From: Juliette Alimena Date: Wed, 19 Oct 2022 16:07:31 +0200 Subject: [PATCH 01/35] add example to run analysis_stage1 over privately-produced LL HNL signals --- .../bsm/LLPs/DisplacedHNL/analysis_stage1.py | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_stage1.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_stage1.py index d3a49f9d1e..42591b13ab 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_stage1.py +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_stage1.py @@ -1,25 +1,41 @@ #Mandatory: List of processes processList = { + + #centrally-produced backgrounds 'p8_ee_Zee_ecm91':{'chunks':100}, 'p8_ee_Zbb_ecm91':{'chunks':100}, 'p8_ee_Ztautau_ecm91':{'chunks':100}, 'p8_ee_Zuds_ecm91':{'chunks':100}, 'p8_ee_Zcc_ecm91':{'chunks':100}, + #privately-produced signals + #'eenu_30GeV_1p41e-6Ve':{}, + #'eenu_50GeV_1p41e-6Ve':{}, + #'eenu_70GeV_1p41e-6Ve':{}, + #'eenu_90GeV_1p41e-6Ve':{}, + #test - #'p8_ee_Zuds_ecm91':{'fraction':0.000001}, + #'p8_ee_Zee_ecm91':{'fraction':0.000001}, #'p8_ee_Zuds_ecm91':{'chunks':10,'fraction':0.000001}, } -#Mandatory: Production tag when running over EDM4Hep centrally produced events, this points to the yaml files for getting sample statistics +#Production tag. This points to the yaml files for getting sample statistics +#Mandatory when running over EDM4Hep centrally produced events +#Comment out when running over privately produced events prodTag = "FCCee/spring2021/IDEA/" +#Input directory +#Comment out when running over centrally produced events +#Mandatory when running over privately produced events +#inputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/HNL_eenu_MadgraphPythiaDelphes" + + #Optional: output directory, default is local dir -outputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/" +outputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/output_stage1/" #outputDir = "/eos/user/j/jalimena/FCCeeLLP/" #outputDir = "output_stage1/" -outputDirEos = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/" +outputDirEos = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/output_stage1/" #outputDirEos = "/eos/user/j/jalimena/FCCeeLLP/" #eosType = "eosuser" From 6a0affcedb1063e829b5ea5b5bbf93098511cec2 Mon Sep 17 00:00:00 2001 From: Juliette Alimena Date: Wed, 19 Oct 2022 17:23:56 +0200 Subject: [PATCH 02/35] add example to run analysis_final over privately-produced LL HNL signals --- .../FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py index 5aa46d97de..07f14cfba4 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py @@ -1,5 +1,5 @@ #Input directory where the files produced at the stage1 level are -inputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/" +inputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/output_stage1" #inputDir = "/eos/user/j/jalimena/FCCeeLLP/" #inputDir = "output_stage1/" @@ -8,11 +8,19 @@ processList = { #run over the full statistics from stage1 + + #backgrounds 'p8_ee_Zee_ecm91':{}, 'p8_ee_Ztautau_ecm91':{}, 'p8_ee_Zbb_ecm91':{}, 'p8_ee_Zcc_ecm91':{}, 'p8_ee_Zuds_ecm91':{}, + + #signals + 'eenu_30GeV_1p41e-6Ve':{}, + 'eenu_50GeV_1p41e-6Ve':{}, + 'eenu_70GeV_1p41e-6Ve':{}, + 'eenu_90GeV_1p41e-6Ve':{}, } #Link to the dictonary that contains all the cross section information etc... @@ -21,6 +29,10 @@ #Add MySample_p8_ee_ZH_ecm240 as it is not an offical process procDictAdd={ #"MySample_p8_ee_ZH_ecm240":{"numberOfEvents": 10000000, "sumOfWeights": 10000000, "crossSection": 0.201868, "kfactor": 1.0, "matchingEfficiency": 1.0} + "eenu_30GeV_1p41e-6Ve": {"numberOfEvents": 50000, "sumOfWeights": 50000, "crossSection": 6.638e-10, "kfactor": 1.0, "matchingEfficiency": 1.0}, + "eenu_50GeV_1p41e-6Ve": {"numberOfEvents": 50000, "sumOfWeights": 50000, "crossSection": 4.535e-10, "kfactor": 1.0, "matchingEfficiency": 1.0}, + "eenu_70GeV_1p41e-6Ve": {"numberOfEvents": 50000, "sumOfWeights": 50000, "crossSection": 1.968e-10, "kfactor": 1.0, "matchingEfficiency": 1.0}, + "eenu_90GeV_1p41e-6Ve": {"numberOfEvents": 50000, "sumOfWeights": 50000, "crossSection": 1.749e-12, "kfactor": 1.0, "matchingEfficiency": 1.0}, } #Number of CPUs to use From fa2e3ba5be1a0a3d205afa31d5fdb9ed3b437231 Mon Sep 17 00:00:00 2001 From: Juliette Alimena Date: Wed, 19 Oct 2022 16:07:31 +0200 Subject: [PATCH 03/35] add example to run analysis_stage1 over privately-produced LL HNL signals --- .../bsm/LLPs/DisplacedHNL/analysis_stage1.py | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_stage1.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_stage1.py index d3a49f9d1e..42591b13ab 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_stage1.py +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_stage1.py @@ -1,25 +1,41 @@ #Mandatory: List of processes processList = { + + #centrally-produced backgrounds 'p8_ee_Zee_ecm91':{'chunks':100}, 'p8_ee_Zbb_ecm91':{'chunks':100}, 'p8_ee_Ztautau_ecm91':{'chunks':100}, 'p8_ee_Zuds_ecm91':{'chunks':100}, 'p8_ee_Zcc_ecm91':{'chunks':100}, + #privately-produced signals + #'eenu_30GeV_1p41e-6Ve':{}, + #'eenu_50GeV_1p41e-6Ve':{}, + #'eenu_70GeV_1p41e-6Ve':{}, + #'eenu_90GeV_1p41e-6Ve':{}, + #test - #'p8_ee_Zuds_ecm91':{'fraction':0.000001}, + #'p8_ee_Zee_ecm91':{'fraction':0.000001}, #'p8_ee_Zuds_ecm91':{'chunks':10,'fraction':0.000001}, } -#Mandatory: Production tag when running over EDM4Hep centrally produced events, this points to the yaml files for getting sample statistics +#Production tag. This points to the yaml files for getting sample statistics +#Mandatory when running over EDM4Hep centrally produced events +#Comment out when running over privately produced events prodTag = "FCCee/spring2021/IDEA/" +#Input directory +#Comment out when running over centrally produced events +#Mandatory when running over privately produced events +#inputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/HNL_eenu_MadgraphPythiaDelphes" + + #Optional: output directory, default is local dir -outputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/" +outputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/output_stage1/" #outputDir = "/eos/user/j/jalimena/FCCeeLLP/" #outputDir = "output_stage1/" -outputDirEos = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/" +outputDirEos = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/output_stage1/" #outputDirEos = "/eos/user/j/jalimena/FCCeeLLP/" #eosType = "eosuser" From b8db6a0f9849daf78f6fdb6149435e12b92b95ce Mon Sep 17 00:00:00 2001 From: Juliette Alimena Date: Wed, 19 Oct 2022 17:23:56 +0200 Subject: [PATCH 04/35] add example to run analysis_final over privately-produced LL HNL signals --- .../FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py index 0b11d73245..8ed767b8e6 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py @@ -1,5 +1,5 @@ #Input directory where the files produced at the stage1 level are -inputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/" +inputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/output_stage1" #inputDir = "/eos/user/j/jalimena/FCCeeLLP/" #inputDir = "output_stage1/" @@ -17,11 +17,19 @@ processList = { #run over the full statistics from stage1 + + #backgrounds 'p8_ee_Zee_ecm91':{}, 'p8_ee_Ztautau_ecm91':{}, 'p8_ee_Zbb_ecm91':{}, 'p8_ee_Zcc_ecm91':{}, 'p8_ee_Zuds_ecm91':{}, + + #signals + 'eenu_30GeV_1p41e-6Ve':{}, + 'eenu_50GeV_1p41e-6Ve':{}, + 'eenu_70GeV_1p41e-6Ve':{}, + 'eenu_90GeV_1p41e-6Ve':{}, } #Link to the dictonary that contains all the cross section information etc... @@ -30,6 +38,10 @@ #Add MySample_p8_ee_ZH_ecm240 as it is not an offical process procDictAdd={ #"MySample_p8_ee_ZH_ecm240":{"numberOfEvents": 10000000, "sumOfWeights": 10000000, "crossSection": 0.201868, "kfactor": 1.0, "matchingEfficiency": 1.0} + "eenu_30GeV_1p41e-6Ve": {"numberOfEvents": 50000, "sumOfWeights": 50000, "crossSection": 6.638e-10, "kfactor": 1.0, "matchingEfficiency": 1.0}, + "eenu_50GeV_1p41e-6Ve": {"numberOfEvents": 50000, "sumOfWeights": 50000, "crossSection": 4.535e-10, "kfactor": 1.0, "matchingEfficiency": 1.0}, + "eenu_70GeV_1p41e-6Ve": {"numberOfEvents": 50000, "sumOfWeights": 50000, "crossSection": 1.968e-10, "kfactor": 1.0, "matchingEfficiency": 1.0}, + "eenu_90GeV_1p41e-6Ve": {"numberOfEvents": 50000, "sumOfWeights": 50000, "crossSection": 1.749e-12, "kfactor": 1.0, "matchingEfficiency": 1.0}, } #Number of CPUs to use From 00da5ca32e4f9413bc82e770a102b10738562da3 Mon Sep 17 00:00:00 2001 From: Juliette Alimena Date: Wed, 19 Oct 2022 16:07:31 +0200 Subject: [PATCH 05/35] add example to run analysis_stage1 over privately-produced LL HNL signals --- .../bsm/LLPs/DisplacedHNL/analysis_stage1.py | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_stage1.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_stage1.py index d3a49f9d1e..42591b13ab 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_stage1.py +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_stage1.py @@ -1,25 +1,41 @@ #Mandatory: List of processes processList = { + + #centrally-produced backgrounds 'p8_ee_Zee_ecm91':{'chunks':100}, 'p8_ee_Zbb_ecm91':{'chunks':100}, 'p8_ee_Ztautau_ecm91':{'chunks':100}, 'p8_ee_Zuds_ecm91':{'chunks':100}, 'p8_ee_Zcc_ecm91':{'chunks':100}, + #privately-produced signals + #'eenu_30GeV_1p41e-6Ve':{}, + #'eenu_50GeV_1p41e-6Ve':{}, + #'eenu_70GeV_1p41e-6Ve':{}, + #'eenu_90GeV_1p41e-6Ve':{}, + #test - #'p8_ee_Zuds_ecm91':{'fraction':0.000001}, + #'p8_ee_Zee_ecm91':{'fraction':0.000001}, #'p8_ee_Zuds_ecm91':{'chunks':10,'fraction':0.000001}, } -#Mandatory: Production tag when running over EDM4Hep centrally produced events, this points to the yaml files for getting sample statistics +#Production tag. This points to the yaml files for getting sample statistics +#Mandatory when running over EDM4Hep centrally produced events +#Comment out when running over privately produced events prodTag = "FCCee/spring2021/IDEA/" +#Input directory +#Comment out when running over centrally produced events +#Mandatory when running over privately produced events +#inputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/HNL_eenu_MadgraphPythiaDelphes" + + #Optional: output directory, default is local dir -outputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/" +outputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/output_stage1/" #outputDir = "/eos/user/j/jalimena/FCCeeLLP/" #outputDir = "output_stage1/" -outputDirEos = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/" +outputDirEos = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/output_stage1/" #outputDirEos = "/eos/user/j/jalimena/FCCeeLLP/" #eosType = "eosuser" From b84ab7a7cc1e9df99bb7c422965c941ac070b083 Mon Sep 17 00:00:00 2001 From: Juliette Alimena Date: Wed, 19 Oct 2022 17:23:56 +0200 Subject: [PATCH 06/35] add example to run analysis_final over privately-produced LL HNL signals --- .../FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py index 0b11d73245..8ed767b8e6 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py @@ -1,5 +1,5 @@ #Input directory where the files produced at the stage1 level are -inputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/" +inputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/output_stage1" #inputDir = "/eos/user/j/jalimena/FCCeeLLP/" #inputDir = "output_stage1/" @@ -17,11 +17,19 @@ processList = { #run over the full statistics from stage1 + + #backgrounds 'p8_ee_Zee_ecm91':{}, 'p8_ee_Ztautau_ecm91':{}, 'p8_ee_Zbb_ecm91':{}, 'p8_ee_Zcc_ecm91':{}, 'p8_ee_Zuds_ecm91':{}, + + #signals + 'eenu_30GeV_1p41e-6Ve':{}, + 'eenu_50GeV_1p41e-6Ve':{}, + 'eenu_70GeV_1p41e-6Ve':{}, + 'eenu_90GeV_1p41e-6Ve':{}, } #Link to the dictonary that contains all the cross section information etc... @@ -30,6 +38,10 @@ #Add MySample_p8_ee_ZH_ecm240 as it is not an offical process procDictAdd={ #"MySample_p8_ee_ZH_ecm240":{"numberOfEvents": 10000000, "sumOfWeights": 10000000, "crossSection": 0.201868, "kfactor": 1.0, "matchingEfficiency": 1.0} + "eenu_30GeV_1p41e-6Ve": {"numberOfEvents": 50000, "sumOfWeights": 50000, "crossSection": 6.638e-10, "kfactor": 1.0, "matchingEfficiency": 1.0}, + "eenu_50GeV_1p41e-6Ve": {"numberOfEvents": 50000, "sumOfWeights": 50000, "crossSection": 4.535e-10, "kfactor": 1.0, "matchingEfficiency": 1.0}, + "eenu_70GeV_1p41e-6Ve": {"numberOfEvents": 50000, "sumOfWeights": 50000, "crossSection": 1.968e-10, "kfactor": 1.0, "matchingEfficiency": 1.0}, + "eenu_90GeV_1p41e-6Ve": {"numberOfEvents": 50000, "sumOfWeights": 50000, "crossSection": 1.749e-12, "kfactor": 1.0, "matchingEfficiency": 1.0}, } #Number of CPUs to use From 0d663244009c05d0007ff77afea4069e13bff41d Mon Sep 17 00:00:00 2001 From: Juliette Alimena Date: Fri, 21 Oct 2022 17:29:41 +0200 Subject: [PATCH 07/35] add processLabels option for runFinal --- config/FCCAnalysisRun.py | 16 ++++++++++++++-- .../bsm/LLPs/DisplacedHNL/analysis_final.py | 16 ++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/config/FCCAnalysisRun.py b/config/FCCAnalysisRun.py index a7e89faf41..7b86536a5b 100644 --- a/config/FCCAnalysisRun.py +++ b/config/FCCAnalysisRun.py @@ -147,6 +147,12 @@ def getElement(rdfModule, element, isFinal=False): return {} else: print('The option <{}> is not available in presel analysis'.format(element)) + elif element=='processLabels': + if isFinal: + print('The variable <{}> is optional in your analysis_final.py file return empty dictionary'.format(element)) + return {} + else: print('The option <{}> is not available in presel analysis'.format(element)) + elif element=='geometryFile': print('The variable <{}> is optional in your analysys.py file, return default value empty string'.format(element)) if isFinal: print('The option <{}> is not available in final analysis'.format(element)) @@ -765,6 +771,7 @@ def runFinal(rdfModule): cutList = getElement(rdfModule,"cutList", True) length_cuts_names = max([len(cut) for cut in cutList]) cutLabels = getElement(rdfModule,"cutLabels", True) + processLabels = getElement(rdfModule,"processLabels", True) # save a table in a separate tex file saveTabular = getElement(rdfModule,"saveTabular", True) @@ -851,9 +858,14 @@ def runFinal(rdfModule): tdf_list = [] count_list = [] cuts_list = [] - cuts_list.append(pr) eff_list=[] - eff_list.append(pr) + + if processLabels: + cuts_list.append(processLabels[pr]) + eff_list.append(processLabels[pr]) + else: + cuts_list.append(pr) + eff_list.append(pr) # Define all histos, snapshots, etc... print ('----> Defining snapshots and histograms') diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py index 8ed767b8e6..1b9f08c174 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py @@ -32,6 +32,22 @@ 'eenu_90GeV_1p41e-6Ve':{}, } +###Dictionary for prettier names of processes (optional) +processLabels = { + #backgrounds + 'p8_ee_Zee_ecm91':"Z $\rightarrow$ ee", + 'p8_ee_Ztautau_ecm91':"Z $\rightarrow \tau \tau$", + 'p8_ee_Zbb_ecm91':"Z $\rightarrow$ bb", + 'p8_ee_Zcc_ecm91':"Z $\rightarrow$ cc", + 'p8_ee_Zuds_ecm91':"Z $\rightarrow$ uds", + + #signals + 'eenu_30GeV_1p41e-6Ve': "$m_N =$ 30 GeV, $|V_{eN}| = 1.41 * 10^{-6}$", + 'eenu_50GeV_1p41e-6Ve': "$m_N =$ 50 GeV, $|V_{eN}| = 1.41 * 10^{-6}$", + 'eenu_70GeV_1p41e-6Ve': "$m_N =$ 70 GeV, $|V_{eN}| = 1.41 * 10^{-6}$", + 'eenu_90GeV_1p41e-6Ve': "$m_N =$ 90 GeV, $|V_{eN}| = 1.41 * 10^{-6}$", +} + #Link to the dictonary that contains all the cross section information etc... procDict = "FCCee_procDict_spring2021_IDEA.json" From 1245fd4490dae491597eba5610af39e651545e2d Mon Sep 17 00:00:00 2001 From: Juliette Alimena Date: Fri, 21 Oct 2022 18:13:27 +0200 Subject: [PATCH 08/35] minor updates for tutorial --- .../bsm/LLPs/DisplacedHNL/analysis_plots.py | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_plots.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_plots.py index 479d5d460a..b0dd01f911 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_plots.py +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_plots.py @@ -5,8 +5,8 @@ ###If scaleSig=0 or scaleBack=0, we don't apply any additional scaling, on top of the normalization to cross section and integrated luminosity, as defined in finalSel.py ###If scaleSig or scaleBack is not defined, plots will be normalized to 1 -scaleSig = 0. -scaleBack = 0. +#scaleSig = 0. +#scaleBack = 0. ana_tex = 'e^{+}e^{-} #rightarrow N #nu, N #rightarrow ee#nu' delphesVersion = '3.4.2' energy = 91 @@ -181,28 +181,28 @@ extralabel['sel2RecoEle_vetoes_MissingEnergyGt10_absD0Gt0p5'] = "2 electrons with |d_0|>0.5 mm; No muons, jets, or photons; Missing momentum > 10 GeV" colors = {} -# colors['HNL_eenu_30GeV_1p41e-6Ve'] = ROOT.kOrange+1 -# colors['HNL_eenu_50GeV_1p41e-6Ve'] = ROOT.kRed -# colors['HNL_eenu_70GeV_1p41e-6Ve'] = ROOT.kBlue -# colors['HNL_eenu_90GeV_1p41e-6Ve'] = ROOT.kGreen+1 - -colors['Zbb'] = ROOT.kAzure-4 -colors['Zcc'] = ROOT.kCyan-9 -colors['Zuds'] = ROOT.kViolet-4 +colors['eenu_30GeV_1p41e-6Ve'] = ROOT.kOrange+1 +colors['eenu_50GeV_1p41e-6Ve'] = ROOT.kRed +colors['eenu_70GeV_1p41e-6Ve'] = ROOT.kBlue +colors['eenu_90GeV_1p41e-6Ve'] = ROOT.kGreen+1 + +#colors['Zbb'] = ROOT.kAzure-4 +#colors['Zcc'] = ROOT.kCyan-9 +#colors['Zuds'] = ROOT.kViolet-4 colors['Ztautau'] = ROOT.kRed-3 colors['Zee'] = ROOT.kGray+2 plots = {} plots['HNL'] = {'signal':{ - # 'HNL_eenu_30GeV_1p41e-6Ve':['HNL_eenu_30GeV_1p41e-6Ve'], - # 'HNL_eenu_50GeV_1p41e-6Ve':['HNL_eenu_50GeV_1p41e-6Ve'], - # 'HNL_eenu_70GeV_1p41e-6Ve':['HNL_eenu_70GeV_1p41e-6Ve'], - # 'HNL_eenu_90GeV_1p41e-6Ve':['HNL_eenu_90GeV_1p41e-6Ve'], + 'eenu_30GeV_1p41e-6Ve':['eenu_30GeV_1p41e-6Ve'], + 'eenu_50GeV_1p41e-6Ve':['eenu_50GeV_1p41e-6Ve'], + 'eenu_70GeV_1p41e-6Ve':['eenu_70GeV_1p41e-6Ve'], + 'eenu_90GeV_1p41e-6Ve':['eenu_90GeV_1p41e-6Ve'], }, 'backgrounds':{ - 'Zbb':['p8_ee_Zbb_ecm91'], - 'Zcc': ['p8_ee_Zcc_ecm91'], - 'Zuds': ['p8_ee_Zuds_ecm91'], + #'Zbb':['p8_ee_Zbb_ecm91'], + #'Zcc': ['p8_ee_Zcc_ecm91'], + #'Zuds': ['p8_ee_Zuds_ecm91'], 'Ztautau': ['p8_ee_Ztautau_ecm91'], 'Zee':['p8_ee_Zee_ecm91'], } @@ -210,13 +210,13 @@ legend = {} -# legend['HNL_eenu_30GeV_1p41e-6Ve'] = 'm_{N} = 30 GeV, V_{e} = 1.41e-6' -# legend['HNL_eenu_50GeV_1p41e-6Ve'] = 'm_{N} = 50 GeV, V_{e} = 1.41e-6' -# legend['HNL_eenu_70GeV_1p41e-6Ve'] = 'm_{N} = 70 GeV, V_{e} = 1.41e-6' -# legend['HNL_eenu_90GeV_1p41e-6Ve'] = 'm_{N} = 90 GeV, V_{e} = 1.41e-6' - -legend['Zbb'] = 'e^{+}e^{-} #rightarrow Z #rightarrow bb' -legend['Zcc'] = 'e^{+}e^{-} #rightarrow Z #rightarrow cc' -legend['Zuds'] = 'e^{+}e^{-} #rightarrow Z #rightarrow uds' +legend['eenu_30GeV_1p41e-6Ve'] = 'm_{N} = 30 GeV, V_{e} = 1.41e-6' +legend['eenu_50GeV_1p41e-6Ve'] = 'm_{N} = 50 GeV, V_{e} = 1.41e-6' +legend['eenu_70GeV_1p41e-6Ve'] = 'm_{N} = 70 GeV, V_{e} = 1.41e-6' +legend['eenu_90GeV_1p41e-6Ve'] = 'm_{N} = 90 GeV, V_{e} = 1.41e-6' + +#legend['Zbb'] = 'e^{+}e^{-} #rightarrow Z #rightarrow bb' +#legend['Zcc'] = 'e^{+}e^{-} #rightarrow Z #rightarrow cc' +#legend['Zuds'] = 'e^{+}e^{-} #rightarrow Z #rightarrow uds' legend['Ztautau'] = 'e^{+}e^{-} #rightarrow Z #rightarrow #tau#tau' legend['Zee'] = 'e^{+}e^{-} #rightarrow Z #rightarrow ee' From 93792505ce18b5ee34b090ed36546d8c915d4589 Mon Sep 17 00:00:00 2001 From: Juliette Alimena Date: Tue, 25 Oct 2022 11:25:21 +0200 Subject: [PATCH 09/35] add ALP UFO model from Andrea Thamm --- .../bsm/LLPs/ALP_NLO_UFO/ALP_NLO_UFO.log | 88 +++ .../bsm/LLPs/ALP_NLO_UFO/CT_couplings.py | 11 + .../FCCee/bsm/LLPs/ALP_NLO_UFO/__init__.py | 50 ++ .../bsm/LLPs/ALP_NLO_UFO/coupling_orders.py | 20 + .../FCCee/bsm/LLPs/ALP_NLO_UFO/couplings.py | 303 +++++++++ examples/FCCee/bsm/LLPs/ALP_NLO_UFO/decays.py | 123 ++++ .../bsm/LLPs/ALP_NLO_UFO/function_library.py | 71 +++ .../FCCee/bsm/LLPs/ALP_NLO_UFO/lorentz.py | 110 ++++ .../bsm/LLPs/ALP_NLO_UFO/object_library.py | 373 +++++++++++ .../FCCee/bsm/LLPs/ALP_NLO_UFO/parameters.py | 559 +++++++++++++++++ .../FCCee/bsm/LLPs/ALP_NLO_UFO/particles.py | 401 ++++++++++++ .../FCCee/bsm/LLPs/ALP_NLO_UFO/propagators.py | 35 ++ .../FCCee/bsm/LLPs/ALP_NLO_UFO/vertices.py | 581 ++++++++++++++++++ .../bsm/LLPs/ALP_NLO_UFO/write_param_card.py | 180 ++++++ 14 files changed, 2905 insertions(+) create mode 100644 examples/FCCee/bsm/LLPs/ALP_NLO_UFO/ALP_NLO_UFO.log create mode 100644 examples/FCCee/bsm/LLPs/ALP_NLO_UFO/CT_couplings.py create mode 100644 examples/FCCee/bsm/LLPs/ALP_NLO_UFO/__init__.py create mode 100644 examples/FCCee/bsm/LLPs/ALP_NLO_UFO/coupling_orders.py create mode 100644 examples/FCCee/bsm/LLPs/ALP_NLO_UFO/couplings.py create mode 100644 examples/FCCee/bsm/LLPs/ALP_NLO_UFO/decays.py create mode 100644 examples/FCCee/bsm/LLPs/ALP_NLO_UFO/function_library.py create mode 100644 examples/FCCee/bsm/LLPs/ALP_NLO_UFO/lorentz.py create mode 100644 examples/FCCee/bsm/LLPs/ALP_NLO_UFO/object_library.py create mode 100644 examples/FCCee/bsm/LLPs/ALP_NLO_UFO/parameters.py create mode 100644 examples/FCCee/bsm/LLPs/ALP_NLO_UFO/particles.py create mode 100644 examples/FCCee/bsm/LLPs/ALP_NLO_UFO/propagators.py create mode 100644 examples/FCCee/bsm/LLPs/ALP_NLO_UFO/vertices.py create mode 100644 examples/FCCee/bsm/LLPs/ALP_NLO_UFO/write_param_card.py diff --git a/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/ALP_NLO_UFO.log b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/ALP_NLO_UFO.log new file mode 100644 index 0000000000..cc1867480b --- /dev/null +++ b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/ALP_NLO_UFO.log @@ -0,0 +1,88 @@ +# This file was automatically created by FeynRules 2.3.43 +# Mathematica version: 12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020) +# Date: Mon 19 Apr 2021 15:23:10 + + +# +# This is the logfile for the model ALP_NLO + +# Authors: M. Bauer, M. Neubert, S. Renner, M. Schnubel, A. Thamm +# Model version: 1 +# Checking the Quantum numbers + * Electric charge defined. +# Checking the Lagrangians + * All Lagrangians are ok. +# +# Particle definitions +# + + * No particles removed. All particles correspond to GenInt setup. + +# Automatically assigned PDG numbers + * Assigned PDG number 9000001 to particle ghA + * Assigned PDG number 9000002 to particle ghZ + * Assigned PDG number 9000003 to particle ghWp + * Assigned PDG number 9000004 to particle ghWm + * Assigned PDG number 9000005 to particle ALP + + +# Compulsory PDG codes: + * Class SM leptons complete. + * Class SM neutrinos complete. + * Class SM quarks complete. + * Class SM gauge bosons complete. +# +# Parameter definitions +# + + * All parameters are ok. + + +# Vertices + * Calling FeynmanRules for 1 Lagrangians. + * Number of classes vertices: 95 + * Number of flavored vertices: 95 + * Saved vertices in InterfaceRun[ 1 ]. + * Checked QNumber conservation. + - Quantum number GhostNumber conserved in all vertices. + - Quantum number LeptonNumber conserved in all vertices. + - Quantum number Q conserved in all vertices. + - Quantum number Y conserved in all vertices. + * particles.py written. + * parameters.py written. +# +# Vertex definitions +# + + * 95 vertices written. + * vertices.py written. +# +# Lorentz structure definitions +# + + * 24 lorentz structures written. + * lorentz.py written. +# +# Coupling definitions +# + + * 73 couplings written. + * couplings.py written. +# +# Coupling order definitions +# + + * 0 couplings orders written. + * coupling_orders.py written. +# +# Decay definitions +# + + * 13 decays written. + * decay.py not written +# +# CTCoupling definitions +# + + * 0 CTcouplings written. + * CT_couplings.py written. diff --git a/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/CT_couplings.py b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/CT_couplings.py new file mode 100644 index 0000000000..ffaff7cf98 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/CT_couplings.py @@ -0,0 +1,11 @@ +# This file was automatically created by FeynRules 2.3.43 +# Mathematica version: 12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020) +# Date: Mon 19 Apr 2021 15:23:43 + + +from object_library import all_couplings, Coupling + +from function_library import complexconjugate, re, im, csc, sec, acsc, asec, cot + + + diff --git a/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/__init__.py b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/__init__.py new file mode 100644 index 0000000000..d078b3291b --- /dev/null +++ b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/__init__.py @@ -0,0 +1,50 @@ + +import particles +import couplings +import lorentz +import parameters +import vertices +import coupling_orders +#import write_param_card +import propagators +import object_library +import function_library + + +all_particles = particles.all_particles +all_vertices = vertices.all_vertices +all_couplings = couplings.all_couplings +all_lorentz = lorentz.all_lorentz +all_parameters = parameters.all_parameters +all_orders = coupling_orders.all_orders +all_functions = function_library.all_functions +all_propagators = propagators.all_propagators + +try: + import decays +except ImportError: + pass +else: + all_decays = decays.all_decays + +try: + import form_factors +except ImportError: + pass +else: + all_form_factors = form_factors.all_form_factors + +try: + import CT_vertices +except ImportError: + pass +else: + all_CTvertices = CT_vertices.all_CTvertices + + +gauge = [0] + + +__author__ = "M. Bauer, M. Neubert, S. Renner, M. Schnubel, A. Thamm" +__date__ = "19/04/2021" +__version__= "1" diff --git a/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/coupling_orders.py b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/coupling_orders.py new file mode 100644 index 0000000000..16cbc72bfd --- /dev/null +++ b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/coupling_orders.py @@ -0,0 +1,20 @@ +# This file was automatically created by FeynRules 2.3.43 +# Mathematica version: 12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020) +# Date: Mon 19 Apr 2021 15:23:43 + + +from object_library import all_orders, CouplingOrder + + +NP = CouplingOrder(name = 'NP', + expansion_order = 99, + hierarchy = 2) + +QCD = CouplingOrder(name = 'QCD', + expansion_order = 99, + hierarchy = 1) + +QED = CouplingOrder(name = 'QED', + expansion_order = 99, + hierarchy = 2) + diff --git a/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/couplings.py b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/couplings.py new file mode 100644 index 0000000000..02cca0d98d --- /dev/null +++ b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/couplings.py @@ -0,0 +1,303 @@ +# This file was automatically created by FeynRules 2.3.43 +# Mathematica version: 12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020) +# Date: Mon 19 Apr 2021 15:23:43 + + +from object_library import all_couplings, Coupling + +from function_library import complexconjugate, re, im, csc, sec, acsc, asec, cot + + + +GC_1 = Coupling(name = 'GC_1', + value = '-(ee*complex(0,1))/3.', + order = {'QED':1}) + +GC_2 = Coupling(name = 'GC_2', + value = '(2*ee*complex(0,1))/3.', + order = {'QED':1}) + +GC_3 = Coupling(name = 'GC_3', + value = '-(ee*complex(0,1))', + order = {'QED':1}) + +GC_4 = Coupling(name = 'GC_4', + value = 'ee*complex(0,1)', + order = {'QED':1}) + +GC_5 = Coupling(name = 'GC_5', + value = 'ee**2*complex(0,1)', + order = {'QED':2}) + +GC_6 = Coupling(name = 'GC_6', + value = '(-2*cah*complex(0,1))/falp**2', + order = {'QED':2}) + +GC_7 = Coupling(name = 'GC_7', + value = '-cbb/(2.*falp)', + order = {'NP':1}) + +GC_8 = Coupling(name = 'GC_8', + value = '-ccc/(2.*falp)', + order = {'NP':1}) + +GC_9 = Coupling(name = 'GC_9', + value = '-cdd/(2.*falp)', + order = {'NP':1}) + +GC_10 = Coupling(name = 'GC_10', + value = '-cee/(2.*falp)', + order = {'NP':1}) + +GC_11 = Coupling(name = 'GC_11', + value = '-cmumu/(2.*falp)', + order = {'NP':1}) + +GC_12 = Coupling(name = 'GC_12', + value = '-css/(2.*falp)', + order = {'NP':1}) + +GC_13 = Coupling(name = 'GC_13', + value = '-ctt/(2.*falp)', + order = {'NP':1}) + +GC_14 = Coupling(name = 'GC_14', + value = '-cuu/(2.*falp)', + order = {'NP':1}) + +GC_15 = Coupling(name = 'GC_15', + value = '-G', + order = {'QCD':1}) + +GC_16 = Coupling(name = 'GC_16', + value = 'complex(0,1)*G', + order = {'QCD':1}) + +GC_17 = Coupling(name = 'GC_17', + value = 'complex(0,1)*G**2', + order = {'QCD':2}) + +GC_18 = Coupling(name = 'GC_18', + value = '-6*complex(0,1)*lam', + order = {'QED':2}) + +GC_19 = Coupling(name = 'GC_19', + value = '-(cWW*ee**2*complex(0,1))/(8.*falp*cmath.pi**2) - (cYY*ee**2*complex(0,1))/(8.*falp*cmath.pi**2)', + order = {'NP':1,'QED':2}) + +GC_20 = Coupling(name = 'GC_20', + value = '-(cGG*complex(0,1)*G**2)/(32.*falp*cmath.pi**2)', + order = {'NP':1,'QCD':2}) + +GC_21 = Coupling(name = 'GC_21', + value = '-(cGG*G**3)/(16.*falp*cmath.pi**2)', + order = {'NP':1,'QCD':3}) + +GC_22 = Coupling(name = 'GC_22', + value = '(cw*cWW*ee**3*complex(0,1))/(4.*falp*cmath.pi**2*sw**3)', + order = {'NP':1,'QED':3}) + +GC_23 = Coupling(name = 'GC_23', + value = '(ee**2*complex(0,1))/(2.*sw**2)', + order = {'QED':2}) + +GC_24 = Coupling(name = 'GC_24', + value = '-((ee**2*complex(0,1))/sw**2)', + order = {'QED':2}) + +GC_25 = Coupling(name = 'GC_25', + value = '(cw**2*ee**2*complex(0,1))/sw**2', + order = {'QED':2}) + +GC_26 = Coupling(name = 'GC_26', + value = '-(cWW*ee**2*complex(0,1))/(8.*falp*cmath.pi**2*sw**2)', + order = {'NP':1,'QED':2}) + +GC_27 = Coupling(name = 'GC_27', + value = '(cWW*ee**3*complex(0,1))/(4.*falp*cmath.pi**2*sw**2)', + order = {'NP':1,'QED':3}) + +GC_28 = Coupling(name = 'GC_28', + value = '(ee*complex(0,1))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_29 = Coupling(name = 'GC_29', + value = '(CKM1x1*ee*complex(0,1))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_30 = Coupling(name = 'GC_30', + value = '(CKM1x2*ee*complex(0,1))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_31 = Coupling(name = 'GC_31', + value = '(CKM1x3*ee*complex(0,1))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_32 = Coupling(name = 'GC_32', + value = '(CKM2x1*ee*complex(0,1))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_33 = Coupling(name = 'GC_33', + value = '(CKM2x2*ee*complex(0,1))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_34 = Coupling(name = 'GC_34', + value = '(CKM2x3*ee*complex(0,1))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_35 = Coupling(name = 'GC_35', + value = '(CKM3x1*ee*complex(0,1))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_36 = Coupling(name = 'GC_36', + value = '(CKM3x2*ee*complex(0,1))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_37 = Coupling(name = 'GC_37', + value = '(CKM3x3*ee*complex(0,1))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_38 = Coupling(name = 'GC_38', + value = '(cw*ee*complex(0,1))/sw', + order = {'QED':1}) + +GC_39 = Coupling(name = 'GC_39', + value = '(-2*cw*ee**2*complex(0,1))/sw', + order = {'QED':2}) + +GC_40 = Coupling(name = 'GC_40', + value = '(ee*complex(0,1)*sw)/(3.*cw)', + order = {'QED':1}) + +GC_41 = Coupling(name = 'GC_41', + value = '(-2*ee*complex(0,1)*sw)/(3.*cw)', + order = {'QED':1}) + +GC_42 = Coupling(name = 'GC_42', + value = '(ee*complex(0,1)*sw)/cw', + order = {'QED':1}) + +GC_43 = Coupling(name = 'GC_43', + value = '-(cw*ee*complex(0,1))/(2.*sw) - (ee*complex(0,1)*sw)/(6.*cw)', + order = {'QED':1}) + +GC_44 = Coupling(name = 'GC_44', + value = '(cw*ee*complex(0,1))/(2.*sw) - (ee*complex(0,1)*sw)/(6.*cw)', + order = {'QED':1}) + +GC_45 = Coupling(name = 'GC_45', + value = '-(cw*ee*complex(0,1))/(2.*sw) + (ee*complex(0,1)*sw)/(2.*cw)', + order = {'QED':1}) + +GC_46 = Coupling(name = 'GC_46', + value = '(cw*ee*complex(0,1))/(2.*sw) + (ee*complex(0,1)*sw)/(2.*cw)', + order = {'QED':1}) + +GC_47 = Coupling(name = 'GC_47', + value = '(cw*cZh5*ee)/(falp*sw) + (cZh5*ee*sw)/(cw*falp)', + order = {'NP':1,'QED':1}) + +GC_48 = Coupling(name = 'GC_48', + value = '-(cw*cWW*ee**2*complex(0,1))/(8.*falp*cmath.pi**2*sw) + (cYY*ee**2*complex(0,1)*sw)/(8.*cw*falp*cmath.pi**2)', + order = {'NP':1,'QED':2}) + +GC_49 = Coupling(name = 'GC_49', + value = 'ee**2*complex(0,1) + (cw**2*ee**2*complex(0,1))/(2.*sw**2) + (ee**2*complex(0,1)*sw**2)/(2.*cw**2)', + order = {'QED':2}) + +GC_50 = Coupling(name = 'GC_50', + value = '-(cw**2*cWW*ee**2*complex(0,1))/(8.*falp*cmath.pi**2*sw**2) - (cYY*ee**2*complex(0,1)*sw**2)/(8.*cw**2*falp*cmath.pi**2)', + order = {'NP':1,'QED':2}) + +GC_51 = Coupling(name = 'GC_51', + value = '(-2*cah*complex(0,1)*vev)/falp**2', + order = {'QED':1}) + +GC_52 = Coupling(name = 'GC_52', + value = '-6*complex(0,1)*lam*vev', + order = {'QED':1}) + +GC_53 = Coupling(name = 'GC_53', + value = '(ee**2*complex(0,1)*vev)/(2.*sw**2)', + order = {'QED':1}) + +GC_54 = Coupling(name = 'GC_54', + value = '(cw*cZh5*ee*vev)/(falp*sw) + (cZh5*ee*sw*vev)/(cw*falp)', + order = {'NP':1}) + +GC_55 = Coupling(name = 'GC_55', + value = 'ee**2*complex(0,1)*vev + (cw**2*ee**2*complex(0,1)*vev)/(2.*sw**2) + (ee**2*complex(0,1)*sw**2*vev)/(2.*cw**2)', + order = {'QED':1}) + +GC_56 = Coupling(name = 'GC_56', + value = '-((complex(0,1)*yb)/cmath.sqrt(2))', + order = {'QED':1}) + +GC_57 = Coupling(name = 'GC_57', + value = '-((complex(0,1)*yc)/cmath.sqrt(2))', + order = {'QED':1}) + +GC_58 = Coupling(name = 'GC_58', + value = '-((complex(0,1)*ydo)/cmath.sqrt(2))', + order = {'QED':1}) + +GC_59 = Coupling(name = 'GC_59', + value = '-((complex(0,1)*ye)/cmath.sqrt(2))', + order = {'QED':1}) + +GC_60 = Coupling(name = 'GC_60', + value = '-((complex(0,1)*ym)/cmath.sqrt(2))', + order = {'QED':1}) + +GC_61 = Coupling(name = 'GC_61', + value = '-((complex(0,1)*ys)/cmath.sqrt(2))', + order = {'QED':1}) + +GC_62 = Coupling(name = 'GC_62', + value = '-((complex(0,1)*yt)/cmath.sqrt(2))', + order = {'QED':1}) + +GC_63 = Coupling(name = 'GC_63', + value = '-((complex(0,1)*ytau)/cmath.sqrt(2))', + order = {'QED':1}) + +GC_64 = Coupling(name = 'GC_64', + value = '-((complex(0,1)*yup)/cmath.sqrt(2))', + order = {'QED':1}) + +GC_65 = Coupling(name = 'GC_65', + value = '(ee*complex(0,1)*complexconjugate(CKM1x1))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_66 = Coupling(name = 'GC_66', + value = '(ee*complex(0,1)*complexconjugate(CKM1x2))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_67 = Coupling(name = 'GC_67', + value = '(ee*complex(0,1)*complexconjugate(CKM1x3))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_68 = Coupling(name = 'GC_68', + value = '(ee*complex(0,1)*complexconjugate(CKM2x1))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_69 = Coupling(name = 'GC_69', + value = '(ee*complex(0,1)*complexconjugate(CKM2x2))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_70 = Coupling(name = 'GC_70', + value = '(ee*complex(0,1)*complexconjugate(CKM2x3))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_71 = Coupling(name = 'GC_71', + value = '(ee*complex(0,1)*complexconjugate(CKM3x1))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_72 = Coupling(name = 'GC_72', + value = '(ee*complex(0,1)*complexconjugate(CKM3x2))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + +GC_73 = Coupling(name = 'GC_73', + value = '(ee*complex(0,1)*complexconjugate(CKM3x3))/(sw*cmath.sqrt(2))', + order = {'QED':1}) + diff --git a/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/decays.py b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/decays.py new file mode 100644 index 0000000000..d6d198a149 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/decays.py @@ -0,0 +1,123 @@ +# This file was automatically created by FeynRules 2.3.43 +# Mathematica version: 12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020) +# Date: Mon 19 Apr 2021 15:23:43 + + +from object_library import all_decays, Decay +import particles as P + + +Decay_ALP = Decay(name = 'Decay_ALP', + particle = P.ALP, + partial_widths = {(P.a,P.a):'(Ma**2*((cWW**2*ee**4*Ma**4)/(32.*falp**2*cmath.pi**4) + (cWW*cYY*ee**4*Ma**4)/(16.*falp**2*cmath.pi**4) + (cYY**2*ee**4*Ma**4)/(32.*falp**2*cmath.pi**4)))/(32.*cmath.pi*abs(Ma)**3)', + (P.a,P.Z):'((Ma**2 - MZ**2)*(-(cWW*cYY*ee**4*Ma**4)/(16.*falp**2*cmath.pi**4) + (cWW*cYY*ee**4*Ma**2*MZ**2)/(8.*falp**2*cmath.pi**4) - (cWW*cYY*ee**4*MZ**4)/(16.*falp**2*cmath.pi**4) + (cw**2*cWW**2*ee**4*Ma**4)/(32.*falp**2*cmath.pi**4*sw**2) - (cw**2*cWW**2*ee**4*Ma**2*MZ**2)/(16.*falp**2*cmath.pi**4*sw**2) + (cw**2*cWW**2*ee**4*MZ**4)/(32.*falp**2*cmath.pi**4*sw**2) + (cYY**2*ee**4*Ma**4*sw**2)/(32.*cw**2*falp**2*cmath.pi**4) - (cYY**2*ee**4*Ma**2*MZ**2*sw**2)/(16.*cw**2*falp**2*cmath.pi**4) + (cYY**2*ee**4*MZ**4*sw**2)/(32.*cw**2*falp**2*cmath.pi**4)))/(16.*cmath.pi*abs(Ma)**3)', + (P.b,P.b__tilde__):'(3*cbb**2*Ma**2*MB**2*cmath.sqrt(Ma**4 - 4*Ma**2*MB**2))/(8.*falp**2*cmath.pi*abs(Ma)**3)', + (P.c,P.c__tilde__):'(3*ccc**2*Ma**2*MC**2*cmath.sqrt(Ma**4 - 4*Ma**2*MC**2))/(8.*falp**2*cmath.pi*abs(Ma)**3)', + (P.d,P.d__tilde__):'(3*cdd**2*Ma**2*MD**2*cmath.sqrt(Ma**4 - 4*Ma**2*MD**2))/(8.*falp**2*cmath.pi*abs(Ma)**3)', + (P.e__minus__,P.e__plus__):'(cee**2*Ma**2*Me**2*cmath.sqrt(Ma**4 - 4*Ma**2*Me**2))/(8.*falp**2*cmath.pi*abs(Ma)**3)', + (P.g,P.g):'(cGG**2*G**4*Ma**6)/(128.*falp**2*cmath.pi**5*abs(Ma)**3)', + (P.H,P.Z):'((-((cZh5**2*ee**2*Ma**2*vev**2)/falp**2) - (cZh5**2*ee**2*MH**2*vev**2)/falp**2 + (cZh5**2*ee**2*Ma**4*vev**2)/(2.*falp**2*MZ**2) - (cZh5**2*ee**2*Ma**2*MH**2*vev**2)/(falp**2*MZ**2) + (cZh5**2*ee**2*MH**4*vev**2)/(2.*falp**2*MZ**2) + (cZh5**2*ee**2*MZ**2*vev**2)/(2.*falp**2) - (cw**2*cZh5**2*ee**2*Ma**2*vev**2)/(2.*falp**2*sw**2) - (cw**2*cZh5**2*ee**2*MH**2*vev**2)/(2.*falp**2*sw**2) + (cw**2*cZh5**2*ee**2*Ma**4*vev**2)/(4.*falp**2*MZ**2*sw**2) - (cw**2*cZh5**2*ee**2*Ma**2*MH**2*vev**2)/(2.*falp**2*MZ**2*sw**2) + (cw**2*cZh5**2*ee**2*MH**4*vev**2)/(4.*falp**2*MZ**2*sw**2) + (cw**2*cZh5**2*ee**2*MZ**2*vev**2)/(4.*falp**2*sw**2) - (cZh5**2*ee**2*Ma**2*sw**2*vev**2)/(2.*cw**2*falp**2) - (cZh5**2*ee**2*MH**2*sw**2*vev**2)/(2.*cw**2*falp**2) + (cZh5**2*ee**2*Ma**4*sw**2*vev**2)/(4.*cw**2*falp**2*MZ**2) - (cZh5**2*ee**2*Ma**2*MH**2*sw**2*vev**2)/(2.*cw**2*falp**2*MZ**2) + (cZh5**2*ee**2*MH**4*sw**2*vev**2)/(4.*cw**2*falp**2*MZ**2) + (cZh5**2*ee**2*MZ**2*sw**2*vev**2)/(4.*cw**2*falp**2))*cmath.sqrt(Ma**4 - 2*Ma**2*MH**2 + MH**4 - 2*Ma**2*MZ**2 - 2*MH**2*MZ**2 + MZ**4))/(16.*cmath.pi*abs(Ma)**3)', + (P.mu__minus__,P.mu__plus__):'(cmumu**2*Ma**2*MMU**2*cmath.sqrt(Ma**4 - 4*Ma**2*MMU**2))/(8.*falp**2*cmath.pi*abs(Ma)**3)', + (P.s,P.s__tilde__):'(3*css**2*Ma**2*MS**2*cmath.sqrt(Ma**4 - 4*Ma**2*MS**2))/(8.*falp**2*cmath.pi*abs(Ma)**3)', + (P.t,P.t__tilde__):'(3*ctt**2*Ma**2*MT**2*cmath.sqrt(Ma**4 - 4*Ma**2*MT**2))/(8.*falp**2*cmath.pi*abs(Ma)**3)', + (P.u,P.u__tilde__):'(3*cuu**2*Ma**2*MU**2*cmath.sqrt(Ma**4 - 4*Ma**2*MU**2))/(8.*falp**2*cmath.pi*abs(Ma)**3)', + (P.W__minus__,P.W__plus__):'(((cWW**2*ee**4*Ma**4)/(32.*falp**2*cmath.pi**4*sw**4) - (cWW**2*ee**4*Ma**2*MW**2)/(8.*falp**2*cmath.pi**4*sw**4))*cmath.sqrt(Ma**4 - 4*Ma**2*MW**2))/(16.*cmath.pi*abs(Ma)**3)', + (P.Z,P.Z):'(((cWW*cYY*ee**4*Ma**4)/(16.*falp**2*cmath.pi**4) - (cWW*cYY*ee**4*Ma**2*MZ**2)/(4.*falp**2*cmath.pi**4) + (cw**4*cWW**2*ee**4*Ma**4)/(32.*falp**2*cmath.pi**4*sw**4) - (cw**4*cWW**2*ee**4*Ma**2*MZ**2)/(8.*falp**2*cmath.pi**4*sw**4) + (cYY**2*ee**4*Ma**4*sw**4)/(32.*cw**4*falp**2*cmath.pi**4) - (cYY**2*ee**4*Ma**2*MZ**2*sw**4)/(8.*cw**4*falp**2*cmath.pi**4))*cmath.sqrt(Ma**4 - 4*Ma**2*MZ**2))/(32.*cmath.pi*abs(Ma)**3)'}) + +Decay_b = Decay(name = 'Decay_b', + particle = P.b, + partial_widths = {(P.W__minus__,P.c):'(((3*CKM2x3*ee**2*MB**2*complexconjugate(CKM2x3))/(2.*sw**2) + (3*CKM2x3*ee**2*MC**2*complexconjugate(CKM2x3))/(2.*sw**2) + (3*CKM2x3*ee**2*MB**4*complexconjugate(CKM2x3))/(2.*MW**2*sw**2) - (3*CKM2x3*ee**2*MB**2*MC**2*complexconjugate(CKM2x3))/(MW**2*sw**2) + (3*CKM2x3*ee**2*MC**4*complexconjugate(CKM2x3))/(2.*MW**2*sw**2) - (3*CKM2x3*ee**2*MW**2*complexconjugate(CKM2x3))/sw**2)*cmath.sqrt(MB**4 - 2*MB**2*MC**2 + MC**4 - 2*MB**2*MW**2 - 2*MC**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MB)**3)', + (P.W__minus__,P.t):'(((3*CKM3x3*ee**2*MB**2*complexconjugate(CKM3x3))/(2.*sw**2) + (3*CKM3x3*ee**2*MT**2*complexconjugate(CKM3x3))/(2.*sw**2) + (3*CKM3x3*ee**2*MB**4*complexconjugate(CKM3x3))/(2.*MW**2*sw**2) - (3*CKM3x3*ee**2*MB**2*MT**2*complexconjugate(CKM3x3))/(MW**2*sw**2) + (3*CKM3x3*ee**2*MT**4*complexconjugate(CKM3x3))/(2.*MW**2*sw**2) - (3*CKM3x3*ee**2*MW**2*complexconjugate(CKM3x3))/sw**2)*cmath.sqrt(MB**4 - 2*MB**2*MT**2 + MT**4 - 2*MB**2*MW**2 - 2*MT**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MB)**3)', + (P.W__minus__,P.u):'(((3*CKM1x3*ee**2*MB**2*complexconjugate(CKM1x3))/(2.*sw**2) + (3*CKM1x3*ee**2*MU**2*complexconjugate(CKM1x3))/(2.*sw**2) + (3*CKM1x3*ee**2*MB**4*complexconjugate(CKM1x3))/(2.*MW**2*sw**2) - (3*CKM1x3*ee**2*MB**2*MU**2*complexconjugate(CKM1x3))/(MW**2*sw**2) + (3*CKM1x3*ee**2*MU**4*complexconjugate(CKM1x3))/(2.*MW**2*sw**2) - (3*CKM1x3*ee**2*MW**2*complexconjugate(CKM1x3))/sw**2)*cmath.sqrt(MB**4 - 2*MB**2*MU**2 + MU**4 - 2*MB**2*MW**2 - 2*MU**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MB)**3)'}) + +Decay_c = Decay(name = 'Decay_c', + particle = P.c, + partial_widths = {(P.W__plus__,P.b):'(((3*CKM2x3*ee**2*MB**2*complexconjugate(CKM2x3))/(2.*sw**2) + (3*CKM2x3*ee**2*MC**2*complexconjugate(CKM2x3))/(2.*sw**2) + (3*CKM2x3*ee**2*MB**4*complexconjugate(CKM2x3))/(2.*MW**2*sw**2) - (3*CKM2x3*ee**2*MB**2*MC**2*complexconjugate(CKM2x3))/(MW**2*sw**2) + (3*CKM2x3*ee**2*MC**4*complexconjugate(CKM2x3))/(2.*MW**2*sw**2) - (3*CKM2x3*ee**2*MW**2*complexconjugate(CKM2x3))/sw**2)*cmath.sqrt(MB**4 - 2*MB**2*MC**2 + MC**4 - 2*MB**2*MW**2 - 2*MC**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MC)**3)', + (P.W__plus__,P.d):'(((3*CKM2x1*ee**2*MC**2*complexconjugate(CKM2x1))/(2.*sw**2) + (3*CKM2x1*ee**2*MD**2*complexconjugate(CKM2x1))/(2.*sw**2) + (3*CKM2x1*ee**2*MC**4*complexconjugate(CKM2x1))/(2.*MW**2*sw**2) - (3*CKM2x1*ee**2*MC**2*MD**2*complexconjugate(CKM2x1))/(MW**2*sw**2) + (3*CKM2x1*ee**2*MD**4*complexconjugate(CKM2x1))/(2.*MW**2*sw**2) - (3*CKM2x1*ee**2*MW**2*complexconjugate(CKM2x1))/sw**2)*cmath.sqrt(MC**4 - 2*MC**2*MD**2 + MD**4 - 2*MC**2*MW**2 - 2*MD**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MC)**3)', + (P.W__plus__,P.s):'(((3*CKM2x2*ee**2*MC**2*complexconjugate(CKM2x2))/(2.*sw**2) + (3*CKM2x2*ee**2*MS**2*complexconjugate(CKM2x2))/(2.*sw**2) + (3*CKM2x2*ee**2*MC**4*complexconjugate(CKM2x2))/(2.*MW**2*sw**2) - (3*CKM2x2*ee**2*MC**2*MS**2*complexconjugate(CKM2x2))/(MW**2*sw**2) + (3*CKM2x2*ee**2*MS**4*complexconjugate(CKM2x2))/(2.*MW**2*sw**2) - (3*CKM2x2*ee**2*MW**2*complexconjugate(CKM2x2))/sw**2)*cmath.sqrt(MC**4 - 2*MC**2*MS**2 + MS**4 - 2*MC**2*MW**2 - 2*MS**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MC)**3)'}) + +Decay_d = Decay(name = 'Decay_d', + particle = P.d, + partial_widths = {(P.W__minus__,P.c):'(((3*CKM2x1*ee**2*MC**2*complexconjugate(CKM2x1))/(2.*sw**2) + (3*CKM2x1*ee**2*MD**2*complexconjugate(CKM2x1))/(2.*sw**2) + (3*CKM2x1*ee**2*MC**4*complexconjugate(CKM2x1))/(2.*MW**2*sw**2) - (3*CKM2x1*ee**2*MC**2*MD**2*complexconjugate(CKM2x1))/(MW**2*sw**2) + (3*CKM2x1*ee**2*MD**4*complexconjugate(CKM2x1))/(2.*MW**2*sw**2) - (3*CKM2x1*ee**2*MW**2*complexconjugate(CKM2x1))/sw**2)*cmath.sqrt(MC**4 - 2*MC**2*MD**2 + MD**4 - 2*MC**2*MW**2 - 2*MD**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MD)**3)', + (P.W__minus__,P.t):'(((3*CKM3x1*ee**2*MD**2*complexconjugate(CKM3x1))/(2.*sw**2) + (3*CKM3x1*ee**2*MT**2*complexconjugate(CKM3x1))/(2.*sw**2) + (3*CKM3x1*ee**2*MD**4*complexconjugate(CKM3x1))/(2.*MW**2*sw**2) - (3*CKM3x1*ee**2*MD**2*MT**2*complexconjugate(CKM3x1))/(MW**2*sw**2) + (3*CKM3x1*ee**2*MT**4*complexconjugate(CKM3x1))/(2.*MW**2*sw**2) - (3*CKM3x1*ee**2*MW**2*complexconjugate(CKM3x1))/sw**2)*cmath.sqrt(MD**4 - 2*MD**2*MT**2 + MT**4 - 2*MD**2*MW**2 - 2*MT**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MD)**3)', + (P.W__minus__,P.u):'(((3*CKM1x1*ee**2*MD**2*complexconjugate(CKM1x1))/(2.*sw**2) + (3*CKM1x1*ee**2*MU**2*complexconjugate(CKM1x1))/(2.*sw**2) + (3*CKM1x1*ee**2*MD**4*complexconjugate(CKM1x1))/(2.*MW**2*sw**2) - (3*CKM1x1*ee**2*MD**2*MU**2*complexconjugate(CKM1x1))/(MW**2*sw**2) + (3*CKM1x1*ee**2*MU**4*complexconjugate(CKM1x1))/(2.*MW**2*sw**2) - (3*CKM1x1*ee**2*MW**2*complexconjugate(CKM1x1))/sw**2)*cmath.sqrt(MD**4 - 2*MD**2*MU**2 + MU**4 - 2*MD**2*MW**2 - 2*MU**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MD)**3)'}) + +Decay_e__minus__ = Decay(name = 'Decay_e__minus__', + particle = P.e__minus__, + partial_widths = {(P.W__minus__,P.ve):'((Me**2 - MW**2)*((ee**2*Me**2)/(2.*sw**2) + (ee**2*Me**4)/(2.*MW**2*sw**2) - (ee**2*MW**2)/sw**2))/(32.*cmath.pi*abs(Me)**3)'}) + +Decay_H = Decay(name = 'Decay_H', + particle = P.H, + partial_widths = {(P.ALP,P.ALP):'(((4*cah**2*Ma**4*vev**2)/falp**4 - (4*cah**2*Ma**2*MH**2*vev**2)/falp**4 + (cah**2*MH**4*vev**2)/falp**4)*cmath.sqrt(-4*Ma**2*MH**2 + MH**4))/(32.*cmath.pi*abs(MH)**3)', + (P.ALP,P.Z):'((-((cZh5**2*ee**2*Ma**2*vev**2)/falp**2) - (cZh5**2*ee**2*MH**2*vev**2)/falp**2 + (cZh5**2*ee**2*Ma**4*vev**2)/(2.*falp**2*MZ**2) - (cZh5**2*ee**2*Ma**2*MH**2*vev**2)/(falp**2*MZ**2) + (cZh5**2*ee**2*MH**4*vev**2)/(2.*falp**2*MZ**2) + (cZh5**2*ee**2*MZ**2*vev**2)/(2.*falp**2) - (cw**2*cZh5**2*ee**2*Ma**2*vev**2)/(2.*falp**2*sw**2) - (cw**2*cZh5**2*ee**2*MH**2*vev**2)/(2.*falp**2*sw**2) + (cw**2*cZh5**2*ee**2*Ma**4*vev**2)/(4.*falp**2*MZ**2*sw**2) - (cw**2*cZh5**2*ee**2*Ma**2*MH**2*vev**2)/(2.*falp**2*MZ**2*sw**2) + (cw**2*cZh5**2*ee**2*MH**4*vev**2)/(4.*falp**2*MZ**2*sw**2) + (cw**2*cZh5**2*ee**2*MZ**2*vev**2)/(4.*falp**2*sw**2) - (cZh5**2*ee**2*Ma**2*sw**2*vev**2)/(2.*cw**2*falp**2) - (cZh5**2*ee**2*MH**2*sw**2*vev**2)/(2.*cw**2*falp**2) + (cZh5**2*ee**2*Ma**4*sw**2*vev**2)/(4.*cw**2*falp**2*MZ**2) - (cZh5**2*ee**2*Ma**2*MH**2*sw**2*vev**2)/(2.*cw**2*falp**2*MZ**2) + (cZh5**2*ee**2*MH**4*sw**2*vev**2)/(4.*cw**2*falp**2*MZ**2) + (cZh5**2*ee**2*MZ**2*sw**2*vev**2)/(4.*cw**2*falp**2))*cmath.sqrt(Ma**4 - 2*Ma**2*MH**2 + MH**4 - 2*Ma**2*MZ**2 - 2*MH**2*MZ**2 + MZ**4))/(16.*cmath.pi*abs(MH)**3)', + (P.b,P.b__tilde__):'((-12*MB**2*yb**2 + 3*MH**2*yb**2)*cmath.sqrt(-4*MB**2*MH**2 + MH**4))/(16.*cmath.pi*abs(MH)**3)', + (P.c,P.c__tilde__):'((-12*MC**2*yc**2 + 3*MH**2*yc**2)*cmath.sqrt(-4*MC**2*MH**2 + MH**4))/(16.*cmath.pi*abs(MH)**3)', + (P.d,P.d__tilde__):'((-12*MD**2*ydo**2 + 3*MH**2*ydo**2)*cmath.sqrt(-4*MD**2*MH**2 + MH**4))/(16.*cmath.pi*abs(MH)**3)', + (P.e__minus__,P.e__plus__):'((-4*Me**2*ye**2 + MH**2*ye**2)*cmath.sqrt(-4*Me**2*MH**2 + MH**4))/(16.*cmath.pi*abs(MH)**3)', + (P.mu__minus__,P.mu__plus__):'((MH**2*ym**2 - 4*MMU**2*ym**2)*cmath.sqrt(MH**4 - 4*MH**2*MMU**2))/(16.*cmath.pi*abs(MH)**3)', + (P.s,P.s__tilde__):'((3*MH**2*ys**2 - 12*MS**2*ys**2)*cmath.sqrt(MH**4 - 4*MH**2*MS**2))/(16.*cmath.pi*abs(MH)**3)', + (P.t,P.t__tilde__):'((3*MH**2*yt**2 - 12*MT**2*yt**2)*cmath.sqrt(MH**4 - 4*MH**2*MT**2))/(16.*cmath.pi*abs(MH)**3)', + (P.ta__minus__,P.ta__plus__):'((MH**2*ytau**2 - 4*MTA**2*ytau**2)*cmath.sqrt(MH**4 - 4*MH**2*MTA**2))/(16.*cmath.pi*abs(MH)**3)', + (P.u,P.u__tilde__):'((3*MH**2*yup**2 - 12*MU**2*yup**2)*cmath.sqrt(MH**4 - 4*MH**2*MU**2))/(16.*cmath.pi*abs(MH)**3)', + (P.W__minus__,P.W__plus__):'(((3*ee**4*vev**2)/(4.*sw**4) + (ee**4*MH**4*vev**2)/(16.*MW**4*sw**4) - (ee**4*MH**2*vev**2)/(4.*MW**2*sw**4))*cmath.sqrt(MH**4 - 4*MH**2*MW**2))/(16.*cmath.pi*abs(MH)**3)', + (P.Z,P.Z):'(((9*ee**4*vev**2)/2. + (3*ee**4*MH**4*vev**2)/(8.*MZ**4) - (3*ee**4*MH**2*vev**2)/(2.*MZ**2) + (3*cw**4*ee**4*vev**2)/(4.*sw**4) + (cw**4*ee**4*MH**4*vev**2)/(16.*MZ**4*sw**4) - (cw**4*ee**4*MH**2*vev**2)/(4.*MZ**2*sw**4) + (3*cw**2*ee**4*vev**2)/sw**2 + (cw**2*ee**4*MH**4*vev**2)/(4.*MZ**4*sw**2) - (cw**2*ee**4*MH**2*vev**2)/(MZ**2*sw**2) + (3*ee**4*sw**2*vev**2)/cw**2 + (ee**4*MH**4*sw**2*vev**2)/(4.*cw**2*MZ**4) - (ee**4*MH**2*sw**2*vev**2)/(cw**2*MZ**2) + (3*ee**4*sw**4*vev**2)/(4.*cw**4) + (ee**4*MH**4*sw**4*vev**2)/(16.*cw**4*MZ**4) - (ee**4*MH**2*sw**4*vev**2)/(4.*cw**4*MZ**2))*cmath.sqrt(MH**4 - 4*MH**2*MZ**2))/(32.*cmath.pi*abs(MH)**3)'}) + +Decay_mu__minus__ = Decay(name = 'Decay_mu__minus__', + particle = P.mu__minus__, + partial_widths = {(P.W__minus__,P.vm):'((MMU**2 - MW**2)*((ee**2*MMU**2)/(2.*sw**2) + (ee**2*MMU**4)/(2.*MW**2*sw**2) - (ee**2*MW**2)/sw**2))/(32.*cmath.pi*abs(MMU)**3)'}) + +Decay_s = Decay(name = 'Decay_s', + particle = P.s, + partial_widths = {(P.W__minus__,P.c):'(((3*CKM2x2*ee**2*MC**2*complexconjugate(CKM2x2))/(2.*sw**2) + (3*CKM2x2*ee**2*MS**2*complexconjugate(CKM2x2))/(2.*sw**2) + (3*CKM2x2*ee**2*MC**4*complexconjugate(CKM2x2))/(2.*MW**2*sw**2) - (3*CKM2x2*ee**2*MC**2*MS**2*complexconjugate(CKM2x2))/(MW**2*sw**2) + (3*CKM2x2*ee**2*MS**4*complexconjugate(CKM2x2))/(2.*MW**2*sw**2) - (3*CKM2x2*ee**2*MW**2*complexconjugate(CKM2x2))/sw**2)*cmath.sqrt(MC**4 - 2*MC**2*MS**2 + MS**4 - 2*MC**2*MW**2 - 2*MS**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MS)**3)', + (P.W__minus__,P.t):'(((3*CKM3x2*ee**2*MS**2*complexconjugate(CKM3x2))/(2.*sw**2) + (3*CKM3x2*ee**2*MT**2*complexconjugate(CKM3x2))/(2.*sw**2) + (3*CKM3x2*ee**2*MS**4*complexconjugate(CKM3x2))/(2.*MW**2*sw**2) - (3*CKM3x2*ee**2*MS**2*MT**2*complexconjugate(CKM3x2))/(MW**2*sw**2) + (3*CKM3x2*ee**2*MT**4*complexconjugate(CKM3x2))/(2.*MW**2*sw**2) - (3*CKM3x2*ee**2*MW**2*complexconjugate(CKM3x2))/sw**2)*cmath.sqrt(MS**4 - 2*MS**2*MT**2 + MT**4 - 2*MS**2*MW**2 - 2*MT**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MS)**3)', + (P.W__minus__,P.u):'(((3*CKM1x2*ee**2*MS**2*complexconjugate(CKM1x2))/(2.*sw**2) + (3*CKM1x2*ee**2*MU**2*complexconjugate(CKM1x2))/(2.*sw**2) + (3*CKM1x2*ee**2*MS**4*complexconjugate(CKM1x2))/(2.*MW**2*sw**2) - (3*CKM1x2*ee**2*MS**2*MU**2*complexconjugate(CKM1x2))/(MW**2*sw**2) + (3*CKM1x2*ee**2*MU**4*complexconjugate(CKM1x2))/(2.*MW**2*sw**2) - (3*CKM1x2*ee**2*MW**2*complexconjugate(CKM1x2))/sw**2)*cmath.sqrt(MS**4 - 2*MS**2*MU**2 + MU**4 - 2*MS**2*MW**2 - 2*MU**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MS)**3)'}) + +Decay_t = Decay(name = 'Decay_t', + particle = P.t, + partial_widths = {(P.W__plus__,P.b):'(((3*CKM3x3*ee**2*MB**2*complexconjugate(CKM3x3))/(2.*sw**2) + (3*CKM3x3*ee**2*MT**2*complexconjugate(CKM3x3))/(2.*sw**2) + (3*CKM3x3*ee**2*MB**4*complexconjugate(CKM3x3))/(2.*MW**2*sw**2) - (3*CKM3x3*ee**2*MB**2*MT**2*complexconjugate(CKM3x3))/(MW**2*sw**2) + (3*CKM3x3*ee**2*MT**4*complexconjugate(CKM3x3))/(2.*MW**2*sw**2) - (3*CKM3x3*ee**2*MW**2*complexconjugate(CKM3x3))/sw**2)*cmath.sqrt(MB**4 - 2*MB**2*MT**2 + MT**4 - 2*MB**2*MW**2 - 2*MT**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MT)**3)', + (P.W__plus__,P.d):'(((3*CKM3x1*ee**2*MD**2*complexconjugate(CKM3x1))/(2.*sw**2) + (3*CKM3x1*ee**2*MT**2*complexconjugate(CKM3x1))/(2.*sw**2) + (3*CKM3x1*ee**2*MD**4*complexconjugate(CKM3x1))/(2.*MW**2*sw**2) - (3*CKM3x1*ee**2*MD**2*MT**2*complexconjugate(CKM3x1))/(MW**2*sw**2) + (3*CKM3x1*ee**2*MT**4*complexconjugate(CKM3x1))/(2.*MW**2*sw**2) - (3*CKM3x1*ee**2*MW**2*complexconjugate(CKM3x1))/sw**2)*cmath.sqrt(MD**4 - 2*MD**2*MT**2 + MT**4 - 2*MD**2*MW**2 - 2*MT**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MT)**3)', + (P.W__plus__,P.s):'(((3*CKM3x2*ee**2*MS**2*complexconjugate(CKM3x2))/(2.*sw**2) + (3*CKM3x2*ee**2*MT**2*complexconjugate(CKM3x2))/(2.*sw**2) + (3*CKM3x2*ee**2*MS**4*complexconjugate(CKM3x2))/(2.*MW**2*sw**2) - (3*CKM3x2*ee**2*MS**2*MT**2*complexconjugate(CKM3x2))/(MW**2*sw**2) + (3*CKM3x2*ee**2*MT**4*complexconjugate(CKM3x2))/(2.*MW**2*sw**2) - (3*CKM3x2*ee**2*MW**2*complexconjugate(CKM3x2))/sw**2)*cmath.sqrt(MS**4 - 2*MS**2*MT**2 + MT**4 - 2*MS**2*MW**2 - 2*MT**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MT)**3)'}) + +Decay_ta__minus__ = Decay(name = 'Decay_ta__minus__', + particle = P.ta__minus__, + partial_widths = {(P.W__minus__,P.vt):'((MTA**2 - MW**2)*((ee**2*MTA**2)/(2.*sw**2) + (ee**2*MTA**4)/(2.*MW**2*sw**2) - (ee**2*MW**2)/sw**2))/(32.*cmath.pi*abs(MTA)**3)'}) + +Decay_u = Decay(name = 'Decay_u', + particle = P.u, + partial_widths = {(P.W__plus__,P.b):'(((3*CKM1x3*ee**2*MB**2*complexconjugate(CKM1x3))/(2.*sw**2) + (3*CKM1x3*ee**2*MU**2*complexconjugate(CKM1x3))/(2.*sw**2) + (3*CKM1x3*ee**2*MB**4*complexconjugate(CKM1x3))/(2.*MW**2*sw**2) - (3*CKM1x3*ee**2*MB**2*MU**2*complexconjugate(CKM1x3))/(MW**2*sw**2) + (3*CKM1x3*ee**2*MU**4*complexconjugate(CKM1x3))/(2.*MW**2*sw**2) - (3*CKM1x3*ee**2*MW**2*complexconjugate(CKM1x3))/sw**2)*cmath.sqrt(MB**4 - 2*MB**2*MU**2 + MU**4 - 2*MB**2*MW**2 - 2*MU**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MU)**3)', + (P.W__plus__,P.d):'(((3*CKM1x1*ee**2*MD**2*complexconjugate(CKM1x1))/(2.*sw**2) + (3*CKM1x1*ee**2*MU**2*complexconjugate(CKM1x1))/(2.*sw**2) + (3*CKM1x1*ee**2*MD**4*complexconjugate(CKM1x1))/(2.*MW**2*sw**2) - (3*CKM1x1*ee**2*MD**2*MU**2*complexconjugate(CKM1x1))/(MW**2*sw**2) + (3*CKM1x1*ee**2*MU**4*complexconjugate(CKM1x1))/(2.*MW**2*sw**2) - (3*CKM1x1*ee**2*MW**2*complexconjugate(CKM1x1))/sw**2)*cmath.sqrt(MD**4 - 2*MD**2*MU**2 + MU**4 - 2*MD**2*MW**2 - 2*MU**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MU)**3)', + (P.W__plus__,P.s):'(((3*CKM1x2*ee**2*MS**2*complexconjugate(CKM1x2))/(2.*sw**2) + (3*CKM1x2*ee**2*MU**2*complexconjugate(CKM1x2))/(2.*sw**2) + (3*CKM1x2*ee**2*MS**4*complexconjugate(CKM1x2))/(2.*MW**2*sw**2) - (3*CKM1x2*ee**2*MS**2*MU**2*complexconjugate(CKM1x2))/(MW**2*sw**2) + (3*CKM1x2*ee**2*MU**4*complexconjugate(CKM1x2))/(2.*MW**2*sw**2) - (3*CKM1x2*ee**2*MW**2*complexconjugate(CKM1x2))/sw**2)*cmath.sqrt(MS**4 - 2*MS**2*MU**2 + MU**4 - 2*MS**2*MW**2 - 2*MU**2*MW**2 + MW**4))/(96.*cmath.pi*abs(MU)**3)'}) + +Decay_W__plus__ = Decay(name = 'Decay_W__plus__', + particle = P.W__plus__, + partial_widths = {(P.c,P.b__tilde__):'(((-3*CKM2x3*ee**2*MB**2*complexconjugate(CKM2x3))/(2.*sw**2) - (3*CKM2x3*ee**2*MC**2*complexconjugate(CKM2x3))/(2.*sw**2) - (3*CKM2x3*ee**2*MB**4*complexconjugate(CKM2x3))/(2.*MW**2*sw**2) + (3*CKM2x3*ee**2*MB**2*MC**2*complexconjugate(CKM2x3))/(MW**2*sw**2) - (3*CKM2x3*ee**2*MC**4*complexconjugate(CKM2x3))/(2.*MW**2*sw**2) + (3*CKM2x3*ee**2*MW**2*complexconjugate(CKM2x3))/sw**2)*cmath.sqrt(MB**4 - 2*MB**2*MC**2 + MC**4 - 2*MB**2*MW**2 - 2*MC**2*MW**2 + MW**4))/(48.*cmath.pi*abs(MW)**3)', + (P.c,P.d__tilde__):'(((-3*CKM2x1*ee**2*MC**2*complexconjugate(CKM2x1))/(2.*sw**2) - (3*CKM2x1*ee**2*MD**2*complexconjugate(CKM2x1))/(2.*sw**2) - (3*CKM2x1*ee**2*MC**4*complexconjugate(CKM2x1))/(2.*MW**2*sw**2) + (3*CKM2x1*ee**2*MC**2*MD**2*complexconjugate(CKM2x1))/(MW**2*sw**2) - (3*CKM2x1*ee**2*MD**4*complexconjugate(CKM2x1))/(2.*MW**2*sw**2) + (3*CKM2x1*ee**2*MW**2*complexconjugate(CKM2x1))/sw**2)*cmath.sqrt(MC**4 - 2*MC**2*MD**2 + MD**4 - 2*MC**2*MW**2 - 2*MD**2*MW**2 + MW**4))/(48.*cmath.pi*abs(MW)**3)', + (P.c,P.s__tilde__):'(((-3*CKM2x2*ee**2*MC**2*complexconjugate(CKM2x2))/(2.*sw**2) - (3*CKM2x2*ee**2*MS**2*complexconjugate(CKM2x2))/(2.*sw**2) - (3*CKM2x2*ee**2*MC**4*complexconjugate(CKM2x2))/(2.*MW**2*sw**2) + (3*CKM2x2*ee**2*MC**2*MS**2*complexconjugate(CKM2x2))/(MW**2*sw**2) - (3*CKM2x2*ee**2*MS**4*complexconjugate(CKM2x2))/(2.*MW**2*sw**2) + (3*CKM2x2*ee**2*MW**2*complexconjugate(CKM2x2))/sw**2)*cmath.sqrt(MC**4 - 2*MC**2*MS**2 + MS**4 - 2*MC**2*MW**2 - 2*MS**2*MW**2 + MW**4))/(48.*cmath.pi*abs(MW)**3)', + (P.t,P.b__tilde__):'(((-3*CKM3x3*ee**2*MB**2*complexconjugate(CKM3x3))/(2.*sw**2) - (3*CKM3x3*ee**2*MT**2*complexconjugate(CKM3x3))/(2.*sw**2) - (3*CKM3x3*ee**2*MB**4*complexconjugate(CKM3x3))/(2.*MW**2*sw**2) + (3*CKM3x3*ee**2*MB**2*MT**2*complexconjugate(CKM3x3))/(MW**2*sw**2) - (3*CKM3x3*ee**2*MT**4*complexconjugate(CKM3x3))/(2.*MW**2*sw**2) + (3*CKM3x3*ee**2*MW**2*complexconjugate(CKM3x3))/sw**2)*cmath.sqrt(MB**4 - 2*MB**2*MT**2 + MT**4 - 2*MB**2*MW**2 - 2*MT**2*MW**2 + MW**4))/(48.*cmath.pi*abs(MW)**3)', + (P.t,P.d__tilde__):'(((-3*CKM3x1*ee**2*MD**2*complexconjugate(CKM3x1))/(2.*sw**2) - (3*CKM3x1*ee**2*MT**2*complexconjugate(CKM3x1))/(2.*sw**2) - (3*CKM3x1*ee**2*MD**4*complexconjugate(CKM3x1))/(2.*MW**2*sw**2) + (3*CKM3x1*ee**2*MD**2*MT**2*complexconjugate(CKM3x1))/(MW**2*sw**2) - (3*CKM3x1*ee**2*MT**4*complexconjugate(CKM3x1))/(2.*MW**2*sw**2) + (3*CKM3x1*ee**2*MW**2*complexconjugate(CKM3x1))/sw**2)*cmath.sqrt(MD**4 - 2*MD**2*MT**2 + MT**4 - 2*MD**2*MW**2 - 2*MT**2*MW**2 + MW**4))/(48.*cmath.pi*abs(MW)**3)', + (P.t,P.s__tilde__):'(((-3*CKM3x2*ee**2*MS**2*complexconjugate(CKM3x2))/(2.*sw**2) - (3*CKM3x2*ee**2*MT**2*complexconjugate(CKM3x2))/(2.*sw**2) - (3*CKM3x2*ee**2*MS**4*complexconjugate(CKM3x2))/(2.*MW**2*sw**2) + (3*CKM3x2*ee**2*MS**2*MT**2*complexconjugate(CKM3x2))/(MW**2*sw**2) - (3*CKM3x2*ee**2*MT**4*complexconjugate(CKM3x2))/(2.*MW**2*sw**2) + (3*CKM3x2*ee**2*MW**2*complexconjugate(CKM3x2))/sw**2)*cmath.sqrt(MS**4 - 2*MS**2*MT**2 + MT**4 - 2*MS**2*MW**2 - 2*MT**2*MW**2 + MW**4))/(48.*cmath.pi*abs(MW)**3)', + (P.u,P.b__tilde__):'(((-3*CKM1x3*ee**2*MB**2*complexconjugate(CKM1x3))/(2.*sw**2) - (3*CKM1x3*ee**2*MU**2*complexconjugate(CKM1x3))/(2.*sw**2) - (3*CKM1x3*ee**2*MB**4*complexconjugate(CKM1x3))/(2.*MW**2*sw**2) + (3*CKM1x3*ee**2*MB**2*MU**2*complexconjugate(CKM1x3))/(MW**2*sw**2) - (3*CKM1x3*ee**2*MU**4*complexconjugate(CKM1x3))/(2.*MW**2*sw**2) + (3*CKM1x3*ee**2*MW**2*complexconjugate(CKM1x3))/sw**2)*cmath.sqrt(MB**4 - 2*MB**2*MU**2 + MU**4 - 2*MB**2*MW**2 - 2*MU**2*MW**2 + MW**4))/(48.*cmath.pi*abs(MW)**3)', + (P.u,P.d__tilde__):'(((-3*CKM1x1*ee**2*MD**2*complexconjugate(CKM1x1))/(2.*sw**2) - (3*CKM1x1*ee**2*MU**2*complexconjugate(CKM1x1))/(2.*sw**2) - (3*CKM1x1*ee**2*MD**4*complexconjugate(CKM1x1))/(2.*MW**2*sw**2) + (3*CKM1x1*ee**2*MD**2*MU**2*complexconjugate(CKM1x1))/(MW**2*sw**2) - (3*CKM1x1*ee**2*MU**4*complexconjugate(CKM1x1))/(2.*MW**2*sw**2) + (3*CKM1x1*ee**2*MW**2*complexconjugate(CKM1x1))/sw**2)*cmath.sqrt(MD**4 - 2*MD**2*MU**2 + MU**4 - 2*MD**2*MW**2 - 2*MU**2*MW**2 + MW**4))/(48.*cmath.pi*abs(MW)**3)', + (P.u,P.s__tilde__):'(((-3*CKM1x2*ee**2*MS**2*complexconjugate(CKM1x2))/(2.*sw**2) - (3*CKM1x2*ee**2*MU**2*complexconjugate(CKM1x2))/(2.*sw**2) - (3*CKM1x2*ee**2*MS**4*complexconjugate(CKM1x2))/(2.*MW**2*sw**2) + (3*CKM1x2*ee**2*MS**2*MU**2*complexconjugate(CKM1x2))/(MW**2*sw**2) - (3*CKM1x2*ee**2*MU**4*complexconjugate(CKM1x2))/(2.*MW**2*sw**2) + (3*CKM1x2*ee**2*MW**2*complexconjugate(CKM1x2))/sw**2)*cmath.sqrt(MS**4 - 2*MS**2*MU**2 + MU**4 - 2*MS**2*MW**2 - 2*MU**2*MW**2 + MW**4))/(48.*cmath.pi*abs(MW)**3)', + (P.ve,P.e__plus__):'((-Me**2 + MW**2)*(-(ee**2*Me**2)/(2.*sw**2) - (ee**2*Me**4)/(2.*MW**2*sw**2) + (ee**2*MW**2)/sw**2))/(48.*cmath.pi*abs(MW)**3)', + (P.vm,P.mu__plus__):'((-MMU**2 + MW**2)*(-(ee**2*MMU**2)/(2.*sw**2) - (ee**2*MMU**4)/(2.*MW**2*sw**2) + (ee**2*MW**2)/sw**2))/(48.*cmath.pi*abs(MW)**3)', + (P.vt,P.ta__plus__):'((-MTA**2 + MW**2)*(-(ee**2*MTA**2)/(2.*sw**2) - (ee**2*MTA**4)/(2.*MW**2*sw**2) + (ee**2*MW**2)/sw**2))/(48.*cmath.pi*abs(MW)**3)'}) + +Decay_Z = Decay(name = 'Decay_Z', + particle = P.Z, + partial_widths = {(P.a,P.ALP):'((-Ma**2 + MZ**2)*(-(cWW*cYY*ee**4*Ma**4)/(16.*falp**2*cmath.pi**4) + (cWW*cYY*ee**4*Ma**2*MZ**2)/(8.*falp**2*cmath.pi**4) - (cWW*cYY*ee**4*MZ**4)/(16.*falp**2*cmath.pi**4) + (cw**2*cWW**2*ee**4*Ma**4)/(32.*falp**2*cmath.pi**4*sw**2) - (cw**2*cWW**2*ee**4*Ma**2*MZ**2)/(16.*falp**2*cmath.pi**4*sw**2) + (cw**2*cWW**2*ee**4*MZ**4)/(32.*falp**2*cmath.pi**4*sw**2) + (cYY**2*ee**4*Ma**4*sw**2)/(32.*cw**2*falp**2*cmath.pi**4) - (cYY**2*ee**4*Ma**2*MZ**2*sw**2)/(16.*cw**2*falp**2*cmath.pi**4) + (cYY**2*ee**4*MZ**4*sw**2)/(32.*cw**2*falp**2*cmath.pi**4)))/(48.*cmath.pi*abs(MZ)**3)', + (P.ALP,P.H):'((-((cZh5**2*ee**2*Ma**2*vev**2)/falp**2) - (cZh5**2*ee**2*MH**2*vev**2)/falp**2 + (cZh5**2*ee**2*Ma**4*vev**2)/(2.*falp**2*MZ**2) - (cZh5**2*ee**2*Ma**2*MH**2*vev**2)/(falp**2*MZ**2) + (cZh5**2*ee**2*MH**4*vev**2)/(2.*falp**2*MZ**2) + (cZh5**2*ee**2*MZ**2*vev**2)/(2.*falp**2) - (cw**2*cZh5**2*ee**2*Ma**2*vev**2)/(2.*falp**2*sw**2) - (cw**2*cZh5**2*ee**2*MH**2*vev**2)/(2.*falp**2*sw**2) + (cw**2*cZh5**2*ee**2*Ma**4*vev**2)/(4.*falp**2*MZ**2*sw**2) - (cw**2*cZh5**2*ee**2*Ma**2*MH**2*vev**2)/(2.*falp**2*MZ**2*sw**2) + (cw**2*cZh5**2*ee**2*MH**4*vev**2)/(4.*falp**2*MZ**2*sw**2) + (cw**2*cZh5**2*ee**2*MZ**2*vev**2)/(4.*falp**2*sw**2) - (cZh5**2*ee**2*Ma**2*sw**2*vev**2)/(2.*cw**2*falp**2) - (cZh5**2*ee**2*MH**2*sw**2*vev**2)/(2.*cw**2*falp**2) + (cZh5**2*ee**2*Ma**4*sw**2*vev**2)/(4.*cw**2*falp**2*MZ**2) - (cZh5**2*ee**2*Ma**2*MH**2*sw**2*vev**2)/(2.*cw**2*falp**2*MZ**2) + (cZh5**2*ee**2*MH**4*sw**2*vev**2)/(4.*cw**2*falp**2*MZ**2) + (cZh5**2*ee**2*MZ**2*sw**2*vev**2)/(4.*cw**2*falp**2))*cmath.sqrt(Ma**4 - 2*Ma**2*MH**2 + MH**4 - 2*Ma**2*MZ**2 - 2*MH**2*MZ**2 + MZ**4))/(48.*cmath.pi*abs(MZ)**3)', + (P.b,P.b__tilde__):'((-7*ee**2*MB**2 + ee**2*MZ**2 - (3*cw**2*ee**2*MB**2)/(2.*sw**2) + (3*cw**2*ee**2*MZ**2)/(2.*sw**2) - (17*ee**2*MB**2*sw**2)/(6.*cw**2) + (5*ee**2*MZ**2*sw**2)/(6.*cw**2))*cmath.sqrt(-4*MB**2*MZ**2 + MZ**4))/(48.*cmath.pi*abs(MZ)**3)', + (P.c,P.c__tilde__):'((-11*ee**2*MC**2 - ee**2*MZ**2 - (3*cw**2*ee**2*MC**2)/(2.*sw**2) + (3*cw**2*ee**2*MZ**2)/(2.*sw**2) + (7*ee**2*MC**2*sw**2)/(6.*cw**2) + (17*ee**2*MZ**2*sw**2)/(6.*cw**2))*cmath.sqrt(-4*MC**2*MZ**2 + MZ**4))/(48.*cmath.pi*abs(MZ)**3)', + (P.d,P.d__tilde__):'((-7*ee**2*MD**2 + ee**2*MZ**2 - (3*cw**2*ee**2*MD**2)/(2.*sw**2) + (3*cw**2*ee**2*MZ**2)/(2.*sw**2) - (17*ee**2*MD**2*sw**2)/(6.*cw**2) + (5*ee**2*MZ**2*sw**2)/(6.*cw**2))*cmath.sqrt(-4*MD**2*MZ**2 + MZ**4))/(48.*cmath.pi*abs(MZ)**3)', + (P.e__minus__,P.e__plus__):'((-5*ee**2*Me**2 - ee**2*MZ**2 - (cw**2*ee**2*Me**2)/(2.*sw**2) + (cw**2*ee**2*MZ**2)/(2.*sw**2) + (7*ee**2*Me**2*sw**2)/(2.*cw**2) + (5*ee**2*MZ**2*sw**2)/(2.*cw**2))*cmath.sqrt(-4*Me**2*MZ**2 + MZ**4))/(48.*cmath.pi*abs(MZ)**3)', + (P.mu__minus__,P.mu__plus__):'((-5*ee**2*MMU**2 - ee**2*MZ**2 - (cw**2*ee**2*MMU**2)/(2.*sw**2) + (cw**2*ee**2*MZ**2)/(2.*sw**2) + (7*ee**2*MMU**2*sw**2)/(2.*cw**2) + (5*ee**2*MZ**2*sw**2)/(2.*cw**2))*cmath.sqrt(-4*MMU**2*MZ**2 + MZ**4))/(48.*cmath.pi*abs(MZ)**3)', + (P.s,P.s__tilde__):'((-7*ee**2*MS**2 + ee**2*MZ**2 - (3*cw**2*ee**2*MS**2)/(2.*sw**2) + (3*cw**2*ee**2*MZ**2)/(2.*sw**2) - (17*ee**2*MS**2*sw**2)/(6.*cw**2) + (5*ee**2*MZ**2*sw**2)/(6.*cw**2))*cmath.sqrt(-4*MS**2*MZ**2 + MZ**4))/(48.*cmath.pi*abs(MZ)**3)', + (P.t,P.t__tilde__):'((-11*ee**2*MT**2 - ee**2*MZ**2 - (3*cw**2*ee**2*MT**2)/(2.*sw**2) + (3*cw**2*ee**2*MZ**2)/(2.*sw**2) + (7*ee**2*MT**2*sw**2)/(6.*cw**2) + (17*ee**2*MZ**2*sw**2)/(6.*cw**2))*cmath.sqrt(-4*MT**2*MZ**2 + MZ**4))/(48.*cmath.pi*abs(MZ)**3)', + (P.ta__minus__,P.ta__plus__):'((-5*ee**2*MTA**2 - ee**2*MZ**2 - (cw**2*ee**2*MTA**2)/(2.*sw**2) + (cw**2*ee**2*MZ**2)/(2.*sw**2) + (7*ee**2*MTA**2*sw**2)/(2.*cw**2) + (5*ee**2*MZ**2*sw**2)/(2.*cw**2))*cmath.sqrt(-4*MTA**2*MZ**2 + MZ**4))/(48.*cmath.pi*abs(MZ)**3)', + (P.u,P.u__tilde__):'((-11*ee**2*MU**2 - ee**2*MZ**2 - (3*cw**2*ee**2*MU**2)/(2.*sw**2) + (3*cw**2*ee**2*MZ**2)/(2.*sw**2) + (7*ee**2*MU**2*sw**2)/(6.*cw**2) + (17*ee**2*MZ**2*sw**2)/(6.*cw**2))*cmath.sqrt(-4*MU**2*MZ**2 + MZ**4))/(48.*cmath.pi*abs(MZ)**3)', + (P.ve,P.ve__tilde__):'(MZ**2*(ee**2*MZ**2 + (cw**2*ee**2*MZ**2)/(2.*sw**2) + (ee**2*MZ**2*sw**2)/(2.*cw**2)))/(48.*cmath.pi*abs(MZ)**3)', + (P.vm,P.vm__tilde__):'(MZ**2*(ee**2*MZ**2 + (cw**2*ee**2*MZ**2)/(2.*sw**2) + (ee**2*MZ**2*sw**2)/(2.*cw**2)))/(48.*cmath.pi*abs(MZ)**3)', + (P.vt,P.vt__tilde__):'(MZ**2*(ee**2*MZ**2 + (cw**2*ee**2*MZ**2)/(2.*sw**2) + (ee**2*MZ**2*sw**2)/(2.*cw**2)))/(48.*cmath.pi*abs(MZ)**3)', + (P.W__minus__,P.W__plus__):'(((-12*cw**2*ee**2*MW**2)/sw**2 - (17*cw**2*ee**2*MZ**2)/sw**2 + (4*cw**2*ee**2*MZ**4)/(MW**2*sw**2) + (cw**2*ee**2*MZ**6)/(4.*MW**4*sw**2))*cmath.sqrt(-4*MW**2*MZ**2 + MZ**4))/(48.*cmath.pi*abs(MZ)**3)'}) + diff --git a/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/function_library.py b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/function_library.py new file mode 100644 index 0000000000..c96d23f8b6 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/function_library.py @@ -0,0 +1,71 @@ +# This file is part of the UFO. +# +# This file contains definitions for functions that +# are extensions of the cmath library, and correspond +# either to functions that are in cmath, but inconvenient +# to access from there (e.g. z.conjugate()), +# or functions that are simply not defined. +# +# + +__date__ = "22 July 2010" +__author__ = "claude.duhr@durham.ac.uk" + +import cmath +from object_library import all_functions, Function + +# +# shortcuts for functions from cmath +# + +complexconjugate = Function(name = 'complexconjugate', + arguments = ('z',), + expression = 'z.conjugate()') + + +re = Function(name = 're', + arguments = ('z',), + expression = 'z.real') + +im = Function(name = 'im', + arguments = ('z',), + expression = 'z.imag') + +# New functions (trigonometric) + +sec = Function(name = 'sec', + arguments = ('z',), + expression = '1./cmath.cos(z.real)') + +asec = Function(name = 'asec', + arguments = ('z',), + expression = 'cmath.acos(1./(z.real))') + +csc = Function(name = 'csc', + arguments = ('z',), + expression = '1./cmath.sin(z.real)') + +acsc = Function(name = 'acsc', + arguments = ('z',), + expression = 'cmath.asin(1./(z.real))') + +cot = Function(name = 'cot', + arguments = ('z',), + expression = '1./cmath.tan(z.real)') + +# Heaviside theta function + +theta_function = Function(name = 'theta_function', + arguments = ('x','y','z'), + expression = 'y if x else z') + +# Auxiliary functions for NLO + +cond = Function(name = 'cond', + arguments = ('condition','ExprTrue','ExprFalse'), + expression = '(ExprTrue if condition==0.0 else ExprFalse)') + +reglog = Function(name = 'reglog', + arguments = ('z'), + expression = '(0.0 if z==0.0 else cmath.log(z.real))') + diff --git a/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/lorentz.py b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/lorentz.py new file mode 100644 index 0000000000..2e591a6f12 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/lorentz.py @@ -0,0 +1,110 @@ +# This file was automatically created by FeynRules 2.3.43 +# Mathematica version: 12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020) +# Date: Mon 19 Apr 2021 15:23:43 + + +from object_library import all_lorentz, Lorentz + +from function_library import complexconjugate, re, im, csc, sec, acsc, asec, cot +try: + import form_factors as ForFac +except ImportError: + pass + + +UUV1 = Lorentz(name = 'UUV1', + spins = [ -1, -1, 3 ], + structure = 'P(3,2) + P(3,3)') + +SSS1 = Lorentz(name = 'SSS1', + spins = [ 1, 1, 1 ], + structure = '1') + +SSS2 = Lorentz(name = 'SSS2', + spins = [ 1, 1, 1 ], + structure = 'P(-1,1)*P(-1,2)') + +FFS1 = Lorentz(name = 'FFS1', + spins = [ 2, 2, 1 ], + structure = 'P(-1,3)*Gamma5(-2,1)*Gamma(-1,2,-2)') + +FFS2 = Lorentz(name = 'FFS2', + spins = [ 2, 2, 1 ], + structure = 'ProjM(2,1) + ProjP(2,1)') + +FFV1 = Lorentz(name = 'FFV1', + spins = [ 2, 2, 3 ], + structure = 'Gamma(3,2,1)') + +FFV2 = Lorentz(name = 'FFV2', + spins = [ 2, 2, 3 ], + structure = 'Gamma(3,2,-1)*ProjM(-1,1)') + +FFV3 = Lorentz(name = 'FFV3', + spins = [ 2, 2, 3 ], + structure = 'Gamma(3,2,-1)*ProjP(-1,1)') + +VSS1 = Lorentz(name = 'VSS1', + spins = [ 3, 1, 1 ], + structure = 'P(1,2)') + +VVS1 = Lorentz(name = 'VVS1', + spins = [ 3, 3, 1 ], + structure = '-4*Epsilon(1,2,-1,-2)*P(-2,2)*P(-1,1) + 4*Epsilon(1,2,-1,-2)*P(-2,1)*P(-1,2)') + +VVS2 = Lorentz(name = 'VVS2', + spins = [ 3, 3, 1 ], + structure = '-(Epsilon(1,2,-1,-2)*P(-2,2)*P(-1,1)) + Epsilon(1,2,-1,-2)*P(-2,1)*P(-1,2)') + +VVS3 = Lorentz(name = 'VVS3', + spins = [ 3, 3, 1 ], + structure = 'Metric(1,2)') + +VVV1 = Lorentz(name = 'VVV1', + spins = [ 3, 3, 3 ], + structure = 'P(3,1)*Metric(1,2) - P(3,2)*Metric(1,2) - P(2,1)*Metric(1,3) + P(2,3)*Metric(1,3) + P(1,2)*Metric(2,3) - P(1,3)*Metric(2,3)') + +SSSS1 = Lorentz(name = 'SSSS1', + spins = [ 1, 1, 1, 1 ], + structure = '1') + +SSSS2 = Lorentz(name = 'SSSS2', + spins = [ 1, 1, 1, 1 ], + structure = 'P(-1,1)*P(-1,2)') + +VSSS1 = Lorentz(name = 'VSSS1', + spins = [ 3, 1, 1, 1 ], + structure = 'P(1,2)') + +VVSS1 = Lorentz(name = 'VVSS1', + spins = [ 3, 3, 1, 1 ], + structure = 'Metric(1,2)') + +VVVS1 = Lorentz(name = 'VVVS1', + spins = [ 3, 3, 3, 1 ], + structure = '-(Epsilon(1,2,3,-1)*P(-1,1)) - Epsilon(1,2,3,-1)*P(-1,2) - Epsilon(1,2,3,-1)*P(-1,3)') + +VVVS2 = Lorentz(name = 'VVVS2', + spins = [ 3, 3, 3, 1 ], + structure = '-4*Epsilon(1,2,3,-1)*P(-1,1) - 4*Epsilon(1,2,3,-1)*P(-1,2) - 4*Epsilon(1,2,3,-1)*P(-1,3)') + +VVVV1 = Lorentz(name = 'VVVV1', + spins = [ 3, 3, 3, 3 ], + structure = 'Metric(1,4)*Metric(2,3) - Metric(1,3)*Metric(2,4)') + +VVVV2 = Lorentz(name = 'VVVV2', + spins = [ 3, 3, 3, 3 ], + structure = 'Metric(1,4)*Metric(2,3) + Metric(1,3)*Metric(2,4) - 2*Metric(1,2)*Metric(3,4)') + +VVVV3 = Lorentz(name = 'VVVV3', + spins = [ 3, 3, 3, 3 ], + structure = 'Metric(1,4)*Metric(2,3) - Metric(1,2)*Metric(3,4)') + +VVVV4 = Lorentz(name = 'VVVV4', + spins = [ 3, 3, 3, 3 ], + structure = 'Metric(1,3)*Metric(2,4) - Metric(1,2)*Metric(3,4)') + +VVVV5 = Lorentz(name = 'VVVV5', + spins = [ 3, 3, 3, 3 ], + structure = 'Metric(1,4)*Metric(2,3) - (Metric(1,3)*Metric(2,4))/2. - (Metric(1,2)*Metric(3,4))/2.') + diff --git a/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/object_library.py b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/object_library.py new file mode 100644 index 0000000000..c196c695c6 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/object_library.py @@ -0,0 +1,373 @@ +## +## +## Feynrules Header +## +## +## +## +## + +import cmath +import re + +class UFOError(Exception): + """Exception raised if when inconsistencies are detected in the UFO model.""" + pass + +class UFOBaseClass(object): + """The class from which all FeynRules classes are derived.""" + + require_args = [] + + def __init__(self, *args, **options): + assert(len(self.require_args) == len (args)) + + for i, name in enumerate(self.require_args): + setattr(self, name, args[i]) + + for (option, value) in options.items(): + setattr(self, option, value) + + def get(self, name): + return getattr(self, name) + + def set(self, name, value): + setattr(self, name, value) + + def get_all(self): + """Return a dictionary containing all the information of the object""" + return self.__dict__ + + def __str__(self): + return self.name + + def nice_string(self): + """ return string with the full information """ + return '\n'.join(['%s \t: %s' %(name, value) for name, value in self.__dict__.items()]) + + def __repr__(self): + replacements = [ + ('+','__plus__'), + ('-','__minus__'), + ('@','__at__'), + ('!','__exclam__'), + ('?','__quest__'), + ('*','__star__'), + ('~','__tilde__') + ] + text = self.name + for orig,sub in replacements: + text = text.replace(orig,sub) + return text + + + +all_particles = [] + +class Particle(UFOBaseClass): + """A standard Particle""" + + require_args=['pdg_code', 'name', 'antiname', 'spin', 'color', 'mass', 'width', 'texname', 'antitexname', 'charge'] + + require_args_all = ['pdg_code', 'name', 'antiname', 'spin', 'color', 'mass', 'width', 'texname', 'antitexname','counterterm','charge', 'line', 'propagating', 'goldstoneboson', 'propagator'] + + def __init__(self, pdg_code, name, antiname, spin, color, mass, width, texname, + antitexname, charge , line=None, propagating=True, counterterm=None, goldstoneboson=False, + propagator=None, **options): + + args= (pdg_code, name, antiname, spin, color, mass, width, texname, + antitexname, float(charge)) + + UFOBaseClass.__init__(self, *args, **options) + + global all_particles + all_particles.append(self) + + self.propagating = propagating + self.goldstoneboson= goldstoneboson + + self.selfconjugate = (name == antiname) + if not line: + self.line = self.find_line_type() + else: + self.line = line + + if propagator: + if isinstance(propagator, dict): + self.propagator = propagator + else: + self.propagator = {0: propagator, 1: propagator} + + def find_line_type(self): + """ find how we draw a line if not defined + valid output: dashed/straight/wavy/curly/double/swavy/scurly + """ + + spin = self.spin + color = self.color + + #use default + if spin == 1: + return 'dashed' + elif spin == 2: + if not self.selfconjugate: + return 'straight' + elif color == 1: + return 'swavy' + else: + return 'scurly' + elif spin == 3: + if color == 1: + return 'wavy' + + else: + return 'curly' + elif spin == 5: + return 'double' + elif spin == -1: + return 'dotted' + else: + return 'dashed' # not supported yet + + def anti(self): + if self.selfconjugate: + raise Exception('%s has no anti particle.' % self.name) + outdic = {} + for k,v in self.__dict__.items(): + if k not in self.require_args_all: + outdic[k] = -v + if self.color in [1,8]: + newcolor = self.color + else: + newcolor = -self.color + + return Particle(-self.pdg_code, self.antiname, self.name, self.spin, newcolor, self.mass, self.width, + self.antitexname, self.texname, -self.charge, self.line, self.propagating, self.goldstoneboson, **outdic) + + + +all_parameters = [] + +class Parameter(UFOBaseClass): + + require_args=['name', 'nature', 'type', 'value', 'texname'] + + def __init__(self, name, nature, type, value, texname, lhablock=None, lhacode=None): + + args = (name,nature,type,value,texname) + + UFOBaseClass.__init__(self, *args) + + args=(name,nature,type,value,texname) + + global all_parameters + all_parameters.append(self) + + if (lhablock is None or lhacode is None) and nature == 'external': + raise Exception('Need LHA information for external parameter "%s".' % name) + self.lhablock = lhablock + self.lhacode = lhacode + +all_CTparameters = [] + +class CTParameter(UFOBaseClass): + + require_args=['name', 'type', 'value', 'texname'] + + def __init__(self, name, type, value, texname): + + args = (name,type,value,texname) + + UFOBaseClass.__init__(self, *args) + + global all_CTparameters + all_CTparameters.append(self) + + def finite(self): + try: + return self.value[0] + except KeyError: + return 'ZERO' + + def pole(self, x): + try: + return self.value[-x] + except KeyError: + return 'ZERO' + +all_vertices = [] + +class Vertex(UFOBaseClass): + + require_args=['name', 'particles', 'color', 'lorentz', 'couplings'] + + def __init__(self, name, particles, color, lorentz, couplings, **opt): + + args = (name, particles, color, lorentz, couplings) + + UFOBaseClass.__init__(self, *args, **opt) + + args=(particles,color,lorentz,couplings) + + global all_vertices + all_vertices.append(self) + +all_CTvertices = [] + +class CTVertex(UFOBaseClass): + + require_args=['name', 'particles', 'color', 'lorentz', 'couplings', 'type', 'loop_particles'] + + def __init__(self, name, particles, color, lorentz, couplings, type, loop_particles, **opt): + + args = (name, particles, color, lorentz, couplings, type, loop_particles) + + UFOBaseClass.__init__(self, *args, **opt) + + args=(particles,color,lorentz,couplings, type, loop_particles) + + global all_CTvertices + all_CTvertices.append(self) + +all_couplings = [] + +class Coupling(UFOBaseClass): + + require_args=['name', 'value', 'order'] + + require_args_all=['name', 'value', 'order', 'loop_particles', 'counterterm'] + + def __init__(self, name, value, order, **opt): + + args =(name, value, order) + UFOBaseClass.__init__(self, *args, **opt) + global all_couplings + all_couplings.append(self) + + def value(self): + return self.pole(0) + + def pole(self, x): + """ the self.value attribute can be a dictionary directly specifying the Laurent serie using normal + parameter or just a string which can possibly contain CTparameter defining the Laurent serie.""" + + if isinstance(self.value,dict): + if -x in self.value.keys(): + return self.value[-x] + else: + return 'ZERO' + + CTparam=None + for param in all_CTparameters: + pattern=re.compile(r"(?P\A|\*|\+|\-|\()(?P"+param.name+r")(?P\Z|\*|\+|\-|\))") + numberOfMatches=len(pattern.findall(self.value)) + if numberOfMatches==1: + if not CTparam: + CTparam=param + else: + raise UFOError, "UFO does not support yet more than one occurence of CTParameters in the couplings values." + elif numberOfMatches>1: + raise UFOError, "UFO does not support yet more than one occurence of CTParameters in the couplings values." + + if not CTparam: + if x==0: + return self.value + else: + return 'ZERO' + else: + if CTparam.pole(x)=='ZERO': + return 'ZERO' + else: + def substitution(matchedObj): + return matchedObj.group('first')+"("+CTparam.pole(x)+")"+matchedObj.group('second') + pattern=re.compile(r"(?P\A|\*|\+|\-|\()(?P"+CTparam.name+r")(?P\Z|\*|\+|\-|\))") + return pattern.sub(substitution,self.value) + +all_lorentz = [] + +class Lorentz(UFOBaseClass): + + require_args=['name','spins','structure'] + + def __init__(self, name, spins, structure='external', **opt): + args = (name, spins, structure) + UFOBaseClass.__init__(self, *args, **opt) + + global all_lorentz + all_lorentz.append(self) + + +all_functions = [] + +class Function(object): + + def __init__(self, name, arguments, expression): + + global all_functions + all_functions.append(self) + + self.name = name + self.arguments = arguments + self.expr = expression + + def __call__(self, *opt): + + for i, arg in enumerate(self.arguments): + exec('%s = %s' % (arg, opt[i] )) + + return eval(self.expr) + +all_orders = [] + +class CouplingOrder(object): + + def __init__(self, name, expansion_order, hierarchy, perturbative_expansion = 0): + + global all_orders + all_orders.append(self) + + self.name = name + self.expansion_order = expansion_order + self.hierarchy = hierarchy + self.perturbative_expansion = perturbative_expansion + +all_decays = [] + +class Decay(UFOBaseClass): + require_args = ['particle','partial_widths'] + + def __init__(self, particle, partial_widths, **opt): + args = (particle, partial_widths) + UFOBaseClass.__init__(self, *args, **opt) + + global all_decays + all_decays.append(self) + + # Add the information directly to the particle + particle.partial_widths = partial_widths + +all_form_factors = [] + +class FormFactor(UFOBaseClass): + require_args = ['name','type','value'] + + def __init__(self, name, type, value, **opt): + args = (name, type, value) + UFOBaseClass.__init__(self, *args, **opt) + + global all_form_factors + all_form_factors.append(self) + + +all_propagators = [] + +class Propagator(UFOBaseClass): + + require_args = ['name','numerator','denominator'] + + def __init__(self, name, numerator, denominator=None, **opt): + args = (name, numerator, denominator) + UFOBaseClass.__init__(self, *args, **opt) + + global all_propagators + all_propagators.append(self) diff --git a/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/parameters.py b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/parameters.py new file mode 100644 index 0000000000..b32500f710 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/parameters.py @@ -0,0 +1,559 @@ +# This file was automatically created by FeynRules 2.3.43 +# Mathematica version: 12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020) +# Date: Mon 19 Apr 2021 15:23:42 + + + +from object_library import all_parameters, Parameter + + +from function_library import complexconjugate, re, im, csc, sec, acsc, asec, cot + +# This is a default parameter object representing 0. +ZERO = Parameter(name = 'ZERO', + nature = 'internal', + type = 'real', + value = '0.0', + texname = '0') + +# User-defined parameters. +falp = Parameter(name = 'falp', + nature = 'external', + type = 'real', + value = 1000, + texname = '\\text{falp}', + lhablock = 'ALPPARAMS', + lhacode = [ 1 ]) + +cbb = Parameter(name = 'cbb', + nature = 'external', + type = 'real', + value = 1., + texname = '\\text{cbb}', + lhablock = 'ALPPARAMS', + lhacode = [ 2 ]) + +ctt = Parameter(name = 'ctt', + nature = 'external', + type = 'real', + value = 1., + texname = '\\text{ctt}', + lhablock = 'ALPPARAMS', + lhacode = [ 3 ]) + +css = Parameter(name = 'css', + nature = 'external', + type = 'real', + value = 1., + texname = '\\text{css}', + lhablock = 'ALPPARAMS', + lhacode = [ 4 ]) + +ccc = Parameter(name = 'ccc', + nature = 'external', + type = 'real', + value = 1., + texname = '\\text{ccc}', + lhablock = 'ALPPARAMS', + lhacode = [ 5 ]) + +cdd = Parameter(name = 'cdd', + nature = 'external', + type = 'real', + value = 1., + texname = '\\text{cdd}', + lhablock = 'ALPPARAMS', + lhacode = [ 6 ]) + +cuu = Parameter(name = 'cuu', + nature = 'external', + type = 'real', + value = 1., + texname = '\\text{cuu}', + lhablock = 'ALPPARAMS', + lhacode = [ 7 ]) + +ctautau = Parameter(name = 'ctautau', + nature = 'external', + type = 'real', + value = 1., + texname = '\\text{ctautau}', + lhablock = 'ALPPARAMS', + lhacode = [ 8 ]) + +cmumu = Parameter(name = 'cmumu', + nature = 'external', + type = 'real', + value = 1., + texname = '\\text{cmumu}', + lhablock = 'ALPPARAMS', + lhacode = [ 9 ]) + +cee = Parameter(name = 'cee', + nature = 'external', + type = 'real', + value = 1., + texname = '\\text{cee}', + lhablock = 'ALPPARAMS', + lhacode = [ 10 ]) + +cah = Parameter(name = 'cah', + nature = 'external', + type = 'real', + value = 0., + texname = '\\text{cah}', + lhablock = 'ALPPARAMS', + lhacode = [ 11 ]) + +cZh5 = Parameter(name = 'cZh5', + nature = 'external', + type = 'real', + value = 0., + texname = '\\text{cZh5}', + lhablock = 'ALPPARAMS', + lhacode = [ 12 ]) + +cWW = Parameter(name = 'cWW', + nature = 'external', + type = 'real', + value = 1., + texname = '\\text{cWW}', + lhablock = 'ALPPARAMS', + lhacode = [ 13 ]) + +cYY = Parameter(name = 'cYY', + nature = 'external', + type = 'real', + value = 1., + texname = '\\text{cYY}', + lhablock = 'ALPPARAMS', + lhacode = [ 14 ]) + +cGG = Parameter(name = 'cGG', + nature = 'external', + type = 'real', + value = 1., + texname = '\\text{cGG}', + lhablock = 'ALPPARAMS', + lhacode = [ 15 ]) + +cabi = Parameter(name = 'cabi', + nature = 'external', + type = 'real', + value = 0.227736, + texname = '\\theta _c', + lhablock = 'CKMBLOCK', + lhacode = [ 1 ]) + +aEWM1 = Parameter(name = 'aEWM1', + nature = 'external', + type = 'real', + value = 127.9, + texname = '\\text{aEWM1}', + lhablock = 'SMINPUTS', + lhacode = [ 1 ]) + +Gf = Parameter(name = 'Gf', + nature = 'external', + type = 'real', + value = 0.0000116637, + texname = 'G_f', + lhablock = 'SMINPUTS', + lhacode = [ 2 ]) + +aS = Parameter(name = 'aS', + nature = 'external', + type = 'real', + value = 0.1184, + texname = '\\alpha _s', + lhablock = 'SMINPUTS', + lhacode = [ 3 ]) + +ymdo = Parameter(name = 'ymdo', + nature = 'external', + type = 'real', + value = 0.00504, + texname = '\\text{ymdo}', + lhablock = 'YUKAWA', + lhacode = [ 1 ]) + +ymup = Parameter(name = 'ymup', + nature = 'external', + type = 'real', + value = 0.00255, + texname = '\\text{ymup}', + lhablock = 'YUKAWA', + lhacode = [ 2 ]) + +yms = Parameter(name = 'yms', + nature = 'external', + type = 'real', + value = 0.101, + texname = '\\text{yms}', + lhablock = 'YUKAWA', + lhacode = [ 3 ]) + +ymc = Parameter(name = 'ymc', + nature = 'external', + type = 'real', + value = 1.27, + texname = '\\text{ymc}', + lhablock = 'YUKAWA', + lhacode = [ 4 ]) + +ymb = Parameter(name = 'ymb', + nature = 'external', + type = 'real', + value = 4.7, + texname = '\\text{ymb}', + lhablock = 'YUKAWA', + lhacode = [ 5 ]) + +ymt = Parameter(name = 'ymt', + nature = 'external', + type = 'real', + value = 172, + texname = '\\text{ymt}', + lhablock = 'YUKAWA', + lhacode = [ 6 ]) + +yme = Parameter(name = 'yme', + nature = 'external', + type = 'real', + value = 0.000511, + texname = '\\text{yme}', + lhablock = 'YUKAWA', + lhacode = [ 11 ]) + +ymm = Parameter(name = 'ymm', + nature = 'external', + type = 'real', + value = 0.10566, + texname = '\\text{ymm}', + lhablock = 'YUKAWA', + lhacode = [ 13 ]) + +ymtau = Parameter(name = 'ymtau', + nature = 'external', + type = 'real', + value = 1.777, + texname = '\\text{ymtau}', + lhablock = 'YUKAWA', + lhacode = [ 15 ]) + +MZ = Parameter(name = 'MZ', + nature = 'external', + type = 'real', + value = 91.1876, + texname = '\\text{MZ}', + lhablock = 'MASS', + lhacode = [ 23 ]) + +Me = Parameter(name = 'Me', + nature = 'external', + type = 'real', + value = 0.000511, + texname = '\\text{Me}', + lhablock = 'MASS', + lhacode = [ 11 ]) + +MMU = Parameter(name = 'MMU', + nature = 'external', + type = 'real', + value = 0.10566, + texname = '\\text{MMU}', + lhablock = 'MASS', + lhacode = [ 13 ]) + +MTA = Parameter(name = 'MTA', + nature = 'external', + type = 'real', + value = 1.777, + texname = '\\text{MTA}', + lhablock = 'MASS', + lhacode = [ 15 ]) + +MU = Parameter(name = 'MU', + nature = 'external', + type = 'real', + value = 0.00255, + texname = 'M', + lhablock = 'MASS', + lhacode = [ 2 ]) + +MC = Parameter(name = 'MC', + nature = 'external', + type = 'real', + value = 1.27, + texname = '\\text{MC}', + lhablock = 'MASS', + lhacode = [ 4 ]) + +MT = Parameter(name = 'MT', + nature = 'external', + type = 'real', + value = 172, + texname = '\\text{MT}', + lhablock = 'MASS', + lhacode = [ 6 ]) + +MD = Parameter(name = 'MD', + nature = 'external', + type = 'real', + value = 0.00504, + texname = '\\text{MD}', + lhablock = 'MASS', + lhacode = [ 1 ]) + +MS = Parameter(name = 'MS', + nature = 'external', + type = 'real', + value = 0.101, + texname = '\\text{MS}', + lhablock = 'MASS', + lhacode = [ 3 ]) + +MB = Parameter(name = 'MB', + nature = 'external', + type = 'real', + value = 4.7, + texname = '\\text{MB}', + lhablock = 'MASS', + lhacode = [ 5 ]) + +MH = Parameter(name = 'MH', + nature = 'external', + type = 'real', + value = 125, + texname = '\\text{MH}', + lhablock = 'MASS', + lhacode = [ 25 ]) + +Ma = Parameter(name = 'Ma', + nature = 'external', + type = 'real', + value = 1., + texname = '\\text{Ma}', + lhablock = 'MASS', + lhacode = [ 9000005 ]) + +WZ = Parameter(name = 'WZ', + nature = 'external', + type = 'real', + value = 2.4952, + texname = '\\text{WZ}', + lhablock = 'DECAY', + lhacode = [ 23 ]) + +WW = Parameter(name = 'WW', + nature = 'external', + type = 'real', + value = 2.085, + texname = '\\text{WW}', + lhablock = 'DECAY', + lhacode = [ 24 ]) + +WT = Parameter(name = 'WT', + nature = 'external', + type = 'real', + value = 1.50833649, + texname = '\\text{WT}', + lhablock = 'DECAY', + lhacode = [ 6 ]) + +WH = Parameter(name = 'WH', + nature = 'external', + type = 'real', + value = 0.00407, + texname = '\\text{WH}', + lhablock = 'DECAY', + lhacode = [ 25 ]) + +WALP = Parameter(name = 'WALP', + nature = 'external', + type = 'real', + value = 1, + texname = '\\text{WALP}', + lhablock = 'DECAY', + lhacode = [ 9000005 ]) + +aEW = Parameter(name = 'aEW', + nature = 'internal', + type = 'real', + value = '1/aEWM1', + texname = '\\alpha _{\\text{EW}}') + +G = Parameter(name = 'G', + nature = 'internal', + type = 'real', + value = '2*cmath.sqrt(aS)*cmath.sqrt(cmath.pi)', + texname = 'G') + +CKM1x1 = Parameter(name = 'CKM1x1', + nature = 'internal', + type = 'complex', + value = 'cmath.cos(cabi)', + texname = '\\text{CKM1x1}') + +CKM1x2 = Parameter(name = 'CKM1x2', + nature = 'internal', + type = 'complex', + value = 'cmath.sin(cabi)', + texname = '\\text{CKM1x2}') + +CKM1x3 = Parameter(name = 'CKM1x3', + nature = 'internal', + type = 'complex', + value = '0', + texname = '\\text{CKM1x3}') + +CKM2x1 = Parameter(name = 'CKM2x1', + nature = 'internal', + type = 'complex', + value = '-cmath.sin(cabi)', + texname = '\\text{CKM2x1}') + +CKM2x2 = Parameter(name = 'CKM2x2', + nature = 'internal', + type = 'complex', + value = 'cmath.cos(cabi)', + texname = '\\text{CKM2x2}') + +CKM2x3 = Parameter(name = 'CKM2x3', + nature = 'internal', + type = 'complex', + value = '0', + texname = '\\text{CKM2x3}') + +CKM3x1 = Parameter(name = 'CKM3x1', + nature = 'internal', + type = 'complex', + value = '0', + texname = '\\text{CKM3x1}') + +CKM3x2 = Parameter(name = 'CKM3x2', + nature = 'internal', + type = 'complex', + value = '0', + texname = '\\text{CKM3x2}') + +CKM3x3 = Parameter(name = 'CKM3x3', + nature = 'internal', + type = 'complex', + value = '1', + texname = '\\text{CKM3x3}') + +MW = Parameter(name = 'MW', + nature = 'internal', + type = 'real', + value = 'cmath.sqrt(MZ**2/2. + cmath.sqrt(MZ**4/4. - (aEW*cmath.pi*MZ**2)/(Gf*cmath.sqrt(2))))', + texname = 'M_W') + +ee = Parameter(name = 'ee', + nature = 'internal', + type = 'real', + value = '2*cmath.sqrt(aEW)*cmath.sqrt(cmath.pi)', + texname = 'e') + +sw2 = Parameter(name = 'sw2', + nature = 'internal', + type = 'real', + value = '1 - MW**2/MZ**2', + texname = '\\text{sw2}') + +cw = Parameter(name = 'cw', + nature = 'internal', + type = 'real', + value = 'cmath.sqrt(1 - sw2)', + texname = 'c_w') + +sw = Parameter(name = 'sw', + nature = 'internal', + type = 'real', + value = 'cmath.sqrt(sw2)', + texname = 's_w') + +g1 = Parameter(name = 'g1', + nature = 'internal', + type = 'real', + value = 'ee/cw', + texname = 'g_1') + +gw = Parameter(name = 'gw', + nature = 'internal', + type = 'real', + value = 'ee/sw', + texname = 'g_w') + +vev = Parameter(name = 'vev', + nature = 'internal', + type = 'real', + value = '(2*MW*sw)/ee', + texname = '\\text{vev}') + +lam = Parameter(name = 'lam', + nature = 'internal', + type = 'real', + value = 'MH**2/(2.*vev**2)', + texname = '\\text{lam}') + +yb = Parameter(name = 'yb', + nature = 'internal', + type = 'real', + value = '(ymb*cmath.sqrt(2))/vev', + texname = '\\text{yb}') + +yc = Parameter(name = 'yc', + nature = 'internal', + type = 'real', + value = '(ymc*cmath.sqrt(2))/vev', + texname = '\\text{yc}') + +ydo = Parameter(name = 'ydo', + nature = 'internal', + type = 'real', + value = '(ymdo*cmath.sqrt(2))/vev', + texname = '\\text{ydo}') + +ye = Parameter(name = 'ye', + nature = 'internal', + type = 'real', + value = '(yme*cmath.sqrt(2))/vev', + texname = '\\text{ye}') + +ym = Parameter(name = 'ym', + nature = 'internal', + type = 'real', + value = '(ymm*cmath.sqrt(2))/vev', + texname = '\\text{ym}') + +ys = Parameter(name = 'ys', + nature = 'internal', + type = 'real', + value = '(yms*cmath.sqrt(2))/vev', + texname = '\\text{ys}') + +yt = Parameter(name = 'yt', + nature = 'internal', + type = 'real', + value = '(ymt*cmath.sqrt(2))/vev', + texname = '\\text{yt}') + +ytau = Parameter(name = 'ytau', + nature = 'internal', + type = 'real', + value = '(ymtau*cmath.sqrt(2))/vev', + texname = '\\text{ytau}') + +yup = Parameter(name = 'yup', + nature = 'internal', + type = 'real', + value = '(ymup*cmath.sqrt(2))/vev', + texname = '\\text{yup}') + +muH = Parameter(name = 'muH', + nature = 'internal', + type = 'real', + value = 'cmath.sqrt(lam*vev**2)', + texname = '\\mu') + diff --git a/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/particles.py b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/particles.py new file mode 100644 index 0000000000..62aafd1fb7 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/particles.py @@ -0,0 +1,401 @@ +# This file was automatically created by FeynRules 2.3.43 +# Mathematica version: 12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020) +# Date: Mon 19 Apr 2021 15:23:42 + + +from __future__ import division +from object_library import all_particles, Particle +import parameters as Param + +import propagators as Prop + +a = Particle(pdg_code = 22, + name = 'a', + antiname = 'a', + spin = 3, + color = 1, + mass = Param.ZERO, + width = Param.ZERO, + texname = 'a', + antitexname = 'a', + charge = 0, + GhostNumber = 0, + LeptonNumber = 0, + Y = 0) + +Z = Particle(pdg_code = 23, + name = 'Z', + antiname = 'Z', + spin = 3, + color = 1, + mass = Param.MZ, + width = Param.WZ, + texname = 'Z', + antitexname = 'Z', + charge = 0, + GhostNumber = 0, + LeptonNumber = 0, + Y = 0) + +W__plus__ = Particle(pdg_code = 24, + name = 'W+', + antiname = 'W-', + spin = 3, + color = 1, + mass = Param.MW, + width = Param.WW, + texname = 'W+', + antitexname = 'W-', + charge = 1, + GhostNumber = 0, + LeptonNumber = 0, + Y = 0) + +W__minus__ = W__plus__.anti() + +g = Particle(pdg_code = 21, + name = 'g', + antiname = 'g', + spin = 3, + color = 8, + mass = Param.ZERO, + width = Param.ZERO, + texname = 'g', + antitexname = 'g', + charge = 0, + GhostNumber = 0, + LeptonNumber = 0, + Y = 0) + +ghA = Particle(pdg_code = 9000001, + name = 'ghA', + antiname = 'ghA~', + spin = -1, + color = 1, + mass = Param.ZERO, + width = Param.ZERO, + texname = 'ghA', + antitexname = 'ghA~', + charge = 0, + GhostNumber = 1, + LeptonNumber = 0, + Y = 0) + +ghA__tilde__ = ghA.anti() + +ghZ = Particle(pdg_code = 9000002, + name = 'ghZ', + antiname = 'ghZ~', + spin = -1, + color = 1, + mass = Param.MZ, + width = Param.WZ, + texname = 'ghZ', + antitexname = 'ghZ~', + charge = 0, + GhostNumber = 1, + LeptonNumber = 0, + Y = 0) + +ghZ__tilde__ = ghZ.anti() + +ghWp = Particle(pdg_code = 9000003, + name = 'ghWp', + antiname = 'ghWp~', + spin = -1, + color = 1, + mass = Param.MW, + width = Param.WW, + texname = 'ghWp', + antitexname = 'ghWp~', + charge = 1, + GhostNumber = 1, + LeptonNumber = 0, + Y = 0) + +ghWp__tilde__ = ghWp.anti() + +ghWm = Particle(pdg_code = 9000004, + name = 'ghWm', + antiname = 'ghWm~', + spin = -1, + color = 1, + mass = Param.MW, + width = Param.WW, + texname = 'ghWm', + antitexname = 'ghWm~', + charge = -1, + GhostNumber = 1, + LeptonNumber = 0, + Y = 0) + +ghWm__tilde__ = ghWm.anti() + +ghG = Particle(pdg_code = 82, + name = 'ghG', + antiname = 'ghG~', + spin = -1, + color = 8, + mass = Param.ZERO, + width = Param.ZERO, + texname = 'ghG', + antitexname = 'ghG~', + charge = 0, + GhostNumber = 1, + LeptonNumber = 0, + Y = 0) + +ghG__tilde__ = ghG.anti() + +ve = Particle(pdg_code = 12, + name = 've', + antiname = 've~', + spin = 2, + color = 1, + mass = Param.ZERO, + width = Param.ZERO, + texname = 've', + antitexname = 've~', + charge = 0, + GhostNumber = 0, + LeptonNumber = 1, + Y = 0) + +ve__tilde__ = ve.anti() + +vm = Particle(pdg_code = 14, + name = 'vm', + antiname = 'vm~', + spin = 2, + color = 1, + mass = Param.ZERO, + width = Param.ZERO, + texname = 'vm', + antitexname = 'vm~', + charge = 0, + GhostNumber = 0, + LeptonNumber = 1, + Y = 0) + +vm__tilde__ = vm.anti() + +vt = Particle(pdg_code = 16, + name = 'vt', + antiname = 'vt~', + spin = 2, + color = 1, + mass = Param.ZERO, + width = Param.ZERO, + texname = 'vt', + antitexname = 'vt~', + charge = 0, + GhostNumber = 0, + LeptonNumber = 1, + Y = 0) + +vt__tilde__ = vt.anti() + +e__minus__ = Particle(pdg_code = 11, + name = 'e-', + antiname = 'e+', + spin = 2, + color = 1, + mass = Param.Me, + width = Param.ZERO, + texname = 'e-', + antitexname = 'e+', + charge = -1, + GhostNumber = 0, + LeptonNumber = 1, + Y = 0) + +e__plus__ = e__minus__.anti() + +mu__minus__ = Particle(pdg_code = 13, + name = 'mu-', + antiname = 'mu+', + spin = 2, + color = 1, + mass = Param.MMU, + width = Param.ZERO, + texname = 'mu-', + antitexname = 'mu+', + charge = -1, + GhostNumber = 0, + LeptonNumber = 1, + Y = 0) + +mu__plus__ = mu__minus__.anti() + +ta__minus__ = Particle(pdg_code = 15, + name = 'ta-', + antiname = 'ta+', + spin = 2, + color = 1, + mass = Param.MTA, + width = Param.ZERO, + texname = 'ta-', + antitexname = 'ta+', + charge = -1, + GhostNumber = 0, + LeptonNumber = 1, + Y = 0) + +ta__plus__ = ta__minus__.anti() + +u = Particle(pdg_code = 2, + name = 'u', + antiname = 'u~', + spin = 2, + color = 3, + mass = Param.MU, + width = Param.ZERO, + texname = 'u', + antitexname = 'u~', + charge = 2/3, + GhostNumber = 0, + LeptonNumber = 0, + Y = 0) + +u__tilde__ = u.anti() + +c = Particle(pdg_code = 4, + name = 'c', + antiname = 'c~', + spin = 2, + color = 3, + mass = Param.MC, + width = Param.ZERO, + texname = 'c', + antitexname = 'c~', + charge = 2/3, + GhostNumber = 0, + LeptonNumber = 0, + Y = 0) + +c__tilde__ = c.anti() + +t = Particle(pdg_code = 6, + name = 't', + antiname = 't~', + spin = 2, + color = 3, + mass = Param.MT, + width = Param.WT, + texname = 't', + antitexname = 't~', + charge = 2/3, + GhostNumber = 0, + LeptonNumber = 0, + Y = 0) + +t__tilde__ = t.anti() + +d = Particle(pdg_code = 1, + name = 'd', + antiname = 'd~', + spin = 2, + color = 3, + mass = Param.MD, + width = Param.ZERO, + texname = 'd', + antitexname = 'd~', + charge = -1/3, + GhostNumber = 0, + LeptonNumber = 0, + Y = 0) + +d__tilde__ = d.anti() + +s = Particle(pdg_code = 3, + name = 's', + antiname = 's~', + spin = 2, + color = 3, + mass = Param.MS, + width = Param.ZERO, + texname = 's', + antitexname = 's~', + charge = -1/3, + GhostNumber = 0, + LeptonNumber = 0, + Y = 0) + +s__tilde__ = s.anti() + +b = Particle(pdg_code = 5, + name = 'b', + antiname = 'b~', + spin = 2, + color = 3, + mass = Param.MB, + width = Param.ZERO, + texname = 'b', + antitexname = 'b~', + charge = -1/3, + GhostNumber = 0, + LeptonNumber = 0, + Y = 0) + +b__tilde__ = b.anti() + +H = Particle(pdg_code = 25, + name = 'H', + antiname = 'H', + spin = 1, + color = 1, + mass = Param.MH, + width = Param.WH, + texname = 'H', + antitexname = 'H', + charge = 0, + GhostNumber = 0, + LeptonNumber = 0, + Y = 0) + +G0 = Particle(pdg_code = 250, + name = 'G0', + antiname = 'G0', + spin = 1, + color = 1, + mass = Param.MZ, + width = Param.WZ, + texname = 'G0', + antitexname = 'G0', + goldstone = True, + charge = 0, + GhostNumber = 0, + LeptonNumber = 0, + Y = 0) + +G__plus__ = Particle(pdg_code = 251, + name = 'G+', + antiname = 'G-', + spin = 1, + color = 1, + mass = Param.MW, + width = Param.WW, + texname = 'G+', + antitexname = 'G-', + goldstone = True, + charge = 1, + GhostNumber = 0, + LeptonNumber = 0, + Y = 0) + +G__minus__ = G__plus__.anti() + +ALP = Particle(pdg_code = 9000005, + name = 'ALP', + antiname = 'ALP', + spin = 1, + color = 1, + mass = Param.Ma, + width = Param.WALP, + texname = 'ALP', + antitexname = 'ALP', + charge = 0, + GhostNumber = 0, + LeptonNumber = 0, + Y = 0) + diff --git a/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/propagators.py b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/propagators.py new file mode 100644 index 0000000000..afd2520e65 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/propagators.py @@ -0,0 +1,35 @@ +# This file was automatically created by FeynRules 2.0 (static file) +# Mathematica version: 8.0 for Mac OS X x86 (64-bit) (November 6, 2010) +# Date: Mon 1 Oct 2012 14:58:26 + +from object_library import all_propagators, Propagator + + +# define only once the denominator since this is always the same +denominator = "P('mu', id) * P('mu', id) - Mass(id) * Mass(id) + complex(0,1) * Mass(id) * Width(id)" + +# propagator for the scalar +S = Propagator(name = "S", + numerator = "complex(0,1)", + denominator = denominator + ) + +# propagator for the incoming fermion # the one for the outcomming is computed on the flight +F = Propagator(name = "F", + numerator = "complex(0,1) * (Gamma('mu', 1, 2) * P('mu', id) + Mass(id) * Identity(1, 2))", + denominator = denominator + ) + +# massive vector in the unitary gauge, can't be use for massless particles +V1 = Propagator(name = "V1", + numerator = "complex(0,1) * (-1 * Metric(1, 2) + Metric(1,'mu')* P('mu', id) * P(2, id) / Mass(id)**2)", + denominator = denominator + ) + +# massless vector and massive vector in unitary gauge +V2 = Propagator(name = "V2", + numerator = "complex(0,-1) * Metric(1, 2)", + denominator = "P('mu', id) * P('mu', id)" + ) + + diff --git a/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/vertices.py b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/vertices.py new file mode 100644 index 0000000000..99d50be220 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/vertices.py @@ -0,0 +1,581 @@ +# This file was automatically created by FeynRules 2.3.43 +# Mathematica version: 12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020) +# Date: Mon 19 Apr 2021 15:23:42 + + +from object_library import all_vertices, Vertex +import particles as P +import couplings as C +import lorentz as L + + +V_1 = Vertex(name = 'V_1', + particles = [ P.H, P.H, P.H, P.H ], + color = [ '1' ], + lorentz = [ L.SSSS1 ], + couplings = {(0,0):C.GC_18}) + +V_2 = Vertex(name = 'V_2', + particles = [ P.H, P.H, P.H ], + color = [ '1' ], + lorentz = [ L.SSS1 ], + couplings = {(0,0):C.GC_52}) + +V_3 = Vertex(name = 'V_3', + particles = [ P.ALP, P.ALP, P.H, P.H ], + color = [ '1' ], + lorentz = [ L.SSSS2 ], + couplings = {(0,0):C.GC_6}) + +V_4 = Vertex(name = 'V_4', + particles = [ P.ALP, P.ALP, P.H ], + color = [ '1' ], + lorentz = [ L.SSS2 ], + couplings = {(0,0):C.GC_51}) + +V_5 = Vertex(name = 'V_5', + particles = [ P.a, P.a, P.ALP ], + color = [ '1' ], + lorentz = [ L.VVS2 ], + couplings = {(0,0):C.GC_19}) + +V_6 = Vertex(name = 'V_6', + particles = [ P.a, P.Z, P.ALP ], + color = [ '1' ], + lorentz = [ L.VVS2 ], + couplings = {(0,0):C.GC_48}) + +V_7 = Vertex(name = 'V_7', + particles = [ P.Z, P.Z, P.ALP ], + color = [ '1' ], + lorentz = [ L.VVS2 ], + couplings = {(0,0):C.GC_50}) + +V_8 = Vertex(name = 'V_8', + particles = [ P.W__minus__, P.W__plus__, P.ALP ], + color = [ '1' ], + lorentz = [ L.VVS2 ], + couplings = {(0,0):C.GC_26}) + +V_9 = Vertex(name = 'V_9', + particles = [ P.g, P.g, P.ALP ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.VVS1 ], + couplings = {(0,0):C.GC_20}) + +V_10 = Vertex(name = 'V_10', + particles = [ P.ghG, P.ghG__tilde__, P.g ], + color = [ 'f(1,2,3)' ], + lorentz = [ L.UUV1 ], + couplings = {(0,0):C.GC_15}) + +V_11 = Vertex(name = 'V_11', + particles = [ P.g, P.g, P.g ], + color = [ 'f(1,2,3)' ], + lorentz = [ L.VVV1 ], + couplings = {(0,0):C.GC_15}) + +V_12 = Vertex(name = 'V_12', + particles = [ P.g, P.g, P.g, P.g ], + color = [ 'f(-1,1,2)*f(3,4,-1)', 'f(-1,1,3)*f(2,4,-1)', 'f(-1,1,4)*f(2,3,-1)' ], + lorentz = [ L.VVVV1, L.VVVV3, L.VVVV4 ], + couplings = {(1,1):C.GC_17,(0,0):C.GC_17,(2,2):C.GC_17}) + +V_13 = Vertex(name = 'V_13', + particles = [ P.g, P.g, P.g, P.ALP ], + color = [ 'f(1,2,3)' ], + lorentz = [ L.VVVS2 ], + couplings = {(0,0):C.GC_21}) + +V_14 = Vertex(name = 'V_14', + particles = [ P.b__tilde__, P.b, P.H ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFS2 ], + couplings = {(0,0):C.GC_56}) + +V_15 = Vertex(name = 'V_15', + particles = [ P.d__tilde__, P.d, P.H ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFS2 ], + couplings = {(0,0):C.GC_58}) + +V_16 = Vertex(name = 'V_16', + particles = [ P.s__tilde__, P.s, P.H ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFS2 ], + couplings = {(0,0):C.GC_61}) + +V_17 = Vertex(name = 'V_17', + particles = [ P.e__plus__, P.e__minus__, P.H ], + color = [ '1' ], + lorentz = [ L.FFS2 ], + couplings = {(0,0):C.GC_59}) + +V_18 = Vertex(name = 'V_18', + particles = [ P.mu__plus__, P.mu__minus__, P.H ], + color = [ '1' ], + lorentz = [ L.FFS2 ], + couplings = {(0,0):C.GC_60}) + +V_19 = Vertex(name = 'V_19', + particles = [ P.ta__plus__, P.ta__minus__, P.H ], + color = [ '1' ], + lorentz = [ L.FFS2 ], + couplings = {(0,0):C.GC_63}) + +V_20 = Vertex(name = 'V_20', + particles = [ P.c__tilde__, P.c, P.H ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFS2 ], + couplings = {(0,0):C.GC_57}) + +V_21 = Vertex(name = 'V_21', + particles = [ P.t__tilde__, P.t, P.H ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFS2 ], + couplings = {(0,0):C.GC_62}) + +V_22 = Vertex(name = 'V_22', + particles = [ P.u__tilde__, P.u, P.H ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFS2 ], + couplings = {(0,0):C.GC_64}) + +V_23 = Vertex(name = 'V_23', + particles = [ P.a, P.W__minus__, P.W__plus__ ], + color = [ '1' ], + lorentz = [ L.VVV1 ], + couplings = {(0,0):C.GC_4}) + +V_24 = Vertex(name = 'V_24', + particles = [ P.a, P.W__minus__, P.W__plus__, P.ALP ], + color = [ '1' ], + lorentz = [ L.VVVS1 ], + couplings = {(0,0):C.GC_27}) + +V_25 = Vertex(name = 'V_25', + particles = [ P.W__minus__, P.W__plus__, P.H, P.H ], + color = [ '1' ], + lorentz = [ L.VVSS1 ], + couplings = {(0,0):C.GC_23}) + +V_26 = Vertex(name = 'V_26', + particles = [ P.W__minus__, P.W__plus__, P.H ], + color = [ '1' ], + lorentz = [ L.VVS3 ], + couplings = {(0,0):C.GC_53}) + +V_27 = Vertex(name = 'V_27', + particles = [ P.a, P.a, P.W__minus__, P.W__plus__ ], + color = [ '1' ], + lorentz = [ L.VVVV2 ], + couplings = {(0,0):C.GC_5}) + +V_28 = Vertex(name = 'V_28', + particles = [ P.W__minus__, P.W__plus__, P.Z ], + color = [ '1' ], + lorentz = [ L.VVV1 ], + couplings = {(0,0):C.GC_38}) + +V_29 = Vertex(name = 'V_29', + particles = [ P.W__minus__, P.W__plus__, P.Z, P.ALP ], + color = [ '1' ], + lorentz = [ L.VVVS1 ], + couplings = {(0,0):C.GC_22}) + +V_30 = Vertex(name = 'V_30', + particles = [ P.W__minus__, P.W__minus__, P.W__plus__, P.W__plus__ ], + color = [ '1' ], + lorentz = [ L.VVVV2 ], + couplings = {(0,0):C.GC_24}) + +V_31 = Vertex(name = 'V_31', + particles = [ P.Z, P.ALP, P.H, P.H ], + color = [ '1' ], + lorentz = [ L.VSSS1 ], + couplings = {(0,0):C.GC_47}) + +V_32 = Vertex(name = 'V_32', + particles = [ P.Z, P.ALP, P.H ], + color = [ '1' ], + lorentz = [ L.VSS1 ], + couplings = {(0,0):C.GC_54}) + +V_33 = Vertex(name = 'V_33', + particles = [ P.a, P.W__minus__, P.W__plus__, P.Z ], + color = [ '1' ], + lorentz = [ L.VVVV5 ], + couplings = {(0,0):C.GC_39}) + +V_34 = Vertex(name = 'V_34', + particles = [ P.Z, P.Z, P.H, P.H ], + color = [ '1' ], + lorentz = [ L.VVSS1 ], + couplings = {(0,0):C.GC_49}) + +V_35 = Vertex(name = 'V_35', + particles = [ P.Z, P.Z, P.H ], + color = [ '1' ], + lorentz = [ L.VVS3 ], + couplings = {(0,0):C.GC_55}) + +V_36 = Vertex(name = 'V_36', + particles = [ P.W__minus__, P.W__plus__, P.Z, P.Z ], + color = [ '1' ], + lorentz = [ L.VVVV2 ], + couplings = {(0,0):C.GC_25}) + +V_37 = Vertex(name = 'V_37', + particles = [ P.e__plus__, P.e__minus__, P.a ], + color = [ '1' ], + lorentz = [ L.FFV1 ], + couplings = {(0,0):C.GC_3}) + +V_38 = Vertex(name = 'V_38', + particles = [ P.mu__plus__, P.mu__minus__, P.a ], + color = [ '1' ], + lorentz = [ L.FFV1 ], + couplings = {(0,0):C.GC_3}) + +V_39 = Vertex(name = 'V_39', + particles = [ P.ta__plus__, P.ta__minus__, P.a ], + color = [ '1' ], + lorentz = [ L.FFV1 ], + couplings = {(0,0):C.GC_3}) + +V_40 = Vertex(name = 'V_40', + particles = [ P.c__tilde__, P.c, P.a ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV1 ], + couplings = {(0,0):C.GC_2}) + +V_41 = Vertex(name = 'V_41', + particles = [ P.t__tilde__, P.t, P.a ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV1 ], + couplings = {(0,0):C.GC_2}) + +V_42 = Vertex(name = 'V_42', + particles = [ P.u__tilde__, P.u, P.a ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV1 ], + couplings = {(0,0):C.GC_2}) + +V_43 = Vertex(name = 'V_43', + particles = [ P.b__tilde__, P.b, P.a ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV1 ], + couplings = {(0,0):C.GC_1}) + +V_44 = Vertex(name = 'V_44', + particles = [ P.d__tilde__, P.d, P.a ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV1 ], + couplings = {(0,0):C.GC_1}) + +V_45 = Vertex(name = 'V_45', + particles = [ P.s__tilde__, P.s, P.a ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV1 ], + couplings = {(0,0):C.GC_1}) + +V_46 = Vertex(name = 'V_46', + particles = [ P.c__tilde__, P.c, P.g ], + color = [ 'T(3,2,1)' ], + lorentz = [ L.FFV1 ], + couplings = {(0,0):C.GC_16}) + +V_47 = Vertex(name = 'V_47', + particles = [ P.t__tilde__, P.t, P.g ], + color = [ 'T(3,2,1)' ], + lorentz = [ L.FFV1 ], + couplings = {(0,0):C.GC_16}) + +V_48 = Vertex(name = 'V_48', + particles = [ P.u__tilde__, P.u, P.g ], + color = [ 'T(3,2,1)' ], + lorentz = [ L.FFV1 ], + couplings = {(0,0):C.GC_16}) + +V_49 = Vertex(name = 'V_49', + particles = [ P.b__tilde__, P.b, P.g ], + color = [ 'T(3,2,1)' ], + lorentz = [ L.FFV1 ], + couplings = {(0,0):C.GC_16}) + +V_50 = Vertex(name = 'V_50', + particles = [ P.d__tilde__, P.d, P.g ], + color = [ 'T(3,2,1)' ], + lorentz = [ L.FFV1 ], + couplings = {(0,0):C.GC_16}) + +V_51 = Vertex(name = 'V_51', + particles = [ P.s__tilde__, P.s, P.g ], + color = [ 'T(3,2,1)' ], + lorentz = [ L.FFV1 ], + couplings = {(0,0):C.GC_16}) + +V_52 = Vertex(name = 'V_52', + particles = [ P.b__tilde__, P.c, P.W__minus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_34}) + +V_53 = Vertex(name = 'V_53', + particles = [ P.d__tilde__, P.c, P.W__minus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_32}) + +V_54 = Vertex(name = 'V_54', + particles = [ P.s__tilde__, P.c, P.W__minus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_33}) + +V_55 = Vertex(name = 'V_55', + particles = [ P.b__tilde__, P.t, P.W__minus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_37}) + +V_56 = Vertex(name = 'V_56', + particles = [ P.d__tilde__, P.t, P.W__minus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_35}) + +V_57 = Vertex(name = 'V_57', + particles = [ P.s__tilde__, P.t, P.W__minus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_36}) + +V_58 = Vertex(name = 'V_58', + particles = [ P.b__tilde__, P.u, P.W__minus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_31}) + +V_59 = Vertex(name = 'V_59', + particles = [ P.d__tilde__, P.u, P.W__minus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_29}) + +V_60 = Vertex(name = 'V_60', + particles = [ P.s__tilde__, P.u, P.W__minus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_30}) + +V_61 = Vertex(name = 'V_61', + particles = [ P.c__tilde__, P.b, P.W__plus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_70}) + +V_62 = Vertex(name = 'V_62', + particles = [ P.t__tilde__, P.b, P.W__plus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_73}) + +V_63 = Vertex(name = 'V_63', + particles = [ P.u__tilde__, P.b, P.W__plus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_67}) + +V_64 = Vertex(name = 'V_64', + particles = [ P.c__tilde__, P.d, P.W__plus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_68}) + +V_65 = Vertex(name = 'V_65', + particles = [ P.t__tilde__, P.d, P.W__plus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_71}) + +V_66 = Vertex(name = 'V_66', + particles = [ P.u__tilde__, P.d, P.W__plus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_65}) + +V_67 = Vertex(name = 'V_67', + particles = [ P.c__tilde__, P.s, P.W__plus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_69}) + +V_68 = Vertex(name = 'V_68', + particles = [ P.t__tilde__, P.s, P.W__plus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_72}) + +V_69 = Vertex(name = 'V_69', + particles = [ P.u__tilde__, P.s, P.W__plus__ ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_66}) + +V_70 = Vertex(name = 'V_70', + particles = [ P.e__plus__, P.ve, P.W__minus__ ], + color = [ '1' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_28}) + +V_71 = Vertex(name = 'V_71', + particles = [ P.mu__plus__, P.vm, P.W__minus__ ], + color = [ '1' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_28}) + +V_72 = Vertex(name = 'V_72', + particles = [ P.ta__plus__, P.vt, P.W__minus__ ], + color = [ '1' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_28}) + +V_73 = Vertex(name = 'V_73', + particles = [ P.ve__tilde__, P.e__minus__, P.W__plus__ ], + color = [ '1' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_28}) + +V_74 = Vertex(name = 'V_74', + particles = [ P.vm__tilde__, P.mu__minus__, P.W__plus__ ], + color = [ '1' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_28}) + +V_75 = Vertex(name = 'V_75', + particles = [ P.vt__tilde__, P.ta__minus__, P.W__plus__ ], + color = [ '1' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_28}) + +V_76 = Vertex(name = 'V_76', + particles = [ P.c__tilde__, P.c, P.Z ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2, L.FFV3 ], + couplings = {(0,0):C.GC_44,(0,1):C.GC_41}) + +V_77 = Vertex(name = 'V_77', + particles = [ P.t__tilde__, P.t, P.Z ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2, L.FFV3 ], + couplings = {(0,0):C.GC_44,(0,1):C.GC_41}) + +V_78 = Vertex(name = 'V_78', + particles = [ P.u__tilde__, P.u, P.Z ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2, L.FFV3 ], + couplings = {(0,0):C.GC_44,(0,1):C.GC_41}) + +V_79 = Vertex(name = 'V_79', + particles = [ P.b__tilde__, P.b, P.Z ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2, L.FFV3 ], + couplings = {(0,0):C.GC_43,(0,1):C.GC_40}) + +V_80 = Vertex(name = 'V_80', + particles = [ P.d__tilde__, P.d, P.Z ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2, L.FFV3 ], + couplings = {(0,0):C.GC_43,(0,1):C.GC_40}) + +V_81 = Vertex(name = 'V_81', + particles = [ P.s__tilde__, P.s, P.Z ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFV2, L.FFV3 ], + couplings = {(0,0):C.GC_43,(0,1):C.GC_40}) + +V_82 = Vertex(name = 'V_82', + particles = [ P.ve__tilde__, P.ve, P.Z ], + color = [ '1' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_46}) + +V_83 = Vertex(name = 'V_83', + particles = [ P.vm__tilde__, P.vm, P.Z ], + color = [ '1' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_46}) + +V_84 = Vertex(name = 'V_84', + particles = [ P.vt__tilde__, P.vt, P.Z ], + color = [ '1' ], + lorentz = [ L.FFV2 ], + couplings = {(0,0):C.GC_46}) + +V_85 = Vertex(name = 'V_85', + particles = [ P.e__plus__, P.e__minus__, P.Z ], + color = [ '1' ], + lorentz = [ L.FFV2, L.FFV3 ], + couplings = {(0,0):C.GC_45,(0,1):C.GC_42}) + +V_86 = Vertex(name = 'V_86', + particles = [ P.mu__plus__, P.mu__minus__, P.Z ], + color = [ '1' ], + lorentz = [ L.FFV2, L.FFV3 ], + couplings = {(0,0):C.GC_45,(0,1):C.GC_42}) + +V_87 = Vertex(name = 'V_87', + particles = [ P.ta__plus__, P.ta__minus__, P.Z ], + color = [ '1' ], + lorentz = [ L.FFV2, L.FFV3 ], + couplings = {(0,0):C.GC_45,(0,1):C.GC_42}) + +V_88 = Vertex(name = 'V_88', + particles = [ P.b__tilde__, P.b, P.ALP ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFS1 ], + couplings = {(0,0):C.GC_7}) + +V_89 = Vertex(name = 'V_89', + particles = [ P.c__tilde__, P.c, P.ALP ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFS1 ], + couplings = {(0,0):C.GC_8}) + +V_90 = Vertex(name = 'V_90', + particles = [ P.d__tilde__, P.d, P.ALP ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFS1 ], + couplings = {(0,0):C.GC_9}) + +V_91 = Vertex(name = 'V_91', + particles = [ P.e__plus__, P.e__minus__, P.ALP ], + color = [ '1' ], + lorentz = [ L.FFS1 ], + couplings = {(0,0):C.GC_10}) + +V_92 = Vertex(name = 'V_92', + particles = [ P.mu__plus__, P.mu__minus__, P.ALP ], + color = [ '1' ], + lorentz = [ L.FFS1 ], + couplings = {(0,0):C.GC_11}) + +V_93 = Vertex(name = 'V_93', + particles = [ P.s__tilde__, P.s, P.ALP ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFS1 ], + couplings = {(0,0):C.GC_12}) + +V_94 = Vertex(name = 'V_94', + particles = [ P.t__tilde__, P.t, P.ALP ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFS1 ], + couplings = {(0,0):C.GC_13}) + +V_95 = Vertex(name = 'V_95', + particles = [ P.u__tilde__, P.u, P.ALP ], + color = [ 'Identity(1,2)' ], + lorentz = [ L.FFS1 ], + couplings = {(0,0):C.GC_14}) + diff --git a/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/write_param_card.py b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/write_param_card.py new file mode 100644 index 0000000000..72781aa14c --- /dev/null +++ b/examples/FCCee/bsm/LLPs/ALP_NLO_UFO/write_param_card.py @@ -0,0 +1,180 @@ + +__date__ = "6 March 2020" +__author__ = 'olivier.mattelaer@uclouvain.be' + + +class ParamCardWriter(object): + + header = \ + """######################################################################\n""" + \ + """## PARAM_CARD AUTOMATICALY GENERATED BY THE UFO #####################\n""" + \ + """######################################################################\n""" + + def __init__(self, filename, list_of_parameters=None, generic=False): + """write a valid param_card.dat""" + + if not list_of_parameters: + from parameters import all_parameters + list_of_parameters = [param for param in all_parameters if \ + param.nature=='external'] + + self.generic_output = generic + if generic: + self.define_not_dep_param(list_of_parameters) + + + self.fsock = open(filename, 'w') + self.fsock.write(self.header) + + self.write_card(list_of_parameters) + + def define_not_dep_param(self, list_of_parameters): + """define self.dep_mass and self.dep_width in case that they are + requested in the param_card.dat""" + from particles import all_particles + + self.dep_mass = [(part, part.mass) for part in all_particles \ + if part.pdg_code > 0 and \ + part.mass not in list_of_parameters] + self.dep_width = [(part, part.width) for part in all_particles\ + if part.pdg_code > 0 and \ + part.width not in list_of_parameters] + + @staticmethod + def order_param(obj1, obj2): + """ order parameter of a given block """ + + maxlen = min([len(obj1.lhacode), len(obj2.lhacode)]) + + for i in range(maxlen): + if obj1.lhacode[i] < obj2.lhacode[i]: + return -1 + elif obj1.lhacode[i] == obj2.lhacode[i]: + return 0 + else: + return 1 + #identical up to the first finish + if len(obj1.lhacode) > len(obj2.lhacode): + return 1 + elif len(obj1.lhacode) == len(obj2.lhacode): + return 0 + else: + return -1 + + def write_card(self, all_ext_param): + """ """ + + # list all lhablock + all_lhablock = set([param.lhablock for param in all_ext_param]) + + # ordonate lhablock alphabeticaly + all_lhablock = list(all_lhablock) + all_lhablock.sort() + # put at the beginning SMINPUT + MASS + DECAY + for name in ['DECAY', 'MASS','SMINPUTS']: + if name in all_lhablock: + all_lhablock.remove(name) + all_lhablock.insert(0, name) + + for lhablock in all_lhablock: + self.write_block(lhablock) + need_writing = [ param for param in all_ext_param if \ + param.lhablock == lhablock] + from functools import cmp_to_key + need_writing.sort(key=cmp_to_key(self.order_param)) + [self.write_param(param, lhablock) for param in need_writing] + + if self.generic_output: + if lhablock in ['MASS', 'DECAY']: + self.write_dep_param_block(lhablock) + + if self.generic_output: + self.write_qnumber() + + def write_block(self, name): + """ write a comment for a block""" + + self.fsock.writelines( + """\n###################################""" + \ + """\n## INFORMATION FOR %s""" % name.upper() +\ + """\n###################################\n""" + ) + if name!='DECAY': + self.fsock.write("""Block %s \n""" % name) + + def write_param(self, param, lhablock): + + lhacode=' '.join(['%3s' % key for key in param.lhacode]) + if lhablock != 'DECAY': + text = """ %s %e # %s \n""" % (lhacode, complex(param.value).real, param.name ) + else: + text = '''DECAY %s %e \n''' % (lhacode, complex(param.value).real) + self.fsock.write(text) + + + + + def write_dep_param_block(self, lhablock): + import cmath + from parameters import all_parameters + for parameter in all_parameters: + exec("%s = %s" % (parameter.name, parameter.value)) + text = "## Not dependent paramater.\n" + text += "## Those values should be edited following analytical the \n" + text += "## analytical expression. Some generator could simply ignore \n" + text += "## those values and use the analytical expression\n" + + if lhablock == 'MASS': + data = self.dep_mass + prefix = " " + else: + data = self.dep_width + prefix = "DECAY " + for part, param in data: + if isinstance(param.value, str): + value = complex(eval(param.value)).real + else: + value = param.value + + text += """%s %s %f # %s : %s \n""" %(prefix, part.pdg_code, + value, part.name, param.value) + self.fsock.write(text) + + sm_pdg = [1,2,3,4,5,6,11,12,13,13,14,15,16,21,22,23,24,25] + data="""Block QNUMBERS %(pdg)d # %(name)s + 1 %(charge)d # 3 times electric charge + 2 %(spin)d # number of spin states (2S+1) + 3 %(color)d # colour rep (1: singlet, 3: triplet, 8: octet) + 4 %(antipart)d # Particle/Antiparticle distinction (0=own anti)\n""" + + def write_qnumber(self): + """ write qnumber """ + from particles import all_particles + + text="""#===========================================================\n""" + text += """# QUANTUM NUMBERS OF NEW STATE(S) (NON SM PDG CODE)\n""" + text += """#===========================================================\n\n""" + + for part in all_particles: + if part.pdg_code in self.sm_pdg or part.pdg_code < 0: + continue + text += self.data % {'pdg': part.pdg_code, + 'name': part.name, + 'charge': 3 * part.charge, + 'spin': 2 * part.spin + 1, + 'color': part.color, + 'antipart': part.name != part.antiname and 1 or 0} + + self.fsock.write(text) + + + + + + + + +if '__main__' == __name__: + ParamCardWriter('./param_card.dat', generic=True) + print('write ./param_card.dat') + From 5ae76b96f704aa9306a572d965405ba26612fe6d Mon Sep 17 00:00:00 2001 From: Juliette Alimena Date: Tue, 25 Oct 2022 11:30:48 +0200 Subject: [PATCH 10/35] add ALP sample creation files --- .../ALPs/ALP_sample_creation/ALP_pythia.cmnd | 20 +++++ .../mg5_proc_card_ALP_aa_1GeV_0p5CYY.dat | 78 +++++++++++++++++++ .../ALP_sample_creation/runPythiaDephies.sh | 6 ++ 3 files changed, 104 insertions(+) create mode 100644 examples/FCCee/bsm/LLPs/ALPs/ALP_sample_creation/ALP_pythia.cmnd create mode 100644 examples/FCCee/bsm/LLPs/ALPs/ALP_sample_creation/mg5_proc_card_ALP_aa_1GeV_0p5CYY.dat create mode 100644 examples/FCCee/bsm/LLPs/ALPs/ALP_sample_creation/runPythiaDephies.sh diff --git a/examples/FCCee/bsm/LLPs/ALPs/ALP_sample_creation/ALP_pythia.cmnd b/examples/FCCee/bsm/LLPs/ALPs/ALP_sample_creation/ALP_pythia.cmnd new file mode 100644 index 0000000000..878b55b426 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/ALPs/ALP_sample_creation/ALP_pythia.cmnd @@ -0,0 +1,20 @@ +! File: ALP_pythia.cmd +Random:setSeed = on +Main:timesAllowErrors = 10 ! how many aborts before run stops +Main:numberOfEvents = 10000 ! number of events to generate + + +! 2) Settings related to output in init(), next() and stat(). +Next:numberCount = 100 ! print message every n events +!Beams:idA = 11 ! first beam, e+ = 11 +!Beams:idB = -11 ! second beam, e- = -11 + +Beams:frameType = 4 ! read info from a LHEF +! Change the LHE file here +Beams:LHEF = ALP_test.lhe + +! 3) Settings for the event generation process in the Pythia8 library. +PartonLevel:ISR = on ! initial-state radiation +PartonLevel:FSR = on ! final-state radiation + +LesHouches:setLifetime = 2 diff --git a/examples/FCCee/bsm/LLPs/ALPs/ALP_sample_creation/mg5_proc_card_ALP_aa_1GeV_0p5CYY.dat b/examples/FCCee/bsm/LLPs/ALPs/ALP_sample_creation/mg5_proc_card_ALP_aa_1GeV_0p5CYY.dat new file mode 100644 index 0000000000..8e9c041903 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/ALPs/ALP_sample_creation/mg5_proc_card_ALP_aa_1GeV_0p5CYY.dat @@ -0,0 +1,78 @@ +#************************************************************ +#* MadGraph5_aMC@NLO * +#* * +#* * * * +#* * * * * * +#* * * * * 5 * * * * * +#* * * * * * +#* * * * +#* * +#* * +#* VERSION 3.2.0 2021-08-22 * +#* * +#* The MadGraph5_aMC@NLO Development Team - Find us at * +#* https://server06.fynu.ucl.ac.be/projects/madgraph * +#* * +#************************************************************ +#* * +#* Command File for MadGraph5_aMC@NLO * +#* * +#* run as ./bin/mg5_aMC filename * +#* * +#************************************************************ +set group_subprocesses Auto +set ignore_six_quark_processes False +set low_mem_multicore_nlo_generation False +set complex_mass_scheme False +set include_lepton_initiated_processes False +set gauge unitary +set loop_optimized_output True +set loop_color_flows False +set max_npoint_for_channel 0 +set default_unset_couplings 99 +set max_t_for_channel 99 +set zerowidth_tchannel True +set nlo_mixed_expansion True +set auto_convert_model T +import model sm +define p = g u c d s u~ c~ d~ s~ +define j = g u c d s u~ c~ d~ s~ +define l+ = e+ mu+ +define l- = e- mu- +define vl = ve vm vt +define vl~ = ve~ vm~ vt~ +import model ALP_NLO_UFO +generate e+ e- > Z, (Z > a ALP, (ALP > a a)) +output ALP_Z_aa_1GeV_cYY_0p5 +launch ALP_Z_aa_1GeV_cYY_0p5 +done +# set to electron beams (0 for ele, 1 for proton) +set lpp1 0 +set lpp2 0 +set ebeam1 45.594 +set ebeam2 45.594 +# set ALP mass +set Ma 1. +# set ALP couplings +set cWW = 0.0 +set CYY = 0.5 +set cGG = 0. +set cuu = 0. +set cdd = 0. +set ccc = 0. +set css = 0. +set ctt = 0. +set cbb = 0. +set cee = 0. +set cmumu = 0. +set ctautau = 0. +set cah = 0. +set cZh5 = 0. +# set supression scale in the effective operators coupling the ALP to SM particles +set falp = 1000 + +# set the decay width of the ALP to auto +set WALP auto +set time_of_flight 0 +set nevents 10000 +done diff --git a/examples/FCCee/bsm/LLPs/ALPs/ALP_sample_creation/runPythiaDephies.sh b/examples/FCCee/bsm/LLPs/ALPs/ALP_sample_creation/runPythiaDephies.sh new file mode 100644 index 0000000000..476df1f598 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/ALPs/ALP_sample_creation/runPythiaDephies.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# quick command to run DelphesPythia8_EDM4HEP +# needs one input for the name of the output root-file + +DelphesPythia8_EDM4HEP ../../../../../../FCC-config/FCCee/Delphes/card_IDEA.tcl ../../../../../../FCC-config/FCCee/Delphes/edm4hep_IDEA.tcl ALP_pythia.cmnd $1 \ No newline at end of file From d3d43847a7d3e482ff435de903138671a004daed Mon Sep 17 00:00:00 2001 From: Juliette Alimena Date: Tue, 25 Oct 2022 11:43:14 +0200 Subject: [PATCH 11/35] add HNL sample creation files --- .../HNL_sample_creation/HNL_pythia.cmd | 21 ++++++ .../HNL_sample_creation/Readme.md | 51 ++++++++++++++ ...mg5_proc_card_HNL_eenu_50GeV_1p41e-6Ve.dat | 67 +++++++++++++++++++ 3 files changed, 139 insertions(+) create mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/HNL_pythia.cmd create mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/Readme.md create mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_eenu_50GeV_1p41e-6Ve.dat diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/HNL_pythia.cmd b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/HNL_pythia.cmd new file mode 100644 index 0000000000..32f7bb8250 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/HNL_pythia.cmd @@ -0,0 +1,21 @@ +! File: HNL_pythia.cmd +Random:setSeed = on +Main:timesAllowErrors = 10 ! how many aborts before run stops +Main:numberOfEvents = 50000 ! number of events to generate + + +! 2) Settings related to output in init(), next() and stat(). +Next:numberCount = 100 ! print message every n events +!Beams:idA = 11 ! first beam, e+ = 11 +!Beams:idB = -11 ! second beam, e- = -11 + +Beams:frameType = 4 ! read info from a LHEF +! Change the LHE file here +Beams:LHEF = HNL_eenu_50GeV_1p41e-6Ve.lhe +! Beams:LHEF = HNL_ejj_50GeV_1p41e-6Ve.lhe + +! 3) Settings for the event generation process in the Pythia8 library. +PartonLevel:ISR = on ! initial-state radiation +PartonLevel:FSR = on ! final-state radiation + +LesHouches:setLifetime = 2 diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/Readme.md b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/Readme.md new file mode 100644 index 0000000000..3eba9be26d --- /dev/null +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/Readme.md @@ -0,0 +1,51 @@ +Author: Suchita Kulkarni +Contact: suchita.kulkarni@cern.ch +This folder will allow you to create your own madgraph sample for heavy neutral lepton decaying to e j j final state. + +To create a sample where the HNL decays to e e nu final state change the following lines in mg5_proc_card.dat + +generate e+ e- > ve n1, (n1 > e j j) +add process e+ e- > ve~ n1, (n1 > e j j) + +to + +generate e+ e- > ve n1, (n1 > e e nu) +add process e+ e- > ve~ n1, (n1 > e e nu) + +First create the LHE file. To do this, you'll need to download the latest version of madgraph (http://madgraph.phys.ucl.ac.be/) and make sure you're using python 3.7 or greater. For the Snowmass study, we're using MadGraph5 v3.2.0. Copy the Madgraph tarball to your local area on lxplus: + +``` +scp MG5_aMC_v3.2.0.tar.gz username@lxplus7.cern.ch:/afs_path/yadda_yadda/ +``` + +Then ssh to lxplus and unzip the tarball (tar -xf MG5_aMC_v3.2.0.tar.gz). If you're going to generate ALPs, copy the ALP_NLO_UFO/ directory into MG5_aMC_v3_2_0/models. + +Then you can do: + +``` +./bin/mg5_aMC mg5_proc_card.dat +``` +to create the LHE file, where mg5_proc_card.dat is the madgraph proc card you are interested in generating. + + +The resulting events will be stored in HNL_ljj/Events/run_01/unweighted_events.lhe.gz file. + +Unzip it (gunzip unweighted_events.lhe.gz) and give the path to HNL_pythia.cmnd file to generate the delphes root file. + +You also need to grab the latest official Delphes card and edm4hep tcl file: +``` +#cd to one directory up from FCCeePhysicsPerformance/ +git clone https://github.com/HEP-FCC/FCC-config.git +cd FCC-config/ +git checkout spring2021 +cd ../FCCeePhysicsPerformance/case-studies/BSM/LLP/DisplacedHNL/HNL_sample_creation/ +``` + +To create delphes root file you need to do the following on your command line: + +``` +source /cvmfs/fcc.cern.ch/sw/latest/setup.sh +DelphesPythia8_EDM4HEP ../../../../../../FCC-config/FCCee/Delphes/card_IDEA.tcl ../../../../../../FCC-config/FCCee/Delphes/edm4hep_IDEA.tcl HNL_eenu_pythia.cmnd HNL_ejj.root +``` + +the resulting HNL_ejj.root is your EDM sample. diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_eenu_50GeV_1p41e-6Ve.dat b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_eenu_50GeV_1p41e-6Ve.dat new file mode 100644 index 0000000000..8f6c5a4b6f --- /dev/null +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_eenu_50GeV_1p41e-6Ve.dat @@ -0,0 +1,67 @@ +#************************************************************ +#* MadGraph5_aMC@NLO * +#* * +#* * * * +#* * * * * * +#* * * * * 5 * * * * * +#* * * * * * +#* * * * +#* * +#* * +#* VERSION 2.7.3 2020-06-21 * +#* * +#* The MadGraph5_aMC@NLO Development Team - Find us at * +#* https://server06.fynu.ucl.ac.be/projects/madgraph * +#* * +#************************************************************ +#* * +#* Command File for MadGraph5_aMC@NLO * +#* * +#* run as ./bin/mg5_aMC filename * +#* * +#************************************************************ +# card is made by suchita Kulkarni +#contact suchita.kulkarni@cern.ch +set default_unset_couplings 99 +set group_subprocesses Auto +set ignore_six_quark_processes False +set loop_optimized_output True +set loop_color_flows False +set gauge unitary +set complex_mass_scheme False +set max_npoint_for_channel 0 +set auto_convert_model T +import model sm +define p = g u c d s u~ c~ d~ s~ +define j = g u c d s u~ c~ d~ s~ +define l+ = e+ mu+ +define l- = e- mu- +define vl = ve vm vt +define vl~ = ve~ vm~ vt~ +import model SM_HeavyN_CKM_AllMasses_LO +define e = e+ e- +define nue = ve ve~ +generate e+ e- > nue n1, (n1 > e e nue) +output HNL_eenu_50GeV_1p41e-6Ve +launch HNL_eenu_50GeV_1p41e-6Ve +done +# set to electron beams (0 for ele, 1 for proton) +set lpp1 0 +set lpp2 0 +set ebeam1 45.594 +set ebeam2 45.594 +set no_parton_cut +# Here I set mass of the electron HNL +set mn1 50 +# set mass of muon HNL, made heavy here +set mn2 10000 +# set mass of tau HNL, made heavy here +set mn3 10000 +# set electron mixing angle +set ven1 1.41e-6 +# this is important, set the decay width of HNL flavour of interest to auto +# if this is not done, lifetime calculations won'e be right +set WN1 auto +set time_of_flight 0 +set nevents 50000 +done From d1ec38afe9f1b525b5d8056f68d97e2c609bf0c1 Mon Sep 17 00:00:00 2001 From: Juliette Alimena Date: Tue, 25 Oct 2022 13:38:17 +0200 Subject: [PATCH 12/35] rename mg5 proc card to be clearer --- ...at => mg5_proc_card_HNL_Majorana_eenu_50GeV_1p41e-6Ve.dat} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/{mg5_proc_card_HNL_eenu_50GeV_1p41e-6Ve.dat => mg5_proc_card_HNL_Majorana_eenu_50GeV_1p41e-6Ve.dat} (96%) diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_eenu_50GeV_1p41e-6Ve.dat b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Majorana_eenu_50GeV_1p41e-6Ve.dat similarity index 96% rename from examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_eenu_50GeV_1p41e-6Ve.dat rename to examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Majorana_eenu_50GeV_1p41e-6Ve.dat index 8f6c5a4b6f..2d1461d0b5 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_eenu_50GeV_1p41e-6Ve.dat +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Majorana_eenu_50GeV_1p41e-6Ve.dat @@ -42,8 +42,8 @@ import model SM_HeavyN_CKM_AllMasses_LO define e = e+ e- define nue = ve ve~ generate e+ e- > nue n1, (n1 > e e nue) -output HNL_eenu_50GeV_1p41e-6Ve -launch HNL_eenu_50GeV_1p41e-6Ve +output HNL_Majorana_eenu_50GeV_1p41e-6Ve +launch HNL_Majorana_eenu_50GeV_1p41e-6Ve done # set to electron beams (0 for ele, 1 for proton) set lpp1 0 From d9ad8ef60e6c19ee61152d03bac393e24c776ace Mon Sep 17 00:00:00 2001 From: Nayaqs Date: Thu, 10 Nov 2022 16:55:27 +0100 Subject: [PATCH 13/35] Adding mg5 card for Dirac ejj --- ...5_proc_card_HNL_Dirac_ejj_20GeV_1e-3Ve.dat | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Dirac_ejj_20GeV_1e-3Ve.dat diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Dirac_ejj_20GeV_1e-3Ve.dat b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Dirac_ejj_20GeV_1e-3Ve.dat new file mode 100644 index 0000000000..940b19dbad --- /dev/null +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Dirac_ejj_20GeV_1e-3Ve.dat @@ -0,0 +1,69 @@ +#************************************************************ +#* MadGraph5_aMC@NLO * +#* * +#* * * * +#* * * * * * +#* * * * * 5 * * * * * +#* * * * * * +#* * * * +#* * +#* * +#* VERSION 2.7.3 2020-06-21 * +#* * +#* The MadGraph5_aMC@NLO Development Team - Find us at * +#* https://server06.fynu.ucl.ac.be/projects/madgraph * +#* * +#************************************************************ +#* * +#* Command File for MadGraph5_aMC@NLO * +#* * +#* run as ./bin/mg5_aMC filename * +#* * +#************************************************************ +#This card was originally made by suchita Kulkarni +#contact suchita.kulkarni@cern.ch +#Then edited by Dimitri Moulin +#contact dimitri.moulin@etu.unige.ch +set default_unset_couplings 99 +set group_subprocesses Auto +set ignore_six_quark_processes False +set loop_optimized_output True +set loop_color_flows False +set gauge unitary +set complex_mass_scheme False +set max_npoint_for_channel 0 +import model sm +define p = g u c d s u~ c~ d~ s~ +define j = g u c d s u~ c~ d~ s~ +define l+ = e+ mu+ +define l- = e- mu- +define vl = ve vm vt +define vl~ = ve~ vm~ vt~ +import model SM_HeavyN_Dirac_CKM_Masses_LO +generate e+ e- > n1 ve~ , (n1 > ve e+ e-) +add process e+ e- > n1~ ve , (n1~ > e+ e- ve~) +add process e+ e- > n1~ ve , (n1~ > e+ j j) +add process e+ e- > n1 ve~ , (n1 > e- j j ) +output HNL_Dirac_ejj_20GeV_1e-3Ve +launch HNL_Dirac_ejj_20GeV_1e-3Ve +done +# set to electron beams (0 for ele, 1 for proton) +set lpp1 0 +set lpp2 0 +set ebeam1 45.594 +set ebeam2 45.594 +set no_parton_cut +# Here I set mass of the electron HNL +set mn1 20 +# set mass of muon HNL, made heavy here +set mn2 10000 +# set mass of tau HNL, made heavy here +set mn3 10000 +# set electron mixing angle +set ven1 1e-3 +# this is important, set the decay width of HNL flavour of interest to auto +# if this is not done, lifetime calculations won'e be right +set WN1 auto +set time_of_flight 0 +set nevents 10000 +done From bad764d5f0afe2d39b26a4907356ee332c0f3629 Mon Sep 17 00:00:00 2001 From: Nayaqs Date: Thu, 10 Nov 2022 16:56:04 +0100 Subject: [PATCH 14/35] Add mg5 card for Dirac eenu --- ..._proc_card_HNL_Dirac_eenu_20GeV_1e-3Ve.dat | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Dirac_eenu_20GeV_1e-3Ve.dat diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Dirac_eenu_20GeV_1e-3Ve.dat b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Dirac_eenu_20GeV_1e-3Ve.dat new file mode 100644 index 0000000000..bc874988cb --- /dev/null +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Dirac_eenu_20GeV_1e-3Ve.dat @@ -0,0 +1,68 @@ +#************************************************************ +#* MadGraph5_aMC@NLO * +#* * +#* * * * +#* * * * * * +#* * * * * 5 * * * * * +#* * * * * * +#* * * * +#* * +#* * +#* VERSION 2.7.3 2020-06-21 * +#* * +#* The MadGraph5_aMC@NLO Development Team - Find us at * +#* https://server06.fynu.ucl.ac.be/projects/madgraph * +#* * +#************************************************************ +#* * +#* Command File for MadGraph5_aMC@NLO * +#* * +#* run as ./bin/mg5_aMC filename * +#* * +#************************************************************ +#This card was originally made by suchita Kulkarni +#contact suchita.kulkarni@cern.ch +#Then edited by Dimitri Moulin +#contact dimitri.moulin@etu.unige.ch + +set default_unset_couplings 99 +set group_subprocesses Auto +set ignore_six_quark_processes False +set loop_optimized_output True +set loop_color_flows False +set gauge unitary +set complex_mass_scheme False +set max_npoint_for_channel 0 +import model sm +define p = g u c d s u~ c~ d~ s~ +define j = g u c d s u~ c~ d~ s~ +define l+ = e+ mu+ +define l- = e- mu- +define vl = ve vm vt +define vl~ = ve~ vm~ vt~ +import model SM_HeavyN_Dirac_CKM_Masses_LO +generate e+ e- > n1 ve~ , (n1 > ve e+ e-) +add process e+ e- > n1~ ve , (n1~ > ve~ e+ e-) +output HNL_Dirac_eenu_20GeV_1e-3Ve +launch HNL_Dirac_eenu_20GeV_1e-3Ve +done +# set to electron beams (0 for ele, 1 for proton) +set lpp1 0 +set lpp2 0 +set ebeam1 45.594 +set ebeam2 45.594 +set no_parton_cut +# Here I set mass of the electron HNL +set mn1 20 +# set mass of muon HNL, made heavy here +set mn2 10000 +# set mass of tau HNL, made heavy here +set mn3 10000 +# set electron mixing angle +set ven1 1e-3 +# this is important, set the decay width of HNL flavour of interest to auto +# if this is not done, lifetime calculations won'e be right +set WN1 auto +set time_of_flight 0 +set nevents 10000 +done From 809b7f3545638f2811e2691b4d11156e4a469be6 Mon Sep 17 00:00:00 2001 From: Nayaqs Date: Thu, 10 Nov 2022 16:56:33 +0100 Subject: [PATCH 15/35] add mg5 card for Majorana ejj --- ...roc_card_HNL_Majorana_ejj_20GeV_1e-3Ve.dat | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Majorana_ejj_20GeV_1e-3Ve.dat diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Majorana_ejj_20GeV_1e-3Ve.dat b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Majorana_ejj_20GeV_1e-3Ve.dat new file mode 100644 index 0000000000..478890b83d --- /dev/null +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Majorana_ejj_20GeV_1e-3Ve.dat @@ -0,0 +1,73 @@ +#************************************************************ +#* MadGraph5_aMC@NLO * +#* * +#* * * * +#* * * * * * +#* * * * * 5 * * * * * +#* * * * * * +#* * * * +#* * +#* * +#* VERSION 2.7.3 2020-06-21 * +#* * +#* The MadGraph5_aMC@NLO Development Team - Find us at * +#* https://server06.fynu.ucl.ac.be/projects/madgraph * +#* * +#************************************************************ +#* * +#* Command File for MadGraph5_aMC@NLO * +#* * +#* run as ./bin/mg5_aMC filename * +#* * +#************************************************************ +#This card was originally made by suchita Kulkarni +#contact suchita.kulkarni@cern.ch +#Then modified by Dimitri Moulin +#contact dimitri.moulin@etu.unige.ch +set default_unset_couplings 99 +set group_subprocesses Auto +set ignore_six_quark_processes False +set loop_optimized_output True +set loop_color_flows False +set gauge unitary +set complex_mass_scheme False +set max_npoint_for_channel 0 +import model sm +define p = g u c d s u~ c~ d~ s~ +define j = g u c d s u~ c~ d~ s~ +define l+ = e+ mu+ +define l- = e- mu- +define vl = ve vm vt +define vl~ = ve~ vm~ vt~ +import model SM_HeavyN_CKM_AllMasses_LO +generate e+ e- > n1 ve , (n1 > ve e+ e-) +add process e+ e- > n1 ve~ , (n1 > ve~ e+ e-) +add process e+ e- > n1 ve , (n1 > e+ e- ve~) +add process e+ e- > n1 ve~ , (n1 > e- e+ ve) +add process e+ e- > n1 ve , (n1 > e+ j j) +add process e+ e- > n1 ve , (n1 > e- j j) +add process e+ e- > n1 ve~ , (n1 > e+ j j) +add process e+ e- > n1 ve~ , (n1 > e- j j) +output HNL_Majorana_ejj_20GeV_1e-3Ve +launch HNL_Majorana_ejj_20GeV_1e-3Ve +done +# set to electron beams (0 for ele, 1 for proton) +set lpp1 0 +set lpp2 0 +set ebeam1 45.594 +set ebeam2 45.594 +set no_parton_cut +# Here I set mass of the electron HNL +set mn1 20 +# set mass of muon HNL, made heavy here +set mn2 10000 +# set mass of tau HNL, made heavy here +set mn3 10000 +# set electron mixing angle +set ven1 1e-3 +# this is important, set the decay width of HNL flavour of interest to auto +# if this is not done, lifetime calculations won'e be right +set WN1 auto +set time_of_flight 0 +set nevents 10000 +done From 8374e7d5d159b7b3379f1f6504c044acb413bf3d Mon Sep 17 00:00:00 2001 From: Nayaqs Date: Thu, 10 Nov 2022 16:57:09 +0100 Subject: [PATCH 16/35] Adding plotting_tools directory, containing scripts and readme --- .../DisplacedHNL/plotting_tools/Readme.md | 41 ++++ .../DisplacedHNL/plotting_tools/make_plots.py | 192 ++++++++++++++++++ .../plotting_tools/make_selection.py | 56 +++++ 3 files changed, 289 insertions(+) create mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md create mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_plots.py create mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_selection.py diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md new file mode 100644 index 0000000000..05d88a5a20 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md @@ -0,0 +1,41 @@ +# How to run the code +
+Show/Hide Table of Contents + +[[_TOC_]] + +
+ +## Overview + +This text file describes how to produce ratio plots for comparing Dirac and Majorana HNLs. +Below is a description of how to modify 'make_selection.py' and 'make_plots.py'. + +## make_selection.py +This script is used to select the variables to be plotted. It returns a .root file containing the selected variables histograms. You must run it both for your Dirac and Majorana samples. +### How to adapt it to your needs +First, specify the path of the input file. The input file corresponds to the output file of 'analysis_final.py'. The path should look like : +'/afs/cern.ch/user/d/dimoulin/FCCAnalyses_new/Analysis/outputs/HNL_Majorana_ejj_20GeV_1e-3Ve/output_finalSel/HNL_Majorana_ejj_20GeV_1e-3Ve_selNone_histo.root' +Next, specify the variables to be plotted, e.g if you want to plot the reconstructed electron energy (RecoElectron_e) you must include the line : +'histSelect.WriteObject(hist_file.Get("RecoElectron_e"), "RecoElectron_e")' +Finally, specify the name of the output file e.g : +'output_file = "histMajorana_ejj_Select.root"' +You can then run the script using 'python make_selection.py' + +## make_plots.py +This script produces ratio plots of the previously selected variables. +### How to adapt it to your needs +You need to specify the path to the selection files : +'input_file_Dirac = 'histDirac_ejj_Select.root'' +'input_file_Majorana = 'histMajorana_ejj_Select.root'' +As well as the output directory : +'output_dir = "20GeV_ejj_plots/"' + +Then you must add the selected variables to the 'variables_list'. + +### Miscellaneous +You can modify the legend by modifying the second entry of 'files_list', as well as the colors of the graphs by modifying the 'colors' list. Finally, the plots are currently saved in .png, you can modify this to any supported extension you like. + + + + diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_plots.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_plots.py new file mode 100644 index 0000000000..39e9cfb3e4 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_plots.py @@ -0,0 +1,192 @@ +import ROOT +import os +# plots don't appear while you run +ROOT.gROOT.SetBatch(0) +# no stat box on plots +ROOT.gStyle.SetOptStat(0) +# no title shown +ROOT.gStyle.SetOptTitle(0) + + +output_dir = "outputs/20GeV_ejj_plots/" +input_file_Dirac = 'histDirac_ejj_Select.root' +input_file_Majorana = 'histMajorana_ejj_Select.root' + +if not os.path.exists(output_dir): + os.mkdir(output_dir) + print("Directory ",output_dir," Created ") +else: + print("Directory ",output_dir," already exists") + +# list of lists +# each internal list: hist name, x title, y title, rebin (if needed) +variables_list = [ + ["RecoElectron_pt", "Reco electron pt", "Entries", 3], + ["RecoElectron_phi", "Reco Electron phi", "Entries", 3], + ["RecoElectron_theta", "Reco Electron theta", "Entries", 3], + ["RecoElectron_e", "Reco Electron energy", "Entries", 3], + ["RecoMissingEnergy_e", "Reco Missing_e", "Entries", 3], + ["RecoMissingEnergy_pt", "Reco Missing_pt", "Entries", 3], + ["RecoMissingEnergy_p", "Reco Missing_p", "Entries", 3], + ["RecoMissingEnergy_px", "Reco Missing_px", "Entries", 3], + ["RecoMissingEnergy_py", "Reco Missing_py", "Entries", 3], + ["RecoMissingEnergy_pz", "Reco Missing_pz", "Entries", 3], + ["RecoMissingEnergy_eta", "Reco Missing_eta", "Entries", 3], + ["RecoMissingEnergy_theta", "Reco Missing_theta", "Entries", 3], + ["RecoMissingEnergy_phi", "Reco Missing_phi", "Entries", 3], + + ["n_RecoJets", "Number of RecoJets", "Entries", 3], + ["RecoJet_e", "Reco Jet energy", "Entries", 3], + ["RecoJet_p", "Reco Jet p", "Entries", 3], + ["RecoJet_pt", "Reco Jet pt", "Entries", 3], + ["RecoJet_pz", "Reco Jet pz", "Entries", 3], + ["RecoJet_eta", "Reco Jet eta", "Entries", 3], + ["RecoJet_theta", "Reco Jet theta", "Entries", 3], + ["RecoJet_phi", "Reco Jet phi", "Entries", 3], + ["RecoJet_charge", "Reco Jet charge", "Entries", 3], + ["RecoJetTrack_absD0", "Reco Jet abs_DO", "Entries", 3], + ["RecoJetTrack_absZ0", "Reco Jet abs_Z0", "Entries", 3], + ["RecoJetTrack_absD0sig", "Reco Jet sigma(abs_D0)", "Entries", 3], + ["RecoJetTrack_absZ0sig", "Reco Jet sigma(abs_Z0)", "Entries", 3], + ["RecoJetTrack_D0cov", "Reco Jet cov(D0)", "Entries", 3], + ["RecoJetTrack_Z0cov", "Reco Jet cov(Z0)", "Entries", 3], + + +# ['hnlLT', 'Lifetime [s]', 'Entries'], +# ['angsepR', 'Reco Cos#theta ee', 'Entries', 5], +# ['angsep', 'Cos#theta ee', 'Entries', 5], +# ['et', 'Missing energy [GeV]', 'Entries'], +# ['eTruthE', 'Electron energy [GeV]', 'Entries'] , +# ['eTruthP', 'Positron energy [GeV]', 'Entries'] , +# ['eRecoE', 'Reco Electron energy [GeV]', 'Entries'] , +# ['eRecoP', 'Reco Positron energy [GeV]', 'Entries'] , +# ['etaRE', 'Reco electron #eta', 'Entries'] , +# ['etaRP', 'Reco positron #eta', 'Entries'] , +# ['phiRE', 'Reco electron #phi', 'Entries'] , +# ['phiRP', 'Reco positron #phi', 'Entries'] , +# ['deletaR', 'Reco del eta ee', 'Entries'] , +# ['delphiR', 'Reco del phi ee', 'Entries'] , +# ['delRR', 'Reco del R ee', 'Entries'] , +# ['etaE', 'electron #eta', 'Entries'] , +# ['etaP', 'positron #eta', 'Entries'] , +# ['phiE', 'electron #phi', 'Entries'] , +# ['phiP', 'positron #phi', 'Entries'] , +# ['deleta', 'del eta ee', 'Entries'] , +# ['delphi', 'del phi ee', 'Entries'] , +# ['delR', 'del R ee', 'Entries'] , +# ['xmRE', 'Reco Px electron [GeV]', 'Entries'] , +# ['ymRE', 'Reco Py electron [GeV]', 'Entries'] , +# ['zmRE', 'Reco Pz electron [GeV]', 'Entries'] , +# ['xmRP', 'Reco Px positron [GeV]', 'Entries'] , +# ['ymRP', 'Reco Py positron (GeV', 'Entries'] , +# ['zmRP', 'Reco Pz positron [GeV]', 'Entries'] , +# ['tmRE', 'Reco pT electron [GeV]', 'Entries'] , +# ['tmRP', 'Reco pT positron [GeV]', 'Entries'] , +# ['xmTE', 'Px electron [GeV]', 'Entries'] , +# ['ymTE', 'Py electron [GeV]', 'Entries'] , +# ['zmTE', 'Pz electron [GeV]', 'Entries'] , +# ['xmTP', 'Px positron [GeV]', 'Entries'] , +# ['ymTP', 'Py positron [GeV]', 'Entries'] , +# ['zmTP', 'Pz positron [GeV]', 'Entries'] , +# ['tmTE', 'pT electron [GeV]', 'Entries'] , +# ['tmTP', 'pT positron [GeV]', 'Entries'] , +# ['dispvrtx', 'displaced vetex [m]', 'Entries'] +] + +files_list = [ + [input_file_Majorana , 'Majorana 20 GeV semi-leptonic'], + [input_file_Dirac , 'Dirac 20 GeV semi-leptonic'] +] + +legend_list = [f[1] for f in files_list] +colors = [609, 856, 410, 801, 629, 879, 602, 921, 622] + +def make_plot(h_list, plot_info, legend_list): + # print('looking at histogram:', plot_info[0]) + c = ROOT.TCanvas("can"+plot_info[0],"can"+plot_info[0],600,600) + pad1 = ROOT.TPad("pad1", "pad1",0.0,0.35,1.0,1.0,21) + pad2 = ROOT.TPad("pad2", "pad2",0.0,0.0,1.0,0.35,22) + + pad1.SetFillColor(0) + pad1.SetBottomMargin(0.01) + pad1.SetTickx() + pad1.SetTicky() + pad1.Draw() + + pad2.SetFillColor(0) + pad2.SetTopMargin(0.01) + pad2.SetBottomMargin(0.3) + pad2.Draw() + + leg = ROOT.TLegend(0.55, 0.7, 0.87, 0.87) + leg.SetFillStyle(0) + leg.SetLineWidth(0) + + h_max = 0 + for ih,h in enumerate(h_list): + leg.AddEntry(h, legend_list[ih]) + if len(plot_info)>3: + h.Rebin(plot_info[3]) + if h.GetMaximum() > h_max: + h_max = h.GetMaximum() + h.Sumw2() + + # Draw in the top panel + pad1.cd() + for ih,h in enumerate(h_list): + h.SetLineColor(colors[ih]) + h.SetLineWidth(3) + h.GetXaxis().SetTitle(plot_info[1]) + h.GetYaxis().SetTitle(plot_info[2]) + h.GetYaxis().SetTitleSize(h.GetYaxis().GetTitleSize()*1.5) + h.GetYaxis().SetTitleOffset(0.8) + h.SetMaximum(1.25*h_max) + h.Draw('same') + h.Draw('same E') + leg.Draw() + pad1.RedrawAxis() + + # build ratios + h_ratios = [] + for ih,h in enumerate(h_list): + if ih == 0: + h_ratios.append(h.Clone('h_ratio_0')) + for ibin in range(-1, h.GetNbinsX()+1): + h_ratios[0].SetBinContent(ibin,1) + else: + h_ratios.append(h.Clone('h_ratio_'+str(ih))) + h_ratios[ih].Divide(h_list[0]) + + # draw in the bottom panel + pad2.cd() + for ih,h in enumerate(h_ratios): + h.SetMaximum(1.5) + h.SetMinimum(0.5) + + h.GetYaxis().SetTitle("Ratio to "+legend_list[0]) + h.GetYaxis().SetLabelSize(h.GetYaxis().GetLabelSize()*1.6) + h.GetYaxis().SetLabelOffset(0.01) + h.GetYaxis().SetTitleSize(h.GetYaxis().GetTitleSize()*1.6) + h.GetYaxis().SetTitleOffset(0.5) + + h.GetXaxis().SetLabelSize(h.GetXaxis().GetLabelSize()*2.3) + #h.GetXaxis().SetLabelOffset(0.02) + h.GetXaxis().SetTitleSize(h.GetXaxis().GetTitleSize()*3) + h.GetXaxis().SetTitleOffset(1.05) + + h.Draw('hist same') + if ih>0: + h.Draw('same E') + c.SaveAs(output_dir + plot_info[0]+'.png') + return + +for plot_info in variables_list: + h_list = [] + print('looking at histogram:', plot_info[0]) + for ifile,fil in enumerate(files_list): + f = ROOT.TFile.Open(fil[0]) + h = f.Get(plot_info[0]) + h.SetDirectory(0) + h_list.append(h) + f.Close() + make_plot(h_list, plot_info, legend_list) diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_selection.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_selection.py new file mode 100644 index 0000000000..b26d2e5eef --- /dev/null +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_selection.py @@ -0,0 +1,56 @@ +import ROOT +input_path = "/afs/cern.ch/user/d/dimoulin/FCCAnalyses_new/Analysis/outputs/HNL_Majorana_20GeV_1e-3Ve_jets_n50000/output_finalSel/HNL_Majorana_20GeV_1e-3Ve_jets_n50000_selNone_histo.root" +output_file = "histMajorana_ejj_Select.root" + +hist_file = ROOT.TFile.Open(input_path) +#hist_file = ROOT.TFile.Open("../outputs/HNL_Majorana_20GeV_1e-3Ve/HNL_Majorana_20GeV_1e-3Ve_jets_selNone_histo.root") +histSelect = ROOT.TFile.Open(output_file, "RECREATE") + +#Object variables +histSelect.WriteObject(hist_file.Get("RecoElectron_pt"), "RecoElectron_pt") +histSelect.WriteObject(hist_file.Get("RecoElectron_phi"), "RecoElectron_phi") +histSelect.WriteObject(hist_file.Get("RecoElectron_theta"), "RecoElectron_theta") +histSelect.WriteObject(hist_file.Get("RecoElectron_e"), "RecoElectron_e") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_e"), "RecoMissingEnergy_e") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_p"), "RecoMissingEnergy_p") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_pt"), "RecoMissingEnergy_pt") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_px"), "RecoMissingEnergy_px") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_py"), "RecoMissingEnergy_py") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_pz"), "RecoMissingEnergy_pz") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_eta"), "RecoMissingEnergy_eta") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_theta"), "RecoMissingEnergy_theta") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_phi"), "RecoMissingEnergy_phi") + +# Jet variables +histSelect.WriteObject(hist_file.Get("n_RecoJets"), "n_RecoJets") +histSelect.WriteObject(hist_file.Get("RecoJet_e"), "RecoJet_e") +histSelect.WriteObject(hist_file.Get("RecoJet_p"), "RecoJet_p") +histSelect.WriteObject(hist_file.Get("RecoJet_pt"), "RecoJet_pt") +histSelect.WriteObject(hist_file.Get("RecoJet_pz"), "RecoJet_pz") +histSelect.WriteObject(hist_file.Get("RecoJet_eta"), "RecoJet_eta") +histSelect.WriteObject(hist_file.Get("RecoJet_theta"), "RecoJet_theta") +histSelect.WriteObject(hist_file.Get("RecoJet_phi"), "RecoJet_phi") +histSelect.WriteObject(hist_file.Get("RecoJet_charge"), "RecoJet_charge") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_absD0"), "RecoJetTrack_absD0") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_absZ0"), "RecoJetTrack_absZ0") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_absD0sig"), "RecoJetTrack_absD0sig") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_absZ0sig"), "RecoJetTrack_absZ0sig") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_D0cov"), "RecoJetTrack_D0cov") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_Z0cov"), "RecoJetTrack_Z0cov") +#histSelect.WriteObject(hist_file.Get(""), "") + + + + + + + + + + + + + + + + From 6b0c7c8c3c9d99d7496e82092ff0fad39811c9a8 Mon Sep 17 00:00:00 2001 From: Nayaqs <88377894+Nayaqs@users.noreply.github.com> Date: Thu, 10 Nov 2022 17:49:23 +0100 Subject: [PATCH 17/35] Update Readme.md --- examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md index 05d88a5a20..618071d51f 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md @@ -14,8 +14,8 @@ Below is a description of how to modify 'make_selection.py' and 'make_plots.py'. ## make_selection.py This script is used to select the variables to be plotted. It returns a .root file containing the selected variables histograms. You must run it both for your Dirac and Majorana samples. ### How to adapt it to your needs -First, specify the path of the input file. The input file corresponds to the output file of 'analysis_final.py'. The path should look like : -'/afs/cern.ch/user/d/dimoulin/FCCAnalyses_new/Analysis/outputs/HNL_Majorana_ejj_20GeV_1e-3Ve/output_finalSel/HNL_Majorana_ejj_20GeV_1e-3Ve_selNone_histo.root' +First, specify the path of the input file. The input file corresponds to the output file of '''analysis_final.py'''. The path should look like : +'''/afs/cern.ch/user/d/dimoulin/FCCAnalyses_new/Analysis/outputs/HNL_Majorana_ejj_20GeV_1e-3Ve/output_finalSel/HNL_Majorana_ejj_20GeV_1e-3Ve_selNone_histo.root''' Next, specify the variables to be plotted, e.g if you want to plot the reconstructed electron energy (RecoElectron_e) you must include the line : 'histSelect.WriteObject(hist_file.Get("RecoElectron_e"), "RecoElectron_e")' Finally, specify the name of the output file e.g : From b3b96fd03cd66ba9912bca2080c86eb7dc009b89 Mon Sep 17 00:00:00 2001 From: Nayaqs <88377894+Nayaqs@users.noreply.github.com> Date: Thu, 10 Nov 2022 17:50:19 +0100 Subject: [PATCH 18/35] Update Readme.md --- examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md index 618071d51f..501b675c8f 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md @@ -9,7 +9,7 @@ ## Overview This text file describes how to produce ratio plots for comparing Dirac and Majorana HNLs. -Below is a description of how to modify 'make_selection.py' and 'make_plots.py'. +Below is a description of how to modify `make_selection.py` and `make_plots.py`. ## make_selection.py This script is used to select the variables to be plotted. It returns a .root file containing the selected variables histograms. You must run it both for your Dirac and Majorana samples. From ca8cdcfab4ce394d8adc2aa1b5dd9d56ffe59138 Mon Sep 17 00:00:00 2001 From: Nayaqs <88377894+Nayaqs@users.noreply.github.com> Date: Thu, 10 Nov 2022 17:52:24 +0100 Subject: [PATCH 19/35] Update Readme.md --- .../DisplacedHNL/plotting_tools/Readme.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md index 501b675c8f..6b7b08870c 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/Readme.md @@ -14,27 +14,27 @@ Below is a description of how to modify `make_selection.py` and `make_plots.py`. ## make_selection.py This script is used to select the variables to be plotted. It returns a .root file containing the selected variables histograms. You must run it both for your Dirac and Majorana samples. ### How to adapt it to your needs -First, specify the path of the input file. The input file corresponds to the output file of '''analysis_final.py'''. The path should look like : -'''/afs/cern.ch/user/d/dimoulin/FCCAnalyses_new/Analysis/outputs/HNL_Majorana_ejj_20GeV_1e-3Ve/output_finalSel/HNL_Majorana_ejj_20GeV_1e-3Ve_selNone_histo.root''' +First, specify the path of the input file. The input file corresponds to the output file of `analysis_final.py`. The path should look like : +`/afs/cern.ch/user/d/dimoulin/FCCAnalyses_new/Analysis/outputs/HNL_Majorana_ejj_20GeV_1e-3Ve/output_finalSel/HNL_Majorana_ejj_20GeV_1e-3Ve_selNone_histo.root` Next, specify the variables to be plotted, e.g if you want to plot the reconstructed electron energy (RecoElectron_e) you must include the line : -'histSelect.WriteObject(hist_file.Get("RecoElectron_e"), "RecoElectron_e")' +`histSelect.WriteObject(hist_file.Get("RecoElectron_e"), "RecoElectron_e")` Finally, specify the name of the output file e.g : -'output_file = "histMajorana_ejj_Select.root"' -You can then run the script using 'python make_selection.py' +`output_file = "histMajorana_ejj_Select.root"` +You can then run the script using `python make_selection.py` ## make_plots.py This script produces ratio plots of the previously selected variables. ### How to adapt it to your needs You need to specify the path to the selection files : -'input_file_Dirac = 'histDirac_ejj_Select.root'' -'input_file_Majorana = 'histMajorana_ejj_Select.root'' +`input_file_Dirac = 'histDirac_ejj_Select.root'` +`input_file_Majorana = 'histMajorana_ejj_Select.root'` As well as the output directory : -'output_dir = "20GeV_ejj_plots/"' +`output_dir = "20GeV_ejj_plots/"` -Then you must add the selected variables to the 'variables_list'. +Then you must add the selected variables to the `variables_list`. ### Miscellaneous -You can modify the legend by modifying the second entry of 'files_list', as well as the colors of the graphs by modifying the 'colors' list. Finally, the plots are currently saved in .png, you can modify this to any supported extension you like. +You can modify the legend by modifying the second entry of `files_list`, as well as the colors of the graphs by modifying the `colors` list. Finally, the plots are currently saved in .png, you can modify this to any supported extension you like. From 2d85a2f60643382d9225e27162e15b6c361194e5 Mon Sep 17 00:00:00 2001 From: Nayaqs Date: Mon, 14 Nov 2022 18:31:06 +0100 Subject: [PATCH 20/35] Added log_scale variable along with axis title modification to plot on log scale axis. Also corrected the ratio legend --- .../DisplacedHNL/plotting_tools/make_plots.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_plots.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_plots.py index 39e9cfb3e4..4bc508c245 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_plots.py +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_plots.py @@ -8,10 +8,13 @@ ROOT.gStyle.SetOptTitle(0) -output_dir = "outputs/20GeV_ejj_plots/" +output_dir = "test_log_false/" input_file_Dirac = 'histDirac_ejj_Select.root' input_file_Majorana = 'histMajorana_ejj_Select.root' +# Set plot log-scale plots, default: False +log_scale = False + if not os.path.exists(output_dir): os.mkdir(output_dir) print("Directory ",output_dir," Created ") @@ -94,11 +97,12 @@ ] files_list = [ - [input_file_Majorana , 'Majorana 20 GeV semi-leptonic'], - [input_file_Dirac , 'Dirac 20 GeV semi-leptonic'] + [input_file_Majorana , 'Majorana 20 GeV semi-leptonic', 'Majorana'], + [input_file_Dirac , 'Dirac 20 GeV semi-leptonic', 'Dirac'] ] legend_list = [f[1] for f in files_list] +ratio_list = [f[2] for f in files_list] colors = [609, 856, 410, 801, 629, 879, 602, 921, 622] def make_plot(h_list, plot_info, legend_list): @@ -109,6 +113,7 @@ def make_plot(h_list, plot_info, legend_list): pad1.SetFillColor(0) pad1.SetBottomMargin(0.01) + if log_scale == True : pad1.SetLogy() pad1.SetTickx() pad1.SetTicky() pad1.Draw() @@ -137,7 +142,7 @@ def make_plot(h_list, plot_info, legend_list): h.SetLineColor(colors[ih]) h.SetLineWidth(3) h.GetXaxis().SetTitle(plot_info[1]) - h.GetYaxis().SetTitle(plot_info[2]) + h.GetYaxis().SetTitle(plot_info[2]) if log_scale == False else h.GetYaxis().SetTitle("log " + plot_info[2]) h.GetYaxis().SetTitleSize(h.GetYaxis().GetTitleSize()*1.5) h.GetYaxis().SetTitleOffset(0.8) h.SetMaximum(1.25*h_max) @@ -163,7 +168,7 @@ def make_plot(h_list, plot_info, legend_list): h.SetMaximum(1.5) h.SetMinimum(0.5) - h.GetYaxis().SetTitle("Ratio to "+legend_list[0]) + h.GetYaxis().SetTitle("Ratio to "+ratio_list[0]) h.GetYaxis().SetLabelSize(h.GetYaxis().GetLabelSize()*1.6) h.GetYaxis().SetLabelOffset(0.01) h.GetYaxis().SetTitleSize(h.GetYaxis().GetTitleSize()*1.6) From f2c561e31495da3545655a44493dc715bee59d24 Mon Sep 17 00:00:00 2001 From: Juliette Alimena Date: Thu, 17 Nov 2022 10:10:06 +0100 Subject: [PATCH 21/35] add HNL-->eenu mg5 proc card for validation --- ...oc_card_HNL_Majorana_eenu_50GeV_1e-5Ve.dat | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Majorana_eenu_50GeV_1e-5Ve.dat diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Majorana_eenu_50GeV_1e-5Ve.dat b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Majorana_eenu_50GeV_1e-5Ve.dat new file mode 100644 index 0000000000..63cbb8338e --- /dev/null +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Majorana_eenu_50GeV_1e-5Ve.dat @@ -0,0 +1,67 @@ +#************************************************************ +#* MadGraph5_aMC@NLO * +#* * +#* * * * +#* * * * * * +#* * * * * 5 * * * * * +#* * * * * * +#* * * * +#* * +#* * +#* VERSION 2.7.3 2020-06-21 * +#* * +#* The MadGraph5_aMC@NLO Development Team - Find us at * +#* https://server06.fynu.ucl.ac.be/projects/madgraph * +#* * +#************************************************************ +#* * +#* Command File for MadGraph5_aMC@NLO * +#* * +#* run as ./bin/mg5_aMC filename * +#* * +#************************************************************ +# card is made by suchita Kulkarni +#contact suchita.kulkarni@cern.ch +set default_unset_couplings 99 +set group_subprocesses Auto +set ignore_six_quark_processes False +set loop_optimized_output True +set loop_color_flows False +set gauge unitary +set complex_mass_scheme False +set max_npoint_for_channel 0 +set auto_convert_model T +import model sm +define p = g u c d s u~ c~ d~ s~ +define j = g u c d s u~ c~ d~ s~ +define l+ = e+ mu+ +define l- = e- mu- +define vl = ve vm vt +define vl~ = ve~ vm~ vt~ +import model SM_HeavyN_CKM_AllMasses_LO +define e = e+ e- +define nue = ve ve~ +generate e+ e- > nue n1, (n1 > e e nue) +output HNL_Majorana_eenu_50GeV_1e-5Ve +launch HNL_Majorana_eenu_50GeV_1e-5Ve +done +# set to electron beams (0 for ele, 1 for proton) +set lpp1 0 +set lpp2 0 +set ebeam1 45.594 +set ebeam2 45.594 +set no_parton_cut +# Here I set mass of the electron HNL +set mn1 50 +# set mass of muon HNL, made heavy here +set mn2 10000 +# set mass of tau HNL, made heavy here +set mn3 10000 +# set electron mixing angle +set ven1 1e-5 +# this is important, set the decay width of HNL flavour of interest to auto +# if this is not done, lifetime calculations won'e be right +set WN1 auto +set time_of_flight 0 +set nevents 50000 +done From c980f0057b29953138f2a419303a3fe9fa2c8f1d Mon Sep 17 00:00:00 2001 From: Nayaqs Date: Thu, 17 Nov 2022 11:58:04 +0100 Subject: [PATCH 22/35] Removed undesired eenunu final state --- .../mg5_proc_card_HNL_Dirac_ejj_20GeV_1e-3Ve.dat | 8 ++++---- .../mg5_proc_card_HNL_Majorana_ejj_20GeV_1e-3Ve.dat | 8 +++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Dirac_ejj_20GeV_1e-3Ve.dat b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Dirac_ejj_20GeV_1e-3Ve.dat index 940b19dbad..478353f365 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Dirac_ejj_20GeV_1e-3Ve.dat +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Dirac_ejj_20GeV_1e-3Ve.dat @@ -40,9 +40,9 @@ define l- = e- mu- define vl = ve vm vt define vl~ = ve~ vm~ vt~ import model SM_HeavyN_Dirac_CKM_Masses_LO -generate e+ e- > n1 ve~ , (n1 > ve e+ e-) -add process e+ e- > n1~ ve , (n1~ > e+ e- ve~) -add process e+ e- > n1~ ve , (n1~ > e+ j j) +define e = e+ e- +define nue = ve ve~ +generate e+ e- > n1~ ve , (n1~ > e+ j j) add process e+ e- > n1 ve~ , (n1 > e- j j ) output HNL_Dirac_ejj_20GeV_1e-3Ve launch HNL_Dirac_ejj_20GeV_1e-3Ve @@ -65,5 +65,5 @@ set ven1 1e-3 # if this is not done, lifetime calculations won'e be right set WN1 auto set time_of_flight 0 -set nevents 10000 +set nevents 50000 done diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Majorana_ejj_20GeV_1e-3Ve.dat b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Majorana_ejj_20GeV_1e-3Ve.dat index 478890b83d..e2d7947b84 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Majorana_ejj_20GeV_1e-3Ve.dat +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/HNL_sample_creation/mg5_proc_card_HNL_Majorana_ejj_20GeV_1e-3Ve.dat @@ -40,11 +40,9 @@ define l- = e- mu- define vl = ve vm vt define vl~ = ve~ vm~ vt~ import model SM_HeavyN_CKM_AllMasses_LO -generate e+ e- > n1 ve , (n1 > ve e+ e-) -add process e+ e- > n1 ve~ , (n1 > ve~ e+ e-) -add process e+ e- > n1 ve , (n1 > e+ e- ve~) -add process e+ e- > n1 ve~ , (n1 > e- e+ ve) -add process e+ e- > n1 ve , (n1 > e+ j j) +define e = e+ e- +define nue = ve ve~ +generate e+ e- > n1 ve , (n1 > e+ j j) add process e+ e- > n1 ve , (n1 > e- j j) add process e+ e- > n1 ve~ , (n1 > e+ j j) add process e+ e- > n1 ve~ , (n1 > e- j j) From f6b737ef3f204809e5f59d629cedddf4a59bcdc1 Mon Sep 17 00:00:00 2001 From: Nayaqs Date: Thu, 1 Dec 2022 13:17:03 +0100 Subject: [PATCH 23/35] Added selMC function definition from FCCPhysicsPerformance. This function selects particles from the mother particle (in decays). --- analyzers/dataframe/FCCAnalyses/MCParticle.h | 7 +++++++ analyzers/dataframe/src/MCParticle.cc | 22 ++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/analyzers/dataframe/FCCAnalyses/MCParticle.h b/analyzers/dataframe/FCCAnalyses/MCParticle.h index 9518974952..84a840b493 100644 --- a/analyzers/dataframe/FCCAnalyses/MCParticle.h +++ b/analyzers/dataframe/FCCAnalyses/MCParticle.h @@ -36,6 +36,13 @@ namespace MCParticle{ ROOT::VecOps::RVec operator() (ROOT::VecOps::RVec in); }; + struct selMC_leg{ + selMC_leg( int idx ); + int m_idx; + ROOT::VecOps::RVec operator() (ROOT::VecOps::RVec list_of_indices, + ROOT::VecOps::RVec in) ; +}; + /// select MCParticles with their status struct sel_genStatus { sel_genStatus(int arg_status); diff --git a/analyzers/dataframe/src/MCParticle.cc b/analyzers/dataframe/src/MCParticle.cc index db5c9f8499..706639b0ee 100644 --- a/analyzers/dataframe/src/MCParticle.cc +++ b/analyzers/dataframe/src/MCParticle.cc @@ -36,6 +36,28 @@ ROOT::VecOps::RVec sel_pdgID::operator() (ROOT::VecOps return result; } +selMC_leg::selMC_leg( int idx ) { + m_idx = idx; +}; + +// I return a vector instead of a single particle : +// - such that the vector is empty when there is no such decay mode (instead +// of returning a dummy particle) +// - such that I can use the getMC_theta etc functions, which work with a +// ROOT::VecOps::RVec of particles, and not a single particle + +ROOT::VecOps::RVec selMC_leg::operator() ( ROOT::VecOps::RVec list_of_indices, ROOT::VecOps::RVec in) { + ROOT::VecOps::RVec res; + if ( list_of_indices.size() == 0) return res; + if ( m_idx < list_of_indices.size() ) { + res.push_back( sel_byIndex( list_of_indices[m_idx], in ) ); + return res; + } + else { + std::cout << " !!! in selMC_leg: idx = " << m_idx << " but size of list_of_indices = " << list_of_indices.size() << std::endl; + } + return res; +} get_decay::get_decay(int arg_mother, int arg_daughters, bool arg_inf){m_mother=arg_mother; m_daughters=arg_daughters; m_inf=arg_inf;}; From af5a25c469ea54d71276ce7b2a47f7d33eb478ce Mon Sep 17 00:00:00 2001 From: Nayaqs Date: Thu, 1 Dec 2022 13:20:50 +0100 Subject: [PATCH 24/35] Update of Analysis files. Now includes Jet variable analyses, Leading Jet, Secondary Jet variables, Decay (prompt) electron variables as well as differences (E, pt, phi, eta, DeltaR) between leading jet and electron or secondary jet. Added HNL lifetime to the study as well as a GenJet object (JetCollection) to get the Jet multiplicity at truth level and Jet energy. --- .../bsm/LLPs/DisplacedHNL/analysis_final.py | 111 ++++++++---------- .../bsm/LLPs/DisplacedHNL/analysis_stage1.py | 110 ++++++++++++++++- 2 files changed, 153 insertions(+), 68 deletions(-) diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py index 1b9f08c174..13416ab4c8 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_final.py @@ -1,51 +1,14 @@ #Input directory where the files produced at the stage1 level are -inputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/output_stage1" +inputDir = "/afs/cern.ch/user/d/dimoulin/FCCAnalyses_new/FCC-LLP/FCCAnalyses_local/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/outputs/HNL_Majorana_ejj_50GeV_1e-3Ve/output_stage1/" #inputDir = "/eos/user/j/jalimena/FCCeeLLP/" #inputDir = "output_stage1/" -#Output directory where the files produced at the final-selection level are -outputDir = "output_finalSel/" - -#Integrated luminosity for scaling number of events (required only if setting doScale to true) -#intLumi = 150e6 #pb^-1 - -#Scale event yields by intLumi and cross section (optional) -#doScale = True - -#Save event yields in a table (optional) -#saveTabular = True +#Input directory where the files produced at the final-selection level are +outputDir = "outputs/HNL_Majorana_ejj_50GeV_1e-3Ve/output_finalSel/" processList = { #run over the full statistics from stage1 - - #backgrounds - 'p8_ee_Zee_ecm91':{}, - 'p8_ee_Ztautau_ecm91':{}, - 'p8_ee_Zbb_ecm91':{}, - 'p8_ee_Zcc_ecm91':{}, - 'p8_ee_Zuds_ecm91':{}, - - #signals - 'eenu_30GeV_1p41e-6Ve':{}, - 'eenu_50GeV_1p41e-6Ve':{}, - 'eenu_70GeV_1p41e-6Ve':{}, - 'eenu_90GeV_1p41e-6Ve':{}, -} - -###Dictionary for prettier names of processes (optional) -processLabels = { - #backgrounds - 'p8_ee_Zee_ecm91':"Z $\rightarrow$ ee", - 'p8_ee_Ztautau_ecm91':"Z $\rightarrow \tau \tau$", - 'p8_ee_Zbb_ecm91':"Z $\rightarrow$ bb", - 'p8_ee_Zcc_ecm91':"Z $\rightarrow$ cc", - 'p8_ee_Zuds_ecm91':"Z $\rightarrow$ uds", - - #signals - 'eenu_30GeV_1p41e-6Ve': "$m_N =$ 30 GeV, $|V_{eN}| = 1.41 * 10^{-6}$", - 'eenu_50GeV_1p41e-6Ve': "$m_N =$ 50 GeV, $|V_{eN}| = 1.41 * 10^{-6}$", - 'eenu_70GeV_1p41e-6Ve': "$m_N =$ 70 GeV, $|V_{eN}| = 1.41 * 10^{-6}$", - 'eenu_90GeV_1p41e-6Ve': "$m_N =$ 90 GeV, $|V_{eN}| = 1.41 * 10^{-6}$", + 'HNL_Majorana_ejj_50GeV_1e-3Ve':{}, } #Link to the dictonary that contains all the cross section information etc... @@ -54,14 +17,10 @@ #Add MySample_p8_ee_ZH_ecm240 as it is not an offical process procDictAdd={ #"MySample_p8_ee_ZH_ecm240":{"numberOfEvents": 10000000, "sumOfWeights": 10000000, "crossSection": 0.201868, "kfactor": 1.0, "matchingEfficiency": 1.0} - "eenu_30GeV_1p41e-6Ve": {"numberOfEvents": 50000, "sumOfWeights": 50000, "crossSection": 6.638e-10, "kfactor": 1.0, "matchingEfficiency": 1.0}, - "eenu_50GeV_1p41e-6Ve": {"numberOfEvents": 50000, "sumOfWeights": 50000, "crossSection": 4.535e-10, "kfactor": 1.0, "matchingEfficiency": 1.0}, - "eenu_70GeV_1p41e-6Ve": {"numberOfEvents": 50000, "sumOfWeights": 50000, "crossSection": 1.968e-10, "kfactor": 1.0, "matchingEfficiency": 1.0}, - "eenu_90GeV_1p41e-6Ve": {"numberOfEvents": 50000, "sumOfWeights": 50000, "crossSection": 1.749e-12, "kfactor": 1.0, "matchingEfficiency": 1.0}, } #Number of CPUs to use -nCPUS = 2 +nCPUS = 4 #produces ROOT TTrees, default is False doTree = False @@ -69,29 +28,21 @@ ###Dictionnay of the list of cuts. The key is the name of the selection that will be added to the output file cutList = { "selNone": "n_RecoTracks > -1", + "selJetPtGt20":"RecoJet_pt[0]>20", # "sel1FSGenEle": "n_FSGenElectron>0", # "sel1FSGenEle_eeInvMassGt80": "n_FSGenElectron>0 && FSGen_ee_invMass >80", # "sel1FSGenNu": "n_FSGenNeutrino>0", - "sel2RecoEle": "n_RecoElectrons==2", - "sel2RecoEle_vetoes": "n_RecoElectrons==2 && n_RecoMuons==0 && n_RecoPhotons==0 && n_RecoJets==0 && n_RecoPhotons==0", + # "sel2RecoEle": "n_RecoElectrons==2", + # "sel2RecoEle_vetoes": "n_RecoElectrons==2 && n_RecoMuons==0 && n_RecoPhotons==0 && n_RecoJets==0 && n_RecoPhotons==0", # "sel2RecoEle_absD0Gt0p1": "n_RecoElectrons==2 && RecoElectronTrack_absD0[0]>0.1 && RecoElectronTrack_absD0[1]>0.1", #both electrons displaced # "sel2RecoEle_chi2Gt0p1": "n_RecoElectrons==2 && RecoDecayVertex.chi2>0.1", #good vertex # "sel2RecoEle_chi2Gt0p1_LxyzGt1": "n_RecoElectrons==2 && RecoDecayVertex.chi2>0.1 && Reco_Lxyz>1", #displaced vertex - "sel2RecoEle_vetoes_MissingEnergyGt10": "n_RecoElectrons==2 && n_RecoMuons==0 && n_RecoPhotons==0 && n_RecoJets==0 && n_RecoPhotons==0 && RecoMissingEnergy_p[0]>10", #missing energy > 10 GeV + # "sel2RecoEle_vetoes_MissingEnergyGt10": "n_RecoElectrons==2 && n_RecoMuons==0 && n_RecoPhotons==0 && n_RecoJets==0 && n_RecoPhotons==0 && RecoMissingEnergy_p[0]>10", #missing energy > 10 GeV # "sel2RecoEle_vetoes_absD0Gt0p5": "n_RecoElectrons==2 && n_RecoMuons==0 && n_RecoPhotons==0 && n_RecoJets==0 && n_RecoPhotons==0 && RecoElectronTrack_absD0[0]>0.5 && RecoElectronTrack_absD0[1]>0.5", #both electrons displaced - "sel2RecoEle_vetoes_MissingEnergyGt10_absD0Gt0p5": "n_RecoElectrons==2 && n_RecoMuons==0 && n_RecoPhotons==0 && n_RecoJets==0 && n_RecoPhotons==0 && RecoMissingEnergy_p[0]>10 && RecoElectronTrack_absD0[0]>0.5 && RecoElectronTrack_absD0[1]>0.5", #both electrons displaced + #"sel2RecoEle_vetoes_MissingEnergyGt10_absD0Gt0p5": "n_RecoElectrons==2 && n_RecoMuons==0 && n_RecoPhotons==0 && n_RecoJets==0 && n_RecoPhotons==0 && RecoMissingEnergy_p[0]>10 && RecoElectronTrack_absD0[0]>0.5 && RecoElectronTrack_absD0[1]>0.5", #both electrons displaced # "sel2RecoEle_vetoes_MissingEnergyGt10_chi2Gt1_LxyzGt5": "n_RecoElectrons==2 && n_RecoMuons==0 && n_RecoPhotons==0 && n_RecoJets==0 && n_RecoPhotons==0 && RecoMissingEnergy_p[0]>10 && RecoDecayVertex.chi2>1 && Reco_Lxyz>5", #displaced vertex } -###Dictionary for prettier names of cuts (optional) -cutLabels = { - "selNone": "Before selection", - "sel2RecoEle": "Exactly 2 electrons", - "sel2RecoEle_vetoes": "Veto photons, muons, and jets", - "sel2RecoEle_vetoes_MissingEnergyGt10": "$\\not\\! p >$ 10 GeV", - "sel2RecoEle_vetoes_MissingEnergyGt10_absD0Gt0p5": "Electron $|d_0| >$ 0.5 mm", -} - ###Dictionary for the ouput variable/hitograms. The key is the name of the variable in the output files. "name" is the name of the variable in the input file, "title" is the x-axis label of the histogram, "bin" the number of bins of the histogram, "xmin" the minimum x-axis value and "xmax" the maximum x-axis value. histoList = { @@ -143,9 +94,15 @@ "FSGenPhoton_phi": {"name":"FSGenPhoton_phi", "title":"Final state gen photons #phi", "bin":64, "xmin":-3.2,"xmax":3.2}, "FSGenPhoton_charge": {"name":"FSGenPhoton_charge", "title":"Final state gen photons charge", "bin":3, "xmin":-1.5,"xmax":1.5}, + + "GenHNLElectron_e": {"name":"GenHNLElectron_e", "title":"Decay electron energy [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "GenHNLElectron_pt": {"name":"GenHNLElectron_pt", "title":"Decay electron p_{T} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "GenHNLElectron_eta": {"name":"GenHNLElectron_eta", "title":"Decay electron #eta", "bin":60,"xmin":-3 ,"xmax":3}, + "GenHNLElectron_phi": {"name":"GenHNLElectron_phi", "title":"Decay electron #phi", "bin":64,"xmin":-3.2 ,"xmax":3.2}, + #reco variables "n_RecoTracks": {"name":"n_RecoTracks", "title":"Total number of reco tracks", "bin":5,"xmin":-0.5 ,"xmax":4.5}, - "n_RecoJets": {"name":"n_RecoJets", "title":"Total number of reco jets", "bin":5,"xmin":-0.5 ,"xmax":4.5}, + "n_RecoJets": {"name":"n_RecoJets", "title":"Total number of reco jets", "bin":11,"xmin":-0.5 ,"xmax":10.5}, "n_RecoPhotons": {"name":"n_RecoPhotons", "title":"Total number of reco photons", "bin":5,"xmin":-0.5 ,"xmax":4.5}, "n_RecoElectrons": {"name":"n_RecoElectrons", "title":"Total number of reco electrons", "bin":5,"xmin":-0.5 ,"xmax":4.5}, "n_RecoMuons": {"name":"n_RecoMuons", "title":"Total number of reco muons", "bin":5,"xmin":-0.5 ,"xmax":4.5}, @@ -159,9 +116,39 @@ "RecoJet_phi": {"name":"RecoJet_phi", "title":"Reco jet #phi", "bin":64, "xmin":-3.2,"xmax":3.2}, "RecoJet_charge": {"name":"RecoJet_charge", "title":"Reco jet charge", "bin":3, "xmin":-1.5,"xmax":1.5}, - "RecoJetTrack_absD0": {"name":"RecoJetTrack_absD0", "title":"Reco jet tracks |d_{0}| [mm]", "bin":100,"xmin":0, "xmax":2000}, + "GenJet_e": {"name":"GenJet_e", "title":"Gen jet energy [GeV]", "bin":100,"xmin":0, "xmax":5}, + "GenLeadJet_e": {"name":"GenLeadJet_e", "title":"Gen Leading jet energy [GeV]", "bin":100,"xmin":0, "xmax":50}, + + "RecoLeadJet_e": {"name":"RecoLeadJet_e", "title":"Reco Leading jet energy [GeV]", "bin":100,"xmin":0, "xmax":50}, + "RecoLeadJet_e_scaled": {"name":"RecoLeadJet_e", "title":"Reco Leading jet energy_scaled [GeV]", "bin":100,"xmin":0, "xmax":1}, + "RecoLeadJet_pt": {"name":"RecoLeadJet_pt", "title":"Reco Leading jet p_{T} [GeV]", "bin":100,"xmin":0, "xmax":50}, + "RecoLeadJet_eta": {"name":"RecoLeadJet_eta", "title":"Reco Leading jet #eta", "bin":64,"xmin":-3, "xmax":3}, + "RecoLeadJet_phi": {"name":"RecoLeadJet_phi", "title":"Reco Leading jet #phi", "bin":64,"xmin":-3.2, "xmax":3.2}, + "RecoSecondJet_e": {"name":"RecoSecondJet_e", "title":"Reco Secondary jet energy [GeV]", "bin":100,"xmin":0, "xmax":50}, + "RecoSecondJet_pt": {"name":"RecoSecondJet_pt", "title":"Reco Secondary jet p_{T} [GeV]", "bin":100,"xmin":0, "xmax":50}, + "RecoSecondJet_eta": {"name":"RecoSecondJet_eta", "title":"Reco Secondary jet #eta", "bin":64,"xmin":-3, "xmax":3}, + "RecoSecondJet_phi": {"name":"RecoSecondJet_phi", "title":"Reco Secondary jet #phi", "bin":64,"xmin":-3.2, "xmax":3.2}, + + "RecoJetDelta_e": {"name":"RecoJetDelta_e", "title":"Reco Jet #Delta E [GeV]", "bin":100,"xmin":0, "xmax":50}, + "RecoJetDelta_pt": {"name":"RecoJetDelta_pt", "title":"Reco Jet #Delta p_{T} [GeV]", "bin":100,"xmin":0, "xmax":50}, + "RecoJetDelta_phi": {"name":"RecoJetDelta_phi", "title":"Reco Jet #Delta #phi", "bin":64,"xmin":-4, "xmax":4}, + "RecoJetDelta_eta": {"name":"RecoJetDelta_eta", "title":"Reco Jet #Delta #eta", "bin":64,"xmin":-7, "xmax":7}, + "RecoJetDelta_R": {"name":"RecoJetDelta_R", "title":"Reco Jet #Delta R", "bin":100,"xmin":0, "xmax":10}, + + "Reco_LeadJet_invMass": {"name":"Reco_LeadJet_invMass", "title":"Reco m_{Jet} [GeV]", "bin":100,"xmin":0, "xmax":10}, + + "LeadJet_HNLELectron_Delta_e": {"name":"LeadJet_HNLELectron_Delta_e", "title":"RecoJet DecayEle #Delta E [GeV]", "bin":100,"xmin":-50, "xmax":50}, + "LeadJet_HNLELectron_Delta_pt": {"name":"LeadJet_HNLELectron_Delta_pt", "title":"RecoJet DecayEle #Delta p_{T} [GeV]", "bin":100,"xmin":-50, "xmax":50}, + "LeadJet_HNLELectron_Delta_phi": {"name":"LeadJet_HNLELectron_Delta_phi", "title":"RecoJet DecayEle #Delta #phi", "bin":64,"xmin":-4, "xmax":4}, + "LeadJet_HNLELectron_Delta_eta": {"name":"LeadJet_HNLELectron_Delta_eta", "title":"RecoJet DecayEle #Delta #eta", "bin":64,"xmin":-7, "xmax":7}, + "LeadJet_HNLELectron_Delta_R": {"name":"LeadJet_HNLELectron_Delta_R", "title":"RecoJet DecayEle #Delta R", "bin":100,"xmin":0, "xmax":10}, + + "GenHNL_Lxy": {"name":"GenHNL_Lxy", "title":"Gen L_{xy} [mm]", "bin":50,"xmin":0 ,"xmax":0.01}, + "GenHNL_Lxyz": {"name":"GenHNL_Lxyz", "title":"Gen L_{xyz} [mm]", "bin":50,"xmin":0 ,"xmax":0.01}, + + "RecoJetTrack_absD0": {"name":"RecoJetTrack_absD0", "title":"Reco jet tracks |d_{0}| [mm]", "bin":100,"xmin":0, "xmax":1}, "RecoJetTrack_absD0_prompt": {"name":"RecoJetTrack_absD0", "title":"Reco jet tracks |d_{0}| [mm]", "bin":100,"xmin":0, "xmax":1}, - "RecoJetTrack_absZ0": {"name":"RecoJetTrack_absZ0", "title":"Reco jet tracks |z_{0}| [mm]", "bin":100,"xmin":0, "xmax":2000}, + "RecoJetTrack_absZ0": {"name":"RecoJetTrack_absZ0", "title":"Reco jet tracks |z_{0}| [mm]", "bin":100,"xmin":0, "xmax":1}, "RecoJetTrack_absZ0_prompt": {"name":"RecoJetTrack_absZ0", "title":"Reco jet tracks |z_{0}| [mm]", "bin":100,"xmin":0, "xmax":1}, "RecoJetTrack_absD0sig": {"name":"RecoJetTrack_absD0sig", "title":"Reco jet tracks |d_{0} significance|", "bin":100,"xmin":0, "xmax":600000}, "RecoJetTrack_absD0sig_prompt": {"name":"RecoJetTrack_absD0sig", "title":"Reco jet tracks |d_{0} significance|", "bin":100,"xmin":0, "xmax":5}, diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_stage1.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_stage1.py index 42591b13ab..c0569fd2ca 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_stage1.py +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/analysis_stage1.py @@ -31,13 +31,12 @@ #Optional: output directory, default is local dir -outputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/output_stage1/" +outputDir = "outputs/HNL_Dirac_ejj_70GeV_1e-3Ve/output_stage1/" #outputDir = "/eos/user/j/jalimena/FCCeeLLP/" #outputDir = "output_stage1/" -outputDirEos = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/output_stage1/" -#outputDirEos = "/eos/user/j/jalimena/FCCeeLLP/" -#eosType = "eosuser" +HNL_id = "9990012" # Dirac +#HNL_id = "9900012" # Majorana #Optional: ncpus, default is 4 nCPUS = 4 @@ -146,7 +145,6 @@ def analysers(df): .Define("FSGen_eenu_invMass", "if (n_FSGenElectron>1 && n_FSGenNeutrino>0) return sqrt(FSGen_eenu_energy*FSGen_eenu_energy - FSGen_eenu_px*FSGen_eenu_px - FSGen_eenu_py*FSGen_eenu_py - FSGen_eenu_pz*FSGen_eenu_pz ); else return float(-1.);") - # MC event primary vertex .Define("MC_PrimaryVertex", "FCCAnalyses::MCParticle::get_EventPrimaryVertex(21)( Particle )" ) @@ -155,7 +153,7 @@ def analysers(df): #JETS .Define("n_RecoJets", "ReconstructedParticle::get_n(Jet)") #count how many jets are in the event in total - + .Define("n_GenJets" , "ReconstructedParticle::get_n(GenJet)") # Count number of jets per event (gen level) #PHOTONS .Alias("Photon0", "Photon#0.index") .Define("RecoPhotons", "ReconstructedParticle::get(Photon0, ReconstructedParticles)") @@ -188,6 +186,68 @@ def analysers(df): .Define("RecoJetTrack_D0cov", "ReconstructedParticle2Track::getRP2TRK_D0_cov(Jet,EFlowTrack_1)") #variance (not sigma) .Define("RecoJetTrack_Z0cov", "ReconstructedParticle2Track::getRP2TRK_Z0_cov(Jet,EFlowTrack_1)") + .Define("selected_Jets", "ReconstructedParticle::sel_pt(20.)(Jet)") #select only jets with a pt > 20 GeV + .Define("selectedJet_e", "ReconstructedParticle::get_e(selected_Jets)") + .Define("selectedJet_pt", "ReconstructedParticle::get_pt(selected_Jets)") + + # Define Gen Jet variables + .Define("GenJet_e" , "ReconstructedParticle::get_e(GenJet)") + + .Define("GenLeadJet_e", "if (n_GenJets >= 1) return (GenJet_e.at(0)); else return float(-10000.);") + + # Leading Reconstructed jet variables + .Define("RecoLeadJet_e", "if (n_RecoJets >= 1) return (RecoJet_e.at(0)); else return float(-10000.);") + .Define("RecoLeadJet_pt", "if (n_RecoJets >= 1) return (RecoJet_pt.at(0)); else return float(-10000.);") + .Define("RecoLeadJet_phi", "if (n_RecoJets >= 1) return (RecoJet_phi.at(0)); else return float(-10000.);") + .Define("RecoLeadJet_eta", "if (n_RecoJets >= 1) return (RecoJet_eta.at(0)); else return float(-10000.);") + .Define("RecoLeadJet_px", "if (n_RecoJets >= 1) return (RecoJet_px.at(0)); else return float(-1.);") + .Define("RecoLeadJet_py", "if (n_RecoJets >= 1) return (RecoJet_py.at(0)); else return float(-1.);") + .Define("RecoLeadJet_pz", "if (n_RecoJets >= 1) return (RecoJet_pz.at(0)); else return float(-1.);") + + # Secondary jet variables + .Define("RecoSecondJet_e", "if (n_RecoJets > 1) return (RecoJet_e.at(1)); else return float(-1000.);") + .Define("RecoSecondJet_pt", "if (n_RecoJets > 1) return (RecoJet_pt.at(1)); else return float(-1000.);") + .Define("RecoSecondJet_phi", "if (n_RecoJets > 1) return (RecoJet_phi.at(1)); else return float(1000.);") + .Define("RecoSecondJet_eta", "if (n_RecoJets > 1) return (RecoJet_eta.at(1)); else return float(1000.);") + + # Difference between lead and secondary jet + .Define("RecoJetDelta_e", "return (RecoLeadJet_e - RecoSecondJet_e)") + .Define("RecoJetDelta_pt", "return (RecoLeadJet_pt - RecoSecondJet_pt)") + .Define("RecoJetDelta_phi", "if (RecoLeadJet_phi > -1000) return atan2(sin(RecoLeadJet_phi - RecoSecondJet_phi), cos(RecoLeadJet_phi - RecoSecondJet_phi)); else return float(100.);") + .Define("RecoJetDelta_eta", "return (RecoLeadJet_eta - RecoSecondJet_eta)") + .Define("RecoJetDelta_R", "return sqrt(RecoJetDelta_phi*RecoJetDelta_phi + RecoJetDelta_eta*RecoJetDelta_eta)") + + # Define lead jet invariant mass + .Define("Reco_LeadJet_invMass", "if (n_RecoJets >= 1) return sqrt(RecoLeadJet_e*RecoLeadJet_e - RecoLeadJet_px*RecoLeadJet_px - RecoLeadJet_py*RecoLeadJet_py - RecoLeadJet_pz*RecoLeadJet_pz ); else return float(-1.);") + + # Defining vector containing the HNL and its daughters, in order written + .Define("GenHNL_indices", "FCCAnalyses::MCParticle::get_indices(%s ,{11} , true, true, true, true)(Particle, Particle1)"%(HNL_id)) + .Define("GenHNL", "FCCAnalyses::MCParticle::selMC_leg(0)(GenHNL_indices, Particle)") + .Define("GenHNLElectron", "FCCAnalyses::MCParticle::selMC_leg(1)(GenHNL_indices, Particle)") + + #Define decay electron from HNL + .Define("GenHNLElectron_e", "FCCAnalyses::MCParticle::get_e(GenHNLElectron)") + .Define("GenHNLElectron_pt", "FCCAnalyses::MCParticle::get_pt(GenHNLElectron)") + .Define("GenHNLElectron_eta", "FCCAnalyses::MCParticle::get_eta(GenHNLElectron)") + .Define("GenHNLElectron_phi", "FCCAnalyses::MCParticle::get_phi(GenHNLElectron)") + + .Define("GenHNLElectron_vertex_x","return FCCAnalyses::MCParticle::get_vertex_x(GenHNLElectron)") + .Define("GenHNLElectron_vertex_y","return FCCAnalyses::MCParticle::get_vertex_y(GenHNLElectron)") + .Define("GenHNLElectron_vertex_z","return FCCAnalyses::MCParticle::get_vertex_z(GenHNLElectron)") + # Finding the Lxy of the HNL + # Definition: Lxy = math.sqrt( (branchGenPtcl.At(daut1).X)**2 + (branchGenPtcl.At(daut1).Y)**2 ) + .Define("GenHNL_Lxy", "return sqrt(GenHNLElectron_vertex_x*GenHNLElectron_vertex_x + GenHNLElectron_vertex_y*GenHNLElectron_vertex_y)") + # Finding the Lxyz of the HNL + .Define("GenHNL_Lxyz", "return sqrt(GenHNLElectron_vertex_x*GenHNLElectron_vertex_x + GenHNLElectron_vertex_y*GenHNLElectron_vertex_y + GenHNLElectron_vertex_z*GenHNLElectron_vertex_z)") + + #Differences Lead jet, decay electron + # Defining diff between lead jet and prompt electron + .Define("LeadJet_HNLELectron_Delta_e", "return GenHNLElectron_e - RecoLeadJet_e") + .Define("LeadJet_HNLELectron_Delta_pt", "return (GenHNLElectron_pt - RecoLeadJet_pt)") + .Define("LeadJet_HNLELectron_Delta_phi", "if (RecoLeadJet_phi < -1000) return float(-100.); else return atan2(sin(RecoLeadJet_phi - GenHNLElectron_phi.at(0)), cos(RecoLeadJet_phi - GenHNLElectron_phi.at(0)));") + .Define("LeadJet_HNLELectron_Delta_eta", "return (RecoLeadJet_eta - GenHNLElectron_eta)") + .Define("LeadJet_HNLELectron_Delta_R", "return sqrt(LeadJet_HNLELectron_Delta_phi*LeadJet_HNLELectron_Delta_phi + LeadJet_HNLELectron_Delta_eta*LeadJet_HNLELectron_Delta_eta)") + .Define("RecoElectron_e", "ReconstructedParticle::get_e(RecoElectrons)") .Define("RecoElectron_p", "ReconstructedParticle::get_p(RecoElectrons)") .Define("RecoElectron_pt", "ReconstructedParticle::get_pt(RecoElectrons)") @@ -309,6 +369,15 @@ def output(): "FSGenPhoton_phi", "FSGenPhoton_charge", + "n_GenJets", + "GenJet_e", + "GenLeadJet_e", + + "GenHNLElectron_e", + "GenHNLElectron_pt", + "GenHNLElectron_eta", + "GenHNLElectron_phi", + ######## Reconstructed particles ####### "n_RecoTracks", "n_RecoJets", @@ -331,6 +400,35 @@ def output(): "RecoJetTrack_absZ0sig", "RecoJetTrack_D0cov", "RecoJetTrack_Z0cov", + + "selectedJet_e", + "selectedJet_pt", + + "RecoLeadJet_e", + "RecoLeadJet_pt", + "RecoLeadJet_eta", + "RecoLeadJet_phi", + "Reco_LeadJet_invMass", + "RecoSecondJet_e", + "RecoSecondJet_pt", + "RecoSecondJet_eta", + "RecoSecondJet_phi", + + "RecoJetDelta_e", + "RecoJetDelta_pt", + "RecoJetDelta_phi", + "RecoJetDelta_eta", + "RecoJetDelta_R", + + "LeadJet_HNLELectron_Delta_e", + "LeadJet_HNLELectron_Delta_pt", + "LeadJet_HNLELectron_Delta_eta", + "LeadJet_HNLELectron_Delta_phi", + "LeadJet_HNLELectron_Delta_R", + + "GenHNL_Lxy", + "GenHNL_Lxyz", + "RecoPhoton_e", "RecoPhoton_p", "RecoPhoton_pt", From 6c5e494a78317edb73b6f02080f406f79bf7a8a4 Mon Sep 17 00:00:00 2001 From: Nayaqs Date: Thu, 1 Dec 2022 13:45:26 +0100 Subject: [PATCH 25/35] Updated make_plots.py and make_selection.py to account for different selection/cuts from analysis_final.py --- .../Analysis/plotting/make_plots.py | 234 ++++++++++++++++++ .../Analysis/plotting/make_selection_file.py | 76 ++++++ 2 files changed, 310 insertions(+) create mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_plots.py create mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_selection_file.py diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_plots.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_plots.py new file mode 100644 index 0000000000..4c1797bea6 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_plots.py @@ -0,0 +1,234 @@ +import ROOT +import os +# plots don't appear while you run +ROOT.gROOT.SetBatch(0) +# no stat box on plots +ROOT.gStyle.SetOptStat(0) +# no title shown +ROOT.gStyle.SetOptTitle(0) + +HNL_mass = "50GeV" + +selection = "selJetPtGt20" +#selection = "selNone" + +output_dir = HNL_mass + "_ejj_50k/" +output_dir_sel = HNL_mass + "_ejj_50k/" + selection +'/' +input_dir = "selected_hist/" + +input_file_Dirac = input_dir + 'histDirac_ejj_'+HNL_mass+'_'+selection+'.root' +input_file_Majorana = input_dir + 'histMajorana_ejj_'+HNL_mass+'_'+selection+'.root' + +# Set plot log-scale plots, default: False +log_scale = False + +if not os.path.exists(output_dir): + os.mkdir(output_dir) + print("Directory ",output_dir," Created ") +else: + print("Directory ",output_dir," already exists") + +if not os.path.exists(output_dir_sel): + os.mkdir(output_dir_sel) + print("Directory ",output_dir_sel," Created ") +else: + print("Directory ",output_dir_sel," already exists") +# list of lists +# each internal list: hist name, x title, y title, rebin (if needed) +variables_list = [ + ["RecoElectron_pt", "Reco electron pt", "Entries", 3], + ["RecoElectron_phi", "Reco Electron phi", "Entries", 3], + ["RecoElectron_theta", "Reco Electron theta", "Entries", 3], + ["RecoElectron_e", "Reco Electron energy", "Entries", 3], + ["RecoMissingEnergy_e", "Reco Missing_e", "Entries", 3], + ["RecoMissingEnergy_pt", "Reco Missing_pt", "Entries", 3], + ["RecoMissingEnergy_p", "Reco Missing_p", "Entries", 3], + ["RecoMissingEnergy_px", "Reco Missing_px", "Entries", 3], + ["RecoMissingEnergy_py", "Reco Missing_py", "Entries", 3], + ["RecoMissingEnergy_pz", "Reco Missing_pz", "Entries", 3], + ["RecoMissingEnergy_eta", "Reco Missing_eta", "Entries", 3], + ["RecoMissingEnergy_theta", "Reco Missing_theta", "Entries", 3], + ["RecoMissingEnergy_phi", "Reco Missing_phi", "Entries", 3], + + ["n_RecoJets", "Number of RecoJets", "Entries"], + ["RecoJet_e", "Reco Jet energy", "Entries", 3], + ["RecoJet_p", "Reco Jet p", "Entries", 3], + ["RecoJet_pt", "Reco Jet pt", "Entries", 3], + ["RecoJet_pz", "Reco Jet pz", "Entries", 3], + ["RecoJet_eta", "Reco Jet eta", "Entries", 3], + ["RecoJet_theta", "Reco Jet theta", "Entries", 3], + ["RecoJet_phi", "Reco Jet phi", "Entries", 3], + ["RecoJet_charge", "Reco Jet charge", "Entries", 3], + ["RecoJetTrack_absD0", "Reco Jet abs_DO", "Entries", 3], + ["RecoJetTrack_absZ0", "Reco Jet abs_Z0", "Entries", 3], + ["RecoJetTrack_absD0sig", "Reco Jet sigma(abs_D0)", "Entries", 3], + ["RecoJetTrack_absZ0sig", "Reco Jet sigma(abs_Z0)", "Entries", 3], + ["RecoJetTrack_D0cov", "Reco Jet cov(D0)", "Entries", 3], + ["RecoJetTrack_Z0cov", "Reco Jet cov(Z0)", "Entries", 3], + + ["RecoLeadJet_e", "Reco Lead Jet E", "Entries", 3], + ["RecoLeadJet_pt", "Reco Lead Jet p_{T}", "Entries", 3], + ["RecoLeadJet_eta", "Reco Lead Jet #eta", "Entries", 3], + ["RecoLeadJet_phi", "Reco Lead Jet #phi", "Entries", 3], + ["RecoSecondJet_e", "Reco Secondary Jet E", "Entries", 3], + ["RecoSecondJet_pt", "Reco Secondary Jet p_{T}", "Entries", 3], + ["RecoSecondJet_eta", "Reco Secondary Jet #eta", "Entries", 3], + ["RecoSecondJet_phi", "Reco Secondary Jet #phi", "Entries", 3], + ["RecoJetDelta_e", "Reco Jet #Delta E", "Entries", 3], + ["RecoJetDelta_pt", "Reco Jet #Delta p_{T}", "Entries", 3], + ["RecoJetDelta_phi", "Reco Jet #Delta #phi", "Entries", 3], + ["RecoJetDelta_eta", "Reco Jet #Delta #eta", "Entries", 3], + ["RecoJetDelta_R", "Reco Jet #Delta R", "Entries", 3], + + ["GenHNLElectron_e", "GenHNLElectron E", "Entries", 3], + ["GenHNLElectron_pt", "GenHNLElectron p_{T}", "Entries", 3], + ["GenHNLElectron_eta", "GenHNLElectron #eta", "Entries", 3], + ["GenHNLElectron_phi", "GenHNLElectron #phi", "Entries", 3], + + ["LeadJet_HNLELectron_Delta_e", "LeadJet Decay Ele #Delta E", "Entries", 3], + ["LeadJet_HNLELectron_Delta_pt", "LeadJet Decay Ele #Delta p_{T}", "Entries", 3], + ["LeadJet_HNLELectron_Delta_eta", "LeadJet Decay Ele #Delta #eta", "Entries", 3], + ["LeadJet_HNLELectron_Delta_phi", "LeadJet Decay Ele #Delta #phi", "Entries", 3], + ["LeadJet_HNLELectron_Delta_R", "LeadJet Decay Ele #Delta R", "Entries", 3], + + + +# ['hnlLT', 'Lifetime [s]', 'Entries'], +# ['angsepR', 'Reco Cos#theta ee', 'Entries', 5], +# ['angsep', 'Cos#theta ee', 'Entries', 5], +# ['et', 'Missing energy [GeV]', 'Entries'], +# ['eTruthE', 'Electron energy [GeV]', 'Entries'] , +# ['eTruthP', 'Positron energy [GeV]', 'Entries'] , +# ['eRecoE', 'Reco Electron energy [GeV]', 'Entries'] , +# ['eRecoP', 'Reco Positron energy [GeV]', 'Entries'] , +# ['etaRE', 'Reco electron #eta', 'Entries'] , +# ['etaRP', 'Reco positron #eta', 'Entries'] , +# ['phiRE', 'Reco electron #phi', 'Entries'] , +# ['phiRP', 'Reco positron #phi', 'Entries'] , +# ['deletaR', 'Reco del eta ee', 'Entries'] , +# ['delphiR', 'Reco del phi ee', 'Entries'] , +# ['delRR', 'Reco del R ee', 'Entries'] , +# ['etaE', 'electron #eta', 'Entries'] , +# ['etaP', 'positron #eta', 'Entries'] , +# ['phiE', 'electron #phi', 'Entries'] , +# ['phiP', 'positron #phi', 'Entries'] , +# ['deleta', 'del eta ee', 'Entries'] , +# ['delphi', 'del phi ee', 'Entries'] , +# ['delR', 'del R ee', 'Entries'] , +# ['xmRE', 'Reco Px electron [GeV]', 'Entries'] , +# ['ymRE', 'Reco Py electron [GeV]', 'Entries'] , +# ['zmRE', 'Reco Pz electron [GeV]', 'Entries'] , +# ['xmRP', 'Reco Px positron [GeV]', 'Entries'] , +# ['ymRP', 'Reco Py positron (GeV', 'Entries'] , +# ['zmRP', 'Reco Pz positron [GeV]', 'Entries'] , +# ['tmRE', 'Reco pT electron [GeV]', 'Entries'] , +# ['tmRP', 'Reco pT positron [GeV]', 'Entries'] , +# ['xmTE', 'Px electron [GeV]', 'Entries'] , +# ['ymTE', 'Py electron [GeV]', 'Entries'] , +# ['zmTE', 'Pz electron [GeV]', 'Entries'] , +# ['xmTP', 'Px positron [GeV]', 'Entries'] , +# ['ymTP', 'Py positron [GeV]', 'Entries'] , +# ['zmTP', 'Pz positron [GeV]', 'Entries'] , +# ['tmTE', 'pT electron [GeV]', 'Entries'] , +# ['tmTP', 'pT positron [GeV]', 'Entries'] , +# ['dispvrtx', 'displaced vetex [m]', 'Entries'] +] + +files_list = [ + [input_file_Majorana , 'Majorana ' + HNL_mass + ' semi-leptonic', 'Majorana'], + [input_file_Dirac , 'Dirac ' + HNL_mass + ' semi-leptonic', 'Dirac'] +] + +legend_list = [f[1] for f in files_list] +ratio_list = [f[2] for f in files_list] +colors = [609, 856, 410, 801, 629, 879, 602, 921, 622] + +def make_plot(h_list, plot_info, legend_list): + # print('looking at histogram:', plot_info[0]) + c = ROOT.TCanvas("can"+plot_info[0],"can"+plot_info[0],600,600) + pad1 = ROOT.TPad("pad1", "pad1",0.0,0.35,1.0,1.0,21) + pad2 = ROOT.TPad("pad2", "pad2",0.0,0.0,1.0,0.35,22) + + pad1.SetFillColor(0) + pad1.SetBottomMargin(0.01) + if log_scale == True : pad1.SetLogy() + pad1.SetTickx() + pad1.SetTicky() + pad1.Draw() + + pad2.SetFillColor(0) + pad2.SetTopMargin(0.01) + pad2.SetBottomMargin(0.3) + pad2.Draw() + + leg = ROOT.TLegend(0.55, 0.7, 0.87, 0.87) + leg.SetFillStyle(0) + leg.SetLineWidth(0) + + h_max = 0 + for ih,h in enumerate(h_list): + leg.AddEntry(h, legend_list[ih]) + if len(plot_info)>3: + h.Rebin(plot_info[3]) + if h.GetMaximum() > h_max: + h_max = h.GetMaximum() + h.Sumw2() + + # Draw in the top panel + pad1.cd() + for ih,h in enumerate(h_list): + h.SetLineColor(colors[ih]) + h.SetLineWidth(3) + h.GetXaxis().SetTitle(plot_info[1]) + h.GetYaxis().SetTitle(plot_info[2]) if log_scale == False else h.GetYaxis().SetTitle("log " + plot_info[2]) + h.GetYaxis().SetTitleSize(h.GetYaxis().GetTitleSize()*1.5) + h.GetYaxis().SetTitleOffset(0.8) + h.SetMaximum(1.25*h_max) + h.Draw('same') + h.Draw('same E') + leg.Draw() + pad1.RedrawAxis() + + # build ratios + h_ratios = [] + for ih,h in enumerate(h_list): + if ih == 0: + h_ratios.append(h.Clone('h_ratio_0')) + for ibin in range(-1, h.GetNbinsX()+1): + h_ratios[0].SetBinContent(ibin,1) + else: + h_ratios.append(h.Clone('h_ratio_'+str(ih))) + h_ratios[ih].Divide(h_list[0]) + + # draw in the bottom panel + pad2.cd() + for ih,h in enumerate(h_ratios): + h.SetMaximum(1.5) + h.SetMinimum(0.5) + + h.GetYaxis().SetTitle("Ratio to "+ratio_list[0]) + h.GetYaxis().SetLabelSize(h.GetYaxis().GetLabelSize()*1.6) + h.GetYaxis().SetLabelOffset(0.01) + h.GetYaxis().SetTitleSize(h.GetYaxis().GetTitleSize()*1.6) + h.GetYaxis().SetTitleOffset(0.5) + + h.GetXaxis().SetLabelSize(h.GetXaxis().GetLabelSize()*2.3) + #h.GetXaxis().SetLabelOffset(0.02) + h.GetXaxis().SetTitleSize(h.GetXaxis().GetTitleSize()*3) + h.GetXaxis().SetTitleOffset(1.05) + + h.Draw('hist same') + if ih>0: + h.Draw('same E') + c.SaveAs(output_dir_sel + plot_info[0]+'.png') if log_scale == False else c.SaveAs(output_dir_sel + "log_" + plot_info[0]+'.png') + return +for plot_info in variables_list: + h_list = [] + print('looking at histogram:', plot_info[0]) + for ifile,fil in enumerate(files_list): + f = ROOT.TFile.Open(fil[0]) + h = f.Get(plot_info[0]) + h.SetDirectory(0) + h_list.append(h) + f.Close() + make_plot(h_list, plot_info, legend_list) diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_selection_file.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_selection_file.py new file mode 100644 index 0000000000..af66d0c9d2 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_selection_file.py @@ -0,0 +1,76 @@ +import ROOT + +selection = "selNone" +#selection = "selJetPtGt20" + +input_path = "/afs/cern.ch/user/d/dimoulin/FCCAnalyses_new/FCC-LLP/FCCAnalyses_local/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/outputs/HNL_Dirac_ejj_50GeV_1e-3Ve/output_finalSel/HNL_Dirac_ejj_50GeV_1e-3Ve_"+selection+"_histo.root" +output_file = "selected_hist/histDirac_ejj_50GeV_"+selection+".root" + +hist_file = ROOT.TFile.Open(input_path) +#hist_file = ROOT.TFile.Open("../outputs/HNL_Dirac_20GeV_1e-3Ve/HNL_Dirac_20GeV_1e-3Ve_jets_selNone_histo.root") +histSelect = ROOT.TFile.Open(output_file, "RECREATE") + +#Object variables +histSelect.WriteObject(hist_file.Get("RecoElectron_pt"), "RecoElectron_pt") +histSelect.WriteObject(hist_file.Get("RecoElectron_phi"), "RecoElectron_phi") +histSelect.WriteObject(hist_file.Get("RecoElectron_theta"), "RecoElectron_theta") +histSelect.WriteObject(hist_file.Get("RecoElectron_e"), "RecoElectron_e") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_e"), "RecoMissingEnergy_e") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_p"), "RecoMissingEnergy_p") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_pt"), "RecoMissingEnergy_pt") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_px"), "RecoMissingEnergy_px") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_py"), "RecoMissingEnergy_py") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_pz"), "RecoMissingEnergy_pz") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_eta"), "RecoMissingEnergy_eta") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_theta"), "RecoMissingEnergy_theta") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_phi"), "RecoMissingEnergy_phi") + +# Jet variables +histSelect.WriteObject(hist_file.Get("n_RecoJets"), "n_RecoJets") +histSelect.WriteObject(hist_file.Get("RecoJet_e"), "RecoJet_e") +histSelect.WriteObject(hist_file.Get("RecoJet_p"), "RecoJet_p") +histSelect.WriteObject(hist_file.Get("RecoJet_pt"), "RecoJet_pt") +histSelect.WriteObject(hist_file.Get("RecoJet_pz"), "RecoJet_pz") +histSelect.WriteObject(hist_file.Get("RecoJet_eta"), "RecoJet_eta") +histSelect.WriteObject(hist_file.Get("RecoJet_theta"), "RecoJet_theta") +histSelect.WriteObject(hist_file.Get("RecoJet_phi"), "RecoJet_phi") +histSelect.WriteObject(hist_file.Get("RecoJet_charge"), "RecoJet_charge") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_absD0"), "RecoJetTrack_absD0") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_absZ0"), "RecoJetTrack_absZ0") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_absD0sig"), "RecoJetTrack_absD0sig") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_absZ0sig"), "RecoJetTrack_absZ0sig") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_D0cov"), "RecoJetTrack_D0cov") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_Z0cov"), "RecoJetTrack_Z0cov") + +histSelect.WriteObject(hist_file.Get("RecoLeadJet_e"), "RecoLeadJet_e") +histSelect.WriteObject(hist_file.Get("RecoLeadJet_pt"), "RecoLeadJet_pt") +histSelect.WriteObject(hist_file.Get("RecoLeadJet_eta"), "RecoLeadJet_eta") +histSelect.WriteObject(hist_file.Get("RecoLeadJet_phi"), "RecoLeadJet_phi") +histSelect.WriteObject(hist_file.Get("RecoSecondJet_e"), "RecoSecondJet_e") +histSelect.WriteObject(hist_file.Get("RecoSecondJet_pt"), "RecoSecondJet_pt") +histSelect.WriteObject(hist_file.Get("RecoSecondJet_eta"), "RecoSecondJet_eta") +histSelect.WriteObject(hist_file.Get("RecoSecondJet_phi"), "RecoSecondJet_phi") +histSelect.WriteObject(hist_file.Get("RecoJetDelta_e"), "RecoJetDelta_e") +histSelect.WriteObject(hist_file.Get("RecoJetDelta_pt"), "RecoJetDelta_pt") +histSelect.WriteObject(hist_file.Get("RecoJetDelta_eta"), "RecoJetDelta_eta") +histSelect.WriteObject(hist_file.Get("RecoJetDelta_phi"), "RecoJetDelta_phi") +histSelect.WriteObject(hist_file.Get("RecoJetDelta_R"), "RecoJetDelta_R") + +histSelect.WriteObject(hist_file.Get("Reco_LeadJet_invMass"), "Reco_LeadJet_invMass") +histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_e"), "LeadJet_HNLELectron_Delta_e") +histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_pt"), "LeadJet_HNLELectron_Delta_pt") +histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_eta"), "LeadJet_HNLELectron_Delta_eta") +histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_phi"), "LeadJet_HNLELectron_Delta_phi") +histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_R"), "LeadJet_HNLELectron_Delta_R") + +histSelect.WriteObject(hist_file.Get("GenHNLElectron_e"), "GenHNLElectron_e") +histSelect.WriteObject(hist_file.Get("GenHNLElectron_pt"), "GenHNLElectron_pt") +histSelect.WriteObject(hist_file.Get("GenHNLElectron_eta"), "GenHNLElectron_eta") +histSelect.WriteObject(hist_file.Get("GenHNLElectron_phi"), "GenHNLElectron_phi") + +histSelect.WriteObject(hist_file.Get("GenHNL_Lxy"), "GenHNL_Lxy") +histSelect.WriteObject(hist_file.Get("GenHNL_Lxyz"), "GenHNL_Lxyz") + +#histSelect.WriteObject(hist_file.Get(""), "") + + From 2649a00b08bbe0149e2289bb113ed54193e2a4f2 Mon Sep 17 00:00:00 2001 From: Nayaqs <88377894+Nayaqs@users.noreply.github.com> Date: Thu, 1 Dec 2022 13:47:33 +0100 Subject: [PATCH 26/35] Delete make_plots.py --- .../Analysis/plotting/make_plots.py | 234 ------------------ 1 file changed, 234 deletions(-) delete mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_plots.py diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_plots.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_plots.py deleted file mode 100644 index 4c1797bea6..0000000000 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_plots.py +++ /dev/null @@ -1,234 +0,0 @@ -import ROOT -import os -# plots don't appear while you run -ROOT.gROOT.SetBatch(0) -# no stat box on plots -ROOT.gStyle.SetOptStat(0) -# no title shown -ROOT.gStyle.SetOptTitle(0) - -HNL_mass = "50GeV" - -selection = "selJetPtGt20" -#selection = "selNone" - -output_dir = HNL_mass + "_ejj_50k/" -output_dir_sel = HNL_mass + "_ejj_50k/" + selection +'/' -input_dir = "selected_hist/" - -input_file_Dirac = input_dir + 'histDirac_ejj_'+HNL_mass+'_'+selection+'.root' -input_file_Majorana = input_dir + 'histMajorana_ejj_'+HNL_mass+'_'+selection+'.root' - -# Set plot log-scale plots, default: False -log_scale = False - -if not os.path.exists(output_dir): - os.mkdir(output_dir) - print("Directory ",output_dir," Created ") -else: - print("Directory ",output_dir," already exists") - -if not os.path.exists(output_dir_sel): - os.mkdir(output_dir_sel) - print("Directory ",output_dir_sel," Created ") -else: - print("Directory ",output_dir_sel," already exists") -# list of lists -# each internal list: hist name, x title, y title, rebin (if needed) -variables_list = [ - ["RecoElectron_pt", "Reco electron pt", "Entries", 3], - ["RecoElectron_phi", "Reco Electron phi", "Entries", 3], - ["RecoElectron_theta", "Reco Electron theta", "Entries", 3], - ["RecoElectron_e", "Reco Electron energy", "Entries", 3], - ["RecoMissingEnergy_e", "Reco Missing_e", "Entries", 3], - ["RecoMissingEnergy_pt", "Reco Missing_pt", "Entries", 3], - ["RecoMissingEnergy_p", "Reco Missing_p", "Entries", 3], - ["RecoMissingEnergy_px", "Reco Missing_px", "Entries", 3], - ["RecoMissingEnergy_py", "Reco Missing_py", "Entries", 3], - ["RecoMissingEnergy_pz", "Reco Missing_pz", "Entries", 3], - ["RecoMissingEnergy_eta", "Reco Missing_eta", "Entries", 3], - ["RecoMissingEnergy_theta", "Reco Missing_theta", "Entries", 3], - ["RecoMissingEnergy_phi", "Reco Missing_phi", "Entries", 3], - - ["n_RecoJets", "Number of RecoJets", "Entries"], - ["RecoJet_e", "Reco Jet energy", "Entries", 3], - ["RecoJet_p", "Reco Jet p", "Entries", 3], - ["RecoJet_pt", "Reco Jet pt", "Entries", 3], - ["RecoJet_pz", "Reco Jet pz", "Entries", 3], - ["RecoJet_eta", "Reco Jet eta", "Entries", 3], - ["RecoJet_theta", "Reco Jet theta", "Entries", 3], - ["RecoJet_phi", "Reco Jet phi", "Entries", 3], - ["RecoJet_charge", "Reco Jet charge", "Entries", 3], - ["RecoJetTrack_absD0", "Reco Jet abs_DO", "Entries", 3], - ["RecoJetTrack_absZ0", "Reco Jet abs_Z0", "Entries", 3], - ["RecoJetTrack_absD0sig", "Reco Jet sigma(abs_D0)", "Entries", 3], - ["RecoJetTrack_absZ0sig", "Reco Jet sigma(abs_Z0)", "Entries", 3], - ["RecoJetTrack_D0cov", "Reco Jet cov(D0)", "Entries", 3], - ["RecoJetTrack_Z0cov", "Reco Jet cov(Z0)", "Entries", 3], - - ["RecoLeadJet_e", "Reco Lead Jet E", "Entries", 3], - ["RecoLeadJet_pt", "Reco Lead Jet p_{T}", "Entries", 3], - ["RecoLeadJet_eta", "Reco Lead Jet #eta", "Entries", 3], - ["RecoLeadJet_phi", "Reco Lead Jet #phi", "Entries", 3], - ["RecoSecondJet_e", "Reco Secondary Jet E", "Entries", 3], - ["RecoSecondJet_pt", "Reco Secondary Jet p_{T}", "Entries", 3], - ["RecoSecondJet_eta", "Reco Secondary Jet #eta", "Entries", 3], - ["RecoSecondJet_phi", "Reco Secondary Jet #phi", "Entries", 3], - ["RecoJetDelta_e", "Reco Jet #Delta E", "Entries", 3], - ["RecoJetDelta_pt", "Reco Jet #Delta p_{T}", "Entries", 3], - ["RecoJetDelta_phi", "Reco Jet #Delta #phi", "Entries", 3], - ["RecoJetDelta_eta", "Reco Jet #Delta #eta", "Entries", 3], - ["RecoJetDelta_R", "Reco Jet #Delta R", "Entries", 3], - - ["GenHNLElectron_e", "GenHNLElectron E", "Entries", 3], - ["GenHNLElectron_pt", "GenHNLElectron p_{T}", "Entries", 3], - ["GenHNLElectron_eta", "GenHNLElectron #eta", "Entries", 3], - ["GenHNLElectron_phi", "GenHNLElectron #phi", "Entries", 3], - - ["LeadJet_HNLELectron_Delta_e", "LeadJet Decay Ele #Delta E", "Entries", 3], - ["LeadJet_HNLELectron_Delta_pt", "LeadJet Decay Ele #Delta p_{T}", "Entries", 3], - ["LeadJet_HNLELectron_Delta_eta", "LeadJet Decay Ele #Delta #eta", "Entries", 3], - ["LeadJet_HNLELectron_Delta_phi", "LeadJet Decay Ele #Delta #phi", "Entries", 3], - ["LeadJet_HNLELectron_Delta_R", "LeadJet Decay Ele #Delta R", "Entries", 3], - - - -# ['hnlLT', 'Lifetime [s]', 'Entries'], -# ['angsepR', 'Reco Cos#theta ee', 'Entries', 5], -# ['angsep', 'Cos#theta ee', 'Entries', 5], -# ['et', 'Missing energy [GeV]', 'Entries'], -# ['eTruthE', 'Electron energy [GeV]', 'Entries'] , -# ['eTruthP', 'Positron energy [GeV]', 'Entries'] , -# ['eRecoE', 'Reco Electron energy [GeV]', 'Entries'] , -# ['eRecoP', 'Reco Positron energy [GeV]', 'Entries'] , -# ['etaRE', 'Reco electron #eta', 'Entries'] , -# ['etaRP', 'Reco positron #eta', 'Entries'] , -# ['phiRE', 'Reco electron #phi', 'Entries'] , -# ['phiRP', 'Reco positron #phi', 'Entries'] , -# ['deletaR', 'Reco del eta ee', 'Entries'] , -# ['delphiR', 'Reco del phi ee', 'Entries'] , -# ['delRR', 'Reco del R ee', 'Entries'] , -# ['etaE', 'electron #eta', 'Entries'] , -# ['etaP', 'positron #eta', 'Entries'] , -# ['phiE', 'electron #phi', 'Entries'] , -# ['phiP', 'positron #phi', 'Entries'] , -# ['deleta', 'del eta ee', 'Entries'] , -# ['delphi', 'del phi ee', 'Entries'] , -# ['delR', 'del R ee', 'Entries'] , -# ['xmRE', 'Reco Px electron [GeV]', 'Entries'] , -# ['ymRE', 'Reco Py electron [GeV]', 'Entries'] , -# ['zmRE', 'Reco Pz electron [GeV]', 'Entries'] , -# ['xmRP', 'Reco Px positron [GeV]', 'Entries'] , -# ['ymRP', 'Reco Py positron (GeV', 'Entries'] , -# ['zmRP', 'Reco Pz positron [GeV]', 'Entries'] , -# ['tmRE', 'Reco pT electron [GeV]', 'Entries'] , -# ['tmRP', 'Reco pT positron [GeV]', 'Entries'] , -# ['xmTE', 'Px electron [GeV]', 'Entries'] , -# ['ymTE', 'Py electron [GeV]', 'Entries'] , -# ['zmTE', 'Pz electron [GeV]', 'Entries'] , -# ['xmTP', 'Px positron [GeV]', 'Entries'] , -# ['ymTP', 'Py positron [GeV]', 'Entries'] , -# ['zmTP', 'Pz positron [GeV]', 'Entries'] , -# ['tmTE', 'pT electron [GeV]', 'Entries'] , -# ['tmTP', 'pT positron [GeV]', 'Entries'] , -# ['dispvrtx', 'displaced vetex [m]', 'Entries'] -] - -files_list = [ - [input_file_Majorana , 'Majorana ' + HNL_mass + ' semi-leptonic', 'Majorana'], - [input_file_Dirac , 'Dirac ' + HNL_mass + ' semi-leptonic', 'Dirac'] -] - -legend_list = [f[1] for f in files_list] -ratio_list = [f[2] for f in files_list] -colors = [609, 856, 410, 801, 629, 879, 602, 921, 622] - -def make_plot(h_list, plot_info, legend_list): - # print('looking at histogram:', plot_info[0]) - c = ROOT.TCanvas("can"+plot_info[0],"can"+plot_info[0],600,600) - pad1 = ROOT.TPad("pad1", "pad1",0.0,0.35,1.0,1.0,21) - pad2 = ROOT.TPad("pad2", "pad2",0.0,0.0,1.0,0.35,22) - - pad1.SetFillColor(0) - pad1.SetBottomMargin(0.01) - if log_scale == True : pad1.SetLogy() - pad1.SetTickx() - pad1.SetTicky() - pad1.Draw() - - pad2.SetFillColor(0) - pad2.SetTopMargin(0.01) - pad2.SetBottomMargin(0.3) - pad2.Draw() - - leg = ROOT.TLegend(0.55, 0.7, 0.87, 0.87) - leg.SetFillStyle(0) - leg.SetLineWidth(0) - - h_max = 0 - for ih,h in enumerate(h_list): - leg.AddEntry(h, legend_list[ih]) - if len(plot_info)>3: - h.Rebin(plot_info[3]) - if h.GetMaximum() > h_max: - h_max = h.GetMaximum() - h.Sumw2() - - # Draw in the top panel - pad1.cd() - for ih,h in enumerate(h_list): - h.SetLineColor(colors[ih]) - h.SetLineWidth(3) - h.GetXaxis().SetTitle(plot_info[1]) - h.GetYaxis().SetTitle(plot_info[2]) if log_scale == False else h.GetYaxis().SetTitle("log " + plot_info[2]) - h.GetYaxis().SetTitleSize(h.GetYaxis().GetTitleSize()*1.5) - h.GetYaxis().SetTitleOffset(0.8) - h.SetMaximum(1.25*h_max) - h.Draw('same') - h.Draw('same E') - leg.Draw() - pad1.RedrawAxis() - - # build ratios - h_ratios = [] - for ih,h in enumerate(h_list): - if ih == 0: - h_ratios.append(h.Clone('h_ratio_0')) - for ibin in range(-1, h.GetNbinsX()+1): - h_ratios[0].SetBinContent(ibin,1) - else: - h_ratios.append(h.Clone('h_ratio_'+str(ih))) - h_ratios[ih].Divide(h_list[0]) - - # draw in the bottom panel - pad2.cd() - for ih,h in enumerate(h_ratios): - h.SetMaximum(1.5) - h.SetMinimum(0.5) - - h.GetYaxis().SetTitle("Ratio to "+ratio_list[0]) - h.GetYaxis().SetLabelSize(h.GetYaxis().GetLabelSize()*1.6) - h.GetYaxis().SetLabelOffset(0.01) - h.GetYaxis().SetTitleSize(h.GetYaxis().GetTitleSize()*1.6) - h.GetYaxis().SetTitleOffset(0.5) - - h.GetXaxis().SetLabelSize(h.GetXaxis().GetLabelSize()*2.3) - #h.GetXaxis().SetLabelOffset(0.02) - h.GetXaxis().SetTitleSize(h.GetXaxis().GetTitleSize()*3) - h.GetXaxis().SetTitleOffset(1.05) - - h.Draw('hist same') - if ih>0: - h.Draw('same E') - c.SaveAs(output_dir_sel + plot_info[0]+'.png') if log_scale == False else c.SaveAs(output_dir_sel + "log_" + plot_info[0]+'.png') - return -for plot_info in variables_list: - h_list = [] - print('looking at histogram:', plot_info[0]) - for ifile,fil in enumerate(files_list): - f = ROOT.TFile.Open(fil[0]) - h = f.Get(plot_info[0]) - h.SetDirectory(0) - h_list.append(h) - f.Close() - make_plot(h_list, plot_info, legend_list) From edc488a82eeb861737ee599918ab45a54a3905e7 Mon Sep 17 00:00:00 2001 From: Nayaqs <88377894+Nayaqs@users.noreply.github.com> Date: Thu, 1 Dec 2022 13:47:46 +0100 Subject: [PATCH 27/35] Delete examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis directory --- .../Analysis/plotting/make_selection_file.py | 76 ------------------- 1 file changed, 76 deletions(-) delete mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_selection_file.py diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_selection_file.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_selection_file.py deleted file mode 100644 index af66d0c9d2..0000000000 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_selection_file.py +++ /dev/null @@ -1,76 +0,0 @@ -import ROOT - -selection = "selNone" -#selection = "selJetPtGt20" - -input_path = "/afs/cern.ch/user/d/dimoulin/FCCAnalyses_new/FCC-LLP/FCCAnalyses_local/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/outputs/HNL_Dirac_ejj_50GeV_1e-3Ve/output_finalSel/HNL_Dirac_ejj_50GeV_1e-3Ve_"+selection+"_histo.root" -output_file = "selected_hist/histDirac_ejj_50GeV_"+selection+".root" - -hist_file = ROOT.TFile.Open(input_path) -#hist_file = ROOT.TFile.Open("../outputs/HNL_Dirac_20GeV_1e-3Ve/HNL_Dirac_20GeV_1e-3Ve_jets_selNone_histo.root") -histSelect = ROOT.TFile.Open(output_file, "RECREATE") - -#Object variables -histSelect.WriteObject(hist_file.Get("RecoElectron_pt"), "RecoElectron_pt") -histSelect.WriteObject(hist_file.Get("RecoElectron_phi"), "RecoElectron_phi") -histSelect.WriteObject(hist_file.Get("RecoElectron_theta"), "RecoElectron_theta") -histSelect.WriteObject(hist_file.Get("RecoElectron_e"), "RecoElectron_e") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_e"), "RecoMissingEnergy_e") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_p"), "RecoMissingEnergy_p") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_pt"), "RecoMissingEnergy_pt") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_px"), "RecoMissingEnergy_px") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_py"), "RecoMissingEnergy_py") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_pz"), "RecoMissingEnergy_pz") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_eta"), "RecoMissingEnergy_eta") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_theta"), "RecoMissingEnergy_theta") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_phi"), "RecoMissingEnergy_phi") - -# Jet variables -histSelect.WriteObject(hist_file.Get("n_RecoJets"), "n_RecoJets") -histSelect.WriteObject(hist_file.Get("RecoJet_e"), "RecoJet_e") -histSelect.WriteObject(hist_file.Get("RecoJet_p"), "RecoJet_p") -histSelect.WriteObject(hist_file.Get("RecoJet_pt"), "RecoJet_pt") -histSelect.WriteObject(hist_file.Get("RecoJet_pz"), "RecoJet_pz") -histSelect.WriteObject(hist_file.Get("RecoJet_eta"), "RecoJet_eta") -histSelect.WriteObject(hist_file.Get("RecoJet_theta"), "RecoJet_theta") -histSelect.WriteObject(hist_file.Get("RecoJet_phi"), "RecoJet_phi") -histSelect.WriteObject(hist_file.Get("RecoJet_charge"), "RecoJet_charge") -histSelect.WriteObject(hist_file.Get("RecoJetTrack_absD0"), "RecoJetTrack_absD0") -histSelect.WriteObject(hist_file.Get("RecoJetTrack_absZ0"), "RecoJetTrack_absZ0") -histSelect.WriteObject(hist_file.Get("RecoJetTrack_absD0sig"), "RecoJetTrack_absD0sig") -histSelect.WriteObject(hist_file.Get("RecoJetTrack_absZ0sig"), "RecoJetTrack_absZ0sig") -histSelect.WriteObject(hist_file.Get("RecoJetTrack_D0cov"), "RecoJetTrack_D0cov") -histSelect.WriteObject(hist_file.Get("RecoJetTrack_Z0cov"), "RecoJetTrack_Z0cov") - -histSelect.WriteObject(hist_file.Get("RecoLeadJet_e"), "RecoLeadJet_e") -histSelect.WriteObject(hist_file.Get("RecoLeadJet_pt"), "RecoLeadJet_pt") -histSelect.WriteObject(hist_file.Get("RecoLeadJet_eta"), "RecoLeadJet_eta") -histSelect.WriteObject(hist_file.Get("RecoLeadJet_phi"), "RecoLeadJet_phi") -histSelect.WriteObject(hist_file.Get("RecoSecondJet_e"), "RecoSecondJet_e") -histSelect.WriteObject(hist_file.Get("RecoSecondJet_pt"), "RecoSecondJet_pt") -histSelect.WriteObject(hist_file.Get("RecoSecondJet_eta"), "RecoSecondJet_eta") -histSelect.WriteObject(hist_file.Get("RecoSecondJet_phi"), "RecoSecondJet_phi") -histSelect.WriteObject(hist_file.Get("RecoJetDelta_e"), "RecoJetDelta_e") -histSelect.WriteObject(hist_file.Get("RecoJetDelta_pt"), "RecoJetDelta_pt") -histSelect.WriteObject(hist_file.Get("RecoJetDelta_eta"), "RecoJetDelta_eta") -histSelect.WriteObject(hist_file.Get("RecoJetDelta_phi"), "RecoJetDelta_phi") -histSelect.WriteObject(hist_file.Get("RecoJetDelta_R"), "RecoJetDelta_R") - -histSelect.WriteObject(hist_file.Get("Reco_LeadJet_invMass"), "Reco_LeadJet_invMass") -histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_e"), "LeadJet_HNLELectron_Delta_e") -histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_pt"), "LeadJet_HNLELectron_Delta_pt") -histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_eta"), "LeadJet_HNLELectron_Delta_eta") -histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_phi"), "LeadJet_HNLELectron_Delta_phi") -histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_R"), "LeadJet_HNLELectron_Delta_R") - -histSelect.WriteObject(hist_file.Get("GenHNLElectron_e"), "GenHNLElectron_e") -histSelect.WriteObject(hist_file.Get("GenHNLElectron_pt"), "GenHNLElectron_pt") -histSelect.WriteObject(hist_file.Get("GenHNLElectron_eta"), "GenHNLElectron_eta") -histSelect.WriteObject(hist_file.Get("GenHNLElectron_phi"), "GenHNLElectron_phi") - -histSelect.WriteObject(hist_file.Get("GenHNL_Lxy"), "GenHNL_Lxy") -histSelect.WriteObject(hist_file.Get("GenHNL_Lxyz"), "GenHNL_Lxyz") - -#histSelect.WriteObject(hist_file.Get(""), "") - - From e88c255519aca166c42eba8886b9cdf4589d5144 Mon Sep 17 00:00:00 2001 From: Nayaqs Date: Thu, 1 Dec 2022 13:50:01 +0100 Subject: [PATCH 28/35] Updated make_selection and make_plots to include optional selections from analysis_final.py. Also included HNL lifetime to be plotted. --- .../DisplacedHNL/plotting_tools/make_plots.py | 53 +++++++++++-- .../plotting_tools/make_selection_file.py | 76 +++++++++++++++++++ 2 files changed, 121 insertions(+), 8 deletions(-) create mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_selection_file.py diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_plots.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_plots.py index 4bc508c245..4c1797bea6 100644 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_plots.py +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_plots.py @@ -7,10 +7,17 @@ # no title shown ROOT.gStyle.SetOptTitle(0) +HNL_mass = "50GeV" -output_dir = "test_log_false/" -input_file_Dirac = 'histDirac_ejj_Select.root' -input_file_Majorana = 'histMajorana_ejj_Select.root' +selection = "selJetPtGt20" +#selection = "selNone" + +output_dir = HNL_mass + "_ejj_50k/" +output_dir_sel = HNL_mass + "_ejj_50k/" + selection +'/' +input_dir = "selected_hist/" + +input_file_Dirac = input_dir + 'histDirac_ejj_'+HNL_mass+'_'+selection+'.root' +input_file_Majorana = input_dir + 'histMajorana_ejj_'+HNL_mass+'_'+selection+'.root' # Set plot log-scale plots, default: False log_scale = False @@ -21,6 +28,11 @@ else: print("Directory ",output_dir," already exists") +if not os.path.exists(output_dir_sel): + os.mkdir(output_dir_sel) + print("Directory ",output_dir_sel," Created ") +else: + print("Directory ",output_dir_sel," already exists") # list of lists # each internal list: hist name, x title, y title, rebin (if needed) variables_list = [ @@ -38,7 +50,7 @@ ["RecoMissingEnergy_theta", "Reco Missing_theta", "Entries", 3], ["RecoMissingEnergy_phi", "Reco Missing_phi", "Entries", 3], - ["n_RecoJets", "Number of RecoJets", "Entries", 3], + ["n_RecoJets", "Number of RecoJets", "Entries"], ["RecoJet_e", "Reco Jet energy", "Entries", 3], ["RecoJet_p", "Reco Jet p", "Entries", 3], ["RecoJet_pt", "Reco Jet pt", "Entries", 3], @@ -54,6 +66,32 @@ ["RecoJetTrack_D0cov", "Reco Jet cov(D0)", "Entries", 3], ["RecoJetTrack_Z0cov", "Reco Jet cov(Z0)", "Entries", 3], + ["RecoLeadJet_e", "Reco Lead Jet E", "Entries", 3], + ["RecoLeadJet_pt", "Reco Lead Jet p_{T}", "Entries", 3], + ["RecoLeadJet_eta", "Reco Lead Jet #eta", "Entries", 3], + ["RecoLeadJet_phi", "Reco Lead Jet #phi", "Entries", 3], + ["RecoSecondJet_e", "Reco Secondary Jet E", "Entries", 3], + ["RecoSecondJet_pt", "Reco Secondary Jet p_{T}", "Entries", 3], + ["RecoSecondJet_eta", "Reco Secondary Jet #eta", "Entries", 3], + ["RecoSecondJet_phi", "Reco Secondary Jet #phi", "Entries", 3], + ["RecoJetDelta_e", "Reco Jet #Delta E", "Entries", 3], + ["RecoJetDelta_pt", "Reco Jet #Delta p_{T}", "Entries", 3], + ["RecoJetDelta_phi", "Reco Jet #Delta #phi", "Entries", 3], + ["RecoJetDelta_eta", "Reco Jet #Delta #eta", "Entries", 3], + ["RecoJetDelta_R", "Reco Jet #Delta R", "Entries", 3], + + ["GenHNLElectron_e", "GenHNLElectron E", "Entries", 3], + ["GenHNLElectron_pt", "GenHNLElectron p_{T}", "Entries", 3], + ["GenHNLElectron_eta", "GenHNLElectron #eta", "Entries", 3], + ["GenHNLElectron_phi", "GenHNLElectron #phi", "Entries", 3], + + ["LeadJet_HNLELectron_Delta_e", "LeadJet Decay Ele #Delta E", "Entries", 3], + ["LeadJet_HNLELectron_Delta_pt", "LeadJet Decay Ele #Delta p_{T}", "Entries", 3], + ["LeadJet_HNLELectron_Delta_eta", "LeadJet Decay Ele #Delta #eta", "Entries", 3], + ["LeadJet_HNLELectron_Delta_phi", "LeadJet Decay Ele #Delta #phi", "Entries", 3], + ["LeadJet_HNLELectron_Delta_R", "LeadJet Decay Ele #Delta R", "Entries", 3], + + # ['hnlLT', 'Lifetime [s]', 'Entries'], # ['angsepR', 'Reco Cos#theta ee', 'Entries', 5], @@ -97,8 +135,8 @@ ] files_list = [ - [input_file_Majorana , 'Majorana 20 GeV semi-leptonic', 'Majorana'], - [input_file_Dirac , 'Dirac 20 GeV semi-leptonic', 'Dirac'] + [input_file_Majorana , 'Majorana ' + HNL_mass + ' semi-leptonic', 'Majorana'], + [input_file_Dirac , 'Dirac ' + HNL_mass + ' semi-leptonic', 'Dirac'] ] legend_list = [f[1] for f in files_list] @@ -182,9 +220,8 @@ def make_plot(h_list, plot_info, legend_list): h.Draw('hist same') if ih>0: h.Draw('same E') - c.SaveAs(output_dir + plot_info[0]+'.png') + c.SaveAs(output_dir_sel + plot_info[0]+'.png') if log_scale == False else c.SaveAs(output_dir_sel + "log_" + plot_info[0]+'.png') return - for plot_info in variables_list: h_list = [] print('looking at histogram:', plot_info[0]) diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_selection_file.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_selection_file.py new file mode 100644 index 0000000000..af66d0c9d2 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_selection_file.py @@ -0,0 +1,76 @@ +import ROOT + +selection = "selNone" +#selection = "selJetPtGt20" + +input_path = "/afs/cern.ch/user/d/dimoulin/FCCAnalyses_new/FCC-LLP/FCCAnalyses_local/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/outputs/HNL_Dirac_ejj_50GeV_1e-3Ve/output_finalSel/HNL_Dirac_ejj_50GeV_1e-3Ve_"+selection+"_histo.root" +output_file = "selected_hist/histDirac_ejj_50GeV_"+selection+".root" + +hist_file = ROOT.TFile.Open(input_path) +#hist_file = ROOT.TFile.Open("../outputs/HNL_Dirac_20GeV_1e-3Ve/HNL_Dirac_20GeV_1e-3Ve_jets_selNone_histo.root") +histSelect = ROOT.TFile.Open(output_file, "RECREATE") + +#Object variables +histSelect.WriteObject(hist_file.Get("RecoElectron_pt"), "RecoElectron_pt") +histSelect.WriteObject(hist_file.Get("RecoElectron_phi"), "RecoElectron_phi") +histSelect.WriteObject(hist_file.Get("RecoElectron_theta"), "RecoElectron_theta") +histSelect.WriteObject(hist_file.Get("RecoElectron_e"), "RecoElectron_e") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_e"), "RecoMissingEnergy_e") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_p"), "RecoMissingEnergy_p") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_pt"), "RecoMissingEnergy_pt") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_px"), "RecoMissingEnergy_px") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_py"), "RecoMissingEnergy_py") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_pz"), "RecoMissingEnergy_pz") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_eta"), "RecoMissingEnergy_eta") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_theta"), "RecoMissingEnergy_theta") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_phi"), "RecoMissingEnergy_phi") + +# Jet variables +histSelect.WriteObject(hist_file.Get("n_RecoJets"), "n_RecoJets") +histSelect.WriteObject(hist_file.Get("RecoJet_e"), "RecoJet_e") +histSelect.WriteObject(hist_file.Get("RecoJet_p"), "RecoJet_p") +histSelect.WriteObject(hist_file.Get("RecoJet_pt"), "RecoJet_pt") +histSelect.WriteObject(hist_file.Get("RecoJet_pz"), "RecoJet_pz") +histSelect.WriteObject(hist_file.Get("RecoJet_eta"), "RecoJet_eta") +histSelect.WriteObject(hist_file.Get("RecoJet_theta"), "RecoJet_theta") +histSelect.WriteObject(hist_file.Get("RecoJet_phi"), "RecoJet_phi") +histSelect.WriteObject(hist_file.Get("RecoJet_charge"), "RecoJet_charge") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_absD0"), "RecoJetTrack_absD0") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_absZ0"), "RecoJetTrack_absZ0") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_absD0sig"), "RecoJetTrack_absD0sig") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_absZ0sig"), "RecoJetTrack_absZ0sig") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_D0cov"), "RecoJetTrack_D0cov") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_Z0cov"), "RecoJetTrack_Z0cov") + +histSelect.WriteObject(hist_file.Get("RecoLeadJet_e"), "RecoLeadJet_e") +histSelect.WriteObject(hist_file.Get("RecoLeadJet_pt"), "RecoLeadJet_pt") +histSelect.WriteObject(hist_file.Get("RecoLeadJet_eta"), "RecoLeadJet_eta") +histSelect.WriteObject(hist_file.Get("RecoLeadJet_phi"), "RecoLeadJet_phi") +histSelect.WriteObject(hist_file.Get("RecoSecondJet_e"), "RecoSecondJet_e") +histSelect.WriteObject(hist_file.Get("RecoSecondJet_pt"), "RecoSecondJet_pt") +histSelect.WriteObject(hist_file.Get("RecoSecondJet_eta"), "RecoSecondJet_eta") +histSelect.WriteObject(hist_file.Get("RecoSecondJet_phi"), "RecoSecondJet_phi") +histSelect.WriteObject(hist_file.Get("RecoJetDelta_e"), "RecoJetDelta_e") +histSelect.WriteObject(hist_file.Get("RecoJetDelta_pt"), "RecoJetDelta_pt") +histSelect.WriteObject(hist_file.Get("RecoJetDelta_eta"), "RecoJetDelta_eta") +histSelect.WriteObject(hist_file.Get("RecoJetDelta_phi"), "RecoJetDelta_phi") +histSelect.WriteObject(hist_file.Get("RecoJetDelta_R"), "RecoJetDelta_R") + +histSelect.WriteObject(hist_file.Get("Reco_LeadJet_invMass"), "Reco_LeadJet_invMass") +histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_e"), "LeadJet_HNLELectron_Delta_e") +histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_pt"), "LeadJet_HNLELectron_Delta_pt") +histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_eta"), "LeadJet_HNLELectron_Delta_eta") +histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_phi"), "LeadJet_HNLELectron_Delta_phi") +histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_R"), "LeadJet_HNLELectron_Delta_R") + +histSelect.WriteObject(hist_file.Get("GenHNLElectron_e"), "GenHNLElectron_e") +histSelect.WriteObject(hist_file.Get("GenHNLElectron_pt"), "GenHNLElectron_pt") +histSelect.WriteObject(hist_file.Get("GenHNLElectron_eta"), "GenHNLElectron_eta") +histSelect.WriteObject(hist_file.Get("GenHNLElectron_phi"), "GenHNLElectron_phi") + +histSelect.WriteObject(hist_file.Get("GenHNL_Lxy"), "GenHNL_Lxy") +histSelect.WriteObject(hist_file.Get("GenHNL_Lxyz"), "GenHNL_Lxyz") + +#histSelect.WriteObject(hist_file.Get(""), "") + + From bf7c7b6ebc1a19ed6de071276f9309f20b3326d1 Mon Sep 17 00:00:00 2001 From: Nayaqs <88377894+Nayaqs@users.noreply.github.com> Date: Thu, 1 Dec 2022 13:57:33 +0100 Subject: [PATCH 29/35] Delete make_selection.py --- .../plotting_tools/make_selection.py | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_selection.py diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_selection.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_selection.py deleted file mode 100644 index b26d2e5eef..0000000000 --- a/examples/FCCee/bsm/LLPs/DisplacedHNL/plotting_tools/make_selection.py +++ /dev/null @@ -1,56 +0,0 @@ -import ROOT -input_path = "/afs/cern.ch/user/d/dimoulin/FCCAnalyses_new/Analysis/outputs/HNL_Majorana_20GeV_1e-3Ve_jets_n50000/output_finalSel/HNL_Majorana_20GeV_1e-3Ve_jets_n50000_selNone_histo.root" -output_file = "histMajorana_ejj_Select.root" - -hist_file = ROOT.TFile.Open(input_path) -#hist_file = ROOT.TFile.Open("../outputs/HNL_Majorana_20GeV_1e-3Ve/HNL_Majorana_20GeV_1e-3Ve_jets_selNone_histo.root") -histSelect = ROOT.TFile.Open(output_file, "RECREATE") - -#Object variables -histSelect.WriteObject(hist_file.Get("RecoElectron_pt"), "RecoElectron_pt") -histSelect.WriteObject(hist_file.Get("RecoElectron_phi"), "RecoElectron_phi") -histSelect.WriteObject(hist_file.Get("RecoElectron_theta"), "RecoElectron_theta") -histSelect.WriteObject(hist_file.Get("RecoElectron_e"), "RecoElectron_e") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_e"), "RecoMissingEnergy_e") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_p"), "RecoMissingEnergy_p") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_pt"), "RecoMissingEnergy_pt") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_px"), "RecoMissingEnergy_px") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_py"), "RecoMissingEnergy_py") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_pz"), "RecoMissingEnergy_pz") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_eta"), "RecoMissingEnergy_eta") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_theta"), "RecoMissingEnergy_theta") -histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_phi"), "RecoMissingEnergy_phi") - -# Jet variables -histSelect.WriteObject(hist_file.Get("n_RecoJets"), "n_RecoJets") -histSelect.WriteObject(hist_file.Get("RecoJet_e"), "RecoJet_e") -histSelect.WriteObject(hist_file.Get("RecoJet_p"), "RecoJet_p") -histSelect.WriteObject(hist_file.Get("RecoJet_pt"), "RecoJet_pt") -histSelect.WriteObject(hist_file.Get("RecoJet_pz"), "RecoJet_pz") -histSelect.WriteObject(hist_file.Get("RecoJet_eta"), "RecoJet_eta") -histSelect.WriteObject(hist_file.Get("RecoJet_theta"), "RecoJet_theta") -histSelect.WriteObject(hist_file.Get("RecoJet_phi"), "RecoJet_phi") -histSelect.WriteObject(hist_file.Get("RecoJet_charge"), "RecoJet_charge") -histSelect.WriteObject(hist_file.Get("RecoJetTrack_absD0"), "RecoJetTrack_absD0") -histSelect.WriteObject(hist_file.Get("RecoJetTrack_absZ0"), "RecoJetTrack_absZ0") -histSelect.WriteObject(hist_file.Get("RecoJetTrack_absD0sig"), "RecoJetTrack_absD0sig") -histSelect.WriteObject(hist_file.Get("RecoJetTrack_absZ0sig"), "RecoJetTrack_absZ0sig") -histSelect.WriteObject(hist_file.Get("RecoJetTrack_D0cov"), "RecoJetTrack_D0cov") -histSelect.WriteObject(hist_file.Get("RecoJetTrack_Z0cov"), "RecoJetTrack_Z0cov") -#histSelect.WriteObject(hist_file.Get(""), "") - - - - - - - - - - - - - - - - From d9989c8683d8713ea5a7132fa6677e348179456a Mon Sep 17 00:00:00 2001 From: Nayaqs Date: Thu, 8 Dec 2022 14:22:26 +0100 Subject: [PATCH 30/35] Included get_tlv functions to return tlv from PtEtaPhiE coordinates. Included get_tlv_sum function to return the sum of two TLorentzVectors. Included get_tlv_i functions to return the energy, pt, eta, phi of TLorentzVector as ROOT:Vectors. --- .../dataframe/src/ReconstructedParticle.cc | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/analyzers/dataframe/src/ReconstructedParticle.cc b/analyzers/dataframe/src/ReconstructedParticle.cc index e6f67062b7..ae006b7550 100644 --- a/analyzers/dataframe/src/ReconstructedParticle.cc +++ b/analyzers/dataframe/src/ReconstructedParticle.cc @@ -253,6 +253,7 @@ ROOT::VecOps::RVec get_eta(ROOT::VecOps::RVec get_phi(ROOT::VecOps::RVec in) { ROOT::VecOps::RVec result; for (auto & p: in) { @@ -357,6 +358,46 @@ TLorentzVector get_tlv(edm4hep::ReconstructedParticleData in) { return result; } +TLorentzVector get_tlv_PtEtaPhiE(float pt, float eta, float phi, float e) { + TLorentzVector result; + if (e>-1) + result.SetPtEtaPhiE(pt, eta, phi, e); + else + result.SetPtEtaPhiE(0, 0, 0, -1); + return result; +} + +TLorentzVector get_tlv_sum(TLorentzVector v1, TLorentzVector v2) { + TLorentzVector result; + result = v1 + v2; + return result; +} + +ROOT::VecOps::RVec get_tlv_phi(TLorentzVector in) { + ROOT::VecOps::RVec result; + result.push_back(in.Phi()); + return result; +} + +ROOT::VecOps::RVec get_tlv_e(TLorentzVector in) { + ROOT::VecOps::RVec result; + result.push_back(in.Energy()); + return result; +} + +ROOT::VecOps::RVec get_tlv_eta(TLorentzVector in) { + ROOT::VecOps::RVec result; + result.push_back(in.Eta()); + return result; +} + +ROOT::VecOps::RVec get_tlv_pt(TLorentzVector in) { + ROOT::VecOps::RVec result; + result.push_back(in.Pt()); + return result; +} + + ROOT::VecOps::RVec get_type(ROOT::VecOps::RVec in){ ROOT::VecOps::RVec result; From 6b011b6064d79491a8d67176b621b9851d0ec3f6 Mon Sep 17 00:00:00 2001 From: Nayaqs Date: Thu, 8 Dec 2022 14:22:58 +0100 Subject: [PATCH 31/35] Included declarations on get_tlv functions. --- .../FCCAnalyses/ReconstructedParticle.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/analyzers/dataframe/FCCAnalyses/ReconstructedParticle.h b/analyzers/dataframe/FCCAnalyses/ReconstructedParticle.h index 1d330a64d5..40848872c1 100644 --- a/analyzers/dataframe/FCCAnalyses/ReconstructedParticle.h +++ b/analyzers/dataframe/FCCAnalyses/ReconstructedParticle.h @@ -126,6 +126,25 @@ namespace ReconstructedParticle{ /// return the TlorentzVector of the one input ReconstructedParticle TLorentzVector get_tlv(edm4hep::ReconstructedParticleData in); + /// return the TlorentzVector from the (pt,eta,phi,E) components + TLorentzVector get_tlv_PtEtaPhiE(float pt, float eta, float phi, float e); + + /// Return the sum of two 4-vectors + TLorentzVector get_tlv_sum(TLorentzVector v1, TLorentzVector v2); + + /// Return energy of TLorentzVector + ROOT::VecOps::RVec get_tlv_e(TLorentzVector in); + + /// Return phi of TLorentzVector + ROOT::VecOps::RVec get_tlv_phi(TLorentzVector in); + + /// Return pt of TLorentzVector + ROOT::VecOps::RVec get_tlv_pt(TLorentzVector in); + + /// Return eta of TLorentzVector + ROOT::VecOps::RVec get_tlv_eta(TLorentzVector in); + + /// concatenate both input vectors and return the resulting vector ROOT::VecOps::RVec merge(ROOT::VecOps::RVec x, ROOT::VecOps::RVec y); From 370737b132b07a2a278d7d76d251df8cfb102f60 Mon Sep 17 00:00:00 2001 From: Nayaqs Date: Thu, 8 Dec 2022 14:24:06 +0100 Subject: [PATCH 32/35] Included di-jet distributions as well as GenElectron vs DiJet delta distributions --- .../DisplacedHNL/Analysis/analysis_stage1.py | 521 ++++++++++++++++++ 1 file changed, 521 insertions(+) create mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/analysis_stage1.py diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/analysis_stage1.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/analysis_stage1.py new file mode 100644 index 0000000000..ca10fe13e0 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/analysis_stage1.py @@ -0,0 +1,521 @@ +#Mandatory: List of processes +processList = { + + #centrally-produced backgrounds + 'p8_ee_Zee_ecm91':{'chunks':100}, + 'p8_ee_Zbb_ecm91':{'chunks':100}, + 'p8_ee_Ztautau_ecm91':{'chunks':100}, + 'p8_ee_Zuds_ecm91':{'chunks':100}, + 'p8_ee_Zcc_ecm91':{'chunks':100}, + + #privately-produced signals + #'eenu_30GeV_1p41e-6Ve':{}, + #'eenu_50GeV_1p41e-6Ve':{}, + #'eenu_70GeV_1p41e-6Ve':{}, + #'eenu_90GeV_1p41e-6Ve':{}, + + #test + #'p8_ee_Zee_ecm91':{'fraction':0.000001}, + #'p8_ee_Zuds_ecm91':{'chunks':10,'fraction':0.000001}, +} + +#Production tag. This points to the yaml files for getting sample statistics +#Mandatory when running over EDM4Hep centrally produced events +#Comment out when running over privately produced events +prodTag = "FCCee/spring2021/IDEA/" + +#Input directory +#Comment out when running over centrally produced events +#Mandatory when running over privately produced events +#inputDir = "/eos/experiment/fcc/ee/analyses/case-studies/bsm/LLPs/HNLs/HNL_eenu_MadgraphPythiaDelphes" + + +#Optional: output directory, default is local dir +outputDir = "outputs/HNL_Majorana_ejj_50GeV_1e-3Ve/output_stage1/" +#outputDir = "/eos/user/j/jalimena/FCCeeLLP/" +#outputDir = "output_stage1/" + +#HNL_id = "9990012" # Dirac +HNL_id = "9900012" # Majorana + +#Optional: ncpus, default is 4 +nCPUS = 4 + +#Optional running on HTCondor, default is False +#runBatch = False +runBatch = True + +#Optional batch queue name when running on HTCondor, default is workday +batchQueue = "longlunch" + +#Optional computing account when running on HTCondor, default is group_u_FCC.local_gen +compGroup = "group_u_FCC.local_gen" + +#Mandatory: RDFanalysis class where the use defines the operations on the TTree +class RDFanalysis(): + def analysers(df): + + df2 = (df + + #Access the various objects and their properties with the following syntax: .Define("", "") + #This will create a column in the RDataFrame named and filled with the return value of the for the given collection/object + #Accessor functions are the functions found in the C++ analyzers code that return a certain variable, e.g. ::get_n(object) returns the number + #of these objects in the event and ::get_pt(object) returns the pt of the object. Here you can pick between two namespaces to access either + #reconstructed (namespace = ReconstructedParticle) or MC-level objects (namespace = MCParticle). + #For the name of the object, in principle the names of the EDM4HEP collections are used - photons, muons and electrons are an exception, see below + + #OVERVIEW: Accessing different objects and counting them + + + # Following code is written specifically for the HNL study + #################################################################################################### + .Alias("Particle1", "Particle#1.index") + .Alias("MCRecoAssociations0", "MCRecoAssociations#0.index") + .Alias("MCRecoAssociations1", "MCRecoAssociations#1.index") + + #all final state gen electrons and positrons + .Define("GenElectron_PID", "FCCAnalyses::MCParticle::sel_pdgID(11, true)(Particle)") + .Define("FSGenElectron", "FCCAnalyses::MCParticle::sel_genStatus(1)(GenElectron_PID)") #gen status==1 means final state particle (FS) + .Define("n_FSGenElectron", "FCCAnalyses::MCParticle::get_n(FSGenElectron)") + #put in dummy values below if there aren't any FSGenElectrons, to avoid seg fault + .Define("FSGenElectron_e", "if (n_FSGenElectron>0) return FCCAnalyses::MCParticle::get_e(FSGenElectron); else return FCCAnalyses::MCParticle::get_genStatus(GenElectron_PID);") + .Define("FSGenElectron_p", "if (n_FSGenElectron>0) return FCCAnalyses::MCParticle::get_p(FSGenElectron); else return FCCAnalyses::MCParticle::get_genStatus(GenElectron_PID);") + .Define("FSGenElectron_pt", "if (n_FSGenElectron>0) return FCCAnalyses::MCParticle::get_pt(FSGenElectron); else return FCCAnalyses::MCParticle::get_genStatus(GenElectron_PID);") + .Define("FSGenElectron_px", "if (n_FSGenElectron>0) return FCCAnalyses::MCParticle::get_px(FSGenElectron); else return FCCAnalyses::MCParticle::get_genStatus(GenElectron_PID);") + .Define("FSGenElectron_py", "if (n_FSGenElectron>0) return FCCAnalyses::MCParticle::get_py(FSGenElectron); else return FCCAnalyses::MCParticle::get_genStatus(GenElectron_PID);") + .Define("FSGenElectron_pz", "if (n_FSGenElectron>0) return FCCAnalyses::MCParticle::get_pz(FSGenElectron); else return FCCAnalyses::MCParticle::get_genStatus(GenElectron_PID);") + .Define("FSGenElectron_eta", "if (n_FSGenElectron>0) return FCCAnalyses::MCParticle::get_eta(FSGenElectron); else return FCCAnalyses::MCParticle::get_genStatus(GenElectron_PID);") + .Define("FSGenElectron_theta", "if (n_FSGenElectron>0) return FCCAnalyses::MCParticle::get_theta(FSGenElectron); else return FCCAnalyses::MCParticle::get_genStatus(GenElectron_PID);") + .Define("FSGenElectron_phi", "if (n_FSGenElectron>0) return FCCAnalyses::MCParticle::get_phi(FSGenElectron); else return FCCAnalyses::MCParticle::get_genStatus(GenElectron_PID);") + .Define("FSGenElectron_charge", "if (n_FSGenElectron>0) return FCCAnalyses::MCParticle::get_charge(FSGenElectron); else return FCCAnalyses::MCParticle::get_genStatus(GenElectron_PID);") + + .Define("FSGenElectron_vertex_x", "if (n_FSGenElectron>0) return FCCAnalyses::MCParticle::get_vertex_x( FSGenElectron ); else return FCCAnalyses::MCParticle::get_genStatus(GenElectron_PID);") + .Define("FSGenElectron_vertex_y", "if (n_FSGenElectron>0) return FCCAnalyses::MCParticle::get_vertex_y( FSGenElectron ); else return FCCAnalyses::MCParticle::get_genStatus(GenElectron_PID);") + .Define("FSGenElectron_vertex_z", "if (n_FSGenElectron>0) return FCCAnalyses::MCParticle::get_vertex_z( FSGenElectron ); else return FCCAnalyses::MCParticle::get_genStatus(GenElectron_PID);") + + # Finding the Lxy of the HNL + # Definition: Lxy = math.sqrt( (branchGenPtcl.At(daut1).X)**2 + (branchGenPtcl.At(daut1).Y)**2 ) + .Define("FSGen_Lxy", "return sqrt(FSGenElectron_vertex_x*FSGenElectron_vertex_x + FSGenElectron_vertex_y*FSGenElectron_vertex_y)") + # Finding the Lxyz of the HNL + .Define("FSGen_Lxyz", "return sqrt(FSGenElectron_vertex_x*FSGenElectron_vertex_x + FSGenElectron_vertex_y*FSGenElectron_vertex_y + FSGenElectron_vertex_z*FSGenElectron_vertex_z)") + + #all final state gen neutrinos and anti-neutrinos + .Define("GenNeutrino_PID", "FCCAnalyses::MCParticle::sel_pdgID(12, true)(Particle)") + .Define("FSGenNeutrino", "FCCAnalyses::MCParticle::sel_genStatus(1)(GenNeutrino_PID)") #gen status==1 means final state particle (FS) + .Define("n_FSGenNeutrino", "FCCAnalyses::MCParticle::get_n(FSGenNeutrino)") + .Define("FSGenNeutrino_e", "if (n_FSGenNeutrino>0) return FCCAnalyses::MCParticle::get_e(FSGenNeutrino); else return FCCAnalyses::MCParticle::get_genStatus(GenNeutrino_PID);") + .Define("FSGenNeutrino_p", "if (n_FSGenNeutrino>0) return FCCAnalyses::MCParticle::get_p(FSGenNeutrino); else return FCCAnalyses::MCParticle::get_genStatus(GenNeutrino_PID);") + .Define("FSGenNeutrino_pt", "if (n_FSGenNeutrino>0) return FCCAnalyses::MCParticle::get_pt(FSGenNeutrino); else return FCCAnalyses::MCParticle::get_genStatus(GenNeutrino_PID);") + .Define("FSGenNeutrino_px", "if (n_FSGenNeutrino>0) return FCCAnalyses::MCParticle::get_px(FSGenNeutrino); else return FCCAnalyses::MCParticle::get_genStatus(GenNeutrino_PID);") + .Define("FSGenNeutrino_py", "if (n_FSGenNeutrino>0) return FCCAnalyses::MCParticle::get_py(FSGenNeutrino); else return FCCAnalyses::MCParticle::get_genStatus(GenNeutrino_PID);") + .Define("FSGenNeutrino_pz", "if (n_FSGenNeutrino>0) return FCCAnalyses::MCParticle::get_pz(FSGenNeutrino); else return FCCAnalyses::MCParticle::get_genStatus(GenNeutrino_PID);") + .Define("FSGenNeutrino_eta", "if (n_FSGenNeutrino>0) return FCCAnalyses::MCParticle::get_eta(FSGenNeutrino); else return FCCAnalyses::MCParticle::get_genStatus(GenNeutrino_PID);") + .Define("FSGenNeutrino_theta", "if (n_FSGenNeutrino>0) return FCCAnalyses::MCParticle::get_theta(FSGenNeutrino); else return FCCAnalyses::MCParticle::get_genStatus(GenNeutrino_PID);") + .Define("FSGenNeutrino_phi", "if (n_FSGenNeutrino>0) return FCCAnalyses::MCParticle::get_phi(FSGenNeutrino); else return FCCAnalyses::MCParticle::get_genStatus(GenNeutrino_PID);") + .Define("FSGenNeutrino_charge", "if (n_FSGenNeutrino>0) return FCCAnalyses::MCParticle::get_charge(FSGenNeutrino); else return FCCAnalyses::MCParticle::get_genStatus(GenNeutrino_PID);") + + #all final state gen photons + .Define("GenPhoton_PID", "FCCAnalyses::MCParticle::sel_pdgID(22, false)(Particle)") + .Define("FSGenPhoton", "FCCAnalyses::MCParticle::sel_genStatus(1)(GenPhoton_PID)") #gen status==1 means final state particle (FS) + .Define("n_FSGenPhoton", "FCCAnalyses::MCParticle::get_n(FSGenPhoton)") + .Define("FSGenPhoton_e", "FCCAnalyses::MCParticle::get_e(FSGenPhoton)") + .Define("FSGenPhoton_p", "FCCAnalyses::MCParticle::get_p(FSGenPhoton)") + .Define("FSGenPhoton_pt", "FCCAnalyses::MCParticle::get_pt(FSGenPhoton)") + .Define("FSGenPhoton_px", "FCCAnalyses::MCParticle::get_px(FSGenPhoton)") + .Define("FSGenPhoton_py", "FCCAnalyses::MCParticle::get_py(FSGenPhoton)") + .Define("FSGenPhoton_pz", "FCCAnalyses::MCParticle::get_pz(FSGenPhoton)") + .Define("FSGenPhoton_eta", "FCCAnalyses::MCParticle::get_eta(FSGenPhoton)") + .Define("FSGenPhoton_theta", "FCCAnalyses::MCParticle::get_theta(FSGenPhoton)") + .Define("FSGenPhoton_phi", "FCCAnalyses::MCParticle::get_phi(FSGenPhoton)") + .Define("FSGenPhoton_charge", "FCCAnalyses::MCParticle::get_charge(FSGenPhoton)") + + + # ee invariant mass + .Define("FSGen_ee_energy", "if (n_FSGenElectron>1) return (FSGenElectron_e.at(0) + FSGenElectron_e.at(1)); else return float(-1.);") + .Define("FSGen_ee_px", "if (n_FSGenElectron>1) return (FSGenElectron_px.at(0) + FSGenElectron_px.at(1)); else return float(-1.);") + .Define("FSGen_ee_py", "if (n_FSGenElectron>1) return (FSGenElectron_py.at(0) + FSGenElectron_py.at(1)); else return float(-1.);") + .Define("FSGen_ee_pz", "if (n_FSGenElectron>1) return (FSGenElectron_pz.at(0) + FSGenElectron_pz.at(1)); else return float(-1.);") + .Define("FSGen_ee_invMass", "if (n_FSGenElectron>1) return sqrt(FSGen_ee_energy*FSGen_ee_energy - FSGen_ee_px*FSGen_ee_px - FSGen_ee_py*FSGen_ee_py - FSGen_ee_pz*FSGen_ee_pz ); else return float(-1.);") + + # eenu invariant mass + .Define("FSGen_eenu_energy", "if (n_FSGenElectron>1 && n_FSGenNeutrino>0) return (FSGenElectron_e.at(0) + FSGenElectron_e.at(1) + FSGenNeutrino_e.at(0)); else return float(-1.);") + .Define("FSGen_eenu_px", "if (n_FSGenElectron>1 && n_FSGenNeutrino>0) return (FSGenElectron_px.at(0) + FSGenElectron_px.at(1) + FSGenNeutrino_px.at(0)); else return float(-1.);") + .Define("FSGen_eenu_py", "if (n_FSGenElectron>1 && n_FSGenNeutrino>0) return (FSGenElectron_py.at(0) + FSGenElectron_py.at(1) + FSGenNeutrino_py.at(0)); else return float(-1.);") + .Define("FSGen_eenu_pz", "if (n_FSGenElectron>1 && n_FSGenNeutrino>0) return (FSGenElectron_pz.at(0) + FSGenElectron_pz.at(1) + FSGenNeutrino_pz.at(0)); else return float(-1.);") + .Define("FSGen_eenu_invMass", "if (n_FSGenElectron>1 && n_FSGenNeutrino>0) return sqrt(FSGen_eenu_energy*FSGen_eenu_energy - FSGen_eenu_px*FSGen_eenu_px - FSGen_eenu_py*FSGen_eenu_py - FSGen_eenu_pz*FSGen_eenu_pz ); else return float(-1.);") + + + # MC event primary vertex + .Define("MC_PrimaryVertex", "FCCAnalyses::MCParticle::get_EventPrimaryVertex(21)( Particle )" ) + + # Reconstructed particles + .Define("n_RecoTracks","ReconstructedParticle2Track::getTK_n(EFlowTrack_1)") + + #JETS + .Define("n_RecoJets", "ReconstructedParticle::get_n(Jet)") #count how many jets are in the event in total + .Define("n_GenJets" , "ReconstructedParticle::get_n(GenJet)") # Count number of jets per event (gen level) + #PHOTONS + .Alias("Photon0", "Photon#0.index") + .Define("RecoPhotons", "ReconstructedParticle::get(Photon0, ReconstructedParticles)") + .Define("n_RecoPhotons", "ReconstructedParticle::get_n(RecoPhotons)") #count how many photons are in the event in total + + #ELECTRONS AND MUONS + .Alias("Electron0", "Electron#0.index") + .Define("RecoElectrons", "ReconstructedParticle::get(Electron0, ReconstructedParticles)") + .Define("n_RecoElectrons", "ReconstructedParticle::get_n(RecoElectrons)") #count how many electrons are in the event in total + + .Alias("Muon0", "Muon#0.index") + .Define("RecoMuons", "ReconstructedParticle::get(Muon0, ReconstructedParticles)") + .Define("n_RecoMuons", "ReconstructedParticle::get_n(RecoMuons)") #count how many muons are in the event in total + + #SIMPLE VARIABLES: Access the basic kinematic variables of the (selected) jets, works analogously for electrons, muons + .Define("RecoJet_e", "ReconstructedParticle::get_e(Jet)") + .Define("RecoJet_p", "ReconstructedParticle::get_p(Jet)") #momentum p + .Define("RecoJet_pt", "ReconstructedParticle::get_pt(Jet)") #transverse momentum pt + .Define("RecoJet_px", "ReconstructedParticle::get_px(Jet)") + .Define("RecoJet_py", "ReconstructedParticle::get_py(Jet)") + .Define("RecoJet_pz", "ReconstructedParticle::get_pz(Jet)") + .Define("RecoJet_eta", "ReconstructedParticle::get_eta(Jet)") #pseudorapidity eta + .Define("RecoJet_theta", "ReconstructedParticle::get_theta(Jet)") + .Define("RecoJet_phi", "ReconstructedParticle::get_phi(Jet)") #polar angle in the transverse plane phi + .Define("RecoJet_charge", "ReconstructedParticle::get_charge(Jet)") + .Define("RecoJetTrack_absD0", "return abs(ReconstructedParticle2Track::getRP2TRK_D0(Jet,EFlowTrack_1))") + .Define("RecoJetTrack_absZ0", "return abs(ReconstructedParticle2Track::getRP2TRK_Z0(Jet,EFlowTrack_1))") + .Define("RecoJetTrack_absD0sig", "return abs(ReconstructedParticle2Track::getRP2TRK_D0_sig(Jet,EFlowTrack_1))") #significance + .Define("RecoJetTrack_absZ0sig", "return abs(ReconstructedParticle2Track::getRP2TRK_Z0_sig(Jet,EFlowTrack_1))") + .Define("RecoJetTrack_D0cov", "ReconstructedParticle2Track::getRP2TRK_D0_cov(Jet,EFlowTrack_1)") #variance (not sigma) + .Define("RecoJetTrack_Z0cov", "ReconstructedParticle2Track::getRP2TRK_Z0_cov(Jet,EFlowTrack_1)") + + .Define("selected_Jets", "ReconstructedParticle::sel_pt(20.)(Jet)") #select only jets with a pt > 20 GeV + .Define("selectedJet_e", "ReconstructedParticle::get_e(selected_Jets)") + .Define("selectedJet_pt", "ReconstructedParticle::get_pt(selected_Jets)") + + # Define Gen Jet variables + .Define("GenJet_e" , "ReconstructedParticle::get_e(GenJet)") + + .Define("GenLeadJet_e", "if (n_GenJets >= 1) return (GenJet_e.at(0)); else return float(-10000.);") + + # Leading Reconstructed jet variables + .Define("RecoLeadJet_e", "if (n_RecoJets >= 1) return (RecoJet_e.at(0)); else return float(-10000.);") + .Define("RecoLeadJet_pt", "if (n_RecoJets >= 1) return (RecoJet_pt.at(0)); else return float(-10000.);") + .Define("RecoLeadJet_phi", "if (n_RecoJets >= 1) return (RecoJet_phi.at(0)); else return float(-10000.);") + .Define("RecoLeadJet_eta", "if (n_RecoJets >= 1) return (RecoJet_eta.at(0)); else return float(-10000.);") + .Define("RecoLeadJet_px", "if (n_RecoJets >= 1) return (RecoJet_px.at(0)); else return float(-1.);") + .Define("RecoLeadJet_py", "if (n_RecoJets >= 1) return (RecoJet_py.at(0)); else return float(-1.);") + .Define("RecoLeadJet_pz", "if (n_RecoJets >= 1) return (RecoJet_pz.at(0)); else return float(-1.);") + + # Secondary jet variables + .Define("RecoSecondJet_e", "if (n_RecoJets > 1) return (RecoJet_e.at(1)); else return float(-1000.);") + .Define("RecoSecondJet_pt", "if (n_RecoJets > 1) return (RecoJet_pt.at(1)); else return float(-1000.);") + .Define("RecoSecondJet_phi", "if (n_RecoJets > 1) return (RecoJet_phi.at(1)); else return float(1000.);") + .Define("RecoSecondJet_eta", "if (n_RecoJets > 1) return (RecoJet_eta.at(1)); else return float(1000.);") + + # Difference between lead and secondary jet + .Define("RecoJetDelta_e", "return (RecoLeadJet_e - RecoSecondJet_e)") + .Define("RecoJetDelta_pt", "return (RecoLeadJet_pt - RecoSecondJet_pt)") + .Define("RecoJetDelta_phi", "if (RecoLeadJet_phi > -1000) return atan2(sin(RecoLeadJet_phi - RecoSecondJet_phi), cos(RecoLeadJet_phi - RecoSecondJet_phi)); else return float(100.);") + .Define("RecoJetDelta_eta", "return (RecoLeadJet_eta - RecoSecondJet_eta)") + .Define("RecoJetDelta_R", "return sqrt(RecoJetDelta_phi*RecoJetDelta_phi + RecoJetDelta_eta*RecoJetDelta_eta)") + + # Define lead jet invariant mass + .Define("Reco_LeadJet_invMass", "if (n_RecoJets >= 1) return sqrt(RecoLeadJet_e*RecoLeadJet_e - RecoLeadJet_px*RecoLeadJet_px - RecoLeadJet_py*RecoLeadJet_py - RecoLeadJet_pz*RecoLeadJet_pz ); else return float(-1.);") + + # Defining vector containing the HNL and its daughters, in order written + .Define("GenHNL_indices", "FCCAnalyses::MCParticle::get_indices(%s ,{11} , true, true, true, true)(Particle, Particle1)"%(HNL_id)) + .Define("GenHNL", "FCCAnalyses::MCParticle::selMC_leg(0)(GenHNL_indices, Particle)") + .Define("GenHNLElectron", "FCCAnalyses::MCParticle::selMC_leg(1)(GenHNL_indices, Particle)") + + #Define decay electron from HNL + .Define("GenHNLElectron_e", "FCCAnalyses::MCParticle::get_e(GenHNLElectron)") + .Define("GenHNLElectron_pt", "FCCAnalyses::MCParticle::get_pt(GenHNLElectron)") + .Define("GenHNLElectron_eta", "FCCAnalyses::MCParticle::get_eta(GenHNLElectron)") + .Define("GenHNLElectron_phi", "FCCAnalyses::MCParticle::get_phi(GenHNLElectron)") + + .Define("GenHNLElectron_vertex_x","return FCCAnalyses::MCParticle::get_vertex_x(GenHNLElectron)") + .Define("GenHNLElectron_vertex_y","return FCCAnalyses::MCParticle::get_vertex_y(GenHNLElectron)") + .Define("GenHNLElectron_vertex_z","return FCCAnalyses::MCParticle::get_vertex_z(GenHNLElectron)") + # Finding the Lxy of the HNL + # Definition: Lxy = math.sqrt( (branchGenPtcl.At(daut1).X)**2 + (branchGenPtcl.At(daut1).Y)**2 ) + .Define("GenHNL_Lxy", "return sqrt(GenHNLElectron_vertex_x*GenHNLElectron_vertex_x + GenHNLElectron_vertex_y*GenHNLElectron_vertex_y)") + # Finding the Lxyz of the HNL + .Define("GenHNL_Lxyz", "return sqrt(GenHNLElectron_vertex_x*GenHNLElectron_vertex_x + GenHNLElectron_vertex_y*GenHNLElectron_vertex_y + GenHNLElectron_vertex_z*GenHNLElectron_vertex_z)") + + #Differences Lead jet, decay electron + # Defining diff between lead jet and prompt electron + .Define("LeadJet_HNLELectron_Delta_e", "return GenHNLElectron_e - RecoLeadJet_e") + .Define("LeadJet_HNLELectron_Delta_pt", "return (GenHNLElectron_pt - RecoLeadJet_pt)") + .Define("LeadJet_HNLELectron_Delta_phi", "if (RecoLeadJet_phi < -1000) return float(-100.); else return atan2(sin(RecoLeadJet_phi - GenHNLElectron_phi.at(0)), cos(RecoLeadJet_phi - GenHNLElectron_phi.at(0)));") + .Define("LeadJet_HNLELectron_Delta_eta", "return (RecoLeadJet_eta - GenHNLElectron_eta)") + .Define("LeadJet_HNLELectron_Delta_R", "return sqrt(LeadJet_HNLELectron_Delta_phi*LeadJet_HNLELectron_Delta_phi + LeadJet_HNLELectron_Delta_eta*LeadJet_HNLELectron_Delta_eta)") + + .Define("LeadingJet4Vect", "ReconstructedParticle::get_tlv_PtEtaPhiE(RecoLeadJet_pt, RecoLeadJet_eta, RecoLeadJet_phi, RecoLeadJet_e)") + .Define("SecondJet4Vect", "ReconstructedParticle::get_tlv_PtEtaPhiE(RecoSecondJet_pt, RecoSecondJet_eta, RecoSecondJet_phi, RecoSecondJet_e)") + .Define("RecoDiJet", "ReconstructedParticle::get_tlv_sum(LeadingJet4Vect, SecondJet4Vect)") + .Define("RecoDiJet_e", "ReconstructedParticle::get_tlv_e(RecoDiJet)") + .Define("RecoDiJet_phi", "if (RecoDiJet_e.at(0) > -1) return ReconstructedParticle::get_tlv_phi(RecoDiJet).at(0); else return float(1000.);") + .Define("RecoDiJet_pt", "if (RecoDiJet_e.at(0) > -1) return ReconstructedParticle::get_tlv_pt(RecoDiJet).at(0); else return float(1000.);") + .Define("RecoDiJet_eta", "if (RecoDiJet_e.at(0) > -1) return ReconstructedParticle::get_tlv_eta(RecoDiJet).at(0); else return float(1000.);") + + .Define("DiJet_HNLElectron_Delta_e", "if (RecoDiJet_e.at(0) > -1) return GenHNLElectron_e.at(0) - RecoDiJet_e.at(0); else return float(1000.);") + .Define("DiJet_HNLElectron_Delta_pt", "return (GenHNLElectron_pt - RecoDiJet_pt)") + .Define("DiJet_HNLElectron_Delta_phi", "if (RecoDiJet_phi > 500) return float(-100.); else return atan2(sin(RecoDiJet_phi - GenHNLElectron_phi.at(0)), cos(RecoDiJet_phi - GenHNLElectron_phi.at(0)));") + .Define("DiJet_HNLElectron_Delta_eta", "return(GenHNLElectron_eta - RecoDiJet_eta)") + .Define("DiJet_HNLElectron_Delta_R", "return sqrt(DiJet_HNLElectron_Delta_phi*DiJet_HNLElectron_Delta_phi + DiJet_HNLElectron_Delta_eta*DiJet_HNLElectron_Delta_eta)") + + .Define("RecoElectron_e", "ReconstructedParticle::get_e(RecoElectrons)") + .Define("RecoElectron_p", "ReconstructedParticle::get_p(RecoElectrons)") + .Define("RecoElectron_pt", "ReconstructedParticle::get_pt(RecoElectrons)") + .Define("RecoElectron_px", "ReconstructedParticle::get_px(RecoElectrons)") + .Define("RecoElectron_py", "ReconstructedParticle::get_py(RecoElectrons)") + .Define("RecoElectron_pz", "ReconstructedParticle::get_pz(RecoElectrons)") + .Define("RecoElectron_eta", "ReconstructedParticle::get_eta(RecoElectrons)") #pseudorapidity eta + .Define("RecoElectron_theta", "ReconstructedParticle::get_theta(RecoElectrons)") + .Define("RecoElectron_phi", "ReconstructedParticle::get_phi(RecoElectrons)") #polar angle in the transverse plane phi + .Define("RecoElectron_charge", "ReconstructedParticle::get_charge(RecoElectrons)") + .Define("RecoElectronTrack_absD0", "return abs(ReconstructedParticle2Track::getRP2TRK_D0(RecoElectrons,EFlowTrack_1))") + .Define("RecoElectronTrack_absZ0", "return abs(ReconstructedParticle2Track::getRP2TRK_Z0(RecoElectrons,EFlowTrack_1))") + .Define("RecoElectronTrack_absD0sig", "return abs(ReconstructedParticle2Track::getRP2TRK_D0_sig(RecoElectrons,EFlowTrack_1))") #significance + .Define("RecoElectronTrack_absZ0sig", "return abs(ReconstructedParticle2Track::getRP2TRK_Z0_sig(RecoElectrons,EFlowTrack_1))") + .Define("RecoElectronTrack_D0cov", "ReconstructedParticle2Track::getRP2TRK_D0_cov(RecoElectrons,EFlowTrack_1)") #variance (not sigma) + .Define("RecoElectronTrack_Z0cov", "ReconstructedParticle2Track::getRP2TRK_Z0_cov(RecoElectrons,EFlowTrack_1)") + + .Define("RecoElectronTracks", "ReconstructedParticle2Track::getRP2TRK( RecoElectrons, EFlowTrack_1)") + + # Now we reconstruct the reco decay vertex using the reco'ed tracks from electrons + # First the full object, of type Vertexing::FCCAnalysesVertex + .Define("RecoDecayVertexObject", "VertexFitterSimple::VertexFitter_Tk( 2, RecoElectronTracks)" ) + + # from which we extract the edm4hep::VertexData object, which contains the vertex position in mm + .Define("RecoDecayVertex", "VertexingUtils::get_VertexData( RecoDecayVertexObject )") + + .Define("Reco_Lxy", "return sqrt(RecoDecayVertex.position.x*RecoDecayVertex.position.x + RecoDecayVertex.position.y*RecoDecayVertex.position.y)") + .Define("Reco_Lxyz","return sqrt(RecoDecayVertex.position.x*RecoDecayVertex.position.x + RecoDecayVertex.position.y*RecoDecayVertex.position.y + RecoDecayVertex.position.z*RecoDecayVertex.position.z)") + + .Define("RecoPhoton_e", "ReconstructedParticle::get_e(RecoPhotons)") + .Define("RecoPhoton_p", "ReconstructedParticle::get_p(RecoPhotons)") + .Define("RecoPhoton_pt", "ReconstructedParticle::get_pt(RecoPhotons)") + .Define("RecoPhoton_px", "ReconstructedParticle::get_px(RecoPhotons)") + .Define("RecoPhoton_py", "ReconstructedParticle::get_py(RecoPhotons)") + .Define("RecoPhoton_pz", "ReconstructedParticle::get_pz(RecoPhotons)") + .Define("RecoPhoton_eta", "ReconstructedParticle::get_eta(RecoPhotons)") #pseudorapidity eta + .Define("RecoPhoton_theta", "ReconstructedParticle::get_theta(RecoPhotons)") + .Define("RecoPhoton_phi", "ReconstructedParticle::get_phi(RecoPhotons)") #polar angle in the transverse plane phi + .Define("RecoPhoton_charge", "ReconstructedParticle::get_charge(RecoPhotons)") + + .Define("RecoMuon_e", "ReconstructedParticle::get_e(RecoMuons)") + .Define("RecoMuon_p", "ReconstructedParticle::get_p(RecoMuons)") + .Define("RecoMuon_pt", "ReconstructedParticle::get_pt(RecoMuons)") + .Define("RecoMuon_px", "ReconstructedParticle::get_px(RecoMuons)") + .Define("RecoMuon_py", "ReconstructedParticle::get_py(RecoMuons)") + .Define("RecoMuon_pz", "ReconstructedParticle::get_pz(RecoMuons)") + .Define("RecoMuon_eta", "ReconstructedParticle::get_eta(RecoMuons)") #pseudorapidity eta + .Define("RecoMuon_theta", "ReconstructedParticle::get_theta(RecoMuons)") + .Define("RecoMuon_phi", "ReconstructedParticle::get_phi(RecoMuons)") #polar angle in the transverse plane phi + .Define("RecoMuon_charge", "ReconstructedParticle::get_charge(RecoMuons)") + .Define("RecoMuonTrack_absD0", "return abs(ReconstructedParticle2Track::getRP2TRK_D0(RecoMuons,EFlowTrack_1))") + .Define("RecoMuonTrack_absZ0", "return abs(ReconstructedParticle2Track::getRP2TRK_Z0(RecoMuons,EFlowTrack_1))") + .Define("RecoMuonTrack_absD0sig", "return abs(ReconstructedParticle2Track::getRP2TRK_D0_sig(RecoMuons,EFlowTrack_1))") #significance + .Define("RecoMuonTrack_absZ0sig", "return abs(ReconstructedParticle2Track::getRP2TRK_Z0_sig(RecoMuons,EFlowTrack_1))") + .Define("RecoMuonTrack_D0cov", "ReconstructedParticle2Track::getRP2TRK_D0_cov(RecoMuons,EFlowTrack_1)") #variance (not sigma) + .Define("RecoMuonTrack_Z0cov", "ReconstructedParticle2Track::getRP2TRK_Z0_cov(RecoMuons,EFlowTrack_1)") + + #EVENTWIDE VARIABLES: Access quantities that exist only once per event, such as the missing energy (despite the name, the MissingET collection contains the total missing energy) + .Define("RecoMissingEnergy_e", "ReconstructedParticle::get_e(MissingET)") + .Define("RecoMissingEnergy_p", "ReconstructedParticle::get_p(MissingET)") + .Define("RecoMissingEnergy_pt", "ReconstructedParticle::get_pt(MissingET)") + .Define("RecoMissingEnergy_px", "ReconstructedParticle::get_px(MissingET)") #x-component of RecoMissingEnergy + .Define("RecoMissingEnergy_py", "ReconstructedParticle::get_py(MissingET)") #y-component of RecoMissingEnergy + .Define("RecoMissingEnergy_pz", "ReconstructedParticle::get_pz(MissingET)") #z-component of RecoMissingEnergy + .Define("RecoMissingEnergy_eta", "ReconstructedParticle::get_eta(MissingET)") + .Define("RecoMissingEnergy_theta", "ReconstructedParticle::get_theta(MissingET)") + .Define("RecoMissingEnergy_phi", "ReconstructedParticle::get_phi(MissingET)") #angle of RecoMissingEnergy + + # ee invariant mass + .Define("Reco_ee_energy", "if (n_RecoElectrons>1) return (RecoElectron_e.at(0) + RecoElectron_e.at(1)); else return float(-1.);") + .Define("Reco_ee_px", "if (n_RecoElectrons>1) return (RecoElectron_px.at(0) + RecoElectron_px.at(1)); else return float(-1.);") + .Define("Reco_ee_py", "if (n_RecoElectrons>1) return (RecoElectron_py.at(0) + RecoElectron_py.at(1)); else return float(-1.);") + .Define("Reco_ee_pz", "if (n_RecoElectrons>1) return (RecoElectron_pz.at(0) + RecoElectron_pz.at(1)); else return float(-1.);") + .Define("Reco_ee_invMass", "if (n_RecoElectrons>1) return sqrt(Reco_ee_energy*Reco_ee_energy - Reco_ee_px*Reco_ee_px - Reco_ee_py*Reco_ee_py - Reco_ee_pz*Reco_ee_pz ); else return float(-1.);") + + + ) + return df2 + + def output(): + branchList = [ + ######## Monte-Carlo particles ####### + "n_FSGenElectron", + "FSGenElectron_e", + "FSGenElectron_p", + "FSGenElectron_pt", + "FSGenElectron_px", + "FSGenElectron_py", + "FSGenElectron_pz", + "FSGenElectron_eta", + "FSGenElectron_theta", + "FSGenElectron_phi", + "FSGenElectron_charge", + "FSGenElectron_vertex_x", + "FSGenElectron_vertex_y", + "FSGenElectron_vertex_z", + "FSGen_Lxy", + "FSGen_Lxyz", + "n_FSGenNeutrino", + "FSGenNeutrino_e", + "FSGenNeutrino_p", + "FSGenNeutrino_pt", + "FSGenNeutrino_px", + "FSGenNeutrino_py", + "FSGenNeutrino_pz", + "FSGenNeutrino_eta", + "FSGenNeutrino_theta", + "FSGenNeutrino_phi", + "FSGenNeutrino_charge", + "n_FSGenPhoton", + "FSGenPhoton_e", + "FSGenPhoton_p", + "FSGenPhoton_pt", + "FSGenPhoton_px", + "FSGenPhoton_py", + "FSGenPhoton_pz", + "FSGenPhoton_eta", + "FSGenPhoton_theta", + "FSGenPhoton_phi", + "FSGenPhoton_charge", + + "n_GenJets", + "GenJet_e", + "GenLeadJet_e", + + "GenHNLElectron_e", + "GenHNLElectron_pt", + "GenHNLElectron_eta", + "GenHNLElectron_phi", + + ######## Reconstructed particles ####### + "n_RecoTracks", + "n_RecoJets", + "n_RecoPhotons", + "n_RecoElectrons", + "n_RecoMuons", + "RecoJet_e", + "RecoJet_p", + "RecoJet_pt", + "RecoJet_px", + "RecoJet_py", + "RecoJet_pz", + "RecoJet_eta", + "RecoJet_theta", + "RecoJet_phi", + "RecoJet_charge", + "RecoJetTrack_absD0", + "RecoJetTrack_absZ0", + "RecoJetTrack_absD0sig", + "RecoJetTrack_absZ0sig", + "RecoJetTrack_D0cov", + "RecoJetTrack_Z0cov", + + "selectedJet_e", + "selectedJet_pt", + + "RecoLeadJet_e", + "RecoLeadJet_pt", + "RecoLeadJet_eta", + "RecoLeadJet_phi", + "Reco_LeadJet_invMass", + "RecoSecondJet_e", + "RecoSecondJet_pt", + "RecoSecondJet_eta", + "RecoSecondJet_phi", + + "RecoJetDelta_e", + "RecoJetDelta_pt", + "RecoJetDelta_phi", + "RecoJetDelta_eta", + "RecoJetDelta_R", + + "LeadJet_HNLELectron_Delta_e", + "LeadJet_HNLELectron_Delta_pt", + "LeadJet_HNLELectron_Delta_eta", + "LeadJet_HNLELectron_Delta_phi", + "LeadJet_HNLELectron_Delta_R", + + "RecoDiJet", + "RecoDiJet_e", + "RecoDiJet_pt", + "RecoDiJet_eta", + "RecoDiJet_phi", + + "DiJet_HNLElectron_Delta_e", + "DiJet_HNLElectron_Delta_pt", + "DiJet_HNLElectron_Delta_phi", + "DiJet_HNLElectron_Delta_eta", + "DiJet_HNLElectron_Delta_R", + + "GenHNL_Lxy", + "GenHNL_Lxyz", + + "RecoPhoton_e", + "RecoPhoton_p", + "RecoPhoton_pt", + "RecoPhoton_px", + "RecoPhoton_py", + "RecoPhoton_pz", + "RecoPhoton_eta", + "RecoPhoton_theta", + "RecoPhoton_phi", + "RecoPhoton_charge", + "RecoElectron_e", + "RecoElectron_p", + "RecoElectron_pt", + "RecoElectron_px", + "RecoElectron_py", + "RecoElectron_pz", + "RecoElectron_eta", + "RecoElectron_theta", + "RecoElectron_phi", + "RecoElectron_charge", + "RecoElectronTrack_absD0", + "RecoElectronTrack_absZ0", + "RecoElectronTrack_absD0sig", + "RecoElectronTrack_absZ0sig", + "RecoElectronTrack_D0cov", + "RecoElectronTrack_Z0cov", + "RecoDecayVertexObject", + "RecoDecayVertex", + "Reco_Lxy", + "Reco_Lxyz", + "RecoMuon_e", + "RecoMuon_p", + "RecoMuon_pt", + "RecoMuon_px", + "RecoMuon_py", + "RecoMuon_pz", + "RecoMuon_eta", + "RecoMuon_theta", + "RecoMuon_phi", + "RecoMuon_charge", + "RecoMuonTrack_absD0", + "RecoMuonTrack_absZ0", + "RecoMuonTrack_absD0sig", + "RecoMuonTrack_absZ0sig", + "RecoMuonTrack_D0cov", + "RecoMuonTrack_Z0cov", + "RecoMissingEnergy_e", + "RecoMissingEnergy_p", + "RecoMissingEnergy_pt", + "RecoMissingEnergy_px", + "RecoMissingEnergy_py", + "RecoMissingEnergy_pz", + "RecoMissingEnergy_eta", + "RecoMissingEnergy_theta", + "RecoMissingEnergy_phi", + + # enunu branches + "FSGen_ee_invMass", + "FSGen_eenu_invMass", + "Reco_ee_invMass", + + ] + + return branchList From 165dcdc1c37e244cffa6e170dec2e604cca1feb1 Mon Sep 17 00:00:00 2001 From: Nayaqs Date: Thu, 8 Dec 2022 14:24:40 +0100 Subject: [PATCH 33/35] Added Di-Jet variables to the list. --- .../DisplacedHNL/Analysis/analysis_final.py | 247 ++++++++++++++++++ 1 file changed, 247 insertions(+) create mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/analysis_final.py diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/analysis_final.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/analysis_final.py new file mode 100644 index 0000000000..60588e0fbd --- /dev/null +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/analysis_final.py @@ -0,0 +1,247 @@ +#Input directory where the files produced at the stage1 level are +inputDir = "/afs/cern.ch/user/d/dimoulin/FCCAnalyses_new/FCC-LLP/FCCAnalyses_local/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/outputs/HNL_Dirac_ejj_50GeV_1e-3Ve/output_stage1/" +#inputDir = "/eos/user/j/jalimena/FCCeeLLP/" +#inputDir = "output_stage1/" + +#Input directory where the files produced at the final-selection level are +outputDir = "outputs/HNL_Dirac_ejj_50GeV_1e-3Ve/output_finalSel/" + +processList = { + #run over the full statistics from stage1 + 'HNL_Dirac_ejj_50GeV_1e-3Ve':{}, +} + +#Link to the dictonary that contains all the cross section information etc... +procDict = "FCCee_procDict_spring2021_IDEA.json" + +#Add MySample_p8_ee_ZH_ecm240 as it is not an offical process +procDictAdd={ + #"MySample_p8_ee_ZH_ecm240":{"numberOfEvents": 10000000, "sumOfWeights": 10000000, "crossSection": 0.201868, "kfactor": 1.0, "matchingEfficiency": 1.0} +} + +#Number of CPUs to use +nCPUS = 4 + +#produces ROOT TTrees, default is False +doTree = False + +###Dictionnay of the list of cuts. The key is the name of the selection that will be added to the output file +cutList = { + "selNone": "n_RecoTracks > -1", + "selJetPtGt20":"RecoJet_pt[0]>20", + # "sel1FSGenEle": "n_FSGenElectron>0", + # "sel1FSGenEle_eeInvMassGt80": "n_FSGenElectron>0 && FSGen_ee_invMass >80", + # "sel1FSGenNu": "n_FSGenNeutrino>0", + # "sel2RecoEle": "n_RecoElectrons==2", + # "sel2RecoEle_vetoes": "n_RecoElectrons==2 && n_RecoMuons==0 && n_RecoPhotons==0 && n_RecoJets==0 && n_RecoPhotons==0", + # "sel2RecoEle_absD0Gt0p1": "n_RecoElectrons==2 && RecoElectronTrack_absD0[0]>0.1 && RecoElectronTrack_absD0[1]>0.1", #both electrons displaced + # "sel2RecoEle_chi2Gt0p1": "n_RecoElectrons==2 && RecoDecayVertex.chi2>0.1", #good vertex + # "sel2RecoEle_chi2Gt0p1_LxyzGt1": "n_RecoElectrons==2 && RecoDecayVertex.chi2>0.1 && Reco_Lxyz>1", #displaced vertex + # "sel2RecoEle_vetoes_MissingEnergyGt10": "n_RecoElectrons==2 && n_RecoMuons==0 && n_RecoPhotons==0 && n_RecoJets==0 && n_RecoPhotons==0 && RecoMissingEnergy_p[0]>10", #missing energy > 10 GeV + # "sel2RecoEle_vetoes_absD0Gt0p5": "n_RecoElectrons==2 && n_RecoMuons==0 && n_RecoPhotons==0 && n_RecoJets==0 && n_RecoPhotons==0 && RecoElectronTrack_absD0[0]>0.5 && RecoElectronTrack_absD0[1]>0.5", #both electrons displaced + #"sel2RecoEle_vetoes_MissingEnergyGt10_absD0Gt0p5": "n_RecoElectrons==2 && n_RecoMuons==0 && n_RecoPhotons==0 && n_RecoJets==0 && n_RecoPhotons==0 && RecoMissingEnergy_p[0]>10 && RecoElectronTrack_absD0[0]>0.5 && RecoElectronTrack_absD0[1]>0.5", #both electrons displaced + # "sel2RecoEle_vetoes_MissingEnergyGt10_chi2Gt1_LxyzGt5": "n_RecoElectrons==2 && n_RecoMuons==0 && n_RecoPhotons==0 && n_RecoJets==0 && n_RecoPhotons==0 && RecoMissingEnergy_p[0]>10 && RecoDecayVertex.chi2>1 && Reco_Lxyz>5", #displaced vertex +} + +###Dictionary for the ouput variable/hitograms. The key is the name of the variable in the output files. "name" is the name of the variable in the input file, "title" is the x-axis label of the histogram, "bin" the number of bins of the histogram, "xmin" the minimum x-axis value and "xmax" the maximum x-axis value. +histoList = { + + #gen variables + "n_FSGenElectron": {"name":"n_FSGenElectron", "title":"Number of final state gen electrons", "bin":5,"xmin":-0.5 ,"xmax":4.5}, + + "FSGenElectron_e": {"name":"FSGenElectron_e", "title":"Final state gen electrons energy [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "FSGenElectron_p": {"name":"FSGenElectron_p", "title":"Final state gen electrons p [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "FSGenElectron_pt": {"name":"FSGenElectron_pt", "title":"Final state gen electrons p_{T} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "FSGenElectron_pz": {"name":"FSGenElectron_pz", "title":"Final state gen electrons p_{z} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "FSGenElectron_eta": {"name":"FSGenElectron_eta", "title":"Final state gen electrons #eta", "bin":60, "xmin":-3,"xmax":3}, + "FSGenElectron_theta": {"name":"FSGenElectron_theta", "title":"Final state gen electrons #theta", "bin":64, "xmin":0,"xmax":3.2}, + "FSGenElectron_phi": {"name":"FSGenElectron_phi", "title":"Final state gen electrons #phi", "bin":64, "xmin":-3.2,"xmax":3.2}, + "FSGenElectron_charge": {"name":"FSGenElectron_charge", "title":"Final state gen electrons charge", "bin":3, "xmin":-1.5,"xmax":1.5}, + + "FSGenElectron_vertex_x": {"name":"FSGenElectron_vertex_x", "title":"Final state gen e^{#font[122]{\55}} production vertex x [mm]", "bin":100,"xmin":-1000 ,"xmax":1000}, + "FSGenElectron_vertex_y": {"name":"FSGenElectron_vertex_y", "title":"Final state gen e^{#font[122]{\55}} production vertex y [mm]", "bin":100,"xmin":-1000 ,"xmax":1000}, + "FSGenElectron_vertex_z": {"name":"FSGenElectron_vertex_z", "title":"Final state gen e^{#font[122]{\55}} production vertex z [mm]", "bin":100,"xmin":-1000 ,"xmax":1000}, + + "FSGenElectron_vertex_x_prompt": {"name":"FSGenElectron_vertex_x", "title":"Final state gen e^{#font[122]{\55}} production vertex x [mm]", "bin":100,"xmin":-0.01 ,"xmax":0.01}, + "FSGenElectron_vertex_y_prompt": {"name":"FSGenElectron_vertex_y", "title":"Final state gen e^{#font[122]{\55}} production vertex y [mm]", "bin":100,"xmin":-0.01 ,"xmax":0.01}, + "FSGenElectron_vertex_z_prompt": {"name":"FSGenElectron_vertex_z", "title":"Final state gen e^{#font[122]{\55}} production vertex z [mm]", "bin":100,"xmin":-0.01 ,"xmax":0.01}, + + "FSGen_Lxy": {"name":"FSGen_Lxy", "title":"Gen L_{xy} [mm]", "bin":100,"xmin":0 ,"xmax":1000}, + "FSGen_Lxyz": {"name":"FSGen_Lxyz", "title":"Gen L_{xyz} [mm]", "bin":100,"xmin":0 ,"xmax":1000}, + "FSGen_Lxyz_prompt": {"name":"FSGen_Lxyz", "title":"Gen L_{xyz} [mm]", "bin":100,"xmin":0 ,"xmax":10}, + + "n_FSGenNeutrino": {"name":"n_FSGenNeutrino", "title":"Number of final state gen neutrinos", "bin":5,"xmin":-0.5 ,"xmax":4.5}, + + "FSGenNeutrino_e": {"name":"FSGenNeutrino_e", "title":"Final state gen neutrinos energy [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "FSGenNeutrino_p": {"name":"FSGenNeutrino_p", "title":"Final state gen neutrinos p [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "FSGenNeutrino_pt": {"name":"FSGenNeutrino_pt", "title":"Final state gen neutrinos p_{T} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "FSGenNeutrino_pz": {"name":"FSGenNeutrino_pz", "title":"Final state gen neutrinos p_{z} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "FSGenNeutrino_eta": {"name":"FSGenNeutrino_eta", "title":"Final state gen neutrinos #eta", "bin":60, "xmin":-3,"xmax":3}, + "FSGenNeutrino_theta": {"name":"FSGenNeutrino_theta", "title":"Final state gen neutrinos #theta", "bin":64, "xmin":0,"xmax":3.2}, + "FSGenNeutrino_phi": {"name":"FSGenNeutrino_phi", "title":"Final state gen neutrinos #phi", "bin":64, "xmin":-3.2,"xmax":3.2}, + "FSGenNeutrino_charge": {"name":"FSGenNeutrino_charge", "title":"Final state gen neutrinos charge", "bin":3, "xmin":-1.5,"xmax":1.5}, + + "FSGen_ee_invMass": {"name":"FSGen_ee_invMass", "title":"Gen m_{ee} [GeV]", "bin":100,"xmin":0, "xmax":100}, + "FSGen_eenu_invMass": {"name":"FSGen_eenu_invMass", "title":"Gen m_{ee#nu} [GeV]", "bin":100,"xmin":0, "xmax":100}, + + "n_FSGenPhoton": {"name":"n_FSGenPhoton", "title":"Number of final state gen photons", "bin":10,"xmin":-0.5 ,"xmax":9.5}, + "FSGenPhoton_e": {"name":"FSGenPhoton_e", "title":"Final state gen photons energy [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "FSGenPhoton_p": {"name":"FSGenPhoton_p", "title":"Final state gen photons p [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "FSGenPhoton_pt": {"name":"FSGenPhoton_pt", "title":"Final state gen photons p_{T} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "FSGenPhoton_pz": {"name":"FSGenPhoton_pz", "title":"Final state gen photons p_{z} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "FSGenPhoton_eta": {"name":"FSGenPhoton_eta", "title":"Final state gen photons #eta", "bin":60, "xmin":-3,"xmax":3}, + "FSGenPhoton_theta": {"name":"FSGenPhoton_theta", "title":"Final state gen photons #theta", "bin":64, "xmin":0,"xmax":3.2}, + "FSGenPhoton_phi": {"name":"FSGenPhoton_phi", "title":"Final state gen photons #phi", "bin":64, "xmin":-3.2,"xmax":3.2}, + "FSGenPhoton_charge": {"name":"FSGenPhoton_charge", "title":"Final state gen photons charge", "bin":3, "xmin":-1.5,"xmax":1.5}, + + + "GenHNLElectron_e": {"name":"GenHNLElectron_e", "title":"Decay electron energy [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "GenHNLElectron_pt": {"name":"GenHNLElectron_pt", "title":"Decay electron p_{T} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "GenHNLElectron_eta": {"name":"GenHNLElectron_eta", "title":"Decay electron #eta", "bin":60,"xmin":-3 ,"xmax":3}, + "GenHNLElectron_phi": {"name":"GenHNLElectron_phi", "title":"Decay electron #phi", "bin":64,"xmin":-3.2 ,"xmax":3.2}, + + #reco variables + "n_RecoTracks": {"name":"n_RecoTracks", "title":"Total number of reco tracks", "bin":5,"xmin":-0.5 ,"xmax":4.5}, + "n_RecoJets": {"name":"n_RecoJets", "title":"Total number of reco jets", "bin":11,"xmin":-0.5 ,"xmax":10.5}, + "n_RecoPhotons": {"name":"n_RecoPhotons", "title":"Total number of reco photons", "bin":5,"xmin":-0.5 ,"xmax":4.5}, + "n_RecoElectrons": {"name":"n_RecoElectrons", "title":"Total number of reco electrons", "bin":5,"xmin":-0.5 ,"xmax":4.5}, + "n_RecoMuons": {"name":"n_RecoMuons", "title":"Total number of reco muons", "bin":5,"xmin":-0.5 ,"xmax":4.5}, + + "RecoJet_e": {"name":"RecoJet_e", "title":"Reco jet energy [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoJet_p": {"name":"RecoJet_p", "title":"Reco jet p [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoJet_pt": {"name":"RecoJet_pt", "title":"Reco jet p_{T} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoJet_pz": {"name":"RecoJet_pz", "title":"Reco jet p_{z} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoJet_eta": {"name":"RecoJet_eta", "title":"Reco jet #eta", "bin":60, "xmin":-3,"xmax":3}, + "RecoJet_theta": {"name":"RecoJet_theta", "title":"Reco jet #theta", "bin":64, "xmin":0,"xmax":3.2}, + "RecoJet_phi": {"name":"RecoJet_phi", "title":"Reco jet #phi", "bin":64, "xmin":-3.2,"xmax":3.2}, + "RecoJet_charge": {"name":"RecoJet_charge", "title":"Reco jet charge", "bin":3, "xmin":-1.5,"xmax":1.5}, + + "GenJet_e": {"name":"GenJet_e", "title":"Gen jet energy [GeV]", "bin":100,"xmin":0, "xmax":5}, + "GenLeadJet_e": {"name":"GenLeadJet_e", "title":"Gen Leading jet energy [GeV]", "bin":100,"xmin":0, "xmax":50}, + + "RecoLeadJet_e": {"name":"RecoLeadJet_e", "title":"Reco Leading jet energy [GeV]", "bin":100,"xmin":0, "xmax":50}, + "RecoLeadJet_e_scaled": {"name":"RecoLeadJet_e", "title":"Reco Leading jet energy_scaled [GeV]", "bin":100,"xmin":0, "xmax":1}, + "RecoLeadJet_pt": {"name":"RecoLeadJet_pt", "title":"Reco Leading jet p_{T} [GeV]", "bin":100,"xmin":0, "xmax":50}, + "RecoLeadJet_eta": {"name":"RecoLeadJet_eta", "title":"Reco Leading jet #eta", "bin":64,"xmin":-3.2, "xmax":3.2}, + "RecoLeadJet_phi": {"name":"RecoLeadJet_phi", "title":"Reco Leading jet #phi", "bin":64,"xmin":-3.2, "xmax":3.2}, + "RecoSecondJet_e": {"name":"RecoSecondJet_e", "title":"Reco Secondary jet energy [GeV]", "bin":100,"xmin":0, "xmax":50}, + "RecoSecondJet_pt": {"name":"RecoSecondJet_pt", "title":"Reco Secondary jet p_{T} [GeV]", "bin":100,"xmin":0, "xmax":50}, + "RecoSecondJet_eta": {"name":"RecoSecondJet_eta", "title":"Reco Secondary jet #eta", "bin":64,"xmin":-3.2, "xmax":3.2}, + "RecoSecondJet_phi": {"name":"RecoSecondJet_phi", "title":"Reco Secondary jet #phi", "bin":64,"xmin":-3.2, "xmax":3.2}, + + "RecoDiJet_e": {"name":"RecoDiJet_e", "title":"Reco di-jet energy [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoDiJet_pt": {"name":"RecoDiJet_pt", "title":"Reco di-jet pt [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoDiJet_eta": {"name":"RecoDiJet_eta", "title":"Reco di-jet eta", "bin":64,"xmin":-3.2 ,"xmax":3.2}, + "RecoDiJet_phi": {"name":"RecoDiJet_phi", "title":"Reco di-jet phi]", "bin":64,"xmin":-3.2 ,"xmax":3.2}, + + + "RecoJetDelta_e": {"name":"RecoJetDelta_e", "title":"Reco Jet #Delta E [GeV]", "bin":100,"xmin":0, "xmax":50}, + "RecoJetDelta_pt": {"name":"RecoJetDelta_pt", "title":"Reco Jet #Delta p_{T} [GeV]", "bin":100,"xmin":0, "xmax":50}, + "RecoJetDelta_phi": {"name":"RecoJetDelta_phi", "title":"Reco Jet #Delta #phi", "bin":64,"xmin":-4, "xmax":4}, + "RecoJetDelta_eta": {"name":"RecoJetDelta_eta", "title":"Reco Jet #Delta #eta", "bin":64,"xmin":-7, "xmax":7}, + "RecoJetDelta_R": {"name":"RecoJetDelta_R", "title":"Reco Jet #Delta R", "bin":100,"xmin":0, "xmax":10}, + + "Reco_LeadJet_invMass": {"name":"Reco_LeadJet_invMass", "title":"Reco m_{Jet} [GeV]", "bin":100,"xmin":0, "xmax":10}, + + "LeadJet_HNLELectron_Delta_e": {"name":"LeadJet_HNLELectron_Delta_e", "title":"RecoJet DecayEle #Delta E [GeV]", "bin":100,"xmin":-50, "xmax":50}, + "LeadJet_HNLELectron_Delta_pt": {"name":"LeadJet_HNLELectron_Delta_pt", "title":"RecoJet DecayEle #Delta p_{T} [GeV]", "bin":100,"xmin":-50, "xmax":50}, + "LeadJet_HNLELectron_Delta_phi": {"name":"LeadJet_HNLELectron_Delta_phi", "title":"RecoJet DecayEle #Delta #phi", "bin":64,"xmin":-4, "xmax":4}, + "LeadJet_HNLELectron_Delta_eta": {"name":"LeadJet_HNLELectron_Delta_eta", "title":"RecoJet DecayEle #Delta #eta", "bin":64,"xmin":-7, "xmax":7}, + "LeadJet_HNLELectron_Delta_R": {"name":"LeadJet_HNLELectron_Delta_R", "title":"RecoJet DecayEle #Delta R", "bin":100,"xmin":0, "xmax":10}, + + + "DiJet_HNLElectron_Delta_e": {"name":"DiJet_HNLElectron_Delta_e", "title":"DiJet DecayEle #Delta E [GeV]", "bin":100,"xmin":-50, "xmax":50}, + "DiJet_HNLElectron_Delta_pt": {"name":"DiJet_HNLElectron_Delta_pt", "title":"DiJet DecayEle #Delta p_{T} [GeV]", "bin":100,"xmin":-50, "xmax":50}, + "DiJet_HNLElectron_Delta_phi": {"name":"DiJet_HNLElectron_Delta_phi", "title":"DiJet DecayEle #Delta #phi", "bin":64,"xmin":-4, "xmax":4}, + "DiJet_HNLElectron_Delta_eta": {"name":"DiJet_HNLElectron_Delta_eta", "title":"DiJet DecayEle #Delta #eta", "bin":64,"xmin":-7, "xmax":7}, + "DiJet_HNLElectron_Delta_R": {"name":"DiJet_HNLElectron_Delta_R", "title":"DiJet DecayEle #Delta R", "bin":100,"xmin":0, "xmax":10}, + + "GenHNL_Lxy": {"name":"GenHNL_Lxy", "title":"Gen L_{xy} [mm]", "bin":50,"xmin":0 ,"xmax":0.01}, + "GenHNL_Lxyz": {"name":"GenHNL_Lxyz", "title":"Gen L_{xyz} [mm]", "bin":50,"xmin":0 ,"xmax":0.01}, + + "RecoJetTrack_absD0": {"name":"RecoJetTrack_absD0", "title":"Reco jet tracks |d_{0}| [mm]", "bin":100,"xmin":0, "xmax":1}, + "RecoJetTrack_absD0_prompt": {"name":"RecoJetTrack_absD0", "title":"Reco jet tracks |d_{0}| [mm]", "bin":100,"xmin":0, "xmax":1}, + "RecoJetTrack_absZ0": {"name":"RecoJetTrack_absZ0", "title":"Reco jet tracks |z_{0}| [mm]", "bin":100,"xmin":0, "xmax":1}, + "RecoJetTrack_absZ0_prompt": {"name":"RecoJetTrack_absZ0", "title":"Reco jet tracks |z_{0}| [mm]", "bin":100,"xmin":0, "xmax":1}, + "RecoJetTrack_absD0sig": {"name":"RecoJetTrack_absD0sig", "title":"Reco jet tracks |d_{0} significance|", "bin":100,"xmin":0, "xmax":600000}, + "RecoJetTrack_absD0sig_prompt": {"name":"RecoJetTrack_absD0sig", "title":"Reco jet tracks |d_{0} significance|", "bin":100,"xmin":0, "xmax":5}, + "RecoJetTrack_absZ0sig": {"name":"RecoJetTrack_absZ0sig", "title":"Reco jet tracks |z_{0} significance|", "bin":100,"xmin":0, "xmax":600000}, + "RecoJetTrack_absZ0sig_prompt": {"name":"RecoJetTrack_absZ0sig", "title":"Reco jet tracks |z_{0} significance|", "bin":100,"xmin":0, "xmax":5}, + "RecoJetTrack_D0cov": {"name":"RecoJetTrack_D0cov", "title":"Reco jet tracks d_{0} #sigma^{2}", "bin":100,"xmin":0, "xmax":0.5}, + "RecoJetTrack_Z0cov": {"name":"RecoJetTrack_Z0cov", "title":"Reco jet tracks z_{0} #sigma^{2}", "bin":100,"xmin":0, "xmax":0.5}, + + "RecoElectron_e": {"name":"RecoElectron_e", "title":"Reco electron energy [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoElectron_p": {"name":"RecoElectron_p", "title":"Reco electron p [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoElectron_pt": {"name":"RecoElectron_pt", "title":"Reco electron p_{T} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoElectron_pz": {"name":"RecoElectron_pz", "title":"Reco electron p_{z} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoElectron_eta": {"name":"RecoElectron_eta", "title":"Reco electron #eta", "bin":60, "xmin":-3,"xmax":3}, + "RecoElectron_theta": {"name":"RecoElectron_theta", "title":"Reco electron #theta", "bin":64, "xmin":0,"xmax":3.2}, + "RecoElectron_phi": {"name":"RecoElectron_phi", "title":"Reco electron #phi", "bin":64, "xmin":-3.2,"xmax":3.2}, + "RecoElectron_charge": {"name":"RecoElectron_charge", "title":"Reco electron charge", "bin":3, "xmin":-1.5,"xmax":1.5}, + + "RecoElectronTrack_absD0": {"name":"RecoElectronTrack_absD0", "title":"Reco electron tracks |d_{0}| [mm]", "bin":100,"xmin":0, "xmax":2000}, + "RecoElectronTrack_absD0_med": {"name":"RecoElectronTrack_absD0", "title":"Reco electron tracks |d_{0}| [mm]", "bin":100,"xmin":0, "xmax":10}, + "RecoElectronTrack_absD0_prompt": {"name":"RecoElectronTrack_absD0", "title":"Reco electron tracks |d_{0}| [mm]", "bin":100,"xmin":0, "xmax":1}, + "RecoElectronTrack_absZ0": {"name":"RecoElectronTrack_absZ0", "title":"Reco electron tracks |z_{0}| [mm]", "bin":100,"xmin":0, "xmax":2000}, + "RecoElectronTrack_absZ0_prompt": {"name":"RecoElectronTrack_absZ0", "title":"Reco electron tracks |z_{0}| [mm]", "bin":100,"xmin":0, "xmax":1}, + "RecoElectronTrack_absD0sig": {"name":"RecoElectronTrack_absD0sig", "title":"Reco electron tracks |d_{0} significance|", "bin":100,"xmin":0, "xmax":600000}, + "RecoElectronTrack_absD0sig_prompt": {"name":"RecoElectronTrack_absD0sig", "title":"Reco electron tracks |d_{0} significance|", "bin":100,"xmin":0, "xmax":5}, + "RecoElectronTrack_absZ0sig": {"name":"RecoElectronTrack_absZ0sig", "title":"Reco electron tracks |z_{0} significance|", "bin":100,"xmin":0, "xmax":600000}, + "RecoElectronTrack_absZ0sig_prompt": {"name":"RecoElectronTrack_absZ0sig", "title":"Reco electron tracks |z_{0} significance|", "bin":100,"xmin":0, "xmax":5}, + "RecoElectronTrack_D0cov": {"name":"RecoElectronTrack_D0cov", "title":"Reco electron tracks d_{0} #sigma^{2}", "bin":100,"xmin":0, "xmax":0.5}, + "RecoElectronTrack_Z0cov": {"name":"RecoElectronTrack_Z0cov", "title":"Reco electron tracks z_{0} #sigma^{2}", "bin":100,"xmin":0, "xmax":0.5}, + + "Reco_DecayVertex_x": {"name":"RecoDecayVertex.position.x", "title":"Reco decay vertex x [mm]", "bin":100,"xmin":-1000 ,"xmax":1000}, + "Reco_DecayVertex_y": {"name":"RecoDecayVertex.position.y", "title":"Reco decay vertex y [mm]", "bin":100,"xmin":-1000 ,"xmax":1000}, + "Reco_DecayVertex_z": {"name":"RecoDecayVertex.position.z", "title":"Reco decay vertex z [mm]", "bin":100,"xmin":-1000 ,"xmax":1000}, + "Reco_DecayVertex_x_prompt": {"name":"RecoDecayVertex.position.x", "title":"Reco decay vertex x [mm]", "bin":100,"xmin":-0.01 ,"xmax":0.01}, + "Reco_DecayVertex_y_prompt": {"name":"RecoDecayVertex.position.y", "title":"Reco decay vertex y [mm]", "bin":100,"xmin":-0.01 ,"xmax":0.01}, + "Reco_DecayVertex_z_prompt": {"name":"RecoDecayVertex.position.z", "title":"Reco decay vertex z [mm]", "bin":100,"xmin":-0.01 ,"xmax":0.01}, + "Reco_DecayVertex_chi2": {"name":"RecoDecayVertex.chi2", "title":"Reco decay vertex #chi^{2}", "bin":100,"xmin":0 ,"xmax":3}, + "Reco_DecayVertex_probability": {"name":"RecoDecayVertex.probability", "title":"Reco decay vertex probability", "bin":100,"xmin":0 ,"xmax":10}, + "Reco_Lxy": {"name":"Reco_Lxy", "title":"Reco L_{xy} [mm]", "bin":100,"xmin":0 ,"xmax":1000}, + "Reco_Lxyz": {"name":"Reco_Lxyz", "title":"Reco L_{xyz} [mm]", "bin":100,"xmin":0 ,"xmax":1000}, + "Reco_Lxyz_prompt": {"name":"Reco_Lxyz", "title":"Reco L_{xyz} [mm]", "bin":100,"xmin":0 ,"xmax":0.1}, + + "Reco_ee_invMass": {"name":"Reco_ee_invMass", "title":"Reco m_{ee} [GeV]", "bin":100,"xmin":0, "xmax":100}, + + "RecoPhoton_e": {"name":"RecoPhoton_e", "title":"Reco photon energy [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoPhoton_p": {"name":"RecoPhoton_p", "title":"Reco photon p [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoPhoton_pt": {"name":"RecoPhoton_pt", "title":"Reco photon p_{T} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoPhoton_pz": {"name":"RecoPhoton_pz", "title":"Reco photon p_{z} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoPhoton_eta": {"name":"RecoPhoton_eta", "title":"Reco photon #eta", "bin":60, "xmin":-3,"xmax":3}, + "RecoPhoton_theta": {"name":"RecoPhoton_theta", "title":"Reco photon #theta", "bin":64, "xmin":0,"xmax":3.2}, + "RecoPhoton_phi": {"name":"RecoPhoton_phi", "title":"Reco photon #phi", "bin":64, "xmin":-3.2,"xmax":3.2}, + "RecoPhoton_charge": {"name":"RecoPhoton_charge", "title":"Reco photon charge", "bin":3, "xmin":-1.5,"xmax":1.5}, + + "RecoMuon_e": {"name":"RecoMuon_e", "title":"Reco muon energy [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoMuon_p": {"name":"RecoMuon_p", "title":"Reco muon p [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoMuon_pt": {"name":"RecoMuon_pt", "title":"Reco muon p_{T} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoMuon_pz": {"name":"RecoMuon_pz", "title":"Reco muon p_{z} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoMuon_eta": {"name":"RecoMuon_eta", "title":"Reco muon #eta", "bin":60, "xmin":-3,"xmax":3}, + "RecoMuon_theta": {"name":"RecoMuon_theta", "title":"Reco muon #theta", "bin":64, "xmin":0,"xmax":3.2}, + "RecoMuon_phi": {"name":"RecoMuon_phi", "title":"Reco muon #phi", "bin":64, "xmin":-3.2,"xmax":3.2}, + "RecoMuon_charge": {"name":"RecoMuon_charge", "title":"Reco muon charge", "bin":3, "xmin":-1.5,"xmax":1.5}, + + "RecoMuonTrack_absD0": {"name":"RecoMuonTrack_absD0", "title":"Reco muon tracks |d_{0}| [mm]", "bin":100,"xmin":0, "xmax":2000}, + "RecoMuonTrack_absD0_prompt": {"name":"RecoMuonTrack_absD0", "title":"Reco muon tracks |d_{0}| [mm]", "bin":100,"xmin":0, "xmax":1}, + "RecoMuonTrack_absZ0": {"name":"RecoMuonTrack_absZ0", "title":"Reco muon tracks |z_{0}| [mm]", "bin":100,"xmin":0, "xmax":2000}, + "RecoMuonTrack_absZ0_prompt": {"name":"RecoMuonTrack_absZ0", "title":"Reco muon tracks |z_{0}| [mm]", "bin":100,"xmin":0, "xmax":1}, + "RecoMuonTrack_absD0sig": {"name":"RecoMuonTrack_absD0sig", "title":"Reco muon tracks |d_{0} significance|", "bin":100,"xmin":0, "xmax":600000}, + "RecoMuonTrack_absD0sig_prompt": {"name":"RecoMuonTrack_absD0sig", "title":"Reco muon tracks |d_{0} significance|", "bin":100,"xmin":0, "xmax":5}, + "RecoMuonTrack_absZ0sig": {"name":"RecoMuonTrack_absZ0sig", "title":"Reco muon tracks |z_{0} significance|", "bin":100,"xmin":0, "xmax":600000}, + "RecoMuonTrack_absZ0sig_prompt": {"name":"RecoMuonTrack_absZ0sig", "title":"Reco muon tracks |z_{0} significance|", "bin":100,"xmin":0, "xmax":5}, + "RecoMuonTrack_D0cov": {"name":"RecoMuonTrack_D0cov", "title":"Reco muon tracks d_{0} #sigma^{2}", "bin":100,"xmin":0, "xmax":0.5}, + "RecoMuonTrack_Z0cov": {"name":"RecoMuonTrack_Z0cov", "title":"Reco muon tracks z_{0} #sigma^{2}", "bin":100,"xmin":0, "xmax":0.5}, + + "RecoMissingEnergy_e": {"name":"RecoMissingEnergy_e", "title":"Reco Total Missing Energy [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoMissingEnergy_p": {"name":"RecoMissingEnergy_p", "title":"Reco Total Missing p [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoMissingEnergy_pt": {"name":"RecoMissingEnergy_pt", "title":"Reco Missing p_{T} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoMissingEnergy_px": {"name":"RecoMissingEnergy_px", "title":"Reco Missing p_{x} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoMissingEnergy_py": {"name":"RecoMissingEnergy_py", "title":"Reco Missing p_{y} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoMissingEnergy_pz": {"name":"RecoMissingEnergy_pz", "title":"Reco Missing p_{z} [GeV]", "bin":100,"xmin":0 ,"xmax":50}, + "RecoMissingEnergy_eta": {"name":"RecoMissingEnergy_eta", "title":"Reco Missing Energy #eta", "bin":60,"xmin":-3 ,"xmax":3}, + "RecoMissingEnergy_theta": {"name":"RecoMissingEnergy_theta", "title":"Reco Missing Energy #theta", "bin":64,"xmin":0 , "xmax":3.2}, + "RecoMissingEnergy_phi": {"name":"RecoMissingEnergy_phi", "title":"Reco Missing Energy #phi", "bin":64,"xmin":-3.2 ,"xmax":3.2}, + +} From 8b97fc8169b24967fb4a25ca4dbc69f7b110fda6 Mon Sep 17 00:00:00 2001 From: Nayaqs Date: Thu, 8 Dec 2022 14:25:12 +0100 Subject: [PATCH 34/35] Added Di-Jet variables to the selection --- .../Analysis/plotting/make_selection_file.py | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_selection_file.py diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_selection_file.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_selection_file.py new file mode 100644 index 0000000000..39022e55a4 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_selection_file.py @@ -0,0 +1,89 @@ +import ROOT + +selection = "selNone" +#selection = "selJetPtGt20" + +input_path = "/afs/cern.ch/user/d/dimoulin/FCCAnalyses_new/FCC-LLP/FCCAnalyses_local/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/outputs/HNL_Majorana_ejj_50GeV_1e-3Ve/output_finalSel/HNL_Majorana_ejj_50GeV_1e-3Ve_"+selection+"_histo.root" +output_file = "selected_hist/histMajorana_ejj_50GeV_1e-3Ve_"+selection+".root" + +hist_file = ROOT.TFile.Open(input_path) +#hist_file = ROOT.TFile.Open("../outputs/HNL_Majorana_20GeV_1e-3Ve/HNL_Majorana_20GeV_1e-3Ve_jets_selNone_histo.root") +histSelect = ROOT.TFile.Open(output_file, "RECREATE") + +#Object variables +histSelect.WriteObject(hist_file.Get("RecoElectron_pt"), "RecoElectron_pt") +histSelect.WriteObject(hist_file.Get("RecoElectron_phi"), "RecoElectron_phi") +histSelect.WriteObject(hist_file.Get("RecoElectron_theta"), "RecoElectron_theta") +histSelect.WriteObject(hist_file.Get("RecoElectron_e"), "RecoElectron_e") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_e"), "RecoMissingEnergy_e") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_p"), "RecoMissingEnergy_p") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_pt"), "RecoMissingEnergy_pt") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_px"), "RecoMissingEnergy_px") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_py"), "RecoMissingEnergy_py") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_pz"), "RecoMissingEnergy_pz") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_eta"), "RecoMissingEnergy_eta") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_theta"), "RecoMissingEnergy_theta") +histSelect.WriteObject(hist_file.Get("RecoMissingEnergy_phi"), "RecoMissingEnergy_phi") + +# Jet variables +histSelect.WriteObject(hist_file.Get("n_RecoJets"), "n_RecoJets") +histSelect.WriteObject(hist_file.Get("RecoJet_e"), "RecoJet_e") +histSelect.WriteObject(hist_file.Get("RecoJet_p"), "RecoJet_p") +histSelect.WriteObject(hist_file.Get("RecoJet_pt"), "RecoJet_pt") +histSelect.WriteObject(hist_file.Get("RecoJet_pz"), "RecoJet_pz") +histSelect.WriteObject(hist_file.Get("RecoJet_eta"), "RecoJet_eta") +histSelect.WriteObject(hist_file.Get("RecoJet_theta"), "RecoJet_theta") +histSelect.WriteObject(hist_file.Get("RecoJet_phi"), "RecoJet_phi") +histSelect.WriteObject(hist_file.Get("RecoJet_charge"), "RecoJet_charge") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_absD0"), "RecoJetTrack_absD0") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_absZ0"), "RecoJetTrack_absZ0") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_absD0sig"), "RecoJetTrack_absD0sig") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_absZ0sig"), "RecoJetTrack_absZ0sig") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_D0cov"), "RecoJetTrack_D0cov") +histSelect.WriteObject(hist_file.Get("RecoJetTrack_Z0cov"), "RecoJetTrack_Z0cov") + +histSelect.WriteObject(hist_file.Get("RecoLeadJet_e"), "RecoLeadJet_e") +histSelect.WriteObject(hist_file.Get("RecoLeadJet_pt"), "RecoLeadJet_pt") +histSelect.WriteObject(hist_file.Get("RecoLeadJet_eta"), "RecoLeadJet_eta") +histSelect.WriteObject(hist_file.Get("RecoLeadJet_phi"), "RecoLeadJet_phi") +histSelect.WriteObject(hist_file.Get("RecoSecondJet_e"), "RecoSecondJet_e") +histSelect.WriteObject(hist_file.Get("RecoSecondJet_pt"), "RecoSecondJet_pt") +histSelect.WriteObject(hist_file.Get("RecoSecondJet_eta"), "RecoSecondJet_eta") +histSelect.WriteObject(hist_file.Get("RecoSecondJet_phi"), "RecoSecondJet_phi") +histSelect.WriteObject(hist_file.Get("RecoJetDelta_e"), "RecoJetDelta_e") +histSelect.WriteObject(hist_file.Get("RecoJetDelta_pt"), "RecoJetDelta_pt") +histSelect.WriteObject(hist_file.Get("RecoJetDelta_eta"), "RecoJetDelta_eta") +histSelect.WriteObject(hist_file.Get("RecoJetDelta_phi"), "RecoJetDelta_phi") +histSelect.WriteObject(hist_file.Get("RecoJetDelta_R"), "RecoJetDelta_R") + +histSelect.WriteObject(hist_file.Get("Reco_LeadJet_invMass"), "Reco_LeadJet_invMass") +histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_e"), "LeadJet_HNLELectron_Delta_e") +histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_pt"), "LeadJet_HNLELectron_Delta_pt") +histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_eta"), "LeadJet_HNLELectron_Delta_eta") +histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_phi"), "LeadJet_HNLELectron_Delta_phi") +histSelect.WriteObject(hist_file.Get("LeadJet_HNLELectron_Delta_R"), "LeadJet_HNLELectron_Delta_R") + +histSelect.WriteObject(hist_file.Get("GenHNLElectron_e"), "GenHNLElectron_e") +histSelect.WriteObject(hist_file.Get("GenHNLElectron_pt"), "GenHNLElectron_pt") +histSelect.WriteObject(hist_file.Get("GenHNLElectron_eta"), "GenHNLElectron_eta") +histSelect.WriteObject(hist_file.Get("GenHNLElectron_phi"), "GenHNLElectron_phi") + +histSelect.WriteObject(hist_file.Get("GenHNL_Lxy"), "GenHNL_Lxy") +histSelect.WriteObject(hist_file.Get("GenHNL_Lxyz"), "GenHNL_Lxyz") + +histSelect.WriteObject(hist_file.Get("RecoDiJet_e"), "RecoDiJet_e") +histSelect.WriteObject(hist_file.Get("RecoDiJet_pt"), "RecoDiJet_pt") +histSelect.WriteObject(hist_file.Get("RecoDiJet_eta"), "RecoDiJet_eta") +histSelect.WriteObject(hist_file.Get("RecoDiJet_phi"), "RecoDiJet_phi") + +histSelect.WriteObject(hist_file.Get("DiJet_HNLElectron_Delta_e"), "DiJet_HNLElectron_Delta_e") +histSelect.WriteObject(hist_file.Get("DiJet_HNLElectron_Delta_pt"), "DiJet_HNLElectron_Delta_pt") +histSelect.WriteObject(hist_file.Get("DiJet_HNLElectron_Delta_eta"), "DiJet_HNLElectron_Delta_eta") +histSelect.WriteObject(hist_file.Get("DiJet_HNLElectron_Delta_phi"), "DiJet_HNLElectron_Delta_phi") +histSelect.WriteObject(hist_file.Get("DiJet_HNLElectron_Delta_R"), "DiJet_HNLElectron_Delta_R") + + + +#histSelect.WriteObject(hist_file.Get(""), "") + + From 0b2b603007da4dda2fcd04fb734cf58f9613d1b7 Mon Sep 17 00:00:00 2001 From: Nayaqs Date: Thu, 8 Dec 2022 14:25:32 +0100 Subject: [PATCH 35/35] Added Di-Jet variables to be plotted --- .../Analysis/plotting/make_plots.py | 253 ++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_plots.py diff --git a/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_plots.py b/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_plots.py new file mode 100644 index 0000000000..4ff4832562 --- /dev/null +++ b/examples/FCCee/bsm/LLPs/DisplacedHNL/Analysis/plotting/make_plots.py @@ -0,0 +1,253 @@ +import ROOT +import os +# plots don't appear while you run +ROOT.gROOT.SetBatch(0) +# no stat box on plots +ROOT.gStyle.SetOptStat(0) +# no title shown +ROOT.gStyle.SetOptTitle(0) + +HNL_mass = "50GeV" + +selection = "selJetPtGt20" +#selection = "selNone" + +output_dir = HNL_mass + "_ejj_50k/" +output_dir_sel = HNL_mass + "_ejj_50k/" + selection +'/' +input_dir = "selected_hist/" + +#input_file_Dirac = input_dir + 'histDirac_ejj_'+HNL_mass+'_AE10_'+selection+'.root' +#input_file_Majorana = input_dir + 'histDirac_ejj_'+HNL_mass+'_AE100_'+selection+'.root' + +input_file_Dirac = input_dir + 'histDirac_ejj_'+HNL_mass+'_1e-3Ve_'+selection+'.root' +input_file_Majorana = input_dir + 'histMajorana_ejj_'+HNL_mass+'_1e-3Ve_'+selection+'.root' + +# Set plot log-scale plots, default: False +log_scale = False + +if not os.path.exists(output_dir): + os.mkdir(output_dir) + print("Directory ",output_dir," Created ") +else: + print("Directory ",output_dir," already exists") + +if not os.path.exists(output_dir_sel): + os.mkdir(output_dir_sel) + print("Directory ",output_dir_sel," Created ") +else: + print("Directory ",output_dir_sel," already exists") +# list of lists +# each internal list: hist name, x title, y title, rebin (if needed) +variables_list = [ + ["RecoElectron_pt", "Reco electron pt", "Entries", 3], + ["RecoElectron_phi", "Reco Electron phi", "Entries", 3], + ["RecoElectron_theta", "Reco Electron theta", "Entries", 3], + ["RecoElectron_e", "Reco Electron energy", "Entries", 3], + ["RecoMissingEnergy_e", "Reco Missing_e", "Entries", 3], + ["RecoMissingEnergy_pt", "Reco Missing_pt", "Entries", 3], + ["RecoMissingEnergy_p", "Reco Missing_p", "Entries", 3], + ["RecoMissingEnergy_px", "Reco Missing_px", "Entries", 3], + ["RecoMissingEnergy_py", "Reco Missing_py", "Entries", 3], + ["RecoMissingEnergy_pz", "Reco Missing_pz", "Entries", 3], + ["RecoMissingEnergy_eta", "Reco Missing_eta", "Entries", 3], + ["RecoMissingEnergy_theta", "Reco Missing_theta", "Entries", 3], + ["RecoMissingEnergy_phi", "Reco Missing_phi", "Entries", 3], + + ["n_RecoJets", "Number of RecoJets", "Entries"], + ["RecoJet_e", "Reco Jet energy", "Entries", 3], + ["RecoJet_p", "Reco Jet p", "Entries", 3], + ["RecoJet_pt", "Reco Jet pt", "Entries", 3], + ["RecoJet_pz", "Reco Jet pz", "Entries", 3], + ["RecoJet_eta", "Reco Jet eta", "Entries", 3], + ["RecoJet_theta", "Reco Jet theta", "Entries", 3], + ["RecoJet_phi", "Reco Jet phi", "Entries", 3], + ["RecoJet_charge", "Reco Jet charge", "Entries", 3], + ["RecoJetTrack_absD0", "Reco Jet abs_DO", "Entries", 3], + ["RecoJetTrack_absZ0", "Reco Jet abs_Z0", "Entries", 3], + ["RecoJetTrack_absD0sig", "Reco Jet sigma(abs_D0)", "Entries", 3], + ["RecoJetTrack_absZ0sig", "Reco Jet sigma(abs_Z0)", "Entries", 3], + ["RecoJetTrack_D0cov", "Reco Jet cov(D0)", "Entries", 3], + ["RecoJetTrack_Z0cov", "Reco Jet cov(Z0)", "Entries", 3], + + ["RecoLeadJet_e", "Reco Lead Jet E", "Entries", 3], + ["RecoLeadJet_pt", "Reco Lead Jet p_{T}", "Entries", 3], + ["RecoLeadJet_eta", "Reco Lead Jet #eta", "Entries", 3], + ["RecoLeadJet_phi", "Reco Lead Jet #phi", "Entries", 3], + + ["RecoSecondJet_e", "Reco Secondary Jet E", "Entries", 3], + ["RecoSecondJet_pt", "Reco Secondary Jet p_{T}", "Entries", 3], + ["RecoSecondJet_eta", "Reco Secondary Jet #eta", "Entries", 3], + ["RecoSecondJet_phi", "Reco Secondary Jet #phi", "Entries", 3], + + ["RecoDiJet_e", "Reco Di-Jet E", "Entries", 3], + ["RecoDiJet_pt", "Reco Di-Jet p_{T}", "Entries", 3], + ["RecoDiJet_eta", "Reco Di-Jet #eta", "Entries", 3], + ["RecoDiJet_phi", "Reco Di-Jet #phi", "Entries", 3], + + + ["RecoJetDelta_e", "Reco Jet #Delta E", "Entries", 3], + ["RecoJetDelta_pt", "Reco Jet #Delta p_{T}", "Entries", 3], + ["RecoJetDelta_phi", "Reco Jet #Delta #phi", "Entries", 3], + ["RecoJetDelta_eta", "Reco Jet #Delta #eta", "Entries", 3], + ["RecoJetDelta_R", "Reco Jet #Delta R", "Entries", 3], + + ["GenHNLElectron_e", "GenHNLElectron E", "Entries", 3], + ["GenHNLElectron_pt", "GenHNLElectron p_{T}", "Entries", 3], + ["GenHNLElectron_eta", "GenHNLElectron #eta", "Entries", 3], + ["GenHNLElectron_phi", "GenHNLElectron #phi", "Entries", 3], + + ["LeadJet_HNLELectron_Delta_e", "LeadJet Decay Ele #Delta E", "Entries", 3], + ["LeadJet_HNLELectron_Delta_pt", "LeadJet Decay Ele #Delta p_{T}", "Entries", 3], + ["LeadJet_HNLELectron_Delta_eta", "LeadJet Decay Ele #Delta #eta", "Entries", 3], + ["LeadJet_HNLELectron_Delta_phi", "LeadJet Decay Ele #Delta #phi", "Entries", 3], + ["LeadJet_HNLELectron_Delta_R", "LeadJet Decay Ele #Delta R", "Entries", 3], + + ["DiJet_HNLElectron_Delta_e", "Di-Jet Decay Ele #Delta E", "Entries", 3], + ["DiJet_HNLElectron_Delta_pt", "Di-Jet Decay Ele #Delta p_{T}", "Entries", 3], + ["DiJet_HNLElectron_Delta_phi", "Di-Jet Decay Ele #Delta #phi", "Entries", 3], + ["DiJet_HNLElectron_Delta_eta", "Di-Jet Decay Ele #Delta #eta", "Entries", 3], + ["DiJet_HNLElectron_Delta_R", "Di-Jet Decay Ele #Delta R", "Entries", 3], + + + ["GenHNL_Lxy", "GenHNL_Lxy", "Entries", 3], + ["GenHNL_Lxyz", "GenHNL_Lxyz", "Entries", 3], + +# ['hnlLT', 'Lifetime [s]', 'Entries'], +# ['angsepR', 'Reco Cos#theta ee', 'Entries', 5], +# ['angsep', 'Cos#theta ee', 'Entries', 5], +# ['et', 'Missing energy [GeV]', 'Entries'], +# ['eTruthE', 'Electron energy [GeV]', 'Entries'] , +# ['eTruthP', 'Positron energy [GeV]', 'Entries'] , +# ['eRecoE', 'Reco Electron energy [GeV]', 'Entries'] , +# ['eRecoP', 'Reco Positron energy [GeV]', 'Entries'] , +# ['etaRE', 'Reco electron #eta', 'Entries'] , +# ['etaRP', 'Reco positron #eta', 'Entries'] , +# ['phiRE', 'Reco electron #phi', 'Entries'] , +# ['phiRP', 'Reco positron #phi', 'Entries'] , +# ['deletaR', 'Reco del eta ee', 'Entries'] , +# ['delphiR', 'Reco del phi ee', 'Entries'] , +# ['delRR', 'Reco del R ee', 'Entries'] , +# ['etaE', 'electron #eta', 'Entries'] , +# ['etaP', 'positron #eta', 'Entries'] , +# ['phiE', 'electron #phi', 'Entries'] , +# ['phiP', 'positron #phi', 'Entries'] , +# ['deleta', 'del eta ee', 'Entries'] , +# ['delphi', 'del phi ee', 'Entries'] , +# ['delR', 'del R ee', 'Entries'] , +# ['xmRE', 'Reco Px electron [GeV]', 'Entries'] , +# ['ymRE', 'Reco Py electron [GeV]', 'Entries'] , +# ['zmRE', 'Reco Pz electron [GeV]', 'Entries'] , +# ['xmRP', 'Reco Px positron [GeV]', 'Entries'] , +# ['ymRP', 'Reco Py positron (GeV', 'Entries'] , +# ['zmRP', 'Reco Pz positron [GeV]', 'Entries'] , +# ['tmRE', 'Reco pT electron [GeV]', 'Entries'] , +# ['tmRP', 'Reco pT positron [GeV]', 'Entries'] , +# ['xmTE', 'Px electron [GeV]', 'Entries'] , +# ['ymTE', 'Py electron [GeV]', 'Entries'] , +# ['zmTE', 'Pz electron [GeV]', 'Entries'] , +# ['xmTP', 'Px positron [GeV]', 'Entries'] , +# ['ymTP', 'Py positron [GeV]', 'Entries'] , +# ['zmTP', 'Pz positron [GeV]', 'Entries'] , +# ['tmTE', 'pT electron [GeV]', 'Entries'] , +# ['tmTP', 'pT positron [GeV]', 'Entries'] , +# ['dispvrtx', 'displaced vetex [m]', 'Entries'] +] + +files_list = [ + [input_file_Majorana , 'Majorana ' + HNL_mass + ' semi-leptonic', 'Majorana'], + [input_file_Dirac , 'Dirac ' + HNL_mass + ' semi-leptonic', 'Dirac'] +] + +legend_list = [f[1] for f in files_list] +ratio_list = [f[2] for f in files_list] +colors = [609, 856, 410, 801, 629, 879, 602, 921, 622] + +def make_plot(h_list, plot_info, legend_list): + # print('looking at histogram:', plot_info[0]) + c = ROOT.TCanvas("can"+plot_info[0],"can"+plot_info[0],600,600) + pad1 = ROOT.TPad("pad1", "pad1",0.0,0.35,1.0,1.0,21) + pad2 = ROOT.TPad("pad2", "pad2",0.0,0.0,1.0,0.35,22) + + pad1.SetFillColor(0) + pad1.SetBottomMargin(0.01) + if log_scale == True : pad1.SetLogy() + pad1.SetTickx() + pad1.SetTicky() + pad1.Draw() + + pad2.SetFillColor(0) + pad2.SetTopMargin(0.01) + pad2.SetBottomMargin(0.3) + pad2.Draw() + + leg = ROOT.TLegend(0.55, 0.7, 0.87, 0.87) + leg.SetFillStyle(0) + leg.SetLineWidth(0) + + h_max = 0 + for ih,h in enumerate(h_list): + leg.AddEntry(h, legend_list[ih]) + if len(plot_info)>3: + h.Rebin(plot_info[3]) + if h.GetMaximum() > h_max: + h_max = h.GetMaximum() + h.Sumw2() + + # Draw in the top panel + pad1.cd() + for ih,h in enumerate(h_list): + h.SetLineColor(colors[ih]) + h.SetLineWidth(3) + h.GetXaxis().SetTitle(plot_info[1]) + h.GetYaxis().SetTitle(plot_info[2]) if log_scale == False else h.GetYaxis().SetTitle("log " + plot_info[2]) + h.GetYaxis().SetTitleSize(h.GetYaxis().GetTitleSize()*1.5) + h.GetYaxis().SetTitleOffset(0.8) + h.SetMaximum(1.25*h_max) + h.Draw('same') + h.Draw('same E') + leg.Draw() + pad1.RedrawAxis() + + # build ratios + h_ratios = [] + for ih,h in enumerate(h_list): + if ih == 0: + h_ratios.append(h.Clone('h_ratio_0')) + for ibin in range(-1, h.GetNbinsX()+1): + h_ratios[0].SetBinContent(ibin,1) + else: + h_ratios.append(h.Clone('h_ratio_'+str(ih))) + h_ratios[ih].Divide(h_list[0]) + + # draw in the bottom panel + pad2.cd() + for ih,h in enumerate(h_ratios): + h.SetMaximum(1.5) + h.SetMinimum(0.5) + + h.GetYaxis().SetTitle("Ratio to "+ratio_list[0]) + h.GetYaxis().SetLabelSize(h.GetYaxis().GetLabelSize()*1.6) + h.GetYaxis().SetLabelOffset(0.01) + h.GetYaxis().SetTitleSize(h.GetYaxis().GetTitleSize()*1.6) + h.GetYaxis().SetTitleOffset(0.5) + + h.GetXaxis().SetLabelSize(h.GetXaxis().GetLabelSize()*2.3) + #h.GetXaxis().SetLabelOffset(0.02) + h.GetXaxis().SetTitleSize(h.GetXaxis().GetTitleSize()*3) + h.GetXaxis().SetTitleOffset(1.05) + + h.Draw('hist same') + if ih>0: + h.Draw('same E') + c.SaveAs(output_dir_sel + plot_info[0]+'.png') if log_scale == False else c.SaveAs(output_dir_sel + "log_" + plot_info[0]+'.png') + return +for plot_info in variables_list: + h_list = [] + print('looking at histogram:', plot_info[0]) + for ifile,fil in enumerate(files_list): + f = ROOT.TFile.Open(fil[0]) + h = f.Get(plot_info[0]) + h.SetDirectory(0) + h_list.append(h) + f.Close() + make_plot(h_list, plot_info, legend_list)