Introduction
The SLAC ATLAS group has developed an inclusive software package for producing flat ROOT ntuples from ATLAS Pool files, either ESD or AOD.
Current Versions
Compatible with release 15.4.0 (RECOMMENDED):
JetTrackVertexAnalysis-00-03-11
Changed with respect to JetTrackVertexAnalysis-00-03-10
- Added the possibilit to apply cell energy density weighting to standard calo towers
- Removed deletion of pointers in extrapolateTrack()
- Updated JVF section of RecoJetBlock to use the functionality of the JetVertexAssociationTool and the JetVertexFraction in release 15.4.0
- Uncommented the line in the TRackBlock which prevents the usage of the track impact parameters
- Added TrigVertex branches to the TriggerBlock for beamspot analysis
- Protection against missing measuredPerigee() in TrackJetBlock
Compatible with release 15.3.0:
JetTrackVertexAnalysis-00-03-10
Changes from JetTrackVertexAnalysis-00-03-08:
- Some includes changed in order to compile in 00-03-10
- b-tagging code in RecoJetBlock.cxx cleaned up and updated for 15.3.0 b-tagging changes
Known bugs:
- Setting DoExtrapolation = True in the TrackBlock appears to cause a segmentation fault. Under investigation
Install the following packages on top of 15.3.0 in order for the ntuple maker to work. Check out all packages before building any of them.
- To avoid a seg fault in the magnetic field tool
- InDetTrackingGeometry-01-04-03 in InnerDetector/InDetDetDescr/InDetTrackingGeometry
- TrkDetDescrSvc-00-14-07 in Tracking/TrkDetDescr/TrkDetDescrSvc
- To avoid zeros in all TrackParticle parameters
- TrkEventTPCnv-00-21-00-01 in Tracking/TrkEventCnv/TrkEventTPCnv
- TrkEventAthenaPool-01-30-05 in Tracking/TrkEventCnv/TrkEventAthenaPool
- TrackParticleTPCnv-00-02-01 in Reconstruction/TrackParticleTPCnv
- TrackParticleAthenaPool-00-04-04 in Reconstruction/TrackParticleAthenaPool
Compatible with release 15.1.0:
JetTrackVertexAnalysis-00-03-08
After 15.0.0 there were changes in the L1 Calo jetEtSum computation and related tools that are not compatible with with releases <= 15.0.0
- includes the L1 jet ET sum computation in the trigger block, there are two possibilites:
- extract the weights provided in the L1 xml configuration file (L1ET_JetEtSum)
- passing the corresponding weights directly through job options (L1ET_myJetEtSum)
Also includes the a block for track jets and job options to construct them.
00-03-08 includes commented-out JVF changes which will work in the next release (JVF branches do NOT work in 00-03-08), various bugfixes and naming convention updates, and updates to jet moment handling. 00-03-06 will still work if 00-03-08 gives problems for any reason. 00-03-07 does not compile in 15.1.0.
Compatible with release <= 15.0.0:
We'll try to keep notes on the current recommended version of the code here, close to the top, for reference.
JetTrackVertexAnalysis-00-02-12
- Updated CaloCellESDBlock to include H1 information
- Ignacio fixed EMTrackMatch for EoverPcalculation
Structure and usage
General structure
The package is divided into several independent algorithms, each of which is responsible for adding groups (or blocks) of data to the output ROOT TTree:
- Calo-Tower Block
- Electron Block
- Photon Block
- MET Block
- Muon Block
- Reco-Jet Block
- Topo-Cluster Block
- Track Block
- TrackJetBlock (>=15.1.0)
- Trigger Block
- Truth-Jet Block
- Truth-MET Block
- Truth Particle Block
- Truth Vertex Block
- Vertex Block
Package location
The package resides in the SLAC ATLAS CVS repository here:
Note that the CMTCVSOFFSET is thus different and should be explicitly defined when checking in or out of this CVS location
cmt co -r JetTrackVertexAnalysis-00-02-12 -o groups/slac JetTrackVertexAnalysis
Checkout and build from a lxplus CERN computer account
This would apply to anyone who wants to start using the package from scratch on a lxplus account at CERN.
Setup the analysis environment
Log in to lxplus.
phansson@phansson-laptop~/% ssh <nop>phansson@lxplus.cern.ch
phansson@lxplus253~/% mkdir work phansson@lxplus253~/% mkdir work/jetmetbtag phansson@lxplus253~/% mkdir work/jetmetbtag/mytest phansson@lxplus253~/% cd work/jetmetbtag/mytest phansson@lxplus253~/work/jetmetbtag/mytest% mkdir 14.2.25
Setup the CMT environment
Source the CMT setup script.
[phansson@lxplus253]~/work/jetmetbtag/mytest% source /afs/cern.ch/sw/contrib/CMT/v1r20p20080222/mgr/setup.sh
[phansson@lxplus253]~/work/jetmetbtag/mytest% touch requirementsMore information on what the requirements file is doing can be found in AtlasLogin
#--------------------------------------------------------------------- #CMT home requirements file set CMTSITE CERN set SITEROOT /afs/cern.ch macro ATLAS_DIST_AREA /afs/cern.ch/atlas/software/dist macro ATLAS_TEST_AREA /afs/cern.ch/user/p/phansson/work/jetmetbtag/mytest apply_tag setup apply_tag simpleTest use AtlasLogin AtlasLogin-* $(ATLAS_DIST_AREA) set CMTCONFIG i686-slc4-gcc34-opt #---------------------------------------------------------------------
Create analysis environment including the CMT setup scripts.
[phansson@lxplus253]~/work/jetmetbtag/mytest% cmt config ------------------------------------------ Configuring environment for standalone package. CMT version v1r20p20080222. System is amd64_linux26 ------------------------------------------ Creating setup scripts. Creating cleanup scripts.
[phansson@lxplus253]~/work/jetmetbtag/mytest% source setup.sh -tag=14.2.25 #CMT> Warning: template <src_dir> not expected in pattern install_scripts (from TDAQCPolicy) #CMT> Warning: template <files> not expected in pattern install_scripts (from TDAQCPolicy)
Check out and compile nTupleMaker from CVS using CMT
In this example the tag used is JetTrackVertexAnalysis-00-02-04.
Check out the package.
[phansson@lxplus253]~/work/jetmetbtag/mytest% cd 14.2.25 [phansson@lxplus253]~/work/jetmetbtag/mytest/14.2.25% cmt co -r JetTrackVertexAnalysis-00-02-12 -o groups/slac JetTrackVertexAnalysis # ================= working on package JetTrackVertexAnalysis version JetTrackVertexAnalysis-00-02-12 in /afs/cern.ch/user/p/ phansson/work/jetmetbtag/mytest/14.2.25/JetTrackVertexAnalysis # get top files cvs update: Updating . Creating setup scripts. Creating cleanup scripts. Installing the run directory
[phansson@lxplus253]~/work/jetmetbtag/mytest/14.2.25% source JetTrackVertexAnalysis/cmt/setup.sh
[phansson@lxplus253]~/work/jetmetbtag/mytest/14.2.25% cd JetTrackVertexAnalysis/cmt [phansson@lxplus253]~/work/jetmetbtag/mytest/14.2.25/JetTrackVertexAnalysis/cmt% make ... ... ... #CMT---> all ok.
Setup the package from a lxplus CERN computer account
After doing the setup from scratch described above it is easy to setup the environment for consecutive logins as the CMT setup scripts are already generated.
Log in to lxplus.
[phansson@phansson-laptop]~/% ssh <nop>phansson@lxplus.cern.ch
[phansson@lxplus253]~/work/jetmetbtag/mytest% source setup.sh -tag=14.2.25 #CMT> Warning: template <src_dir> not expected in pattern install_scripts (from TDAQCPolicy) #CMT> Warning: template <files> not expected in pattern install_scripts (from TDAQCPolicy)
Setup the JetTrackVertexAnalysis? package.
[phansson@lxplus253]~/work/jetmetbtag/mytest% cd 14.2.25 [phansson@lxplus253]~/work/jetmetbtag/mytest/14.2.25% source JetTrackVertexAnalysis/cmt/setup.sh #CMT> Warning: template <src_dir> not expected in pattern install_scripts (from TDAQCPolicy) #CMT> Warning: template <files> not expected in pattern install_scripts (from TDAQCPolicy)
Done.
Run the common nTupleMaker on an AOD residing on a local disk
FInd an AOD file that can be used. If you have access to pcphuat disks a file that should work with this example can be found here
Copy this file, or run it from that directory./u1/phansson/data/WbbNp1.250evt.0skip.no_trig.AOD.pool.root
If you copy the file to any other directory, remember to change the file location as necessary in the steps below.
Go to run directory:
[phansson@lxplus253]~/work/jetmetbtag/mytest/14.2.25/JetTrackVertexAnalysis/cmt% cd ../run
In order to run the program, edit this file with your favorite text editor.
[phansson@lxplus253]~/work/jetmetbtag/mytest/14.2.25/JetTrackVertexAnalysis/run% cp ../share/CommonNtuple_defaultOptions.py . [phansson@lxplus253]~/work/jetmetbtag/mytest/14.2.25/JetTrackVertexAnalysis/run% emacs CommonNtuple_defaultOptions.py
- Change the input file:
svcMgr.EventSelector.InputCollections = [ "/home/fizisist/work/data/WbbNp0_AOD_2K.pool.root" ]to (or the location of the AOD file that you are using)
svcMgr.EventSelector.InputCollections = [ "/u1/phansson/data/WbbNp1.250evt.0skip.no_trig.AOD.pool.root" ] - Change output directory of the resulting ROOT file that contains the common TTree
OutputNtupleDir = "/home/fizisist/work/data/""to (or wherever you want the ROOT file to end up)
OutputNtupleDir = "/afs/cern.ch/user/p/phansson/scratch0/" - (optional)Change name of the output ROOT file
OutputNtupleName = "test_2K_fromAOD.root"to
OutputNtupleName = "your_file_name.root"
Run over the local file.
[phansson@lxplus253]\~/work/jetmetbtag/mytest/14.2.25/JetTrackVertexAnalysis/run% athena CommonNtuple_defaultOptions.py
Note that the events may be large and thus choose your output directory accordingly. The number of events can be changed in CommonNtuple_defaultOptions.py by modifying the line
theApp.EvtMax = 10
Run the common nTupleMaker on the GRID using PANDA using a CERN lxplus account
This explains how to run the JetTrackVertexAnalysis? nTupleMaker on the GRID using PANDA.
Initial fact-finding mission
It's probably good practice to know something about your dataset before you start an analysis. Go to AMI
and type in the name of the dataset, or the configuration tag used to produce it (e.g. e352_s462_r541).
Some of the information you'll want to know, which I am taking from mc08.105404.SU6_jimmy_susy.recon.AOD.e352_s462_r541 as an example is:
- Geometry version used: e.g ATLAS-GEO-02-01-00
- Events per file: Children Elements (right side) > event_range > details > nMaxEventPerFile = 250
- Release used to produce the dataset: Transformation Package > 14.2.20.3
- Job configuration at the simulation stage (e.g. if an offset beamspot is used): Production step > simul > JobConfig = VertexPos.py
Setup PANDA
Log in to lxplus.
Follow the instructions here for setting up PANDA:
Go directly to the working directory and setup the release:
[phansson@lxplus253]~/work/jetmetbtag/mytest% source setup.sh -tag=14.2.25 [phansson@lxplus253]~/work/jetmetbtag/mytest% cd 14.2.25
[phansson@lxplus253]~/work/jetmetbtag/mytest% cmt co PhysicsAnalysis/DistributedAnalysis/PandaTools
[phansson@lxplus253]~/work/jetmetbtag/mytest% source PhysicsAnalysis/DistributedAnalysis/PandaTools/cmt/setup.sh
[phansson@lxplus253]~/work/jetmetbtag/mytest% cd PhysicsAnalysis/DistributedAnalysis/PandaTools/cmt/ [phansson@lxplus216]~/work/jetmetbtag/mytest/14.2.25/PhysicsAnalysis/DistributedAnalysis/PandaTools/cmt% make ... ... ... #CMT---> all ok.
Consecutive setup to enable PANDA
Log in to lxplus.
Go directly to the working directory and setup the release:
[phansson@lxplus253]~/work/jetmetbtag/mytest% source setup.sh -tag=14.2.25
[phansson@lxplus253]~/work/jetmetbtag/mytest% source PhysicsAnalysis/DistributedAnalysis/PandaTools/cmt/setup.sh
Submit jobs with PANDA
Log in to lxplus.
Set up your grid environment (note that there is no obligation to be in the working directory when setting up the grid environment).
[phansson@lxplus209]~/% source /afs/cern.ch/project/gd/LCG-share/sl4/etc/profile.d/grid_env.sh [phansson@lxplus209]~/% voms-proxy-init -voms atlas Cannot find file or dir: /afs/cern.ch/user/p/phansson/.glite/vomses Enter GRID pass phrase: Your identity: /O=Grid/O=NorduGrid/OU=kth.se/CN=Per Hansson Creating temporary proxy .................................. Done Contacting voms.cern.ch:15001 [/DC=ch/DC=cern/OU=computers/CN=voms.cern.ch] "atlas" Done Creating proxy ............................... Done Your proxy is valid until Tue Jan 13 23:28:24 2009
[phansson@lxplus209]~/% source /afs/cern.ch/atlas/offline/external/GRID/ddm/DQ2Clients/setup.sh
Tips/recommendation: Put the last three commands in a shell script e.g. "setup_grid_tools.sh" that can be run at setup.
Find a dataset that you want to run over. Note that this dataset have to be registered to the grid. In this example I use a Wbb sample.
[phansson@lxplus209]~/% dq2-ls 'user*David*Miller*WbbNp1*AOD*' user.DavidWilkinsMiller.misal1_mc12.006281.AlpgenJimmyWbbNp1.v12000605.no_trigger.AOD
[phansson@lxplus253]~/% cd work/jetmetbtag/mytest [phansson@lxplus253]~/work/jetmetbtag/mytest% source setup.sh -tag=14.2.25
[phansson@pcphuat27]~/work/jetmetbtag/mytest% cd 14.2.25 [phansson@pcphuat27]~/work/jetmetbtag/mytest/14.2.25% source JetTrackVertexAnalysis/cmt/setup.sh #CMT> Warning: template <src_dir> not expected in pattern install_scripts (from TDAQCPolicy) #CMT> Warning: template <files> not expected in pattern install_scripts (from TDAQCPolicy)
[phansson@pcphuat27]~/work/jetmetbtag/mytest/14.2.25% source PhysicsAnalysis/DistributedAnalysis/PandaTools/cmt/setup.sh #CMT> Warning: template <src_dir> not expected in pattern install_scripts (from TDAQCPolicy) #CMT> Warning: template <files> not expected in pattern install_scripts (from TDAQCPolicy)
The panda job is sent by executing the pathena script which should now be found in the /InstallArea (at least the a link to it).
[phansson@pcphuat27]~/work/jetmetbtag/mytest/14.2.25% more InstallArea/share/bin/pathena
[phansson@lxplus209]~/work/jetmetbtag/mytest/14.2.25% pathena --help
[phansson@lxplus209]~/work/jetmetbtag/mytest/14.2.25% cp JetTrackVertexAnalysis/share/submitDefaultPathenaJob.py JetTrackVertexAnalysis/run/ [phansson@lxplus209]~/work/jetmetbtag/mytest/14.2.25% cd JetTrackVertexAnalysis/run [phansson@lxplus209]~/work/jetmetbtag/mytest/14.2.25% emacs submitDefaultPathenaJob.py
'user': the name of the user output dataset
'identifier': name that can be used to specify additional identifier in the output dataset
'inDS': list of datasets to run over
'options': parameters given to the pathena script (see pathena --help)
'job_options': the job_optionsfile to be used.
--libDs LAST
A good cross-check before executing the pathena script is to run the common nTupleMaker on one of the files in (at least) one of the datasets locally and make sure everything behaves as expected. It is also possible to run over only a few files with panda as a test before sending large jobs, this is possible by specifying in the option
--split 1
[phansson@lxplus209]~/work/jetmetbtag/mytest/14.2.25/JetTrackVertexAnalysis/run% python ../share/submitDefaultPathenaJob.py
pathena --nFilesPerJob 2 --individualOutDS --split 20 --outDS user09.PerHansson.default.user.DavidWilkinsMiller.misal1_mc12.0
06281.AlpgenJimmyWbbNp1.v12000605.no_trigger.AOD --inDS user.DavidWilkinsMiller.misal1_mc12.006281.AlpgenJimmyWbbNp1.v1200060
5.no_trigger.AOD CommonNtuple_defaultOptions.py
extracting run configuration
ConfigExtractor > Input=POOL
ConfigExtractor > Output=AANT AANTupleStream AANT
archive sources
archive InstallArea
check symbolic links
post sources/jobO
query files in dataset:user.DavidWilkinsMiller.misal1_mc12.006280.AlpgenJimmyWbbNp1.v12000605.no_trigger.AOD
submit
===================
JobID : 707
Status : 0
> build
PandaID=23151069
> run
PandaID=23151070-23151086
[phansson@lxplus209]~/work/jetmetbtag/mytest/14.2.25/JetTrackVertexAnalysis/run% dq2-ls -r user.DavidWilkinsMiller.misal1_mc1 2.006281.AlpgenJimmyWbbNp1.v12000605.no_trigger.AOD user.DavidWilkinsMiller.misal1_mc12.006281.AlpgenJimmyWbbNp1.v12000605.no_trigger.AOD INCOMPLETE: COMPLETE: SLACXRD
--site=SLACXRD
Status and re-submission of jobs sent with PANDA
Status of jobs
There are different ways of checking the status of submitted jobs.
- pathena_util: a command line interface to the PANDA DB which is available after setting up PANDA in the release environment.
- PandaMonitor:web interface available atPandaMonitor.
A notification email is automatically sent to the user indicating the result of the job after it has finished.
Re-submit failed jobs
Jobs can be re-submitted using pathena_util.
Retrieve jobs sent with panda
Jobs successfully finished will be registrered on the grid using the dataset given in the pathena script options. Datasets can be fetched using DQ2.
SLAC ATLAS Home