Presentation is loading. Please wait.

Presentation is loading. Please wait.

Maria Grazia Pia Usage and results Maria Grazia Pia INFN Genova Budker Inst. of Physics IHEP Protvino MEPHI Moscow Pittsburg University.

Similar presentations

Presentation on theme: "Maria Grazia Pia Usage and results Maria Grazia Pia INFN Genova Budker Inst. of Physics IHEP Protvino MEPHI Moscow Pittsburg University."— Presentation transcript:

1 Maria Grazia Pia Usage and results Maria Grazia Pia INFN Genova Budker Inst. of Physics IHEP Protvino MEPHI Moscow Pittsburg University

2 Maria Grazia Pia Today’s exercise A real-life example –simulation + analysis in a simple experimental set-up By-products Geant4 –an overview of Geant4 Analysis Tools –an overview of OO Analysis Tools example –a practical example how to use Geant4 and AIDA/Anaphe software process –an introduction to software process OO technology –an introduction to basics concepts of OO technology Applications and results of Geant4 –large-scale HEP experiments –small-scale HEP experiments –astroparticle experiments –space science –radiotherapy Discussion Tomorrow’s lecture

3 Maria Grazia Pia through a real-life simulation + analysis Maria Grazia Pia INFN Genova Budker Inst. of Physics IHEP Protvino MEPHI Moscow Pittsburg University and AIDA+Anaphe

4 Maria Grazia Pia The experimental set-up of our exercise A simple configuration, consisting of –a tracking detector –an electromagnetic calorimeter –a system of anti-coincidences What happens in our detectors –incident particles interact in the experimental set-up –secondary particles may be generated and interact too –detectors and their read-out electronics record the effects produced by primary and secondary particles

5 Maria Grazia Pia What shall we do now? Wonder what we want to do… Ask our boss what he wants us to do… Chat with collaborators in the experiment… Sit in front of a PC and start writing code… Software process Ask thinkplandesigndeveloptest get feedback Ask and think and plan and analyse and design and develop and test and get feedback and ask and think and plan and analyse and design and develop and test and get feedback and ask and think and…

6 Maria Grazia Pia The software life-cycle Complexity is never overwhelming –only tackle small bits at a time Early feedback from using the software –provides input to the analysis of subsequent iterations Developers’ skills can grow with the project –don’t need to apply latest techniques/technology at the start Requirements can be modified –each iteration is a mini-project (analysis, design…) Advantages of iterative and incremental development A software process - provides guidance to a team’s activities - specifies which work products should be produced and when - offers criteria for monitoring and measuring the project’s products and activities

7 Maria Grazia Pia SEI’s definition: A set of activities, methods, practices and transformations that people use to develop and maintain software and associated products USDP key components Three key components: the people involved the organization of the development process the technology used Various software process models USDP / RUP OPEN OOSP XP, Agile etc. waterfall Reference for guidance and assessment Capability Maturity Model (CMM) SPICE/ISO 15504 Software Process

8 Maria Grazia Pia Best practices The goal: –to ensure the production of high-quality software – that meets the needs of its end users – within a predictable schedule and budget the way software is produced The way to progress is to study and improve the way software is produced –better technology only helps once the organizational framework is set –there is evidence that going for new technology instead of improving the process can make things worst best practices A set of “best practices” for software development teams –considered conventional wisdom by methodology pratictioners

9 Maria Grazia Pia The inception phase Formulating the scope of the project –capturing the context and the most important requirements and constraints Planning –project plan, risk management, staffing etc. Synthesizing a candidate architecture –to demonstrate feasibility through some kind of proof of concept Preparing the environment for the project Capture User Requirements Select a simulation framework Identify a candidate architecture

10 Maria Grazia Pia Capture User Requirements Define the scope of the software system to be built (“what it should do”)

11 Maria Grazia Pia User Requirements

12 Maria Grazia Pia Select a simulation framework

13 Maria Grazia Pia Lifetime of LHC software = 25 yrs WWW Thanks to Dino Ferrero Merlino(IT)

