Error Running PythiaDelphes_config.py on LHE File From MG5

Hello,

I have been trying to use the FCCSW to produce some samples for our VLQ analysis. I was able to use MG5 to produce an lhe file. I am trying to mimic the starter kit in 2.3.2 by creating the Pythia_LHE card which I attach. You will note the only difference is I have substituted the location of the lhe file.


Then proceeding to run the command fccrun PythiaDelphes_config.py --Filename Pythia_LHE.cmd --filename mg5_pp_TTbar.root -n 10000 the code runs for some time until producing some warnings about the ObsTrk::GenToObsPar: angle until reaching an error. I attach a screenshot below

I apologize if my confusion has a trivial solution, but I appreciate the help.

Hello @zalegria ,

the

warning ObsTrk ... tells me you run the IDEA FCC-ee delphes cards, not sure if the fccrun can handle that.

I suggest you move to key4hep/edm4hep. We are in the process of updating the tutorials, but from this one

you should already be able to run what you want with some minor modifications (like the delphes card) and you pythia card looks ok to me, so that should not be the problem.
Clement

Hello @clement.helsens,

Thank you so much your assistance fixed the issue. Is there anything else that is different from the other tutorial/starterkit? Are there any resources besides the GitHub/starterkit that might be useful? Thank you so much!
Zack

Sure @zalegria! once you have produced your files, analyse them following this example

then if more large production of events are needed, we can discuss how to support your studies.

Hello @clement.helsens,

Sorry for my late response. I was able to run the analysis script, however I noticed the histograms in the root file were empty. Any idea as to why this may be?

hello @zalegria ,

I did ran that tutorial few days ago and the histograms were not empty. See this plot for example.

maybe write below what you have done and that will help to spot the issue?

Hello @clement.helsens,

After further inspection I should say the only histogram that has any entries is the zed_leptonic_recoil_m even then there is only a single entry, and the rest are empty. When attempting to run the final selection I receive the following error

Traceback (most recent call last):
  File "examples/FCCee/higgs/mH-recoil/mumu/finalSel.py", line 56, in <module>
    myana=rdf.runDataFrameFinal(baseDir,procDict,process_list,cut_list,variables)
  File "/afs/cern.ch/user/z/zalegria/work/Snowmass_21/FCCAnalyses/config/runDataFrameFinal.py", line 25, in __init__
    with open(procDict, 'r') as f:
PermissionError: [Errno 13] Permission denied: '/afs/cern.ch/work/h/helsens/public/FCCDicts/FCCee_procDict_spring2021_IDEA.json'

Looking at this leads me now to ask the question should I be using the FCCee_procDict_spring2021_IDEA.json considering I ran the original DelphesPythia8 simulation with an FCChh card? I attach that command below to clarify
DelphesPythia8_EDM4HEP $DELPHES_DIR/cards/FCC/FCChh.tcl edm4hep.tcl Pythia_LHE.cmd mg5_pp_TTbar.root

I apologize for the many questions.

Hello @zalegria ,

ok, I get it now, sorry being a bit slow.
Of course, with VLQ you are FCC-hh, thus the analysis.py from a higgs study at FCC-ee (240GeV center of mass energy) is not what you need to use and I can understand you do not select events.

What you need is to write your own analysis.py to do what you need, and that depends on the type of signature you are interested in.

The dictionary FCCee_procDict_spring2021_IDEA.json is not what you need indeed.
To run over your locally produced samples you need to pass your own dictionary. For example in the finalSel.py you can pass your own like this:

{
   "MySample1": {"numberOfEvents": 1000, "sumOfWeights": 1000, "crossSection": 1.0, "kfactor": 1.0, "matchingEfficiency": 1.0},
   "MySample2": {"numberOfEvents": 1000, "sumOfWeights": 1000, "crossSection": 1.0, "kfactor": 1.0, "matchingEfficiency": 1.0},
}

The name of the samples should match the name in
process_list=['MySample1','MySample2']

I did already produced some events in edm4hep for FCC-hh, here they are, and maybe you will find some useful:
http://fcc-physics-events.web.cern.ch/fcc-physics-events/Delphesevents_fcc_v04.php

if that is the case, I will grant you read access to /afs/cern.ch/work/h/helsens/public/FCCDicts/

Cheers.
Clement

Hello @clement.helsens,

I have been attempting to work on this issue over the past week as well as trying to understand more of how the code works, so my apologies for the late response. I attempted to produce something by mimicking the already made code, but adding the following lines in the analysis.py script and commented out anything that will lead to an empty histogram.

# define an alias for Jet index collection
.Alias("Jet2", "Jet#2.index")
# define the jet collection
.Define("jets",  "ReconstructedParticle::get(Jet2, ReconstructedParticles")
# select jets on pt
.Define("selected_jets", "ReconstructedParticle::sel_pt(25.)(jets)")
# create branch with jet pt
.Define("selected_jets_pt", "ReconstructedParticle::get_pt(selected_jets)") 

I made sure to include selected_jets_pt in the “branchName” list. Upon running the command
python examples/FCCee/higgs/mH-recoil/mumu/analysis.py ~/work/Snowmass_21/FCCSW/mg5_pp_TTbar.root I am able to produce the following histogram

I have questions in regards to your comment about the dictionary and in particular the piece of code you wrote above. What is the purpose of the dictionary in the code and what exactly does the code you wrote above achieve? I apologize if this question is trivial/elementary.

Thank you for your assistance!

hello @zalegria ,

Good to see that you have some jets!
You have the possibility to run your own jet clustering like shown here:

it does not include fancy sub-structure yet, but we could consider it.

The dictionary thing is really trivial, let me explain.
When you run analysis.py you will probably run over X events and select a subset, let’s say you end up with Y events. When producing histograms (what the finalSel.py does) you want those histograms to be normalised properly. Indeed all your processes have most likely a different cross section. The normalisation factor you have yo apply is somehting like (if you want it normalised to 1pb-1) XS(in pb)/number of processed events thus you need the cross section and the number of events you processed, and this is taken from the dictionary.

Cheers,
Clement

Hello @clement.helsens,

I have modified the final selection script to include a dictionary which I have created which contains the following

{
    "mg5_pp_TTbar": {"numberOfEvents": 10000, "sumOfWeights": 10000, "crossSection": 98.61, "kfactor": 1.0, "matchingEfficiency": 1.0},

}

I also have updated the process list to be process_list=['mg5_pp_TTbar'], the cut list is as follows (although I am not too sure what I have works) cut_list = {"sel0":"selected_jets_pt.size() > 1", as well as defining

variables = {  "jet_pt":{"name":"selected_jets_pt","title":"jet_{p_{T}} [GeV]","bin":120,"xmin":20,"xmax":140},
            }

Unfortunately, I receive the following error which I am unable to solve

Any ideas as to why this may be arising? As always thank you!

Zack

hello @zalegria ,

just remove the “,” at the end of the list, json files are not like python list.

Clement

Hi @clement.helsens,

Thank you I was unaware of that.

Zack