ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4MIRDHeart.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4MIRDHeart.cc
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // Previous authors: G. Guerrieri, S. Guatelli and M. G. Pia, INFN Genova, Italy
27 // Authors (since 2007): S. Guatelli, University of Wollongong, Australia
28 //
29 //
30 #include "G4MIRDHeart.hh"
31 #include "globals.hh"
32 #include "G4SDManager.hh"
33 #include "G4VisAttributes.hh"
34 #include "G4Ellipsoid.hh"
35 #include "G4ThreeVector.hh"
36 #include "G4VPhysicalVolume.hh"
37 #include "G4RotationMatrix.hh"
38 #include "G4Material.hh"
39 #include "G4LogicalVolume.hh"
41 #include "G4VPhysicalVolume.hh"
42 #include "G4PVPlacement.hh"
43 #include "G4Sphere.hh"
44 #include "G4UnionSolid.hh"
45 #include "G4HumanPhantomColour.hh"
46 #include "G4SystemOfUnits.hh"
47 
49 {
50 
51 }
52 
54 {
55 
56 }
57 
59  const G4String& colourName, G4bool wireFrame, G4bool)
60 {
61 
62  G4cout << "Construct " << volumeName <<" with mother "<<mother->GetName()<<G4endl;
63 
65 
66  G4Material* soft = material -> GetMaterial("soft_tissue");
67 
68  G4double ax= 4.00* cm;
69  G4double by= 4.00 *cm;
70  G4double cz= 7.00 *cm;
71  G4double zcut1= -7.00 *cm;
72  G4double zcut2= 0.0 *cm;
73 
74  G4Ellipsoid* heart1 = new G4Ellipsoid("Heart1",ax, by, cz, zcut1, zcut2);
75 
76  G4double rmin =0.*cm;
77  G4double rmax = 3.99*cm;
78  G4double startphi = 0. * degree;
79  G4double deltaphi = 360. * degree;
80  G4double starttheta = 0. * degree;
81  G4double deltatheta = 90. * degree;
82 
83  G4Sphere* heart2 = new G4Sphere("Heart2", rmin,rmax,
84  startphi, deltaphi,
85  starttheta, deltatheta);
86 
87  G4UnionSolid* heart = new G4UnionSolid("Heart", heart1, heart2);
88 
89  G4LogicalVolume* logicHeart = new G4LogicalVolume(heart, soft,
90  "HeartVolume",
91  0, 0, 0);
92 
93  // Define rotation and position here!
95  rm->rotateY(25.*degree);
96  G4VPhysicalVolume* physHeart = new G4PVPlacement(rm,G4ThreeVector(0.0,-3.0*cm, 15.32 *cm),
97  "physicalHeart",
98  logicHeart,
99  mother,
100  false,
101  0,true);
102 
103  // Visualization Attributes
104  G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour();
105  G4Colour colour = colourPointer -> GetColour(colourName);
106  G4VisAttributes* HeartVisAtt = new G4VisAttributes(colour);
107  HeartVisAtt->SetForceSolid(wireFrame);
108  logicHeart->SetVisAttributes(HeartVisAtt);
109 
110  G4cout << "Heart created !!!!!!" << G4endl;
111 
112  // Testing Heart Volume
113  G4double HeartVol = logicHeart->GetSolid()->GetCubicVolume();
114  G4cout << "Volume of Heart = " << HeartVol/cm3 << " cm^3" << G4endl;
115 
116  // Testing Heart Material
117  G4String HeartMat = logicHeart->GetMaterial()->GetName();
118  G4cout << "Material of Heart = " << HeartMat << G4endl;
119 
120  // Testing Density
121  G4double HeartDensity = logicHeart->GetMaterial()->GetDensity();
122  G4cout << "Density of Material = " << HeartDensity*cm3/g << " g/cm^3" << G4endl;
123 
124  // Testing Mass
125  G4double HeartMass = (HeartVol)*HeartDensity;
126  G4cout << "Mass of Heart = " << HeartMass/gram << " g" << G4endl;
127 
128  return physHeart;
129 
130 }