DetectorConstruction Class Reference

#include <DetectorConstruction.hh>

Inheritance diagram for DetectorConstruction:

Inheritance graph
[legend]
Collaboration diagram for DetectorConstruction:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 DetectorConstruction ()
 ~DetectorConstruction ()
void SetWorldMaterial (G4String)
void SetSpacecraftMaterial (G4String)
void SetCabinMaterial (G4String)
void SetFloorMaterial (G4String)
void SetAstronautMaterial (G4String)
void SetWorldSizeXY (G4double val)
void SetWorldSizeZ (G4double val)
void SetSpacecraftRadius (G4double val)
void SetSpacecraftLength (G4double val)
void SetSpacecraftThickness (G4double val)
void SetCabinRadius (G4double val)
void SetCabinLength (G4double val)
void SetFloorThickness (G4double val)
void SetFloorWidth (G4double val)
void SetFloorLength (G4double val)
void SetFloorYcenter (G4double val)
void SetAstronautHeight (G4double val)
void SetAstronautTopWidth (G4double val)
void SetAstronautBottomWidth (G4double val)
void SetAstronautPosition (G4double val)
G4VPhysicalVolume * Construct ()
void UpdateGeometry ()
G4VPhysicalVolume * GetWorld ()
G4VPhysicalVolume * GetSpacecraft ()
G4VPhysicalVolume * GetCabin ()
G4VPhysicalVolume * GetFloor ()
G4VPhysicalVolume * GetAstronaut ()
G4Material * GetWorldMaterial ()
G4Material * GetSpacecraftMaterial ()
G4Material * GetCabinMaterial ()
G4Material * GetFloorMaterial ()
G4Material * GetAstronautMaterial ()
G4double GetWorldSizeXY ()
G4double GetWorldSizeZ ()
G4double GetSpacecraftRadius ()
G4double GetSpacecraftLength ()
G4double GetSpacecraftThickness ()
G4double GetCabinRadius ()
G4double GetCabinLength ()
G4double GetFloorThickness ()
G4double GetFloorWidth ()
G4double GetFloorLength ()
G4double GetFloorYcenter ()
G4double GetAstronautHeight ()
G4double GetAstronautTopWidth ()
G4double GetAstronautBottomWidth ()
G4double GetAstronautPosition ()
void PrintParameters ()

Private Member Functions

void DefineMaterials ()
G4VPhysicalVolume * ConstructVolumes ()

Private Attributes

G4VPhysicalVolume * m_physiWorld
G4VPhysicalVolume * m_physiSpacecraft
G4VPhysicalVolume * m_physiCabin
G4VPhysicalVolume * m_physiFloor
G4VPhysicalVolume * m_physiAstronaut
G4Material * m_worldMaterial
G4Material * m_spacecraftMaterial
G4Material * m_cabinMaterial
G4Material * m_floorMaterial
G4Material * m_astronautMaterial
G4double m_worldSizeXY
G4double m_worldSizeZ
G4double m_spacecraftRadius
G4double m_spacecraftLength
G4double m_spacecraftThickness
G4double m_cabinRadius
G4double m_cabinLength
G4double m_floorThickness
G4double m_floorWidth
G4double m_floorLength
G4double m_floorYcenter
G4double m_astronautHeight
G4double m_astronautTopWidth
G4double m_astronautBottomWidth
G4double m_astronautPosition
DetectorMessengerm_detectorMessenger


Detailed Description

Definition at line 19 of file DetectorConstruction.hh.


Constructor & Destructor Documentation

DetectorConstruction::DetectorConstruction (  ) 

Definition at line 35 of file DetectorConstruction.cc.

00036 {  
00037   DefineMaterials();
00038   
00039   //define geometrical parameters
00040   //
00041   m_cabinRadius = 50*cm;       
00042   m_cabinLength = 80*cm;
00043   m_spacecraftThickness = 2*cm;
00044   
00045   m_floorThickness = 2*cm;
00046 
00047   m_astronautHeight = 50*cm;
00048   m_astronautTopWidth = 40*cm;
00049   m_astronautBottomWidth = 60*cm;
00050     
00051   // create commands for interactive definition of the detector  
00052   m_detectorMessenger = new DetectorMessenger(this);        
00053 }

DetectorConstruction::~DetectorConstruction (  ) 

