Presentation is loading. Please wait.

Presentation is loading. Please wait.

Event Generators Norman Graf (SLAC) May 20, 2003 May 20, 2003.

Similar presentations


Presentation on theme: "Event Generators Norman Graf (SLAC) May 20, 2003 May 20, 2003."— Presentation transcript:

1 Event Generators Norman Graf (SLAC) May 20, 2003 May 20, 2003

2 2 Problem Statement HEP community has mostly completed its transition to modern programming technologies (object-oriented, C++, Java). HEP community has mostly completed its transition to modern programming technologies (object-oriented, C++, Java). GEANT4, ROOT, JAS, … GEANT4, ROOT, JAS, … One exception is event generators which remain mostly FORTRAN based. One exception is event generators which remain mostly FORTRAN based. Need to accommodate legacy packages Need to accommodate legacy packages e.g. Pythia, Herwig, Isajet e.g. Pythia, Herwig, Isajet

3 3 Interfacing I Could interface with generators simply through persistent output. Could interface with generators simply through persistent output. FORTRAN program  stdhep file  user app. FORTRAN program  stdhep file  user app. Requires users to gain proficiency in setting up and implementing each generator. Requires users to gain proficiency in setting up and implementing each generator. Different requirements, interfaces, etc. Different requirements, interfaces, etc. Requires FORTRAN compiler! Requires FORTRAN compiler! Disk storage can be prohibitive in large- statistics fast-simulation physics analyses. Disk storage can be prohibitive in large- statistics fast-simulation physics analyses.

4 4 Interfacing II Alternative is to abstract out a common interface & provide standard implementations. Alternative is to abstract out a common interface & provide standard implementations. HEPEVT common block is an accepted standard for event generators. HEPEVT common block is an accepted standard for event generators. STDHEP provides common persistent format. STDHEP provides common persistent format. Java provides a consistent platform- independent interface. Java provides a consistent platform- independent interface. Java UI/API  C++  FORTRAN (.dll or.so) Java UI/API  C++  FORTRAN (.dll or.so)

5 5 Legacy Physics Generators Philosophy is to push as much as possible onto the native event generators. Control is through ASCII files which are parsed by FORTRAN routines. These communicate with the COMMON blocks in the event generator code to set parameters. Philosophy is to push as much as possible onto the native event generators. Control is through ASCII files which are parsed by FORTRAN routines. These communicate with the COMMON blocks in the event generator code to set parameters. Can select processes, beamstrahlung, decay channels, etc. at run-time by editing text file. Can select processes, beamstrahlung, decay channels, etc. at run-time by editing text file. Output is stdhep files. Output is stdhep files.

6 6 Physics Generators Java calls C++ class through JNI with minimal interface. public native void initialize(); public native void nextEvent( int[] nev, int[] nev, int[] isthep, int[] idhep, int[] jmohep, int[] jdahep, int[] isthep, int[] idhep, int[] jmohep, int[] jdahep, double[] phep, double[] vhep); double[] phep, double[] vhep); public native void finish();

7 7 C++ communicates with FORTRAN. extern "C" void initialize_(); extern "C" void nextevent_(); extern "C" void finish_(); typedef struct // HEPEVT common block { int nevhep; // event number int nevhep; // event number int nhep; // number of entries int nhep; // number of entries int isthep[4000]; // status code int isthep[4000]; // status code int idhep[4000]; // PDG particle id int idhep[4000]; // PDG particle id int jmohep[4000][2]; // position of first, second mother int jmohep[4000][2]; // position of first, second mother int jdahep[4000][2]; // position of first, last daughter int jdahep[4000][2]; // position of first, last daughter double phep[4000][5]; // 4-momemtum, mass (GeV) double phep[4000][5]; // 4-momemtum, mass (GeV) double vhep[4000][4]; // vertex, production time in mm double vhep[4000][4]; // vertex, production time in mm } hepevtcommon;

8 8 FORTRAN code simply fills HEPEVT common block for each event. FORTRAN code simply fills HEPEVT common block for each event. This code has to be written by someone with expertise in the generator, but then can be used by anyone. This code has to be written by someone with expertise in the generator, but then can be used by anyone. Control is through initialize_ call, and is generator-specific. Control is through initialize_ call, and is generator-specific.

9 9 Physics Generators Any generator producing HEPEVT-format output can be used as input to LCD simulations. Any generator producing HEPEVT-format output can be used as input to LCD simulations. Provide precompiled versions of Provide precompiled versions of PYTHIA 6.2 PYTHIA 6.2 ISAJET 7.48 ISAJET 7.48 HERWIG 6.5 HERWIG 6.5 Interfaced to CIRCE (beamstrahlung) and TAUOLA (  decays) and controlled at run- time by ASCII files. Interfaced to CIRCE (beamstrahlung) and TAUOLA (  decays) and controlled at run- time by ASCII files.

