Commit 9d030d49 authored by Elidiano Tronchin's avatar Elidiano Tronchin
Browse files

*Adding geometry

	-Simulation doesn't work yet..
parent 11e50718
......@@ -64,6 +64,7 @@ namespace Minos_NS{
const double Width = 100*mm ;
const double Thickness = 300*mm ;
const string Material = "BC400";
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......@@ -116,6 +117,185 @@ G4LogicalVolume* Minos::BuildSquareDetector(){
return m_SquareDetector;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Minos::DefineMaterials()
{
//This function illustrates the possible ways to define materials
G4String symbol; //a=mass of a mole;
G4double a, z, density; //z=mean number of protons;
G4int ncomponents, natoms;
G4double fractionmass;
//
// define Elements
//
G4Element* H = new G4Element("Hydrogen",symbol="H" , z= 1., a= 1.01*g/mole);
G4Element* C = new G4Element("Carbon" ,symbol="C" , z= 6., a= 12.01*g/mole);
G4Element* F = new G4Element("Fluorin" ,symbol="F" , z= 9., a= 19.0*g/mole);
G4Element* N = new G4Element("Nitrogen",symbol="N" , z= 7., a= 14.01*g/mole);
G4Element* O = new G4Element("Oxygen" ,symbol="O" , z= 8., a= 16.00*g/mole);
G4Element* Ar = new G4Element("Argon", symbol="Ar", z=18, a=39.948*g/mole);
G4Element* Fe = new G4Element("Fer",symbol="Fe" , z= 26., a= 55.9*g/mole);
G4Element* Cr = new G4Element("Chrome",symbol="Cr" , z= 24., a= 52.*g/mole);
new G4Material("Aluminium", z=13., a=26.98*g/mole, density=2.700*g/cm3);
new G4Material("liquidArgon", z=18., a= 39.95*g/mole, density= 1.390*g/cm3);
new G4Material("Lead" , z=82., a= 207.19*g/mole, density= 11.35*g/cm3);
new G4Material("Silicium", z=14., a=28.09*g/mole, density=2.330*g/cm3);
new G4Material("Titanium", z=22., a=47.87*g/mole, density=4.510*g/cm3);
G4Material* iso = new G4Material("isobutane", density=0.002506*g/cm3, ncomponents=2);
iso->AddElement(C, natoms=4);
iso->AddElement(H, natoms=10);
G4Material* CF4 =
new G4Material("CF4", density= 0.0036586*g/cm3, ncomponents=2);
CF4->AddElement(C, natoms=1);
CF4->AddElement(F, natoms=4);
// overwrite computed meanExcitationEnergy with ICRU recommended value
CF4->GetIonisation()->SetMeanExcitationEnergy(20.0*eV);
G4Material* mix =
new G4Material("mix", density= 0.0019836*g/cm3, ncomponents=3);
mix->AddMaterial(CF4, fractionmass=15.*perCent);
mix->AddMaterial(iso, fractionmass=3.*perCent);
mix->AddElement(Ar, fractionmass=82.*perCent);
// overwrite computed meanExcitationEnergy with ICRU recommended value
mix->GetIonisation()->SetMeanExcitationEnergy(25.0*eV);
G4Material* Ar_CF4_95_5 =
new G4Material("Ar_CF4_95_5", density= 0.0017611*g/cm3, ncomponents=2);
Ar_CF4_95_5->AddMaterial(CF4, fractionmass=5.*perCent);
Ar_CF4_95_5->AddElement(Ar, fractionmass=95.*perCent);
Ar_CF4_95_5->GetIonisation()->SetMeanExcitationEnergy(30.0*eV);
G4Material* Ar_CF4_90_10 =
new G4Material("Ar_CF4_90_10", density= 0.0018610*g/cm3, ncomponents=2);
Ar_CF4_90_10->AddMaterial(CF4, fractionmass=10.*perCent);
Ar_CF4_90_10->AddElement(Ar, fractionmass=90.*perCent);
Ar_CF4_90_10->GetIonisation()->SetMeanExcitationEnergy(25.0*eV);
G4Material* Ar_iso_97_3 =
new G4Material("Ar_iso_97_3", density= 0.0016838*g/cm3, ncomponents=2);
Ar_iso_97_3->AddMaterial(iso, fractionmass=3.*perCent);
Ar_iso_97_3->AddElement(Ar, fractionmass=97.*perCent);
Ar_iso_97_3->GetIonisation()->SetMeanExcitationEnergy(25.0*eV);
G4Material* Ar_iso_95_5 =
new G4Material("Ar_iso_95_5", density= 0.0016990*g/cm3, ncomponents=2);
Ar_iso_95_5->AddMaterial(iso, fractionmass=5.*perCent);
Ar_iso_95_5->AddElement(Ar, fractionmass=95.*perCent);
Ar_iso_95_5->GetIonisation()->SetMeanExcitationEnergy(25.0*eV);
G4Material* LH2 =
new G4Material("LH2", density= 0.0715*g/cm3, ncomponents=1);
LH2->AddElement(H, natoms=2);
G4Material* Myl =
new G4Material("Mylar", density= 1.397*g/cm3, ncomponents=3);
Myl->AddElement(C, natoms=10);
Myl->AddElement(H, natoms= 8);
Myl->AddElement(O, natoms= 4);
G4Material* Epo =
new G4Material("Epoxy", density= 1.85*g/cm3, ncomponents=3); //density of FR4 (Wikipedia)
Epo->AddElement(C, natoms=18);
Epo->AddElement(H, natoms= 20);
Epo->AddElement(O, natoms= 3);
G4Material* Air =
new G4Material("Air" , density= 1.290*mg/cm3, ncomponents=3);
Air->AddElement(N, fractionmass=0.781);
Air->AddElement(O, fractionmass=0.21);
Air->AddElement(Ar, fractionmass=0.009);
G4Material* Vacuum =
new G4Material("Galactic", z=1., a=1.01*g/mole,density= universe_mean_density,
kStateGas, 2.73*kelvin, 3.e-18*pascal);
G4Material* beam =
new G4Material("Beam", density= 1.e-5*g/cm3, ncomponents=1,
kStateGas, STP_Temperature, 2.e-2*bar);
beam->AddMaterial(Air, fractionmass=1.);
G4Material* Inox =
new G4Material("Inox", density= 8.02*g/cm3, ncomponents=3);
Inox->AddElement(C, fractionmass=0.001);
Inox->AddElement(Fe, fractionmass=0.829);
Inox->AddElement(Cr, fractionmass=0.17);
G4Material* Kapton =
new G4Material("Kapton", density= 1.42*g/cm3, ncomponents=4);
Kapton->AddElement(C, fractionmass=0.691133);
Kapton->AddElement(H, fractionmass=0.026362);
Kapton->AddElement(O, fractionmass=0.209235);
Kapton->AddElement(N, fractionmass=0.073270);
G4Material* Rohacell =
new G4Material("Rohacell", density= 0.075*g/cm3, ncomponents=4);
Rohacell->AddElement(C, fractionmass=0.6014);
Rohacell->AddElement(H, fractionmass=0.0805);
Rohacell->AddElement(O, fractionmass=0.3154);
Rohacell->AddElement(N, fractionmass=0.00276);
G4cout << *(G4Material::GetMaterialTable()) << G4endl;
//default materials of the World
defaultMaterial = Vacuum;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//SET MATERIALS
void Minos::SetTargetMaterial(G4String materialChoice)
{
// search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
if (pttoMaterial) TargetMaterial = pttoMaterial;
}
void Minos::SetChamberMaterial(G4String materialChoice)
{
// search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
if (pttoMaterial) ChamberMaterial = pttoMaterial;
}
void Minos::SetTPCMaterial(G4String materialChoice)
{
// search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
if (pttoMaterial) TPCMaterial = pttoMaterial;
}
void Minos::SetWindowMaterial(G4String materialChoice)
{
// search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
if (pttoMaterial) WindowMaterial = pttoMaterial;
}
void Minos::SetInnerRohacellMaterial(G4String materialChoice)
{
// search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
if (pttoMaterial) InnerRohacellMaterial = pttoMaterial;
}
void Minos::SetOuterRohacellMaterial(G4String materialChoice)
{
// search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
if (pttoMaterial) OuterRohacellMaterial = pttoMaterial;
}
void Minos::SetKaptonMaterial(G4String materialChoice)
{
// search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
if (pttoMaterial) KaptonMaterial = pttoMaterial;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LogicalVolume* Minos::BuildCylindricalDetector(){
if(!m_CylindricalDetector){
......@@ -128,7 +308,22 @@ G4LogicalVolume* Minos::BuildCylindricalDetector(){
m_CylindricalDetector->SetSensitiveDetector(m_MinosScorer);
*/
TargetRadius = 28.*mm; TargetLength = 150./2.*mm;
ChamberInnerRadius = 37.*mm; ChamberThickness = 1.*mm;
ChamberLength = 300./2.*mm;
InnerRohacellThickness = 1.*mm; KaptonThickness = 0.125*mm; OuterRohacellThickness = 2.*mm;
TPCRadiusExt = 100.*mm; WindowThickness = 0.150/2.*mm;
DefineMaterials();
SetTargetMaterial("LH2");
SetChamberMaterial("Inox");
SetTPCMaterial("mix");
SetWindowMaterial("Mylar");
SetKaptonMaterial("Kapton");
SetInnerRohacellMaterial("Rohacell");
SetOuterRohacellMaterial("Rohacell");
......@@ -139,8 +334,141 @@ G4LogicalVolume* Minos::BuildCylindricalDetector(){
}
return m_CylindricalDetector;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LogicalVolume* Minos::BuildTarget(){
if(!logicTarget){
//
// Target
//
solidTarget=0; logicTarget=0; physiTarget=0;
solidChamber=0; logicChamber=0; physiChamber=0;
solidTPC=0; logicTPC=0; physiTPC=0;
solidTarget = new G4Tubs("Target", //its name
0.,TargetRadius,TargetLength,0,360.);//size
logicTarget = new G4LogicalVolume(solidTarget, //its solid
TargetMaterial, //its material
"Target"); //its name
}
return logicTarget;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LogicalVolume* Minos::BuildChamber(){
if(!logicChamber){
//
// Chamber
//
solidChamber = new G4Tubs("Chamber", //its name
ChamberInnerRadius,ChamberInnerRadius+ChamberThickness,ChamberLength,0,360.); //size
logicChamber = new G4LogicalVolume(solidChamber, //its solid
ChamberMaterial, //its material
"Chamber"); //its name
}
return logicChamber;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LogicalVolume* Minos::BuildInnerRohacell(){
if(!logicInnerRohacell){
//
// Inner Rohacell
//
solidInnerRohacell = new G4Tubs("InnerRohacell", //its name
ChamberInnerRadius + ChamberThickness,ChamberInnerRadius + ChamberThickness+InnerRohacellThickness,ChamberLength,0,360.); //size
logicInnerRohacell = new G4LogicalVolume(solidInnerRohacell, //its solid
InnerRohacellMaterial, //its material
"InnerRohacell"); //its name
}
return logicInnerRohacell;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LogicalVolume* Minos::BuildOuterRohacell(){
if(!logicOuterRohacell){
//
// Outer Rohacell
//
solidOuterRohacell = new G4Tubs("OuterRohacell", //its name
ChamberInnerRadius + ChamberThickness + InnerRohacellThickness + KaptonThickness,ChamberInnerRadius + ChamberThickness + InnerRohacellThickness + KaptonThickness+OuterRohacellThickness,ChamberLength,0,360.); //size
logicOuterRohacell = new G4LogicalVolume(solidOuterRohacell, //its solid
OuterRohacellMaterial, //its material
"OuterRohacell"); //its name
}
return logicOuterRohacell;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LogicalVolume* Minos::BuildKapton(){
if(!logicKapton){
//
// Kapton
//
solidKapton = new G4Tubs("Kapton", //its name
ChamberInnerRadius + ChamberThickness+InnerRohacellThickness,ChamberInnerRadius + ChamberThickness+InnerRohacellThickness+KaptonThickness,ChamberLength,0,360.); //size
logicKapton = new G4LogicalVolume(solidKapton, //its solid
KaptonMaterial, //its material
"Kapton"); //its name
}
return logicKapton;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LogicalVolume* Minos::BuildTPC(){
if(!logicTPC){
//
// TPC
solidTPC = new G4Tubs("TPC", //its name
ChamberInnerRadius + ChamberThickness + InnerRohacellThickness + KaptonThickness + OuterRohacellThickness,TPCRadiusExt,ChamberLength,0,360.);
logicTPC = new G4LogicalVolume(solidTPC, //its solid
TPCMaterial, //its material
"TPC"); //name
}
return logicTPC;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
// windows
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LogicalVolume* Minos::BuildWindow0(){
if(!logicWindow0){
solidWindow0 = new G4Tubs("WindowTube", //its name
TargetRadius,TargetRadius+WindowThickness*2.,TargetLength,0,360.);
logicWindow0 = new G4LogicalVolume(solidWindow0, //its solid
WindowMaterial, //its material
"WindowTube"); //name
}
return logicWindow0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LogicalVolume* Minos::BuildWindow1(){
if(!logicWindow1){
solidWindow1 = new G4Tubs("WindowEntrance", //its name
0.,TargetRadius+2.*WindowThickness,WindowThickness,0,360.);
logicWindow1 = new G4LogicalVolume(solidWindow1, //its solid
WindowMaterial, //its material
"WindowEntrance"); //name
}
return logicWindow1;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LogicalVolume* Minos::BuildWindow2(){
if(!logicWindow2){
solidWindow2 = new G4Tubs("WindowOutcoming", //its name
0.,TargetRadius+2.*WindowThickness,WindowThickness,0,360.);
logicWindow2 = new G4LogicalVolume(solidWindow2, //its solid
WindowMaterial, //its material
"WindowOutcoming"); //name
}
return logicWindow2;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Virtual Method of NPS::VDetector class
......@@ -212,13 +540,94 @@ void Minos::ConstructDetector(G4LogicalVolume* world){
BuildCylindricalDetector(),
"Minos",world,false,i+1);
}
else if(m_Shape[i] == "Square"){
new G4PVPlacement(G4Transform3D(*Rot,Det_pos),
BuildSquareDetector(),
"Minos",world,false,i+1);
}
}
physiTarget = new G4PVPlacement(0, //no rotation
G4ThreeVector(0,0,TargetLength), //at (0,0,0)
BuildTarget(), //its logical volume
"Target", //its name
world, //its mother volume
false, //no boolean operation
0); //copy number
physiChamber = new G4PVPlacement(0, //its name
G4ThreeVector(0,0,ChamberLength), //at (0,0,0)
BuildChamber(), //its logical volume
"Chamber", //its name
world, //its mother volume
false, //no boolean operation
0); //copy number
physiInnerRohacell = new G4PVPlacement(0, //its name
G4ThreeVector(0,0,ChamberLength), //at (0,0,0)
BuildInnerRohacell(), //its logical volume
"InnerRohacell", //its name
world, //its mother volume
false, //no boolean operation
0); //copy number
physiOuterRohacell = new G4PVPlacement(0, //its name
G4ThreeVector(0,0,ChamberLength), //at (0,0,0)
BuildOuterRohacell(), //its logical volume
"OuterRohacell", //its name
world, //its mother volume
false, //no boolean operation
0); //copy number
physiKapton = new G4PVPlacement(0, //its name
G4ThreeVector(0,0,ChamberLength), //at (0,0,0)
BuildKapton(), //its logical volume
"Kapton", //its name
world, //its mother volume
false, //no boolean operation
0); //copy number
physiTPC = new G4PVPlacement(0, //its name
G4ThreeVector(0,0,ChamberLength), //at (0,0,0)
BuildTPC(), //its logical volume
"TPC", //its name
world, //its mother volume
false, //no boolean operation
0); //copy number
physiWindow0 = new G4PVPlacement(0, //its name
G4ThreeVector(0,0,TargetLength), //at (0,0,0)
BuildWindow0(), //its logical volume
"WindowTube", //its name
world, //its mother volume
false, //no boolean operation
0); //copy number
physiWindow1 = new G4PVPlacement(0, //its name
G4ThreeVector(0,0,-1.*WindowThickness), //at (0,0,0)
BuildWindow1(), //its logical volume
"WindowEntrance", //its name
world, //its mother volume
false, //no boolean operation
0); //copy number
physiWindow2 = new G4PVPlacement(0, //its name
G4ThreeVector(0,0,2.*TargetLength+WindowThickness), //at (0,0,0)
BuildWindow2(), //its logical volume
"WindowOutcoming", //its name
world, //its mother volume
false, //no boolean operation
0); //copy number
G4Region* aRegion = new G4Region("TPCLog");
logicTPC -> SetRegion(aRegion);
aRegion -> AddRootLogicalVolume(logicTPC);
}
//
// Visualization attributes
//
world->SetVisAttributes (G4VisAttributes::Invisible);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Add Detector branch to the EventTree.
......
......@@ -54,13 +54,125 @@ class Minos : public NPS::VDetector{
// Spherical
void AddDetector(double R,double Theta,double Phi,string Shape);
private:
//For material definition
void DefineMaterials();
public:
void SetTargetMaterial(G4String materialChoice);
void SetChamberMaterial(G4String materialChoice);
void SetTPCMaterial(G4String materialChoice);
void SetWindowMaterial(G4String materialChoice);
void SetInnerRohacellMaterial(G4String materialChoice);
void SetOuterRohacellMaterial(G4String materialChoice);
void SetKaptonMaterial(G4String materialChoice);
G4LogicalVolume* BuildSquareDetector();
G4LogicalVolume* BuildCylindricalDetector();
G4LogicalVolume* BuildTarget();
G4LogicalVolume* BuildChamber();
G4LogicalVolume* BuildInnerRohacell();
G4LogicalVolume* BuildOuterRohacell();
G4LogicalVolume* BuildKapton();
G4LogicalVolume* BuildTPC();
G4LogicalVolume* BuildWindow0();
G4LogicalVolume* BuildWindow1();
G4LogicalVolume* BuildWindow2();
public:
G4double GetTargetLength() {return TargetLength*2.;};
G4Material* GetTargetMaterial() {return TargetMaterial;};
G4double GetTargetRadius() {return TargetRadius;};
const G4VPhysicalVolume* GetphysiWorld() {return physiWorld;};
const G4VPhysicalVolume* GetTarget() {return physiTarget;};
const G4VPhysicalVolume* GetChamber() {return physiChamber;};
const G4VPhysicalVolume* GetTPC() {return physiTPC;};
const G4VPhysicalVolume* GetWindow0() {return physiWindow0;};
const G4VPhysicalVolume* GetWindow1() {return physiWindow1;};
const G4VPhysicalVolume* GetWindow2() {return physiWindow2;};
const G4VPhysicalVolume* GetInnerRohacell() {return physiInnerRohacell;};
const G4VPhysicalVolume* GetOuterRohacell() {return physiOuterRohacell;};
const G4VPhysicalVolume* GetKapton() {return physiKapton;};
private:
G4Material* TargetMaterial;
G4double TargetRadius;
G4double TargetLength;
G4Material* WindowMaterial;
G4double WindowThickness;
G4Material* ChamberMaterial;
G4double ChamberInnerRadius;
G4double ChamberLength;
G4double ChamberThickness;
G4Material* InnerRohacellMaterial;
G4double InnerRohacellThickness;
G4Material* OuterRohacellMaterial;
G4double OuterRohacellThickness;
G4Material* KaptonMaterial;
G4double KaptonThickness;
G4Material* TPCMaterial;
G4double TPCRadiusExt;
G4Material* defaultMaterial;
G4double WorldSizeXY;
G4double WorldSizeZ;
G4LogicalVolume* m_SquareDetector;
G4LogicalVolume* m_CylindricalDetector;
G4Box* solidWorld; //pointer to the solid World
G4LogicalVolume* logicWorld; //pointer to the logical World
G4VPhysicalVolume* physiWorld; //pointer to the physical World
G4Tubs* solidTarget;
G4LogicalVolume* logicTarget;
G4VPhysicalVolume* physiTarget;
G4Tubs* solidChamber;
G4LogicalVolume* logicChamber;
G4VPhysicalVolume* physiChamber;
G4Tubs* solidTPC;
G4LogicalVolume* logicTPC;
G4VPhysicalVolume* physiTPC;
G4Tubs* solidWindow0;
G4LogicalVolume* logicWindow0;
G4VPhysicalVolume* physiWindow0;
G4Tubs* solidWindow1;
G4LogicalVolume* logicWindow1;
G4VPhysicalVolume* physiWindow1;
G4Tubs* solidWindow2;
G4LogicalVolume* logicWindow2;
G4VPhysicalVolume* physiWindow2;
G4Tubs* solidInnerRohacell;
G4LogicalVolume* logicInnerRohacell;
G4VPhysicalVolume* physiInnerRohacell;
G4Tubs* solidOuterRohacell;
G4LogicalVolume* logicOuterRohacell;
G4VPhysicalVolume* physiOuterRohacell;
G4Tubs* solidKapton;
G4LogicalVolume* logicKapton;
G4VPhysicalVolume* physiKapton;
////////////////////////////////////////////////////
////// Inherite from NPS::VDetector class /////////
......@@ -102,8 +214,8 @@ class Minos : public NPS::VDetector{
vector<double> m_R;
vector<double> m_Theta;
vector<double> m_Phi;
// Shape type
// Shape type
vector<string> m_Shape ;
// Visualisation Attribute
......
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Target
THICKNESS= 10 micrometer
RADIUS= 20 mm
MATERIAL= CD2