Definition at line 57 of file DetectorConstruction.cc.

00058 {delete m_detectorMessenger;  }


Member Function Documentation

void DetectorConstruction::SetWorldMaterial ( G4String  materialChoice  ) 

Definition at line 372 of file DetectorConstruction.cc.

00373 {
00374   // search the material by its name   
00375   G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);     
00376   if (pttoMaterial) m_worldMaterial = pttoMaterial;
00377 }

void DetectorConstruction::SetSpacecraftMaterial ( G4String  materialChoice  ) 

Definition at line 381 of file DetectorConstruction.cc.

Referenced by DetectorMessenger::SetNewValue().

00382 {
00383   // search the material by its name   
00384   G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);     
00385   if (pttoMaterial) m_spacecraftMaterial = pttoMaterial;
00386 }

void DetectorConstruction::SetCabinMaterial ( G4String  materialChoice  ) 

Definition at line 390 of file DetectorConstruction.cc.

00391 {
00392   // search the material by its name   
00393   G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);     
00394   if (pttoMaterial) m_cabinMaterial = pttoMaterial;
00395 }

void DetectorConstruction::SetFloorMaterial ( G4String  materialChoice  ) 

Definition at line 399 of file DetectorConstruction.cc.

00400 {
00401   // search the material by its name   
00402   G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);     
00403   if (pttoMaterial) m_floorMaterial = pttoMaterial;
00404 }

void DetectorConstruction::SetAstronautMaterial ( G4String  materialChoice  ) 

Definition at line 408 of file DetectorConstruction.cc.

00409 {
00410   // search the material by its name   
00411   G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);     
00412   if (pttoMaterial) m_astronautMaterial = pttoMaterial;
00413 }

void DetectorConstruction::SetWorldSizeXY ( G4double  val  )  [inline]

Definition at line 34 of file DetectorConstruction.hh.

00034 {m_worldSizeXY = val;};

void DetectorConstruction::SetWorldSizeZ ( G4double  val  )  [inline]

Definition at line 35 of file DetectorConstruction.hh.

00035 {m_worldSizeZ = val;};

void DetectorConstruction::SetSpacecraftRadius ( G4double  val  )  [inline]

Definition at line 36 of file DetectorConstruction.hh.

00036 {m_spacecraftRadius = val;};

void DetectorConstruction::SetSpacecraftLength ( G4double  val  )  [inline]

Definition at line 37 of file DetectorConstruction.hh.

00037 {m_spacecraftLength = val;};

void DetectorConstruction::SetSpacecraftThickness ( G4double  val  )  [inline]

Definition at line 38 of file DetectorConstruction.hh.

Referenced by DetectorMessenger::SetNewValue().

00038 {m_spacecraftThickness = val;};

void DetectorConstruction::SetCabinRadius ( G4double  val  )  [inline]

Definition at line 39 of file DetectorConstruction.hh.

Referenced by DetectorMessenger::SetNewValue().

00039 {m_cabinRadius = val;};

void DetectorConstruction::SetCabinLength ( G4double  val  )  [inline]

Definition at line 40 of file DetectorConstruction.hh.

Referenced by DetectorMessenger::SetNewValue().

00040 {m_cabinLength = val;};

void DetectorConstruction::SetFloorThickness ( G4double  val  )  [inline]

Definition at line 41 of file DetectorConstruction.hh.

00041 {m_floorThickness = val;};

void DetectorConstruction::SetFloorWidth ( G4double  val  )  [inline]

Definition at line 42 of file DetectorConstruction.hh.

00042 {m_floorWidth = val;};

void DetectorConstruction::SetFloorLength ( G4double  val  )  [inline]

Definition at line 43 of file DetectorConstruction.hh.

00043 {m_floorLength = val;};

void DetectorConstruction::SetFloorYcenter ( G4double  val  )  [inline]

Definition at line 44 of file DetectorConstruction.hh.

00044 {m_floorYcenter = val;};

void DetectorConstruction::SetAstronautHeight ( G4double  val  )  [inline]

Definition at line 45 of file DetectorConstruction.hh.

00045 {m_astronautHeight = val;};

void DetectorConstruction::SetAstronautTopWidth ( G4double  val  )  [inline]

Definition at line 46 of file DetectorConstruction.hh.

00046 {m_astronautTopWidth = val;};

void DetectorConstruction::SetAstronautBottomWidth ( G4double  val  )  [inline]

Definition at line 47 of file DetectorConstruction.hh.

00047 {m_astronautBottomWidth = val;};     

void DetectorConstruction::SetAstronautPosition ( G4double  val  )  [inline]

Definition at line 48 of file DetectorConstruction.hh.

00048 {m_astronautPosition = val;};

G4VPhysicalVolume * DetectorConstruction::Construct (  ) 

Definition at line 62 of file DetectorConstruction.cc.

00063 {
00064   return ConstructVolumes();
00065 }

void DetectorConstruction::UpdateGeometry (  ) 

Definition at line 419 of file DetectorConstruction.cc.

Referenced by DetectorMessenger::SetNewValue().

00420 {
00421   G4RunManager::GetRunManager()->DefineWorldVolume(ConstructVolumes());
00422 }

G4VPhysicalVolume* DetectorConstruction::GetWorld (  )  [inline]

Definition at line 55 of file DetectorConstruction.hh.

00055 {return m_physiWorld;};

G4VPhysicalVolume* DetectorConstruction::GetSpacecraft (  )  [inline]

Definition at line 56 of file DetectorConstruction.hh.

00056 {return m_physiSpacecraft;};

G4VPhysicalVolume* DetectorConstruction::GetCabin (  )  [inline]

Definition at line 57 of file DetectorConstruction.hh.

00057 {return m_physiCabin;};

G4VPhysicalVolume* DetectorConstruction::GetFloor (  )  [inline]

Definition at line 58 of file DetectorConstruction.hh.

00058 {return m_physiFloor;};     

G4VPhysicalVolume* DetectorConstruction::GetAstronaut (  )  [inline]

G4Material* DetectorConstruction::GetWorldMaterial (  )  [inline]

Definition at line 61 of file DetectorConstruction.hh.

00061 {return m_worldMaterial;};                                  

G4Material* DetectorConstruction::GetSpacecraftMaterial (  )  [inline]

Definition at line 62 of file DetectorConstruction.hh.

00062 {return m_spacecraftMaterial;};

G4Material* DetectorConstruction::GetCabinMaterial (  )  [inline]

Definition at line 63 of file DetectorConstruction.hh.

00063 {return m_cabinMaterial;};     

G4Material* DetectorConstruction::GetFloorMaterial (  )  [inline]

Definition at line 64 of file DetectorConstruction.hh.

00064 {return m_floorMaterial;};

G4Material* DetectorConstruction::GetAstronautMaterial (  )  [inline]

Definition at line 65 of file DetectorConstruction.hh.

00065 {return m_astronautMaterial;};

G4double DetectorConstruction::GetWorldSizeXY (  )  [inline]

Definition at line 67 of file DetectorConstruction.hh.

Referenced by PrimaryGeneratorAction::GeneratePrimaries().

00067 {return m_worldSizeXY;};

G4double DetectorConstruction::GetWorldSizeZ (  )  [inline]

Definition at line 68 of file DetectorConstruction.hh.

Referenced by PrimaryGeneratorAction::GeneratePrimaries().

00068 {return m_worldSizeZ;};

G4double DetectorConstruction::GetSpacecraftRadius (  )  [inline]

Definition at line 69 of file DetectorConstruction.hh.

00069 {return m_spacecraftRadius;};            

G4double DetectorConstruction::GetSpacecraftLength (  )  [inline]

Definition at line 70 of file DetectorConstruction.hh.

00070 {return m_spacecraftLength;};    

G4double DetectorConstruction::GetSpacecraftThickness (  )  [inline]

Definition at line 71 of file DetectorConstruction.hh.

00071 {return m_spacecraftThickness;};

G4double DetectorConstruction::GetCabinRadius (  )  [inline]

Definition at line 72 of file DetectorConstruction.hh.

00072 {return m_cabinRadius;};            

G4double DetectorConstruction::GetCabinLength (  )  [inline]

Definition at line 73 of file DetectorConstruction.hh.

00073 {return m_cabinLength;};         

G4double DetectorConstruction::GetFloorThickness (  )  [inline]

Definition at line 74 of file DetectorConstruction.hh.

00074 {return m_floorThickness;};     

G4double DetectorConstruction::GetFloorWidth (  )  [inline]

Definition at line 75 of file DetectorConstruction.hh.

00075 {return m_floorWidth;};     

G4double DetectorConstruction::GetFloorLength (  )  [inline]

Definition at line 76 of file DetectorConstruction.hh.

00076 {return m_floorLength;};

G4double DetectorConstruction::GetFloorYcenter (  )  [inline]

Definition at line 77 of file DetectorConstruction.hh.

00077 {return m_floorYcenter;};     

G4double DetectorConstruction::GetAstronautHeight (  )  [inline]

G4double DetectorConstruction::GetAstronautTopWidth (  )  [inline]

Definition at line 79 of file DetectorConstruction.hh.

00079 {return m_astronautTopWidth;};

G4double DetectorConstruction::GetAstronautBottomWidth (  )  [inline]

Definition at line 80 of file DetectorConstruction.hh.

00080 {return m_astronautBottomWidth;};     

G4double DetectorConstruction::GetAstronautPosition (  )  [inline]

Definition at line 81 of file DetectorConstruction.hh.

00081 {return m_astronautPosition;};

void DetectorConstruction::PrintParameters (  ) 

Definition at line 340 of file DetectorConstruction.cc.

Referenced by ConstructVolumes().

00341 {
00342   G4cout << "\n---------------------------------------------------------\n";
00343   G4cout 
00344     << "---> World : (" << m_worldSizeXY/m << " X " << m_worldSizeXY/m << " X "
00345                         << m_worldSizeZ/m << ") m of "
00346                         << m_worldMaterial->GetName() << G4endl;
00347   G4cout
00348     << "---> Spacecraft : radius = " << G4BestUnit(m_spacecraftRadius,"Length")
00349     << "\t length = " << G4BestUnit(m_spacecraftLength,"Length")
00350     << "\t thickness = " << G4BestUnit(m_spacecraftThickness,"Length")        
00351     << "\t material : " << m_spacecraftMaterial->GetName() << G4endl;
00352   G4cout
00353     << "---> Cabin : radius = " << G4BestUnit(m_cabinRadius,"Length")
00354     << "\t length = " << G4BestUnit(m_cabinLength,"Length")
00355     << "\t material : " << m_cabinMaterial->GetName() << G4endl;
00356   G4cout
00357     << "---> Floor : thickness = " << G4BestUnit(m_floorThickness,"Length")
00358     << "\t width = " << G4BestUnit(m_floorWidth,"Length")    
00359     << "\t length = " << G4BestUnit(m_floorLength,"Length")
00360     << "\t material : " << m_floorMaterial->GetName() << G4endl;
00361   G4cout
00362     << "---> Astronaut : height = " << G4BestUnit(m_astronautHeight,"Length")
00363     << "\t bottom width = " << G4BestUnit(m_astronautBottomWidth,"Length")
00364     << "\t top width = " << G4BestUnit(m_astronautTopWidth,"Length")    
00365     << "\t material : " << m_astronautMaterial->GetName() << G4endl;            
00366   G4cout << "\n---------------------------------------------------------\n";
00367   G4cout << G4endl;
00368 }

void DetectorConstruction::DefineMaterials (  )  [private]

Definition at line 69 of file DetectorConstruction.cc.

Referenced by DetectorConstruction().

00070 { 
00071   //
00072   // define simple materials
00073   //
00074   G4double Z,A,density;
00075   
00076   G4Material* Al =
00077   new G4Material("Aluminium", Z=13., A=26.98*g/mole, density=2.700*g/cm3);
00078   
00079   //
00080   // build compounds from Elements
00081   //
00082   G4Element* H  = new G4Element("Hydrogen" ,"H" , Z=1., A= 1.01*g/mole);  
00083   G4Element* N  = new G4Element("Nitrogen" ,"N" , Z=7., A=14.01*g/mole);
00084   G4Element* O  = new G4Element("Oxygen"   ,"O" , Z=8., A=16.00*g/mole);
00085 
00086   G4int ncomponents, natoms;
00087   G4double fractionmass;  
00088   
00089   G4Material* Air = 
00090   new G4Material("Air", density= 1.290*mg/cm3, ncomponents=2);
00091   Air->AddElement(N, fractionmass=70.*perCent);
00092   Air->AddElement(O, fractionmass=30.*perCent);
00093 
00094   G4Material* H2O = 
00095   new G4Material("Water", density= 1.000*g/cm3, ncomponents=2);
00096   H2O->AddElement(H, natoms=2);
00097   H2O->AddElement(O, natoms=1);
00098         
00099   // Vacuum standard definition...
00100   //
00101   G4Material* Vacuum =
00102   new G4Material("Galactic", Z=1., A=1.01*g/mole, density= 1.e-10*g/cm3,
00103                            kStateGas, 2.73*kelvin, 3.e-18*pascal);
00104                            
00105   //associate materials
00106   //
00107   m_worldMaterial = Vacuum;
00108   m_spacecraftMaterial = m_floorMaterial = Al;
00109   m_cabinMaterial = Air;
00110   m_astronautMaterial = H2O;
00111                              
00112   // Print
00113   //
00114   G4cout << *(G4Material::GetMaterialTable()) << G4endl;
00115 }

G4VPhysicalVolume * DetectorConstruction::ConstructVolumes (  )  [private]

Definition at line 119 of file DetectorConstruction.cc.

Referenced by Construct(), and UpdateGeometry().

00120 {
00121   // Cleanup old geometry
00122   G4GeometryManager::GetInstance()->OpenGeometry();
00123   G4PhysicalVolumeStore::GetInstance()->Clean();
00124   G4LogicalVolumeStore::GetInstance()->Clean();
00125   G4SolidStore::GetInstance()->Clean();
00126   
00127   //define geometrical parameters
00128   //    
00129   m_spacecraftRadius = m_cabinRadius + m_spacecraftThickness;       
00130   m_spacecraftLength = m_cabinLength + 2*m_spacecraftThickness;
00131   
00132   m_floorYcenter   = - 0.5*m_cabinRadius;
00133   G4double floorYtop      = m_floorYcenter + 0.5*m_floorThickness;
00134   G4double floorYbottom   = m_floorYcenter - 0.5*m_floorThickness;      
00135   m_floorWidth =
00136           2*std::sqrt(m_cabinRadius*m_cabinRadius - floorYbottom*floorYbottom);
00137   m_floorLength    = m_cabinLength;
00138     
00139   m_worldSizeXY = 2.2*m_spacecraftRadius;
00140   m_worldSizeZ  = 1.1*m_spacecraftLength;
00141   
00142   m_astronautPosition = floorYtop + 0.5*m_astronautHeight;
00143   
00144     
00145   // World volume
00146   //
00147 
00148   G4Box*
00149   solidWorld = new G4Box("World",                                  //its name
00150                  m_worldSizeXY/2,m_worldSizeXY/2,m_worldSizeZ/2);  //its size
00151   
00152   G4LogicalVolume*  
00153   logicWorld = new G4LogicalVolume(solidWorld,          //its solid
00154                                    m_worldMaterial,     //its material
00155                                    "World");            //its name
00156 
00157   m_physiWorld = new G4PVPlacement(0,                   //no rotation
00158                                  G4ThreeVector(),       //at (0,0,0)
00159                                  logicWorld,            //its logical volume
00160                                  "World",               //its name
00161                                  0,                     //its mother  volume
00162                                  false,                 //no boolean operation
00163                                  0);                    //copy number
00164                                  
00165   // SpaceCraft volume
00166   //
00167   G4Tubs*
00168   solidSpacecraft = new G4Tubs("Spacecraft",            //name
00169                          0*cm, m_spacecraftRadius,      //r1, r2
00170                          0.5*m_spacecraftLength,        //half-length 
00171                          0., twopi);                    //teta1, teta2
00172                          
00173   G4LogicalVolume*    
00174   logicSpacecraft = new G4LogicalVolume(solidSpacecraft,   //solid
00175                                     m_spacecraftMaterial,  //material
00176                                         "Spacecraft");     //name
00177   
00178   m_physiSpacecraft = new G4PVPlacement(0,              //no rotation
00179                                   G4ThreeVector(0,0,0), //position
00180                                   logicSpacecraft,      //logicalVolume
00181                                   "Spacecraft",         //name
00182                                    logicWorld,          //mother
00183                                    false,               //no boolean
00184                                    0);                  //copy nb
00185   
00186   // Cabin
00187   //
00188   G4Tubs*
00189   solidCabin = new G4Tubs("Cabin",                      //name
00190                          0*cm, m_cabinRadius,           //r1, r2
00191                          0.5*m_cabinLength,             //half-length 
00192                          0., 360*deg);                  //teta1, teta2
00193                          
00194   G4LogicalVolume*    
00195   logicCabin = new G4LogicalVolume(solidCabin,          //solid
00196                                    m_cabinMaterial,     //material
00197                                    "Cabin");            //name
00198                                           
00199   m_physiCabin = new G4PVPlacement(0,                   //no rotation
00200                                  G4ThreeVector(0,0,0),  //position
00201                                  logicCabin,            //logicalVolume
00202                                  "Cabin",               //name
00203                                   logicSpacecraft,      //mother
00204                                   false,                //no boolean
00205                                   0);                   //copy nb
00206   
00207 
00208   // Floor
00209   //
00210   G4Box*
00211   solidFloor = new G4Box("Floor",                                    //name
00212               m_floorWidth/2,m_floorLength/2,m_floorThickness/2);    //size
00213                     
00214   G4LogicalVolume*  
00215   logicFloor = new G4LogicalVolume(solidFloor, m_floorMaterial, "Floor");
00216   
00217   //rotation matrix to place the floor within cabin
00218   G4RotationMatrix* rotm1 = new G4RotationMatrix();
00219   rotm1->rotateX(90*deg);
00220 
00221   m_physiFloor = new G4PVPlacement(rotm1,               //rotation
00222                              G4ThreeVector(0,m_floorYcenter,0), //position 
00223                                  logicFloor,            //logicalVolume 
00224                                  "Floor",               //name 
00225                                  logicCabin,            //mother
00226                                  false,                 //no boolean
00227                                  0);                    //copy nb
00228                                  
00229   // Astronaut
00230   //
00231   G4Trd*
00232    solidAstronaut = new G4Trd("Astronaut",              //name
00233                0.5 * m_astronautBottomWidth,            //dx1
00234                0.5 * m_astronautTopWidth,               //dx2
00235                0.5 * m_astronautBottomWidth,            //dy1
00236                0.5 * m_astronautTopWidth,               //dy2
00237                0.5 * m_astronautHeight);                //dz
00238                          
00239   G4LogicalVolume*    
00240     logicAstronaut = new G4LogicalVolume(solidAstronaut,        //solid
00241                                          m_astronautMaterial,   //material
00242                                          "Astronaut");  //name
00243                                    
00244   //rotation matrix to place astronaut within cabin
00245   G4RotationMatrix* rotm2 = new G4RotationMatrix();
00246   rotm2->rotateX(90*deg);
00247   
00248   //translation vector to place astronaut within cabin
00249   G4ThreeVector position = G4ThreeVector(0.,m_astronautPosition,0.);                               
00250                                           
00251   m_physiAstronaut = new G4PVPlacement(rotm2,           //no rotation
00252                                  position,              //position
00253                                  logicAstronaut,        //logicalVolume
00254                                  "Astronaut",           //name
00255                                   logicCabin,           //mother
00256                                   false,                //no boolean
00257                                   0);                   //copy nb
00258 
00259 
00260   // ----------------------------------------------------------
00261   // -- Binding SensitiveDetector code to astronaut volume:
00262   // -- Note that it is possible to set the sensitive detector
00263   // -- at construction of the G4LogicalVolume (fith argument
00264   // -- is a G4VSensitiveDetector*).
00265   // ----------------------------------------------------------
00266   SensitiveDetector* sensitive = new SensitiveDetector("astronautSD");
00267   logicAstronaut->SetSensitiveDetector(sensitive);
00268   // -- inform the G4SDManager of this new sensitive detector object
00269   G4SDManager::GetSDMpointer()->AddNewDetector(sensitive);
00270 
00271 
00272   // ----------------------------------------------------------
00273   // -- Add sensitive detector to the floor, using the scorer
00274   // -- facilities. This made by a G4MultiFunctionalDetector
00275   // -- to which several "Primitive Scorer" (PS) object are
00276   // -- bound. Each of these primitive take care of a single
00277   // -- quantity.
00278   // ----------------------------------------------------------
00279   // -- create a multifunctional detector, this is of G4VSensitiveDetector type:
00280   G4MultiFunctionalDetector *floorScorer = new G4MultiFunctionalDetector("floorScorer");
00281   // -- attach it to the spaceship floor:
00282   logicFloor->SetSensitiveDetector(floorScorer);
00283   // -- and declare it to the G4SDManager:
00284   G4SDManager::GetSDMpointer()->AddNewDetector(floorScorer);
00285 
00286   G4VPrimitiveScorer* primitive;
00287 
00288   // -- create a "primitive" 
00289   primitive = new G4PSEnergyDeposit("edepFloor",0);
00290   // -- and register it to the multifunctionnal detector
00291   floorScorer->RegisterPrimitive(primitive);
00292   // -- it is possible to register as many primitives you wish 
00293 
00294   // -- entering track counter scorer:
00295   primitive = new G4PSTrackCounter("trackCounterFloor", fCurrent_In, 0); // <-- flag fCurrentIn defined in source/digits_hits/scorer/include/G4PSDirectionFlag.hh
00296   floorScorer->RegisterPrimitive(primitive);
00297   
00298 
00299 
00300   //colour attributes
00301   //
00302   
00303   G4VisAttributes* colourWhite= new G4VisAttributes(G4Colour(1.,1.,1.)); 
00304   colourWhite->SetVisibility(true);
00305   colourWhite->SetForceSolid(false);
00306   
00307   G4VisAttributes* colourGrey= new G4VisAttributes(G4Colour(0.5,0.5,0.5)); 
00308   colourGrey->SetVisibility(true);
00309   colourGrey->SetForceSolid(false);
00310   
00311   G4VisAttributes* colourCyan= new G4VisAttributes(G4Colour(0.,1.,1.)); 
00312   colourCyan->SetVisibility(true);
00313   colourCyan->SetForceSolid(false);
00314 
00315   G4VisAttributes* colourMagenta= new G4VisAttributes(G4Colour(1.,0.,1.)); 
00316   colourMagenta->SetVisibility(true);
00317   colourMagenta->SetForceSolid(true);
00318 
00319   G4VisAttributes* colourBlue= new G4VisAttributes(G4Colour(0.,0.,1.)); 
00320   colourBlue->SetVisibility(true);
00321   colourBlue->SetForceSolid(false);
00322   
00323   logicWorld->SetVisAttributes(colourGrey);
00324   logicSpacecraft->SetVisAttributes(colourCyan);
00325   logicCabin->SetVisAttributes(colourCyan);
00326   logicFloor->SetVisAttributes(colourWhite);
00327   logicAstronaut->SetVisAttributes(colourBlue);
00328     
00329   //print parameters
00330   //
00331   PrintParameters();
00332   
00333   // always return Physical World
00334   //
00335   return m_physiWorld;
00336 }


