Event Generation Gloria Corti CERN LHCb Software Tutorial

Download Report

Transcript Event Generation Gloria Corti CERN LHCb Software Tutorial

LHCb Software Tutorial
Updated on 13 July 2007
Event Generation
Gloria Corti
CERN
Gauss Tutorial
Outline



Overview of Event generation
Purpose: reminder
Elements of generation



External libraries
Event types


hints for generating a new signal sample and controlling decay
Generator studies and high statistic samples


structure and various tasks: accelerator conditions,
production of pp collisions, decays
random number seeds, asking for a production
Output Data

HepMC
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 2
Purpose: a reminder

For Generator phase of Gauss



Data produced can be studied directly or in further
processing



generation of proton-proton collisions
decay of particles with special attention to those of b-hadrons
GenCollisions (Global generator event information)
HepMCEvents (Generator event with particles and vertices)
Output (.sim ) can be processed by Gauss simulation
phase if produced alone, if in a complete Gauss job
Boole will not use the generator information but will
“propagate it” to Brunel  DaVinci
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 3
Event Generator Phase as stand-alone Gauss job

Gauss normally run in a single job with all phases




Generator phase can be run by itself to do studies at
Generator level




Detector physics simulation is quite time consuming
Require production system resources for reasonable statistic
No more than few hundred (500) events can be produced in a
single job
Faster → reasonable statistics can be produced for signal
samples by anyone
Very useful when introducing generator features or looking at
at production mechanisms or decay channels for the first time
Must do it BEFORE introducing a new decay channel in a
Gauss release and asking the Production Team for events to
be produced with Gauss → Boole → Brunel chain
You will run generator stand-alone jobs in this
following practical section
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 4
Job Options – Gauss.opts Generator Stand alone
//----------------------------------------------------------------// Phases to be executed:
//----------------------------------------------------------------ApplicationMgr.TopAlg += { "GaudiSequencer/Generator" };Commented
// ApplicationMgr.TopAlg += { “GaudiSequencer/Simulation” };
//----------------------------------------------------------------// Generator Phase
Uncomment for
//----------------------------------------------------------------writing out only
#include "$GAUSSOPTS/Generator.opts“
generator event
Generator.MeasureTime = true;
// When running Generator stand-alone uncomment the following
// to write on tape only Generator objects
#include "$GAUSSOPTS/GenStandAlone.opts“
//----------------------------------------------------------------// Simulation Phase
Commented !
//----------------------------------------------------------------// #include "$GAUSSOPTS/Simulation.opts"
// Simulation.MeasureTime = true;

!
A generator stand-alone Gauss job can be run with Gauss.opts or
v200601.opts – the geometry is irrelevant !
 ../slc3_ia32_gcc323/Gauss.exe $GAUSSOPTS/Gauss.opts
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 5
Stand alone Event Generation
Monitor
JobOpts
JobOpts
Init
Interface
HepMC
Cnv
Pythia,
EvtGen
…
POOL
Event Generation
Cnv
Initialize
GiGa
Geant4
HepMC
MCParticle
MCVertex
MCHits
Monitor
Cnv
Geometry
POOL
Detector Simulation
geometry of the detector (LHCb  Geant4)
primary event generator
specialized decay package tracking through materials (Geant4)
hit creation and MC truth information (Geant4 
pile-up generation
LHCb)
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 6
Event Generator Phase

Necessary to generate events for different purposes




Physics Events

feasibilities of some physics analysis in LHCb
understand detector performance and evaluate changes in
detector design
test beam analysis
LHCb real data physics analysis
Need different type of “events”





Single pp-collisions and bunch crossing at different
luminosities (pile-up)
Minimum bias
Generic beauty (and charm) events
“Signal” events: b-mesons family in many decay modes but
also b-hadrons, open charm, heavy quarkonia, Higgs, Z0, etc.
etc. etc.
Particle guns (calibration, test beams, single beam in IP8)
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 7
Elements of generation of physics events

Generation algorithm uses tools, i.e. small pieces of
code realizing small and specific actions of the
generation sequence:








PileUpTool – Generation of number of pile-up events
SampleGenerationTool – generate a given sample of events
(minimum bias, inclusive, signal, …)
ProductionTool – Generation of one p-p interaction
BeamTool – Generation of beam parameters (3
momentum)
DecayTool – Decay of unstable particles,
CutTool – Cut at generator level,
FullGenEventCutTool – Cut on full event properties,
VertexSmearingTool – Smearing of primary vertex.
Generator.Members
= { "Generation" };
Software Tutorial - Gauss - Last update: 10 October 2007
Generator.opts
Event Generation - Page 8
Generator Tools


Each tool has a generic interface and a specific
implementation: this allows to use different methods to
realize each action. For example, generation of p-p
interactions can be done with Pythia or HERWIG,
without changing anything else.
New in DC06 versions – easier to add a new generator
engine or cuts for specific samples



A large amount of code is common when using Pythia or
Herwig and then do not have to be rewritten.
New ideas (for generator level cuts, …) can be inserted quickly
in Gauss since it is just a matter of adding a small piece of
code and do not require to change the whole software.
Details on the web:

http://lhcb-comp.web.cern.ch/lhcb-comp/Simulation/generators.htm
(Gauss → Generators)
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 9
ProductionTool
IProductionTool
Abstract Interface
generateEvent( HepMC )
setStable()
save/loadPartonEvent()
turnOn/OffHadronization()
PythiaProduction
Concrete Implementations
Interface to Pythia with possibility to
interact with Pythia common blocks
via job options.
HerwigProduction
BcVegPyProduction
SHERPAProduction
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 10
External libraries

The functionality in the tools is implemented by external libraries
available in the physics community

controllable via property of the tools
Generation.MinimumBias.PythiaProduction.Commands = {
"pysub msel 1" };

Default engines used in Gauss v25r12


Pythia generates pp interactions up to hadronization and some
decays (main-stream generator)
LHAPDF generate the parton distributions inside the colliding protons


EvtGen generate the decay and evolution of all particles



called by Pythia
B hadrons, generic and user/signal tables
delegate to Pythia when decay not present in decay table (called internally)
Photos implements QED radiative corrections


used for all kind of decays
called by EvtGen
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 11
External libraries used in Gauss v24r7

Most external libraries for generator phase out of the box from GENSER
1.4.1 (LCG application area Generator Services)






Pythia 6.325.2
PHOTOS 2.15.2
LHAPDF 4.2 (use CTEQ6L)
HERWIG 6.510.2 (and JIMMY 4.2.2)
Documentation on the web
by authors from Gauss

available for validation and development
doxygen but look first on
HepMC 1.26

uses CLHEP,
how it is controllable and

two libraries: one for Event classes, the other interfaces
to HepEVT
IO to
interfaced
tofor
Gauss
FORTRAN generator libraries
Specialized libraries maintained by LHCb

EvtGen

modified by P.Robbe for hadron machine with additional models including for Lb
decays
– from a–00–11–07, D.Lange & A.Rys for Babar

BcVegPy 2.0 – special Bc generator

for validation and development
– from C.H.Chang, J.X.Wang, X.G.Wu, Comp.Phys.Comm. 174 (2006) 241

HiddenValley – special Z’  v-quarks generator

for special productions
– from M. Strassler, hep-ph/0707160

MC@NLO – build with LbHerwig

modified by K.Harrison to fit with LHCb software requirements
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 12
Event types and Generator methods

Minimum Bias:


Inclusive:



Keep events generated by Pythia with at least one b-(or c)hadron in 400 mrad
w/r to the z axis.
If all of these hadrons have pz < 0, flip the whole interaction
Signal:







Keep all events generated by Pythia.
Keep events generated by Pythia containing one B+ or one B- (or one B0/antiB0, J/y, Ds+/Ds-, …) in 400 mrad.
If there are several candidates, choose randomly one.
If it has pz<0, flip the whole interaction.
To speed up generation, if the interaction contains a b quark, repeat the
hadronization process of Pythia until the interaction contains the B+/B-.
Decay the signal candidate according to a forced channel with EvtGen.
Decay B** and B mixing with EvtGen
Special (Higgs, top, W, Z, …):



Keep all events generated by Pythia with special settings and passing
specific generator level cuts (pT(lepton) > 4 GeV, …)
Decay Higgs, top, W, Z, … with Pythia, all other particles with EvtGen
No pile-up for this mode.
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 13
Sample Generation
Abstract Interface
Concrete
Implementations
MinimumBias
SignalPlain
ISampleGenerationTool
generate()
ExternalGenerator
Contain useful functions when interfacing
with an external production generator
(handling of B**, parity trick, …)
Inclusive
Signal
Other
SignalForcedFragmentation
SignalRepeatedHadronization
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 14
Options for event types

Options for event type chosen at production time,
included after all other options

example in Gauss.opts
Minimum Bias:
#include $DECFILESROOT/options/30000000.opts
Inclusive b:
#include $DECFILESROOT/options/10000000.opts
Bs->J/Psi(mum)Phi(KK)
#include $DECFILESROOT/options/13144000.opts

Options files have name GSDCTNXU.opts


GSDCTNXU is LHCb Event type code, used in data and in
Book-keeping to identify samples
Each digit has a meaning explained in Note LHCb-2005-034
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 15
DecFile package

Contains all validated and released EventType options


released independently from Gauss
allow production of new event types with an already released Gauss
and corresponding EvtGen decay files (dkfiles) for signals and to
be used in addition to generic one containing all decays
Generator.opts
ToolSvc.EvtGenDecay.DecayFile =
"$DECFILESROOT/dkfiles/DECAY-DC06.DEC";
13144000.opts
ToolSvc.EvtGenDecay.UserDecayFile =
"$DECFILESROOT/dkfiles/Bs_Jpsiphi,mm.dec";

When building the package a tool automatically builds job options
necessary for a given EVTTYPE given specified keywords for
production, cuts to be applied and special options to include
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 16
Options and dkfile for Minimum Bias
#
# EventType:
# Descriptor:
# NickName:
# Production:
# Physics:
#
End
30000000
pp => ?
minbias
Pythia
used by Book-keeping minbias.dec
used by EvtTypeSvc
and MCDecayFinder
// Event Type:30000000
//
// ASCII Decay Descriptor: pp => ?
Empty EvtGen directive:
no special decay
30000000.opts
Generation.EventType
= 30000000;
Generation.SampleGenerationTool
= "MinimumBias";
Generation.MinimumBias.ProductionTool = "PythiaProduction";
ToolSvc.EvtGenDecay.UserDecayFile
=
"$DECFILESROOT/dkfiles/minbias.dec";
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 17
Generation algorithm for Mimimum Bias
Main algorithm: Generation
1.
Initialize all tools
2.
Generate an event:
1.
Compute the number
of interactions per
event, N
2.
Generate an event
with N interactions
3.
Repeat until this
event is accepted
3.
Decay all hadrons in event
4.
Smear the vertex
5.
Store in event data store
6.
Print counters
Fixed luminosity of 2 × 1032 cm2/s (default)
and 5 × 1032 cm2/s.
IPileUpTool
MinimumBias
Generate interactions
(N times)
IDecayTool
ISmearingVertexTool
Beam spot size:
sx,y=70 mm
sz=50 mm
Software Tutorial - Gauss - Last update: 10 October 2007
IProductionTool
Obtain the beam
parameters for this
event.
Generate an event
(use the internal
function of the
generator used)
IBeamTool
Colliding
beams with
horizontal
crossing angle
285 mrad
Event Generation - Page 18
Options for Signal Event
Bs_Jpsiphi,mm.dec
# This is the decay file for the decay BS0 -> PSI(-> MU+ MU-)PHI(->
K+ K-)
#
EventType: 13144000
#
Descriptor: [B_s0 -> (J/psi(1S) -> mu+ mu- {,gamma} {,gamma})
(phi(1020) -> K+ K-)]cc
used by Book-keeping
#
NickName: Bs_Jpsiphi,mm
#
Physics: Includes radiative mode, No CP violation
#
In analysis session used:
#
Tested: Yes
#
By: Gerhard Raven
Bs  J /  ( m  m  )  ( K  K  )
#
Date: 29 Mar 2004
13144000.opts
// Event Type:13144000
//
// ASCII Decay Descriptor: [B_s0 -> (J/psi(1S) -> mu+ mu- {,gamma}
{,gamma}) (phi(1020) -> K+ K-)]cc
Generation.EventType
= 13144000;
Generation.SampleGenerationTool = "SignalRepeatedHadronization";
Generation.SignalRepeatedHadronization.ProductionTool =
"PythiaProduction";
Generation.SignalRepeatedHadronization.SignalPIDList = {531,-531};
ToolSvc.EvtGenDecay.UserDecayFile = "$GAUSSOPTS/Bs_Jpsiphi,mm.dec";
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 19
Generation algorithm for Signal Events
Main algorithm: Generation
IProductionTool
IPileUpTool
1.
Initialize all tools
2.
Generate an event:
Generate interactions (N times).
1.
If the interaction contains a b (or
bbar) quark, save the parton event
and re-run only the hadronization.
2.
3.
Compute the
number of
interactions per
event, N
Generate an event
with N
interactions
Repeat until this
event is accepted
3.
Decay all hadrons in
event
4.
Smear the vertex
5.
Apply cut on whole
event
6.
Store in event data store
7.
Print counters
SignalReapeatedHadronization
Decay excited particles heavier
than the signal particle.
Obtain the beam
parameters for this
event.
Generate an event
(use the internal
function of the
generator used)
IDecayTool
Check if the interaction contains
the signal
Apply generator level cuts to all
particles of interest.
IGenCutTool
If all remaining particles have
pz<0, invert the interaction.
Force the signal particle to decay to
the correct decay mode.
IDecayTool
ISmearingVertexTool
Software Tutorial - Gauss - Last update: 10 October 2007
IBeamTool
IDecayTool
available:
• 400 mrad
cut on the B
direction
(default)
• direction of
the decay
products of
the B
Repeated hadronization used
for B0, B+, Bs and Lb.
Forced fragmentation for Bc
Plain Pythia for J/y D, Ds, …
Event Generation - Page 20
Decays and EvtGen


