Detector Description - Advanced

Slides:



Advertisements
Similar presentations
Parameterizing a Geometry using the COMSOL Moving Mesh Feature
Advertisements

Geant4 v9.2p02 Geometry I Makoto Asai (SLAC) Geant4 Tutorial Course.
Review for Test 3.
APPLICATIONS OF INTEGRATION
CS447/ Realistic Rendering -- Solids Modeling -- Introduction to 2D and 3D Computer Graphics.
Geant4 v9.2p02 Geometry IV Makoto Asai (SLAC) Geant4 Tutorial Course.
Makoto Asai (SLAC) Geant4 Tutorial Course
Defining Material and Geometry Makoto Asai (SLAC) Geant4 Tutorial Course the 2nd Finnish Geant4 Workshop June , Helsinki Institute of Physics June.
Geometry IV Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.
Geant4 v9.4 Geometry II Makoto Asai (SLAC) Geant4 Tutorial Course.
Detector Description Gabriele Cosmo, Geant4 Users’ Workshop Tutorial SLAC February 18-22, 2002.
Geometry I Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.
1 Geometry A line in 3D space is represented by  S is a point on the line, and V is the direction along which the line runs  Any point P on the line.
Detector Description Gabriele Cosmo, Geant4 Users’ Workshop Tutorial SLAC February 18-22, 2002.
Geant4 v9.4 Geometry II Makoto Asai (SLAC) Geant4 Tutorial Course.
Geometry II Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.
Geometry III Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.
3-D Modeling Concepts V part 2.
V part 2 Obtained from a Guildford County workshop- Summer, 2014.
Geometry 5 I.Hrivnacova¹, J.Apostolakis² ¹IPN, Orsay; ²CERN Cours Paris June 2007.
Detector Description – basic concepts The full set of lecture notes of this Geant4 Course is available at
Modeling and representation 1 – comparative review and polygon mesh models 2.1 Introduction 2.2 Polygonal representation of three-dimensional objects 2.3.
Geant4 Geometry – building your virtual experiment
Detector Description – advanced features The full set of lecture notes of this Geant4 Course is available at
COMP 175: Computer Graphics March 24, 2015
Detector Description – Part II Ivana Hrivnacova, IPN Orsay Tatiana Nikitina, CERN Aknowledgement: Slides by: J.Apostolakis, G.Cosmo, A. Lechner.
Geometry Detector geometry A detector geometry in Geant4 is made of a number of volumes. The largest volume is called the World volume. It must contain.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Maria Grazia Pia Detector Response Acknowledgements: A. Lechner, J. Apostolakis, M. Asai, G. Cosmo, A. Howard.
Field propagation in Geant4 John Apostolakis 25 th May 2005 Ver. 
Field propagation in Geant4 John Apostolakis, CERN Ecole Geant June 2007, Paris 25 th May 2005 Ver. 
Detector Description: Sensitive Detector & Field
Detector Description: Basics
Geometry 4 I.Hrivnacova IPN, Orsay Most slides thanks to M. Asai, SLAC Cours Paris June 2007.
Detector Description – Part III Ivana Hrivnacova, IPN Orsay Tatiana Nikitina, CERN Aknowledgement: Slides by: J.Apostolakis, G.Cosmo, A. Lechner.
Outline  Developments/fixes in the last year  Introduced in release 9.6 and patches  Planned for release 10.0 and ongoing …  Currently under development.
Detector Description: Basics
Detector Description – basic concepts The full set of lecture notes of this Geant4 Course is available at
Geant4 release 5.1 summary Gabriele Cosmo EP/SFT.
Geometry 3 I.Hrivnacova IPN, Orsay Most slides thanks to M. Asai, SLAC Cours Paris June 2007.
Geometry and Fields: Further and advanced features J. Apostolakis & G. Cosmo.
Unstructured Meshing Tools for Fusion Plasma Simulations
3-D Modeling Concepts V part 2.
Fits and Tolerances: Linear and Geometry.
Detector Description: Advanced Features
Lecture 5 Basic geometric objects
3-D Modeling Concepts V part 2.
Detector Description - Advanced
Geant4 Geometry Speed-ups
Detector Description – advanced features
In this section, we will learn about: Using integration to find out
Sketching.
Direct Manipulator Kinematics
Detector Description – basic concepts
Geant4: Detector description Gabriele Cosmo,
Fitting Curve Models to Edges
Field propagation in Geant4
Detector Description – advanced features
Makoto Asai (SLAC) Geant4 Tutorial Course
Geant4: Detector description module Authors: J.Apostolakis, G.Cosmo
3-D Modeling Concepts V part B.
Field propagation in Geant4
In this chapter, you will learn the following:
Field propagation in Geant4
3-D Modeling Concepts V part 2.
3-D Modeling Concepts Part 2.
Field propagation in Geant4
Marc Verderi GEANT4 collaboration meeting 01/10/2002
Based on a presentation of M.Verderi
GPAT – Chapter 7 Physics.
Presentation transcript:

Detector Description - Advanced Geant4: Detector description module Detector Description - Advanced http://geant4.cern.ch

Detector Description: Replicas PART I Detector Description: Replicas

Replicated Physical Volumes Geant4: Detector description module Replicated Physical Volumes repeated The mother volume can be sliced into replicas, all of the same size and dimensions. Represents many detector elements differing only in their positioning. Replication may occur along: Cartesian axes (X, Y, Z) – slices are considered perpendicular to the axis of replication Coordinate system at the center of each replica Radial axis (Rho) – cons/tubs sections centered on the origin and un-rotated Coordinate system same as the mother Phi axis (Phi) – phi sections or wedges, of cons/tubs form Coordinate system rotated such as that the X axis bisects the angle made by each wedge The elements positions are calculated by means of a simple linear formula, and the elements completely fill the containing mother volume. If a G4PVReplica is positioned inside a given mother, it must be the only daughter volume for that mother. During tracking, translation and rotation of each replica object are computed according to the current active replication. Detector Description - Geant4 Course

Geant4: Detector description module a daughter volume to be replicated mother volume G4PVReplica G4PVReplica(const G4String& pName, G4LogicalVolume* pCurrentLogical, G4LogicalVolume* pMotherLogical, const EAxis pAxis, const G4int nReplicas, const G4double width, const G4double offset=0); An offset can only be associated to a mother offset along the axis of replication Features and restrictions: Replicas can be placed inside other replicas Normal placement volumes can be placed inside replicas, assuming no intersection/overlaps with the mother volume or with other replicas No volume can be placed inside a radial replication Parameterised volumes cannot be placed inside a replica The width of the replica refers to its extent along the axis of replication. Detector Description - Geant4 Course

Replica – axis, width, offset Cartesian axes - kXaxis, kYaxis, kZaxis offset not be used Center of n-th daughter is given as -width*(nReplicas-1)*0.5+n*width Radial axis - kRaxis width*(n+0.5)+offset Phi axis - kPhi offset width Detector Description - Geant4 Course

Replication example – 6 sectors of a cylinder Geant4: Detector description module Replication example – 6 sectors of a cylinder G4double tube_dPhi = twopi; G4VSolid* tube = new G4Tubs("tube", 20*cm, 50*cm, 30*cm, 0., tube_dPhi*rad); G4LogicalVolume * tube_log = new G4LogicalVolume(tube, Ar, "tubeL", 0, 0, 0); G4VPhysicalVolume* tube_phys = new G4PVPlacement(0,G4ThreeVector(-200.*cm, 0., 0.*cm), "tubeP", tube_log, world_phys, false, 0); G4double divided_tube_dPhi = twopi/6.; G4VSolid* divided_tube = new G4Tubs("divided_tube", 20*cm, 50*cm, 30*cm, -divided_tube_dPhi/2.*rad, divided_tube_dPhi*rad); G4LogicalVolume* divided_tube_log = new G4LogicalVolume(divided_tube, Ar, "div_tubeL", 0, 0, 0); G4VPhysicalVolume* divided_tube_phys = new G4PVReplica("divided_tube_phys", divided_tube_log, tube_log,kPhi, 6, divided_tube_dPhi); mother volume logical volume to be replicated Example of replication in Phi 6 replicas along the kPhi axis, of width 2p/6 # of replicas width Detector Description - Geant4 Course

Geant4: Detector description module PART II Detector Description: Advanced solids, booleans

