Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:24

0001 #ifndef MACRO_G4CEMCALBEDO_C
0002 #define MACRO_G4CEMCALBEDO_C
0003 
0004 #include <GlobalVariables.C>
0005 
0006 #include <g4detectors/PHG4CylinderSubsystem.h>
0007 
0008 #include <g4main/PHG4Reco.h>
0009 
0010 namespace Enable
0011 {
0012   bool CEMCALBEDO = false;
0013   bool CEMCALBEDO_ABSORBER = false;
0014 }  // namespace Enable
0015 
0016 namespace G4CEMCALBEDO
0017 {
0018   double teflon_cylinder_thickness = 1.5;
0019   double inner_radius = 95. - teflon_cylinder_thickness;  // inner radius emc, 1.5cm electronics subtracted
0020   double albedo_thickness = 2.;
0021 }  // namespace G4CEMCALBEDO
0022 
0023 void CEmcAlbedoInit()
0024 {
0025   BlackHoleGeometry::max_z = std::max(BlackHoleGeometry::max_z, 149.47);
0026   BlackHoleGeometry::min_z = std::min(BlackHoleGeometry::min_z, -149.47);
0027   BlackHoleGeometry::max_radius = std::max(BlackHoleGeometry::max_radius, G4CEMCALBEDO::inner_radius + G4CEMCALBEDO::teflon_cylinder_thickness + G4CEMCALBEDO::albedo_thickness);
0028 }
0029 
0030 void CEmcAlbedo(PHG4Reco *g4Reco)
0031 {
0032   bool AbsorberActive = Enable::ABSORBER || Enable::CEMCALBEDO_ABSORBER;
0033   PHG4CylinderSubsystem *cyl = new PHG4CylinderSubsystem("CEMC_ELECTRONICS", 0);
0034   cyl->SuperDetector("CEMC_MOCKUP");
0035   cyl->set_double_param("radius", G4CEMCALBEDO::inner_radius);
0036   cyl->set_string_param("material", "G4_TEFLON");
0037   cyl->set_double_param("thickness", G4CEMCALBEDO::teflon_cylinder_thickness);
0038   if (AbsorberActive) cyl->SetActive();
0039   g4Reco->registerSubsystem(cyl);
0040   cyl = new PHG4CylinderSubsystem("CEMC_ALBEDO", 1);
0041   cyl->SuperDetector("CEMC_MOCKUP");
0042   cyl->set_double_param("radius", G4CEMCALBEDO::inner_radius + G4CEMCALBEDO::teflon_cylinder_thickness);
0043   cyl->set_string_param("material", "Spacal_W_Epoxy");
0044   cyl->set_double_param("thickness", G4CEMCALBEDO::albedo_thickness);
0045   if (AbsorberActive) cyl->SetActive();
0046   g4Reco->registerSubsystem(cyl);
0047 }
0048 #endif