LCIO, Marlin, Mokka & Druid Manqi 11/08/2014 G4-Mokka - - PowerPoint PPT Presentation

lcio marlin mokka druid manqi 11 08 2014 g4 mokka
SMART_READER_LITE
LIVE PREVIEW

LCIO, Marlin, Mokka & Druid Manqi 11/08/2014 G4-Mokka - - PowerPoint PPT Presentation

A Brief Introduction to ILCSoft: LCIO, Marlin, Mokka & Druid Manqi 11/08/2014 G4-Mokka Training@NanKai U 1 Foreword: This introduction is prepared PURELY from the user's P.o.V 19/10/2013 G4-Mokka Training @ Nankai U 2 Data flow


slide-1
SLIDE 1

11/08/2014 G4-Mokka Training@NanKai U 1

Manqi

A Brief Introduction to ILCSoft: LCIO, Marlin, Mokka & Druid

slide-2
SLIDE 2

19/10/2013 G4-Mokka Training @ Nankai U 2

Foreword:

This introduction is prepared PURELY from the user's P.o.V

slide-3
SLIDE 3

Data flow

slide-4
SLIDE 4

19/10/2013 G4-Mokka Training @ Nankai U 4

ILCSoft:

Over 40 packages with complex dependence... Three core softwares (LCIO, Marlin & Mokka), ~10 useful command

slide-5
SLIDE 5

19/10/2013 G4-Mokka Training @ Nankai U 5

Data flow & Software landscape

Generator Whizard, PYTHIA: Position/ 4 momentum of particles Simulation: Mokka (req: Geant4, Database) Detector Hits Digitization: MarlinReco, etc. eg: G2CD Digitized Detector Hits 径迹重建 MarlinReco,etc. Tracks. Stdhep LCIO root

PFA

Pandora/Arbor Cluster, Recon-Particles Flavor Tagging: LCFIPlus Analysis Marlin, Root Evt Display: Druid LCIO

Physics Result

GDML/Root

slide-6
SLIDE 6

19/10/2013 G4-Mokka Training @ Nankai U 6

A short version dedicated for Training

/home/ihep/Training/env_ilcsoft.sh /home/ihep/ilcsoft/v01-17-05

slide-7
SLIDE 7

19/10/2013 G4-Mokka Training @ Nankai U 7

LCIO: Data format

Path: /home/ihep/ilcsoft/v01-17-05/lcio/v02-04-03 Virtual Box User name: ihep Passwd: cepc

slide-8
SLIDE 8

19/10/2013 G4-Mokka Training @ Nankai U 8

LCIO: Linear Collider I/O

  • Official webpage http://lcio.desy.de/
  • Event information organized into different collections – C++ classes

Read: $LCIO/include/EVENT

Write: $LCIO/include/IMPL

  • A very useful command: dump the data information into text

$LCIO/bin/dumpevent *.slcio $EventNum | less

  • A less useful command: output the general event information and number of
  • bjects in each collection

$LCIO/bin/anajob *slcio | less

slide-9
SLIDE 9

19/10/2013 G4-Mokka Training @ Nankai U 9

LCIO classes

  • Important collections

Generator: MCParticles

Simulated Detector Hits: SimTrackerHit, SimCalorimeterHit

Digitized Hits: TrackerHit, CalorimeterHit

Intermediate reconstructed objects: Vertex, Track, Cluster

Final reconstructed objects: ReconstructedParticle

...

slide-10
SLIDE 10

19/10/2013 G4-Mokka Training @ Nankai U 10

Example: Cluster.h