14 Maria Grazia Pia EGS4, EGS5, EGSnrc Geant3, Geant4 MARS MCNP, MCNPX, A3MCNP, MCNP-DSP, MCNP4B MVP, MVP-BURN Penelope Peregrine Tripoli-3, Tripoli-3 A, Tripoli-4 DPM EA-MC FLUKA GEM HERMES LAHET MCBEND MCU MF3D NMTC MONK MORSE RTS&T-2000 SCALE TRAX VMC++...and I probably forgot some more Many codes not publicly distributed A lot of business around MC The zoo Monte Carlo codes presented at the MC200 Conference, Lisbon, October 2000

15 Maria Grazia Pia What is ? OO Toolkit for the simulation of next generation HEP detectors general infrastructure Geant4 provides a general infrastructure for –modeling geometry and materials –particle transport and interactions with matter –describing detector response –visualisation of geometries, tracks and hits specific code The user develops specific code for –the primary event generator –the geometrical description of the set-up –the digitisation of the detector response –...of the current generation too –...not only of HEP detectors already used also in nuclear physics, medical physics, space applications, radiation background studies etc.

16 Maria Grazia Pia The Toolkit approach components A toolkit is a set of compatible components specialised –each component is specialised for a specific functionality refined –each component can be refined independently to a great detail integrated –components can be integrated at any degree of complexity alternative –it is easy to provide (and use) alternative components customised –the simulation application can be customised by the user according to his/her needs –maintenance evolution –maintenance and evolution - both of the components and of the user application - is greatly facilitated...but what is the price to pay? –the user is invested of a greater responsibility –he/she must critically evaluate what he/she needs and wants to use

17 Maria Grazia Pia Domain decomposition hierarchical structure of sub-domains Geant4 architecture Uni-directional flow of dependencies Interface to external products w/o dependencies Software Engineering plays a fundamental role in Geant4 User Requirements formally collected systematically updated PSS-05 standard Software Process spiral iterative approach regular assessments and improvements (SPI process) monitored following the ISO 15504 model Quality Assurance commercial tools code inspections automatic checks of coding guidelines testing procedures at unit and integration level dedicated testing team Object Oriented methods OOAD use of CASE tools openness to extension and evolution contribute to the transparency of physics interface to external software without dependencies Use of Standards de jure and de facto

18 Maria Grazia Pia Identify a candidate architecture

19 Maria Grazia Pia

20 The elaboration Refining the vision –a solid understanding of the most critical use cases Defining, validating and refining the architecture Iteration plans for the construction phase Putting in place the development environment Use case realizations Architecture (based on the Geant4 framework) Priorities of requirements: plan iterations

21 Maria Grazia Pia Detector description Detector response Primary event generation Management Physics Visualisation Analysis Architecture

22 Maria Grazia Pia Initialisation Describe a geometrical set-up : a Si-W tracker, a CsI calorimeter and an anti-coincidence system made out of plastic scintillators. Activate electromagnetic/hadronic processes appropriate to the energy range of the experiment

23 Maria Grazia Pia Beam On Generate primary events according to various distributions relevant to gamma astrophysics

24 Maria Grazia Pia Event processing Record the coordinates of impact of tracks in the tracker layers Record the energy deposited in each element of the calorimeter at every event

25 Maria Grazia Pia The kernel Run and event multiple events –possibility to handle the pile-up multiple runs in the same job –with different geometries, materials etc. powerful stacking mechanism –three levels by default: handle trigger studies, loopers etc.Tracking decoupled from physics: all processes handled through the same abstract interface tracking is independent from particle type it is possible to add new physics processes without affecting the tracking Geant4 has only production thresholds, no tracking cuts l all particles are tracked down to zero range l energy, TOF... cuts can be defined by the user

26 Maria Grazia Pia The construction Completing the –analysis –design –development –testing of all required functionality

27 Maria Grazia Pia Detailing the design

28 Maria Grazia Pia Materials Different kinds of materials can be defined –isotopesG4Isotope –elementsG4Element –moleculesG4Material –compounds and mixturesG4Material Attributes associated: –temperature –pressure –state –density Describe a geometrical set-up : a Si-W tracker, a CsI calorimeter and an anti-coincidence system made out of plastic scintillators.