BREPS: G4BREPSolidPolyhedra Geant4: Detector description module BREPS: G4BREPSolidPolyhedra G4BREPSolidPolyhedra(const G4String& pName, G4double phiStart, G4double phiTotal, G4int sides, G4int nZplanes, G4double zStart, const G4double zval[], const G4double rmin[], const G4double rmax[]); sides - numbers of sides of each polygon in the x-y plane nZplanes - numbers of planes perpendicular to the z axis zval[] - z coordinates of each plane rmin[], rmax[] - Radii of inner and outer polygon at each plane In picture: #define VECSIZE 6 G4int sides = 5; G4double rmin[VECSIZE] = { 100*mm, 100*mm, 100*mm, 100*mm, 100*mm, 100*mm }; G4double rmax[VECSIZE] = { 700*mm, 800*mm, 400*mm, 400*mm, 600*mm, 500*mm }; G4double zval[VECSIZE] = { 3500*mm, 3800*mm, 4000*mm, 4300*mm, 4500*mm, 5000*mm }; G4BREPSolidPolyhedra *sphedra = new G4BREPSolidPolyhedra( "sphedra", pi/2*rad, 2*pi*rad, sides, VECSIZE, zval[0], zval, rmin, rmax); G4LogicalVolume *lvphedra = new G4LogicalVolume( sphedra, Al, "lvphedra" ); G4PVPlacement *pvphedra = new G4PVPlacement( 0, G4ThreeVector(), "pvphedra1", lvphedra, worldPhysic, false, 0 ); Detector Description - Geant4 Course

Geant4: Detector description module Boolean Solids Geant4: Detector description module Solids can be combined using boolean operations: G4UnionSolid, G4SubtractionSolid, G4IntersectionSolid Requires: 2 solids, 1 boolean operation, and an (optional) transformation for the 2nd solid 2nd solid is positioned relative to the coordinate system of the 1st solid Result of boolean operation becomes a solid. Thus the third solid can be combined to the resulting solid of first operation. Solids to be combined can be either CSG or other Boolean solids. Note: tracking cost for the navigation in a complex Boolean solid is proportional to the number of constituent CSG solids G4UnionSolid G4SubtractionSolid G4IntersectionSolid Passive transformation: a rotation matrix/translation is provided to transform the coordinate system of the 1st solid to the coordinate system of the 2nd solid. The final transformation in this case is NOT copied, therefore, once defined and used it must not be modified. Active transformation: a transformation (G4Transform3D) is first created to move the 2nd solid to the correct position. The transformation in this case is stored (copied) in the final boolean solid. Detector Description - Geant4 Course

Geant4: Detector description module Boolean solid Detector Description - Geant4 Course

