muon reconstruction with orca - infn sezione di padovalacaprar/talks/tutorialmuon_20040415.pdf ·...

51
CMS Workshop on Muon at the LHC and Tevatron FNAL, thursday, April 15, 2004 Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara [email protected] INFN and Padova University Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.1/43

Upload: others

Post on 27-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

Workshop on Muon at the LHC and Tevatron

FNAL, thursday, April 15, 2004

Muon Reconstruction with ORCAORCA tutorial

Stefano [email protected]

INFN and Padova University

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.1/43

Page 2: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

OutlineGeneral introduction,

Goal of this tutorial,Muon related packages,Information: who and where,Muon BuildFile,.orcarc and co,Basics on CommonDet,

Exercises: access to Geometry, SimHits, Digisand RecHits

access DT geometry information,access RPC SimHits,access CSC Digis,access RecHits for all 3 systems,homework,

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.2/43

Page 3: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

Introduction: GoalsGoals of this tutorial

general description of Muon softwaredescription of Muon detector modelinghow to access geometry of DT, CSC and RPChow to access SimHits, Digis and Rechits (localreconstruction) for the 3 systems

This tutorial will not cover:How to access and use muon reconstructed tracks,DST (Norbert’s tutorial)Algorithmic details about how the reconstruction isperformedL1 simulation and HLT reconstruction

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.3/43

Page 4: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS Muon packagesThere are � packages related to Muon reconstruction inORCA:

MuonResponsible for detector description of DT, CSC andRPC (reading from DDD), OO modeling of detectorsaccess to SimHits, simulation and access to Digislocal reconstruction (hits and segments)stand alone reconstruction, using only muondetectors(mis)alignment

The Muon package will be soon (next release?) split intwoMuon geometry, SimHits, DigisMuonLocalReco RecHits (reconstruction inside

detectors) and stand alone reconstruction

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.4/43

Page 5: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS Muon packages (II)MuonReco

responsible for global reconstruction (with tracker)HLT reconstruction (L2, L3), using L1 trigger inputmuon isolation (using calo’s, pixel and tracker)Off-line muon reconstruction and isolationMuon identification

MuonAnalysisFramework for analysis for the PRS-� groupUsed to produce root trees for the DAQ TDRcode now obsoleted by DST

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.5/43

Page 6: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

DocumentationWhere to find it:

A good reference book on C++ (like Stroustrup’s)For STL: http://www.sgi.com/stl/ORCA http://cmsdoc.cern.ch/orca/ORCA UserGuide: Muon section

large effort to write and update the DT partfor CSC CMS Note 2001/013

ORCA Reference Manual: for class interface anddocumentation about class methodsfor local reconstruction CMS Note 2002/043 (DT partobsolete since december...)for track reconstruction DAQ TDR vol II (mostly HLT, butuseful)

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.6/43

Page 7: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS PeopleWho can answer to your questions

Stefano Lacaprara all Muon, DT, reconstruction;Nicola Amapane DT, isolation;Tim Cox, Rick Wilkinson CSC;Artur Kalinosky, Giacomo Bruno RPC;Norbert Neumeister global muon reconstruction;Celso-Martinez Rivero (mis)alignment;

Don’t forget the general ORCA mailing list:[email protected]

For bug report and feature request use savannah:https://savannah.cern.ch/projects/orca/

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.7/43

Page 8: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

BuildFileWhat to put into your BuildFile

The content of your BuildFile determines what you canactually do in your executable.Documented from ORCA page (follow BuildFile link inthe upper part)General rules:

keep it as simple as possible (but not simpler...)use only groups, not directly library (except yourown): if they do not work, complain with author (egvia feedback mailing list)find a working example and copy it!

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.8/43

Page 9: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS BuildFile (II)Simple example: private analysis library and executablewhich uses just muon from stand alone reconstructionstarting from Digi<environment>

<lib name=MyGreatAnalysisLibrary></lib>

<group name=MuonInternalReco><use Muon>

<group name=RecReader><External ref=COBRA Use=CARF>

<bin file=MyAnalysis.cpp name=MyAnalysis></bi</environment>

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.9/43

Page 10: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS BuildFile: Muon groups (I)with <Use Muon>