LCEvent * evtP LCCollection * ClusterColl = evtP ->getCollection(“MyClusterCollection”); Cluster * a_Clu = dynamic_cast<Cluster*>(ClusterColl->getElementAt(#Num)); a_Clu->getSOMETHING()

slide-11
SLIDE 11

19/10/2013 G4-Mokka Training @ Nankai U 11

Dumpevent *slcio EventNumber

slide-12
SLIDE 12

19/10/2013 G4-Mokka Training @ Nankai U 12

Anajob *slcio

Access to Event Header (Simulation software version, steering file) Statistic of number of object in each Collection Small Exercise: anajob will print the Simulation Steering file at the beginning: try to find The detector module name: i.e, ILD_o2_v05/06...

slide-13
SLIDE 13

19/10/2013 G4-Mokka Training @ Nankai U 13

To get a LCIO file

  • Generator:

– Marlin can convert the stdhep files into lcio files with only

MCParticle collection

  • Simulation:

– Mokka: Geant4 based full simulation software

  • Real data:

– Raw data: DAQ software can use LCGenericObject to store the

ADC counts, Cell ID...

  • Reconstruction:

– Real data: converted into detector hits – Simulated hits: converted Digitized detector hits – Detector hits then be reconstructed into other objects

slide-14
SLIDE 14

19/10/2013 G4-Mokka Training @ Nankai U 14

Mokka: Full Simulation

slide-15
SLIDE 15

19/10/2013 G4-Mokka Training @ Nankai U 15

Mokka

  • Mokka:

– Geant 4 based Full Simulation package: organize virtual

volume/material into virtual detector

– Supports lots of detector geometries – Depend on mysql database: store geometry information

  • Official Servers at IHEP, France, Germany.
  • You can also create your own db (see Emilia's talk)
  • Usage:

– Event: particle gun/generator – Select/edit geometry – Output: lcio data file, gear/gdml geometry description file

slide-16
SLIDE 16

19/10/2013 G4-Mokka Training @ Nankai U 16

Mokka steering

Specify event type/statistics Select/edit geometry Specify mysql database server Specify IO... cd $Training/Simulation vim Muon1mm.sh

slide-17
SLIDE 17

19/10/2013 G4-Mokka Training @ Nankai U 17

sh ./MyLaunchMokka.sh

slide-18
SLIDE 18

19/10/2013 G4-Mokka Training @ Nankai U 18

Exercise: have fun with Druid...

Wait for sometime... then do

Druid Muplus_10GeV.slcio

slide-19
SLIDE 19

19/10/2013 G4-Mokka Training @ Nankai U 19

Marlin: Data manager

slide-20
SLIDE 20

19/10/2013 G4-Mokka Training @ Nankai U 20

Marlin

  • Marlin:

– LCIO data Manager – Reconstruction/Analysis framework – More than half of the ilc soft packages are Reconstruction

modules that can be used by Marlin

  • Typical functions:

– Read LCIO informations and write it into root files: More

details in Xiangyu's talk

– Reconstructions: read lcio data, reconstruct into new

  • bjects, add new collections into the same data: dedicated

examples will be presented.

slide-21
SLIDE 21

19/10/2013 G4-Mokka Training @ Nankai U 21

Usage of Marlin

  • Write/Modify your own reconstruction/analysis code
  • Cmake: create a makefile according to its dependency

cd $MyAnalyis mkdir build cd build cmake -C $ILCSoft/ILCSoft.cmake ..

– Makefile can be reused

  • Compile your own code into Marlin Libraries

make make install

slide-22
SLIDE 22

19/10/2013 G4-Mokka Training @ Nankai U 22

Usage of Marlin

  • Load the library to Marlin by setting the environment variable MARLIN_DLL
  • Control your module with steering file:

Useful command: print the reference steering file/verify if your module is properly loaded $MARLIN/bin/Marlin -l or $MARLIN/bin/Marlin -x

To execute: $MARLIN/bin/Marlin mymodule.steer

slide-23
SLIDE 23

19/10/2013 G4-Mokka Training @ Nankai U 23

Example: Convert stdhep file into lcio

$Training/Analysis/StdhepReader/conv.steer

slide-24
SLIDE 24

19/10/2013 G4-Mokka Training @ Nankai U 24

MCParticle collection in the generator

MCParticle List of a ffH events: ZH with Z->tautau and H->ZZ* Marlin conv1.steer dumpevent Pffh_RL_005.slcio 1 | less

slide-25
SLIDE 25

19/10/2013 G4-Mokka Training @ Nankai U 25

Full Simulation: Edit, verify/validation of new detector geometry

slide-26
SLIDE 26

19/10/2013 G4-Mokka Training @ Nankai U 26

Edit geometry with Mokka

By using globalModelParameter... $Training/Simulation/Geocooking/GeoHZ.macro

slide-27
SLIDE 27

19/10/2013 G4-Mokka Training @ Nankai U 27

Exercise 2: dump Geometry

cd $Training/Simulation/Geocooking/ Mokka -U GeoHZ.macro Type following command here: Mokka/Visu/Detector/DumpGDML Then, you will get a file named World.gdml Do: root -l Geo.C

slide-28
SLIDE 28

19/10/2013 G4-Mokka Training @ Nankai U 28

Init Mokka with geometry macro, and dump gdml file out

Launch Mokka: Mokka -U GeoHZ.macro

slide-29
SLIDE 29

19/10/2013 G4-Mokka Training @ Nankai U 29

If root is compiled with gdml option...

slide-30
SLIDE 30

19/10/2013 G4-Mokka Training @ Nankai U 30

Therefore, you should be able to find...

slide-31
SLIDE 31

19/10/2013 G4-Mokka Training @ Nankai U 31

TPC Radius changed: from 1808 to 1365mm

Geometry could/should also be Xchecked from Hit Map

HitMap: scan your detector with lots of particle gun events, read the hit positions...

slide-32
SLIDE 32

19/10/2013 G4-Mokka Training @ Nankai U 32

Not a exercise

Try to do: Druid *.slcio *.root The root file is geometry file: you have plenty of them located at $DRUID/geometryfile

slide-33
SLIDE 33

19/10/2013 G4-Mokka Training @ Nankai U 33

I am the exercise

Use the generator file as input

/home/ihep/Training/Analysis/StdhepReader/E250-TDR_ws.Pnnh.Gwhizard-1_95.eL.pR.I106483.004.stdhep

Edit your geometry by changing TPC radius & Half Z to some reasonable value you like; Simulate several physical event with new geometry Get a event display wi/wo the geometry

slide-34
SLIDE 34

19/10/2013 G4-Mokka Training @ Nankai U 34

Example Marlin Process: To make Hitmap

$Training/Analysis/AnaGeo/

slide-35
SLIDE 35

19/10/2013 G4-Mokka Training @ Nankai U 35

PrintHit Header

slide-36
SLIDE 36

19/10/2013 G4-Mokka Training @ Nankai U 36

Define the steering parameters

slide-37
SLIDE 37

19/10/2013 G4-Mokka Training @ Nankai U 37

Steering of Marlin Module

slide-38
SLIDE 38

19/10/2013 G4-Mokka Training @ Nankai U 38

Define the output root file

slide-39
SLIDE 39

19/10/2013 G4-Mokka Training @ Nankai U 39

Event loop: fill your root file

...

slide-40
SLIDE 40

19/10/2013 G4-Mokka Training @ Nankai U 40

Read the data: use lcio class

slide-41
SLIDE 41

19/10/2013 G4-Mokka Training @ Nankai U 41

Output the root file

slide-42
SLIDE 42

19/10/2013 G4-Mokka Training @ Nankai U 42

Usage of Marlin

  • Write/Modify your own source code
  • Generate the make file using Cmake:

cd $AnaGeo mkdir build cd build HFcmake ( = cmake -C $ILCSoft.cmake ..)

  • Compile

make install

  • Load your module to Marlin: export the Marlin_LDD variable

cd $AnaGeo . loadLDD.sh

slide-43
SLIDE 43

19/10/2013 G4-Mokka Training @ Nankai U 43

CMake

slide-44
SLIDE 44

19/10/2013 G4-Mokka Training @ Nankai U 44

Make install

slide-45
SLIDE 45

19/10/2013 G4-Mokka Training @ Nankai U 45

Usage of Marlin

  • Load the library to Marlin by setting the environment variable MARLIN_DLL
  • Control your module with steering file:

Useful command: print the reference steering file/verify if your module is properly loaded $MARLIN/bin/Marlin -l or $MARLIN/bin/Marlin -x

To execute: $MARLIN/bin/Marlin mymodule.steer

slide-46
SLIDE 46

19/10/2013 G4-Mokka Training @ Nankai U 46

Run

slide-47
SLIDE 47

19/10/2013 G4-Mokka Training @ Nankai U 47

Summary

  • 40 packages, ~10 commands.
  • LCIO: data format
  • Marlin: data manger
  • Mokka: Geant4 Full Simulation
slide-48
SLIDE 48

19/10/2013 G4-Mokka Training @ Nankai U 48

Important Executable

  • LCIO: dumpevent, anajob
  • Mokka: sh ./MuonSimu.sh
  • Marlin:

Usage:

  • loadLDD.sh
  • Marlin -l
  • Marlin Mysteer.steer

Compile:

  • Cmake: Hfcmake = cmake -C ILCSoft.cmake .
  • Make install
  • Druid: Druid *.slcio *gdml.root
slide-49
SLIDE 49

19/10/2013 G4-Mokka Training @ Nankai U 49

Homework: Event Display

  • Explore Druid, using hotkeys (w, e, r, j, k), your mouse, and

...

  • Snapshot/Save with whatever geometry, whatever data

sample (better matched with geometry) and whatever style

  • Send your favorite Event Display to

(the mail should be named “Event display at Nankai Training”)

Manqi.ruan@ihep.ac.cn

slide-50
SLIDE 50

19/10/2013 G4-Mokka Training @ Nankai U 50

Backup

slide-51
SLIDE 51

19/10/2013 G4-Mokka Training @ Nankai U 51

Hit Map: Ecal

Index M: Module number: Ecal/Hcal Barrel is divided into 5 modules along Z direction.

slide-52
SLIDE 52

19/10/2013 G4-Mokka Training @ Nankai U 52

Hit Map: Hcal Barrel

A la videau structure

slide-53
SLIDE 53

19/10/2013 G4-Mokka Training @ Nankai U 53

Hit Map: Hcal Endcap

slide-54
SLIDE 54

19/10/2013 G4-Mokka Training @ Nankai U 54

HitMap: Muon

No obvious defect tagged.