-- RamdasMakhmanazarov - 2023-01-27



The place of IPatFitter in the Reconstruction chain

Muon reconstruction in a nutshell.png


Checkout iPat from Athena

First - make your fork of Athena in Gitlab (more details: https://atlassoftwaredocs.web.cern.ch/gittutorial/).

Then (in your lxplus):

mkdir ipatdevel #your development area
cd ipatdevel
lsetup git
git atlas init-workdir https://:@gitlab.cern.ch:8443/atlas/athena.git
cd athena
git atlas addpkg TrkiPatFitter TrkiPatFitterUtils MuidTrackBuilder
git atlas addpkg MuonRecExample MuonCombinedRecExample MuonConfig MuonCombinedConfig
git fetch upstream
git checkout -b my-ipat-development upstream/master --no-track
mkdir ../build ; cd ../build
asetup master,latest,Athena
cmake ../athena/Projects/WorkDir
mkdir ../run
cd ../run
source ../build/x86_64-centos7-gcc11-opt/setup.sh #or other system parameters of your machine

All other details are here: https://atlassoftwaredocs.web.cern.ch/gittutorial/

Inheritance order of iPat

IPatFitter is a descendant of ITrackFitter, which is an interface and the ancestor of all fitters. The inheritance scheme is the following:
ITrackFitter (interface) : 

Main repository for iPat

  1. https://gitlab.cern.ch/atlas/athena/-/tree/master/Tracking/TrkFitter/TrkiPatFitter
  2. https://gitlab.cern.ch/atlas/athena/-/tree/master/Tracking/TrkFitter/TrkiPatFitterUtils
The iPatFitter class itself assembles measurements and material (using the MaterialCollector) and then calls the FitProcedure to perform the fit and build the track from the resulting measurements. The FitProcedure object is not a tool: instead, an instance of it is created when the iPatFitter is initialized. The iPatFitter uses its own FitMeasurement objects to perform the fit. Extrapolation and calculation of derivatives and residuals is done by the MeasurementProcessor class. iPatFitter is represented my two objects: Fitter and FitterSL. The later (Straight Line) is used in those regions of the detector, where magnets are off.

Entry point to iPat in Athena: CombinedMuonTrackBuilder

https://gitlab.cern.ch/atlas/athena/-/blob/master/Reconstruction/MuonIdentification/MuidTrackBuilder The CombinedMuonTrackBuilder is the interface for the iPatFitter via its three main methods, standaloneFit, combinedFit, and standaloneRefit.


Starting from the MS, calorimeter material (from the TrkMaterialProviderTool) is associated to the track, and a perigee surface is created. The perigee, vertex, calorimeter, and MS entrance TSOSís [https://twiki.cern.ch/twiki/pub/Sandbox/IPatFitter/Muon_Event_Data_Model_and_Dataflow_Overview.pdf] are added to the MS TSOSís, a track is created from them, and the fitter is called. The hits in the resulting track are then recalibrated and the fit is run again. At this point the fit is redone with scaled errors and the cleaner is run. (If the change in momentum is large, the fit will be iterated once more.) The calo TSOS are then re-associated and the fit run once more. Finally, the hit recovery is run and the track is refitted with updated errors, either by inflating the errors to reflect alignment problems (old method) or using the new AlignmentEffectOnTrack TSOSís (new method).


The algorithm is fairly similar, except that now the ID TSOSís are also used (material is still associated to the track from the outside in). Additionally, hits are not recalibrated.


the algorithm is similar but simpler. The calorimeter material is taken from the combined track and the ID Eloss (but not the ID hits) are used. Additionally, the usual step of refining the calorimeter material is skipped and the cleaner and hit recovery are not run, though the error optimizer is.

Configuration of fitter (this chapter needs to be verified)

Fitters have to be configured and steered inside the reconstruction algorithms. Unfortunately, we have two places where this happens. One is the legacy rec excommon which is super hard to understand (Links with Rec in their names - we should use them for now) because there's no clear data flow visible. This will be superseded in the near future by the component accumulator. The first two packages contain the configuration for the MS track building and the other ones for the combined muon reconstruction.





Run Reconstruction

You can run your reconstruction process using data (bytestream file) or MC simulation (using HITS). Here is the example with HITS:
# Get hits. For example like this:
cp /eos/atlas/atlascerngroupdisk/data-art/grid-input/CampaignInputs/mc21/HITS/mc21_13p6TeV.601229.PhPy8EG_A14_ttbar_hdamp258p75_SingleLep.simul.HITS.e8453_s3873/50events.HITS.pool.root .

# Run Reconstruction
Reco_tf.py --inputHITSFile 50events.HITS.pool.root --outputESDFile myESD.root --outputAODFile myAOD.root --preExec='all:from AthenaMonitoring.DQMonFlags import DQMonFlags; DQMonFlags.doHLTMon=False;rec.doTrigger=False; rec.doJetMissingETTag.set_Value_and_Lock(False); rec.doTau.set_Value_and_Lock(False);' --steering='doRAWtoALL' --multithreaded True --autoConfiguration='everything' --conditionsTag='OFLCOND-MC21-SDR-RUN3-10' 2>&1 | tee ./log.txt

checkFile.py† myAOD.root† † †# if you have interest
checkFile 50events.HITS.pool.root

# Run validation
runMuonPhysVal.py --filesInput myAOD.root --outputFile myPhysVal.root

#Explore myPhysVal.root .....

Example of Reco_tf command, when you reconstruct data:

Reco_tf.py \

  --inputBSFile '../data22_13p6TeV.00437548.physics_Main.daq.RAW._lb1666._SFO-19._0001.data' \

  --maxEvents '1000' \

  --outputAODFile 'myAOD.pool.root' \

  --outputESDFile 'myESD.pool.root' \

  --multithreaded 'True' \

  --preExec 'all:from RecExConfig.RecFlags import rec; rec.doZdc.set_Value_and_Lock(False); from AthenaConfiguration.AllConfigFlags import ConfigFlags; ConfigFlags.Trigger.triggerConfig="DB";
 ConfigFlags.DQ.Steering.HLT.doBjet=True; ConfigFlags.DQ.Steering.HLT.doInDet=True; ConfigFlags.DQ.Steering.HLT.doBphys=True; ConfigFlags.DQ.Steering.HLT.doCalo=True; ConfigFlags.DQ.Steering.HLT.doEgamma=True; ConfigFlags.DQ.Steering.HLT.doMET=True; ConfigFlags.DQ.Steering.HLT.doJet=True;
 ConfigFlags.DQ.Steering.HLT.doMinBias=True; ConfigFlags.DQ.Steering.HLT.doMuon=True; ConfigFlags.DQ.Steering.HLT.doTau=True; rec.doDetailedPerfMonMT = True;' \

  --postExec 'all:from AthenaCommon.AlgScheduler import AlgScheduler; AlgScheduler.CheckDependencies(True); AlgScheduler.ShowControlFlow(True); AlgScheduler.ShowDataDependencies(True); svcMgr.PerfMonMTSvc.memFitLowerLimit
 = 300; svcMgr.AlgResourcePool.CountAlgorithmInstanceMisses=True;' \

  --autoConfiguration 'everything' \

  --conditionsTag 'CONDBR2-BLKPA-2022-08' \

  --geometryVersion 'ATLAS-R3S-2021-03-01-00' \

  --runNumber '437548' \

  --steering 'doRAWtoALL'

Switch off iPat in Recotf.py : preExec='InDetFlags.iPatRec= Falseí

Helpful Sources:

  1. Johannes presentation with the role of iPat in reconstruction (22.07.22): https://twiki.cern.ch/twiki/pub/Sandbox/IPatFitter/Review_of_the_Muon_EDM.pdf
  2. Twiki for iPatRec (Obsolete version of IPatFitter) from Alan (2007): https://twiki.cern.ch/twiki/bin/view/AtlasComputing/IPatRec
  3. Reco-validation: https://gitlab.cern.ch/atlas/athena/-/tree/master/MuonSpectrometer/MuonValidation/MuonRecValidation
  4. ATLAS Tracking Software Tutorial: https://atlassoftwaredocs.web.cern.ch/trackingTutorial/index.html
  5. Muon Software Review (2016): https://twiki.cern.ch/twiki/pub/Sandbox/IPatFitter/Muon_Software_Review_2016.pdf
Topic attachments
I Attachment History Action Size Date Who Comment
PDFpdf ATLAS-CONF-2010-072.pdf r1 manage 2540.7 K 2023-01-29 - 16:49 SergeiRosliakov Magnetic field deviation from straight line
PDFpdf Alignment_of_the_ATLAS_Inner_Detector_in_Run-2.pdf r1 manage 5038.3 K 2023-02-17 - 05:47 SergeiRosliakov Alignment of the ATLAS Inner Detector in Run-2
PDFpdf Muon_Event_Data_Model_and_Dataflow_Overview.pdf r1 manage 694.2 K 2023-05-11 - 19:03 IuriiBordulev Edward Moyse presentation
PDFpdf Muon_Software_Review_2016.pdf r1 manage 203.0 K 2023-05-11 - 18:04 IuriiBordulev Muon Software Review (2016)
PNGpng Muon_reconstruction_in_a_nutshell.png r1 manage 334.2 K 2023-05-11 - 17:20 IuriiBordulev Reconstruction sheme
PDFpdf Review_of_the_Muon_EDM.pdf r1 manage 1604.5 K 2023-05-11 - 17:56 IuriiBordulev Johannes_presentation_22_07_22
PDFpdf T_G_Cornelissen_2008_J._Phys.__Conf._Ser._119_032013.pdf r1 manage 1109.6 K 2023-01-29 - 16:56 SergeiRosliakov The global Ōá2 track fitter in ATLAS
PDFpdf Track_Fitting_in_the_ATLAS.pdf r1 manage 10503.9 K 2023-01-29 - 16:50 SergeiRosliakov Track Fitting in the ATLAS Experiment
PDFpdf epjconf_chep2018_06006.pdf r1 manage 1180.1 K 2023-01-29 - 16:59 SergeiRosliakov New Fitting Concept in ATLAS muon tracking for the LHC Run-2
PDFpdf lagouri2004.pdf r1 manage 2637.2 K 2023-03-16 - 12:52 RamdasMakhmanazarov About Reconstruction
PDFpdf talk_for_muon_SW.pdf r1 manage 68.4 K 2023-03-16 - 13:28 RamdasMakhmanazarov Alan's presentation
PDFpdf trackalgs-temp.pdf r1 manage 14216.7 K 2023-01-29 - 17:00 SergeiRosliakov Track reconstruction
Edit | Attach | Watch | Print version | History: r18 < r17 < r16 < r15 < r14 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r18 - 2023-05-26 - IuriiBordulev
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback