24
(too) Short (too) Short Introduction to Introduction to O O bject-oriented bject-oriented R R econstruction for econstruction for C C MS MS A A nalysis nalysis July 13 July 13 th th , 2004 , 2004 Hannes Sakulin – HEPHY Vienna, Austria (for Stephan Wynhoff)

(too) Short Introduction to O bject-oriented R econstruction for C MS A nalysis

  • Upload
    reya

  • View
    36

  • Download
    0

Embed Size (px)

DESCRIPTION

(too) Short Introduction to O bject-oriented R econstruction for C MS A nalysis. July 13 th , 2004 Hannes Sakulin – HEPHY Vienna, Austria (for Stephan Wynhoff ). What is ORCA ?. O bject-oriented R econstruction for C MS A nalysis Large CMS Software Project - PowerPoint PPT Presentation

Citation preview

Page 1: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

(too) Short (too) Short Introduction toIntroduction toOObject-oriented bject-oriented

RReconstruction for econstruction for

CCMS MS

AAnalysisnalysisJuly 13July 13thth, 2004, 2004Hannes Sakulin – HEPHY Vienna, Austria

(for Stephan Wynhoff)

July 13July 13thth, 2004, 2004Hannes Sakulin – HEPHY Vienna, Austria

(for Stephan Wynhoff)

Page 2: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -2- Introduction for Summer Students, July 13th, 2004

What is ORCA ? Object-oriented Reconstruction for CMS Analysis Large CMS Software Project

> 500 000 lines of C++ (not counting COBRA) developed by a large international collaboration

Tasks Simulation of detectors and electronics Event Reconstruction (both offline and high level trigger) Analysis

ORCA is in rapid development Try to use the latest and greatest: Current version: 8_2_0

Starting point: http://cmsdoc.cern.ch/orca

Page 3: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -3- Introduction for Summer Students, July 13th, 2004

HEPEVTNtuple

ORCA 8

Ntuplesignal

Ntupleminbias

POOLSimHits/minbias

POOLSimHits/signal POOL

DigisDST

OSCAR SimReader RecReader

MC generator

CMKIN

Production

Production User

OSCAR 3

The Analysis Chain

1)digitization

“data summary tape”

ROOTTree

RecReader

3)analysis2)reconstruction

NEW

Pool Of persistent Objects for LHC

Page 4: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -4- Introduction for Summer Students, July 13th, 2004

1) Digitization: from Hits to Digis Output of Simulation (OSCAR) are Hits

Position, where a particle entered a sensitive detector volume Direction of the particle, Exit point of the particle Energy deposited (exact format depends on detector type)

ORCA simulates reaction of detectors to the passing particle E.g. ionization of gas in drift tube muon chamber, drift of

particles to wire, avalanche, signal Detector electronics (analog to digital conversion, data

compression, …) Parameterizations of actual processes used Also includes full emulation of Level-1 Trigger electronics Result: Digis

Digis are like the raw data that will come out of the experiment!!!

Page 5: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -5- Introduction for Summer Students, July 13th, 2004

At high LHC luminosity an average of 17 interactions occur in the same bunch crossing

Detector response is slower than 25ns: also have to consider interactions before and after Overlay crossings -5 to +3

~200 “minimum bias” events added to 1 signal event (before digitization)

1) Digitization: adding Pileup

Single interaction

Interaction + pile-up

POOLSimHits/minbias

POOLSimHits/signal POOL

DigisORCADigitization

1

~ 200 ( recycle)

Page 6: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -6- Introduction for Summer Students, July 13th, 2004

2) Reconstruction ORCA does Reconstruction of Raw Detector Data (or the Digis) in

several steps

1) Detector-specific processing Data unpacking, cluster finding, hit reconstruction, tracking,

applying calibration constants

2) Global Tracking include hits from different subsystems, e.g. Tracker and Muon System for muons

3) Vertex Finding Bases on Tracks found in the previous step

4) Particle Identification Physics Objects Produce objects used in physics analyses: electrons, photons, muons, jets, …

Both Offline Reconstruction / and High-Level Trigger reconstruction

