Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Virtual MonteCarlo D.Adamova 2, V.Berejnoi 1, R.Brun 1, F.Carminati 1, A.Fassó 1, E.Futo 1, I.Gonzalez 3, I.Hrivnacova 4, A.Morsch 1 1 CERN, Geneva;

Similar presentations


Presentation on theme: "The Virtual MonteCarlo D.Adamova 2, V.Berejnoi 1, R.Brun 1, F.Carminati 1, A.Fassó 1, E.Futo 1, I.Gonzalez 3, I.Hrivnacova 4, A.Morsch 1 1 CERN, Geneva;"— Presentation transcript:

1 The Virtual MonteCarlo D.Adamova 2, V.Berejnoi 1, R.Brun 1, F.Carminati 1, A.Fassó 1, E.Futo 1, I.Gonzalez 3, I.Hrivnacova 4, A.Morsch 1 1 CERN, Geneva; 2 NPI, Rez; 3 IFCA, Cantabria; 4 IPN, Orsay For the ALICE Collaboration Presented by I. Hrivnacova Conference for Computing in High Energy and Nuclear Physics La Jolla, 27 March 2003

2 I. HrivnacovaCHEP 2003, La Jolla, 27 March 20032 Outline  Interfaces  Available MCs  Examples  Distribution  Future

3 I. HrivnacovaCHEP 2003, La Jolla, 27 March 20033 The VMC Concept  The Virtual MonteCarlo (VMC) has been developed in order to –Run the same user application with all supported transport Monte Carlos –Run different transport Monte Carlo programs without changing the user code and therefore the geometry definition, the detector response simulation, or input and output formats  VMC decouples the dependence of a user code from a concrete MC

4 I. HrivnacovaCHEP 2003, La Jolla, 27 March 20034 VMC Concept User Code VMC Geant4 VMC Particles Hits Geant4 Geant3 Output Fluka VMC Fluka Input Geant3 VMC

5 I. HrivnacovaCHEP 2003, La Jolla, 27 March 20035 Virtual Monte Carlo

6 I. HrivnacovaCHEP 2003, La Jolla, 27 March 20036 Interfaces (1)  TVirtualMC –Interface to the Monte Carlo program –Generalization of Geant3 functions for definition of simulation task Provides methods for definition of geometry and physics setup; for access to tracked particle properties during stepping; for run control –Implementations: TGeant3, TGeant4, TFluka (coming soon) Are provided for the user Methods For Building & Accessing Geometry Methods For Building & Accessing Materials Methods For Setting Physics Methods For Accessing Tracked Particle During Stepping Methods For Run Control Virtual MC

7 I. HrivnacovaCHEP 2003, La Jolla, 27 March 20037 Interfaces (2)  TVirtualMCApplication –Interface to a user application –Defines user actions at each stage of a simulation run –Mandatory –Implementation has to be done by a user ConstructGeometry InitGeometry GeneratePrimaries BeginEvent BeginPrimary PreTrack Stepping PostTrack FinishPrimary FinishEvent Virtual MC Application

8 I. HrivnacovaCHEP 2003, La Jolla, 27 March 20038 Interfaces (3)  TVirtualMCStack –Interface to a user defined particles stack –Mandatory –User can use the concrete stack classes provided in the examples or implement their own stack class  TVirtualMCDecayer –Interface to an external decayer –Eg. Pythia6 –Optional

9 I. HrivnacovaCHEP 2003, La Jolla, 27 March 20039 ConstructGeometry InitGeometry GeneratePrimaries BeginEvent BeginPrimary PreTrack Stepping PostTrack FinishPrimary FinishEvent User MC Application void MyMCApplication::Construct Geometry() { Double_t trackerTube[3]; trackerTube[0] = 0.; trackerTube[1] = 60.; trackerTube[2] = 50.; gMC->Gsvolu("TRTU", "TUBE", fImedAl, trackerTube, 3); Double_t posX = -100.; Double_t posY = 0.; Double_t posZ = 0.; gMC->Gspos("TRTU", 1, "EXPH", posX, posY, posZ, 0, "ONLY"); } Use of VMC Geometry Construction  Geometry is defined by calls to TVirtualMC interface

10 I. HrivnacovaCHEP 2003, La Jolla, 27 March 200310 void MyMCApplication::GeneratePrimaries() { // Define particle properties: // PDG encoding // position: vx, vy, vz, vt // momentum: px py, pz, e // … // Add particle to MC stack gMC->GetStack() ->SetTrack(toBeDone, -1, pdg, px, py, pz, e, vx, vy, vz, t, …); } Use of VMC Primary Particles  Primary particles are defined by calls to the TVirtualMCStack interface ConstructGeometry InitGeometry GeneratePrimaries BeginEvent BeginPrimary PreTrack Stepping PostTrack FinishPrimary FinishEvent User MC Application

11 I. HrivnacovaCHEP 2003, La Jolla, 27 March 200311 void MyMCApplication:: Stepping() { // Get track position Double_t x, y, z; gMC->TrackPosition(x, y, z); // Get energy deposit Double_t edep = gMC->Edep(); // Create user hit mySD->AddHit(x, y, z, edep); } Use of VMC Hits Production  The user stepping function is called by MC at each step  User gets the properties of the tracked particle by calls to TVirtualMC and saves them in their own hits objects ConstructGeometry InitGeometry GeneratePrimaries BeginEvent BeginPrimary PreTrack Stepping PostTrack FinishPrimary FinishEvent User MC Application

12 I. HrivnacovaCHEP 2003, La Jolla, 27 March 200312 Available MCs  Geant3, Geant4 –Geant3 VMC and Geant4 VMC in production  Fluka –Fluka VMC in development

13 I. HrivnacovaCHEP 2003, La Jolla, 27 March 200313 Available MCs Geant3 VMC  Provided within a single package together with Geant321 (FORTRAN)  Straightforward implementation –VirtualMC was largely inspired by Geant3  Geant3 Geometry Browser –Provided within TGeant3 –http://alisoft.cern.ch/ people/morsch/Geant3GUI.html

14 I. HrivnacovaCHEP 2003, La Jolla, 27 March 200314 Available MCs Geant4 VMC (1)  Provided within a package - geant4_vmc –Requires Geant4 installation  Access to Geant4 –Switching between Root UI and Geant4 UI –Geant4 classes are not processed by CINT – G4 objects are not accessible from the Root UI  Use of G3toG4 –TVirtualMC has been inspired by Geant3 –An effort has been made to minimize the limitations of the G3toG4 tool – in Geant4 4.0: Support for reflections Limited support for “MANY” volume positions

15 I. HrivnacovaCHEP 2003, La Jolla, 27 March 200315 Available MCs Geant4 VMC (2)  Geant4 VMC extensions: –Geant4 VMC Geometry Browser Analogy to Geant3 Geometry browser –Geometry XML Convertor Enables to export Geant4 geometry to XML (AGDD) and then to browse and visualize using GraXML More on GraXML: in the presentation: “GraXML – Modular Geometric Modeller” (J. Hrivnac)

16 I. HrivnacovaCHEP 2003, La Jolla, 27 March 200316 Available MCs Fluka VMC  In development by the ALICE collaboration and FLUKA team –TFluka in AliRoot  Implemented: –Functions for building/accessing geometry Use of Geant4 VMC + Flugg –Functions for accessing tracked particle during stepping –Recording particles in VMC stack –Functions for run management  To be done: –Functions for setting physics –External decayer

17 I. HrivnacovaCHEP 2003, La Jolla, 27 March 200317 Examples  3 examples provided in geant4_vmc –In spite of being provided within Geant4 VMC, they are built independently and do not require Geant4 installation in case a user wants to run them with Geant3 only  Geant4 novice examples N01, N02 and N03 rewritten with use of Virtual Monte Carlo  Implement MC Application and MC Stack  All examples are executed in the same way: –cd geant4_vmc/examples/E0n –root –root[0].x run_g3.C or run_g4.C

18 I. HrivnacovaCHEP 2003, La Jolla, 27 March 200318 { // Load basic libraries gROOT->LoadMacro(“basiclibs.C”); basiclibs(); // Load this example library gSystem->Load("libexample01"); // MC application Ex01MCApplication* appl = new Ex01MCApplication("Example01", "The example01 MC application"); appl->RunMC(1); } E01 run_g3.C run_g4.C // Load Geant3 libraries gROOT->LoadMacro(“g3libs.C”); g3libs(); // Load Geant4 libraries gROOT->LoadMacro(“g4libs.C”); g4libs(); appl->InitMC("g3Config.C");appl->InitMC("g4Config.C");

19 I. HrivnacovaCHEP 2003, La Jolla, 27 March 200319 void Config() { // RunConfiguration for Geant4 TG4RunConfiguration* runConfiguration = new TG4RunConfiguration(); // Geant4 VMC new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration); } void Config() { new TGeant3("C++ Interface to Geant3"); } E01 g3Config.C g4Config.C

20 I. HrivnacovaCHEP 2003, La Jolla, 27 March 200320 Examples AliRoot  AliRoot Framework –Integrates simulation, reconstruction and analysis software for the ALICE experiment  Simulation based on Virtual Monte Carlo –A complex “example” of VMC usage –No MC specific code in user code –PPR production with Geant3  More on AliRoot – in the presentations: –“The AliRoot Framework, status and perspectives” (F.Carminati) –“Simulation in ALICE” (A. Morsch) –“ALICE experience with Geant4” (I. Gonzalez)

21 I. HrivnacovaCHEP 2003, La Jolla, 27 March 200321 Dimuon Arm AliRoot Geometry

22 I. HrivnacovaCHEP 2003, La Jolla, 27 March 200322 AliRoot Hits Production Geant3Geant4

23 I. HrivnacovaCHEP 2003, La Jolla, 27 March 200323 VMC Future (1)  Integration of the new Root geometrical modeller (TGeo) in VMC – in progress –Will then be able to define MC geometry directly via TGeo  Geant3, Fluka –Replacement of the native geometry with TGeo inside the program itself –Geant3: Already operational, close to completion Production release in coming weeks –Fluka: Work is ongoing

24 I. HrivnacovaCHEP 2003, La Jolla, 27 March 200324 VMC Future (2)  Geant4 –Discussions about using the Root geometry modeller through an abstract interface to Geant4 geometry have been started –RootToG4 converter Converter from Root geometry to Geant4 native geometry Already operational, close to completion Production release will follow the release of the new Geant3 version  More on TGeo – in the presentation: “A Geometrical Modeller for HEP” (A. Gheata)

25 I. HrivnacovaCHEP 2003, La Jolla, 27 March 200325 Distribution  ROOT CVS server –mc – core package (interfaces), in Root –geant3, geant4_vmc 2 independent modules (parallel to root): –cvs -d :pserver:cvs@root.cern.ch:/user/cvs co –P geant3 –cvs -d :pserver:cvs@root.cern.ch:/user/cvs co –P geant4_vmc  ROOT Web –http://root.cern.ch/root/vmc/VirtualMC.html –Distribution of sources: geant321+_vmc.version.tar.gz geant4_vmc.version.tar.gz

26 I. HrivnacovaCHEP 2003, La Jolla, 27 March 200326 Summary  VMC allows the user to run different transport MonteCarlo’s from the same user code –On the menu today: Geant3, Geant4 –Coming soon: Fluka  VMC available from –http://root.cern.ch/root/vmc/VirtualMC.html


Download ppt "The Virtual MonteCarlo D.Adamova 2, V.Berejnoi 1, R.Brun 1, F.Carminati 1, A.Fassó 1, E.Futo 1, I.Gonzalez 3, I.Hrivnacova 4, A.Morsch 1 1 CERN, Geneva;"

Similar presentations


Ads by Google