// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // /// \file exampleB1.cc /// \brief Main program of the B1 example #ifdef G4MULTITHREADED #include "G4MTRunManager.hh" #else #include "G4RunManager.hh" #endif #include "B1DetectorConstruction.hh" #include "B1ActionInitialization.hh" #include "gem90PhysicsList.hh" #include "B1SteppingAction.hh" #include "B1EventAction.hh" #include "B1PrimaryGeneratorAction.hh" #include "B1RunAction.hh" #include "B1ActionInitialization.hh" #include "MyLogger.hh" #include "G4RunManagerFactory.hh" #include "G4UImanager.hh" #include "QBBC.hh" #include "G4VisExecutive.hh" #include "G4ScoringManager.hh" #include "G4UIExecutive.hh" #include "G4SystemOfUnits.hh" #include "B1PrimaryGeneratorAction.hh" #include "MyMain.hh" #include "Randomize.hh" //#include "g4analysis.hh" #include "G4AnalysisManager.hh" #include #include #include #include #include using namespace std; //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //void PrintHeader(); int main(int argc,char** argv) { MyMain* mymain=0; mymain->PrintHeader(); // ----------------------------------------------- // --- Set detector // -------------------------------------------------------- GeMi=false; //switching on this flag simulation uses GeMi detector GeBaradello=true; //switching on this flag simulation uses GeBaradello detector GePaolo=false; //switching on this flag simulation uses GePaolo detector // ----------------------------------------------- // --- Set sample geometry // -------------------------------------------------------- smarinelli_geom=false; //switching on this flag simulation uses smarinelli sample vsmarinelli_geom=false; //switching on this flag simulation uses vsmarinelli sample box_geom=false; //switching on this flag simulation uses box sample tube_geom=false; //switching on this flag simulation uses tube sample twobox_geom=false; //switching on this flag simulation uses two box sample liquid_geom=false; //switching on this flag simulation uses liquid sample nocuinsert_geom=false; //switching on this flag simulation uses nocuinsert sample. marinelli_geom=false; //switching on this flag simulation uses nocuinsert sample smarinellispecial_geom=false; //switching on this flag simulation uses smarinelli special sample custom_geom=false; //switching on this flag simulation uses custom sample customnocuinsert_geom=true; //switching on this flag simulation uses custom no cuinsert sample. You have also to set the section "customnocuinsert cap" drillcoresERMES_geom=false; //switching on this flag simulation uses drill cores ERMES sample drillcoresERMESa_geom=false; //switching on this flag simulation uses drill cores ERMES a sample drillcoresERMESb_geom=false; //switching on this flag simulation uses drill cores ERMES b sample sbox_geom=false; //switching on this flag simulation uses sbox sample // ----------------------------------------------- // --- customnocuinsert cup // -------------------------------------------------------- customnocuinsertnormal_geom=false; //switching on this flag simulation uses customnocuinsert with the normal sample. customnocuinsertbottle_geom=true; //switching on this flag simulation uses customnocuinsert with the bottle sample. // ----------------------------------------------- // --- Get particles entering the crystal // -------------------------------------------------------- GetKinematicsFlag=true; //switching on this flag you can store kinematics of particles entering the crystal if ((GeMi && (GeBaradello || GePaolo)) || (GeBaradello && (GeMi || GePaolo)) || (GePaolo && (GeMi || GeBaradello))) { filestream <<"\n \n"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"# Error!!! #"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"\n"<< std::endl; filestream << "Two, or more Ge detectors have been selected" << std::endl; filestream << "Please check and run the simulation again!" << std::endl; G4cout << "Two, or more Ge detectors have been selected" << G4endl; G4cout << "Please check and run the simulation again!" << G4endl; G4Exception("","",FatalException,"Exit simulation"); } if (!GeMi && !GeBaradello && !GePaolo){ filestream <<"\n \n"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"# Error!!! #"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"\n"<< std::endl; filestream << "You didn't select the Ge detector" << std::endl; filestream << "Please check and run the simulation again!" << std::endl; G4cout << "You didn't select the Ge detector" << G4endl; G4cout << "Please check and run the simulation again!" << G4endl; G4Exception("","",FatalException,"Exit simulation"); } if ((smarinelli_geom && (vsmarinelli_geom || box_geom || tube_geom || twobox_geom || liquid_geom || nocuinsert_geom || marinelli_geom || smarinellispecial_geom || custom_geom || customnocuinsert_geom || drillcoresERMES_geom || drillcoresERMESa_geom || drillcoresERMESb_geom || sbox_geom)) || (vsmarinelli_geom && (smarinelli_geom || box_geom || tube_geom || twobox_geom || liquid_geom || nocuinsert_geom || marinelli_geom || smarinellispecial_geom || custom_geom || customnocuinsert_geom || drillcoresERMES_geom || drillcoresERMESa_geom || drillcoresERMESb_geom || sbox_geom)) || (box_geom && (smarinelli_geom || vsmarinelli_geom || tube_geom || twobox_geom || liquid_geom || nocuinsert_geom || marinelli_geom || smarinellispecial_geom || custom_geom || customnocuinsert_geom || drillcoresERMES_geom || drillcoresERMESa_geom || drillcoresERMESb_geom || sbox_geom)) || (tube_geom && (smarinelli_geom || vsmarinelli_geom || box_geom || twobox_geom || liquid_geom || nocuinsert_geom || marinelli_geom || smarinellispecial_geom || custom_geom || customnocuinsert_geom || drillcoresERMES_geom || drillcoresERMESa_geom || drillcoresERMESb_geom || sbox_geom)) || (twobox_geom && (smarinelli_geom || vsmarinelli_geom || box_geom || tube_geom || liquid_geom || nocuinsert_geom || marinelli_geom || smarinellispecial_geom || custom_geom || customnocuinsert_geom || drillcoresERMES_geom || drillcoresERMESa_geom || drillcoresERMESb_geom || sbox_geom)) || (liquid_geom && (smarinelli_geom || vsmarinelli_geom || box_geom || tube_geom || twobox_geom || nocuinsert_geom || marinelli_geom || smarinellispecial_geom || custom_geom || customnocuinsert_geom || drillcoresERMES_geom || drillcoresERMESa_geom || drillcoresERMESb_geom || sbox_geom)) || (nocuinsert_geom && (smarinelli_geom || vsmarinelli_geom || box_geom || tube_geom || twobox_geom || liquid_geom || marinelli_geom || smarinellispecial_geom || custom_geom || customnocuinsert_geom || drillcoresERMES_geom || drillcoresERMESa_geom || drillcoresERMESb_geom || sbox_geom)) || (marinelli_geom && (smarinelli_geom || vsmarinelli_geom || box_geom || tube_geom || twobox_geom || liquid_geom || nocuinsert_geom || smarinellispecial_geom || custom_geom || customnocuinsert_geom || drillcoresERMES_geom || drillcoresERMESa_geom || drillcoresERMESb_geom || sbox_geom)) || (smarinellispecial_geom && (smarinelli_geom || vsmarinelli_geom || box_geom || tube_geom || twobox_geom || liquid_geom || nocuinsert_geom || marinelli_geom || custom_geom || customnocuinsert_geom || drillcoresERMES_geom || drillcoresERMESa_geom || drillcoresERMESb_geom || sbox_geom)) || (custom_geom && (smarinelli_geom || vsmarinelli_geom || box_geom || tube_geom || twobox_geom || liquid_geom || nocuinsert_geom || marinelli_geom || smarinellispecial_geom || customnocuinsert_geom || drillcoresERMES_geom || drillcoresERMESa_geom || drillcoresERMESb_geom || sbox_geom)) || (customnocuinsert_geom && (smarinelli_geom || vsmarinelli_geom || box_geom || tube_geom || twobox_geom || liquid_geom || nocuinsert_geom || marinelli_geom || smarinellispecial_geom || custom_geom || drillcoresERMES_geom || drillcoresERMESa_geom || drillcoresERMESb_geom || sbox_geom)) || (drillcoresERMES_geom && (smarinelli_geom || vsmarinelli_geom || box_geom || tube_geom || twobox_geom || liquid_geom || nocuinsert_geom || marinelli_geom || smarinellispecial_geom || custom_geom || customnocuinsert_geom || drillcoresERMESa_geom || drillcoresERMESb_geom || sbox_geom)) || (drillcoresERMESa_geom && (smarinelli_geom || vsmarinelli_geom || box_geom || tube_geom || twobox_geom || liquid_geom || nocuinsert_geom || marinelli_geom || smarinellispecial_geom || custom_geom || customnocuinsert_geom || drillcoresERMES_geom || drillcoresERMESb_geom || sbox_geom)) || (drillcoresERMESb_geom && (smarinelli_geom || vsmarinelli_geom || box_geom || tube_geom || twobox_geom || liquid_geom || nocuinsert_geom || marinelli_geom || smarinellispecial_geom || custom_geom || customnocuinsert_geom || drillcoresERMES_geom || drillcoresERMESa_geom || sbox_geom))|| (sbox_geom && (smarinelli_geom || vsmarinelli_geom || box_geom || tube_geom || twobox_geom || liquid_geom || nocuinsert_geom || marinelli_geom || smarinellispecial_geom || custom_geom || customnocuinsert_geom || drillcoresERMES_geom || drillcoresERMESa_geom || drillcoresERMESb_geom))){ filestream <<"\n \n"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"# Error!!! #"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"\n"<< std::endl; filestream << "Two, or more sample geometries have been selected" << std::endl; filestream << "Please check and run the simulation again!" << std::endl; G4cout << "Two, or more sample geometries have been selected" << G4endl; G4cout << "Please check and run the simulation again!" << G4endl; G4Exception("","",FatalException,"Exit simulation"); } if (customnocuinsert_geom && !customnocuinsertnormal_geom && !customnocuinsertbottle_geom){ filestream <<"\n \n"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"# Error!!! #"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"\n"<< std::endl; filestream << "You didn't select the cap" << std::endl; filestream << "Please check and run the simulation again!" << std::endl; G4cout << "You didn't select the cap" << G4endl; G4cout << "Please check and run the simulation again!" << G4endl; G4Exception("","",FatalException,"Exit simulation"); } if (customnocuinsert_geom && customnocuinsertnormal_geom && customnocuinsertbottle_geom){ filestream <<"\n \n"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"# Error!!! #"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"\n"<< std::endl; filestream << "You selected two caps" << std::endl; filestream << "Please check and run the simulation again!" << std::endl; G4cout << "You selected two caps" << G4endl; G4cout << "Please check and run the simulation again!" << G4endl; G4Exception("","",FatalException,"Exit simulation"); } if(!smarinelli_geom && !vsmarinelli_geom && !box_geom && !tube_geom && !twobox_geom && !liquid_geom && !nocuinsert_geom && !marinelli_geom&& !smarinellispecial_geom && !custom_geom && !customnocuinsert_geom && !drillcoresERMES_geom && !drillcoresERMESa_geom && !drillcoresERMESb_geom && !sbox_geom){ filestream <<"\n \n"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"# Error!!! #"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"\n"<< std::endl; filestream << "You didn't select the sample geometry" << std::endl; filestream << "Please check and run the simulation again!" << std::endl; G4cout << "You didn't select the sample geometry" << G4endl; G4cout << "Please check and run the simulation again!" << G4endl; G4Exception("","",FatalException,"Exit simulation"); } mymain->PrintDetectorGeometry(); // ----------------------------------------- // --- Costants // -------------------------------------------------------- G4double pi = 3.14159265358979323846; G4double twopi=2.*pi; // ----------------------------------------- // --- Geometry // -------------------------------------------------------- //World- (World is a box) G4double world_sizeX = 1*m; // Total x-length G4double world_sizeY = 1*m; // Total y-length G4double world_sizeZ = 1*m; // Total z-length G4int WorldMat = 0; // set world material: 0 is vacuum, 1 is air //leadshield_box (GeMI) G4double leadshield_sizeX = 65*cm; // Total x-length G4double leadshield_sizeY = 65*cm; // Total y-length G4double leadshield_sizeZ = 100*cm; // Total z-length //leadshield_box (GeBaradello) G4double outercoppershield_sizeX = 65*cm; // Total x-length G4double outercoppershield_sizeY = 65*cm; // Total y-length G4double outercoppershield_sizeZ = 100*cm; // Total z-length //coppershield_box G4double coppershield_sizeX; G4double coppershield_sizeY; G4double coppershield_sizeZ; if (GeMi){ coppershield_sizeX = 25*cm; // Total x-length coppershield_sizeY = 25*cm; // Total y-length coppershield_sizeZ = 50*cm; // Total z-length } else if (GeBaradello){ coppershield_sizeX = 65*cm; // Total x-length coppershield_sizeY = 65*cm; // Total y-length coppershield_sizeZ = 100*cm; // Total z-length } //Nfilledchamber_box G4double Nfilledchamber_sizeX; G4double Nfilledchamber_sizeY; G4double Nfilledchamber_sizeZ; G4double Nfilledchamber_Zplace; if (GeMi){ Nfilledchamber_sizeX = 16*cm; // Total x-length Nfilledchamber_sizeY = 16*cm; // Total y-length Nfilledchamber_sizeZ = 23.9*cm; // Total z-length Nfilledchamber_Zplace = 11.95; //z position } else if (GeBaradello){ Nfilledchamber_sizeX = 17*cm; // Total x-length Nfilledchamber_sizeY = 17*cm; // Total y-length Nfilledchamber_sizeZ = 23.2*cm; // Total z-length Nfilledchamber_Zplace = 11.6; //z position } //detwindow_tubs G4double Ndetwindow_Rmax; G4double Ndetwindow_sizeZ; G4double Ndetwindow_Zplace; if (GeMi){ Ndetwindow_Rmax = 4.6*cm; // Total radius Ndetwindow_sizeZ = 0.05*cm; //Total z-length Ndetwindow_Zplace = 2.525*cm; //z position } if (GeBaradello){ Ndetwindow_Rmax = 3.38*cm; // Total radius Ndetwindow_sizeZ = 0.15*cm; //Total z-length Ndetwindow_Zplace = 2.825*cm; //z position } //dethousing_tubs G4double dethousing_Rmin; G4double dethousing_Rmax; G4double dethousing_Zplace; G4double dethousing_sizeZ = 14.5*cm; //Total z-length if (GeMi){ dethousing_Rmin = 4.6*cm; // Minimum radius dethousing_Rmax = 4.7*cm; // Maximum radius dethousing_Zplace = -4.7*cm; // z position } else if (GeBaradello){ dethousing_Rmin = 3.38*cm; // Minimum radius dethousing_Rmax = 3.53*cm; // Maximum radius dethousing_Zplace = -4.35*cm; // z position } //detvacuum_tubs G4double detvacuum_Rmax; G4double detvacuum_sizeZ; G4double detvacuum_Zplace; if (GeMi){ detvacuum_Rmax = 4.6*cm; // Maximum radius detvacuum_sizeZ = 14.45*cm; //Total z-length detvacuum_Zplace = -4.725*cm; // z position } else if (GeBaradello){ detvacuum_Rmax = 3.38*cm; // Maximum radius detvacuum_sizeZ = 14.35*cm; //Total z-length detvacuum_Zplace = -4.225*cm; // z position } //dethousingclad_tubs G4double dethousingclad_Rmin = 4.575*cm; //Minimum radius G4double dethousingclad_Rmax = 4.6*cm; //Maximum radius G4double dethousingclad_sizeZ = 14.05*cm; //Total z-length //detinnercap_tubs G4double crystal_d; G4double detinnercap_Rmin; G4double detinnercap_Rmax; G4double detinnercap_sizeZ; G4double detinnercap_Zshift; if (GeMi){ crystal_d = 7.19*cm; //crystal diameter detinnercap_Rmin = 0.5*crystal_d + 0.005*cm; //Minimum radius detinnercap_Rmax = 0.5*crystal_d + 0.055*cm; //Maximum radius detinnercap_sizeZ = 12.62*cm; //Total z-length detinnercap_Zshift = 0.915*cm; // Shift along z-axis } else if (GeBaradello){ crystal_d = 5.86*cm;; //crystal diameter detinnercap_Rmin = 0.5*crystal_d + 0.005*cm; //Minimum radius detinnercap_Rmax = 0.5*crystal_d + 0.081*cm; //Maximum radius detinnercap_sizeZ = 9.4*cm; //Total z-length detinnercap_Zshift = 2.475*cm; // Shift along z-axis } //detinnercapbottom_tubs G4double detinnercapbottom_Rmax; G4double detinnercapbottom_Zshift; G4double detinnercapbottom_Rmin = 0.8*cm; //Minimum radius if (GeMi){ detinnercapbottom_Rmax = 0.5*crystal_d + 0.055*cm; //Maximum radius detinnercapbottom_Zshift = -5.555*cm; // Shift along z-axis } else if (GeBaradello){ detinnercapbottom_Rmax = 0.5*crystal_d + 0.005*cm; //Maximum radius detinnercapbottom_Zshift = -2.065*cm; // Shift along z-axis } G4double detinnercapbottom_sizeZ = 0.32*cm; //Total z-length //detinnercapring_tubs G4double detinnercapring_Rmin; G4double detinnercapring_Rmax; if (GeMi){ detinnercapring_Rmin = crystal_d/2+0.055*cm; //Minimum radius detinnercapring_Rmax = crystal_d/2+0.255*cm; //Maximum radius } else if (GeBaradello){ detinnercapring_Rmin = crystal_d/2+0.081; //Minimum radius detinnercapring_Rmax = crystal_d/2+0.281*cm; //Maximum radius } G4double detinnercapring_sizeZ = 0.6*cm; //Total z-length //detinnercaptop_tubs G4double detinnercaptop_sizeZ; G4double detinnercaptop_Zshift; G4double detinnercaptop_Rmax = crystal_d/2+0.005*cm; //Maixmum radius if (GeMi){ detinnercaptop_sizeZ = 0.0013*cm; //Total z-length detinnercaptop_Zshift = 7.22565*cm; // Shift along z-axis } else if (GeBaradello){ detinnercaptop_sizeZ = 0.0015*cm; //Total z-length detinnercaptop_Zshift = 7.1735*cm; // Shift along z-axis } //detinnercapplate_tubs G4double detinnercapplate_sizeZ; G4double detinnercapplate_Zshift; G4double detinnercapplate_Rmax = crystal_d/2.+0.005*cm; //Maximum radius if (GeMi){ detinnercapplate_sizeZ = 0.0025*cm; //Total z-length detinnercapplate_Zshift = 7.22755*cm; // Shift along z-axis } if (GeBaradello){ detinnercapplate_sizeZ = 0.0030*cm; //Total z-length detinnercapplate_Zshift = 7.1705*cm; // Shift along z-axis } //detpecap_tubs G4double detpecap_Rmin = crystal_d/2+0.055*cm; //Minimum radius G4double detpecap_Rmax = crystal_d/2+0.155*cm; //Maximum radius G4double detpecap_sizeZ = 0.8*cm; //Total z-length //detpecaptop_tubs G4double detpecaptop_Rmin = crystal_d/2.-0.145*cm; //Minimum radius G4double detpecaptop_Rmax = crystal_d/2.+0.155*cm; //Maximum radius G4double detpecaptop_sizeZ = 0.1*cm; //Total z-length //detdeadlayer_tubs G4double crystal_l; G4double detdeadlayer_Zshift; if (GeMi){ crystal_l=10.41*cm; //crystal length detdeadlayer_Zshift = 7.225*cm; // Shift along z-axis } else if (GeBaradello){ crystal_l=5.56*cm; //crystal length detdeadlayer_Zshift = 7.169*cm; // Shift along z-axis } G4double detdeadlayer_Rmax = crystal_l/2.; //Maximum radius G4double detdeadlayer_sizeZ = crystal_l; //Total z-length //crystal_tubs G4double d_dead=0.15*cm; G4double crystal_Rmax = crystal_d/2-d_dead; //Maximum radius G4double crystal_sizeZ = crystal_l-d_dead; //Total z-length //dethole_shape G4double hole_d; G4double hole_l; if (GeMi){ hole_d=1.11*cm; hole_l=9.23*cm; } else if (GeBaradello){ hole_d=1.01*cm; hole_l=4.88*cm; } G4double detholeincrystal_Rmax = hole_d/2; //Maximum radius G4double detholeincrystal_sizeZ = hole_l-hole_d/2; //Total z-length //detdeadcone_cons G4double y = 0; y = hole_d/2*(sqrt(2.)-1)/cos(twopi/8); G4double detdeadcone_Rmin1 = crystal_d/2-0.0001*cm-d_dead; //Minimum radius -Dz G4double detdeadcone_Rmax1 = crystal_d/2-d_dead; //Maximum radius -Dz G4double detdeadcone_Rmin2 = crystal_d/2-y-d_dead; //Minimum radius +Dz G4double detdeadcone_Rmax2 = crystal_d/2-d_dead; //Maximum radius +Dz G4double detdeadcone_sizeZ = y; //Total z-length //Cublock_box (smarinelli sample) G4double Cublock_sizeX; G4double Cublock_sizeY; G4double Cublock_sizeZ; if (smarinelli_geom){ Cublock_sizeX = 16.0*cm; //Total x-length Cublock_sizeY = 16.0*cm; //Total y-length Cublock_sizeZ = 7.2*cm; //Total z-length } //drhole_tubs (smarinelli sample) G4double drhole_Rmax; G4double drhole_sizeZ; if (smarinelli_geom){ drhole_Rmax = 5.0*cm; //Maximum radius drhole_sizeZ = 7.2*cm; //Total z-length } //marinellis1l_tubs (smarinelli sample) G4double marinellis1l_Rmin; G4double marinellis1l_Rmax; G4double marinellis1l_sizeZ; if (smarinelli_geom){ marinellis1l_Rmin = 4.95*cm; //Minimum radius marinellis1l_Rmax = 7.35*cm; //Maximum radius marinellis1l_sizeZ = 0.2*cm; //Total z-length } //marinellis1o_tubs (smarinelli sample) G4double marinellis1o_Rmin = 7.25*cm; //Minimum radius G4double marinellis1o_Rmax = 7.35*cm; //Maximum radius G4double marinellis1o_sizeZ = 7.8*cm; //Total z-length //marinellis2o_cons (smarinelli sample) G4double marinellis2o_Rmin1 = 7.3*cm; //Minimum radius -Dz G4double marinellis2o_Rmax1 = 7.4*cm; //Maximum radius -Dz G4double marinellis2o_Rmin2 = 7.675*cm; //Minimum radius +Dz G4double marinellis2o_Rmax2 = 7.775*cm; //Maximum radius +Dz G4double marinellis2o_sizeZ = 8.6*cm; //Total z-length //marinellis1i_cons (smarinelli sample) G4double marinellis1i_Rmin1; G4double marinellis1i_Rmax1; G4double marinellis1i_Rmin2; G4double marinellis1i_Rmax2; G4double marinellis1i_sizeZ; if (smarinelli_geom){ marinellis1i_Rmin1 = 4.95*cm; //Minimum radius -Dz marinellis1i_Rmax1 = 5.05*cm; //Maximum radius -Dz marinellis1i_Rmin2 = 4.8*cm; //Minimum radius +Dz marinellis1i_Rmax2 = 4.9*cm; //Maximum radius +Dz marinellis1i_sizeZ = 10.15*cm; //Total z-length } //marinellis2l_tubs (smarinelli sample) G4double marinellis2l_Rmax; G4double marinellis2l_sizeZ; if (smarinelli_geom){ marinellis2l_Rmax = 4.8*cm; //Maximum radius marinellis2l_sizeZ = 0.15*cm; //Total z-length } //marinellis3l_tubs (smarinelli sample) G4double marinellis3l_Rmax = 7.9*cm; //Maximum radius G4double marinellis3l_sizeZ = 0.1*cm; //Total z-length // sample inside GAMA small Marinelli G4double smarinelli_height = 0.*cm; //Cublock_box (vsmarinelli sample) if (vsmarinelli_geom){ Cublock_sizeX = 16.0*cm; //Total x-length Cublock_sizeY = 16.0*cm; //Total y-length Cublock_sizeZ = 7.2*cm; //Total z-length } //drhole_tubs (vsmarinelli sample) if (vsmarinelli_geom){ drhole_Rmax = 5.0*cm; //Maximum radius drhole_sizeZ = 7.2*cm; //Total z-length } //marinellivs1l_tubs (vsmarinelli sample) G4double marinellivs1l_Rmin = 5.3*cm; //Minimum radius G4double marinellivs1l_Rmax = 6.35*cm; //Maximum radius G4double marinellivs1l_sizeZ = 0.2*cm; //Total z-length //marinellivs1o_cons (vsmarinelli sample) G4double marinellivs1o_Rmin1 = 6.175*cm; //Minimum radius -Dz G4double marinellivs1o_Rmax1 = 6.35*cm; //Maximum radius -Dz G4double marinellivs1o_Rmin2 = 6.45*cm; //Minimum radius +Dz G4double marinellivs1o_Rmax2 = 6.625*cm; //Maximum radius +Dz G4double marinellivs1o_sizeZ = 8.5*cm; //Total z-length //marinellivs2o_cons (vsmarinelli sample) G4double marinellivs2o_Rmin1 = 6.625*cm; //Minimum radius -Dz G4double marinellivs2o_Rmax1 = 6.78*cm; //Maximum radius -Dz G4double marinellivs2o_Rmin2 = 6.705*cm; //Minimum radius +Dz G4double marinellivs2o_Rmax2 = 6.86*cm; //Maximum radius +Dz G4double marinellivs2o_sizeZ = 4.0*cm; //Total z-length //marinellivs1i_cons (vsmarinelli sample) G4double marinellivs1i_Rmin1 = 5.3*cm; //Minimum radius -Dz G4double marinellivs1i_Rmax1 = 5.45*cm; //Maximum radius -Dz G4double marinellivs1i_Rmin2 = 5.2*cm; //Minimum radius +Dz G4double marinellivs1i_Rmax2 = 5.35*cm; //Maximum radius +Dz G4double marinellivs1i_sizeZ = 8.78*cm; //Total z-length //marinellivs2l_tubs (vsmarinelli sample) G4double marinellivs2l_Rmax = 5.2*cm; //Maximum radius G4double marinellivs2l_sizeZ = 0.15*cm; //Total z-length //mmarinellivs3l_tubs (vsmarinelli sample) G4double marinellivs3l_Rmax = 6.9*cm; //Maximum radius G4double marinellivs3l_sizeZ = 0.15*cm; //Total z-length // sample inside GAMA v small Marinelli G4double vsmarinelli_height = 0.*cm; //Cublock_box (box sample) if (box_geom){ Cublock_sizeX = 16.0*cm; //Total x-length Cublock_sizeY = 16.0*cm; //Total y-length Cublock_sizeZ = 20.85*cm; //Total z-length } //drhole_tubs (box sample) if (box_geom){ drhole_Rmax = 5.0*cm; //Maximum radius drhole_sizeZ = 20.85*cm; //Total z-length } // cudisks_tubs (box sample) G4double cudisks_Rmax; G4double cudisks_sizeZ; if (box_geom){ cudisks_Rmax = 5.0*cm; //Maximum radius cudisks_sizeZ = 5.0*cm; //Total z-length } //PE bag (box sample) G4double box_thickness=2.*cm; //bagbox_shape (box sample) G4double bagbox_sizeX = 2.*cm; // Total x-length G4double bagbox_sizeY = 2.*cm; // Total y-length G4double bagbox_sizeZ = 0.015*cm; // Total z-length //sample_shape (box sample) G4double samplebox_sizeX = 2.*cm; // Total x-length G4double samplebox_sizeY = 2.*cm; // Total y-length G4double samplebox_sizeZ = 2.*cm; // Total z-length //Cublock_box (tube sample) if (tube_geom){ Cublock_sizeX = 16.0*cm; //Total x-length Cublock_sizeY = 16.0*cm; //Total y-length Cublock_sizeZ = 20.85*cm; //Total z-length } //drhole_tubs (tube sample) if (tube_geom){ drhole_Rmax = 5.0*cm; //Maximum radius drhole_sizeZ = 20.85*cm; //Total z-length } // cudisks_tubs (tube sample) if (tube_geom){ cudisks_Rmax = 5.0*cm; //Maximum radius cudisks_sizeZ = 5.0*cm; //Total z-length } //bagtube_shape (tube sample) G4double bagtube_Rmin = 0.*cm; //Minimum radius G4double bagtube_Rmax = 7.0*cm; //Maximum radius G4double bagtube_sizeZ = 0.015*cm; //Total z-length G4double bagtube_fimax = twopi; //Maximum angle //sampletube_shape (tube sample) G4double sampletube_Rmin = 0.*cm; //Minimum radius G4double sampletube_Rmax = 7.0*cm; //Maximum radius G4double sampletube_sizeZ = 3.8*cm; //Total z-length G4double sampletube_fimax = twopi; //Maximum angle //detplasticcap_tubs (twobox sample) G4double detplasticcap_Rmax; G4double detplasticcap_sizeZ; if (twobox_geom){ detplasticcap_Rmax = 3.81*cm; //Maximum radius detplasticcap_sizeZ = 0.1*cm; //Total z-length } //detplasticcap1_tubs (twobox sample) G4double detplasticcap1_Rmax; G4double detplasticcap1_sizeZ; if (twobox_geom){ detplasticcap1_Rmax = 3.81*cm; //Maximum radius detplasticcap1_sizeZ = 0.15*cm; //Total z-length } //detplasticshell_tubs (twobox sample) G4double detplasticshell_Rmin; //Minimum radius G4double detplasticshell_Rmax; //Maximum radius G4double detplasticshell_sizeZ; //Total z-length G4double spheretwobox_rad; // (twobox) if (twobox_geom){ detplasticshell_Rmin = 3.65*cm; //Minimum radius detplasticshell_Rmax = 3.81*cm; //Maximum radius detplasticshell_sizeZ = 2.8*cm; //Total z-length spheretwobox_rad=0.00001*cm; } //detplasticcap_tubs (liquid sample) if (liquid_geom){ detplasticcap_Rmax = 3.81*cm; //Maximum radius detplasticcap_sizeZ = 0.1*cm; //Total z-length } //detplasticcap1_tubs (liquid sample) if (liquid_geom){ detplasticcap1_Rmax = 3.81*cm; //Maximum radius detplasticcap1_sizeZ = 0.15*cm; //Total z-length } //detplasticshell_tubs (liquid sample) if (liquid_geom){ detplasticshell_Rmin = 3.65*cm; //Minimum radius detplasticshell_Rmax = 3.81*cm; //Maximum radius detplasticshell_sizeZ = 2.8*cm; //Total z-length } //sampleliquid_body (liquid sample) G4double sampleliquid_Rmin = 0.*cm; //Minimum radius G4double sampleliquid_Rmax = 7.0*cm; //Maximum radius G4double sampleliquid_sizeZ = 3.8*cm; //Total z-length G4double sampleliquid_fimax = twopi; //Maximum angle G4double boxliquid_height=2.*cm; //Cublock_box (nocuinser sample) if (nocuinsert_geom){ Cublock_sizeX = 16.0*cm; //Total x-length Cublock_sizeY = 16.0*cm; //Total y-length Cublock_sizeZ = 7.17*cm; //Total z-length } //drhole_tubs (cocuinser sample) if (nocuinsert_geom){ drhole_Rmax = 5.0*cm; //Maximum radius drhole_sizeZ = 7.17*cm; //Total z-length } //truncside_cons (nocuinsert sample) G4double truncside_Rmin1 = 4.91*cm; //Minimum radius -Dz G4double truncside_Rmax1 = 5.01*cm; //Maximum radius -Dz G4double truncside_Rmin2 = 4.8*cm; //Minimum radius +Dz G4double truncside_Rmax2 = 4.9*cm; //Maximum radius +Dz G4double truncside_sizeZ = 7.5*cm; //Total z-length //trunctop_tubs (nocuinsert sample) G4double trunctop_Rmax = 4.8*cm; //Maximum radius G4double trunctop_sizeZ = 0.15*cm; //Total z-length //samplenocuinsert_shape (nocuinsert sample) G4double samplenocuinsert_sizeZ = 4.0*cm; //Total z-length pDz G4double samplenocuinsert_sizeYBasemin = 8.0*cm; //Total Y length of the base at -pDz G4double samplenocuinsert_sizeYBasemax = 7.0*cm; //Total Y length of the base at -+pDz G4double samplenocuinsert_sizeXSmallYmin = 11.0*cm; //Total X length at smaller Y of the base at -pDz G4double samplenocuinsert_sizeXBigYmin = 5.5*cm; //Total X length at bigger Y of the base at -pDz G4double samplenocuinsert_sizeXSmallYmax = 4.8125*cm; //Total X length at smaller Y of the base at +pDz G4double samplenocuinsert_sizeXBigYmax = 7.5625*cm; //Total X length at bigger Y of the base at +pDz //Cublock_box (marinelli sample) if (marinelli_geom){ Cublock_sizeX = 16.0*cm; //Total x-length Cublock_sizeY = 16.0*cm; //Total y-length Cublock_sizeZ = 7.2*cm; //Total z-length } //drhole_tubs (marinelli sample) if (marinelli_geom){ drhole_Rmax = 5.0*cm; //Maximum radius drhole_sizeZ = 7.2*cm; //Total z-length } //top_box (marinelli sample) G4double topbox_sizeX = 13.8*cm; // Total x-length G4double topbox_sizeY = 13.8*cm; // Total y-length G4double topbox_sizeZ = 0.5*cm; // Total z-length //side1_box (marinelli sample) G4double side1_sizeX = 14.8*cm; // Total x-length G4double side1_sizeY = 0.5*cm; // Total y-length G4double side1_sizeZ = 13.5*cm; // Total z-length //side2_box (marinelli sample) G4double side2_sizeX = 0.5*cm; // Total x-length G4double side2_sizeY = 13.8*cm; // Total y-length G4double side2_sizeZ = 13.5*cm; // Total z-length //bottom_body (marinelli sample) G4double bottombody_sizeX = 13.8*cm; // Total x-length G4double bottombody_sizeY = 13.8*cm; // Total y-length G4double bottombody_sizeZ = 0.5*cm; // Total z-length //bottom_hole (marinelli sample) G4double bottomhole_Rmax = 4.9*cm; //Maximum radius G4double bottomhole_sizeZ = 0.5*cm; //Total z-length G4double bottomhole_fimax = twopi; //Maximum angle //inner_cyl (marinelli sample) G4double innercyl_Rmin = 4.9*cm; //Minimum radius G4double innercyl_Rmax = 5.1*cm; //Maximum radius G4double innercyl_sizeZ = 8.5*cm; //Total z-length G4double innercyl_fimax = twopi; //Maximum angle //inner_top (marinelli sample) G4double innertop_Rmax = 5.1*cm; //Maximum radius G4double innertop_sizeZ = 0.2*cm; //Total z-length G4double innertop_fimax = twopi; //Maximum angle //samplemarinelli_body (marinelli sample) G4double samplemarinellibody_sizeX = 13.8*cm; // Total x-length G4double samplemarinellibody_sizeY = 13.8*cm; // Total y-length G4double samplemarinellibody_sizeZ = 12.5*cm; // Total z-length //samplemarinelli_hole (marinelli sample) G4double samplemarinellihole_Rmax = 5.1*cm; //Maximum radius G4double samplemarinellihole_sizeZ = 8.7*cm; //Total z-length G4double samplemarinellihole_fimax = twopi; //Maximum angle //Cublock_box (smarinellispecial sample) if (smarinellispecial_geom){ Cublock_sizeX = 16.0*cm; //Total x-length Cublock_sizeY = 16.0*cm; //Total y-length Cublock_sizeZ = 7.2*cm; //Total z-length } //drhole_tubs (smarinellispecial sample) G4double drhole_Rmin; if (smarinellispecial_geom){ drhole_Rmin = 4.95*cm; //Minimum radius drhole_Rmax = 7.35*cm; //Maximum radius drhole_sizeZ = 0.1*cm; //Total z-length } //marinellis1l_tubs (smarinellispecial sample) if (smarinellispecial_geom){ marinellis1l_Rmin = 4.95*cm; //Minimum radius marinellis1l_Rmax = 7.35*cm; //Maximum radius marinellis1l_sizeZ = 0.2*cm; //Total z-length } //marinellis1i_cons (smarinellispecial sample) if (smarinellispecial_geom){ marinellis1i_Rmin1 = 4.95*cm; //Minimum radius -Dz marinellis1i_Rmax1 = 5.05*cm; //Maximum radius -Dz marinellis1i_Rmin2 = 4.8*cm; //Minimum radius +Dz marinellis1i_Rmax2 = 4.9*cm; //Maximum radius +Dz marinellis1i_sizeZ = 10.15*cm; //Total z-length } //marinellis2l_tubs (smarinellispecial sample) if (smarinellispecial_geom){ marinellis2l_Rmax = 4.8*cm; //Maximum radius marinellis2l_sizeZ = 0.15*cm; //Total z-length } //sample_shape_washers_tubs (smarinellispecial sample) G4double sampleshapewashers_Rmin = 1.264*cm; //Minimum radius G4double sampleshapewashers_Rmax = 2.4765*cm; //Maximum radius G4double sampleshapewashers_sizeZ = 1.865*cm; //Total z-length //sample_shape_nuts_tubs (smarinellispecial sample) G4double sampleshapenuts_Rmin = 1.325*cm; //Minimum radius G4double sampleshapenuts_Rmax = 2.3544*cm; //Maximum radius G4double sampleshapenuts_sizeZ = 2.305*cm; //Total z-length //sample_shape_boltsb_tubs (smarinellispecial sample) G4double sampleshapeboltsb_Rmax = 1.8688*cm; //Maximum radius G4double sampleshapeboltsb_sizeZ = 1.49*cm; //Total z-length //sample_shape_boltsbt_tubs (smarinellispecial sample) G4double sampleshapeboltsbt_Rmax = 1.025*cm; //Maximum radius G4double sampleshapeboltsbt_sizeZ = 6.04*cm; //Total z-length //sample_shape_boltss_tubs (smarinellispecial sample) G4double sampleshapeboltss_Rmax = 1.238135*cm; //Maximum radius G4double sampleshapeboltss_sizeZ = 1.023*cm; //Total z-length //sample_shape_boltsst1 (smarinellispecial sample) G4double sampleshapeboltsst1_Rmax = 0.695*cm; //Maximum radius G4double sampleshapeboltsst1_sizeZ = 8.96*cm; //Total z-length //Cublock_box (custom sample) if (custom_geom){ Cublock_sizeX = 16.0*cm; //Total x-length Cublock_sizeY = 16.0*cm; //Total y-length Cublock_sizeZ = 20.85*cm; //Total z-length } //drhole_tubs (custom sample) if (custom_geom){ drhole_Rmax = 5.0*cm; //Maximum radius drhole_sizeZ = 20.85*cm; //Total z-length } //detplasticbottom_tubs (custom sample) G4double detplasticbottom_Rmax; G4double detplasticbottom_sizeZ; if (custom_geom){ detplasticbottom_Rmax = 2.5*cm; //Maximum radius detplasticbottom_sizeZ = 0.015*cm; //Total z-length } //detplasticshell_tubs (custom sample) if (custom_geom){ detplasticshell_Rmin = 2.5*cm; //Minimum radius detplasticshell_Rmax = 5.015*cm; //Maximum radius detplasticshell_sizeZ = 1.5*cm; //Total z-length } //detplasticring_tubs (custom sample) G4double detplasticring_Rmax = 4.5*cm; //Maximum radius G4double detplasticring_sizeZ = 0.1*cm; //Total z-length //detplasticshell02_tubs (custom_sample) G4double detplasticshell02_Rmin = 4.4*cm; //Minimum radius G4double detplasticshell02_Rmax = 4.5*cm; //Maximum radius G4double detplasticshell02_sizeZ = 1.*cm; //Total z-length //sample_holder_tubs (custom_sample) G4double sampleholder_Rmin; G4double sampleholder_Rmax; G4double sampleholder_sizeZ; if (custom_geom){ sampleholder_Rmin = 4.75*cm; //Minimum radius sampleholder_Rmax = 5.*cm; //Maximum radius sampleholder_sizeZ = 5.66*cm; //Total z-length } //sample_holder_ring_tubs (custom_sample) G4double sampleholderring_Rmin; G4double sampleholderring_Rmax; G4double sampleholderring_sizeZ; if (custom_geom){ sampleholderring_Rmin = 4.45*cm; //Minimum radius sampleholderring_Rmax = 4.75*cm; //Maximum radius sampleholderring_sizeZ = 0.28*cm; //Total z-length } // cudisks_tubs (custom sample) if (custom_geom){ cudisks_Rmax = 4.75*cm; //Maximum radius cudisks_sizeZ = 2.*2.83*cm-0.28*cm-1.1*cm; //Total z-length } //Cublock_box (custom no cuinsert sample) if (customnocuinsert_geom){ Cublock_sizeX = 16.0*cm; //Total x-length Cublock_sizeY = 16.0*cm; //Total y-length Cublock_sizeZ = 7.2*cm; //Total z-length } //drhole_tubs (custom no cuinsert sample) if (customnocuinsert_geom){ drhole_Rmax = 5.0*cm; //Maximum radius drhole_sizeZ = 7.2*cm; //Total z-length } //marinellis1i_cons (custom no cuinsert sample) if (customnocuinsert_geom){ marinellis1i_Rmin1 = 4.95*cm; //Minimum radius -Dz marinellis1i_Rmax1 = 5.05*cm; //Maximum radius -Dz marinellis1i_Rmin2 = 4.8*cm; //Minimum radius +Dz marinellis1i_Rmax2 = 4.9*cm; //Maximum radius +Dz marinellis1i_sizeZ = 7.4*cm; //Total z-length } //marinellis2l_tubs (custom no cuinsert sample) if (customnocuinsert_geom){ marinellis2l_Rmax = 4.8*cm; //Maximum radius marinellis2l_sizeZ = 0.15*cm; //Total z-length } //temp1_box (custom no cuinsert sample) G4double temp1_sizeX = 12.835*cm; //Total x-length G4double temp1_sizeY = 8.03*cm; //Total y-length G4double temp1_sizeZ = 9.989*cm; //Total z-length //drhole_tubs (custom no cuinsert sample) G4double temp2_Rmax = 1.45*cm; //Maximum radius G4double temp2_sizeZ = 10.*cm; //Total z-length //Cublock_box (drill cores ERMES sample) if (drillcoresERMES_geom){ Cublock_sizeX = 16.0*cm; //Total x-length Cublock_sizeY = 16.0*cm; //Total y-length Cublock_sizeZ = 20.85*cm; //Total z-length } //drhole_tubs (drill cores ERMES sample) if (drillcoresERMES_geom){ drhole_Rmax = 5.0*cm; //Maximum radius drhole_sizeZ = 20.85*cm; //Total z-length } //sample_holder_tubs (drill cores ERMES sample) if (drillcoresERMES_geom){ sampleholder_Rmin = 4.75*cm; //Minimum radius sampleholder_Rmax = 5.*cm; //Maximum radius sampleholder_sizeZ = 5.66*cm; //Total z-length } //sample_holder_ring_tubs (drill cores ERMES sample) if (drillcoresERMES_geom){ sampleholderring_Rmin = 4.45*cm; //Minimum radius sampleholderring_Rmax = 4.75*cm; //Maximum radius sampleholderring_sizeZ = 0.28*cm; //Total z-length } //detplasticbottom_tubs (drill cores ERMES sample) if (drillcoresERMES_geom){ detplasticbottom_Rmax = 3.6*cm; //Maximum radius detplasticbottom_sizeZ = 0.1*cm; //Total z-length } //detplasticshell_tubs (drill cores ERMES sample) if (drillcoresERMES_geom){ detplasticshell_Rmin = 3.6*cm; //Minimum radius detplasticshell_Rmax = 7.8*cm; //Maximum radius detplasticshell_sizeZ = 7.6*cm; //Total z-length } //sampleshape_tubs (drill cores ERMES sample) G4double sampleshape_Rmin; G4double sampleshape_Rmax; G4double sampleshape_sizeZ; G4double sampleshape_fimax; if (drillcoresERMES_geom){ sampleshape_Rmin = 0.*cm; // Total x-length sampleshape_Rmax = 7.*cm; // Total y-length sampleshape_sizeZ = 7.6*cm; // Total z-length sampleshape_fimax = twopi; //Maximum angle } //Cublock_box (drill cores ERMES a sample) if (drillcoresERMESa_geom){ Cublock_sizeX = 16.0*cm; //Total x-length Cublock_sizeY = 16.0*cm; //Total y-length Cublock_sizeZ = 20.85*cm; //Total z-length } //drhole_tubs (drill cores ERMES a sample) if (drillcoresERMESa_geom){ drhole_Rmax = 5.0*cm; //Maximum radius drhole_sizeZ = 20.85*cm; //Total z-length } //sampleshape_tubs (drill cores ERMES a sample) if (drillcoresERMESa_geom){ sampleshape_Rmin = 0.*cm; // Total x-length sampleshape_Rmax = 1.385*cm; // Total y-length sampleshape_sizeZ = 9.68*cm; // Total z-length sampleshape_fimax = twopi; //Maximum angle } //Cublock_box (drill cores ERMES b sample) if (drillcoresERMESb_geom){ Cublock_sizeX = 16.0*cm; //Total x-length Cublock_sizeY = 16.0*cm; //Total y-length Cublock_sizeZ = 20.85*cm; //Total z-length } //drhole_tubs (drill cores ERMES b sample) if (drillcoresERMESb_geom){ drhole_Rmax = 5.0*cm; //Maximum radius drhole_sizeZ = 20.85*cm; //Total z-length } //sample_holder_tubs (drill cores ERMES b sample) if (drillcoresERMESb_geom){ sampleholder_Rmin = 4.75*cm; //Minimum radius sampleholder_Rmax = 5.*cm; //Maximum radius sampleholder_sizeZ = 5.66*cm; //Total z-length } //sample_holder_ring_tubs (drill cores ERMES b sample) if (drillcoresERMESb_geom){ sampleholderring_Rmin = 4.45*cm; //Minimum radius sampleholderring_Rmax = 4.75*cm; //Maximum radius sampleholderring_sizeZ = 0.28*cm; //Total z-length } //detplasticbottom_tubs (drill cores ERMES b sample) if (drillcoresERMESb_geom){ detplasticbottom_Rmax = 3.6*cm; //Maximum radius detplasticbottom_sizeZ = 0.1*cm; //Total z-length } //detplasticshell_tubs (drill cores ERMES b sample) if (drillcoresERMESb_geom){ detplasticshell_Rmin = 3.5*cm; //Minimum radius detplasticshell_Rmax = 3.6*cm; //Maximum radius detplasticshell_sizeZ = 3.8*cm; //Total z-length } //detplasticbottomb_tubs (drill cores ERMES b sample) G4double detplasticbottomb_Rmax = 3.65*cm; //Maximum radius G4double detplasticbottomb_sizeZ = 0.1*cm; //Total z-length //detplasticshellb_tubs (drill cores ERMES b sample) G4double detplasticshellb_Rmin = 3.65*cm; //Minimum radius G4double detplasticshellb_Rmax = 3.75*cm; //Maximum radius G4double detplasticshellb_sizeZ = 3.2*cm; //Total z-length //sample_shape_drillcoresERMESb_tubs (drill cores ERMES b sample) G4double sampleshapedrillcoresERMESb_Rmax = 3.65*cm; //Maximum radius G4double sampleshapedrillcoresERMESb_sizeZ = 0.75*cm; //Total z-length G4double sampleshapedrillcoresERMESb_fimax = twopi; //Maximum angle //Cublock_box (sbox sample) if (sbox_geom){ Cublock_sizeX = 16.0*cm; //Total x-length Cublock_sizeY = 16.0*cm; //Total y-length Cublock_sizeZ = 20.85*cm; //Total z-length } //drhole_tubs (sbox sample) if (sbox_geom){ drhole_Rmax = 5.0*cm; //Maximum radius drhole_sizeZ = 20.85*cm; //Total z-length } //sample_holder_tubs (sbox sample) if (sbox_geom){ sampleholder_Rmin = 4.75*cm; //Minimum radius sampleholder_Rmax = 5.*cm; //Maximum radius sampleholder_sizeZ = 5.66*cm; //Total z-length } //sample_holder_ring_tubs (sbox sample) if (sbox_geom){ sampleholderring_Rmin = 4.45*cm; //Minimum radius sampleholderring_Rmax = 4.75*cm; //Maximum radius sampleholderring_sizeZ = 0.28*cm; //Total z-length } //supportring_tubs (sbox sample) G4double supportring_Rmin = 2.75*cm; //Minimum radius G4double supportring_Rmax = 4.75*cm; //Maximum radius G4double supportring_sizeZ = 0.2*cm; //Total z-length //detplasticbottom_tubs (sbox sample) if (sbox_geom){ detplasticbottom_Rmax = 3.6*cm; //Maximum radius detplasticbottom_sizeZ = 0.1*cm; //Total z-length } //detplasticcap_tubs (sbox sample) if (sbox_geom){ detplasticcap_Rmax = 3.8*cm; //Maximum radius detplasticcap_sizeZ = 0.1*cm; //Total z-length } //detplasticshell_tubs (sbox sample) if (sbox_geom){ detplasticshell_Rmin = 3.5*cm; //Minimum radius detplasticshell_Rmax = 3.6*cm; //Maximum radius detplasticshell_sizeZ = 7.6*cm; //Total z-length } //sample_shape_sbox_tubs (sbox sample) G4double sampleshapesbox_Rmin = 0.*cm; //Minimum radius G4double sampleshapesbox_Rmax = 3.5*cm; //Maximum radius G4double sampleshapesbox_sizeZ = 7.6*cm; //Total z-length G4double sampleshapesbox_fimax = twopi; //Maximum angle // Detect interactive mode (if no arguments) and define UI session // G4UIExecutive* ui = 0; if ( argc == 1 ) { ui = new G4UIExecutive(argc, argv); } // Optionally: choose a different Random engine... // G4Random::setTheEngine(new CLHEP::MTwistEngine); // Construct the default run manager // //auto* runManager = G4RunManagerFactory::CreateRunManager(G4RunManagerType::Default); #ifdef G4MULTITHREADED G4MTRunManager* runManager = new G4MTRunManager; #else G4RunManager* runManager = new G4RunManager; #endif G4ScoringManager* scoringManager = G4ScoringManager::GetScoringManager(); // Set mandatory initialization classes // // Detector construction runManager->SetUserInitialization(new B1DetectorConstruction(WorldMat, world_sizeX, world_sizeY, world_sizeZ, leadshield_sizeX, leadshield_sizeY, leadshield_sizeZ, coppershield_sizeX, coppershield_sizeY, coppershield_sizeZ, Nfilledchamber_sizeX, Nfilledchamber_sizeY, Nfilledchamber_sizeZ, Ndetwindow_Rmax, Ndetwindow_sizeZ, dethousing_Rmin, dethousing_Rmax, dethousing_sizeZ, detvacuum_Rmax, detvacuum_sizeZ, dethousingclad_Rmin, dethousingclad_Rmax, dethousingclad_sizeZ, detinnercap_Rmin, detinnercap_Rmax, detinnercap_sizeZ, detinnercapbottom_Rmin, detinnercapbottom_Rmax, detinnercapbottom_sizeZ, detinnercapring_Rmin, detinnercapring_Rmax, detinnercapring_sizeZ, detinnercaptop_Rmax, detinnercaptop_sizeZ, detinnercapplate_Rmax, detinnercapplate_sizeZ, detpecap_Rmin, detpecap_Rmax, detpecap_sizeZ, detpecaptop_Rmin, detpecaptop_Rmax, detpecaptop_sizeZ, detdeadlayer_Rmax, detdeadlayer_sizeZ, crystal_l, d_dead, crystal_Rmax, crystal_sizeZ, hole_d, hole_l, detholeincrystal_Rmax, detholeincrystal_sizeZ, y, detdeadcone_Rmin1, detdeadcone_Rmax1, detdeadcone_Rmin2, detdeadcone_Rmax2, detdeadcone_sizeZ, smarinelli_geom, Cublock_sizeX, Cublock_sizeY, Cublock_sizeZ, drhole_Rmax, drhole_sizeZ, marinellis1l_Rmin, marinellis1l_Rmax, marinellis1l_sizeZ, marinellis1o_Rmin, marinellis1o_Rmax, marinellis1o_sizeZ, marinellis2o_Rmin1, marinellis2o_Rmax1, marinellis2o_Rmin2, marinellis2o_Rmax2, marinellis2o_sizeZ, marinellis1i_Rmin1, marinellis1i_Rmax1, marinellis1i_Rmin2, marinellis1i_Rmax2, marinellis1i_sizeZ, marinellis2l_Rmax, marinellis2l_sizeZ, marinellis3l_Rmax, marinellis3l_sizeZ, smarinelli_height, vsmarinelli_geom, marinellivs1l_Rmin, marinellivs1l_Rmax, marinellivs1l_sizeZ, marinellivs1o_Rmin1, marinellivs1o_Rmax1, marinellivs1o_Rmin2, marinellivs1o_Rmax2, marinellivs1o_sizeZ, marinellivs2o_Rmin1, marinellivs2o_Rmax1, marinellivs2o_Rmin2, marinellivs2o_Rmax2, marinellivs2o_sizeZ, marinellivs1i_Rmin1, marinellivs1i_Rmax1, marinellivs1i_Rmin2, marinellivs1i_Rmax2, marinellivs1i_sizeZ, marinellivs2l_Rmax, marinellivs2l_sizeZ, marinellivs3l_Rmax, marinellivs3l_sizeZ, vsmarinelli_height, box_geom, cudisks_Rmax, cudisks_sizeZ, bagbox_sizeX, bagbox_sizeY, bagbox_sizeZ, samplebox_sizeX, samplebox_sizeY, samplebox_sizeZ, box_thickness, tube_geom, bagtube_Rmin, bagtube_Rmax, bagtube_sizeZ, bagtube_fimax, sampletube_Rmin, sampletube_Rmax, sampletube_sizeZ, sampletube_fimax, twobox_geom, detplasticcap_Rmax, detplasticcap_sizeZ, detplasticcap1_Rmax, detplasticcap1_sizeZ, detplasticshell_Rmin, detplasticshell_Rmax, detplasticshell_sizeZ, spheretwobox_rad, liquid_geom, sampleliquid_Rmin, sampleliquid_Rmax, sampleliquid_sizeZ, sampleliquid_fimax, boxliquid_height, nocuinsert_geom, truncside_Rmin1, truncside_Rmax1, truncside_Rmin2, truncside_Rmax2, truncside_sizeZ, trunctop_Rmax, trunctop_sizeZ, samplenocuinsert_sizeZ, samplenocuinsert_sizeYBasemin, samplenocuinsert_sizeYBasemax, samplenocuinsert_sizeXSmallYmin, samplenocuinsert_sizeXBigYmin, samplenocuinsert_sizeXSmallYmax, samplenocuinsert_sizeXBigYmax, marinelli_geom, topbox_sizeX, topbox_sizeY, topbox_sizeZ, side1_sizeX, side1_sizeY, side1_sizeZ, side2_sizeX, side2_sizeY, side2_sizeZ, bottombody_sizeX, bottombody_sizeY, bottombody_sizeZ, bottomhole_Rmax, bottomhole_sizeZ, bottomhole_fimax, innercyl_Rmin, innercyl_Rmax, innercyl_sizeZ, innercyl_fimax, innertop_Rmax, innertop_sizeZ, innertop_fimax, samplemarinellibody_sizeX, samplemarinellibody_sizeY, samplemarinellibody_sizeZ, samplemarinellihole_Rmax, samplemarinellihole_sizeZ, samplemarinellihole_fimax, smarinellispecial_geom, drhole_Rmin, sampleshapewashers_Rmin, sampleshapewashers_Rmax, sampleshapewashers_sizeZ, sampleshapenuts_Rmin, sampleshapenuts_Rmax, sampleshapenuts_sizeZ, sampleshapeboltsb_Rmax, sampleshapeboltsb_sizeZ, sampleshapeboltsbt_Rmax, sampleshapeboltsbt_sizeZ, sampleshapeboltss_Rmax, sampleshapeboltss_sizeZ, sampleshapeboltsst1_Rmax, sampleshapeboltsst1_sizeZ, custom_geom, detplasticbottom_Rmax, detplasticbottom_sizeZ, detplasticring_Rmax, detplasticring_sizeZ, detplasticshell02_Rmin, detplasticshell02_Rmax, detplasticshell02_sizeZ, sampleholder_Rmin, sampleholder_Rmax, sampleholder_sizeZ, sampleholderring_Rmin, sampleholderring_Rmax, sampleholderring_sizeZ, customnocuinsert_geom, temp1_sizeX, temp1_sizeY, temp1_sizeZ, temp2_Rmax, temp2_sizeZ, drillcoresERMES_geom, sampleshape_Rmin, sampleshape_Rmax, sampleshape_sizeZ, sampleshape_fimax, drillcoresERMESa_geom, drillcoresERMESb_geom, detplasticbottomb_Rmax, detplasticbottomb_sizeZ, detplasticshellb_Rmin, detplasticshellb_Rmax, detplasticshellb_sizeZ, sampleshapedrillcoresERMESb_Rmax, sampleshapedrillcoresERMESb_sizeZ, sampleshapedrillcoresERMESb_fimax, sbox_geom, supportring_Rmin, supportring_Rmax, supportring_sizeZ, sampleshapesbox_Rmin, sampleshapesbox_Rmax, sampleshapesbox_sizeZ, sampleshapesbox_fimax, customnocuinsertbottle_geom, customnocuinsertnormal_geom, GeMi, GeBaradello, GePaolo, outercoppershield_sizeX, outercoppershield_sizeY, outercoppershield_sizeZ, Nfilledchamber_Zplace, Ndetwindow_Zplace, dethousing_Zplace, detvacuum_Zplace, detinnercap_Zshift, detinnercapbottom_Zshift, detinnercaptop_Zshift, detinnercapplate_Zshift, detdeadlayer_Zshift)); // Physics list G4VModularPhysicsList* physicsList = new QBBC; physicsList->SetVerboseLevel(1); // runManager->SetUserInitialization(physicsList); runManager->SetUserInitialization(new gem90PhysicsList); // User action initialization runManager->SetUserInitialization(new B1ActionInitialization(GetKinematicsFlag)); // Instantiate all primary generator actions classes auto b1PrimaryGeneratorAction = new B1PrimaryGeneratorAction(); // Initialize visualization // G4VisManager* visManager = new G4VisExecutive; // G4VisExecutive can take a verbosity argument - see /vis/verbose guidance. // G4VisManager* visManager = new G4VisExecutive("Quiet"); visManager->Initialize(); // Get the pointer to the User Interface manager G4UImanager* UImanager = G4UImanager::GetUIpointer(); // Process macro or start UI session // if ( ! ui ) { // batch mode G4String command = "/control/execute "; G4String fileName = argv[1]; UImanager->ApplyCommand(command+fileName); } else { // interactive mode UImanager->ApplyCommand("/control/execute init_vis.mac"); ui->SessionStart(); delete ui; } // Job termination // Free the store: user actions, physics_list and detector_description are // owned and deleted by the run manager, so they should not be deleted // in the main() program ! //Write simulation information at the end of the simulation OutputFilename = "SolidStateDetectorSimulation"; if(smarinelli_geom) OutputFilename.append("_SmarinelliSample"); else if(vsmarinelli_geom) OutputFilename.append("_VSmarinelliSample"); else if(box_geom) OutputFilename.append("_BoxSample"); else if(tube_geom) OutputFilename.append("_TubeSample"); else if(twobox_geom) OutputFilename.append("_TwoBoxSample"); else if(liquid_geom) OutputFilename.append("_LiquidSample"); else if(nocuinsert_geom) OutputFilename.append("_NocuinsertSample"); else if(marinelli_geom) OutputFilename.append("_MarinelliSample"); else if(smarinellispecial_geom) OutputFilename.append("_SmarinelliSpecialSample"); else if(custom_geom) OutputFilename.append("_CustomSample"); else if(customnocuinsert_geom) OutputFilename.append("_CustomnocuinsertSample"); else if(drillcoresERMES_geom) OutputFilename.append("_DrillcoresERMESSample"); else if(drillcoresERMESa_geom) OutputFilename.append("_DrillcoresERMESaSample"); else if(drillcoresERMESb_geom) OutputFilename.append("_DrillcoresERMESbSample"); else if(sbox_geom) OutputFilename.append("_SboxSample"); if(customnocuinsertnormal_geom) OutputFilename.append("_Normal"); else if(customnocuinsertbottle_geom) OutputFilename.append("_Bottle"); if (GetKinematicsFlag) OutputFilename.append("_GotKinematics"); mymain->PrintSpectrum(); mymain->PrintEnd(); filestream.close(); auto analysisManager = G4AnalysisManager::Instance(); analysisManager->CloseFile(); delete visManager; delete runManager; } void MyMain::PrintHeader() { auto start = std::chrono::system_clock::now(); std::time_t start_time = std::chrono::system_clock::to_time_t(start); filestream <<"################################################"<< std::endl; filestream <<"# Welcome to Solid State Detector Simulation #"<< std::endl; filestream <<"# #"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"\n "<< std::endl; filestream <<"The simulation allows to study the deposited energy by a radioactive sample in a defined solid state detector \n"<< std::endl; filestream << "Start simulation on " << std::ctime(&start_time) << std::endl; } void MyMain::PrintDetectorGeometry() { filestream <<"\n \n"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"# Detector and sample #"<< std::endl; filestream <<"################################################"<< std::endl; if (GeMi){ filestream <<"The selected detector is GeMi. "<< std::endl; } else if (GeBaradello){ filestream <<"The selected detector is GeBaradello. "<< std::endl; } else if (GePaolo){ filestream <<"The selected detector is GePaolo. "<< std::endl; } if (smarinelli_geom){ filestream <<"The selected geometry is smarinelli. "<< std::endl; } else if (vsmarinelli_geom){ filestream <<"The selected geometry is vsmarinelli. "<< std::endl; } else if (box_geom){ filestream <<"The selected geometry is box. "<< std::endl; } else if (tube_geom){ filestream <<"The selected geometry is tube. "<< std::endl; } else if (twobox_geom){ filestream <<"The selected geometry is twobox. "<< std::endl; } else if (liquid_geom){ filestream <<"The selected geometry is liquid. "<< std::endl; } else if (nocuinsert_geom){ filestream <<"The selected geometry is nocuinsert. "<< std::endl; } else if (marinelli_geom){ filestream <<"The selected geometry is . "<< std::endl; } else if (smarinellispecial_geom){ filestream <<"The selected geometry is smarinelli special. "<< std::endl; } else if (customnocuinsert_geom){ if (customnocuinsertnormal_geom){ filestream <<"The selected geometry is customnocuinsert normal. "<< std::endl; } else if (customnocuinsertbottle_geom){ filestream <<"The selected geometry is customnocuinsert with bottle. "<< std::endl; } } else if (custom_geom){ filestream <<"The selected geometry is custom no cuinsert. "<< std::endl; } else if (drillcoresERMES_geom){ filestream <<"The selected geometry is drill cores ERMES. "<< std::endl; } else if (drillcoresERMESa_geom){ filestream <<"The selected geometry is drill cores ERMES a. "<< std::endl; } else if (drillcoresERMESb_geom){ filestream <<"The selected geometry is drill cores ERMES b. "<< std::endl; } else if (sbox_geom){ filestream <<"The selected geometry is sbox. "<< std::endl; } } void MyMain::PrintSpectrum() { auto analysisManager = G4AnalysisManager::Instance(); #ifdef G4MULTITHREADED static G4Mutex stuffMutex = G4MUTEX_INITIALIZER; G4AutoLock al(&stuffMutex); #endif G4int i=0; G4double h0bin; G4double h1bin; // save histograms & ntuple // G4int nbins = analysisManager->GetH1Nbins(0); G4H1* h0 = analysisManager->GetH1(0); G4H1* h1 = analysisManager->GetH1(1); static std::ofstream ResultsEff ("EnergySpectrumResults.txt", std::ofstream::out | std::ofstream::app); for (i=0;i<=nbins;i++) { h0bin = h0->bin_height(i); h1bin = h1->bin_height(i); // G4cout<< i << " " << h0bin << " " << h1bin << G4endl; ResultsEff << i << " " << h0bin << " " << h1bin << G4endl; } ResultsEff.close(); } void MyMain::PrintEnd() { filestream <<"\n \n"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"# ROOT File info #"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"I stored the deposited energy in the crystal in the Ntupla called DepositedEnergyNtupla. Unit is keV. "<< std::endl; if (GetKinematicsFlag){ filestream <<"I stored the kinematics of particles entering the crystal in the Ntupla called EnterParticlesNtupla. Units are keV, cm, rad."<< std::endl; } filestream <<"\n \n"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"# Deposited energy storage #"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"I printed the binned deposited energy in the crystal and the and primary gammas energy histograms in the B1.ascii file. First culomn is the bin number, second culomn is the mean of the bin, third culomn is the counts number. Unit is keV. "<< std::endl; filestream <<"I stored the NO binned deposited energy in the crystal in the DepositedEnergyData.txt file. Unit is keV. "<< std::endl; filestream <<"I stored the binned deposited energy in the crystal and the number of primary gammas energy in the EnergySpectrumResults.txt file. First culomn is the bin number, second culomn is the counts of deposited energy, third the counts of primary gammas energy. Unit is keV. "<< std::endl; filestream <<"\n \n"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"# End of simulation #"<< std::endl; filestream <<"################################################"<< std::endl; filestream <<"The simulation has been concluded. A ROOT file, an ascii file and two txt file have been created.\n"<< std::endl; filestream<<"To create proper ROOT file for this simulation: mv B1.root "<< OutputFilename<<".root \n"<