Package developed by BABAR (David Lange and Anders Ryd) for
B decays generation, written in C++.
Takes as input:

evt.pdl: particles properties (name, mass, width, charge, spin,
lifetime)


DECAY(-DC06).DEC: decay table for generic decays




we use the latest BABAR table with updated Branching Ratio
User .dec file : decay table for signal decays
Dedicated syntax to describe how to perform decays in .dec files
EvtGen also uses PYTHIA to generate some decay modes.


In LHCb created on the fly from ParticleTable.txt
Ensure both use the same particle properties (masses, lifetimes,…) via
Gaudi ParticleProperty Service
EvtGen is contained in a tool, EvtGenDecay, that can be called at
various stages of the Generation
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 21
EvtGen Decay Files (1)

Aliases for signal B hadrons are defined by default.
B-hadron
Alias
Charge conjugate
B0
B0sig
anti-B0sig
B+
B+sig
B-sig
B0s
B_s0sig
anti-B_s0sig
B+c
B_c+sig
B_c-sig
Lb
Lambda_b0sig
anti-Lambda_b0sig
they can be found in DECAY(-DC06).DEC


The user decay file sets the decay table for these
aliases.
Additional aliases can be defined
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 22
EvtGen Decay Files (2)

A lot of decay models are available. The most common ones are:



PHSP : phase space
SVS : (pseudo)scalar to vector (pseudo)scalar
VSS : vector to scalar scalar


for example for  → KK
SVV_HELAMP |H+| argH+ |H0| argH0 |H-| argH- : scalar to vector
vector with amplitude given by helicity amplitude arguments

for example for Bs → J/Psi  where the values are:
|H+| = 0.159 argH+ = 1.563 |H0| = 0.775 argH0 = 0.0 |H-| = 0.612 argH- = 2.712


VLL : vector to lepton lepton
PHOTOS_VLL : vector to lepton lepton with Photos radiative
corrections



for example for J/Psi → mm
ISGW2 : semi-leptonic, …
Their explanation is available from the EvtGen manual

available from the Gauss web page: Gauss → EvtGen → pdf of
manual
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 23
Example decay file
# Decay file for BS0 -> PSI(-> MU+ MU-) PHI(-> K+ K-)
# Can define parameters to be used
Define Hp 0.159
. . .
# Define aliases for J/psi and phi decays
Alias MyJ/psi J/psi
Alias MyPhi phi
# Define charged conjugates
Bs  J /  ( m  m  )  ( K  K  )
ChargeConj MyJ/psi MyJ/psi
ChargeConj MyPhi MyPhi
# Define decay of B0sig alias
Decay B_s0sig
# BR Decay_products Decay_model (parameters)
1.000
MyJ/psi MyPhi
SVV_HELAMP Hp pHp Hz pHz Hm pHm;
Enddecay
# Define the charge conjugate decay mode for anti-particle
Decay anti-B_s0sig
1.000
MyJ/psi MyPhi
SVV_HELAMP Hm pHm Hz pHz Hp pHp;
Enddecay
# Define the decay of the products
. . .
End
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 24
High statistic samples - requests

Once an Event type has been chosen .OR. setup up
and a big production through the whole chain of
GaussBooleBrunel is necessary

Send a request to your Physics Working Group and the
Physics Coordinator, Olivier Schneider, with cc to Patrick
Robbe and me


specify Gauss version to use and if decay file is new provide it
It will be ensure all necessary code is released (including
options!) and request is forwarded to Production Team
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 25
Indipendent samples

To generate independent samples and to ensure reproducibility of
the events set random number sequence for each event


Use the same random number generator in whole of Gauss (from Gaudi
framework)
The random number sequence is set in initialization of each phase