MuonRecHitReader : For RecHit reconstruction on DT, CSCand RPC;

MuonDigiReader : For reading on the 3 sub-detectors: noRecHit reconstruction is guaranteed

MuonSimHitReader : For SimHit reading on the 3sub-detectors: no RecHit reconstruction and/or Digisimulation is guaranteed

MuonLayout : To access DetLayers (see after) for the Muonsystem [to be used with <use CommonReco> :( ]

� Identical groups exist separately for each sub-system,replacing Muon with MB, ME, MRpc, respectively forDT (barrel), CSC (endcap) and RPC systems;

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.10/43

Page 11: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS BuildFile: Muon groups (II)MuonDSTReading : For reading (and writing) muon track

reconstruction with standalone detector from DST;

MuonInternalReco : For muon track reconstruction withstandalone detector;

with <Use MuonReco>

MuonReconstruction : For global reconstruction (withtracker);

MuonIsolation : For isolation;

MuonRecoReader : to read reconstructed muon (even withisolation info) from DST;

� Warning � : to perform off-line reconstruction(GlobalMuonReconstructor), also MuonInternalReconeeded.No problem to read muons from DST!

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.11/43

Page 12: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

.orcarc and coWhat to put into your .orcarc

The .orcarc files contains parameter and setting forORCA softwareCan have different name. UsageMyExacutable -c <MyOrcarcFile>Documented from ORCA page (follow orcarc link in theupper part)keep it as simple as possible: the default is (almost)always the best choice, unless you know what you aredoingMandatory:

InputFileCatalogURL = @�<yourPoolFileCatalog>�@InputCollections =/System/<Owner>/<Dataset>MaxEvents = ... Default (-1) == all events

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.12/43

Page 13: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS .orcarc and co (II)To switch off completely access to all Digis, SimHits butthe Muon onesFrontEnd:DefaultRequest = NopMuonHits*:Request = AutoMuonDigi*:Request = Auto

Similars card for all other detector

IMPORTANT!! To perform Muon track reconstruction we stilluse GEANE for extrapolation: need initialization, viaenvironment variablesetenv GEANEUSED TRUE (csh)export GEANEUSED=TRUE (sh) ALL CAPITAL!!If not, no reconstructed muons!Warning: If you just read from DST reconstructed muontrack you DON’T need it

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.13/43

Page 14: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS Geometry in ORCA

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.14/43

Page 15: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

CommonDetCommonDet is a base ORCA package to describegeometry and detectorsIt widely used by Muon and Tracker sub-systemsDefines common interfaces and implementfunctionalities which are not system dependentMuon and Tracker have specialization of baseCommonDet classes, to deals with details (such asgeometry structure, hierarchy, reconstructionalgorithms) which are differentThe common interface allow for a transparent use ofMuon and Tracker system by userGreat use in muon reconstruction but not onlyBase object in CommonDet are Det, DetUnit,RecHit and related classes

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.15/43

Page 16: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

Deta Det model a “Detector” in ORCA softwareWhat is a “Detector”?

For Tracker: a silicon or pixel model (not a singlestrip or pixel)For Muon: a Chamber (DT, CSC, RPC)DT and CSC are multi layers: also the individuallayers are Det (also the SuperLayer for DT)This leads naturally for a CompositeDet, with ahierarchial structure (see after)In general: a Det models a well defined physicalobject, with reconstruction capabilities, but not thesmallest possible one (eg silicon strip or DT cell)

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.16/43

Page 17: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS Responsibility of a DetThe responsibility defines also the interface

Det deals with reconstructionHas knowledge of it’s position within CMS referenceframe, its size, defines a local reference frame and isable to transform back and forth from local to global ref.frameReconstruct the detector response in term of position(and eventually direction), in case using external input(such as track angle) and return the results as RecHitsDet is not responsible to access the Digis and/orSimHits (DetUnit see after)Part of Det responsibility is delegated to specializedclasses: eg position to Surface and bounds toBoundSurface, which are hidden behind Det interfaceSpecialization of Det of Muon system are:MuBarChamber, SL, Layer, MuEndChamber,Layer, MRpcDetUnit

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.17/43

Page 18: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

Det interfaceposition(), rotation() of Det surface in CMSreference frametoLocal(...), toGlobal(...) transforms apoint, vector, error from global (CMS) to local (Det) ref.frame. toLocal wants a Global<Object> and returns aLocal<Object>, and vice-versa.recHits(), recHits(TSOS) return all RecHitsreconstructed by the Det, eventually using the inputTSOS.measurements(...) return all the measurementscompatible with an input state according to a userdefinable criteria (��, distance, etc).DetUnits() return all DetUnits (see after) the Det iscomposed of, or itself if not composedOther methods to implement the ones above in adetector specific way

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.18/43

Page 19: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

CompositeDetA Det can be composite, ie made of other DetsGood examples are DT chambers (each made of 3SuperLayers, each made of 4 Layers) or CSC (eachmade of 6 Layers)Very useful to define logical collection of physicaldetectors with common features, which is useful tohandle together (DetLayer)CompositeDet is a Det made of DetsCompositeDet::dets() returns the components asvector<Det*> .all other Det methods are available, including recHits(),measurements(),...

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.19/43

Page 20: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS DetLayerVery important CompositeDet is a DetLayerDetLayer is a logical CompositeDet, made of alldetector of a given type which lays “more or less” on thesame surfaceThe surface can be a cylinder (barrel) or a disk (endcap)

CSC

DTRPCeta=0.8 1.04 1.2

2.1

2.4

0

100

600

700

800

500

400

300

200

0 200 400 600 800 1000 1200

R (

cm)

Z (cm)

Muon barrel: 4 DetLayerscorresponding to the 4 DTstations, plus 6 for RPCs,all cylindersMuon endcap: 5 disks (��)for CSC and 5 for RPC (ne-glecting staging ...)

The physical dets does not lie necessarily exactly onthe surface, but at least very close to

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.20/43

Page 21: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

DetLayer (II)Responsibility of DetLayer is navigationGiven this state, which is the next DetLayer where Ishould look to find other RecHits?Other responsability is to find efficiently which are allthe components Det which are truly compatible with thepropagated stateThe set of DetLayers give a simplified description ofCMS often called the reconstruction geometryImportant by-product of DetLayer is the ability to accessto the Det geometry in a uniform way for all thesub-systems, via DetLayer::dets()

Caveat: for Muon need group MuonLayout inBuildFileWarning: the Dets are accessed as Det, not asspecific object (eg MuBarChamber, ...). Not fullinterface is available (can dynamic cast )

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.21/43

Page 22: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

DetUnitSpecialization of DetHas a pointer to SimDet where SimHit (hits simulatedby OSCAR/cmsim) are stored: can be void (eg after2007...)Has pointer to Readout, which acts as a Digi container,thus gives access to DigisThe digis are detector specific, so it’s not possible toaccess to a generic vector<Digis> from a DetUnit:must use the specific interface of concreteimplementation of DetUnit for various systems (DT:MuBarLayer, CSC: MuEndLayer, RPC:MRpcDetUnit)

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.22/43

Page 23: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS Geometry buildingWho builds the Dets? NOT YOU!!There must be only one instance of the Geometry inmemory, and the user just access itThe geometry is built when the proper library is loadedThe ORCA geometry is focused on reconstruction, andis designed to be as simple as possibleIt is different from the detector description used inOSCAR (simulation), which describes as many detail aspossibleeg. in ORCA only sensitive detectors are described, notpassive materialDifferent applications have different needs, thus“different” geometriesBoth geometries come from the same database!!Database is a set of xml files, almost human readable,and ORCA is interfaced to xml via Detector DescriptionDatabase package

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.23/43

Page 24: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

Local reconstruction: RecHitA Det is a reconstructing detectorthe local reconstructed object is always returned as aRecHita RecHit can be different things:Hit 1D only one coordinate is measured (in the local Det

ref. frame). ex. Drift Tube alone (only distance fromwire)

Hit 2D two coordinates are measured. ex. pixeldetectors or CSC Layers if wires and stripsinformation are matched

a Hit pair ex. Drift Tube without Left/Right ambiguitysolved

Segment 2D position and direction in one coordinate. exa DT SuperLayer

Segment 4D position and direction in both coordinates.ex a DT chamber segment (matching � and � SLsegments), a CSC chamber segment.

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.24/43

Page 25: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS Local reconstruction: RecHit (II)The RecHit is always defined at the Det surface (solocal z is always �)RecHit interface is wide enough to return information forthe most complex object.Not all methods are meaningful for all kind of RecHits:eg no direction for a 1D hit!A RecHit is a composed object: can be made of otherRecHits (eg a segments or a pair)When needed (eg for Kalman filter), all availableinformation about a RecHit are used properly, with acommon interfaceRecHit always accessed by value! Always do a localcopy of vector<RecHit> before iterating

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.25/43

Page 26: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

RecHit and tracksRecHits are used to build Tracks (see also Norbert’stutorial)A track has a collection of TrajectoryMeasurementEach TM has:predictedState() according to “last” measurement and

propagated to the actual Det surface,recHit() the RecHit found and used to update the

trajectory: can be invalid if no compatible RecHit has beenfound. Always check if RecHit::isValid()

updatedState() the starting point for next iteration.

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.26/43

Page 27: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS RecHit and tracks (II)The pattern recognition in CommonDet framework(bird’s eye view: reality can be much more complex)

Define a starting state (seed) on a Det: eg. using theDet RecHits (as in StandAlone muon reco, starts fromDT/CSC segments) or external input (L1 trigger)Ask to the DetLayer (to who the actual Det belong)which is next DetLayer compatible with actual statepropagate state to DL surface, “long” propagation, inMuon system likely across iron: CPU expensive!Find inside the next DetLayer the Dets compatible withthe state (reminder: a DetLayer can be a cylinder

� � ��� ��� many possible Det, mostly wrong ones!)Propagate from DL surface to compatible Det surfaces(if not the same), short propagationfind best RecHit in the Dets, check if good enough, andupdate the state with RecHit informationrestart the procedure with the updated state

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.27/43

Page 28: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

ORCA Exercises

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.28/43

Page 29: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

Exercise

To run the exercise (ie the solution) just do:

wget http://www.pd.infn.it/˜lacaprar/Tutorial/goM

chmod +x goMuon

./goMuon

or goMuon --loc CERN at CERN or goMuon --loc PDin Padova.For code with just comments and hints (to be completed byyou), go to cdORCA 8 0 1/src/MuonAnalysis/MuonTutorial/src/and complete MuonTutorial.cc ex. Then copy it to .cc,compile the library scram b, compile the executablescram b (from test) and run it.

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.29/43

Page 30: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS Ex 1: DT geometryGoal Get number of wires for each DT chamber in centralwheel

Quick description of DT geometry:CMSMuonBarrel: the whole systemhas: � DetLayers, cylinders, aka stations, used fornavigation during track findingMuBarChamber: access to 4D segments (RecHits)each chamber has 3 (2) MuBarSL: access to 2Dsegments (RecHits)each SL has � MuBarLayer: access to SimHits, Digis,Hits (RecHit)each Layer has ������ MuBarWirePossible to navigate from top to bottom in different ways

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.30/43

Page 31: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS DT geometry (II)

Det

MuBarChamber

CompositeDet

MuBarSegment2DPhi

MuBarSegment2D

MuBarLayer

MuBarSL

MuBarRecHitPair

MuBarRecHit

MuBarSegment

1

1

n

1

1

2

1

1,2

11

Detectorsis a

has

RecHits

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.31/43

Page 32: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS DT geometry (III)template in src/MuonTutorial.cc MuonTutorial::printDTGeom()

Access to Dt Geometry via CmsMuon (need MuonLayoutgroup):CmsMuon muonSystem;MuBarrelSetup* mbSetup = muonSystem.DTSetup(const MuBarDetectorMap& map = mbSetup->map()

Access to Dt Geometry via Singleton:MuBarrelSetup* mbSetup =

Singleton<MuBarrelSetup>::instance();const MuBarDetectorMap& map =

mbSetup->map();

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.32/43

Page 33: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS DT geometry (IV)From setup you can access to CMSMuonBarrel andthen to DetLayer reconstruction geometryMuBarrelSetup::CMSMBarrel() If noreconstruction geometry is available (eg if MBLayoutnot loaded), throws exceptionGet dets() again and again until you reach the Layerlevel (3 times) you’ll need to dynamic_cast Det toCompositeDet to use dets()You have a Layer (as a Det), must again cast to useMuBarLayer specific interfaceGet number of wires per Layer (not easy nor efficient!)Or remember that for DT, the Layers are DetUnitGet directly from DetLayers all detUnits()Cast the DetUnit to MuBarLayerEasier, but not efficient (very slow)

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.33/43

Page 34: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS DT geometry (V)Best solution: we need MuBarLayer specific interface, so it’sbetter to get MuBarLayer as such and not as Det

Get a reference to MuBarDetectorMap, which allowsto access the whole DT geometryMuBarrelSetup::map()get all MuBarChamber viaMuBarDetectorMap::chambers()for each chamber, loop through all SL, then all Layerand count wireseach chamber (as well as SL and Layer) have a“name”, MuBarChamberId, via id() method.MuBarChamberId::wheel() gives the wheel ofchamber (������)print nWires only if wheel()==0

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.34/43

Page 35: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

Ex 2: Get RPC SimHitstemplate in MuonTutorial::printRPCSimHits()

For all system, the SimHits are accessible via SimDetA SimDet is accessible from a DetUnitThere are different ways to get all DetUnitsget them via the DetLayers::detUnits()To get DetLayers:

Get Rpc setupGet simplyfied geometry from setupGet DetLayers

As for DT, either via CmsMuon or via SingletonMRpcSetUp* mrpcSetup = muonSystem.RPCSetup();

( ’’ = Singleton<MRpcSetUp>::instance();

CMSMuonRpc* cmsrpc=mrpcSetup->CMSMRpc();

vector<DetLayer*> dls=cmsrpc->allLayers();Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.35/43

Page 36: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS Ex 2: Get RPC SimHits (II)Other methods can be

Get directly all DetUnit via MRpcMap, in turnaccessed as a singletonNavigate through the Rpc geometry in an other (Rpcspecific) way:

get all MRpcDetectors from setupget all MRpcChamber from MRpcDetectors(MRpcDetectors is composed of MRpcChambers,use getComponent(i) method)get all DetUnit from MRpcChamber (again ascomponents): there are 1 to 3 DetUnit for eachchamber, as in reality “chambers”are made by 1 to3 “detectors”

Once we have the DetUnit, we should get the SimDetCheck if the SimDet is really present (in real worldthere are not such a thing as a SimWhatever...)Finally, the SimDet can give us the SimHits

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.36/43

Page 37: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS Ex 2.3: Get CSC Digistemplate in MuonTutorial::printCSCDigis()

CSC geometry

CmsMuonEndcap: collection of DetLayers (disk)MuEndcapSystem (all), MuEndcap (2), MuEndStation

(the disks 4+4), MuEndRing (2 or 4)MuEndChamber: provides 4D segments (RecHit)MuEndLayer (6 for each chamber), provides SimHits,Digis (separately for Wires and Strips) and hits (akacluster) (RecHit)To get the digis we must get all the MuEndLayersCompletely different approach (better?)Use MuEndLayerIterator (almost STL like, Tim isimproving it)

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.37/43

Page 38: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS Ex 2.3: Get CSC Digis (2)As before, get the MuEndSetUp via CmsMuon or viaSingletonGet MuEndSystem from the setupMuEndcapSetUp * setup = muonSystem.CSCSetup(( ’’ =

Singleton<MuEndcapSetUp>::instance(); )MuEndcapSystem * endcapSystem =

setup->MEndcap();

Instantiate a MuEndLayerIterator with the system(the constructor get the system as argument)Iterate over all the layerwhile((MuBarLayer* layer = layerItr.next()))

{...}

Get the DigisThat’s it!

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.38/43

Page 39: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

Ex 4: Print all RecHitstemplate in MuonTutorial::printAllRecHits()

C’mon, it’s the last exercise!

The goal is to print all the RecHits of the 3 systemsFor RPC, the MRpcDetUnit provide the only RecHitsFor the CSC and DT, there is a hierarchy of RecHits, asthere is a hierarchy of DetsCSC: Chamber provides segments, Layers provide HitsDT: Chamber provide 4D segments, SL 2D segments,layer hitsMoreover, the segments are composed RecHits, made ofRecHitsLet’s concentrate on highest level RecHits, ie segmentsfor DT and CSC

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.39/43

Page 40: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS Ex 4: Print all RecHits (II)We already know how to access DT chamber, CSCchamber and Rpc DetUnitsall these object are Det, so have a common interfaceTo get RecHits from a Det, just use Det::recHits()Q: wait! I know that these 2 types of RecHits aredifferent (segment vs hit). How can it be that they are allthe same object (RecHit)??A: good question! They have the same interface, buthave different information. Eg. only the segments havedirection. When used in the Kalman fit, every RecHitprovide information according to what it really is.Print position and direction of DT and CSC, and checkthat direction is not defined for RPC

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.40/43

Page 41: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

HomeworkRepeat ex 1,2,3 for the other 2 sub-systemsPrint also the low level RecHits of CSC and DT

Access them via appropriate Det (MuEndLayer, andMuBarSL/Layer, respectively)Do the same also via the composite RecHit interface(namely via RecHit::recHits()). Do you get the samenumber of RH in both cases? Why?

For a given event, plot the global position of RecHitsand SimHits in �� � and � planes, so to have asimple event displayCompare SimHits and RecHits to get residuals for allsub-systemGet a reconstructed muon (see Norbert tutorial), get allthe Dets which contribute with a RecHit (valid or not),and look if there are other RH in that Det, and how far

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.41/43

Page 42: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

ConclusionThis was an overview of Muon reconstruction software

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.42/43

Page 43: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

ConclusionThis was an overview of Muon reconstruction softwareLot of details have been left out

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.42/43

Page 44: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

ConclusionThis was an overview of Muon reconstruction softwareLot of details have been left outDo you think you could do better?

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.42/43

Page 45: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

ConclusionThis was an overview of Muon reconstruction softwareLot of details have been left outDo you think you could do better?You have idea about major improving?

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.42/43

Page 46: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

ConclusionThis was an overview of Muon reconstruction softwareLot of details have been left outDo you think you could do better?You have idea about major improving?There is a lot of room for improvement and for peoplewilling to contribute!

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.42/43

Page 47: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

ConclusionThis was an overview of Muon reconstruction softwareLot of details have been left outDo you think you could do better?You have idea about major improving?There is a lot of room for improvement and for peoplewilling to contribute!Don’t stay just a user, become a developer!

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.42/43

Page 48: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

ConclusionThis was an overview of Muon reconstruction softwareLot of details have been left outDo you think you could do better?You have idea about major improving?There is a lot of room for improvement and for peoplewilling to contribute!Don’t stay just a user, become a developer!

from CERN Picked up for you:

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.42/43

Page 49: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

ConclusionThis was an overview of Muon reconstruction softwareLot of details have been left outDo you think you could do better?You have idea about major improving?There is a lot of room for improvement and for peoplewilling to contribute!Don’t stay just a user, become a developer!

from CERN Picked up for you:

“You must be the change you want to see in the world”,M.K.Ghandi

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.42/43

Page 50: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

ConclusionThis was an overview of Muon reconstruction softwareLot of details have been left outDo you think you could do better?You have idea about major improving?There is a lot of room for improvement and for peoplewilling to contribute!Don’t stay just a user, become a developer!

from CERN Picked up for you:

“You must be the change you want to see in the CMS”

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.42/43

Page 51: Muon Reconstruction with ORCA - INFN Sezione di Padovalacaprar/talks/TutorialMuon_20040415.pdf · 4/15/2004  · Muon Reconstruction with ORCA ORCA tutorial Stefano Lacaprara Stefano.Lacaprara@pd.infn.it

CMS

ThanksMany thanks to the organizing committee for thisworkshop

In particular Darin for inviting me

Hans and Natalia for technical support at FNAL

Stefano Lacaprara – Workshop on Muon at the LHC and Tevatron, FNAL, thursday, April 15, 2004 – Muon Reconstruction with ORCA – p.43/43