Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tiesheng Dai & Steven Goldfarb US–ATLAS Muon Alignment & Calibration Software Workshop Boston University – 18 Dec 2008 Tiesheng Dai & Steven Goldfarb US–ATLAS.

Similar presentations


Presentation on theme: "Tiesheng Dai & Steven Goldfarb US–ATLAS Muon Alignment & Calibration Software Workshop Boston University – 18 Dec 2008 Tiesheng Dai & Steven Goldfarb US–ATLAS."— Presentation transcript:

1 Tiesheng Dai & Steven Goldfarb US–ATLAS Muon Alignment & Calibration Software Workshop Boston University – 18 Dec 2008 Tiesheng Dai & Steven Goldfarb US–ATLAS Muon Alignment & Calibration Software Workshop Boston University – 18 Dec 2008 ATLAS Cosmic Muon Reconstruction A Brief Tutorial

2 Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 2 Primary Goals  Find cosmic muon data  Reconstruct that data in the Muon Spectrometer with athena  Create and Modify Calibration N-Tuples and AANT  Analyze the data in those N-Tuples Primary Goals  Find cosmic muon data  Reconstruct that data in the Muon Spectrometer with athena  Create and Modify Calibration N-Tuples and AANT  Analyze the data in those N-Tuples The Tutorial What We Won’t Do  Explain athena or the Muon reconstruction algorithms  Spend much time on the technical issues of installation / running  Run in batch or on the grid (or therefore over many events)  Debug, calibrate & align the detector (exercise for the student) What We Won’t Do  Explain athena or the Muon reconstruction algorithms  Spend much time on the technical issues of installation / running  Run in batch or on the grid (or therefore over many events)  Debug, calibrate & align the detector (exercise for the student) AANT Raw Data Calibration N-Tuple athena Wiki Instructions https://hep.pa.msu.edu/twiki/bin/view/AGLT2/MuonReco Wiki Instructions https://hep.pa.msu.edu/twiki/bin/view/AGLT2/MuonReco

3 Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 3 CERN Online Raw Data /castor/cern.ch/grid/atlas/DAQ/2008 /castor/cern.ch/grid/atlas/DAQ/M7 (May-July 2008) CERN Offline Data /castor/cern.ch/grid/atlas/atlasdatadisk/data08_X/Y X = 1beammag, calib, cos, cosmag, cvalid and idcomm, Y = RAW, AOD, ESD, CBNT, TAG  Common Castor Commands: nsls, rfdir, rfcp (see user guide in Software wiki pages) AGLT2 (ATLAS Great Lakes Tier 2)  /pnfs/aglt2.org/data/daits/mdaq/ NOTE: Muon Data Only (stripped to MDT, CSC, RPC, TGC, Trig)  DCACHE Commands: ls, dir, dccp BNL (ATLAS Tier 1) [Muon Data Only of Run 91060]  /pnfs/usatlas.bnl.gov/u06/daits/mdaq/ BU (ATLAS Tier 2) [Muon Data Only of Run 91060]  NFS: /data4/bu/daits/mdaq/ More Information:  http://atlas-runquery.cern.ch http://atlas-runquery.cern.ch Finding The Data

4 Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 4 DQ2 https://twiki.cern.ch/twiki/bin/view/Atlas/WorkBookDQ2  Setting Up DQ2  CERN : /afs/cern.ch/atlas/offline/external/GRID/ddm/DQ2Clients/setup.[c]sh  AGLT2 : $LCG_ENV/grid_env.[c]sh and $DQ2_ENV/setup.[c]sh  BNL : /afs/usatlas.bnl.gov/lcg/current/etc/profile.d/grid_env.[c]sh; /afs/usatlas.bnl.gov/Grid/Don-Quijote/DQ2Clients/setup.[c]sh DQ2_LOCAL_SITE_ID = BNL-OSG2_DATATAPE  Grid Certificate Needed for voms-enabled proxy  https://www.racf.bnl.gov/docs/howto/grid https://www.racf.bnl.gov/docs/howto/grid  Some Basic Commands:  List: dq2-ls –f data08_cos.00091060.physics_TGCwBeam.daq.RAW.o4  Copy: dq2-get data08_cos.00091060.physics_TGCwBeam.daq.RAW.o4  But, what are you doing copying a raw data set, anyway?  Better to run on the grid, at CERN, or at a Tier 1 or Tier 2 site. Finding The Data

5 Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 5 The Scripts  Tutorial Based on Scripts of Tiesheng  Installation of software and setup of environment  Running of reconstruction and filling of n-tuples  Advantages  Limited Time of Tutorial  Simplicity & Robustness  Provides Record of Full Procedure (Copy It!)  Where to Run the Scripts  AGLT2 : ssh -Y myusername@AssignedNodeForYou (see mail of Bob Ball)  OR ssh -Y myusername@umt3int0X.physics.lsa.umich.edu (X=1,2,3)  CERN : ssh -Y myusername@lxplus.cern.chmyusername@lxplus.cern.ch  OR any CERN linux machine with AFS  BNL : ssh -Y myusername@atlasgw.bnl.gov, rterm -imyusername@atlasgw.bnl.gov  BU : ssh -Y myusername@atlas-login.bu.edu (no package checkout)myusername@atlas-login.bu.edu Installing & Running The Software

6 Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 6 The Installation Script Example Usage: ~daits/public/scripts/installProdMuonRec 14.5.0.1 -checkout MuonSpectrometer/MuonCalib/MuonCalibNtuple

7 Directories  AtlasProduction/  cmthome : requirements file and initial setup scripts;  MuonSpectrometer : any packages that were checked out;  InstallArea : libraries and links for checked out packages;  data08list : 2008 data file lists;  runCtrl : python jobOption files and full setup script;  job : Scripts to process data.  Caution:  Script will not overwrite any existing package unless “update” option used. Still, be careful if you are editing files in the packages Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 7 The Installed Environment Note By default, the Tier Centers install the distribution kits. The script option –KITDIR allows the user to point to one of those kits explicitly. If AthenaProduction was not included in that kit, the script will find the right tag for the release and install it. Note By default, the Tier Centers install the distribution kits. The script option –KITDIR allows the user to point to one of those kits explicitly. If AthenaProduction was not included in that kit, the script will find the right tag for the release and install it.

8 The Run Scripts  jobs/run_using_default  reads data directly (castor at CERN, DCACHE for BNL, AGL2)  ESD not written  jobs/run_using_local_disk  copies data to local area (/tmp/username) from DCACHE or castor  Both  ESD writing turned off  dataFileName and numberEvent can be specified as input to script  Example mkdir test; cd test../job/run_using_local_disk ! 10  Runs reconstruction on 10 events of the default data set  New Files Produced  CalibrationNtuple.root  ntuple.root (Muon AANT) We’re Done!!!  But, what did we do? Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 8 Running

9 Create cmthome/requirements According to the Machine / Environment Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 9 Inside InstallProdMuonRec (1) use athena kit kit location install area cvs kserver Set up CMT environment for version of CMT source $CMTDIR/$CMTVERS/mgr/setup.sh Build the setup scripts cmt config

10 Install the package from the kit, using pacman Example of a private installation: ~daits/public/scripts/installProdMuonRec 14.5.0.1 -kitdir /afs/atlas.umich.edu/athena/ Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 10 Inside InstallProdMuonRec (2) Obtain AFS token (KERBEROS 4) if necessary kinit -4 cernUserName@CERN.CH Setting Up CVS and CMT CERN: CVSROOT=:gserver:isscvs.cern.ch:/local/reps/atlas; CMT=cmt BNL: CVSROOT=/afs/usatlas.bnl.gov/software/cvs; CMT=bnl_cmt AGLT2: CVSROOT=:kserver:atlas-sw.cern.ch:/atlascvs; CMT=cmt BU Tier2: CVSROOT=:kserver:atlas-sw.cern.ch:/atlascvs; CMT=cmt

11 Setup ATHENA Environment  Shell & athena Environment /bin/sh cd ~/work/p14.5.0.1 source./runctrl/setup.sh  get AFS token if necessary Check Out and Install Packages  Explicit tag used when provided, else uses correct tag for Release cmt show versions MuonSpectrometer/MuonReconstruction/MuonRecExample  Example checkout and build: cmt co –r MuonRecExample-01-01-20 MuonSpectrometer/MuonReconstruction/MuonRecExample (use bnl_cmt at BNL Tier 1) cd ~/work/p14.5.0.1; unset CMTPATH; source cmthome/setup.sh –tag=32,14.5.0 cd MuonSpectrometer/MuonReconstruction/MuonRecExample/cmt; source setup.sh; gmake Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 11 Inside InstallProdMuonRec (3)

