r8 - 02 Feb 2007 - 16:18:31 - KevinBlackYou are here: TWiki >  AtlasSoftware Web > MuonAnalysisTutorial

MuonAnalysisTutorial - AOD Tutorial 12.0.4


SETUP CMT

Login to an atlas machine at BNL

ssh atlasgw.bnl.gov
rterm -i
cd
mkdir Tutorial

Create 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

SETUP Release 12.0.4

Do:

source setup.csh -tag=12.0.4

Check if your environmental variables are setup correctly

echo $CMTPATH

It should say something like

/usatlas/u/black/scratch_area/TuTest:/afs/usatlas/software/builds/AtlasOffline/12.0.4

if it doesn't or you get error messages while doing this. Don't proceed - ask to figure out what went wrong.

Check out the Code

Check out the code which will access the data from the AOD and produce an ntuple you can analyze:

cmt co -r UserAnalysis-00-08-43 PhysicsAnalysis/AnalysisCommon/UserAnalysis

compile it

cd PhysicsAnalysis/AnalysisCommon/UserAnalysis/cmt/
gmake
cd ..
mkdir run
cd run

To check that everything worked out do a simple test

get_files HelloWorldOptions.py
athena.py -b HelloWorldOptions.py

if 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/
gmake

Now 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.csh

Now you can finally run

athena.py AnalysisSkeleton_topOptions.py

This 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.

About This Site

Please note that this site is a content mirror of the BNL US ATLAS 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 US ATLAS computing account name and password.


Attachments

 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback