# Presentation: 217424

## Run II Muon SoftwareAn Overview

- Pushpa Bhat
-                                                        			**Muon Vertical Review**
**                                                         ****May 22, 2000**

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## Muon Algorithms/ID Group

-   Paul Balm	(Level3, Hitreco)
-   Pushpa Bhat	(Muon Alg. Co-leader, Geometry,muo_explore)
-   Kors Bos	(Level3, TIM, d0ve)
-   Laurent Chevalier(Tracking)
-   Frederic Deliot	(Tracking, alignment)
-   Oleg Eroshin	(FAMUS tracking code)
-   Mike Fortner	(Unpack/pack reco, muon_index)
-   Claude Guyot	(Tracking)
-   Dave Hedin	(Muon ID Co-leader, muo_examine,online)
-   Sharon Hagopian	(Graphics)
-   Rick Jesik	(Geometry)
-   Sasha Kozelov	(Segment reco, track reco)
-   Chun hui Luo	(Muon ID, muo_analyze)
-   Onne Peters	(Level3, hitreco,segmentreco,trf++,d0ve)
-   Harrison Prosper	(Graphics, Geometry, muo_explore)
-   Nemat Rakmatov	(Geometry)
-   Christophe Royon	(Muon-AlgCo-leader,D0sim,release,debug&test)
-   Marc Virchauex	(Tracking)
-   Daria Zieminska	(MuonID Co-leader, muonid,muo_analyze, trf++)
-   Andrzej Zieminski(Geometry, Calibration, Alignment)
**Ex-members**
-  Andrei Mayorov	(mureco, muon_index)
-  Vladimir Sirotenko (D0gstar, McToUnp Reco,
-                                      muon_util, muo_examine)
-  Taka Yasuda	(muo_digi, mureco)

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## Outline

- Introduction
- Data Processing in a Nutshell
- Detailed Data Flow
- Existing and Planned Packages
- Software Review
- Status & Plans

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## What does the software do?

- Access and unpack Raw Data
- Sort the data, process and create hit objects
- Reconstruct segments and tracks
-                     Local Tracking
-                     [Global Tracking (TRF++)]
- Link reconstructed segments/tracks to tracks from SMT, CFT  and produce muon objects
- Analyze hits, segments, tracks, muon particles and MC data; make ntuples
- Detector and data visualization.
- 	(Muon Algorithms and ID groups run as an integrated entity has helped all parties )

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## Data Processing in a Nutshell

**Raw Data**

**Monte Carlo**
** ****Data**

**Unpacked**
** ****Data**

**Processed**
** ****Data**

**Reconstructed**
** ****Data**

**Physics**
** ****Data**

**Unpack**

**Pack**

**Digitize**
**Index**

**Sort, Calibrate**
**Align,..**

**Smearing**
**TrigSim,..**

**Find Segments,**
**Tracks**

**Muon ID**

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## Data Objects

- Monte Carlo
- Data
- SimTkHit

- Unpacked
- Data
- PDTChannel
- MDTChannel
- MSCChannel

- Processed
- Data
- PDTHit
- MDTHit
- MSCHit

- Reconstructed
- Data
- MuoSegment
- MuoTrack

- Physics
- Data
- MuonParticle

- Muon ID VR              Pushpa Bhat

- May 22, 2000

##      MuonParticle

- MuoTrackReco

-      **MuonParticle**
**          ****Reco**

**MuoTrack**
**   **

**MuoSegment**
**Reco**

-   **MuoHit**

**MuoMcToUnp**
**       **

**MuonParticle**
**   **

**GlobalTrackReco**
**         **

**GlobalTrack**
**    **

**RawData**
**   **

-  **MuoUnp **
**  ****Chunk**

**  ****MuoHit **
**  ****Chunk**

**    ****MuoSegment **
**  ****Chunk**

**    ****MuoTrack **
**       ****Chunk**

**  ****Chunk**

**   ****Reco**

**Reco**

**Reco**

**(trf++)**

**        ****Chunk**

**Chunk**

**    ****SimMUONHit **
**  ****Chunk**

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## Packages

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## Muon Geometry

- muon_geometry
- Defines ideal geometry for the muon system detectors
-  Provides access to shapes, sizes and positions of the detectors and their elements, number of wires, wire lengths etc.,
-  Handles conversions of local to global coordinate systems and vice versa
**MuoBaseGeometry, MuoGeomDetector,**
**MuoGeometer (user interface to geometry tree)**

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## each element is represented by a simple geometric shape and position
when an element is moved, the change of position is automatically propagated to the elements below it in the tree.

**when an element is moved, the change of position is automatically propagated to the elements below it in the tree.**

***muon_geometry package***

- The muon geometry is represented by
- a hierarchical tree structure.

- Rick Jesik

- May 22, 2000

## Muon Index

- muon_index
- An indexing/addressing scheme by which every section and every readout cell in the muon system can be uniquely identified.
- MuoSectionIndex, MuoCellIndex
- Each hit will have a muon index
- Translation to other addressing schemes used in the muon system are provided (MC, Geometry, Electronics)
- MuoIndexTrans
-  Greatly simplifies searching, sorting, and tagging hits, hence improving efficiency  and elegance of software.
- (performs as a key)

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## RECO Packages

- 					muo_hit
- muo_data	    muo_segment
- 					muo_track
- Specifies data formats for processed and reconstructed objects.
- muo_hitreco
- Take T0 corrected times, apply calib/alignment, make time to distance conversions and provide geometrical information of the hits to the user.
- muo_segmentreco
- Find A & BC layer segments using MuoHits. Allows more than one segment finding algorithm.

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## Track RECO

- muo_trackreco
-  	Builds muon tracks (and track objects) starting with pairs of A & BC segments.
- 	Allows more than one algorithm
- Currently two algorithms  implemented
- Combinatorial Algorithm
- 	Simple matching of A & BC segments in the Toroid, assuming a uniform magnetic field
- Fit Algorithm
- 	Pair of segments are fit into a muon track via track propagation through the non-uniform magnetic field, taking into account multiple scattering and energy loss in the toroid.

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## Muon ID Package

- MuonParticleReco is the steering framework package for muon ID
- Provides for linking the tracks found in the muon system to the central tracks (reconstructed in SMT and CFT)
- Uses the matched A & BC segments from the muon reconstruction and charged  particles from central tracker (Gtracks)
- The quality of match between the central track and A-layer segment is stored as MuonQualityInfo.
- Working definition of Muon ID
- Gtrack + A segment “loose” 
- Gtrack + (A+BC)segments “tight”

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## Analysis Packages

- muo_analyze
- 	MuoIDAnalyze
- Reads D0reco output and makes a HEPtuple and a ROOT ntuple with quantities relevent to muons, based on the contents of appropriate chunks.
- MC, Gtracks (pt>1.5GeV/c), hits, segment, tracks, MuonID
- muo_explore
- 	An alternate analysis package which currently stores MC and muon local tracking info in an HBOOK ntuple

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## Detector and Event Display

- d0ve_muon
- 	D0 Visualization Environment
- Developed by the NIKHEF group
- Has been a great tool for debugging geometry and reconstruction code
- Now being used for on-line display in the commissioning runs.
- Mr Datae
- Work underway
- Beautiful 3D displays
- D0Scan
- Based on Open Inventor

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## Software Review Design & Implementation

- Very thorough and very useful review of hit (and segment) reconstruction code(s) by  Marc Paterno and Jim Kowalkowski
-       Design Concerns:
-       - Template strategy for MuoDataProcessor
-       - Problem Decomposition in hit processing
-       - Hit storage in Hit Collection
-       - EDM and Framework usage
-      Coding Concerns:
-       - Poor memory management due to
- 	    extensive  copy of pointers
-  	  - Error reporting

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## Software ReviewActions Taken

- Done away with MuoDataProcessor
- Added new utilities to access unpack data
- Chunk selector
- SelectModules
- SelectDataChannels
- Revised Hit and HitCollection classes
- Provided new hit access and insert methods
- Separated different hit types
- Written Channel and Hit Adaptors
- Revised HitReco and HitChunk
- Fixed other minor technical problems
- Error Logging

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## Status and Plans 

- Revisions of hitreco almost done
-          -sign-off this week
-  Revisions of segment reco and track reco are underway
-          -concrete schedule this week
- New algorithms for segment-finding and tracking underway : 3 months
-  trf++ Global tracking
-            -Ramp up after 2 months
-  Muon tracking in Calorimeter (MuoTrackInCal)  Gallas, a few months
-  Improve efficiency, purity, resolution
- ( Performance studies will cover these topics in detail)

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## Major Milestones

- First version of D0gstar Geometry and
- 	Protvino C++ code for FAMUS  tracking  Fall 1997
- Extend to WAMUS, convert to D0standard
- 						Summer 1998
-  Invented MuoIndex                  		 June 1998
-  D0ve event display available
-  Muon Geometry written, mostly debugged early 1999
-  Redesign and revise code to decouple EDM and framework stuff from algorithms.     Spring -Fall 1999
- MCData   Unpdata  hit  segment  track complete. First real data (cosmic) in Run II format read, processed and displayed                         		Aug .99
-  A thorough Software Design and Code Review   (Paterno and Kowalkowski)                     	Dec. 99
-  4th major Iteration: Redesign and Revision                      	                                                      	Jan.00-present
**Three Mini Workshops: **
**April 2000,  May 1999,  Dec. 1998**

- Muon ID VR              Pushpa Bhat

- May 22, 2000

## Summary

- We can process MC and Raw data (in Run II format) and find tracks in the muon system.
-  The momentum resolution obtained is as expected. Work needs to be done on improving efficiencies and reducing fake segments.
- Design and coding revisions are underway for local tracking software. Global tracking (trf++) work has to be ramped up.

-              Momentum Resolution
-              PT  vs. PT

- Muon ID VR              Pushpa Bhat

- May 22, 2000