Updates in FCCee analysis using Delphes+Pythia8

Dear experts

may I kindly ask where I can find updated instructions for the FCCee analysis using Delphes+Pythia8?
Should GitHub - HEP-FCC/FCCeePhysicsPerformance still be followed?
Thank you.

Regards Patricia

Dear Patricia,
There are updated tutorials since a few days: 2.2. FCC: Getting started with simulating events in Delphes — FCC Starterkit Lessons documentation .
Please check and let us know of any problem or question.
G Ganis

Dear Ganis

I am following the new tutorial, but using external LHE files to be processed with DelphesPythia8_EDM4HEP card_IDEA.tcl edm4hep_IDEA.tcl Pythia_LHE.cmd output.root in lxplus.

I have also edited (acc my signal) and tried the analysis.py , only changing muons to photons accordingly.

My files are located at /afs/cern.ch/user/p/prebello/public/forGanis

Unfortunately, I am receiving an error informed below that I cannot fix. May I kindly ask for your help? Thank you.

python analysis.py ALPm1sqrt91.root ALPm1sqrt91_edm4hep.root
Load cxx analyzers …
edm4hep <cppyy.gbl.edm4hep.ReconstructedParticleData object at 0x51f8d90>
podio <cppyy.gbl.podio.ObjectID object at 0x4b7ddf0>
fccana <C++ overload “dummyLoader” at 0x7fef1c5796d0>
done
Traceback (most recent call last):
File “analysis.py”, line 77, in
analysis.run()
File “analysis.py”, line 32, in run
.Alias(“Photon”, “Photon#0.index”)
cppyy.gbl.std.runtime_error: ROOT::RDF::RInterfaceROOT::Detail::RDF::RLoopManager,void ROOT::RDF::RInterfaceROOT::Detail::RDF::RLoopManager,void::Alias(basic_string_view<char,char_traits > alias, basic_string_view<char,char_traits > columnName) =>
runtime_error: GetBranchNames: error in opening the tree events

Hi Patricia, Gerri,
Did you solve your problem Patricia ?
I can not access the files you put in /afs/cern.ch/user/p/prebello/public/forGanis.
cheers,
E.

hi @eperez unfortunately not.

I have been trying to redo it, maybe waiting for updates of the tool, sometimes problems are gone by magic :slight_smile: , but still with same error msg.
The difference from the tutorial is that I am using external LHE files. Would it be a problem?
I have added forGanis.tar to /tmp of lxplus740 node.
Could you please take the files there?
Thank you for your help.

Regards Patricia

Hi Patricia,
your file in /tmp is still read-only:
-rw-------. 1 prebello zh 4454400 Jul 26 16:56 forGanis.tar

E.

Hi @eperez
could you please try to get it as /tmp/forGanis.tar in the same lxplus740 node?
I changed permission to -rwx–xrwx. 1 prebello zh 4.3M Jul 26 16:56 /tmp/forGanis.tar

Cheers Pat

Hi Patricia,

The problem of your analysis.py is that you define an alias:

           .Alias("Photon", "Photon#0.index")

but there is already a branch called “Photon” in the edm4hep file.
What you should do is change the name of your alias, for example to Photon0, and use Photon0 subsequently:

           .Alias("Photon0", "Photon#0.index")
           .Define("photons",  "ReconstructedParticle::get(Photon0, ReconstructedParticles)")

With this, the output file contains indeed the kinematic quantities of your photons.

You may find this page useful in order to understand the collection of references, and what this “Photon#0” means :

(look into “Structure of EDM4Hep files”)

Cheers,
E.

hi @eperez , please see below, quite the same error…
I guess it is because of ROOT. I am connecting lxplus via ssh -Y
it takes forever to import ROOT.
Is there any way to work with FCCSW locally? Maybe via docker image setup?

The FCCanalyses output is
prebello@lxplus755 01July2021]$ spack find -p -d key4hep-stack@2021-07-16 | grep fccanalyses
fccanalyses@0.3.3 /cvmfs/sw.hsf.org/spackages2/fccanalyses/0.3.3/x86_64-centos7-gcc8.3.0-dbg/quxxzqkc6co6vlrhm3472badqup4zoz6
fccanalyses@0.3.3 /cvmfs/sw.hsf.org/spackages2/fccanalyses/0.3.3/x86_64-centos7-gcc8.3.0-dbg/quxxzqkc6co6vlrhm3472badqup4zoz6
fccanalyses@0.3.3 /cvmfs/sw.hsf.org/spackages2/fccanalyses/0.3.3/x86_64-centos7-gcc8.3.0-opt/3dqnwz2uplmpxs5iguqewo7ebypi2udf
fccanalyses@0.3.3 /cvmfs/sw.hsf.org/spackages2/fccanalyses/0.3.3/x86_64-centos7-gcc8.3.0-opt/3dqnwz2uplmpxs5iguqewo7ebypi2udf