29 Maria Grazia Pia Geometry Borexino CMS ATLAS Chandra Role: detailed detector description and efficient navigation CSG CSG (Constructed Solid Geometries) - simple solids STEP extensions - polyhedra,, spheres, cylinders, cones, toroids, etc. BREPS (Boundary REPresented Solids) - volumes defined by boundary surfaces - include solids defined by NURBS (Non-Uniform Rational B-Splines) External tool for g3tog4 geometry conversion Multiple representations (same abstract interface) CAD exchange: ISO STEP interface Fields: of variable non-uniformity and differentiability BaBar ATLAS

30 Maria Grazia Pia How to define detector geometry Three conceptual layers –G4VSolid: shape, size –G4LogicalVolume: daughter volumes, material, sensitivity etc. –G4VPhysicalVolume: position, rotation Placement: one positioned volume Repeated: a volume placed many times –reduces use of memory –Replica: simple repetition (e.g. divisions) –Parameterised repeated placement

31 Maria Grazia Pia Read-out Geometry Readout geometry is a virtual and artificial geometry sensitive detector it is associated to a sensitive detector can be defined in parallel to the real detector geometry helps optimising the performance

32 Maria Grazia Pia

33 DetectorConstruction // Calorimeter Structure (CALLayerX + CALLayerY) Solid // Solid solidCALLayerX = new G4Box("CALLayerX", CALSizeXY/2, CALSizeXY/2, CALBarThickness/2); Logical volume // Logical volume logicCALLayerX = new G4LogicalVolume(solidCALLayerX, CALMaterial, "CALLayerX"); Physical volume // Physical volume for (G4int i = 0; i < NbOfCALLayers; i++) { physiCALLayerY = new G4PVPlacement(…); physiCALLayerX = new G4PVPlacement(…); … }

34 Maria Grazia Pia Hits and Digis A sensitive detector creates hits using the information provided by G4Step One can store various types of information in a hit –position and time of the step –momentum and energy of the track –energy deposition of the step –geometrical information –etc. A Digi represents a detector output –e.g. ADC/TDC count, trigger signal A Digi is created with one or more hits and/or other digits Hits collections are accessible –through G4Event at the end of an event –through G4SDManager during processing an event The digitise() method of each G4VDigitizerModule must be explicitly invoked by the user ’ s code –e.g. in the UserEventAction Record the coordinates of impact of tracks in the layers of the tracker. Record the energy deposited in each element of the calorimeter at every event.

35 Maria Grazia Pia Hits and Digis

36 Maria Grazia Pia Hits in our example Each tracker hit contains the following information: ID of the event (this is important for multiple events run) Energy deposition of the particle in the strip Number of the strip Number of the plane Type of the plane Position of the hit (x,y,z) in the reference frame of the payload

37 Maria Grazia Pia Generating primary particles Interface to Event Generators –through ASCII file for generators supporting /HEPEVT/ –abstract interface to Lund++ Various utilities provided within the Geant4 Toolkit –ParticleGun beam of selectable particle type, energy etc. –GeneralParticleSource provides sophisticated facilities to model a particle source used to model space radiation environments, sources of radioactivity in underground experiments etc. –you can write your own, inheriting from G4VUserPrimaryGeneratorActionParticles –all PDG data –and more, for specific Geant4 use, like ions Generate primary events according to various distributions relevant to  astrophysics

38 Maria Grazia Pia Primary generator in our example GammaRayTelParticleGenerationAction and its Messenger are responsible for the generation of primary particles and the related configuration through the UI Define the incident flux of particles: –from a specific direction –or from an isotropic background Choose also between two spectral options: –monochromatic –or with a power-law dependence The particle generator parameters are accessible through the UI –/gun/ tree

39 Maria Grazia Pia Physics From the Minutes of LCB (LHCC Computing Board) meeting on 21 October, 1997: “It was noted that experiments have requirements for independent, alternative physics models. In Geant4 these models, differently from the concept of packages, allow the user to understand how the results are produced, and hence improve the physics validation. Geant4 is developed with a modular architecture and is the ideal framework where existing components are integrated and new models continue to be developed.” Activate electromagnetic and hadronic processes appropriate to the energy range of the experiment

40 Maria Grazia Pia Physics: general features Ample variety of physics functionalities Modular design, at a fine granularity, to expose the physics Uniform treatment of electromagnetic and hadronic processes Abstract interface to physics processes –tracking independent from physics Distinction between processes and models –often multiple models for the same physics process (complementary/alternative) Transparency (supported by encapsulation and polymorfism) –calculation of cross-sections independent from the way they are accessed (data files, analytical formulae etc.) –distinction between the calculation of cross sections and their use –calculation of the final state independent from tracking Open system –users can easily create and use their own models

41 Maria Grazia Pia Data libraries Systematic collection and evaluation of experimental data from many sources worldwideDatabases –ENDF/B, JENDL, FENDL, CENDL, ENSDF,JEF, BROND, EFF, MENDL, IRDF, SAID, EPDL, EEDL, EADL, SANDIA, ICRU etc. Collaborating distribution centres – NEA, LLNL, BNL, KEK, IAEA, IHEP, TRIUMF, FNAL, Helsinki, Durham, Japan etc. The use of evaluated data is important for the validation of physics results of the experiments 41

42 Maria Grazia Pia Processes Processes describe how particles interact with material or with a volume Three basic types –At rest process (eg. decay at rest) –Continuous process (eg. ionization) –Discrete process (eg. decay in flight) Transportation is a process –interacting with volume boundary A process which requires the shortest interaction length limits the step

43 Maria Grazia Pia Multiple scattering Bremsstrahlung Ionisation Annihilation Photoelectric effect Compton scattering Rayleigh effect  conversion e + e - pair production Synchrotron radiation Transition radiation Cherenkov Refraction Reflection Absorption Scintillation Fluorescence Auger (in progress) Electromagnetic physics High energy extensions –needed for LHC experiments, cosmic ray experiments… Low energy extensions –fundamental for space and medical applications, dark matter and  experiments, antimatter spectroscopy etc. Alternative models for the same process energy loss  electrons and positrons , X-ray and optical photons muons n charged hadrons n ions Comparable to Geant3 already in the  release (1997) Further extensions (facilitated by the OO technology) All obeying to the same abstract Process interface  transparent to tracking

44 Maria Grazia Pia Standard electromagnetic processes Multiple scattering –new model (by L. Urbán) –computes mean free path length and lateral displacement New energy loss algorithm –optimises the generation of  rays near boundaries Variety of models Variety of models for ionisation and energy loss –including PhotoAbsorption Interaction model (for thin layers) Many optimised features –Secondaries produced only when needed –Sub-threshold production Multiple scattering 6.56 MeV proton, 92.6 mm Si J.Vincour and P.Bem Nucl.Instr.Meth. 148. (1978) 399 1 keV up to O(100 TeV) Geant4 Geant3 data Old plot, further improvements with a new model

45 Maria Grazia Pia Low Energy electromagnetic Processes: e, 

46 Maria Grazia Pia Low energy e.m. extensions e,  down to 250 eV (EGS4, ITS to 1 keV, Geant3 to 10 keV) Fundamental for neutrino/dark matter experiments, space and medical applications, antimatter spectroscopy etc. Hadron and ion models based on Ziegler and ICRU data and parameterisations Barkas effect (charge dependence) models for negative hadrons Based on EPDL97, EEDL and EADL evaluated data libraries Bragg peak shell effects Photon attenuation antiprotons protons ions

