Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jet Substructure #13

Open
wants to merge 299 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
299 commits
Select commit Hold shift + click to select a range
cb3937c
Merge pull request #53 from MadAnalysis/substructure_beta
jackaraz Mar 21, 2022
4f60cb0
bugfix for fastjet compilation
jackaraz Mar 21, 2022
6e6e497
add VariableR plugin
jackaraz Mar 22, 2022
7e74991
add event based execution to Cluster.h
jackaraz Mar 22, 2022
a3c7d11
add protection against same JetID
jackaraz Mar 22, 2022
dacafda
add proper exception handlers
jackaraz Mar 22, 2022
63365c4
bugfix in setup_writer.py
jackaraz Mar 22, 2022
f103977
bugfix in setup_writer.py
jackaraz Mar 22, 2022
08efd72
bugfix in setup_writer.py
jackaraz Mar 22, 2022
e4d38c4
include VariableR algorithm for SFS
jackaraz Mar 22, 2022
707c67b
failsafe for variableR
jackaraz Mar 22, 2022
8828329
extend docstring
jackaraz Mar 22, 2022
31528cf
add pruner
jackaraz Mar 22, 2022
3fa15a6
move clustering function to private
jackaraz Mar 22, 2022
c3614dc
add vector execution
jackaraz Mar 22, 2022
e9d0251
improve coding style and documentation
jackaraz Mar 23, 2022
f20ee43
add extra layer of protection
jackaraz Mar 23, 2022
7eb91f7
protection for delphes
jackaraz Mar 23, 2022
e3185ca
add filtering functionality for single jet execution to `Cluster.h`
jackaraz Mar 24, 2022
85e655e
optimize the codeflow
jackaraz Mar 24, 2022
d18e1e1
bugfix in Nsubjettiness.h
jackaraz Mar 24, 2022
8459df2
rename accessors for readability
jackaraz Mar 24, 2022
002a246
optimize codeflow in JetClusterer.h
jackaraz Mar 24, 2022
fd0ad2c
add Filter.h
jackaraz Mar 24, 2022
2671209
further optimization for SoftDrop.h
jackaraz Mar 24, 2022
c653832
fix the function names
jackaraz Mar 24, 2022
415cda7
add ability to cluster. this will allow adding further features
jackaraz Mar 25, 2022
f905829
optimize codeflow: ClusterBase.h
jackaraz Mar 25, 2022
92a7501
add EnergyCorrelator.h
jackaraz Mar 25, 2022
fab2bd1
move VariableR parameters into the class
jackaraz Mar 25, 2022
cfe6f15
move Nsubjettiness methods into the class
jackaraz Mar 25, 2022
11515b6
bugfix in ClusterBase.h
jackaraz Mar 25, 2022
0364844
enable zsh support
jackaraz Mar 26, 2022
ced935e
codeflow optimization for memory allocation
jackaraz Mar 26, 2022
4e992cd
further memory allocation optimization
jackaraz Mar 26, 2022
cb5b4d5
further cutflow optimization
jackaraz Mar 27, 2022
e9e510c
introduce shorthand for widely used reco obj
jackaraz Mar 27, 2022
7a9b896
rename shortcuts
jackaraz Mar 27, 2022
9326825
bugfix
jackaraz Mar 27, 2022
f3080db
add shorthand for tracks
jackaraz Mar 28, 2022
6f0283a
create a failsafe for jet accessors
jackaraz Mar 30, 2022
d752467
optimise RecEventFormat.h
jackaraz Mar 30, 2022
f5497a3
remove old `jets_` vector
jackaraz Mar 30, 2022
89015f5
update DelphesTreeReader.cpp
jackaraz Mar 30, 2022
6890643
update DelphesTreeReader.cpp
jackaraz Apr 1, 2022
e6796ce
add checkup for fjcontrib
jackaraz Apr 2, 2022
b2f87cb
modify library structure
jackaraz Apr 2, 2022
9cc1658
create shared library for substructure module
jackaraz Apr 2, 2022
9809346
bugfix in execution without fastjet
jackaraz Apr 2, 2022
6d55de3
slight modification in coding style of main.py
jackaraz Apr 2, 2022
c054fd2
add substructure library to normal mode workflow
jackaraz Apr 2, 2022
735fedc
bugfix in RecJetFormat.h
jackaraz Apr 2, 2022
d426641
improve the code structure
jackaraz Apr 3, 2022
03c7dac
move fastjet into shared library
jackaraz Apr 3, 2022
38e2357
move filter into the shared library
jackaraz Apr 3, 2022
8cf6a65
add Pruner.cpp
jackaraz Apr 3, 2022
0e9c061
update the structure of the class: ClusterBase.h
jackaraz Apr 4, 2022
1ae418e
improve Nsubjettiness.h
jackaraz Apr 5, 2022
7cfbc9a
add HEPTopTagger to SampleAnalyzer backend
jackaraz Apr 5, 2022
8a3476e
integration of HTT for compilation libraries
jackaraz Apr 5, 2022
ecae28d
HTT installation and detection interfaces
jackaraz Apr 5, 2022
74cbb28
add fastjet flag
jackaraz Apr 5, 2022
118c378
add HTT to AnalyzerBase.h
jackaraz Apr 5, 2022
ad9903e
move Recluster.hh to the source file
jackaraz Apr 6, 2022
d2f4b2a
update install_heptoptagger.py
jackaraz Apr 6, 2022
8536884
update install_heptoptagger.py
jackaraz Apr 6, 2022
821bf6d
simplify Filter.h
jackaraz Apr 6, 2022
37ad5e7
add empty jet (thanks to @econte-cms)
jackaraz Apr 6, 2022
e09c803
move softdrop to source
jackaraz Apr 6, 2022
7b35f4f
add examples for substructure module
jackaraz Apr 7, 2022
d8a0dae
add table for available normal mode jet_algo definitions
jackaraz Apr 7, 2022
41ee4f4
add installation instructions
jackaraz Apr 7, 2022
62ed504
fix syntax in virtual functions
jackaraz Apr 10, 2022
d7f7995
fix memory leaks and doc
jackaraz Apr 11, 2022
8312fa6
remove pseudojet dependency from JetClusterer.cpp
jackaraz Apr 12, 2022
d01fab3
protection against delphes
jackaraz Apr 12, 2022
575a8f3
implement `exclusive_subjets` accessor to RecJetFormat.h
jackaraz Apr 13, 2022
66bb550
bugfix in malloc for Pruner.cpp and Filter.cpp
jackaraz Apr 19, 2022
3d8da12
bugfix in malloc for SoftDrop.cpp
jackaraz Apr 19, 2022
b54d4a7
add failsafe for `exclusive_subjets`
jackaraz Apr 19, 2022
6b2a4cf
remove unnecessary class declarations in ClusterBase.h
jackaraz Apr 19, 2022
e528f70
fix library name
jackaraz Apr 20, 2022
4efc86d
bugfix in HTT.h and HTT.cpp
jackaraz Apr 20, 2022
5824c69
add test module for HTT
jackaraz Apr 20, 2022
65eaaf6
check compiler version
jackaraz Apr 20, 2022
bbe0afb
raise proper error with necessary information
jackaraz Apr 20, 2022
a943159
optimise codeflow
jackaraz Apr 21, 2022
46d4c4b
optimise codeflow: HTT.h
jackaraz Apr 21, 2022
ebead65
update FastJet and fjcontrib
jackaraz Apr 21, 2022
3a1cbbd
modify behaviour incase fjcontrib is not available
jackaraz Apr 21, 2022
dfbd209
import fjcontrib based interface if fjcontrib is available
jackaraz Apr 21, 2022
f8eb75a
bugfix: fjconfig control requires new flag
jackaraz Apr 21, 2022
2c43e59
move variableR headers to source file
jackaraz Apr 22, 2022
0e95a55
compile fjcontrib as position independent code
jackaraz Apr 22, 2022
b598574
cleaning setup_write.py
BFuks Apr 25, 2022
a97bd3d
Update ma5
BFuks Apr 25, 2022
02da2d2
cleaning cmd_submit.py
BFuks Apr 25, 2022
0375873
missing initialisation in the reset function for the MCParticleFormat…
BFuks Apr 26, 2022
ffbf4d1
Polishing JetClusterer.h
BFuks Apr 26, 2022
6beb13f
Merge branch 'substructure' into sharedlib
jackaraz Apr 26, 2022
f9118f6
removing useless comments in install_fastjet.py
BFuks Apr 27, 2022
4bbb4cc
removing useless comments in install_fastjetcontrib.py
BFuks Apr 27, 2022
7f26ef7
polishing the heptoptagger installation routines + downgrading clang …
BFuks May 5, 2022
84fcb30
polishing install_manager.py
BFuks May 5, 2022
49feb65
polishing detect_fastjet.py
BFuks May 5, 2022
9632393
polishing detect_heptoptagger.py
BFuks May 5, 2022
061200d
polishing RecJetFormat.cpp
BFuks May 17, 2022
2277188
Polishing HEPTopTagger
BFuks May 17, 2022
a534e6d
Removing a useless line in ClusterBase.h
BFuks May 17, 2022
27c5b5d
Polishing the substructure readme
BFuks May 17, 2022
6b3123b
Fixing the substructure readme (markdown)
BFuks May 17, 2022
fbe64c8
Fixing the substructure readme (markdown)
BFuks May 17, 2022
a2ff644
Merge pull request #63 from MadAnalysis/sharedlib
BFuks May 18, 2022
3aa5ef9
convert bits to LaTeX
jackaraz May 24, 2022
b701a4c
Merge branch 'main' into substructure
jackaraz May 24, 2022
ae15a64
add changelog for v2.0
jackaraz May 28, 2022
7a89a77
Merge branch 'main' into substructure
jackaraz May 30, 2022
6136d13
Merge branch 'main' into substructure
jackaraz May 30, 2022
5a06aab
Merge branch 'main' into substructure
jackaraz Jun 1, 2022
209a5fc
improve code efficiency
jackaraz Jun 6, 2022
4b0ee80
deprecate old detector simulator
jackaraz Jun 6, 2022
2bcc2ca
change ancestor as RecJetFormat
jackaraz Jun 6, 2022
4c6ae3f
add reconstruction method
jackaraz Jun 6, 2022
e74b371
set default reco mode to hadron-based
jackaraz Jun 6, 2022
2cf1f42
Merge branch 'main' into substructure
jackaraz Jun 6, 2022
1724c4d
Merge branch 'substructure' into tau_tagging
jackaraz Jun 6, 2022
28c108d
merge updates
jackaraz Jun 6, 2022
df1fc5d
initialize tagger base
jackaraz Jun 6, 2022
bfcdbee
main routines for tagger base
jackaraz Jun 7, 2022
0aaaa3b
add tagger base
jackaraz Jun 7, 2022
cddb25f
construct main tagger structure (not complete)
jackaraz Jun 8, 2022
b20caa9
improve docstring
jackaraz Jun 8, 2022
b8ac302
complete tagger module
jackaraz Jun 9, 2022
50f1abf
add tagger loader
jackaraz Jun 9, 2022
bf3923a
adapt python interface
jackaraz Jun 9, 2022
f46457b
adap user-interface
jackaraz Jun 9, 2022
fdb5f28
integrate new tagger to JetClusterer
jackaraz Jun 9, 2022
8676021
remove null smearer. its not needed
jackaraz Jun 9, 2022
d80a61a
rule out old tagger interface
jackaraz Jun 9, 2022
dbb0eb6
bugfix in tagging interface
jackaraz Jun 9, 2022
ad205e9
move sfs banner to JetClusterer.h
jackaraz Jun 9, 2022
684b7b7
full integration of SFSTaggerBase
jackaraz Jun 9, 2022
ef06a61
move SFS header file inclusion from analysis to analysisList.h
jackaraz Jun 9, 2022
213f678
update changelog-v2.0.md
jackaraz Jun 9, 2022
e08fe7c
bump version minor
jackaraz Jun 9, 2022
d1cc375
use functions to set parameters
jackaraz Jun 9, 2022
a70fe98
change vector definitions to typefef
jackaraz Jun 22, 2022
29d1d51
add loose, mid, tight tagging options to the jet class
jackaraz Jun 22, 2022
f8c7ceb
adapt tagger to have loose, mid, tight taggers
jackaraz Jun 22, 2022
fa61363
butfix in hadron based tau tagging
jackaraz Jun 22, 2022
7931048
adapt packages to the new tagger
jackaraz Jun 22, 2022
65bcabc
adapt SFS tagging interface
jackaraz Jun 22, 2022
cd7bf11
bugfix in tagger structure
jackaraz Jun 23, 2022
59fefad
Merge branch 'main' into substructure
jackaraz Jun 23, 2022
7743820
Merge branch 'substructure' into tau_tagging
jackaraz Jun 23, 2022
e116b09
Merge branch 'tau_tagging' into multitag
jackaraz Jun 23, 2022
41e6f12
merge "fix_random" in "multitag"
jackaraz Jun 23, 2022
ef26851
bugfix in btag efficiencies
jackaraz Jun 23, 2022
ef4ddf2
Merge branch 'main' into substructure
jackaraz Jun 23, 2022
b2dcbee
Merge branch 'substructure' into tau_tagging
jackaraz Jun 23, 2022
8588c19
fix tagger to match previous tagger
jackaraz Jun 23, 2022
d22ac49
expand docstring
jackaraz Jun 23, 2022
2699ff5
adapt jet identification algo
jackaraz Jun 23, 2022
684cf73
add switch to enable ctagging
jackaraz Jun 23, 2022
9a52d64
code efficiency booleans are moved to SFSTaggerBase
jackaraz Jun 23, 2022
2ef3a1e
bugfix in tagger names
jackaraz Jun 23, 2022
23cbb43
move efficiency booleans to protected
jackaraz Jun 23, 2022
4dac495
bugfix for backwards compatibility
jackaraz Jun 24, 2022
aca18af
bugfix in code efficiency booleans
jackaraz Jun 24, 2022
5007303
expand the printing functionality
jackaraz Jun 24, 2022
4500577
Merge remote-tracking branch 'remotes/origin/tau_tagging' into multitag
jackaraz Jun 24, 2022
6064eab
update changelog
jackaraz Jun 24, 2022
0330493
expand docstring
jackaraz Jun 24, 2022
d6a5c49
fix the numeric difference in inclusive mode between main branch
jackaraz Jun 24, 2022
8d57c08
clean the heap in JetClusterer.h
jackaraz Jun 24, 2022
087619c
remove unnecessary headers
jackaraz Jun 24, 2022
93c6e0a
turn off verbosity of the tracker
jackaraz Jun 24, 2022
77b7f88
Merge pull request #97 from MadAnalysis/multitag
jackaraz Jun 24, 2022
c2b3df5
extend the documentation
jackaraz Jun 25, 2022
1e7c9ab
remove old tagger
jackaraz Jun 25, 2022
593778c
update destructor
jackaraz Jun 25, 2022
708d8a3
clean the header file
jackaraz Jun 25, 2022
2c0bd43
limit the scope of the namespace
jackaraz Jun 25, 2022
1dd5603
extend jet definitions
jackaraz Jun 25, 2022
fe4feae
bugfix in heap allocation for Filter
jackaraz Jun 25, 2022
4e828e4
bugfix in pointer initializer
jackaraz Jun 25, 2022
f2def75
add interface test for jet substructure
jackaraz Jun 25, 2022
636b13b
update HTT test
jackaraz Jun 25, 2022
8f67c6e
update changelog-v2.0.md
jackaraz Jun 25, 2022
5409785
polishing the language
BFuks Jul 4, 2022
dc3c7cb
- Polishing error and warning messages all over the place.
BFuks Jul 5, 2022
b3084dc
revert `_isTauTaggingEffOn` definition
jackaraz Jul 18, 2022
c990e68
update changelog-v2.0.md
jackaraz Jul 18, 2022
3681002
protection against prereleases
jackaraz Jul 18, 2022
c49a4fd
update changelog-v2.0.md
jackaraz Jul 18, 2022
b788cb2
update README.md
jackaraz Jul 18, 2022
214bcb0
remove unused integer declerations
jackaraz Jul 18, 2022
7535afc
Merge pull request #86 from MadAnalysis/tau_tagging
jackaraz Jul 18, 2022
82a9bb8
Merge branch 'main' into substructure
jackaraz Jul 18, 2022
7ce498e
update makedoc
jackaraz Jul 18, 2022
d8b82f7
bump version minor
jackaraz Jul 18, 2022
646b0a8
major bugfix for the initial compilation
jackaraz Jul 18, 2022
6a4dca4
bump version minor
jackaraz Jul 18, 2022
ae6c567
bugfix in SFSTaggerBase.cpp
jackaraz Jul 18, 2022
fe98722
bump version minor
jackaraz Jul 18, 2022
a4a9edd
Merge branch 'main' into substructure
jackaraz Jul 18, 2022
a2c6875
move the implementation of fatjets and genjets into the jetcollection
jackaraz Sep 29, 2022
a0723b6
update changelog-v2.0.md
jackaraz Sep 29, 2022
6a74b37
update version
jackaraz Sep 29, 2022
be1cd8a
bugfix for jet collection
jackaraz Sep 29, 2022
e388dc0
update changelog-v2.0.md
jackaraz Sep 29, 2022
da9c5d6
update main_normal.tex
jackaraz Sep 29, 2022
12f6b99
simplify the print structure
jackaraz Oct 3, 2022
c95821e
Merge branch 'substructure' into delphes_integration
BFuks Jan 6, 2023
33bd564
Fixing language
BFuks Jan 6, 2023
4690af0
Merge branch 'delphes_integration' of https://github.com/MadAnalysis/…
BFuks Jan 6, 2023
826f0bb
Merge pull request #135 from MadAnalysis/delphes_integration
BFuks Jan 6, 2023
af5ef6c
Compiler options for the LHCO reader
BFuks Jan 11, 2023
3dad67c
separate asimov based stat model for SL
jackaraz Jan 12, 2023
3d03f27
Revert "separate asimov based stat model for SL"
jackaraz Jan 12, 2023
6fc86af
update changelog-v2.0.md
jackaraz Jan 12, 2023
a3e20b0
bump the version minor
jackaraz Jan 12, 2023
f0b789c
Merge pull request #167 from MadAnalysis/LHCO_issue
jackaraz Jan 12, 2023
990f342
remove unnecessary reinitialisation
jackaraz Mar 20, 2023
acd2ead
update gitignore
jackaraz Mar 20, 2023
8c81384
extend gitignore
jackaraz Mar 20, 2023
0fe0657
Merge branch 'main' into substructure
jackaraz Mar 21, 2023
60d37f0
bump the version
jackaraz Mar 21, 2023
e2bfff5
improve executable
jackaraz Mar 21, 2023
28b8759
extend gitignore
jackaraz Mar 21, 2023
980cd87
update gitignore
jackaraz Mar 21, 2023
e4279e2
modify the banner
jackaraz Mar 21, 2023
be7d79b
update deletion
jackaraz Mar 21, 2023
9100642
update gitignore
jackaraz Mar 21, 2023
add397f
bugfix for issue #190
jackaraz Apr 21, 2023
f8fbd93
extend the boost class accessors
jackaraz May 4, 2023
b951678
add new initialisation
jackaraz May 4, 2023
099601d
Merge branch 'main' into substructure
jackaraz May 31, 2023
04d71ae
fix linking issues
jackaraz May 31, 2023
3672a6a
bump version
jackaraz May 31, 2023
1c65eba
convert binary taco file into csv file
jackaraz Jun 6, 2023
726109e
add fastjet flags for delphes
jackaraz Jul 19, 2023
ec3b390
update changelog
jackaraz Jul 19, 2023
2bdb4e3
real fix of the bug
BFuks Jul 19, 2023
d01257b
set fastjet flag by default
jackaraz Jul 21, 2023
c719d93
fix the wrong placement
jackaraz Jul 21, 2023
418c2ea
add fastjet flag for the execution
jackaraz Jul 21, 2023
11083d7
add protection for recjetformat
jackaraz Jul 21, 2023
d1608aa
Merge pull request #208 from MadAnalysis/delphes_bugfix
jackaraz Jul 21, 2023
8748ee2
Merge branch 'main' into substructure
jackaraz Sep 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

