ssh atlasgw.bnl.gov rterm -i cd mkdir TutorialCreate a requirements file called requirements which looks like
# Set the site where you are working. For CERN set:
set CMTSITE BNL
set SITEROOT /afs/usatlas
# For portables:
#set CMTSITE EXTSITE
# Other possible values are: LBNL, BNL
# Set the base location of all release for your site:
macro ATLAS_DIST_AREA ${SITEROOT}/software/dist
# Set the location of your prefered development area, where packages
# will be checked out, (change "${HOME}/MyTest" to be any directory
# path or soft link under your home directory):
# The choice below is the most convenient one when used with
# the option -tag=oneTest
macro ATLAS_TEST_AREA "${PWD}"
# Choose current directory as work area
apply_tag oneTest
# Choose to run with optimized code by default
apply_tag opt
# Choose correct version of CMT for the selected release
apply_tag setupCMT
#setup atlas runtime stuff
apply_tag setup
# Set standard Atlas environment
use AtlasLogin AtlasLogin-* $(ATLAS_DIST_AREA)
Then do the following: source /afs/usatlas.bnl.gov/cernsw/contrib/CMT/v1r18p20060606/mgr/setup.csh cmt config
source setup.csh -tag=12.0.4Check if your environmental variables are setup correctly
echo $CMTPATHIt should say something like
/usatlas/u/black/scratch_area/TuTest:/afs/usatlas/software/builds/AtlasOffline/12.0.4if it doesn't or you get error messages while doing this. Don't proceed - ask to figure out what went wrong.
cmt co -r UserAnalysis-00-08-43 PhysicsAnalysis/AnalysisCommon/UserAnalysiscompile it
cd PhysicsAnalysis/AnalysisCommon/UserAnalysis/cmt/ gmake cd .. mkdir run cd runTo check that everything worked out do a simple test
get_files HelloWorldOptions.py athena.py -b HelloWorldOptions.pyif it worked out you will see something like
HistorySvc INFO Registered 1 Algorithms HistorySvc INFO Registered 0 AlgTools HistorySvc INFO Registered 19 Services ApplicationMgr INFO Application Manager Initialized successfully HelloWorld INFO beginRun() ActiveStoreSvc INFO Initializing ActiveStoreSvc - package version StoreGate-02-15-20-07 EventPersistenc... INFO Added successfully Conversion service:DetDescrCnvSvc EventPersistenc... INFO Added successfully Conversion service:McCnvSvc AthenaEventLoopMgr INFO ===>>> start of run 0 <<<=== AthenaEventLoopMgr INFO ===>>> start of event 0 <<<=== HelloWorld INFO execute() HelloWorld INFO An INFO message HelloWorld WARNING A WARNING message HelloWorld ERROR An ERROR message HelloWorld FATAL A FATAL error message AthenaEventLoopMgr INFO ===>>> end of event 0 <<<=== AthenaEventLoopMgr INFO ===>>> start of event 1 <<<=== HelloWorld INFO execute() HelloWorld INFO An INFO message HelloWorld WARNING A WARNING message HelloWorld ERROR An ERROR message HelloWorld FATAL A FATAL error message AthenaEventLoopMgr INFO ===>>> end of event 1 <<<=== AthenaEventLoopMgr INFO ===>>> start of event 2 <<<=== HelloWorld INFO execute() HelloWorld INFO An INFO message HelloWorld WARNING A WARNING message HelloWorld ERROR An ERROR message HelloWorld FATAL A FATAL error message AthenaEventLoopMgr INFO ===>>> end of event 2 <<<===--+Modify the code The default code does not access the Muon Branch. I have copied Ketevi's code as an example go to the src directory and then do :
cd ../src/ cp ~black/scratch_area/Tutorial/PhysicsAnalysis/AnalysisCommon/UserAnalysis/src/AnalysisSkeleton.cxx . cd ../UserAnalysis/ cp ~black/scratch_area/Tutorial/PhysicsAnalysis/AnalysisCommon/UserAnalysis/UserAnalysis/AnalysisSkeleton.h . cd ../cmt/ gmakeNow we are almost ready to run, go to your run directory and copy the job options from my directory to yours
cp ~black/scratch_area/Tutorial/run/AnalysisSkeleton_topOptions.py . cp ~black/scratch_area/Tutorial/run/PythiaZmumu.AOD.py .Since the AODs are on the dcache tape system you have to do one more setup to be able to access the data
source /afs/usatlas.bnl.gov/i386_redhat72/opt/dcache/dcache_client_config.cshNow you can finally run
athena.py AnalysisSkeleton_topOptions.pyThis will run and produce an ntuple called AnalysisSkeleton? .aan.root Now, you may look at the the
AnalysisSkeleton.h, the AnalysisSkeleton.cxx and AnalysisSkeleton_jobOptions.py to see how the ROOT histograms and the AthenaAwareNTuple? of the output file AnalysisSkeleton.aan.root are defined, filled and saved: Follow this link to the AnalysisSkeleton. For further details on how to produces ROOT histograms and Tuples in ATHENA, look at the THistSvc.
You should open the output file AnalysisSkeleton.aan.root in ROOT and browse the histograms and the AthenaAwareNTuple? :
root AnalysisSkeleton.aan.root b = TBrowser()You will notice that beside the user-defined NTuple, the AthenaAwareNTuple? tools add references to the AOD, ESD and Raw Data, in addition the
RunNumber and the EventNumber.
Please note that this site is a content mirror of the BNL USATLAS TWiki. To edit the content of this page, click the Edit this page button at the top of the page and log in with your BNL USATLAS account.