//! A rough version of the inner HCal support ring, from Richie's CAD drawing. - Jin
void HCalInner_SupportRing(PHG4Reco* g4Reco,
			   const int absorberactive = 0) {
  
  gSystem->Load("libg4detectors.so");
  gSystem->Load("libg4testbench.so");

  const double z_ring1 = (2025 + 2050) / 2. / 10.;
  const double z_ring2 = (2150 + 2175) / 2. / 10.;
  const double dz = 25. / 10.;
  const double innerradius = 116.;
  const double maxradius = 178.0 - 0.001; // avoid touching the outer HCal envelop volumne

  const double z_rings[] =
    { -z_ring2, -z_ring1, z_ring1, z_ring2, 0, 0, 0, 0 };

  PHG4CylinderSubsystem *cyl;

  for (int i = 0; i < 4; i++)
    {
      cyl = new PHG4CylinderSubsystem("HCALIN_SPT_N1", 0);
      cyl->SetPosition(0, 0, z_rings[i]);
      cyl->SuperDetector("HCALIN_SPT");
      cyl->SetRadius(innerradius);
      cyl->SetLengthViaRapidityCoverage(false);
      cyl->SetLength(dz);
      cyl->SetMaterial("G4_Fe"); // use 1 radiation length Al for magnet thickness
      cyl->SetThickness(maxradius - innerradius);
      if (absorberactive)
        cyl->SetActive();
      g4Reco->registerSubsystem(cyl);
    }
  
  return;
}
Beispiel #2
0
//! for visualization purpose only
double
CEmc_Vis(PHG4Reco* g4Reco, double radius, const int crossings, const int absorberactive = 0)
{
  double emc_inner_radius = 95.; // emc inner radius from engineering drawing
  double cemcthickness = 12.7;
  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");
  gSystem->Load("libg4testbench.so");

  // the radii are only to determined the thickness of the cemc
  radius = emc_inner_radius;

  int ilayer = Min_cemc_layer;
  PHG4SpacalSubsystem *cemc;
  cemc = new PHG4SpacalSubsystem("CEMC", ilayer);

  cemc ->get_geom().set_radius(emc_inner_radius);
  cemc ->get_geom().set_thickness(cemcthickness);
  cemc ->get_geom().set_virualize_fiber(true);
  cemc ->get_geom().set_construction_verbose(2);

  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;
  
  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;
}
Beispiel #3
0
double Pipe(PHG4Reco* g4Reco,
	    double radius,
	    const int absorberactive = 0,
	    int verbosity = 0) {

  double pipe_radius    = 2.16;   // 2.16 cm based on spec sheet
  double pipe_thickness = 0.0760; // 760 um based on spec sheet
  double pipe_length = g4Reco->GetWorldSizeZ() - no_overlapp; // entire volume
  if (radius > pipe_radius) {
    cout << "inconsistency: radius: " << radius 
	 << " larger than Pipe inner radius: " << pipe_radius << endl;
    gSystem->Exit(-1);
  }
  
  gSystem->Load("libg4detectors.so");
  gSystem->Load("libg4testbench.so");

  PHG4CylinderSubsystem *cyl = new PHG4CylinderSubsystem("PIPE", 0);
  cyl->SetRadius(pipe_radius);
  cyl->SetLengthViaRapidityCoverage(false);
  cyl->SetLength(pipe_length);
  cyl->SetMaterial("G4_Be");
  cyl->SetThickness(pipe_thickness);
  cyl->SuperDetector("PIPE");
  if (absorberactive)  cyl->SetActive();
  g4Reco->registerSubsystem( cyl );

  radius = pipe_radius + pipe_thickness;
  
  if (verbosity >= 0) {
    cout << "=========================== G4_Pipe.C::Pipe() =============================" << endl;
    cout << " PIPE Material Description:" << endl;
    cout << "  inner radius = " << pipe_radius << " cm" << endl;
    cout << "  thickness = " << pipe_thickness << " cm" << endl;
    cout << "  outer radius = " << pipe_radius + pipe_thickness << " cm" << endl;
    cout << "  length = " << pipe_length << " cm" << endl;
    cout << "===========================================================================" << endl;
  }

  radius += no_overlapp;
  
  return radius; 
}
Beispiel #4
0
double Magnet(PHG4Reco* g4Reco,
	      double radius,
	      const int crossings = 0,
	      const int absorberactive = 0,
	      int verbosity = 0) {

  double magnet_inner_cryostat_wall_radius = 142;
  double magnet_inner_cryostat_wall_thickness = 1;
  double magnet_outer_cryostat_wall_radius = 174.5;
  double magnet_outer_cryostat_wall_thickness = 2.5;
  double magnet_coil_radius = 150.8;
  double magnet_coil_thickness = 9.38;
  double magnet_length = 379.;
  double coil_length = 361.5;
  if (radius > magnet_inner_cryostat_wall_radius) {
    cout << "inconsistency: radius: " << radius 
	 << " larger than Magnet inner radius: " << magnet_inner_cryostat_wall_radius << endl;
    gSystem->Exit(-1);
  }
  
  gSystem->Load("libg4detectors.so");
  gSystem->Load("libg4testbench.so");

  radius = magnet_inner_cryostat_wall_radius;
  PHG4CylinderSubsystem *cyl = new PHG4CylinderSubsystem("MAGNET", 0);
  cyl->SetRadius(magnet_inner_cryostat_wall_radius);
  cyl->SetLengthViaRapidityCoverage(false);
  cyl->SetLength(magnet_length);
  cyl->SetMaterial("Al5083"); // use 1 radiation length Al for magnet thickness
  cyl->SetThickness(magnet_inner_cryostat_wall_thickness);
  cyl->SuperDetector("MAGNET");
  if (absorberactive)  cyl->SetActive();
  g4Reco->registerSubsystem( cyl );

  cyl = new PHG4CylinderSubsystem("MAGNET", 1);
  cyl->SetRadius(magnet_coil_radius);
  cyl->SetLengthViaRapidityCoverage(false);
  cyl->SetLength(coil_length);
  cyl->SetMaterial("Al5083"); // use 1 radiation length Al for magnet thickness
  cyl->SetThickness(magnet_coil_thickness);
  cyl->SuperDetector("MAGNET");
  if (absorberactive)  cyl->SetActive();
  g4Reco->registerSubsystem( cyl );

  cyl = new PHG4CylinderSubsystem("MAGNET", 2);
  cyl->SetRadius(magnet_outer_cryostat_wall_radius);
  cyl->SetLengthViaRapidityCoverage(false);
  cyl->SetLength(magnet_length);
  cyl->SetMaterial("Al5083"); // use 1 radiation length Al for magnet thickness
  cyl->SetThickness(magnet_outer_cryostat_wall_thickness);
  cyl->SuperDetector("MAGNET");
  if (absorberactive)  cyl->SetActive();
  g4Reco->registerSubsystem( cyl );

  radius = magnet_outer_cryostat_wall_radius + magnet_outer_cryostat_wall_thickness; // outside of magnet
  
  if (verbosity > 0) {
    cout << "========================= G4_Magnet.C::Magnet() ===========================" << endl;
    cout << " MAGNET Material Description:" << endl;
    cout << "  inner radius = " << magnet_inner_cryostat_wall_radius << " cm" << endl;
    cout << "  outer radius = " << magnet_outer_cryostat_wall_radius + magnet_outer_cryostat_wall_thickness << " cm" << endl;
    cout << "  length = " << magnet_length << " cm" << endl;
    cout << "===========================================================================" << endl;
  }

  radius += no_overlapp;
  
  return radius; 
}
Beispiel #5
0
double Svtx(PHG4Reco* g4Reco, double radius, 
	    const int absorberactive = 0,
	    int verbosity = 0) {

  float svtx_inner_radius = 2.335; // based on the ALICE ITS (same beam pipe as ours)
  
  if (radius > svtx_inner_radius) {
    cout << "inconsistency: radius: " << radius 
	 << " larger than SVTX inner radius: " << svtx_inner_radius << endl;
    gSystem->Exit(-1);
  }
 
  PHG4CylinderSubsystem *cyl;

  // silicon layers ------------------------------------------------------------

  // inner pixels are a copy of the MAPS ITS inner layers
  // outer strips are from YA at the Santa Fe Tracking Workshop 10/27/2015
  // see: https://indico.bnl.gov/conferenceDisplay.py?confId=1364

  // The updated thicknesses from Yasuyuki are as follows:
  // For Si 1mm = 1.07% X_0
  // For Cu 1mm = 6.96% X_0
  // The thickness of the tracking layers is:
  // 0 MAPS: 0.3% X_0  (0.053% sensor + 0.247% support) sensor =  50 mc Si, support =  35 mc Cu
  // 1 MAPS: 0.3% X_0  (0.053% sensor + 0.247% support) sensor =  50 mc Si, support =  35 mc Cu
  // 2 MAPS: 0.3% X_0  (0.053% sensor + 0.247% support) sensor =  50 mc Si, support =  35 mc Cu
  
  double si_thickness[3] = {0.0050, 0.0050, 0.0050};
  double svxrad[3] = {svtx_inner_radius, 3.132, 3.904};
  double support_thickness[3] = {0.0035, 0.0035, 0.0035};
  double length[3] = {27., 27., 27.};

  for (int ilayer=0;ilayer<n_svx_layer;++ilayer) {
    cyl = new PHG4CylinderSubsystem("SVTX", ilayer);
    radius = svxrad[ilayer];
    cyl->SetRadius(radius);
    cyl->SetLength( length[ilayer] );
    cyl->SetMaterial("G4_Si");
    cyl->SetThickness( si_thickness[ilayer] );
    cyl->SetActive();
    cyl->SuperDetector("SVTX");
    g4Reco->registerSubsystem( cyl );
    
    radius += si_thickness[ilayer] + no_overlapp;
    
    cyl = new PHG4CylinderSubsystem("SVTXSUPPORT", ilayer);
    cyl->SetRadius(radius);
    cyl->SetLength( length[ilayer] );
    cyl->SetMaterial("G4_Cu");
    cyl->SetThickness( support_thickness[ilayer] );
    cyl->SuperDetector("SVTXSUPPORT");
    g4Reco->registerSubsystem( cyl );
  }

  // time projection chamber layers --------------------------------------------

  double inner_cage_radius = 30.;
  string tpcgas = "G4_Ar";

  radius = inner_cage_radius;
  
  double n_rad_length_cage = 1.0e-02;
  double cage_length = 400.;
  double cage_thickness = 1.43 * n_rad_length_cage;
  
  cyl = new PHG4CylinderSubsystem("SVTXSUPPORT", 3);
  cyl->SetRadius(radius);
  cyl->SetLength(cage_length);
  cyl->SetMaterial("G4_Cu");
  cyl->SetThickness( cage_thickness ); // Cu X_0 = 1.43 cm
  cyl->SuperDetector("SVTXSUPPORT");
  g4Reco->registerSubsystem( cyl );

  radius += cage_thickness;
  
  double outer_radius = 80.;
  int npoints = Max_si_layer - n_svx_layer;
  double delta_radius =  ( outer_radius - cage_thickness - radius )/( (double)npoints );
  
  for(int ilayer=n_svx_layer;ilayer<(2+npoints);++ilayer) {
    cyl = new PHG4CylinderSubsystem("SVTX", ilayer);
    cyl->SetRadius(radius);
    cyl->SetLength( cage_length );
    cyl->SetMaterial(tpcgas.c_str());
    cyl->SetThickness(  delta_radius - 0.01 );
    cyl->SetActive();
    cyl->SuperDetector("SVTX");
    g4Reco->registerSubsystem( cyl );
    
    radius += delta_radius;
  }

  cyl = new PHG4CylinderSubsystem("SVTXSUPPORT", 2+npoints);
  cyl->SetRadius(radius);
  cyl->SetLength(cage_length);
  cyl->SetMaterial("G4_Cu");
  cyl->SetThickness( cage_thickness ); // Cu X_0 = 1.43 cm
  cyl->SuperDetector("SVTXSUPPORT");
  g4Reco->registerSubsystem( cyl );

  radius += cage_thickness;

  return radius;
}
//! 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);
}
Beispiel #7
0
double Pipe(PHG4Reco* g4Reco,
	    double radius,
	    const int absorberactive = 0,
	    int verbosity = 0) {

  double be_pipe_radius    = 2.16;   // 2.16 cm based on spec sheet
  double be_pipe_thickness = 0.0760; // 760 um based on spec sheet
  double be_pipe_length    = 80.0;   // +/- 40 cm

  double al_pipe_radius    = 2.16;   // same as Be pipe
  double al_pipe_thickness = 0.1600; // 1.6 mm based on spec
  double al_pipe_length    = 88.3;   // extension beyond +/- 40 cm
  
  if (radius > be_pipe_radius) {
    cout << "inconsistency: radius: " << radius 
	 << " larger than pipe inner radius: " << be_pipe_radius << endl;
    gSystem->Exit(-1);
  }
  
  gSystem->Load("libg4detectors.so");
  gSystem->Load("libg4testbench.so");

  // mid-rapidity beryillium pipe
  PHG4CylinderSubsystem *cyl = new PHG4CylinderSubsystem("BE_PIPE", 0);
  cyl->SetRadius(be_pipe_radius);
  cyl->SetLengthViaRapidityCoverage(false);
  cyl->SetLength(be_pipe_length);
  cyl->SetMaterial("G4_Be");
  cyl->SetThickness(be_pipe_thickness);
  cyl->SuperDetector("PIPE");
  if (absorberactive)  cyl->SetActive();
  g4Reco->registerSubsystem( cyl );

  // north aluminum pipe
  cyl = new PHG4CylinderSubsystem("N_AL_PIPE", 1);
  cyl->SetPosition(0.0,0.0,0.5*be_pipe_length+0.5*al_pipe_length+no_overlapp);
  cyl->SetRadius(al_pipe_radius);
  cyl->SetLengthViaRapidityCoverage(false);
  cyl->SetLength(al_pipe_length);
  cyl->SetMaterial("G4_Al");
  cyl->SetThickness(al_pipe_thickness);
  cyl->SuperDetector("PIPE");
  if (absorberactive)  cyl->SetActive();
  g4Reco->registerSubsystem( cyl );

  // south aluminum pipe
  cyl = new PHG4CylinderSubsystem("S_AL_PIPE", 2);
  cyl->SetPosition(0.0,0.0,-0.5*be_pipe_length-0.5*al_pipe_length-no_overlapp);
  cyl->SetRadius(al_pipe_radius);
  cyl->SetLengthViaRapidityCoverage(false);
  cyl->SetLength(al_pipe_length);
  cyl->SetMaterial("G4_Al");
  cyl->SetThickness(al_pipe_thickness);
  cyl->SuperDetector("PIPE");
  if (absorberactive)  cyl->SetActive();
  g4Reco->registerSubsystem( cyl );

  radius = be_pipe_radius + be_pipe_thickness;
  
  if (verbosity > 0) {
    cout << "=========================== G4_Pipe.C::Pipe() =============================" << endl;
    cout << " PIPE Material Description:" << endl;
    cout << "  inner radius = " << be_pipe_radius << " cm" << endl;
    cout << "  thickness = " << be_pipe_thickness << " cm" << endl;
    cout << "  outer radius = " << be_pipe_radius + be_pipe_thickness << " cm" << endl;
    cout << "  length = " << be_pipe_length << " cm" << endl;
    cout << "===========================================================================" << endl;
  }

  radius += no_overlapp;
  
  return radius; 
}
Beispiel #8
0
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;
}