then

python analysis.py ALPm1sqrt91.root ALPm1sqrt91_edm4hep.root
Load cxx analyzers …
edm4hep <cppyy.gbl.edm4hep.ReconstructedParticleData object at 0x3fa86f0>
podio <cppyy.gbl.podio.ObjectID object at 0x42b3580>
fccana <C++ overload “dummyLoader” at 0x7f7a04be4a10>
done
Traceback (most recent call last):
File “analysis.py”, line 77, in
analysis.run()
File “analysis.py”, line 32, in run
.Alias(“Photon0”, “Photon#0.index”)
cppyy.gbl.std.runtime_error: ROOT::RDF::RInterfaceROOT::Detail::RDF::RLoopManager,void ROOT::RDF::RInterfaceROOT::Detail::RDF::RLoopManager,void::Alias(basic_string_view<char,char_traits > alias, basic_string_view<char,char_traits > columnName) =>
runtime_error: GetBranchNames: error in opening the tree events

Hi Patricia,
As I told you by email, in addition to the Photon0 issue, you seem to be swapping the name of the input and of the output files. Using your ALPm1sqrt91.root which you have put in your tmp directory, this works for me:
python analysis.py output.root ALPm1sqrt91.root

Since your analysis.py contains:
if name == “main”:
infile = sys.argv[2]
outfile = sys.argv[1]

if you revert the order:
python analysis.py ALPm1sqrt91.root output.root

this would not work.

E.

ok it has worked :slight_smile: thank you

Now, to access MCParticle, would be enough to define

.Define(“MCphotons”, " MCParticle::get(Photon0, MCParticle)") ?

how can I build other kinematic variables and compare MC vs RECO to understand the detector efficiency?
is there any example? the link Writing your own function looks not working

Thank you
Cheers Pat

Now, to access MCParticle, would be enough to define

.Define(“MCphotons”, " MCParticle::get(Photon0, MCParticle)") ?

No. See in the link sent earlier the meaning of Photon#0.

To access the MC photons, you should do e.g.:

           # select MC Photons
           .Define("MC_allphotons",  "MCParticle::sel_pdgID( 22, false )(Particle)")
           # photons with genStatus = 1
           .Define("MC_photons",   "MCParticle::sel_genStatus(1) ( MC_allphotons )" )

and then, you can put the kinematic quantities of all these photons into your ntuple, for example:

           .Define("MC_photons_pt",  "MCParticle::get_pt( MC_photons )")

how can I build other kinematic variables and compare MC vs RECO to understand the detector efficiency?

Since you have in your ntuple the kinematic variables of all reco’ed photons, you could add the variables of all the MC photons, and do some matching yourself, at the ntuple level. There is, however, a better way to associate Reco particles and MC particles, i.e., for a given RecoParticle, to tell from which MCParticle it originates. See here, in " Association between RecoParticles and MonteCarloParticles":

For example, to access the MC particle that is associated with your first reconstructed photon, you could do something like:

           # mapping between reco'ed particles and MC:
           .Alias("MCRecoAssociations0", "MCRecoAssociations#0.index")
           .Alias("MCRecoAssociations1", "MCRecoAssociations#1.index")
           .Define('RP_MC_index',          "ReconstructedParticle2MC::getRP2MC_index(MCRecoAssociations0,MCRecoAssociations1,ReconstructedParticles)")

           # Index of the MC particle associated with the 1st reco'ed photon :
           .Define("index_MCpart_matched_to_first_photon",   " if ( Photon0.size() >0 ) return RP_MC_index[ Photon0.at(0) ]; else return -1;" )

           # the corresponding MC particle :
           .Define("MCpart_matched_to_first_photon",  " if ( index_MCpart_matched_to_first_photon >= 0) return Particle.at(index_MCpart_matched_to_first_photon); else return edm4hep::MCParticleData(); ")

           # its pt :
           .Define("MCpart_matched_to_first_photon_pt",  " return sqrt(pow(MCpart_matched_to_first_photon.momentum.x,2) + pow(MCpart_matched_to_first_photon.momentum.y,2))" )

Now, in your ntuple, you should see a good correlation between your selected_photons_pt[0] and the variable MCpart_matched_to_first_photon_pt defined above.

This is a bit clumsy, but it gives you the idea. It may be best for you to write some dedicated code indeed, that fits best with what you want to do. Indeed, the link “Writing your own function” that you refer to is still to be written. Meanwhile you can take a look at the paragraph “Code development” in:

Cheers,

E.