#include "B1DetectorConstruction.hh" #include "DetectorSD.hh" #include "globals.hh" #include "G4FieldManager.hh" #include "G4TransportationManager.hh" #include "G4Mag_UsualEqRhs.hh" #include "G4Isotope.hh" #include "G4Element.hh" #include "G4Material.hh" #include "G4UnitsTable.hh" #include "G4Material.hh" #include "G4Element.hh" #include "G4MaterialTable.hh" #include "G4NistManager.hh" #include "Materials.hh" #include "G4VSolid.hh" #include "G4Box.hh" #include "G4Tubs.hh" #include "G4LogicalVolume.hh" #include "G4VPhysicalVolume.hh" #include "G4PVPlacement.hh" #include "G4PVParameterised.hh" #include "G4PVReplica.hh" #include "G4UserLimits.hh" #include "G4SDManager.hh" #include "G4VSensitiveDetector.hh" #include "G4RunManager.hh" #include "G4GenericMessenger.hh" #include "G4VisAttributes.hh" #include "G4Colour.hh" #include "G4ios.hh" #include "G4SystemOfUnits.hh" B1DetectorConstruction::B1DetectorConstruction() : G4VUserDetectorConstruction(), fScoringVolume(0) {} B1DetectorConstruction::~B1DetectorConstruction() { } G4VPhysicalVolume* B1DetectorConstruction::Construct() { // Get nist material manager G4NistManager* nist = G4NistManager::Instance(); // Envelope parameters // // Option to switch on/off checking of volumes overlaps // G4bool checkOverlaps = true; // // World // G4double world_sizeXY = 1*m; G4double world_sizeZ = 1*m; G4Material* world_mat = nist->FindOrBuildMaterial("G4_Galactic"); G4Box* solidWorld = new G4Box("World", //its name 0.5*world_sizeXY, // 0.5*world_sizeXY, // 0.5*world_sizeZ); //its size G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld, //its solid world_mat, //its material "World"); //its name G4VPhysicalVolume* physWorld = new G4PVPlacement(0, //no rotation G4ThreeVector(), //at (0,0,0) logicWorld, //its logical volume "World", //its name 0, //its mother volume false, //no boolean operation 0, //copy number checkOverlaps); //overlaps checking //оболочка /* G4ThreeVector pos1 = G4ThreeVector(0, 0, 0); auto solidEnv = new G4Box("Envelope", //its name 0.5*world_sizeXY, 0.5*world_sizeXY, 0.5*world_sizeZ); //its size G4LogicalVolume* logicEnv = new G4LogicalVolume(solidEnv, //its solid world_mat, //its material "Envelope"); //its name new G4PVPlacement(0, //no rotation pos1, //at (0,0,0) logicEnv, //its logical volume "Envelope", //its name logicWorld, //its mother volume false, //no boolean operation 0, //copy number checkOverlaps); //overlaps checking */ G4VisAttributes *att_1 = new G4VisAttributes(); att_1->SetColour(0.73,0.38,1); // определение цвета /* auto gun = new G4Box("gun",5*mm,5*mm,5.*mm); auto gun_Logical = new G4LogicalVolume(gun,world_mat,"gun_log"); gun_Logical->SetVisAttributes(att_1); new G4PVPlacement(0, G4ThreeVector(0*mm,0*mm,0.), gun_Logical, "gun_phys", logicWorld, false, 0, checkOverlaps); */ G4Material* body_mat = nist->FindOrBuildMaterial("G4_PbWO4"); //G4Material* body_mat = Materials::GetInstance()->GetMaterial("GGAG"); G4Material* logic_mat = nist->FindOrBuildMaterial("G4_Galactic"); G4ThreeVector pos2 = G4ThreeVector(0, 0, 0); // placement of Tube /*auto tubsolid = new G4Tubs( "tub",0.0,100*mm,6*mm,0.0,360*deg); G4LogicalVolume* fMagneticLogical = new G4LogicalVolume(tubsolid, logic_mat, "tublog"); G4RotationMatrix* fieldRot = new G4RotationMatrix(); new G4PVPlacement(0, pos2, fMagneticLogical, "exit", logicWorld, false, 0, checkOverlaps); */ // auto* ReplicaSD//логический объем для репликантов // = new G4Box("ReplicaSDBox",200*mm,200*mm,90.*mm); // auto ReplicaSDlogical // = new G4LogicalVolume(ReplicaSD,world_mat,"EMcalorimeterLogical"); // ReplicaSDlogical -> SetVisAttributes(G4VisAttributes::GetInvisible() );//невидимость логического объема ВАЖНО!!! // new G4PVPlacement(0, // G4ThreeVector(0.,0.,90*mm), // ReplicaSDlogical, // "EMcalorimeterPhysical", // logicWorld, // false, // 0, // checkOverlaps); //G4ThreeVector pos1 = G4ThreeVector(0, 0, 90*mm); auto calorimeterSolid = new G4Box("cellBox",11*mm,11*mm,90*mm); //центральный же logicbody = new G4LogicalVolume(calorimeterSolid,body_mat,"cellLogical"); //new G4PVPlacement(0, //no rotation // pos1, //at (0,0,0) // logicbody, //its logical volume // "Envelope", //its name // logicWorld, //its mother volume // false, //no boolean operation // 0, //copy number // checkOverlaps); //overlaps checking /* G4ThreeVector pos1 = G4ThreeVector(0, 0, 0); auto solidEnv = new G4Box("Envelope", //its name 0.5*world_sizeXY, 0.5*world_sizeXY, 0.5*world_sizeZ); //its size G4LogicalVolume* logicEnv = new G4LogicalVolume(solidEnv, //its solid world_mat, //its material "Envelope"); //its name new G4PVPlacement(0, //no rotation pos1, //at (0,0,0) logicEnv, //its logical volume "Envelope", //its name logicWorld, //its mother volume false, //no boolean operation 0, //copy number checkOverlaps); //overlaps checking */ //G4VPVParameterisation* cellParam = new B5CellParameterisation(); // цикы для центрирования четных и нечетных сборок G4int n = 1; if ( n%2 == 0) { for (int i = 1; i <=n; ++i) { for (int j = 1; j <= n; ++j) { new G4PVPlacement( 0, G4ThreeVector(23*mm*j-trunc(n/2+1)*23*mm+12*mm,23*mm*i-trunc(n/2+1)*23*mm+12*mm,90*mm) , logicbody, "calorimeter", logicWorld, false, j*11+i-11, true); } } } else { for (int i = 1; i <=n; ++i) { for (int j = 1; j <= n; ++j) { new G4PVPlacement( 0, G4ThreeVector(23*mm*j-trunc(n/2+1)*23*mm,23*mm*i-trunc(n/2+1)*23*mm,90*mm) , logicbody, "calorimeter", logicWorld, false, j*11+i-10, true); } } } // G4VPhysicalVolume *trackerChamber_phys = //важно, помещение репликантов (объемов, которые были скопированы и собраны в сборку // new G4PVParameterised("cellPhysical", //командой replica или parametrised помещаются в подготовленный заранее Логический объем!!! // logicbody, // ReplicaSDlogical,//а вот и сам логический объем, для репликантов // kXAxis, // EmCells, // cellParam); return physWorld; } void B1DetectorConstruction::ConstructSDandField() { G4SDManager* SDman = G4SDManager::GetSDMpointer(); auto *sensdet = new DetectorSD("SensitiveDetector"); SDman->AddNewDetector(sensdet); logicbody->SetSensitiveDetector(sensdet); }