12 Find and Link to Data File Lists  According to user’s request Generate Setup Script  Example for AtlasProduction from Kit: Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 12 Inside InstallProdMuonRec (4) Modify jobOptions to account for user’s requests, data sets, etc.  MuonDataRec_myTopOptions.py Generate run scripts for cosmics

13 Making Changes to the jobOptions and Running mkdir myinstallarea/AtlasProduction/work cd myinstallarea/AtlasProduction/work source../runCtrl/setup.sh cp../runCtrl/MuonDataRec_myTopOptions.py. Modify MuonDataRec_myTopOptions.py as you need. athena.py –s MuonDataRec_myTopOptions.py Running on More or Different Data  Using Castor  https://twiki.cern.ch/twiki/bin/view/Atlas/WorkBookCastor https://twiki.cern.ch/twiki/bin/view/Atlas/WorkBookCastor  Using DCACHE  https://www.racf.bnl.gov/Facility/dcache/ https://www.racf.bnl.gov/Facility/dcache/  https://hep.pa.msu.edu/twiki/bin/view/AGLT2/DCacheNotes https://hep.pa.msu.edu/twiki/bin/view/AGLT2/DCacheNotes Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 13 Moving On After The Tutorial

14 MuonDataRec_myTopOptions.py  Settings for Tutorial  ESD output : rec.doWriteESD = False  MDT segment T0 fit : muonRecFlags.doSegmentT0Fit = False  Alignment correction : muonRecFlags.useAlignmentCorrections = True  Detector Control (run 91897 with CSC) : muonRecFlags.doCSCs=False  Read Multiple Data Files  athenaCommonFlags.BSRDOInput.set_Value_and_Lock([ ‘FILE1’, ‘FILE2’,…]) MuonRecFlags.py  Where to Find the File MuonSpectrometer/MuonReconstruction/MuonRecExample/python/  Modify with Care More Examples  Modified files ~daits/public/demo_for_14.5.0.1 Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 14 More On jobOptions

15 MuonRecFlags.py  Create New Flag: useMDTCalibSQLLite Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 15 Reading Calibration Constants From SQLLite Add these lines after the useAlignmentCorrections flag to define this flag. MuonReadCalib.py  Change: to:

16 MuonSpectrometer/MuonCalib/MuonCalibNtuple/MuonCalibNtuple/MuonEventNtuple Branch.h  Add line: int dummyForTest; before: int eventNumber; MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonEventNtupleBranch.cxx  Add line: branchCreator.createBranch( tree, "dummyForTest", &dummyForTest, "/I“ ); before: branchCreator.createBranch( tree, "eventNumber", &eventNumber, "/I" );  Add line: dummyForTest = 1; before: runNumber = eventInfo.runNumber(); Build the Code ~daits/public/scripts/installProdMuonRec 14.5.0.1 -checkout no -compile MuonSpectrometer/MuonCalib/MuonCalibNtuple Run the Code../job/run_using_local_disk Take a Quick Look at the N-Tuple to See if it Worked ~daits/public/scripts/generator_cppfile_for_calibNtuple CalibrationNtuple.root mytest more mytest.h Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 16 Adding Content to the Calibration N-Tuple Here it is!

17 What To Use  AANTP will NO LONGER be produced in central production  Muon Calibration N-Tuple WILL be produced  Tracking Contents  Moore Track Parameters in Calibration N-Tuple for 14.5.0.1  Muonboy Track Parameters in later releases (not yet segments) Documentation  Muon Calibration N-tuple https://twiki.cern.ch/twiki/bin/view/Atlas/MuonCalibNtuple  Muon Spectrometer Nomenclature https://hep.pa.msu.edu/twiki/pub/AGLT2/MuonReco/MS_Naming.ppt  Muon AANT for raw data https://twiki.cern.ch/twiki/bin/view/Atlas/MuonCommRawDataAna  Muon AANT for MOORE tracking https://twiki.cern.ch/twiki/bin/view/Atlas/MooreNtuple  Muon AANT for Muonboy tracking http://cern.ch/atlas-samusog/muonboy/DocNtuples/CBNT_Muon.html Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 17 More On the N-Tuples

18 User Analysis Example: mytest  Create a work area for analysis and run Tiesheng’s script mkdir ~/work/p14.5.0.1/anal; cd ~/work/p14.5.0.1/anal ~daits/public/scripts/generate_cppfile_for_calibNtuple../test/CalibrationNtuple.root mytest  Modify mytest.h to include more ntuple files:  Replace mytest::mytest(TTree *tree) by  Or copy ~daits/public/muon_calib_ntup_demo/mytest.h Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 18 Analyzing The Calibration N-Tuple root -l TFile *my = new TFile(“../test/calibrationNtuple.root") my->ls() my->cd("PatternNtupleMaker") Segments->MakeClass(“mytest").q root -l TFile *my = new TFile(“../test/calibrationNtuple.root") my->ls() my->cd("PatternNtupleMaker") Segments->MakeClass(“mytest").q

19 User Analysis Example: mytest (2)  Add code to mytest.C  Here is an example from ~daits/public/muon_calib_ntup_demo/mytest.C Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 19 Analyzing The Calibration N-Tuple Open new root file for output Write plots to root file Fill histograms Book histograms Make plot

20 User Analysis Example: mytest (3)  Perform the Analysis ~daits/public/scripts/run_cppfile mytest  Take a look at All_plots.pdf and mytest.root Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 20 Analyzing The Calibration N-Tuple root -l.L mytest.C mytest p p.Loop().q root -l.L mytest.C mytest p p.Loop().q

21 Some Expert Code  Decoding the Identifiers: ~daits/public/scripts/muonfixedid.h (Code from Ed Diehl to decode muonfixedid into type, station, eta, phi)  Checking and Merging N-Tuples: ~daits/public/scripts/checknt.sh (also from Ed)  Other examples out there from other experts Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 21 Useful Analysis Tools for Calibration N-Tuple

22 Similar to Calibration N-Tuple  Create mytest.h and mytest.C ~daits/public/scripts/generate_cppfile_for_muonNtuple../test/ntuple.root mytest  Modify the files as in Examples from Tiesheng for 14.5.0.1: ~daits/public/muon_AA_ntup_demo/  Chaining AANT files: TChain *f = new TChain("CollectionTree");  Running the Analysis ~daits/public/scripts/run_cppfile mytest Note: N-Tuples are often Athena version-dependent! Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 22 Analysis of Muon AANT

23 Who To Ask When You Have Questions or Problems Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 23 Experts TopicContact Questions Specific to the TutorialTiesheng Dai, Steven Goldfarb General Muon Software Issueshn-atlas-muonSW@cern.chhn-atlas-muonSW@cern.ch, Stephane Willocq, Rosy Nikolaidou, Ed Moyse, Kevin Black Finding the Datahttp://atlas-runquery.cern.chhttp://atlas-runquery.cern.ch, Tiesheng Dai MOORE Reconstructionhn-atlas-muonSWReconstruction@cern.chhn-atlas-muonSWReconstruction@cern.ch, Niels van Eldik Muonboy Reconstructionhn-atlas-muonSWReconstruction@cern.chhn-atlas-muonSWReconstruction@cern.ch, samusog@cern.chsamusog@cern.ch ATLAS Database Technical Issuesatlas-db-help@cern.chatlas-db-help@cern.ch, Vakho Tsulaia, Emil Obreshenkov Muon COOL DatabaseMonica Verducci MDT Calibration DatabaseOliver Kortner, Domizia Orestano Calibration N-Tuple & SoftwareFelix Rauscher, Ed Diehl MDT AlignmentChristoph Amelung (Endcap), Pierre-Francois Giraud (Barrel) MDT Alignment SoftwareRob Harrington TGC IssuesMasaya Ishino CSC IssuesWoochun Park, Michael Schernau RPC IssuesGabriele Chodini

24 What We Have Covered  How to Find Raw Cosmic Muon Data  How to Reconstruct that Data to Produce N-Tuples  How to Add Information to those N-Tuples  How to Analyze those N-Tuples The Scripts  Run them on the machine of your choice  More Important: Copy them and use them as examples  Available at CERN, BNL, AGLT2, BU  ~daits/public/scripts/  ~daits/public/demo_for_14.5.0.1/  ~daits/public/muon_calib_ntup_demo/  ~daits/public/muon_AA_ntup_demo/ Enjoy! Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 24 Summary

25 Merry Christmas and Happy New Year Boston - 18 Dec 2008T. Dai & S. Goldfarb - Univ of Michigan MDT Config DB - Slide 25 Tiesheng’s Christmas Card


Download ppt "Tiesheng Dai & Steven Goldfarb US–ATLAS Muon Alignment & Calibration Software Workshop Boston University – 18 Dec 2008 Tiesheng Dai & Steven Goldfarb US–ATLAS."

Similar presentations


Ads by Google