Similar algorithms, but offline algorithms may consume more time, may use more calibration constants, …

Can save output of reconstruction: DSTs (“Data Summary Tapes”)

Page 7: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -7- Introduction for Summer Students, July 13th, 2004

Reconstruction on Demand Action on demand is a powerful tool to manage the order in

which things are done, and to avoid doing things that you don’t need to do

Algorithms register with the framework “I can produce Tracks of type T1”

Algorithms are only called when the user requests them or when another Algorithm needs them

E.g. User wants tracks of type T1 E.g. User want vertices and vertex algorithm needs Tracks T1

When results are available (in cache or persistent storage), just return the results

Otherwise run the algorithm and save results in cache If the same results are needed again, the algorithm is not run

again

Page 8: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -8- Introduction for Summer Students, July 13th, 2004

Reconstruction on Demand

RecUnitClusterA

RecUnitCrystal

ClusterAlgoA

Analysisprogram

ClusterAlgoB

Cl1 Cl2 Cl3 Cl4

K1

K2

K3

K4

K5

K6

K7

K8

K9

K10

K11

K12

K13

K14

K15

K16

RecUnitClusterB

Cl1 Cl2 Cl3

Page 9: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -9- Introduction for Summer Students, July 13th, 2004

Using ORCA

Page 10: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -10- Introduction for Summer Students, July 13th, 2004

Creating a Working Area login with your CMS account (group zh) cd $SCRATCH

can also work on AFS workspace or AFS scratch scram listcompact ORCA

[…]ORCA ORCA_8_2_0 /afs/cern.ch/cms/Releases/ORCA/ORCA_8_2_0

scram project ORCA ORCA_8_2_0 new directory ORCA_8_2_0 with subdirectories

src, config, tmp, logs cd ORCA_8_2_0/src eval `scram runtime –csh` rehash

Ready to use pre-compiled executables

Set environment variablesRebuild hash table of executables

Page 11: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -11- Introduction for Summer Students, July 13th, 2004

Standard Executables ORCA can be used in many different ways

Data can be processed in steps ( Digitization, Reconstruction,… )

Many different executables exist Standard executables Test executables You can make your own executables (e.g. in Workspace)

Standard Executables from Examples/ExProduction writeAllDigis (read hits, digitize, write digis) writeDST (read digis, reconstruct, write DST)

Standard Executables from Examples/Statistics ExSimHitStatistics, ExDigiStatistics, ExDSTStatistics

Page 12: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -12- Introduction for Summer Students, July 13th, 2004

Example 1: from Hits to Digis Log into CVS

cmscvsroot ORCA; cvs login (password: 98passwd) Check out the code from CVS (in ORCA_8_2_0/src)

cvs co –r Summies04 Example/ExProduction cd Examples/ExProduction

Set the parameters writeAllDigis-Tutorial04.orcarc

Page 13: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -13- Introduction for Summer Students, July 13th, 2004

.orcarc

MaxEvents = 5

InputCollections = /System/StW752SimHits/h300eemm/h300eemmOutputDataSet = /System/HSDigis/h300eemm

# - minbias as 2x10^33 s^-1 cm^-2 ----------------------------PUGenerator:Collection = /System/StW752SimHits/minbias03/minbias03PUGenerator:AverageEvents = 3.5PUGenerator:MinBunch = -5 PUGenerator:MaxBunch = 3PUGenerator:FirstEvent = -2

GoPersistent = true

#-- database technicalities ---------------------------------- DBPopulator:CommitInterval = 15DBPopulator:MaxDBSize = 1.5..

MaxEvents = 5

InputCollections = /System/StW752SimHits/h300eemm/h300eemmOutputDataSet = /System/HSDigis/h300eemm

# - minbias as 2x10^33 s^-1 cm^-2 ----------------------------PUGenerator:Collection = /System/StW752SimHits/minbias03/minbias03PUGenerator:AverageEvents = 3.5PUGenerator:MinBunch = -5 PUGenerator:MaxBunch = 3PUGenerator:FirstEvent = -2

GoPersistent = true

#-- database technicalities ---------------------------------- DBPopulator:CommitInterval = 15DBPopulator:MaxDBSize = 1.5..