47 Maria Grazia Pia GammaRayTelPhysicsList … if (particleName == "gamma") { // gamma pManager->AddDiscreteProcess(new G4PhotoElectricEffect()); pManager->AddDiscreteProcess(new G4ComptonScattering()); pManager->AddDiscreteProcess(new G4GammaConversion()); } else if (particleName == "e-") { // electron pManager->AddProcess(new G4MultipleScattering(),-1, 1,1); pManager->AddProcess(new G4eIonisation(), -1, 2,2); pManager->AddProcess(new G4eBremsstrahlung(), -1,-1,3); } else if (particleName == "e+") { // positron pManager->AddProcess(new G4MultipleScattering(),-1, 1,1); pManager->AddProcess(new G4eIonisation(), -1, 2,2); pManager->AddProcess(new G4eBremsstrahlung(), -1,-1,3); pManager->AddProcess(new G4eplusAnnihilation(), 0,-1,4); … SetCutValue(cutForGamma, "gamma"); SetCutValue(cutForElectron, "e-"); SetCutValue(cutForElectron, "e+"); select physics processes to be activated for each particle type set production thresholds

48 Maria Grazia Pia Highlights of Geant4 Hadronic Physics and more about Electromagnetic Physics in tomorrow’s lecture …

49 Maria Grazia Pia Now we can run our simulation, track particles, produce showers and record the effects in the detectors… …but our job is not limited to simulation only

50 Maria Grazia Pia Collaborating Frameworks Simulation –to model the experimental setup and generate effects from particle interactions User Interface –to control configuration and flow of execution Visualisation –detector geometry, particle tracks, hits etc. Analysis –histogramming of physics quantities In our application:

51 Maria Grazia Pia Components and Frameworks Frameworks are composed of components Abstract Interfacesde-couple Abstract Interfaces de-couple components and frameworksFrameworks –correlated groups of classes (components) together with their interactions –re-usable (generic) designs of a software system on a very high abstraction level –flow of control is bi-directional between application and the framework libraryComponent –a correlated group of classes together with their interactions –reusable design of (part of) a software system on a low or medium abstraction level Weakly coupled components and frameworks have large advantages –ease of re-use of component or framework –flexibility through independence of implementation –maintainability through independent evolution of components

52 Maria Grazia Pia Similar approach Interface to external tools in Geant4 no dependence minimize coupling of components Through abstract interfaces Visualisation (G)UI Persistency Analysis The user is free to choose the concrete system he/she prefers for each component

53 Maria Grazia Pia Visualisation in Geant4 Control of several kinds of visualisation –detector geometry –particle trajectories –hits in the detectors Using abstract G4VisManager class –takes 3-D data from geometry/track/hits –passes on to abstract visualization driver G4VGraphicsSystem (initialization) G4VSceneHandler (processing 3-D data for visualisation) G4VViewer (rendering the processed 3-D data) Various drivers –OpenGL, OpenInventor, X11, Postscript, DAWN, OPACS, VRML… Visualise the experimental set-up Visualise tracks in the experimental set-up Visualise hits

54 Maria Grazia Pia User Interface in Geant4 Two phases of user user actions –setup of simulation –control of event generation and processing User Interface category separated from actual command interpreter (intercoms) –using abstract G4UIsession class –several implementations exist command-line (batch and terminal) GUIs (X11/Motif, GAG, MOMO, OPACS, Java) Automatic code generation for geometry and materials (GGE, GPE) Configure the tracker, by modifying the number of active planes, the pitch of the strips, the area of silicon tiles, the material of the converter Configure the calorimeter, by modifying the number of active elements, the number of layers Configure the source Configure digitisation by modifying the threshold Configure the histograms

55 Maria Grazia Pia Persistency in Geant4 Geant4 Persistency makes run, event, hits, digits and geometry information be persistent, to be read back later by user programs –no dependence on any specific persistency model –use industrial standard ODMG C++ binding and HepODBMS as persistency interface Possibility to run in transient or persistent mode Produce an intermediate output of the simulation at the level of hits in the tracker Store( ) Retrieve( ) Inherits from HepPersObj in HepODBMS G4 kernel objects have corresponding “P” objects in G4Persistency G4Run  G4PRun G4Event  G4PEvent G4Hit  G4PHit : G4 kernel objects have corresponding “P” objects in G4Persistency G4Run  G4PRun G4Event  G4PEvent G4Hit  G4PHit : “Parallel World” approach Data members of transient and persistent objects are copied by Store( ) and Retrieve( )

56 Maria Grazia Pia The analysis frameworkLizard Plot the x-y distribution of impact of the track Plot the energy distribution in the calorimeter. Store significant quantities in a ntuple (energy release in the strips, hit strips) for further analysis Plot histograms during the simulation execution. COLTJASOpenScientist

57 Maria Grazia Pia AIDA Abstract Interfaces for Data Analysis (in HEP) abstract interfaces physics analysis tools exchange data  “The goals of the AIDA project are to define abstract interfaces for common physics analysis tools, such as histograms. The adoption of these interfaces should make it easier for developers and users to select to use different tools without having to learn new interfaces or change their code. In addition it should be possible to exchange data (objects) between AIDA compliant applications.” ( Unify/standardize “look and feel” for various tools –there is no longer “only one tool” flexibility Provide flexibility to interchange implementations of these interfaces –can use specific features of specific tools w/o change! re-use Allows and try to re-use existing packages –even across “language boundaries” e.g., C++ analysis using Java Histograms Minimize coupling Minimize coupling between components

58 Maria Grazia Pia Abstract Interfaces pure virtualinheritance Only pure virtual methods, inheritance only from other Abstract Interfaces use Components use other components only through their Abstract Interfaces protocol Defines a kind of a “protocol” for a component flexibility re-use Maximize flexibility and re-use of packages Allow each component to develop independently implementationuse De-couple the implementation of a component from its use

59 Maria Grazia Pia Use of Components with Abstract Interfaces User Code uses only Interface classes –IHistogram1D* hist = histoFactory-> create1D(‘track quality’, 100, 0., 10.) Actual implementations are selected at run-time –loading of shared libraries No change at all to user code but keep freedom to choose implementation –flexible –customizable Histo- Impl. 2 Histo-IFFitter-IF User Code Fitter- Impl. Y Histo- Impl. 1 Fitter- Impl. X

60 Maria Grazia Pia Architectural issue: Components functionality Identify components by functionality Define “protocol” using Abstract Interfaces different aspects Emphasize separation of different aspects for each component –example: Histogram statistical entity statistical entity (density distribution of a physics quantity) view view of a “collection of data points” (which can be a density distribution but also a detector efficiency curve) command command to manipulate/store/plot/fit/... “User’s view” is different from “developer’s view” –separate Abstract Interfaces for both aspects UserInterface UserInterface as a separate component –by definition couples to most of the other components weak coupling –promotes weak coupling between the other components –interfaces to scripting and/or GUI

61 Maria Grazia Pia Initial categories and dependencies

62 Maria Grazia Pia Anaphe: what it is Modular (OO/C++) replacement of CERNLIB functionality for use in HEP experiments –memory management –I/O –foundation classes –histogramming –minimizing/fitting –visualization –interactive data analysis Trying to use standards wherever possible Trying to re-use existing class libraries

63 Maria Grazia Pia

64 Anaphe Abstract Interfaces

65 Maria Grazia Pia Anaphe components

66 Maria Grazia Pia Lizard Un tool di analisi interattiva AIDA compatibile –Python scripting –Visualizzazione con Qt –Istogrammi HTL (via AIDA) –Persistenza con Objectivity (o “licence-free”) –Fitting con NAG Libraries (o Minuit) Componenti disponibili come shared libraries –indipendenti dal linguaggio di scripting

67 Maria Grazia Pia Design and implementation in our example Based on AIDA –independent from any concrete Analysis Tool Online histogramming –provides fast feedback Java Analysis Studio

68 Maria Grazia Pia Are we done? Not yet… Did we satisfy all the original requests? Which element of the design does a requirement correspond to? Which requirement does a design element correspond to? Same for the implementation… Did we test that each requirement has been correctly satisfied? Did we provide documentation for usage? Where are we now in the process of producing our software product?

69 Maria Grazia Pia Traceability Traceability is the ability to trace a project element to other related project elements From RUP

70 Maria Grazia Pia A simple example of traceability through User Requirements, Design, Implementation, Test Iterative and incremental process Every release cycle increments the functionality, until all requirements are satisfied

71 Maria Grazia Pia The transition phase In most cases our software is used in the wider context of an experiment Geant4 GammaRayTelescope advanced example Developed by Riccardo Giannitrapani, Francesco Longo, Giovanni Santin (INFN TS/UD) geant4/examples/advanced/gammaray_telescope/ –documentation –training collaborators to use our software –feedback from users –maintenance …start an evolutionary cycle for a new version of our software

72 Maria Grazia Pia Courtesy of F. Longo and R. Giannitrapani, GLAST GLAST Credit: Hytec GLAST  ray telescope Preliminary

73 Maria Grazia Pia Geant4 advanced examples  -ray telescope X-ray telescope Underground physics and radiation background X-ray fluorescence Brachytherapy Full scale applications showing physics guidelines, advanced interactive facilities and usage of OO Analysis Tools in real-life set-ups GaAs lines Fe lines fluorescence

Download ppt "Maria Grazia Pia Usage and results Maria Grazia Pia INFN Genova Budker Inst. of Physics IHEP Protvino MEPHI Moscow Pittsburg University."

Similar presentations

Ads by Google