N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Prototype GEANT4 Service for ATHENA framework ATLAS Software Workshop Dec 3.

Slides:



Advertisements
Similar presentations
Mantid Architecture Straw man proposal Nick Draper 24 th August 2007.
Advertisements

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett TruthAssociation EDM Workshop Event Data Model Session Jan
Athena/POOL integration
25/03/2003Simulation Application for the LHCb Experiment CHEP March 2003 Presented by: W. Pokorski / CERN Authors: I. Belyaev, Ph. Charpentier,
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
14 User Documents and Examples I SLAC Geant4 Tutorial 3 November 2009 Dennis Wright Geant4 V9.2.p02.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
FCC Software Status Report from a User’s Perspective Colin Bernet (IPNL), Benedikt Hegner (CERN) 14 January
Victor Serbo, SLAC30 September 2004, Interlaken, Switzerland JASSimApp plugin for JAS3: Interactive Geant4 GUI Serbo, Victor (SLAC) - presenter Donszelmann,
Introducing JavaBeans Lesson 2A / Slide 1 of 30 JDBC and JavaBeans Pre-assessment Questions 1.Which of the given symbols is used as a placeholder for PreparedStatement.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Japan.
Introduction to Hall-D Software February 27, 2009 David Lawrence - JLab.
User Documents and Examples I Sébastien Incerti Slides thanks to Dennis Wrigth, SLAC.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett A Lightweight Histogram Interface Layer CHEP 2000 Session F (F320) Thursday.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett The Athena Control Framework in Production, New Developments and Lessons Learned.
Event Data History David Adams BNL Atlas Software Week December 2001.
V. Serbo, SLAC ACAT03, 1-5 December 2003 Interactive GUI for Geant4 by Victor Serbo, SLAC.
GLAST Gaudi Code Review, 10 Sept. 2002, H. Kelly, 2-1 GLAST Event Data Model and Persistency.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER 1 ACAT 2000, Fermilab Oct Control States... Control States for the Atlas Software Framework.
David Adams ATLAS DIAL status David Adams BNL November 21, 2002 ATLAS software meeting GRID session.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Updates to Interval of Validity Service (IOVSvc) ATLAS Software Week Dec
ALCPG Software Framework Overview & Updates Jeremy McCormick, SLAC SiD Group ALCPG 2009.
DANA uses a factory model to deliver data “just in time”
Use of Gaudi in Reconstruction Weidong Li 23/06/2004.
User Application Luciano Pandola INFN-LNGS Partially based on a presentation by Maria Grazia Pia (INFN-Ge)
Gaudi Framework Tutorial, April Algorithm Tools: what they are, how to write them, how to use them.
Gaudi Framework Tutorial, April Job Options and Printing.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Interval of Validity Service IOVSvc ATLAS Software Week May Architecture.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Interval of Validity Service IOVSvc EDM Workshop Detector Description Session.
9-13/9/03 Atlas Overview WeekPeter Sherwood 1 Atlfast, Artemis and Atlantis What, Where and How.
Vertex finding and B-Tagging for the ATLAS Inner Detector A.H. Wildauer Universität Innsbruck CERN ATLAS Computing Group on behalf of the ATLAS collaboration.
Maria Grazia Pia INFN Genova Salamanca, July 2002
The CMS Simulation Software Julia Yarba, Fermilab on behalf of CMS Collaboration 22 m long, 15 m in diameter Over a million geometrical volumes Many complex.
Introduction What is detector simulation? A detector simulation program must provide the possibility of describing accurately an experimental setup (both.
Run and Event G4Run and G4RunManager In Geant4, the Run is the largest unit of simulation and it consist of a series of events Within a Run, the detector.
FreeHEP, JAS and WIRED Mark Dönszelmann, CERN/IT Charles Loomis, UC, Santa Cruz ATLAS Software Week, 30 November 2000.
How to combine IRIS products Available APIs Examples of integrations Ole Andersen Senior Strategic Account Manager.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Colors in the Message Service ATLAS software workshop March Architecture.
The JANA Reconstruction Framework David Lawrence - JLab May 25, /25/101JANA - Lawrence - CLAS12 Software Workshop.
Tutorial: Examples (09may00 - ATLAS Software LBNL) May 2000 Prototype Framework Tutorial: Examples Paolo Calafiura, Charles Leggett HCG/NERSC/LBNL.
Makoto Asai (SLAC) Getting Started MGP: added class diagram of basic user application.
David Adams ATLAS ATLAS Distributed Analysis: Overview David Adams BNL December 8, 2004 Distributed Analysis working group ATLAS software workshop.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Interval of Validity Service IOVSvc ATLAS Software Week Architecture Session.
SPI NIGHTLIES Alex Hodgkins. SPI nightlies  Build and test various software projects each night  Provide a nightlies summary page that displays all.
Valeri Fine Athena/POOL integration.
- GMA Athena (24mar03 - CHEP La Jolla, CA) GMA Instrumentation of the Athena Framework using NetLogger Dan Gunter, Wim Lavrijsen,
Update G4builder issues Talk written almost entirely by Stan Bentvelsen with a few updates from Christopher Lester ATLAS G4 Workshop December 2000 CAMBRIDGE.
1 Week # 4 Introduction to PDM PDM is a workbench environment that lets programmers and system operators navigate the three levels of the AS/400’s object-based.
Chapter – 8 Software Tools.
1 April 2, 2004, Athena tutorial, FZU, PragueZdeňka Broklová SCT Simulation for CTB Status and HowTos Zdenka Broklova, Carlos Escobar, Peter Kodys.
INFSO-RI Enabling Grids for E-sciencE Using of GANGA interface for Athena applications A. Zalite / PNPI.
Introduction to the Athena Software Hong Ma BNL Athena Tutorial USATLAS Software Workshop.
Software Requirements for the Testing of Prototype Correlator Sonja Vrcic Socorro, December 11, 2007.
Gaudi Framework Tutorial, Algorithm Tools: what they are and how to use them.
Athena StoreGate Tutorial: May 30, Objectives Learn how to access data objects using StoreGate How to record/retrieve by TYPE Optionally using keys.
David Adams ATLAS Hybrid Event Store Integration with Athena/StoreGate David Adams BNL March 5, 2002 ATLAS Software Week Event Data Model and Detector.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Transient Conditions/Detector Store using StoreGate ATLAS Software Workshop.
LHCb Simulation LHCC Computing Manpower Review 3 September 2003 F.Ranjard / CERN.
“Algorithm Tools” what they are, how to get them and how to use them
GLAST Gaudi Review T. Burnett H.Kelly 10 Sept 02 Gaudi code review
LHCb Software Tutorial
User Documents and Examples I
Basics of a user application
Geant4:User Actions and Analysis
Linear Collider Simulation Tools
GAUSS - GEANT4 based simulation for LHCb
G4 Workshop 2002 Detector Description Parallel Session
Use Of GAUDI framework in Online Environment
Simulation in Experiments searching for rare events
Presentation transcript:

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Prototype GEANT4 Service for ATHENA framework ATLAS Software Workshop Dec Architecture Session

2 Charles Leggett Objectives F Access GEANT4 services from ATHENA framework F Use HepMC event as produced by Generators F Understand various geometry formats: l basic GEANT4 C++ geometry classes l AGDD l DOM F Use GEANT4 Physics Lists F Preserve GEANT4 Hits and Tracks for further processing F Visualization F Use ATHENA framework facilities for persistification F Use ATHENA framework facilities for histograms F Use any other ATHENA framework component...

3 Charles Leggett Components F G4Svc: ATHENA/GAUDI service l G4Svc inherits from IService, IG4Svc. usually, only thing the user needs to talk to l G4SvcRunManager inherits from G4RunManager extends functionality splits up event loop so G4 event/hit store doesn’t get cleared until end of Athena event l AthenaHepMCtoG4EventAction converts HepMC event in StoreGate to G4Event F AGDD geometry builder l reads XML files and builds geometry/materials specifications F DOM geometry builder l reads other XML files using DOM model

4 Charles Leggett Access to GEANT4 Services F pure GEANT4 facilities can be accessed in several different ways: l using pre-defined G4Svc access methods, such as: SetUserAction( G4VUserEventAction ); SetUserInitialization(G4VUserDetectorConstruction* ); l direct access to G4RunManager l via command line userInterface session l sending text commands to the UImanager l get hold of various other G4 objects, such as G4Event* and talk directly to them

5 Charles Leggett Process Loop: initialize() G4Svc::initialize() AddListner(EndEvent, McEventGenerated) new G4SvcRunManager LArG4Sim::initialize() G4Svc->SetUserInitialization(new LArDetectorConstruction) G4Svc->SetUserAction(new LArRunAction) G4Svc->SetUserAction(new LArEventAction) G4Svc->SetUserAction(new LArSteppingAction) initialize()

6 Charles Leggett Process Loop: execute() GenModule::execute() create HepMCEventCollection, put in StoreGate fire McEventGenerated incident G4Svc::handle(McEventGenerated) if (FirstEvent) { runMgr->SetUserInitialization(PhysicsList) runMgr->SetUserAction(AthenaHepMCtoG4EventAction) setup visualization runMgr->Initialize() } G4SvcRunManager::StartEvent(n) SetNumberOfEventsToBeStored(n) RunInitialization() DoEventLoop(n) AthenaHepMCtoG4EventAction::GeneratePrimaries() for (1,n) { SaveHits() SaveTracks() } execute()

7 Charles Leggett Process Loop: execute() cont. LArG4Sim::execute() access G4VHits in StoreGate process Hits G4Svc::handle(EndEvent) runMgr->EndEvent() G4SvcRunManager::RunTermination() execute()

8 Charles Leggett MC Event Conversion F Convert HepMC::GenEvent as produced by Generators into a G4Event, using a class that inherits from G4VUserPrimaryGeneratorAction F Can do multiple events per event F Trivial to do with SingleParticleGun F For Pythia events, don’t need all the particles, can ignore unstable ones F Problem: particle tree becomes disconnected. l put all particles into one primary vertex? l create many primary vertices, one for each HepMC::GenVertex causes problems with GEANT when have lots of vertices (segfault)

9 Charles Leggett Physics Lists F Very simple: copy directly from GEANT4 examples. F Select via jobOption l G4Svc.PhysicsList = “string” F Available lists: l Geantino (ExN01, ExN02) l ElectroMagnetic (ExN03) l Full (ExN04) l “none”  user must supply their own F Users can also create their own lists, and load them via l G4Svc->SetUserInitialization( PhysicsList  )

10 Charles Leggett Saving G4VHits G4SvcRunManager::SaveHits(G4Event  event) { event->GetHCofThisEvent() new vector hit_keys for (HitCollections in event) { new vector v_HC hit_keys->push_back(HitCollection->GetName()) for (G4VHits in HitCollection) { v_HC->push_back(G4VHit) } StoreGate->record(v_HC,HitCollectionName) } StoreGate->record(hit_keys,”HitKeys”) }

11 Charles Leggett Saving G4VTrajectories F Very similar to G4VHits, except all stored in one container F debug mode prints out all G4TrajectoryPoints in each G4VTrajectory. Turn off when using Pythia! G4SvcRunManager::SaveTracks(G4Event* event) { vector *v_TC = new vector ; G4TrajectoryContainer* TC = event->GetTrajectoryContainer(); for (G4VTrajectory* in TrajectoryContainer) { v_TC->push_back(G4VTrajectory*) } storeGate->record(v_TC,"G4VTrajectory") }

12 Charles Leggett Accessing the G4Svc F Tell the jobOptions about it: F Get hold of the service inside your algorithm: ApplicationMgr.DLLs += { "G4Svc" }; ApplicationMgr.ExtSvc += { "G4Svc" }; #include "G4Svc/IG4Svc.h" IG4Svc* p_G4Svc; StatusCode status = service("G4Svc",p_G4Svc);

13 Charles Leggett G4Svc Job Options F G4Svc.PhysicsList: l "ExN01", "ExN02", "ExN03", "ExN04 " l "Geantino", "EM", "Full", "none" F G4Svc.DefaultPhysicsCut l for a PhysicsList F G4Svc.Visualize l turn on visualization F G4Svc.VisType l default VRML F G4Svc.Tracking l G4RunManager->SetSaveTracks F G4Svc.RunVerbosity, EventVerbosity, TrackingVerbosity l how much G4 output to print out

14 Charles Leggett G4Svc UserInterface F Can access the G4UI text user interface at any time: p_G4Svc->StartUISession(); F Can also pass commands directly to the UImanager: l p_G4Svc->uiMgr()->ApplyCommand( "G4 command" );

15 Charles Leggett Accessing Hits and Tracks F As shown before, G4VHits and G4VTrajectories are stored in StoreGate in vectors, keyed by name F To retrieve hits: const DataHandle > hit_keys; vector ::const_iterator kitr; StatusCode status = m_sgSvc->retrieve( hit_keys, "HitKeys" ); if (status.isSuccess()) { for (kitr=hit_keys->begin(); kitr!=hit_keys->end(); ++kitr) { const DataHandle > hits; status = m_sgSvc->retrieve(hits, (*kitr)); if (status.isSuccess()) { vector ::const_iterator itr; for (itr=hits->begin(); itr!=hits->end(); ++itr) { (*itr) -> Print(); }

16 Charles Leggett Building Geometry from XML F Several XML geom/material builders have been implemented: l Stan’s G4Builder: G4Builder l Jean-Francois’s AGDDBuilder: G4AGDDBuilder l Andrea’s DOM model: G4DOMBuilder ApplicationMgr.DLLs += { "G4Builder" }; ApplicationMgr.TopAlg = {..., "G4BuilderAlg",... }; G4BuilderAlg.MaterialXML = "Material_AGDD.xml"; G4BuilderAlg.DetectorXML = "Atlas_AGDD.xml"; ApplicationMgr.DLLs += { "G4AGDDBuilder" }; ApplicationMgr.TopAlg = {..., "G4AGDDBuilder",... }; G4AGDDBuilder.MaterialXML = "Material_AGDD.xml"; G4AGDDBuilder.DetectorXML = "Atlas_AGDD.xml"; ApplicationMgr.DLLs += { “G4DOMBuilder” }; ApplicationMgr.TopAlg = {..., "G4DOMBuilder",... }; G4DOMBuilder.XML = { ”SCTDesc.xml”, “color.xml” };

17 Charles Leggett Building AGDD Geometry F Use AGDD to read in (uncompacted) XML G4VPhysicalVolume* DetectorConstruction::Construct() { AGDD_Factory &f = AGDD_Factory::Expat_instance(); f.build_detector_description (m_materialFile); BuildMaterial build_material; build_material.parseAGDD (f.get_detector_description() ); f.build_detector_description (m_detectorFile); BuildGeometry build_geometry; build_geometry.parseAGDD (f.get_detector_description() ); }

18 Charles Leggett Visualization F Several vis models are currently supported: l VRML/vrweb l DAWN l will add the other G4 standards when I get the chance: had trouble compiling them in under Linux when I first started F By turning visualization on via the jobOptions, the G4Svc will write out the appropriate visualization file at the end of every event.

19 Charles Leggett Implementations F GEANT4 novice examples 1 through 4 l package G4Sim/G4Ex. l use Algorithm “G4ExN01”, “G4ExN02”, “G4ExN03”, “G4ExN04” F Liquid Argon Calorimeter, l package G4Sim/LArG4Sim l uses C++ classes F SCT with G4Builder l package G4Sim/G4Builder F SCT,Muon,HEC with G4AGDDBuilder l package G4Sim/G4AGDDBuilder F SCT with G4DOM l package G4Sim/G4DOMBuilder

20 Charles Leggett Documentation F online: l F CVS: l currently at BNL $CVSROOT = /afs/rhic/usatlas/project/localcvs F G4Sim container package contains: l GEANT4 (interface package for G4, using geant4.3.2) l G4Svc l G4Builder l G4AGDDBuilder l LArG4Sim l G4Ex