Setting Parameters: orcarc files

To save the digis

Number of events Signal Hits (input!)

Pile-up Hits (minimum bias)

Digis (the output)

Many more parameters follow (to understand all these is a scientific discipline by itself)

writeAllDigis-Tutorial04.orcarc

Attention: The file .orcarc in the current directory is always read and used. Specify any other orcarc file with the –c option.

Page 14: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -14- Introduction for Summer Students, July 13th, 2004

Example 1: from Hits to Digis (cont’d)

Log into CVS cmscvsroot ORCA; cvs login (password: 98passwd)

Check out the code from CVS (in ORCA_8_2_0/src) cvs co –r Summies04 Example/ExProduction cd Examples/ExProduction

Set the parameters writeAllDigis-Tutorial04.orarc

Copy a POOL File Catalog to the local dir cp /afs/cern.ch/cms/OO/Reconstruction/catalog/PoolFileCatalog_8_2_0.xml

PoolFileCatalog.xml

(We use the default test datasets)

Page 15: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -15- Introduction for Summer Students, July 13th, 2004

.

. <File ID="72F3C417-5264-D811-82F5-0007E924923D"> <physical> <pfn filetype="ROOT_All" name="rfio:/castor/cern.ch/cms/reconstruction/datafiles/ORCA_7_5_2/EVD2_Hits.ff83cd88645111d882f50007e924923d.123.h300eemm.StW752SimHits"/> </physical> <logical> <lfn name="EVD2_Hits.ff83cd88645111d882f50007e924923d.123.h300eemm.StW752SimHits"/> </logical> <metadata att_name="DBoid" att_value="[DB=72F3C417-5264-D811-82F5-0007E924923D][CNT=.master][CLID=7D721C8E-530D-608F-BFD9-70E61D0F1EB5][TECH=00000201][OID=00000003-00000000]"/> <metadata att_name="DataType" att_value="EVD"/> <metadata att_name="FileCategory" att_value="Hits"/> <metadata att_name="dataset" att_value="h300eemm"/> <metadata att_name="jobid" att_value="ff83cd88645111d882f50007e924923d"/> <metadata att_name="owner" att_value="StW752SimHits"/> <metadata att_name="runid" att_value="123"/> </File>..

.

. <File ID="72F3C417-5264-D811-82F5-0007E924923D"> <physical> <pfn filetype="ROOT_All" name="rfio:/castor/cern.ch/cms/reconstruction/datafiles/ORCA_7_5_2/EVD2_Hits.ff83cd88645111d882f50007e924923d.123.h300eemm.StW752SimHits"/> </physical> <logical> <lfn name="EVD2_Hits.ff83cd88645111d882f50007e924923d.123.h300eemm.StW752SimHits"/> </logical> <metadata att_name="DBoid" att_value="[DB=72F3C417-5264-D811-82F5-0007E924923D][CNT=.master][CLID=7D721C8E-530D-608F-BFD9-70E61D0F1EB5][TECH=00000201][OID=00000003-00000000]"/> <metadata att_name="DataType" att_value="EVD"/> <metadata att_name="FileCategory" att_value="Hits"/> <metadata att_name="dataset" att_value="h300eemm"/> <metadata att_name="jobid" att_value="ff83cd88645111d882f50007e924923d"/> <metadata att_name="owner" att_value="StW752SimHits"/> <metadata att_name="runid" att_value="123"/> </File>..

Physical file name Physical file name (you may need to edit this,(you may need to edit this,if you are moving the data)if you are moving the data)

What is in a POOL File Catalog ?XML file that knows where all the data files are.

PoolFileCatalog.xml needs to be in current directory(or have to specify location via InputFileCatalogURL parameter in orcarc)

Page 16: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -16- Introduction for Summer Students, July 13th, 2004

Example 1: from Hits to Digis (cont’d)

Log into CVS cmscvsroot ORCA; cvs login (password: 98passwd)

Check out the code from CVS (in ORCA_8_2_0/src) cvs co –r Summies04 Example/ExProduction cd Examples/ExProduction

