Include a new Algorithm
Athena setup
Setup the athena enviroment with asetup.
This one works for me.
Add the following lines to your ~/.bash_profile
:
export AtlasSetup=/afs/cern.ch/atlas/software/dist/AtlasSetup
alias asetup='source $AtlasSetup/scripts/asetup.sh'
(this has to be done only once of course). Then issue
asetup 16.0.2.5
to setup in AtlasProduction 16.0.2.5.
Make a directory
mkdir $TestArea
and
cd
there. Then check out the package Trigger/TrigAnalysis/TrigAnalysisExapmples. For this, first check, which version corresponds to your release. Do
cmt show versions Trigger/TrigAnalysis/TrigAnalysisExapmples
Strange enough this shows a really old package (TrigAnalysisExamples-00-00-22), so I checked out the newest version anyway. (Normally you would check out the one shown by
cmt show versions
.) Anyway, the newest version worked for me. I checked it out by doing
cmt co -r TrigAnalysisExamples-00-00-27 Trigger/TrigAnalysis/TrigAnalysisExamples
To make sure you haven't screwed up anywhere, you might want to compile and run:
cd $TestArea/Trigger/TrigAnalysis/TrigAnalysisExamples/cmt
make -j5
mkdir $TestArea/run # to create a run directory
cd $TestArea/run
get_files TrigMatchExampleJO.py # to grab the joboptions file
athena TrigMatchExampleJO.py | tee joblog # | tee joblog = shows output on screen and also writes it into joblog
If every thing's fine, you can add a new algorithm.
Add a new algorithm
To add your own TriggerAnalysis algorithm from scratch, do the following. In Trigger/TrigAnalysis/TrigAnalysisExapmples/src create a file TriggerAnalysis.cxx and its header, TriggerAnalysis.h (note that in most other packages, the header files are stored in TrigAnalysisExapmples/TrigAnalysisExapmples. Your algorithm should be able to do the following
- retrieve the reconstructed and the trigger objects
- make some trigger studies
- save everything to a ntuple
In order to create a nice ntuple (which would even be re-readable by athena), you should inherit from CBNT_AthenaAwareBase. Alternatively, you can inherit from AthAlgorithm.