Difference between revisions of "MuonCalib Tutorial"

From Atlas Wiki
Jump to navigation Jump to search
Line 117: Line 117:
 
<font color = red><tt> cd 11.0.0/ </tt></font>
 
<font color = red><tt> cd 11.0.0/ </tt></font>
 
* get the CalibNtupleAnalysis package (in the future this can be checked out from the release):
 
* get the CalibNtupleAnalysis package (in the future this can be checked out from the release):
<font color = red><tt> cp ~zvankest/public/CalibNtupleAnalysis.tar </tt>
+
<font color = red><tt> cp ~zvankest/public/CalibNtupleAnalysis.tgz </tt></font>
 
+
* and get the hacked MuonSpectrometer/MuonCalib/MuonCalibEventBase package from the same place. This is needed because some incompatibility problems of the MuonCalibEvent class and the MuonGlobalPattern class. In the future this won't be needed, so bear with this for the moment.
<tt> tar -xvf CalibNtupleAnalysis.tar </tt></font>
+
<font color = red><tt> tar -xvfz MuonSpectrometer.tgz </tt></font>
 +
* unpack the tarred files
 +
<font color = red><tt> tar -xvfz <package>.tgz </tt></font>
  
 
An example of an analysis is given in the executable ''exe/Main.cxx''. Try running it after building the package:
 
An example of an analysis is given in the executable ''exe/Main.cxx''. Try running it after building the package:

Revision as of 13:06, 1 November 2005

Muon calibration tutorial

Welcome to the Muon Calibration Page! After doing this tutorial, you will be able to run Athena, make your ntuples containing segment information and use this ntuple to do Athena-independent analysis.


Introduction

Calibration

General information about the need of calibration in the MuonSpectrometer.


Calibration framework

Link to Niels' stuff on calibration.


Why segments?

Maybe needed to explain the concept of segments and the calibration EDM.


Making segment ntuples

Setting up ATHENA

Making segment ntuples from scratch can be done with Athena running on release 10.5.0 or higher. It is recommended to run at the most recent release, in order to be up-to-date. This section covers working in release 11.0.0 . Since this release is not stalled at NIKHEF yet, it is recommended to work at CERN. If you do not have an ATLAS account yet you can get an account here.

  • log on to lxplus:

ssh <username>@lxplus.cern.ch

  • create a work area (here called 11.0.0)

mkdir 11.0.0

cd 11.0.0/

  • create a requirements file which should look like this:
set          CMTSITE          CERN

macro        ATLAS_DIST_AREA  "/afs/cern.ch/atlas/software/dist"
macro        ATLAS_RELEASE    "11.0.0"

use          AtlasSettings v* $(ATLAS_DIST_AREA)

path_remove  CMTPATH          ${PWD}
path_prepend CMTPATH          ${PWD}
  • build your CMT environment:

source /afs/cern.ch/sw/contrib/CMT/v1r18p20050501/mgr/setup.(c)sh

cmt config

source setup.(c)sh -tag=opt

  • the last command line must be typed in every time you open a new terminal. If you want to fill your ntuple with segments from ATLAS reconstructed muons check out the RecExCommon package. For other environments (such as CTB etcetera take a closer look at the MuonCalibrationFramework page.

cmt co Reconstruction/RecExample/RecExCommon (at head) or

cmt co -r RecExCommon-version Reconstruction/RecExample/RecExCommon for your favorite version

  • build RecExCommon

cd Recontruction/RecExample/RecExCommon/RecExCommon-*/cmt

cmt config

source setup.(c)sh

gmake

  • go to the run directory and load some auxilliary stuff:

cd ../run/

source ../share/RecExCommon_links.(c)sh

  • now we can run Athena, provided to have the right jobOptions files. (The following command dumps the messages and writes them to the logfile.)

athena jobOptions.py | tee athena.log

Running on single muons samples

  • a good example of a jobOptions file that produces segment ntuples is provided by Domizia:

cp /afs/cern.ch/user/d/domizia/public/MuonCalib_files/myTopOptions.py

  • you can customize this jobOption file to your own needs...
Change the number of events in the ntuple
Change the tracking software (Moore <-> MuonBoy)
Change the muon-sample (note! The file should be in your PoolFileCatalog)

From the ntuple on, we can operate Athena-independent <<whew!!>>.

Segment analysis

The Calibration Event Data Model (EDM)

The MuonCalibration-framework works with a Calibration EDM, which defines the objects used in the Calibration. The structure is more or less like this:

  • each event contains a certain number of Patterns. Concider these as potential tracks, containing information such as the Chi Squared of the pattern, the track parameters (z0, r0, , , q/p). These patterns are described in the class MuonCalib::MuonGlobalPattern. Patterns are built from a number of segments.
  • a segment is described by MuonCalib::MuonCalibSegment, which is basically a line segment which matches the hits stored in the segment. So segments describe the premature track at chamber level. A line is given by a vector and a direction. This information can be found on the segment as well, in two co-ordinate systems: the global ATLAS co-ordinates and the local chamber co-ordinates.
  • the hits on the segment are implemented as MuonCalib::XxxCalibHitBase 's with Xxx the technology which recorded the hits (i.e. Mdt, Tgc, Csc or Rpc). Each hitBase has their own dedicated content relevant for doing calibration; thus RPCs do not have drifttimes and MDTs do not provide timemeasurements. They do have common members such as (local en global) position and MuonCalib::MuonFixedId 's. Since the Calibration EDM classes are Athena-independent, the identifiers defined for the hit classes are decoupled from the ATLAS data-base (which is Athena-dependent).

In order to do an analysis on segment level from the ntuple, the content from the ntuple must be casted into the Calibration EDM. This can be done with help of a skeleton analysis package.

The CalibNtupleAnalysis package

<<work in progress>>

This package consists of a number of objects:

CalibNtupleAnalysis

                   NTReader                    Reads the ntuple and stores events in Calibration EDM classes
                   MuonCalibEvent              Container class for the MuonCalib::MuonGlobalPatterns
                   SegmentAnalysis             Steers the analysis performed on the ntuple

Setting up the analysis package

  • go to your work space at your ATLAS account

cd 11.0.0/

  • get the CalibNtupleAnalysis package (in the future this can be checked out from the release):

cp ~zvankest/public/CalibNtupleAnalysis.tgz

  • and get the hacked MuonSpectrometer/MuonCalib/MuonCalibEventBase package from the same place. This is needed because some incompatibility problems of the MuonCalibEvent class and the MuonGlobalPattern class. In the future this won't be needed, so bear with this for the moment.

tar -xvfz MuonSpectrometer.tgz

  • unpack the tarred files

tar -xvfz <package>.tgz

An example of an analysis is given in the executable exe/Main.cxx. Try running it after building the package:

cd CalibNtupleAnalysis/v*/cmt/

cmt config

source setup.(c)sh

gmake

../i686-slc3-gcc323-opt/Run.exe

Customizing your favorite analysis

A skeleton needs some 'meat'... Some example routines will be provided:

Refitting with a DCSLfitter (drift circle straight line fitter)

Selecting particular chambers with help of the MuonFixedId

Interfacing a simple event display