Set the parameters writeAllDigis-Tutorial04.orarc

Copy a POOL File Catalog to the local dir cp /afs/cern.ch/cms/OO/Reconstruction/catalog/PoolFileCatalog_8_2_0.xml

PoolFileCatalog.xml (We use the default test datasets)

Run the Executable (do not need to compile) writeAllDigis -c writeAllDigis-Tutorial04.orcarc |& tee

wd1.out Will produce Digis (attention: big files)

Page 17: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -17- Introduction for Summer Students, July 13th, 2004

BuildFile## This is to write RecHits/Digis into a DB#<environment> <ignore> To produce Calorimetry digis</ignore> <Group name=CaloHitReader> <Group name=CaloRHitWriter> <Group name=CaloRHitReader> <Group name=TriggerPrimitiveWriter> <Use name=Calorimetry>

<ignore> To produce all Muon digis </ignore> <Group name=MuonDigiWriter> <Use name=CommonReco> <Use name=Muon>

<ignore> To produce Tracker digis </ignore> <lib name=DDDInterface></lib> <lib name=TkHitLoader></lib> <Group name=TkOscarReader> <Group name=TkDigiWriter> <Use name=Tracker>

<ignore> To store L1 global trigger </ignore> <Group name=L1TRIGGER> <Use name=Trigger>

<Group name=G3> <Group name=SimReader> <external ref=COBRA Use=CARF>

<bin file=writeAllDigis.cpp></bin></environment>

## This is to write RecHits/Digis into a DB#<environment> <ignore> To produce Calorimetry digis</ignore> <Group name=CaloHitReader> <Group name=CaloRHitWriter> <Group name=CaloRHitReader> <Group name=TriggerPrimitiveWriter> <Use name=Calorimetry>

<ignore> To produce all Muon digis </ignore> <Group name=MuonDigiWriter> <Use name=CommonReco> <Use name=Muon>

<ignore> To produce Tracker digis </ignore> <lib name=DDDInterface></lib> <lib name=TkHitLoader></lib> <Group name=TkOscarReader> <Group name=TkDigiWriter> <Use name=Tracker>

<ignore> To store L1 global trigger </ignore> <Group name=L1TRIGGER> <Use name=Trigger>

<Group name=G3> <Group name=SimReader> <external ref=COBRA Use=CARF>

<bin file=writeAllDigis.cpp></bin></environment>

writeAllDigis

Reading of SimHits

The BuildFile

Calo

Muons

Tracker

L1 Trigger

Source for theexecutable

The BuildFile is used when building an executable (or a library) with scram

Page 18: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -18- Introduction for Summer Students, July 13th, 2004

Example 2: Reading DIGIs Example – Examples/Statistics/ExDigiStatistics

echo “InputCollections = /System/HSDigis/h300eemm” > readdigis.orarc

ExDigiStatistics –c readdigis.orcarc |& tee ds1.out

This will read the digis and print some information…

<environment>

<Group name=MuonDigiReader> <Use name=Muon>

<Group name=TrackerDigiReader> <Use name=Tracker>

<Group name=CaloRecHitReader> <Use name=Calorimetry>

<Group name=G3> <Group name=RecReader> <external ref=COBRA Use=CARF>

<bin file=ExDigiStatistics.cpp></bin></environment>

<environment>

<Group name=MuonDigiReader> <Use name=Muon>

<Group name=TrackerDigiReader> <Use name=Tracker>

<Group name=CaloRecHitReader> <Use name=Calorimetry>

<Group name=G3> <Group name=RecReader> <external ref=COBRA Use=CARF>

<bin file=ExDigiStatistics.cpp></bin></environment>

reading of digitized events

The BuildFile needed to read digis (from Examples/Statistics/BuildFile)

Calo

Muons

Tracker

Page 19: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -19- Introduction for Summer Students, July 13th, 2004

The Workspace cd ../ORCA_8_2_0/src

cvs co –r ORCA_8_2_0 Workspace

cd Workspace

scram build

eval `scram runtime –csh`

rehash

ExRunEvent (this executable is using parameters in .orcarc)