[![PAD](https://img.shields.io/static/v1?style=plastic&label=Recasting&message=PublicAnalysisDatabase&color=blue)](http://madanalysis.irmp.ucl.ac.be/wiki/PublicAnalysisDatabase)
[![TUTO](https://img.shields.io/static/v1?style=plastic&label=Tutorials&message=@HomePage&color=red)](https://madanalysis.irmp.ucl.ac.be/wiki/tutorials)
[![Talks](https://img.shields.io/static/v1?style=plastic&label=Talks&message=@HomePage&color=red)](http://madanalysis.irmp.ucl.ac.be/wiki/Talks)
[![FAQ](https://img.shields.io/static/v1?style=plastic&label=FAQ&message=NormalMode&color=orange)](http://madanalysis.irmp.ucl.ac.be/wiki/FAQNormalMode)

![Python v3.8](https://img.shields.io/badge/python-3670A0?style=plastic&logo=python&logoColor=ffdd54&label=3.6|3.7|3.8&color=brightgreen)
![C++](https://img.shields.io/badge/c++-%2300599C.svg?style=plastic&logo=c%2B%2B&logoColor=white&label=98|11)
![Python v3.8](https://img.shields.io/badge/python-3670A0?style=plastic&logo=python&logoColor=ffdd54&label=3.8&color=brightgreen)
![C++](https://img.shields.io/badge/c++-%2300599C.svg?style=plastic&logo=c%2B%2B&logoColor=white&label=11)
## Outline
- [What is MadAnalysis 5?](#what-is-madanalysis-5)
- [Requirements](#requirements)
Expand All @@ -14,6 +15,7 @@
- [Description of the package](#description-of-the-package)
- [Very first steps with MadAnalysis 5](#very-first-steps-with-madanalysis-5)
- [Troubleshootings and bug reports](#troubleshootings-and-bug-reports)
- [Supported third party software](#supported-third-party-software)
- [Authors](#authors)
- [Our famous last words](#our-famous-last-words)
- [Credits](#credits)
Expand Down Expand Up @@ -44,7 +46,7 @@ More details can be found on the [MadAnalysis 5 website](https://madanalysis.irm

MadAnalysis 5 requires several external libraries in order to properly run:

- Python 3.6 or a more recent version that can be downloaded from [this website](http://www.python.org/)
- Python 3.8 or a more recent version that can be downloaded from [this website](http://www.python.org/)
In order to check the installed version of Python on a system, it is
sufficient to issue in a shell `$ python --version`.

Expand Down Expand Up @@ -225,6 +227,16 @@ suggested to create a report on [GitHub Issues](https://github.com/MadAnalysis/m
In this way, you also participate to the improvement of MadAnalysis 5 and the
authors thank you for this.

### Supported third party software

In the following you can find supported third party software that can be used within MadAnalysis 5.
The [latest release](https://github.com/MadAnalysis/madanalysis5/releases) of MadAnalysis 5 has been tested with enlisted versions.

- [FastJet](http://fastjet.fr) v3.3.3
- [Delphes](https://github.com/delphes/delphes) v3.4.3
- [ROOT](https://root.cern) v6.04.08
- [pyhf](https://github.com/scikit-hep/pyhf) v0.6.3

### Authors

MadAnalysis 5 is openly developed by the core dev team consisting of:
Expand Down
16 changes: 7 additions & 9 deletions bin/ma5
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,17 @@ and call immediately the command line interface scripts"""

# Checking if the correct release of Python is installed
import sys
if (sys.version_info[0] == 2 and sys.version_info[1] < 7) or (sys.version_info[0] == 3 and sys.version_info[1] < 6):
if sys.version_info[0] != 3 or sys.version_info[1] <= 6:
sys.exit('Python release '+ sys.version + ' is detected.\n' + \
'MadAnalysis 5 works only with python 2.7 ' + \
'or python 3.6 and later.\n' + \
'Please upgrade your version of python.')
'MadAnalysis 5 works only with Python version 3.7 and more recent version.\n' + \
'Please upgrade your Python installation.')

# Checking that the 'six' package is present
try:
import six
except:
sys.exit('The python "six" module is not found on your system and it is required for MadAnalysis 5 for ' +\
'a question of Python 2/3 compatibility. Please install it with the following command:\n' +\
'pip install six')
sys.exit('The python "six" module is not found on your system. ' +\
'Please install it with by typing in a shell:\n python -m pip install six')

# Getting the parent directory (ma5 root dir) of the script real path (bin)
import os
Expand All @@ -69,8 +67,8 @@ sys.path.insert(0, servicedir)

# Release version
# Do not touch it !!!!!
version = "1.10.0"
date = "2022/01/12"
version = "1.10.2"
date = "2022/02/15"

# Loading the MadAnalysis session
import madanalysis.core.launcher
Expand Down
75 changes: 57 additions & 18 deletions madanalysis/IOinterface/job_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@


from __future__ import absolute_import
from madanalysis.selection.instance_name import InstanceName
from madanalysis.IOinterface.folder_writer import FolderWriter
from shell_command import ShellCommand

import logging
import shutil
import os
import shutil

import six
from shell_command import ShellCommand

from madanalysis.IOinterface.folder_writer import FolderWriter
from madanalysis.selection.instance_name import InstanceName


class JobWriter(object):

Expand Down Expand Up @@ -459,14 +463,13 @@ def CreateMainFct(self,file,analysisName,outputName):

# Fast-Simulation detector
# + Case Fastsim
# + Case extra jet definitions
if self.main.fastsim.package=="fastjet":
file.write(' //Getting pointer to the clusterer\n')
file.write(' std::map<std::string, std::string> parametersC1;\n')
parameters = self.main.fastsim.SampleAnalyzerConfigString()
for k,v in sorted(six.iteritems(parameters),\
key=lambda k_v: (k_v[0],k_v[1])):
for k,v in sorted(six.iteritems(parameters),key=lambda k_v: (k_v[0],k_v[1])):
file.write(' parametersC1["'+k+'"]="'+v+'";\n')

for obj in ["electron","muon","track","photon"]:
if len(getattr(self.main.superfastsim, obj+"_isocone_radius")) != 0:
file.write(
Expand All @@ -478,6 +481,24 @@ def CreateMainFct(self,file,analysisName,outputName):
file.write(' manager.InitializeJetClusterer("'+\
self.main.fastsim.clustering.algorithm+'",parametersC1);\n')
file.write(' if (cluster1==0) return 1;\n\n')
if len(self.main.jet_collection) > 0:
# Write configuration for other jets
for ix, (key, item) in enumerate(self.main.jet_collection.collection.items()):
map_name = "JetConfiguration"+str(ix+1)
file.write(' //Adding new jet with ID ' + key + '\n')
file.write(' std::map<std::string, std::string> '+map_name+';\n')
for opt, val in item.__dict__.items():
if opt in ['JetID','algorithm']:
file.write(' '+map_name+'["'+(opt+'"').ljust(18,' ') + '] = "'+str(val)+'";\n')
else:
# To follow old syntax add "cluster.".
# This is not necessary but makes sense for unified syntax
opt = opt.replace('radius','R')
opt = opt.replace('ptmin','PTmin')
valule = val if type(val) != bool else val*(1)
file.write(' '+map_name+'["'+('cluster.'+opt+'"').ljust(18,' ') +\
'] = "'+str(valule)+'";\n')
file.write(' cluster1->LoadJetConfiguration('+map_name+');\n\n')
if self.main.superfastsim.isNewSmearerOn():
file.write(' // Declaration of the smearer\n')
file.write(' SmearerBase* mySmearer = new NewSmearer();\n')
Expand All @@ -486,14 +507,16 @@ def CreateMainFct(self,file,analysisName,outputName):
file.write(' // Declaration of a generic tagger\n')
file.write(' NewTagger* tagger = new NewTagger();\n\n')


# + Case Delphes
if self.main.fastsim.package in ["delphes","delphesMA5tune"]:
file.write(' //Getting pointer to fast-simulation package\n')
file.write(' std::map<std::string, std::string> parametersD1;\n')
if self.fastsim.package=="delphesMA5tune":
cfg=self.main.fastsim.delphesMA5tune
else:
cfg=self.main.fastsim.delphes
#@JACK: This variable is not used
#if self.fastsim.package=="delphesMA5tune":
# cfg=self.main.fastsim.delphesMA5tune
#else:
# cfg=self.main.fastsim.delphes
parameters = self.main.fastsim.SampleAnalyzerConfigString()
for k,v in sorted(six.iteritems(parameters),\
key=lambda k_v1: (k_v1[0],k_v1[1])):
Expand Down Expand Up @@ -668,7 +691,8 @@ def WriteSelectionSource(self,main):
return True

def WriteSampleAnalyzerMakefile(self,option=""):

# @JACK: This function is not in use!!!
# Also there is a bug -> package is not defined!!
from madanalysis.build.makefile_writer import MakefileWriter
options=MakefileWriter.MakefileOptions()

Expand Down Expand Up @@ -697,14 +721,18 @@ def WriteSampleAnalyzerMakefile(self,option=""):
ProductPath='../../Build/Lib/'

# write makefile
MakefileWriter.Makefile(filename,title,ProductName,ProductPath,isLibrary,cppfiles,hfiles,options,self.main.archi_info,toRemove)
MakefileWriter.Makefile(
filename, title, ProductName, ProductPath, isLibrary, cppfiles, hfiles, options,
self.main.archi_info, toRemove
)

# Ok
return True


def WriteMakefiles(self,option=""):

def WriteMakefiles(self,option="",**kwargs):
# kwargs: keyword arguments regarding additional mode options such as `ma5_fastjet_mode`
# this will protect Delphes based analyses in PAD
from madanalysis.build.makefile_writer import MakefileWriter
options=MakefileWriter.MakefileOptions()

Expand All @@ -717,9 +745,20 @@ def WriteMakefiles(self,option=""):
# Options
options.has_commons = True
options.has_process = True
if self.main.archi_info.has_root:
options.has_root_inc = True
options.has_root_lib = True
# @JACK enable usage of fastjet
# If there are any root files, fastjet clusterer should not run with MA5_FASTJET_MODE Flag
options.ma5_fastjet_mode = (
all([all([('root' not in x) for x in dataset.filenames]) for dataset in self.main.datasets])
and self.main.archi_info.has_fastjet
and kwargs.get('ma5_fastjet_mode',True)
and self.main.fastsim.package == 'fastjet'
)
options.has_fastjet_lib = self.main.archi_info.has_fastjet
options.has_fastjet_ma5lib = self.main.archi_info.has_fastjet
# @JACK: fastjet_inc is required to be able to use the FJ files when FJ mode is on
options.has_fastjet_inc = self.main.archi_info.has_fastjet
options.has_root_inc = self.main.archi_info.has_root
options.has_root_lib = self.main.archi_info.has_root
#options.has_userpackage = True
toRemove=['Log/compilation.log','Log/linking.log','Log/cleanup.log','Log/mrproper.log']

Expand Down
13 changes: 13 additions & 0 deletions madanalysis/IOinterface/library_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,23 @@ def WriteMakefileForInterfaces(self,package):
options.has_commons=True
options.has_fastjet_inc=True
options.has_fastjet_lib=True
# @JACK: To be able to use fastjet in Ma5 data structure
options.ma5_fastjet_mode=True
toRemove.extend(['compilation_fastjet.log','linking_fastjet.log','cleanup_fastjet.log','mrproper_fastjet.log'])
elif package=='test_fastjet':
options.has_commons=True
options.has_fastjet_ma5lib=True
options.has_fastjet_inc=True
# options.has_fastjet_lib=True
toRemove.extend(['compilation_fastjet.log','linking_fastjet.log','cleanup_fastjet.log','mrproper_fastjet.log','../Bin/TestFastjet.log'])
elif package=='configuration':
toRemove.extend(['compilation.log','linking.log','cleanup.log','mrproper.log'])
elif package=='commons':
# @JACK: This will allow us to dynamically use the FJ libraries in commons
options.ma5_fastjet_mode = self.main.archi_info.has_fastjet
options.has_fastjet_inc = self.main.archi_info.has_fastjet
options.has_fastjet_lib = self.main.archi_info.has_fastjet
# options.has_fastjet_ma5lib = self.main.archi_info.has_fastjet
toRemove.extend(['compilation.log','linking.log','cleanup.log','mrproper.log'])
elif package=='test_commons':
options.has_commons = True
Expand Down Expand Up @@ -252,6 +260,11 @@ def WriteMakefileForInterfaces(self,package):
options.has_zlib_tag = self.main.archi_info.has_zlib
options.has_root_tag = self.main.archi_info.has_root
options.has_root_ma5lib = self.main.archi_info.has_root
# @JACK: For fastjet to be accessible through ma5 datastructure
options.has_fastjet_inc = self.main.archi_info.has_fastjet
options.has_fastjet_lib = self.main.archi_info.has_fastjet
options.ma5_fastjet_mode = self.main.archi_info.has_fastjet

toRemove.extend(['compilation.log','linking.log','cleanup.log','mrproper.log'])
elif package=='test_process':
options.has_commons = True
Expand Down