dcms cmssw tutorial - kitekpscheurer/download/dcms_cmssw... · 05.10.2006 cmssw tutorial 10...
TRANSCRIPT
CMSSW Tutorial
DCMS Workshop Karlsruhe
A. Poschlad, A. Scheurer
Karlsruhe, 05.10.2006
O. Oberst, A. Oehler,
Institut für Experimentelle Kernphysik
05.10.2006 CMSSW Tutorial 2
Overview
Introduction
General
CMSSW
Tutorial - Part I
What to do?
• Event Generation
• Vertex Smearing
• Simulation
• Reconstruction
Do it yourself!
Tutorial - Part II
Analysis
• ROOT
• EDAnalyzer
Last Slide
05.10.2006 CMSSW Tutorial 3
Introduction - General
The used tutorial is mainly taken from the CMS Weektutorials held in September 2006.
https://uimon.cern.ch/twiki/bin/view/CMS/WorkBook
It was changed to best fit our needs and cluster setup.
For in-depth information, visit the WorkBook WIKI.
Note: The tutorials are in general only compatiblewith the specified CMSSW versions!
05.10.2006 CMSSW Tutorial 4
Introduction - CMSSW I
This tutorial works with CMSSW_1_0_0 and CMSSW_1_0_1
CMSSW provides the framework for the followingtasks:
Event generation (Interface to various event generators)
Simulation (GEANT, Digitization, etc.)
Reconstruction
Analysis and Visualisation
...
05.10.2006 CMSSW Tutorial 5
Introduction - CMSSW II
Running CMSSW: cmsRun example.cfg
cmsRun only binary
example.cfg specifies the required tasks (modules
to load, parameters to use, datasets, etc.)
available module types:
• Source
• EDProducer
• EDFilter
• EDAnalyzer
• OutputModule
User specific code requires to develop an
EDAnalyzer module type written in C++
CMSSW root-files can be analysed by ROOT as well.
05.10.2006 CMSSW Tutorial 6
Introduction - CMSSW III
CMSSW runtime and build system: scramv1
scramv1:
allows the usage of multiple software versions due to
managing the correct include/library paths
builds the software with its loadable modules
sets up the project area from where CMSSW is run
Useful commands:scramv1 list
scramv1 project CMSSW CMSSW_1_0_1
scramv1 build [--reset]
scramv1 build clean
scramv1 tool list
05.10.2006 CMSSW Tutorial 7
Tutorial - Overview
Modules and parameters can be specified in the.cfg file via:
Explicit declaration (cmsRun Configuration File Language)
Including .cff (Configuration File Fragment) files
Including .cfi (Configuration File Initializer) files, each
module should have one of these
Note: every parameter has to be uniquely set in all includedfiles
Note: to overwrite settings:
replace PythiaSource.maxEvents = 10
05.10.2006 CMSSW Tutorial 8
Tutorial - GenSimDigi
An event generator is needed, e.g. Pythia:include "IOMC/GeneratorInterface/data/PythiaHZZ4mu.cfi"
The Vertex can be smeared:include "IOMC/EventVertexGenerators/data/VtxSmearedGauss.cfi"
if not included, vertex is (0,0,0)
Simulation (GEANT4):include "SimG4Core/Application/data/SimG4Object.cfi"
Digitization:include
"SimG4Core/Application/data/DigiWithEcalZeroSuppression.cff"
Reconstruction:include "Configuration/Examples/data/RECO.cff"
Code Browser:http://cmslxr.fnal.gov/lxr/source/?v=CMSSW_1_0_1
05.10.2006 CMSSW Tutorial 9
Tutorial - Task Order
Modules can be ordered in sequences, e.g.:sequence smear_and_geant = {VtxSmeared, g4SimHits}
Sequences or plain modules have to be specified in a so called "path" which defines the order of execution, e.g.:
path p = {smear_and_geant,digitization,reconstruction}
To write a file, an output path is required, e.g.:endpath outpath = {GEN-SIM-DIGI-RECO}
05.10.2006 CMSSW Tutorial 10
Tutorial - First Steps
# login to our cluster
# set up the environment
source /wlcg/sw/cms/cmsset_default.(c)sh
# make a project
scramv1 project CMSSW CMSSW_1_0_1
cd CMSSW_1_0_1/src
# and set the environment to your working directory
eval `scramv1 runtime -(c)sh`
# setup CVS
cmscvsroot CMSSW
cvs login (Password: 98passwd)
# get FWLite-patch
cvs co –r V00-07-02 FWCore/FWLite
cd FWCore
scramv1 b
05.10.2006 CMSSW Tutorial 11
Tutorial - Example
# checkout the tutorials:
cd ~/CMSSW_1_0_1/src
cvs co -r tutorials_21_sep_06_fix \
UserCode/Blekman/Examples_and_Tutorials/
cp -rf UserCode/Blekman/Examples_and_Tutorials \
ExampleAnalysis
# login to one of our nodes to better balance
# the load on our machines
ssh ekpplus0XX (will be specified per user)
source /wlcg/sw/cms/cmsset_default.(c)sh
cd ~/CMSSW_1_0_1/src/ExampleAnalysis/data
# this directory contains amongst other:
# exampleRunAll.cfg and exampleDump.cfg
# Now run the example
cmsRun exampleRunAll.cfg
# this runs the entire Monte Carlo chain for 20
# Higgs to 4 Muon events.
05.10.2006 CMSSW Tutorial 12
Tutorial - Closer Look
Open the file exampleRunAll.cfg in your favourite
editor.
Go to the LXR Code Browser: http://cmslxr.fnal.gov/lxr/source/?v=CMSSW_1_0_1 and have a look what the included files do.
05.10.2006 CMSSW Tutorial 13
Tutorial - Analysis (DUMP)
A very basic EDAnalyzer to get an overview of thecontents of a generated root-file:
cmsRun exampleDump.cfg
05.10.2006 CMSSW Tutorial 14
Tutorial - Analysis (ROOT)
# return to ekpcms2 ( exit )
# open root
root
# do some library setup
gSystem->Load("libFWCoreFWLite.so");
AutoLibraryLoader::enable();
# open your file
TFile *_file0 = \TFile::Open("exampleRunAllOutput.root");
# open TBrowser to view the file content
TBrowser x;
05.10.2006 CMSSW Tutorial 15
Tutorial - Analysis (EDAnalyzer)
For user specific code:# go to this directory
cd ../ExampleAnalysis
# and compile
scramv1 b
# go back to the data directory
cd ../data
# run the analyzer
cmsRun exampleAnalysis.cfg
# check the output root-file
root ExampleSmallAnalysisOutput.root
TBrowser x;
# if you like to build your own EDAnalyzer,
mkedanlzr myModule
# produces template for the EDAnalyzer framework object
05.10.2006 CMSSW Tutorial 16
Last Slide
Questions?
Answers?
Play around!
A bit more statistics (8000 events):
wget http://www-ekp.physik.uni-karlsruhe.de/~oberst/ExampleHzz4mu.cfg
Download this tutorial:
http://www-ekp.physik.uni-karlsruhe.de/ ~scheurer/download/dcms_cmssw_tutorial.pdf