Page 20: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -20- Introduction for Summer Students, July 13th, 2004

Working with YOUR code cd …/ORCA_8_2_0/src/Workspace BuildFile

selects the libraries to use for each executable ExRunEventInfo.h, ExRunEventInfo.cc

the real code. You can put your code here.

class ExRunEventInfo : private Observer<G3EventProxy *> {

ExRunEvent.cppregistration of ExRunEvent to the Framework

.orcarcwhere to find the data and more parameters

Page 21: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -21- Introduction for Summer Students, July 13th, 2004

Access to Higher Objects Object are stored in RecCollections

These may be stored in the DSTs (much faster) Reconstructed Muons

Reconstructed Electrons

Try Training Lecture 3 on the ORCA page! (under Tutorials)

RecQuery q("<Name of Reconstructor>");RecCollection<RecMuon> theCollection(q);for (RecCollection<RecMuon>::const_iterator it = theCollection.begin(); it != theCollection.end(); ++it)cout << "Muon: " << (**it) << endl;

RecQuery q("<Name of Reconstructor>");RecCollection<RecMuon> theCollection(q);for (RecCollection<RecMuon>::const_iterator it = theCollection.begin(); it != theCollection.end(); ++it)cout << "Muon: " << (**it) << endl;

#include “ElectronPhoton/EgammaOfflineReco/interface/OfflineElectronReco.h”RecCollection<ElectronCandidate> theCollection(OfflineElectronReco::defaultQuery());for (RecCollection<ElectronCandidate>::const_iterator it = theCollection.begin(); it != theCollection.end(); ++it)cout << ”Electron: " << (**it) << endl;

#include “ElectronPhoton/EgammaOfflineReco/interface/OfflineElectronReco.h”RecCollection<ElectronCandidate> theCollection(OfflineElectronReco::defaultQuery());for (RecCollection<ElectronCandidate>::const_iterator it = theCollection.begin(); it != theCollection.end(); ++it)cout << ”Electron: " << (**it) << endl;

For example:For example:GlobalMuonReconstructor

orL3MuonReconstructor

Can also add Can also add parametersparametersto the RecQueryto the RecQuery

Page 22: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -22- Introduction for Summer Students, July 13th, 2004

RecCollections available in DSTs DSTs contain reconstructed objects for“users”

Level-1 Trigger infoHLT info

CombinatorialTrackFinderPixelTrackFinderFromTripletsPrincipalVertexFinderCombinedBTagging

EGCandL2EGCluster/EGBCluster/EGSClusterEGEClusterEGHLTelectron/photonEPTracks/EGPhotons/EGElectronsEGcalibrationEGofflineCandidatesOfflineElectron, OfflinePhoton

MET-L1Trigger

METfromCaloRecHits/EPHTowers

METfromIterConeJets/KtJets

RecJet-Itercone0.5/0.7

RecJet-Ktrecom1/4

TowerBuilder (EcalPlusHcalTowers)

StandAloneMuonReconstructor

GlobalMuonReconstructor

L2MuonReconstructor

L3MuonReconstructor

MuonCaloEffIsolator

MuonCaloEtIsolator

MuonTkEffIsolator

MuonTkPtIsolator

Page 23: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -23- Introduction for Summer Students, July 13th, 2004

Documentation The main ORCA pages are at http://cmsdoc.cern.ch/orca

This should be you first resource for finding information.

Two types of Documentation UserGuide

Introduction, general description (200 pages) ReferenceManual

all classes documented, web based and semi-automatically produced, where you can delve into the details

Tutorials CVS Browser of all sources …

Page 24: (too) Short Introduction to O bject-oriented  R econstruction for  C MS  A nalysis

H. Sakulin, HEPHY Vienna: ORCA -24- Introduction for Summer Students, July 13th, 2004

The END Much more to learn Read the UserGuide first! Ask your colleagues Ask your supervisor Check http://cmsdoc.cern.ch/orca

Read the FAQ Problems: https://savannah.cern.ch/projects/orca

Ask question one the ORCA-feedback mailing list [email protected]

ORCA is not easy, not consistent, not complete but it is mostly working!

Try to enjoy using it!