//! 2D full projective SPACAL double CEmc_2DProjectiveSpacal(PHG4Reco* g4Reco, double radius, const int crossings, const int absorberactive = 0) { double emc_inner_radius = 95.; // emc inner radius from engineering drawing double cemcthickness = 21.00000 - no_overlapp; double emc_outer_radius = emc_inner_radius + cemcthickness; // outer radius if (radius > emc_inner_radius) { cout << "inconsistency: preshower radius+thickness: " << radius << " larger than emc inner radius: " << emc_inner_radius << endl; gSystem->Exit(-1); } //--------------- // Load libraries //--------------- gSystem->Load("libg4detectors.so"); // the radii are only to determined the thickness of the cemc radius = emc_inner_radius; //--------------- // Load libraries //--------------- // 1.5cm thick teflon as an approximation for EMCAl light collection + electronics (10% X0 total estimated) PHG4CylinderSubsystem *cyl = new PHG4CylinderSubsystem("CEMC_ELECTRONICS", 0); cyl->set_double_param("radius",radius); cyl->set_string_param("material","G4_TEFLON"); cyl->set_double_param("thickness",1.5- no_overlapp); cyl->SuperDetector("CEMC_ELECTRONICS"); cyl->OverlapCheck(overlapcheck); if (absorberactive) cyl->SetActive(); g4Reco->registerSubsystem( cyl ); radius += 1.5; cemcthickness -= 1.5+no_overlapp; // 0.5cm thick Stainless Steel as an approximation for EMCAl support system cyl = new PHG4CylinderSubsystem("CEMC_SPT", 0); cyl->SuperDetector("CEMC_SPT"); cyl->set_double_param("radius",radius +cemcthickness - 0.5 ); cyl->set_string_param("material","SS310"); // SS310 Stainless Steel cyl->set_double_param("thickness",0.5 - no_overlapp); cyl->OverlapCheck(overlapcheck); if (absorberactive) cyl->SetActive(); g4Reco->registerSubsystem(cyl); cemcthickness -= 0.5+no_overlapp; //--------------- // Load libraries //--------------- int ilayer = Min_cemc_layer; PHG4SpacalSubsystem *cemc; cemc = new PHG4SpacalSubsystem("CEMC", ilayer); cemc->get_geom().set_config( PHG4CylinderGeom_Spacalv1::kFullProjective_2DTaper_SameLengthFiberPerTower); // load from hard code map for now. Need to move to calibration file or database. cemc->get_geom().load_demo_sector_tower_map3(); cemc->get_geom().set_radius(radius); cemc->get_geom().set_thickness(cemcthickness); cemc->get_geom().set_construction_verbose(1); cemc->SetActive(); cemc->SuperDetector("CEMC"); if (absorberactive) cemc->SetAbsorberActive(); cemc->OverlapCheck(overlapcheck); g4Reco->registerSubsystem(cemc); if (ilayer > Max_cemc_layer) { cout << "layer discrepancy, current layer " << ilayer << " max cemc layer: " << Max_cemc_layer << endl; } radius += cemcthickness; radius += no_overlapp; return radius; }
int G4Setup(const int absorberactive = 0, const string &field ="1.5", const EDecayType decayType = TPythia6Decayer::kAll, const bool do_svtx = true, const bool do_preshower = false, const bool do_cemc = true, const bool do_hcalin = true, const bool do_magnet = true, const bool do_hcalout = true, const bool do_pipe = true, const bool do_bbc = true, const bool do_FEMC = false, const bool do_FHCAL = false, const float magfield_rescale = 1.0) { //--------------- // Load libraries //--------------- gSystem->Load("libg4detectors.so"); gSystem->Load("libg4testbench.so"); //--------------- // Fun4All server //--------------- Fun4AllServer *se = Fun4AllServer::instance(); PHG4Reco* g4Reco = new PHG4Reco(); g4Reco->set_rapidity_coverage(1.1); // according to drawings if (decayType != TPythia6Decayer::kAll) { g4Reco->set_force_decay(decayType); } double fieldstrength; istringstream stringline(field); stringline >> fieldstrength; if (stringline.fail()) { // conversion to double fails -> we have a string if (field.find("sPHENIX.root") != string::npos) { g4Reco->set_field_map(field, 1); } else { g4Reco->set_field_map(field, 2); } } else { g4Reco->set_field(fieldstrength); // use const soleniodal field } g4Reco->set_field_rescale(magfield_rescale); double radius = 0.; //---------------------------------------- // PIPE if (do_pipe) radius = Pipe(g4Reco, radius, absorberactive); //---------------------------------------- // SVTX if (do_svtx) radius = Svtx(g4Reco, radius, absorberactive); //---------------------------------------- // PRESHOWER if (do_preshower) radius = PreShower(g4Reco, radius, absorberactive); //---------------------------------------- // CEMC // if (do_cemc) radius = CEmc(g4Reco, radius, 8, absorberactive); // if (do_cemc) radius = CEmc_Vis(g4Reco, radius, 8, absorberactive);// for visualization substructure of SPACAL, slow to render //---------------------------------------- // HCALIN if (do_hcalin) radius = HCalInner(g4Reco, radius, 4, absorberactive); //---------------------------------------- // MAGNET if (do_magnet) radius = Magnet(g4Reco, radius, 0, absorberactive); //---------------------------------------- // HCALOUT if (do_hcalout) radius = HCalOuter(g4Reco, radius, 4, absorberactive); //---------------------------------------- // FEMC if ( do_FEMC ) FEMCSetup(g4Reco, absorberactive); //---------------------------------------- // FHCAL if ( do_FHCAL ) FHCALSetup(g4Reco, absorberactive); // sPHENIX forward flux return(s) PHG4CylinderSubsystem *flux_return_plus = new PHG4CylinderSubsystem("FWDFLUXRET", 0); flux_return_plus->SetLength(10.2); flux_return_plus->SetPosition(0,0,335.9); flux_return_plus->SetRadius(5.0); flux_return_plus->SetLengthViaRapidityCoverage(false); flux_return_plus->SetThickness(263.5-5.0); flux_return_plus->SetMaterial("G4_Fe"); flux_return_plus->SetActive(false); flux_return_plus->SuperDetector("FLUXRET_ETA_PLUS"); flux_return_plus->OverlapCheck(overlapcheck); g4Reco->registerSubsystem(flux_return_plus); PHG4CylinderSubsystem *flux_return_minus = new PHG4CylinderSubsystem("FWDFLUXRET", 0); flux_return_minus->SetLength(10.2); flux_return_minus->SetPosition(0,0,-335.9); flux_return_minus->SetRadius(5.0); flux_return_minus->SetLengthViaRapidityCoverage(false); flux_return_minus->SetThickness(263.5-5.0); flux_return_minus->SetMaterial("G4_Fe"); flux_return_minus->SetActive(false); flux_return_minus->SuperDetector("FLUXRET_ETA_MINUS"); flux_return_minus->OverlapCheck(overlapcheck); g4Reco->registerSubsystem(flux_return_minus); //---------------------------------------- // BLACKHOLE // swallow all particles coming out of the backend of sPHENIX PHG4CylinderSubsystem *blackhole = new PHG4CylinderSubsystem("BH", 1); blackhole->SetRadius(radius + 10); // add 10 cm blackhole->SetLengthViaRapidityCoverage(false); blackhole->SetLength(g4Reco->GetWorldSizeZ() - no_overlapp); // make it cover the world in length blackhole->BlackHole(); blackhole->SetThickness(0.1); // it needs some thickness blackhole->SetActive(); // always see what leaks out blackhole->OverlapCheck(overlapcheck); g4Reco->registerSubsystem(blackhole); //---------------------------------------- // FORWARD BLACKHOLEs // +Z blackhole = new PHG4CylinderSubsystem("BH_FORWARD_PLUS", 1); blackhole->SuperDetector("BH_FORWARD_PLUS"); blackhole->SetRadius(0); // add 10 cm blackhole->SetLengthViaRapidityCoverage(false); blackhole->SetLength(0.1); // make it cover the world in length blackhole->SetPosition(0,0, g4Reco->GetWorldSizeZ()/2. - 0.1 - no_overlapp); blackhole->BlackHole(); blackhole->SetThickness(radius - no_overlapp); // it needs some thickness blackhole->SetActive(); // always see what leaks out blackhole->OverlapCheck(overlapcheck); g4Reco->registerSubsystem(blackhole); blackhole = new PHG4CylinderSubsystem("BH_FORWARD_NEG", 1); blackhole->SuperDetector("BH_FORWARD_NEG"); blackhole->SetRadius(0); // add 10 cm blackhole->SetLengthViaRapidityCoverage(false); blackhole->SetLength(0.1); // make it cover the world in length blackhole->SetPosition(0,0, - g4Reco->GetWorldSizeZ()/2. +0.1 + no_overlapp); blackhole->BlackHole(); blackhole->SetThickness(radius - no_overlapp); // it needs some thickness blackhole->SetActive(); // always see what leaks out blackhole->OverlapCheck(overlapcheck); g4Reco->registerSubsystem(blackhole); PHG4TruthSubsystem *truth = new PHG4TruthSubsystem(); g4Reco->registerSubsystem(truth); se->registerSubsystem( g4Reco ); }
//! Jin Huang <*****@*****.**> : Fully tuned for ePHENIX LOI setup void G4Setup(const int absorberactive = 0, const float field = -1.) { //--------------- // Load libraries //--------------- gSystem->Load("libg4detectors.so"); gSystem->Load("libg4testbench.so"); //--------------- // Fun4All server //--------------- Fun4AllServer *se = Fun4AllServer::instance(); PHG4Reco* g4Reco = new PHG4Reco(); g4Reco->set_rapidity_coverage(1.1); // temperary value assigned by ePHENIX LOI if (field < 0) { const char * map = "/direct/phenix+WWW/p/draft/jinhuang/sPHENIX/ePHENIX/BABAR_V11_GridOut_ePHENIX.SF7.root"; cout << "G4Setup - Using ePHENIX LOI field map "; cout << map; cout << endl; g4Reco->set_field_map(map, 2); } else { g4Reco->set_field(field); // use const soleniodal field } ///////////////////////////////////////////////// // Beam Pipe ///////////////////////////////////////////////// PHG4CylinderSubsystem *beamcyl; beamcyl = new PHG4CylinderSubsystem("BEAMPIPE", 1); beamcyl->SetRadius(2.0); beamcyl->SetThickness(0.1); beamcyl->SetLengthViaRapidityCoverage(false); beamcyl->SetLength(g4Reco->GetWorldSizeZ() - 10.); //g4Reco->GetWorldSizeZ()); // go through our entire world in z directions beamcyl->SetMaterial("G4_Be"); // beamcyl->SetPosition(0, 0, 250); // if (absorberactive) beamcyl->SetActive(); beamcyl->OverlapCheck(overlapcheck); g4Reco->registerSubsystem(beamcyl); ///////////////////////////////////////////////// // Central magnet and detectors ///////////////////////////////////////////////// PHG4CylinderSubsystem *cyl; double magnet_inner_radius = 140; double magnet_outer_radius = 173; double magnet_thickness = magnet_outer_radius - magnet_inner_radius; double emc_inner_radius = 95.; // emc inner radius from engineering spreadsheet double hcal_in_inner_radius = magnet_outer_radius + 15.; // inner hcal inner radius from engineering spreadsheet double hcal_out_inner_radius = hcal_in_inner_radius + 30.; // inner hcal inner radius from engineering spreadsheet double preshower_inner_radius = 90.; double tpc_inner_radius = 15.; double tpc_outer_radius = 80.; double tpc_thickness = tpc_outer_radius - tpc_inner_radius; int ilayer = -1; // just to declare this varialbe outside of detector setups double radius = tpc_inner_radius; radius = Tpc(g4Reco, radius, tpc_thickness, absorberactive); // radius = G4_DIRC(g4Reco); if (radius > emc_inner_radius - 4.) { cout << "inconsistency: " << radius << " larger than emc inner radius: " << emc_inner_radius - 4. << endl; gSystem->Exit(-1); } // inside CEmc now... //radius = emc_inner_radius - 4.; //cyl = new PHG4CylinderSubsystem("EMCELECTRONICS", 0); //cyl->SetRadius(radius); //cyl->SetMaterial("G4_TEFLON"); // plastic //cyl->SetThickness(0.5); //if (absorberactive) // cyl->SetActive(); //cyl->OverlapCheck(overlapcheck); //g4Reco->registerSubsystem(cyl); radius = emc_inner_radius; int ncross = 4; radius = CEmc(g4Reco, radius, ncross, absorberactive); double saveradius = radius + no_overlapp; // double al_radlen = 8.897; // radius = magnet_inner_radius + magnet_thickness/2. - al_radlen/2.; // magnet (1 radlen Al = 8.897cm - pdg) // located half way between inner and outer radius radius = magnet_inner_radius; cyl = new PHG4CylinderSubsystem("MAGNET", 0); cyl->SetRadius(radius); cyl->SetLengthViaRapidityCoverage(false); cyl->SetLength(385.0); cyl->SetMaterial("AL_BABAR_MAG"); // use 1 radiation length Al for magnet thickness cyl->SetThickness(magnet_thickness); cyl->OverlapCheck(overlapcheck); if (absorberactive) cyl->SetActive(); g4Reco->registerSubsystem(cyl); // radius = magnet_inner_radius + magnet_thickness; // outside of magnet // // radius += 10; // if (radius > hcal_in_inner_radius) // { // cout << "inconsistency: magnet radius+thickness: " << radius // << " larger than emc inner radius: " << hcal_in_inner_radius << endl; // gSystem->Exit(-1); // } // radius = hcal_in_inner_radius; // ncross = 3; // radius = HCal(g4Reco, radius, ncross, absorberactive); //radius += 60; cout <<"G4Setup - loading updated HCal setup"<<endl; ncross = 4; radius = HCal(g4Reco, saveradius, ncross, absorberactive); ///////////////////////////////////////////////// // Build hadron going detectors ///////////////////////////////////////////////// // tracker G4_FGEM_ePHENIX(g4Reco, N_forward_sector, Min_forward_eta); // RICH G4_RICH(g4Reco, N_forward_sector, Min_forward_eta_RICH); //AeroGel G4_AeroGel(g4Reco, N_forward_sector, Min_forward_eta); // ECal G4_FEmc(g4Reco); // 17cm thick Pb/Sci calorimeter = 20 X0 // HCal G4_FHCal(g4Reco); // ForwardHcal detector Geant4 module PHG4ConeSubsystem *bbc = new PHG4ConeSubsystem("BBC", 0); bbc->SetZlength(2); bbc->SetPlaceZ(325); bbc->Set_eta_range(4, 5); bbc->SetMaterial("G4_Pyrex_Glass"); bbc->SetActive(); bbc->SuperDetector("BBC"); bbc->OverlapCheck(overlapcheck); g4Reco->registerSubsystem(bbc); ///////////////////////////////////////////////// // electron going detectors ///////////////////////////////////////////////// G4_EEmc( g4Reco ); // 18cm thick PbWO4 crystal calorimeter G4_eGEM_ePHENIX(g4Reco); PHG4TruthSubsystem *truth = new PHG4TruthSubsystem(); g4Reco->registerSubsystem(truth); se->registerSubsystem(g4Reco); }
int G4Setup(const int absorberactive = 0, const string &field ="1.5", #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0) const EDecayType decayType = EDecayType::kAll, #else const EDecayType decayType = TPythia6Decayer::kAll, #endif const bool do_tracking = true, const bool do_pstof = true, const bool do_cemc = true, const bool do_hcalin = true, const bool do_magnet = true, const bool do_hcalout = true, const bool do_pipe = true, const bool do_plugdoor = false, // const bool do_plugdoor = true, const float magfield_rescale = 1.0) { //--------------- // Load libraries //--------------- gSystem->Load("libg4detectors.so"); gSystem->Load("libg4testbench.so"); //--------------- // Fun4All server //--------------- Fun4AllServer *se = Fun4AllServer::instance(); // read-in HepMC events to Geant4 if there is any HepMCNodeReader *hr = new HepMCNodeReader(); se->registerSubsystem(hr); PHG4Reco* g4Reco = new PHG4Reco(); g4Reco->set_rapidity_coverage(1.1); // according to drawings // uncomment to set QGSP_BERT_HP physics list for productions // (default is QGSP_BERT for speed) // g4Reco->SetPhysicsList("QGSP_BERT_HP"); #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0) if (decayType != EDecayType::kAll) #else if (decayType != TPythia6Decayer::kAll) #endif { g4Reco->set_force_decay(decayType); } double fieldstrength; istringstream stringline(field); stringline >> fieldstrength; if (stringline.fail()) { // conversion to double fails -> we have a string if (field.find("sPHENIX.root") != string::npos) { g4Reco->set_field_map(field, PHFieldConfig::Field3DCartesian); } else { g4Reco->set_field_map(field, PHFieldConfig::kField2D); } } else { g4Reco->set_field(fieldstrength); // use const soleniodal field } g4Reco->set_field_rescale(magfield_rescale); double radius = 0.; //---------------------------------------- // PIPE if (do_pipe) radius = Pipe(g4Reco, radius, absorberactive); //---------------------------------------- // TRACKING if (do_tracking) radius = Tracking(g4Reco, radius, absorberactive); //---------------------------------------- // PSTOF if (do_pstof) radius = PSTOF(g4Reco, radius, absorberactive); //---------------------------------------- // CEMC // if (do_cemc) radius = CEmc(g4Reco, radius, 8, absorberactive); // if (do_cemc) radius = CEmc_Vis(g4Reco, radius, 8, absorberactive);// for visualization substructure of SPACAL, slow to render //---------------------------------------- // HCALIN if (do_hcalin) radius = HCalInner(g4Reco, radius, 4, absorberactive); //---------------------------------------- // MAGNET if (do_magnet) radius = Magnet(g4Reco, radius, 0, absorberactive); //---------------------------------------- // HCALOUT if (do_hcalout) radius = HCalOuter(g4Reco, radius, 4, absorberactive); //---------------------------------------- // sPHENIX forward flux return door if (do_plugdoor) PlugDoor(g4Reco, absorberactive); //---------------------------------------- // BLACKHOLE // swallow all particles coming out of the backend of sPHENIX PHG4CylinderSubsystem *blackhole = new PHG4CylinderSubsystem("BH", 1); blackhole->set_double_param("radius",radius + 10); // add 10 cm blackhole->set_int_param("lengthviarapidity",0); blackhole->set_double_param("length",g4Reco->GetWorldSizeZ() - no_overlapp); // make it cover the world in length blackhole->BlackHole(); blackhole->set_double_param("thickness",0.1); // it needs some thickness blackhole->SetActive(); // always see what leaks out blackhole->OverlapCheck(overlapcheck); g4Reco->registerSubsystem(blackhole); //---------------------------------------- // FORWARD BLACKHOLEs // +Z blackhole = new PHG4CylinderSubsystem("BH_FORWARD_PLUS", 1); blackhole->SuperDetector("BH_FORWARD_PLUS"); blackhole->set_double_param("radius",0); // add 10 cm blackhole->set_int_param("lengthviarapidity",0); blackhole->set_double_param("length",0.1); // make it cover the world in length blackhole->set_double_param("place_z",g4Reco->GetWorldSizeZ()/2. - 0.1 - no_overlapp); blackhole->BlackHole(); blackhole->set_double_param("thickness",radius - no_overlapp); // it needs some thickness blackhole->SetActive(); // always see what leaks out blackhole->OverlapCheck(overlapcheck); g4Reco->registerSubsystem(blackhole); blackhole = new PHG4CylinderSubsystem("BH_FORWARD_NEG", 1); blackhole->SuperDetector("BH_FORWARD_NEG"); blackhole->set_double_param("radius",0); // add 10 cm blackhole->set_int_param("lengthviarapidity",0); blackhole->set_double_param("length",0.1); // make it cover the world in length blackhole->set_double_param("place_z", - g4Reco->GetWorldSizeZ()/2. +0.1 + no_overlapp); blackhole->BlackHole(); blackhole->set_double_param("thickness",radius - no_overlapp); // it needs some thickness blackhole->SetActive(); // always see what leaks out blackhole->OverlapCheck(overlapcheck); g4Reco->registerSubsystem(blackhole); PHG4TruthSubsystem *truth = new PHG4TruthSubsystem(); g4Reco->registerSubsystem(truth); se->registerSubsystem( g4Reco ); return 0; }
//! Babar DIRC (Without most of support structure) //! Ref: I. Adam et al. The DIRC particle identification system for the BaBar experiment. //! Nucl. Instrum. Meth., A538:281-357, 2005. doi:10.1016/j.nima.2004.08.129. double DIRCSetup(PHG4Reco* g4Reco) { const double radiator_R = 83.65; const double length = 470; const double z_shift = -115; const double z_start = z_shift + length / 2.; const double z_end = z_shift - length / 2.; PHG4SectorSubsystem *dirc; dirc = new PHG4SectorSubsystem("DIRC"); dirc->get_geometry().set_normal_polar_angle(3.14159265358979323846/2); dirc->get_geometry().set_normal_start( 83.65 * PHG4Sector::Sector_Geometry::Unit_cm()); dirc->get_geometry().set_min_polar_angle(atan2(radiator_R, z_start)); dirc->get_geometry().set_max_polar_angle(atan2(radiator_R, z_end)); dirc->get_geometry().set_min_polar_edge(PHG4Sector::Sector_Geometry::FlatEdge()); dirc->get_geometry().set_max_polar_edge(PHG4Sector::Sector_Geometry::FlatEdge()); dirc->get_geometry().set_material("Quartz"); dirc->get_geometry().set_N_Sector(12); dirc->OverlapCheck(overlapcheck); dirc->get_geometry().AddLayer("Radiator", "Quartz", 1.7 * PHG4Sector::Sector_Geometry::Unit_cm(), true); g4Reco->registerSubsystem(dirc); PHG4CylinderSubsystem *cyl; // The cylinder skins provide most of the strength // and stiffness of the CST. The thickness of the inner // and outer skins is 1.27 and 0.76 mm, respectively // Inner skin: cyl = new PHG4CylinderSubsystem("DIRC_CST_Inner_Skin", 10); cyl->set_double_param("radius",81.71); cyl->set_int_param("lengthviarapidity",0); cyl->set_double_param("length",length); cyl->set_string_param("material","G4_Al"); cyl->set_double_param("thickness",0.127); cyl->set_double_param("place_x",0.); cyl->set_double_param("place_y",0.); cyl->set_double_param("place_z",z_shift); cyl->SetActive(0); cyl->SuperDetector("DIRC"); cyl->OverlapCheck(overlapcheck); g4Reco->registerSubsystem(cyl); // Outer skin: cyl = new PHG4CylinderSubsystem("DIRC_CST_Outer_Skin", 11); cyl->set_double_param("radius",89.25 - 0.076); cyl->set_int_param("lengthviarapidity",0); cyl->set_double_param("length",length); cyl->set_string_param("material","G4_Al"); cyl->set_double_param("thickness",0.076); cyl->set_double_param("place_x",0.); cyl->set_double_param("place_y",0.); cyl->set_double_param("place_z",z_shift); cyl->SetActive(0); cyl->SuperDetector("DIRC"); cyl->OverlapCheck(overlapcheck); g4Reco->registerSubsystem(cyl); // Done return 89.25; }
double CEmc(PHG4Reco* g4Reco, double radius, const int crossings, const int absorberactive = 0) { if (radius > 100) { cout << "inconsistency: radius: " << radius << " larger than ALICE CEMC inner radius: 100" << endl; gSystem->Exit(-1); } radius = 100; //--------------- // Load libraries //--------------- gSystem->Load("libg4detectors.so"); gSystem->Load("libg4testbench.so"); double depth = 18*1.23; // 18 radlen, 1 radlen = 1.23 cm double scintiwidth = 0.176; double leadwidth = 0.144; PHG4CylinderSubsystem *cemc; for (int ilayer = Min_cemc_layer; ilayer <= Max_cemc_layer; ilayer++) { cemc = new PHG4CylinderSubsystem("ABSORBER_CEMC", ilayer); cemc->SetRadius(radius); cemc->SetMaterial("G4_Pb"); cemc->SetThickness(leadwidth); cemc->SuperDetector("ABSORBER_CEMC"); if (absorberactive) cemc->SetActive(); cemc->OverlapCheck(overlapcheck); g4Reco->registerSubsystem( cemc ); radius += leadwidth; radius += no_overlapp; cemc = new PHG4CylinderSubsystem("CEMC", ilayer); cemc->SetRadius(radius); cemc->SetMaterial("Scintillator"); cemc->SetThickness(scintiwidth); cemc->SetActive(); cemc->SuperDetector("CEMC"); cemc->OverlapCheck(overlapcheck); g4Reco->registerSubsystem( cemc ); radius += scintiwidth; radius += no_overlapp; } PHG4CylinderSubsystem *cyl = new PHG4CylinderSubsystem("EMCELECTRONICS", 0); cyl->SetRadius(radius); cyl->SetMaterial("G4_TEFLON"); // plastic cyl->SetThickness(0.5); if (absorberactive) cyl->SetActive(); g4Reco->registerSubsystem( cyl ); radius += 0.5; radius += no_overlapp; return radius; }
//! 2D full projective SPACAL double CEmc_2DProjectiveSpacal(PHG4Reco *g4Reco, double radius, const int crossings, const int absorberactive = 0) { double emc_inner_radius = 92; // emc inner radius from engineering drawing double cemcthickness = 24.00000 - no_overlapp; //max radius is 116 cm; double emc_outer_radius = emc_inner_radius + cemcthickness; // outer radius assert(emc_outer_radius < 116); if (radius > emc_inner_radius) { cout << "inconsistency: preshower radius+thickness: " << radius << " larger than emc inner radius: " << emc_inner_radius << endl; gSystem->Exit(-1); } //--------------- // Load libraries //--------------- gSystem->Load("libg4detectors.so"); // the radii are only to determined the thickness of the cemc radius = emc_inner_radius; //--------------- // Load libraries //--------------- // 1.5cm thick teflon as an approximation for EMCAl light collection + electronics (10% X0 total estimated) PHG4CylinderSubsystem *cyl = new PHG4CylinderSubsystem("CEMC_ELECTRONICS", 0); cyl->set_double_param("radius", radius); cyl->set_string_param("material", "G4_TEFLON"); cyl->set_double_param("thickness", 1.5 - no_overlapp); cyl->SuperDetector("CEMC_ELECTRONICS"); cyl->OverlapCheck(overlapcheck); if (absorberactive) cyl->SetActive(); g4Reco->registerSubsystem(cyl); radius += 1.5; cemcthickness -= 1.5 + no_overlapp; // 0.5cm thick Stainless Steel as an approximation for EMCAl support system cyl = new PHG4CylinderSubsystem("CEMC_SPT", 0); cyl->SuperDetector("CEMC_SPT"); cyl->set_double_param("radius", radius + cemcthickness - 0.5); cyl->set_string_param("material", "SS310"); // SS310 Stainless Steel cyl->set_double_param("thickness", 0.5 - no_overlapp); cyl->OverlapCheck(overlapcheck); if (absorberactive) cyl->SetActive(); g4Reco->registerSubsystem(cyl); cemcthickness -= 0.5 + no_overlapp; //--------------- // Load libraries //--------------- int ilayer = 0; PHG4SpacalSubsystem *cemc; const bool use_2015_design = false; if (use_2015_design) { cemc = new PHG4SpacalSubsystem("CEMC", ilayer); cemc->set_int_param("config", PHG4CylinderGeom_Spacalv1::kFullProjective_2DTaper_SameLengthFiberPerTower); cemc->set_double_param("radius", radius); // overwrite minimal radius cemc->set_double_param("thickness", cemcthickness); // overwrite thickness cemc->set_int_param("azimuthal_n_sec", 32); // cemc->set_int_param("construction_verbose", 2); cemc->SetActive(); cemc->SuperDetector("CEMC"); if (absorberactive) cemc->SetAbsorberActive(); cemc->OverlapCheck(overlapcheck); } else { cemc = new PHG4SpacalSubsystem("CEMC", ilayer); cemc->set_int_param("virualize_fiber", 0); cemc->set_int_param("azimuthal_seg_visible", 1); cemc->set_int_param("construction_verbose", 0); cemc->Verbosity(0); cemc->UseCalibFiles(PHG4DetectorSubsystem::xml); cemc->SetCalibrationFileDir(string(getenv("CALIBRATIONROOT")) + string("/CEMC/Geometry_2017ProjTilted/")); cemc->set_double_param("radius", radius); // overwrite minimal radius cemc->set_double_param("thickness", cemcthickness); // overwrite thickness cemc->SetActive(); cemc->SuperDetector("CEMC"); if (absorberactive) cemc->SetAbsorberActive(); cemc->OverlapCheck(overlapcheck); } g4Reco->registerSubsystem(cemc); if (ilayer > Max_cemc_layer) { cout << "layer discrepancy, current layer " << ilayer << " max cemc layer: " << Max_cemc_layer << endl; } radius += cemcthickness; radius += no_overlapp; return radius; }