Three Random numbers are setup via Run and FirstEvent Number
and their combination: change either one!
Gauss.RunNumber = 3477;
Gauss.FirstEventNumber = 1001;


Gauss.opts
Event and Run number set in Generator phase and retrieved in
Simulation
Random number seeds is also stored in Headers

Two separate headers: GenHeader (event type) & MCHeader (event time)
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 26
Type of events: Particle Guns

Used for special studies

Gaudi Algorihtm that can be controlled given particles in
ranges of momentum, angle and origin vertex
Generator.Members -= { "Generation", "GaudiSequencer/GenMonitor" };
Generator.Members += { "ParticleGun", "GaudiSequencer/GenMonitor" };
// Particle Gun's options
// Note that internally the ParticleGun expect the units to be as specified on
// the side (this is because of consistency with the generator format HepMC)
ParticleGun.xVertexMin = 0.0; // mm
ParticleGun.xVertexMax = 0.0; // mm
Example in Gauss:
ParticleGun.yVertexMin = 0.0; // mm
ParticleGun.yVertexMax = 0.0; // mm
ParticleGun.opts
ParticleGun.zVertexMin = 0.0; // mm
ParticleGun.zVertexMax = 0.0; // mm
ParticleGun.MomentumMin =
1.0; // GeV
Momentum
ParticleGun.MomentumMax = 100.0; // GeV
ParticleGun.ThetMin
= 0.015; // rad
Theta
ParticleGun.ThetMax
= 0.300; // rad
ParticleGun.PhiMin
=
0.0; // rad
Phi
ParticleGun.PhiMax
=
6.28; // rad
ParticleGun.PdgCodes
= {-211, 211}; // PDG code of list of particles to be

// generated
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 27
Generator Event data

Event data resides in Event Store




Tree - similar to file system
Identification by path ”/Event/Gen/HepMCEvents”
Objects or Containers of objects
Data access in GaudiAlgorithm:
LHCb convention
const HepMCEvents* events =
get<HepMCEvents>(HepMCEventLocation::Default);

iteration like any STL-vector:
for( HepMCEvents::const_iterator iEv = events->begin();
iEv != events->end(); ++iEv ) {
for( HepMC::GenEvent::particle_const_iterator
iP = (*iEv)->pGenEvt()->particles_begin();
iP != (*iEv)->pGenEvt()->particles_end(); ++iP ) {

Don’t FORGET the header file of the data class
LHCb convention
#include “Event/HepMCEvent.h”
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 28
Generator Events

HepMC used for generator event




External library supported by LCG
Some C++ generator provides interface
Provide access to Pythia, Herwig data (HepEvt wrapper provided)
Generators communicate via HepMC in LHCb


PythiaEvtGen
Very well suited to generator structure
HepMC::GenEvent (process)
from which access to
HepMC::GenVertex(ices)
HepMC::GenVertex and
HepMC::GenParticle
holding incoming
particle/end vertex,
production vertex/outgoing
particle relationship
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 29
Generator Events

HepMCEvent(s)

LHCb wrapper class to provide general LHCb data object
functionality




One for each pile-up event
GenCollisions

Information about each pile-up interaction




Access in Transient Event, Persistency
Link to HepMC::GenEvent as a whole from other LHCb event data
classes (SmartRef)
Mandelstam and Bjorken variables
process type
reference to HepMCEvent
GenHeader

General information of generation


luminosity, event type, event and run number
Fast access to pile-ups: reference to GenCollisions
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 30
Generator – Counters and Monitors


In the Gauss log files, counters computed during the
generation are printed to be able to compute
efficiencies and cross sections:

Pythia cross-sections,

Number of c and b events,

Fractions of B, B*, B**

Fractions of B0, B+, Bs, Lb

Efficiencies of generator level cuts

A tool is being put in place to automatically extract quantities
from log files (F. Ranjard, M. Barbera Asin)
Basic monitoring histograms are filled in production

They can also be run also a posteriori on the HepMCEvents
and a detailed n-tuple is also available (set up in
MonitorInDetail.opts)
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 31
Exercises

You will get familiar with running Gauss in generator
stand-alone, how to generate independent samples and
how the configuration for different event types are set

Guidelines for the exercises on the web


from the tutorial agenda
Packages used:


Sim/Gauss v25r12 – Mandatory
Tutorial/Simulation v2r0 – Optional



exercises/README.txt + exerciseN.txt
solutions/exerciseN/
Advanced exercises also available
Software Tutorial - Gauss - Last update: 10 October 2007
Event Generation - Page 32