CLHEP Components Geant4 and CLHEP Geant4 makes a rather substantial use of CLHEP components –System of units –Vector classes and matrices G4ThreeVector(typedef.

Slides:



Advertisements
Similar presentations
Vectors and Two-Dimensional Motion
Advertisements

Unit Vectors. Vector Length  Vector components can be used to determine the magnitude of a vector.  The square of the length of the vector is the sum.
1 3D Vector & Matrix Chapter 2. 2 Vector Definition: Vector is a line segment that has the direction. The length of the line segment is called the magnitude.
Polar Coordinate System 11.3 – Polar Coordinates Used to plot and analyze equations of conics (circles, parabolas, ellipses, and hyperbolas. Another method.
Chapter 3 Vectors.
General Physics 1, additional questions, By/ T.A. Eleyan 1 Additional Questions (Lec1&2)
3-D Geometry.
Mechanics of Rigid Bodies
General physics 1, Lec 3, By/ T.A. Eleyan Lecture 3 Discussion.
Computer Animations of Molecular Vibration Michael McGuan and Robert M. Hanson Summer Research 2004 Department of Chemistry St. Olaf College Northfield,
Euler Angles. Three Angles  A rotation matrix can be described with three free parameters. Select three separate rotations about body axesSelect three.
PHYS 218 sec Review Chap. 1. Caution This presentation is to help you understand the contents of the textbook. Do not rely on this review for.
Detector Description - Materials
Detector Description: Materials
Polar Coordinates. Common Coordinate Systems There are two common coordinate systems: Cartesian Rectangular Coordinate SystemPolar Coordinate System.
A Hands-on introduction to Geant4 Andrea Dell’Acqua CERN-EP/ATC
A stable interface to read and write IAEA phase-space files in Geant4 M. A. Cortés-Giraldo 1, R. Capote 2, J. M. Quesada 1 1 Dep. Física Atómica, Molecular.
Chapter 2: Fundamentals I. After completing this Chapter, you will be able to do the following: Construct Geometric Figures Use Coordinate Systems Additional.
Review of Vector Analysis
EDT Chapter 41 Coordinate Systems Cartesian, Relative and Polar Sacramento City College EDT 310.
Chapter 3 Vectors Coordinate Systems Used to describe the position of a point in space Coordinate system consists of A fixed reference point called.
Vectors A vector is a quantity that is characterized by both magnitude and direction. Vectors are represented by arrows. The length of the arrow represents.
7.1 Scalars and vectors Scalar: a quantity specified by its magnitude, for example: temperature, time, mass, and density Chapter 7 Vector algebra Vector:
Introduction and Vectors
Materials 1 Images: Isotopic composition Molecular composition Density Pressure State Temperature.
Homogeneous Coordinates (Projective Space) Let be a point in Euclidean space Change to homogeneous coordinates: Defined up to scale: Can go back to non-homogeneous.
Computational Biology, Part E Basic Principles of Computer Graphics Robert F. Murphy Copyright  1996, 1999, 2000, All rights reserved.
Chapter 3 Vectors. Coordinate Systems Used to describe the position of a point in space Coordinate system consists of a fixed reference point called the.
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.
JJ205 ENGINEERING MECHANICS COURSE LEARNING OUTCOMES : Upon completion of this course, students should be able to: CLO 1. apply the principles of statics.
Chapter 3 Vectors. Coordinate Systems Used to describe the position of a point in space Coordinate system consists of a fixed reference point called the.
Solving Problems.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
College Physics Chapter 1 Introduction.
ENGR Introduction to Engineering1 ENGR 107 – Introduction to Engineering Coordinate Systems, Vectors, and Forces (Lecture #6)
VECTORS (Ch. 12) Vectors in the plane Definition: A vector v in the Cartesian plane is an ordered pair of real numbers:  a,b . We write v =  a,b  and.
C2:Radian Measure Learning Objective: to understand that angles can be measured in radians.
Computer Graphics 3D Transformations. Translation.
The Spinning Top Chloe Elliott. Rigid Bodies Six degrees of freedom:  3 cartesian coordinates specifying position of centre of mass  3 angles specifying.
Chun-Yuan Lin Mathematics for Computer Graphics 2015/12/15 1 CG.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Quantum Two 1. 2 Angular Momentum and Rotations 3.
Geometric Transformations UBI 516 Advanced Computer Graphics Aydın Öztürk
Document Releases Peer Reviews Constraints CDF-A How to…
II-1 Transformations Transformations are needed to: –Position objects defined relative to the origin –Build scenes based on hierarchies –Project objects.
Polarization Jones vector & matrices
Detector Description - Materials
Chapter 3 Lecture 5: Vectors HW1 (problems): 1.18, 1.27, 2.11, 2.17, 2.21, 2.35, 2.51, 2.67 Due Thursday, Feb. 11.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
COORDINATE SYSTEMS & TRANSFORMATION
Trigonometry and Applications References: xyz. Motivation Our character movements so far: Other types of movement:
Sect. 4.5: Cayley-Klein Parameters 3 independent quantities are needed to specify a rigid body orientation. Most often, we choose them to be the Euler.
Robotic Arms and Matrices By Chris Wong and Chris Marino.
ENE 325 Electromagnetic Fields and Waves Lecture 2 Static Electric Fields and Electric Flux density.
Object Oriented Programming Some Interesting Genes.
1 Part B Tensors Or, inverting The graph above represents a transformation of coordinates when the system is rotated at an angle  CCW.
Lecture 10 Geometric Transformations In 3D(Three- Dimensional)
Measurement is used to measure quantities
Computer Graphics 3D Transformations
Vectors.
ENE 325 Electromagnetic Fields and Waves
ENE 325 Electromagnetic Fields and Waves
2D Geometric Transformations
Geometric Objects and Transformations (II)
Detector Description - Materials
Kernel Author: Makoto Asai.
Coordinate Systems Cartesian, Relative and Polar
Presentation transcript:

CLHEP Components

Geant4 and CLHEP Geant4 makes a rather substantial use of CLHEP components –System of units –Vector classes and matrices G4ThreeVector(typedef to Hep3Vector) G4RotationMatrix(typedef to HepRotation) G4LorentzVector(typedef to HepLorentzVector) G4LorentzRotation(typedef to HepLorentzRotation) –Geometrical classes G4Plane3D(typedef to HepPlane3D) G4Transform3D(typedef to HepTransform3D) G4Normal3D(typedef to HepNormal3D) G4Point3D(typedef to HepPoint3D) G4Vector3D(typedef to HepVector3D)

System of units Geant4 offers the possibility to choose and use the units one prefers for any quantity Geant4 uses an internal and consistent set of units based on: –millimeter(mm) –nanosecond(ns) –Mega electron Volt(MeV) –Positron charge(eplus) –Degree Kelvin(kelvin) –Amount of substance(mole) –Luminosity intensity(candela) –Radian(radian) –steradian(steradian)

System of units (2) All the units are defined from the basic ones These definitions are available in the file –source/global/management/include/SystemOfUnits … and are now part of CLHEP The user is free to change the system of units to be used by the kernel millimeter=mm=1; meter = m = 1000*mm; ……. m3 = m*m*m; ……..

System of units (3) Avoid hard coded data –you better specify the unit of the data you are going to introduce –The Geant4 code is written respecting these specification and this makes the code independent from the system of units chosen by the user Be careful!!! Some built-in commands for the User interface require the unit to be specified G4double Size = 15.*km, KineticEnergy = 90.3*GeV, density = 11*mg/cm3; G4double radius=10.*m;// internally converted: radius=10000 …. G4double xposition = (radius*cos(alpha*rad))*cm// is this really what you want to do?? G4double yposition = (radius*sin(alpha*rad))*cm /gun/energy 10 GeV

System of units (4) To output the data on the unit you wish you must DIVIDE the data by the corresponding unit You can let Geant4 decide which is the most appropriate unit to represent your data. It is just sufficient to specify which category (length, time, energy…) does it belong to: You can print the whole table of units by using the static function cout << KineticEnergy/KeV << “ KeV “<<endl ; cout << G4BestUnit(StepSize, “Length”) <<endl G4UnitDefinition::PrintUnitsTable

System of units (5) You may introduce new units if you wish: –by completing the file SystemOfUnits.hh –by using the class G4UnitDefinition and creating a new object of it G4UnitDefinition (name, symbol, category, value) #include “SystemOfUnits.hh” static const G4double inch = 2.54*cm; G4UnitDefinition (“inch”,”in”,”Length”,25.4*mm);

3-Vectors Geant4 makes use of the CLHEP HepVector3D and Hep3Vector for implementing several 3-dimensional object (G4ThreeVector, G4ParticleMomentum…) The definition of a 3-vector is pretty straightforward: G4ThreeVector *p=new G4ThreeVector(10,20,100); Every component can be accessed very easily: G4double px=p->x(); and set very easily; p->setZ(50); the components in polar coordinates are give by phi(), theta(), mag() and set using: setPhi(), setTheta(), setMag()

3-Vectors (2) They can be normalized: p->unit(); rotated around one of the cartesian axes p->rotateY(2.73); or around any other 3-vector p->rotate(1.57,G4ThreeVector(10,20,30)); for reference: $CLHEP_BASE_DIR/include/CLHEP/Vector/ThreeVector.h wwwinfo.cern.ch/asd/lhc++/clhep/manual/RefGuide/Vector/Hep3Vector.html

Rotation Matrices Geant4 uses the rotation matrix implementation which comes with CLHEP (HepRotation, typedef’d into G4RotationMatrix) #include “G4RotationMatrix.hh” …. G4RotationMatrix *rm = new G4RotationMatrix; You can then rotate about the coordinate axes: rm->rotateX(45*deg);// rotation about X and combine several rotations into a 3D one: rm->rotateX(30*deg); rm->rotateY(20*deg);

Rotation Matrices (2) You can rotate about a specified vector rm->rotate(45*deg,Hep3Vector(1.,1.,.3)); or specify the direction of the three cartesian axes after the rotation rm->rotateAxes(Hep3Vector(-sin(a),0,cos(a)), Hep3Vector(cos(a),0,sin(a)), Hep3Vector(0,1,0)); a rotation matrix can be inverted by using the invert method rm->invert();

Rotation Matrices (3) The angles made by the rotated axes against the original axes can be obtained with the set of functions: –phiX(),phiY(),phiZ(),thetaX(),thetaY(),thetaZ() …or one can get the rotation angle and the rotation axis (awkward) G4double angle; G4ThreeVector axis; rm->getAngleAxis(angle,axis); to reset a rotation matrix use the default constructor *rm=G4RotationMatrix(); documentation at: $CLHEP_BASE_DIR/include/CLHEP/Vector/Rotation.h wwwinfo.cern.ch/asd/lhc++/clhep/manual/RefGuide/Vector/HepRotation.html