Member Data Documentation

G4VPhysicalVolume* DetectorConstruction::m_physiWorld [private]

Definition at line 92 of file DetectorConstruction.hh.

Referenced by ConstructVolumes(), and GetWorld().

G4VPhysicalVolume* DetectorConstruction::m_physiSpacecraft [private]

Definition at line 93 of file DetectorConstruction.hh.

Referenced by ConstructVolumes(), and GetSpacecraft().

G4VPhysicalVolume* DetectorConstruction::m_physiCabin [private]

Definition at line 94 of file DetectorConstruction.hh.

Referenced by ConstructVolumes(), and GetCabin().

G4VPhysicalVolume* DetectorConstruction::m_physiFloor [private]

Definition at line 95 of file DetectorConstruction.hh.

Referenced by ConstructVolumes(), and GetFloor().

G4VPhysicalVolume* DetectorConstruction::m_physiAstronaut [private]

Definition at line 96 of file DetectorConstruction.hh.

Referenced by ConstructVolumes(), and GetAstronaut().

Definition at line 117 of file DetectorConstruction.hh.

Referenced by ConstructVolumes(), GetFloorYcenter(), and SetFloorYcenter().

Definition at line 124 of file DetectorConstruction.hh.

Referenced by DetectorConstruction(), and ~DetectorConstruction().


The documentation for this class was generated from the following files:

Generated on Fri Nov 21 10:21:17 2008 for jour4b4 by  doxygen 1.5.7.1