Commit 6670da9a authored by Jihee Kim's avatar Jihee Kim
Browse files

Modified Pb/Sc sampling calorimeter

parent 776c0ef2
Pipeline #2778 passed with stage
in 52 seconds
......@@ -79,9 +79,10 @@
<!-- Definition of the readout segmentation/definition -->
<readouts>
<readout name="HcalEndcapHits">
<segmentation type="CartesianGridXY" grid_size_x="3.5*cm" grid_size_y="3.5*cm" />
<id>system:8,module:14,layer:10,slice:2,x:48:-8,y:-8</id>
<readout name="HcalEndcapHits">
<id>system:5,module:14,sensor:2,side:32:-2,strip:24</id>
<!--<segmentation type="CartesianGridXY" grid_size_x="3.5*cm" grid_size_y="3.5*cm" />-->
<!--<id>system:8,module:14,layer:10,slice:2,x:48:-8,y:-8</id>-->
</readout>
</readouts>
......
......@@ -20,30 +20,38 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se
xml_det_t x_det = e;
int det_id = x_det.id();
string det_name = x_det.nameStr();
// Size of Endcap
double rmin = 2.0*cm;
double rmax = 10.0*cm;
Assembly assembly( det_name+"_assembly" );
int nlayers = 10;
// Number of layers of each tile
int nlayers = 30;
// Thickness of plates
double layer0_thickness = 0.5*mm; //Pb_slice
double layer1_thickness = 1.5*mm; //Scint_slice
double total_layer_thickness = layer0_thickness + layer1_thickness;
// Size of tile
double width_x = 1*cm;
double width_y = 1*cm;
// Visualization Setting
auto gray_vis = description.visAttributes("GrayVis");
auto red_vis = description.visAttributes("RedVis");
DetElement det(det_name, det_id);
Assembly module_assembly( "module_assembly" );
PlacedVolume module_PV;
//Pb tile
Box lead_layer_shape(width_x/2.0, width_y/2.0,layer0_thickness/2.0);
Volume lead_layer_Vol("lead_layer_Vol", lead_layer_shape, description.material("Lead"));
lead_layer_Vol.setVisAttributes(gray_vis);
//Sci tile
Box scint_layer_shape(width_x/2.0, width_y/2.0,layer1_thickness/2.0);
Volume scint_layer_Vol("tile_scint_vol", scint_layer_shape, description.material("PlasticScint"));
Volume scint_layer_Vol("scint_layer_Vol", scint_layer_shape, description.material("PlasticScint"));
scint_layer_Vol.setVisAttributes(red_vis);
// A Stack of Pb and Scintillator tiles
for(int ilayer = 0; ilayer < nlayers; ilayer++) {
double z_layer = ilayer * total_layer_thickness + layer0_thickness / 2.0;
auto lead_PV = module_assembly.placeVolume(lead_layer_Vol, Position(0.0, 0.0, z_layer));
......@@ -57,10 +65,111 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se
scint_layer_Vol.setSensitiveDetector(sens);
}
PlacedVolume module_PV = assembly.placeVolume(module_assembly, Position(0.0,0.0, 0.0));
module_PV.addPhysVolID("module", 0);
// How many
int nx = 10;
int ny = 10;
// Offset between X and Y
double offset_x = 0.1*mm;
double offset_y = 0.1*mm;
// Position of each stack of Pb/Sc
double pos_x = 0.0*cm;
double pos_y = 0.0*cm;
// Starting Position of each stack of Pb/Sc
double x_start = (width_x + offset_x)/2.0;
double y_start = (width_y + offset_x)/2.0;
// Spacing between stacks and Diagonal length
double x_spacing = width_x + offset_x;
double y_spacing = width_y + offset_y;
double diagonal = width_x*sqrt(2);
// Limit based on Endcap size
double limit_inner = rmin + diagonal/2.0;
double limit_outer = rmax - diagonal/2.0;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Start placing stacks of Pb/Sc
// Divide 4 sections; X+Y+, X-Y+, X+Y-, X-Y-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// X+Y+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int imod = 0;
for(int ix = 0; ix<nx; ix++)
{
pos_x = x_start + (ix*x_spacing);
pos_y = y_start;
for(int iy = 0; iy<ny; iy++)
{
pos_y = y_start + (iy*y_spacing);
if(sqrt((pos_x*pos_x) + (pos_y*pos_y)) > limit_inner && sqrt((pos_x*pos_x) + (pos_y*pos_y)) < limit_outer)
{
module_PV = assembly.placeVolume(module_assembly, Position(pos_x,pos_y,0.0));
imod++;
module_PV.addPhysVolID("module", imod);
}
else
continue;
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// X-Y+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
for(int ix = 0; ix<nx; ix++)
{
pos_x = -x_start - (ix*x_spacing);
pos_y = y_start;
for(int iy = 0; iy<ny; iy++)
{
pos_y = y_start + (iy*y_spacing);
if(sqrt((pos_x*pos_x) + (pos_y*pos_y)) > limit_inner && sqrt((pos_x*pos_x) + (pos_y*pos_y)) < limit_outer)
{
module_PV = assembly.placeVolume(module_assembly, Position(pos_x,pos_y, 0.0));
imod++;
module_PV.addPhysVolID("module", imod);
}
else
continue;
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// X+Y-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
for(int ix = 0; ix<nx; ix++)
{
pos_x = x_start + (ix*x_spacing);
pos_y = -y_start;
for(int iy = 0; iy<ny; iy++)
{
pos_y = -y_start - (iy*y_spacing);
if(sqrt((pos_x*pos_x) + (pos_y*pos_y)) > limit_inner && sqrt((pos_x*pos_x) + (pos_y*pos_y)) < limit_outer)
{
module_PV = assembly.placeVolume(module_assembly, Position(pos_x,pos_y, 0.0));
imod++;
module_PV.addPhysVolID("module", imod);
}
else
continue;
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// X-Y-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
for(int ix = 0; ix<nx; ix++)
{
pos_x = -x_start - (ix*x_spacing);
pos_y = -y_start;
for(int iy = 0; iy<ny; iy++)
{
pos_y = -y_start - (iy*y_spacing);
if(sqrt((pos_x*pos_x) + (pos_y*pos_y)) > limit_inner && sqrt((pos_x*pos_x) + (pos_y*pos_y)) < limit_outer)
{
module_PV = assembly.placeVolume(module_assembly, Position(pos_x,pos_y, 0.0));
imod++;
module_PV.addPhysVolID("module", imod);
}
else
continue;
}
}
DetElement det(det_name, det_id);
Volume motherVol = description.pickMotherVolume(det);
PlacedVolume envPV = motherVol.placeVolume(assembly, Position(0, 0, 0));
envPV.addPhysVolID("system", det_id);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment