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

Tagging remastered #86

Merged
merged 75 commits into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
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
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
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
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
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
4 changes: 2 additions & 2 deletions bin/ma5
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ sys.path.insert(0, servicedir)

# Release version
# Do not touch it !!!!!
version = "2.0.0"
date = "2022/05/24"
version = "2.0.1"
date = "2022/07/04"

# Loading the MadAnalysis session
import madanalysis.core.launcher
Expand Down
46 changes: 44 additions & 2 deletions doc/releases/changelog-v2.0.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,55 @@
# Release 2.0-dev (development release)
# Release 2.0.0-dev (development release)

## New features since last release

* A module allowing for jet substructure studies has been implemented in
MadAnalysis 5. [(#13)](https://github.com/MadAnalysis/madanalysis5/pull/13)
* It includes the following fastjet-contrib functionalities:
* VariableR: normal and expert mode
* SoftDrop: expert mode
* Clusterer: expert mode
* Jet Filtering: expert mode
* Reclustering: expert mode
* Nsubjettiness: expert mode
* Pruner: expert mode
* Energy Correlator: expert mode
* HEPTopTagger: expert mode
* `RecJetFormat` has been wrapped with a `PseudoJet` structure to accommodate
dynamic transition between two objects.

All these methods can be used through the SFS interface.

* Substructure and HEPTopTagger has been redesigned to be shared libraries, so
that MadAnalysis could be compiled without these modules as well.
[(#63)](https://github.com/MadAnalysis/madanalysis5/pull/63)

* The tagger module has been redesigned to accommodate the features of
substructure module.
[(#86)](https://github.com/MadAnalysis/madanalysis5/pull/86)

* Multi-level object tagging has been enabled through the SFS framework.
([#97](https://github.com/MadAnalysis/madanalysis5/pull/97))
* Option to activate charm-jet tagging has been introduced.
* Option to use jet-based hadronic tau matching has been introduced.

## Improvements

* The SFS libraries are now included in the file `analysisList.h`, instead of in
the main analysis file. This leads to much cleaner and independent analysis
construction. [(#86)](https://github.com/MadAnalysis/madanalysis5/pull/86)

* Compilation time testing has been added for the jet Substructure and
HEPTopTagger interfaces
([#86](https://github.com/MadAnalysis/madanalysis5/pull/86)).

## Bug fixes

* Various bugfixes for matching the numeric results to MA5 v1.10.
([#97](https://github.com/MadAnalysis/madanalysis5/pull/97))

## Contributors

This release contains contributions from (in alphabetical order):

Jack Y. Araz, Benjamin Fuks
[Jack Y. Araz](https://github.com/jackaraz),
[Benjamin Fuks](https://github.com/BFuks)
15 changes: 9 additions & 6 deletions madanalysis/IOinterface/job_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,11 +471,11 @@ def CreateMainFct(self,file,analysisName,outputName):
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])):
file.write(' parametersC1["'+k+'"]="'+v+'";\n')
file.write(' parametersC1["' + (k + '"').ljust(30, " ") + '] = "' + v + '";\n')
for obj in ["electron","muon","track","photon"]:
if len(getattr(self.main.superfastsim, obj+"_isocone_radius")) != 0:
file.write(
' parametersC1["isolation.'+obj+'.radius"]="'+ ','.join(
' parametersC1[' + ('"isolation.' + obj + '.radius"').ljust(30, " ") + '] = "' + ','.join(
[str(x) for x in getattr(self.main.superfastsim, obj+"_isocone_radius")]
)+'";\n'
)
Expand All @@ -491,7 +491,7 @@ def CreateMainFct(self,file,analysisName,outputName):
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')
file.write(' '+map_name+'["'+(opt+'"').ljust(20,' ') + '] = "'+str(val)+'";\n')
else:
# To follow old syntax add "cluster.".
# This is not necessary but makes sense for unified syntax
Expand All @@ -507,7 +507,8 @@ def CreateMainFct(self,file,analysisName,outputName):
file.write(' cluster1->LoadSmearer(mySmearer);\n\n')
if self.main.superfastsim.isTaggerOn():
file.write(' // Declaration of a generic tagger\n')
file.write(' NewTagger* tagger = new NewTagger();\n\n')
file.write(' NewTagger* myTagger = new NewTagger();\n')
file.write(' cluster1->LoadTagger(myTagger);\n\n')


# + Case Delphes
Expand Down Expand Up @@ -596,8 +597,6 @@ def CreateMainFct(self,file,analysisName,outputName):
file.write(' if (!analyzer2->Execute(mySample,myEvent)) continue;\n')
if self.main.fastsim.package=="fastjet":
file.write(' cluster1->Execute(mySample,myEvent);\n')
if self.main.superfastsim.isTaggerOn():
file.write(' tagger->Execute(mySample,myEvent);\n')
elif self.main.fastsim.package=="delphes":
file.write(' fastsim1->Execute(mySample,myEvent);\n')
elif self.main.fastsim.package=="delphesMA5tune":
Expand Down Expand Up @@ -696,6 +695,10 @@ def WriteSelectionSource(self,main):
file.write('#include "SampleAnalyzer/Process/Analyzer/AnalyzerManager.h"\n')
file.write('#include "SampleAnalyzer/User/Analyzer/user.h"\n')
file.write('#include "SampleAnalyzer/Commons/Service/LogStream.h"\n')
if self.main.superfastsim.isTaggerOn():
file.write('#include "new_tagger.h"\n')
if self.main.superfastsim.isNewSmearerOn():
file.write('#include "new_smearer_reco.h"\n')
file.write('\n')
file.write('// ------------------------------------------' +\
'-----------------------------------\n')
Expand Down
56 changes: 44 additions & 12 deletions madanalysis/IOinterface/library_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ def WriteMakefileForInterfaces(self,package):
filename = self.path+"/SampleAnalyzer/Test/Makefile_zlib"
elif package=='test_fastjet':
filename = self.path+"/SampleAnalyzer/Test/Makefile_fastjet"
elif package=='test_substructure':
filename = self.path+"/SampleAnalyzer/Test/Makefile_substructure"
elif package=='test_htt':
filename = self.path+"/SampleAnalyzer/Test/Makefile_htt"
elif package=='test_delphes':
Expand All @@ -146,6 +148,8 @@ def WriteMakefileForInterfaces(self,package):
title='*zlib-interface* test'
elif package=='test_fastjet':
title='*fastjet-interface* test'
elif package=='test_substructure':
title='*substructure-interface* test'
elif package=='test_htt':
title='*htt-interface* test'
elif package=='test_delphes':
Expand Down Expand Up @@ -186,6 +190,19 @@ def WriteMakefileForInterfaces(self,package):
'cleanup_substructure.log',
'mrproper_substructure.log']
)
elif package == "test_substructure":
options.has_commons = True
options.has_fastjet_inc = True
options.has_fastjet_lib = True
options.ma5_fastjet_mode = True
options.has_fastjet_ma5lib = True
options.has_substructure = True
toRemove.extend(
['compilation_test_substructure.log',
'linking_test_substructure.log',
'cleanup_test_substructure.log',
'mrproper_test_substructure.log']
)
elif package == "HEPTopTagger":
options.has_commons=True
options.has_fastjet_inc=True
Expand All @@ -203,7 +220,7 @@ def WriteMakefileForInterfaces(self,package):
elif package == "test_htt":
options.has_commons=True
options.has_fastjet_inc=True
# options.has_fastjet_lib=True
options.has_fastjet_lib=True
# @JACK: To be able to use fastjet in Ma5 data structure
options.ma5_fastjet_mode=True
options.has_fastjet_ma5lib = True
Expand Down Expand Up @@ -342,9 +359,12 @@ def WriteMakefileForInterfaces(self,package):
elif package=='test_fastjet':
cppfiles = ['Fastjet/*.cpp']
hfiles = ['Fastjet/*.h']
elif package=='test_substructure':
cppfiles = ['Substructure/*.cpp']
hfiles = []
elif package=='test_htt':
cppfiles = ['HEPTopTagger/*.cpp']
hfiles = ['HEPTopTagger/*.h']
hfiles = []
elif package=='test_delphes':
cppfiles = ['Delphes/*.cpp']
hfiles = ['Delphes/*.h']
Expand Down Expand Up @@ -379,6 +399,10 @@ def WriteMakefileForInterfaces(self,package):
isLibrary=False
ProductName='TestFastjet'
ProductPath='../Bin/'
elif package=='test_substructure':
isLibrary=False
ProductName='TestSubstructure'
ProductPath='../Bin/'
elif package=='test_htt':
isLibrary=False
ProductName='TestHEPTopTagger'
Expand Down Expand Up @@ -416,16 +440,18 @@ def Compile(self,ncores,package,folder):
# log file name
if package in ['process','commons','test','configuration']:
logfile = folder+'/compilation.log'
elif package in ['test_process','test_commons','test_zlib','test_fastjet', "test_htt", 'test_root','test_delphes','test_delphesMA5tune']:
logfile = folder+'/compilation_'+package[5:]+'.log'
elif package in ['test_process', 'test_commons', 'test_zlib', 'test_fastjet', "test_substructure", "test_htt",
'test_root', 'test_delphes', 'test_delphesMA5tune']:
logfile = folder + '/compilation_' + package[5:] + '.log'
else:
logfile = folder+'/compilation_'+package+'.log'

# makefile
if package in ['process','commons','test','configuration']:
makefile = 'Makefile'
elif package in ['test_process','test_commons','test_zlib','test_fastjet', "test_htt", 'test_root','test_delphes','test_delphesMA5tune']:
makefile = 'Makefile_'+package[5:]
elif package in ['test_process', 'test_commons', 'test_zlib', 'test_fastjet', "test_substructure", "test_htt",
'test_root', 'test_delphes', 'test_delphesMA5tune']:
makefile = 'Makefile_' + package[5:]
else:
makefile = 'Makefile_'+package

Expand All @@ -451,15 +477,17 @@ def Link(self,package,folder):
# log file name
if package in ['process','commons','test','configuration']:
logfile = folder+'/linking.log'
elif package in ['test_process','test_commons','test_zlib','test_fastjet',"test_htt",'test_root','test_delphes','test_delphesMA5tune']:
elif package in ['test_process', 'test_commons', 'test_zlib', 'test_fastjet', "test_substructure", "test_htt",
'test_root', 'test_delphes', 'test_delphesMA5tune']:
logfile = folder+'/linking_'+package[5:]+'.log'
else:
logfile = folder+'/linking_'+package+'.log'

# makefile
if package in ['process','commons','test','configuration']:
makefile = 'Makefile'
elif package in ['test_process','test_commons','test_zlib','test_fastjet',"test_htt",'test_root','test_delphes','test_delphesMA5tune']:
elif package in ['test_process', 'test_commons', 'test_zlib', 'test_fastjet', "test_substructure", "test_htt",
'test_root', 'test_delphes', 'test_delphesMA5tune']:
makefile = 'Makefile_'+package[5:]
else:
makefile = 'Makefile_'+package
Expand All @@ -483,15 +511,17 @@ def Clean(self,package,folder):
# log file name
if package in ['process','commons','configuration','test']:
logfile = folder+'/cleanup.log'
elif package in ['test_process','test_commons','test_zlib','test_fastjet',"test_htt",'test_root','test_delphes','test_delphesMA5tune']:
elif package in ['test_process', 'test_commons', 'test_zlib', 'test_fastjet', "test_substructure", "test_htt",
'test_root', 'test_delphes', 'test_delphesMA5tune']:
logfile = folder+'/cleanup_'+package[5:]+'.log'
else:
logfile = folder+'/cleanup_'+package+'.log'

# makefile
if package in ['process','commons','test','configuration']:
makefile = 'Makefile'
elif package in ['test_process','test_commons','test_zlib','test_fastjet',"test_htt",'test_root','test_delphes','test_delphesMA5tune']:
elif package in ['test_process', 'test_commons', 'test_zlib', 'test_fastjet', "test_substructure", "test_htt",
'test_root', 'test_delphes', 'test_delphesMA5tune']:
makefile = 'Makefile_'+package[5:]
else:
makefile = 'Makefile_'+package
Expand All @@ -515,7 +545,8 @@ def MrProper(self,package,folder):
# log file name
if package in ['process','commons','configuration']:
logfile = folder+'/mrproper.log'
elif package in ['test_process','test_commons','test_zlib','test_root','test_fastjet',"test_htt",'test_delphes','test_delphesMA5tune']:
elif package in ['test_process', 'test_commons', 'test_zlib', 'test_root', 'test_fastjet', "test_substructure",
"test_htt", 'test_delphes', 'test_delphesMA5tune']:
logfile = folder+'/mrproper_'+package[5:]+'.log'
else:
logfile = folder+'/mrproper_'+package+'.log'
Expand All @@ -525,7 +556,8 @@ def MrProper(self,package,folder):
# makefile
if package in ['process','commons','test','configuration']:
makefile = 'Makefile'
elif package in ['test_process','test_commons','test_zlib','test_root','test_fastjet',"test_htt",'test_delphes','test_delphesMA5tune']:
elif package in ['test_process', 'test_commons', 'test_zlib', 'test_root', 'test_fastjet', "test_substructure",
"test_htt", 'test_delphes', 'test_delphesMA5tune']:
makefile = 'Makefile_'+package[5:]
else:
makefile = 'Makefile_'+package
Expand Down