Boolean solids, example Geant4: Detector description module Boolean solids, example G4VSolid* box = new G4Box(“Box",50*cm,60*cm,40*cm); G4VSolid* cylinder = new G4Tubs(“Cylinder”,0.,50.*cm,50.*cm,0.,2*M_PI*rad); G4VSolid* union = new G4UnionSolid("Box+Cylinder", box, cylinder); G4VSolid* subtract = new G4SubtractionSolid("Box-Cylinder", box, cylinder, 0, G4ThreeVector(30.*cm,0.,0.)); G4RotationMatrix* rm = new G4RotationMatrix(); rm->RotateX(30.*deg); G4VSolid* intersect = new G4IntersectionSolid("Box&&Cylinder", box, cylinder, rm, G4ThreeVector(0.,0.,0.)); The origin and the coordinates of the combined solid are the same as those of the first solid. translation rotation Detector Description - Geant4 Course

Geant4: Detector description module PART III Detector Description: Magnetic fields

Geant4: Detector description module Field integration To propagate a particle inside a field  solve the equation of motion of the particle in the field (e.g. using the Runge-Kutta method for the integration of the equations of motion). In specific cases other solvers can also be used: In a uniform field, using the analytical solution. In a smooth but varying field, with RK+helix. Using the method to calculate the track's motion in a field, Geant4 breaks up this curved path into linear chord segments. We determine the chord segments so that they closely approximate the curved path. ‘Tracking’ Step Chords Real Trajectory Detector Description - Geant4 Course

Geant4: Detector description module Tracking in field Use the chords to interrogate the G4Navigator, to see whether the track has crossed a volume boundary. One physics/tracking step can create several chords. In some cases, one step consists of several helix turns. User can set the accuracy of the volume intersection, By setting a parameter called the “miss distance” It is a measure of the error in whether the approximate track intersects a volume. It is quite expensive in CPU performance to set too small “miss distance”. ‘Tracking’ Step Chords Real Trajectory "miss distance" Detector Description - Geant4 Course

Geant4: Detector description module Magnetic field (1) Create your Magnetic field class Uniform field : Use an object of the G4UniformMagField class G4MagneticField* magField = new G4UniformMagField(G4ThreeVector(1.*Tesla,0.,0.); Non-uniform field : Create your own concrete class derived from G4MagneticField and implement GetFieldValue() void MyField::GetFieldValue(const double Point[4], double *field) const Points[0..2] are position in global coordinate system, Point[3] is time, field[0..2] are returning magnetic field Detector Description - Geant4 Course

Geant4: Detector description module Magnetic field (2) Tell Geant4 to use your field: Retrieve the global Field Manager from G4TransportationManager G4FieldManager* globalFieldMgr = G4TransportationManager::GetTransportationManager() ->GetFieldManager(); Register the field to the FieldManager, globalFieldMgr->SetDetectorField(magField); and create a Chord Finder globalFieldMgr->CreateChordFinder(magField); /example/novice/N04 is a good starting point Detector Description - Geant4 Course

Geant4: Detector description module PART IV Detector Description: Regions and cut-per-region

Detector Description - Geant4 Course Cuts by Region Geant4 has had a unique production threshold (‘cut’) expressed in length (i.e. minimum range of secondary) For all volumes, but possibly different for each particle (e+, e-, g-rays). Appropriate length scales can vary greatly between different areas of a large detector E.g. a vertex detector (5 mm) and a muon detector (2.5 cm) Having a unique (low) cut can create a performance penalty Now Geant4 allows for several cuts Globally or per particle Enabling the tuning of production thresholds at the level of a sub-detector, i.e. region Cuts are applied only for g, electron and positron and only for processes which have infrared divergence (e.g. soft d-rays or soft bremsstrahlung photons) Detector Description - Geant4 Course

Geant4: Detector description module Detector Region Concept of region: Set of geometry volumes, typically of a sub-system barrel + end-caps of the calorimeter; “Deep” areas of support structures can be a region. Or any group of volumes A set of cuts in range is associated to a region a different range cut for each particle among g, e-, e+ is allowed in a region Region B Default Region B Region A C Some Details: A region - Has one or several ‘root’ volumes The world is in a predefined ‘default region’ Detector Description - Geant4 Course

World Volume - Default Region Region and cut World Volume - Default Region Root logical - Region A Root logical - Region B Each region has its unique set of cuts. World volume is recognized as the default region. The default cuts defined in Physics list are used for it. A logical volume becomes a root logical volume once it is assigned to a region. All daughter volumes belonging to the root logical volume share the same region (and cut), unless a daughter volume itself becomes to another root Important restriction : No logical volume can be shared by more than one regions, regardless of root volume or not Detector Description - Geant4 Course

Region and cut – how to use create a region G4Region* emCalorimeter = new G4Region("EM-Calorimeter"); emCalorimeter->AddRootLogicalVolume(emCalorimeterLV); [...] G4String regName = “EM-calorimeter"; G4Region* region = G4RegionStore::GetInstance()->GetRegion(regName); cuts = new G4ProductionCuts; cuts->SetProductionCut(0.01*mm,G4ProductionCuts::GetIndex("gamma")); cuts->SetProductionCut(0.1*mm,G4ProductionCuts::GetIndex("e-")); cuts->SetProductionCut(0.1*mm,G4ProductionCuts::GetIndex("e+")); region->SetProductionCuts(cuts); attach a logical volume to the region retrieve a region create production cuts attach cuts to the region Detector Description - Geant4 Course

Geant4: Detector description module PART V Detector Description: Additional tools and debugging

Computing volumes and masses Geant4: Detector description module Computing volumes and masses Geometrical volume of a generic solid or boolean composition can be computed from the solid: G4double GetCubicVolume(); Overall mass of a geometry setup (subdetector) can be computed from the logical volume (mass of daughters can be subtracted): G4double GetMass(G4Bool forced=false, G4Material* parameterisedMaterial=0); This may take a long computing time, for complex geometries GetCubicVolume: Returns an estimation of the solid volume in internal units. Should be overloaded by the concrete solid implementation to perform exact computation of the volume quantity and eventually “cache” the computed value, such that it is NOT recomputed each time the method is called. GetMass: Returns the mass of the logical-volume tree computed from the estimated geometrical volume of each solid and material associated to the logical volume and its daughters. The computation may require a considerable amount of time, depending from the complexity of the geometry tree. The returned value is cached and can be used for successive calls (default), unless re-computation is forced by providing 'true' for the ‘forced’ argument in input. Computation should be forced if the geometry setup has changed after the previous call. An optional argument to specify a parameterised material is provided. Detector Description - Geant4 Course

Geant4: Detector description module Debugging geometries An overlapping volume is a contained volume which actually protrudes from its mother volume Volumes are also often positioned in a same volume with the intent of not provoking intersections between themselves. When volumes in a common mother actually intersect themselves are defined as overlapping Geant4 does not allow for malformed geometries: a point in the space cannot be univocally assigned to a physical volume The problem of detecting overlaps between volumes is bounded by the complexity of the solid models description You may have warnings or loops in the simulation Utilities are provided for detecting wrong positioning Graphical tools Kernel commands and built-in utilities Detector Description - Geant4 Course

Debugging tools: DAVID Geant4: Detector description module Debugging tools: DAVID DAVID is a graphical debugging tool for detecting potential intersections of volumes Accuracy of the graphical representation can be tuned to the exact geometrical description. physical-volume surfaces are automatically decomposed into 3D polygons intersections of the generated polygons are parsed. If a polygon intersects with another one, the physical volumes associated to these polygons are highlighted in color (red is the default). DAVID can be downloaded from the Web as external tool for Geant4 http://geant4.kek.jp/GEANT4/vis/DAWN/About_DAVID.html Detector Description - Geant4 Course

Debugging run-time commands Geant4: Detector description module Debugging run-time commands Built-in run-time commands to activate verification tests for the user geometry. Tests can be applied recursively to all depth levels (may require CPU time!): [recursion_flag] Idle> geometry/test/run [recursion_flag] or Idle> geometry/test/grid_test [recursion_flag] to start verification of geometry for overlapping regions based on a standard grid setup Idle> geometry/test/line_test [recursion_flag] to shoot a line along a specified direction and position Idle>geometry/test/position and geometry/test/direction to specify position & direction for the line_test Resolution/dimensions of grid/cylinders can be tuned To avoid spurious errors caused by round off, a tolerance of 0.1 micron is used by default. The tolerance can be adjusted as needed by the application through the run-time command: geometry/test/tolerance <new-value> Detector Description - Geant4 Course

Debugging run-time commands - 2 Geant4: Detector description module Debugging run-time commands - 2 Example layout: GeomTest: no daughter volume extending outside mother detected. GeomTest Error: Overlapping daughter volumes The volumes Tracker[0] and Overlap[0], both daughters of volume World[0], appear to overlap at the following points in global coordinates: (list truncated) length (cm) ----- start position (cm) ----- ----- end position (cm) ----- 240 -240 -145.5 -145.5 0 -145.5 -145.5 Which in the mother coordinate system are: . . . Which in the coordinate system of Tracker[0] are: Which in the coordinate system of Overlap[0] are: Detector Description - Geant4 Course

Geant4: Detector description module Debugging commands An other tool to check for overlaps is the CheckOverlap() method of G4VPhysicalVolume Verifies if the placed volume is overlapping with existing daughters or with the mother volume. Returns true if the volume is overlapping myPhysicalVolume->CheckOverlap(); It is convenient to run this tool when the geometry is complete (all volumes defined), retrieving all the Physical Volumes from the G4PhysicalVolumeStore() Detector Description - Geant4 Course

Geant4: Detector description module Backup slides PART VI Backup slides

Geant4: Detector description module Reflecting solids Let's take an example of a pair of mirror symmetric volumes. Such geometry cannot be made by parallel transformation or 180 degree rotation. G4ReflectedSolid (derived from G4VSolid) Utility class representing a solid shifted from its original reference frame to a new mirror symmetric one The reflection (G4Reflect[X/Y/Z]3D) is applied as a decomposition into rotation and translation G4ReflectionFactory Singleton object using G4ReflectedSolid for generating placements of reflected volumes Reflections are currently limited to simple CSG solids. will be extended soon to all solids Detector Description - Geant4 Course

Reflecting hierarchies of volumes - 1 Geant4: Detector description module Reflecting hierarchies of volumes - 1 G4ReflectionFactory::Place(…) Used for normal placements: Performs the transformation decomposition Generates a new reflected solid and logical volume Retrieves it from a map if the reflected object is already created Transforms any daughter and places them in the given mother Returns a pair of physical volumes, the second being a placement in the reflected mother G4PhysicalVolumesPair Place(const G4Transform3D& transform3D, // the transformation const G4String& name, // the actual name G4LogicalVolume* LV, // the logical volume G4LogicalVolume* motherLV, // the mother volume G4bool noBool, // currently unused G4int copyNo) // optional copy number Detector Description - Geant4 Course

Reflecting hierarchies of volumes - 2 Geant4: Detector description module Reflecting hierarchies of volumes - 2 G4ReflectionFactory::Replicate(…) Creates replicas in the given mother volume Returns a pair of physical volumes, the second being a replica in the reflected mother G4PhysicalVolumesPair Replicate(const G4String& name, // the actual name G4LogicalVolume* LV, // the logical volume G4LogicalVolume* motherLV, // the mother volume Eaxis axis // axis of replication G4int replicaNo // number of replicas G4int width, // width of single replica G4int offset=0) // optional mother offset Detector Description - Geant4 Course