10 10 Runtime control Interact natively with event generators Interact natively with event generators ISAJET has well-defined set of control “cards” ISAJET has well-defined set of control “cards” Input file is same as would be used for FORTRAN job. Input file is same as would be used for FORTRAN job. PYTHIA has command-parsing capability PYTHIA has command-parsing capability Simply pass these commands to PYGIVE Simply pass these commands to PYGIVE HERWIG has neither HERWIG has neither abstract out a “reasonable” set of parameters which user can modify. abstract out a “reasonable” set of parameters which user can modify. Interaction from Java/C++ is only through initialize() method. Interaction from Java/C++ is only through initialize() method.

11 11 Runtime execution All.dll or.so libraries respect same interface, so can dynamically select and load at runtime All.dll or.so libraries respect same interface, so can dynamically select and load at runtime >java EvtGen libToLoad >java EvtGen libToLoad Catalog of available generators can be expanded in the future, without users having to modify any of their existing code. Catalog of available generators can be expanded in the future, without users having to modify any of their existing code. However, only one generator can be used at a time. However, only one generator can be used at a time.

12 12 Alternate approaches Mike Ronan has developed a set of explicit interfaces to various event generators which allow different generators to be run at the same time. Mike Ronan has developed a set of explicit interfaces to various event generators which allow different generators to be run at the same time. Very useful for comparisons Very useful for comparisons e.g. e.g. Pythia pythia = new Pythia(); pythia.give(parameters);pythia.init("CMS","e+","e-",Ecm);

13 13 Diagnostic Generator Often convenient to analyze simple events over which user has complete control. Often convenient to analyze simple events over which user has complete control. Single particles for tracking (momentum) and calorimeter (energy) resolution studies. Single particles for tracking (momentum) and calorimeter (energy) resolution studies. Resonances Resonances  0 to study photon separation  0 to study photon separation Few-particle events with well-defined properties Few-particle events with well-defined properties Fixed impact parameter or decay point for vertexing Fixed impact parameter or decay point for vertexing Multiple tracks to investigate two-track separation Multiple tracks to investigate two-track separation charged+neutral track to study energy flow algorithms charged+neutral track to study energy flow algorithms

14 14 Diagnostic Generator II Implemented interface to PYTHIA allowing runtime control of arbitrarily complex user- defined events. Implemented interface to PYTHIA allowing runtime control of arbitrarily complex user- defined events. Number and type of particles Number and type of particles Energy, , , x, y, z distributions Energy, , , x, y, z distributions Repeat as necessary Repeat as necessary Arbitrary number of PYTHIA commands to control final state decays. Arbitrary number of PYTHIA commands to control final state decays.

15 15 Event Generation with LCDRoot Implements PYTHIA via TPythia class Implements PYTHIA via TPythia class Set up processes and event control through method calls at runtime via CINT. Set up processes and event control through method calls at runtime via CINT. methods similar to PYTHIA calls methods similar to PYTHIA calls Can output events in stdhep binary format, or as root file. Can output events in stdhep binary format, or as root file. Can also simply loop through events using fast simulator. Can also simply loop through events using fast simulator. Interfaced to pandora-pythia (preferred mode) Interfaced to pandora-pythia (preferred mode)

16 16 Event Generation with LCDRoot TPythia6 pyth6; pyth6.SetPMAS(6,1,175.); // Select gamma*/Z0 production process pyth6.SetMSEL(0);pyth6.SetMSUB(1,1); // Initialize process pyth6.Pyinit("CMS","E-","E+",ECM); for (iEvent = 0; iEvent < nEvent; iEvent++) { pyth6.GenerateEvent(); }

17 17 LCDMcDiag Generate single particles (e, , ,n,p,K) Generate single particles (e, , ,n,p,K) Specify momentum, cos(theta), phi Specify momentum, cos(theta), phi LCDMCDiag mc(fname); mc.Set_Momentum(10.0, 0.5, TMath::Pi()/2); mc.Set_Type(211);mc.Set_Particles(1);mc.Set_Seed(0); for(Int_t i=0; i < nEvent; i++){ mc.doit(); }

18 18 Summary Event generators are most important class of legacy code, and require special handling in multi-language, multi-platform environments. Event generators are most important class of legacy code, and require special handling in multi-language, multi-platform environments. Several techniques exist to allow users to generate their own event samples. Several techniques exist to allow users to generate their own event samples. We are following developments of generators (e.g. PYTHIA++) and event record formats (e.g. HepMC) as replacements. We are following developments of generators (e.g. PYTHIA++) and event record formats (e.g. HepMC) as replacements.


Download ppt "Event Generators Norman Graf (SLAC) May 20, 2003 May 20, 2003."

Similar presentations


Ads by Google