Skip to content
Snippets Groups Projects
Commit 56a9cdb0 authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

Moving far forward detectors to ip6 repository.

parent 83b00b5e
No related branches found
No related tags found
1 merge request!51Moving far forward detectors to ip6 repository.
......@@ -192,10 +192,10 @@
<include ref="compact/forward_trd.xml"/>
<include ref="compact/forward_rich.xml"/>
<include ref="compact/B0_tracker.xml"/>
<include ref="compact/far_forward_offM_tracker.xml"/>
<include ref="compact/far_forward_romanpots.xml"/>
<include ref="compact/far_forward_detectors.xml"/>
<include ref="ip6/B0_tracker.xml"/>
<include ref="ip6/far_forward_offM_tracker.xml"/>
<include ref="ip6/far_forward_romanpots.xml"/>
<include ref="ip6/far_forward_detectors.xml"/>
<!--
<include ref="compact/mm_tracker_barrel.xml"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<lccdd>
<define>
<comment>
---------------------------------
Far Forward B0 Tracker Parameters
---------------------------------
</comment>
<constant name="B0Tracker_zpos" value="B0PF_CenterPosition + B0PF_Length/2.0 + 20.0*cm"/>
</define>
<detectors>
<detector
id="B0Tracker_ID"
name="B0Tracker"
readout="B0TrackerHits"
type="ref_RectangularTracker"
insideTrackingVolume="true"
reflect="false"
vis="AnlRed">
<position x="0" y="0" z="B0Tracker_zpos"/>
<layer id="1"
vis="AnlBlue"
x="20.0*cm"
y="10.0*cm" >
<slice material="Air" thickness="1.0*cm" vis="AnlBlue" sensitive="true" />
<slice material="Air" thickness="1.0*cm" vis="AnlBlue" sensitive="true" />
<slice material="Air" thickness="1.0*cm" vis="AnlBlue" sensitive="true" />
<slice material="Air" thickness="1.0*cm" vis="AnlBlue" sensitive="true" />
</layer>
</detector>
</detectors>
<readouts>
<readout name="B0TrackerHits">
<segmentation type="CartesianGridXY" grid_size_x="1.0*mm" grid_size_y="1.0*mm" />
<id>system:8,barrel:3,layer:4,slice:4,x:32:-16,y:-16</id>
</readout>
</readouts>
</lccdd>
......@@ -626,33 +626,6 @@
<constant name="DIRCLength" value="CentralTracking_length + BackwardPIDLength"/>
<constant name="DIRCOffset" value="(CentralTracking_length - DIRCLength)/2.0"/>
<comment>
----------------------
Zero Degree Parameters
----------------------
</comment>
<constant name="ffi_ZDC_ECAL_z_pos" value="3800.0 * cm"/>
<constant name="ffi_ZDC_ECAL_x_pos" value="ffi_ZDC_ECAL_z_pos * ionCrossingAngle"/>
<constant name="ffi_ZDC_ECAL_y_pos" value="0.0 * cm"/>
<constant name="ffi_ZDC_ECAL_rotateX_angle" value="0.0 * rad"/>
<constant name="ffi_ZDC_ECAL_rotateY_angle" value="-0.0125 * rad"/>
<constant name="ffi_ZDC_ECAL_rotateZ_angle" value="0.0 * rad"/>
<constant name="ffi_ZDC_ECAL_module_width" value="5.0 * cm"/>
<constant name="ffi_ZDC_ECAL_module_thickness" value="20.0 * cm"/>
<constant name="ffi_ZDC_ECAL_module_gap" value="1.0 * mm"/>
<constant name="ffi_ZDC_ECAL_module_ntower" value="12"/>
<constant name="ffi_ZDC_ECAL_width" value="(ffi_ZDC_ECAL_module_width + ffi_ZDC_ECAL_module_gap) * ffi_ZDC_ECAL_module_ntower + 2.0 * cm"/>
<constant name="ffi_ZDC_ECAL_thickness" value="ffi_ZDC_ECAL_module_thickness + 2.0 * cm"/>
<constant name="ffi_ZDC_HCAL_x_pos" value="ffi_ZDC_ECAL_x_pos"/>
<constant name="ffi_ZDC_HCAL_y_pos" value="ffi_ZDC_ECAL_y_pos"/>
<constant name="ffi_ZDC_HCAL_z_pos" value="ffi_ZDC_ECAL_z_pos + ffi_ZDC_ECAL_thickness + 3.0 * cm"/>
<constant name="ffi_ZDC_HCAL_rotateX_angle" value="ffi_ZDC_ECAL_rotateX_angle"/>
<constant name="ffi_ZDC_HCAL_rotateY_angle" value="ffi_ZDC_ECAL_rotateY_angle"/>
<constant name="ffi_ZDC_HCAL_rotateZ_angle" value="ffi_ZDC_ECAL_rotateZ_angle"/>
<constant name="ffi_ZDC_HCAL_width" value="ffi_ZDC_ECAL_module_width * ffi_ZDC_ECAL_module_ntower"/>
<constant name="ffi_ZDC_HCAL_length" value="200.0 * cm"/>
<comment>
-----------------------
Gaseous RICH Parameters
......
<lccdd>
<comment>
//////////////////////////////////////////////////
// Far Forward Ion Zero Degree Calorimeter - Ecal
// PWO crystal bars
//////////////////////////////////////////////////
</comment>
<detectors>
<detector id="ffi_ZDC_ECAL_ID" name="ffi_ZDC_ECAL" type="ffi_ZDC_ECAL" readout="ffi_ZDC_ECAL_Hits" vis="ffi_ZDC_ECAL_Vis">
<position x="ffi_ZDC_ECAL_x_pos" y="ffi_ZDC_ECAL_y_pos" z="ffi_ZDC_ECAL_z_pos"/>
<rotation x="ffi_ZDC_ECAL_rotateX_angle" y="ffi_ZDC_ECAL_rotateY_angle" z="ffi_ZDC_ECAL_rotateZ_angle"/>
<dimensions x="ffi_ZDC_ECAL_width" z="ffi_ZDC_ECAL_thickness"/>
<module name="ffi_ZDC_ECAL_module"
vis="ffi_ZDC_ECAL_module_Vis"
material="PbWO4"
thickness="ffi_ZDC_ECAL_module_thickness"
width="ffi_ZDC_ECAL_module_width"
gap="ffi_ZDC_ECAL_module_gap"
ntower="ffi_ZDC_ECAL_module_ntower"/>
</detector>
</detectors>
<readouts>
<readout name="ffi_ZDC_ECAL_Hits">
<segmentation type="CartesianGridXY" grid_size_x="5.0*cm" grid_size_y="5.0*cm" />
<id>system:8,module:14,x:32:-16,y:-16</id>
</readout>
</readouts>
</lccdd>
<lccdd>
<comment>
//////////////////////////////////////////////////
// Far Forward Ion Zero Degree Calorimeter - Hcal
// Si+W sampling
//////////////////////////////////////////////////
</comment>
<define>
<constant name="ffi_ZDC_HCAL_NRepeat" value="40"/>
<constant name="ffiZDCHcalTungstenThickness" value="3.5 * mm"/>
<constant name="ffiZDCHcalSiliconThickness" value="500.0 * um"/>
<constant name="ffiZDCHcalAirThickness" value="1.0 * mm"/>
</define>
<detectors>
<detector id="ffi_ZDC_HCAL_ID" name="ffi_ZDC_HCAL" type="ffi_ZDC_HCAL" readout="ffi_ZDC_HCAL_Hits" vis="ffi_ZDC_HCAL_Vis">
<position x="ffi_ZDC_HCAL_x_pos" y="ffi_ZDC_HCAL_y_pos" z="ffi_ZDC_HCAL_z_pos"/>
<rotation x="ffi_ZDC_HCAL_rotateX_angle" y="ffi_ZDC_HCAL_rotateY_angle" z="ffi_ZDC_HCAL_rotateZ_angle"/>
<dimensions x="ffi_ZDC_HCAL_width" z="ffi_ZDC_HCAL_length"/>
<layer repeat="ffi_ZDC_HCAL_NRepeat">
<slice name="Tungsten_slice" material="TungstenDens24" thickness="ffiZDCHcalTungstenThickness" vis="AnlBlue"/>
<slice name="Silicon_slice" material="Silicon" thickness="ffiZDCHcalSiliconThickness" vis="AnlRed" sensitive="true"/>
<slice name="Air_slice" material="Air" thickness="ffiZDCHcalAirThickness" vis="AnlGold"/>
</layer>
</detector>
</detectors>
<readouts>
<readout name="ffi_ZDC_HCAL_Hits">
<segmentation type="CartesianGridXY" grid_size_x="1.0*cm" grid_size_y="1.0*cm" />
<id>system:8,layer:12,slice:12,x:32:-16,y:-16</id>
</readout>
</readouts>
</lccdd>
<lccdd>
<comment>Far Forward Hadron Detectors</comment>
<define>
</define>
<limits>
</limits>
<regions>
</regions>
<display>
</display>
<include ref="far_forward_ZDC_Ecal.xml" />
<include ref="far_forward_ZDC_Hcal.xml" />
<detectors>
</detectors>
<readouts>
</readouts>
<plugins>
</plugins>
<fields>
</fields>
</lccdd>
<?xml version="1.0" encoding="UTF-8"?>
<lccdd>
<define>
<comment>
----------------------------------------
Forward Off-Momentum Tracker Parameters
----------------------------------------
</comment>
<constant name="ForwardOffMTracker_zpos" value="B1APF_CenterPosition + B1APF_Length/2.0 + 10.0*cm"/>
<constant name="ForwardOffMTracker_xpos" value="B1APF_XPosition+40.0*cm"/>
</define>
<detectors>
<detector
id="ForwardOffMTracker_ID"
name="ForwardOffMTracker"
readout="ForwardOffMTrackerHits"
type="ref_RectangularTracker"
insideTrackingVolume="true"
reflect="false"
vis="AnlRed">
<position x="ForwardOffMTracker_xpos" y="0" z="ForwardOffMTracker_zpos"/>
<layer id="1"
vis="AnlViolet"
x="60.0*cm"
y="20.0*cm" >
<slice material="Air" thickness="1.0*cm" vis="AnlViolet" sensitive="true" />
<slice material="Air" thickness="1.0*cm" vis="AnlViolet" sensitive="true" />
<slice material="Air" thickness="1.0*cm" vis="AnlViolet" sensitive="true" />
<slice material="Air" thickness="1.0*cm" vis="AnlViolet" sensitive="true" />
</layer>
</detector>
</detectors>
<readouts>
<readout name="ForwardOffMTrackerHits">
<segmentation type="CartesianGridXY" grid_size_x="1.0*mm" grid_size_y="1.0*mm" />
<id>system:8,barrel:3,layer:4,slice:4,x:32:-16,y:-16</id>
</readout>
</readouts>
</lccdd>
<?xml version="1.0" encoding="UTF-8"?>
<lccdd>
<define>
<comment>
---------------------------------
Far Forward B0 Tracker Parameters
---------------------------------
</comment>
<constant name="ForwardRomanPotA_zpos" value="B1APF_CenterPosition + B1APF_Length/2.0 + 20.0*cm"/>
<constant name="ForwardRomanPotA_xpos" value="B1APF_XPosition"/>
<constant name="ForwardRomanPotB_zpos" value="B2PF_CenterPosition - B2PF_Length/2.0 - 20.0*cm"/>
<constant name="ForwardRomanPotB_xpos" value="B2PF_XPosition "/>
</define>
<detectors>
<detector
id="ForwardRomanPotA_ID"
name="ForwardRomanPotA"
readout="ForwardRomanPotHits"
type="ref_RectangularTracker"
insideTrackingVolume="true"
reflect="false"
vis="AnlRed">
<position x="ForwardRomanPotA_xpos" y="0" z="ForwardRomanPotA_zpos"/>
<layer id="1"
vis="AnlBlue"
x="20.0*cm"
y="10.0*cm" >
<slice material="Air" thickness="1.0*cm" vis="AnlBlue" sensitive="true" />
<slice material="Air" thickness="1.0*cm" vis="AnlBlue" sensitive="true" />
<slice material="Air" thickness="1.0*cm" vis="AnlBlue" sensitive="true" />
<slice material="Air" thickness="1.0*cm" vis="AnlBlue" sensitive="true" />
</layer>
</detector>
<detector
id="ForwardRomanPotB_ID"
name="ForwardRomanPotB"
readout="ForwardRomanPotHits"
type="ref_RectangularTracker"
insideTrackingVolume="true"
reflect="false"
vis="AnlRed">
<position x="ForwardRomanPotB_xpos" y="0" z="ForwardRomanPotB_zpos"/>
<layer id="1"
vis="AnlBlue"
x="20.0*cm"
y="10.0*cm" >
<slice material="Air" thickness="1.0*cm" vis="AnlBlue" sensitive="true" />
<slice material="Air" thickness="1.0*cm" vis="AnlBlue" sensitive="true" />
<slice material="Air" thickness="1.0*cm" vis="AnlBlue" sensitive="true" />
<slice material="Air" thickness="1.0*cm" vis="AnlBlue" sensitive="true" />
</layer>
</detector>
</detectors>
<readouts>
<readout name="ForwardRomanPotHits">
<segmentation type="CartesianGridXY" grid_size_x="1.0*mm" grid_size_y="1.0*mm" />
<id>system:8,barrel:3,layer:4,slice:4,x:32:-16,y:-16</id>
</readout>
</readouts>
</lccdd>
<lccdd>
<define>
</define>
<limits>
</limits>
<regions>
</regions>
<display>
</display>
<!-- Define detector -->
<detectors>
<detector
id="HCalBarrel_ID"
name="HcalBarrel"
type="DD4hep_PolyhedraBarrelCalorimeter2"
readout="HcalBarrelHits"
calorimeterType="HAD_BARREL"
gap="0.*cm"
material="Steel235">
<dimensions
numsides="CaloSides"
rmin="HcalBarrel_rmin"
z="HcalBarrelLength"/>
<staves vis="HcalBarrelVis"/>
<layer repeat="HcalBarrelLayers">
<slice material="Steel235" thickness="HcalSteelThickness"/>
<slice material="PyrexGlass" thickness="HcalPyrexThickness"/>
<slice material="RPCGasDefault" thickness="HcalRPCGasThickness" sensitive="yes" limits="cal_limits"/>
<slice material="PyrexGlass" thickness="HcalPyrexThickness"/>
<slice material="G10" thickness="HcalG10Thickness"/>
<slice material="Air" thickness="HcalAirThickness"/>
</layer>
</detector>
<detector
id="HCalEndcapP_ID"
name="HcalEndcapP"
type="refdet_PolyhedraEndcapCalorimeter2"
readout="HcalEndcapHits"
vis="HcalEndcapVis"
calorimeterType="HAD_ENDCAP"
reflect="false">
<dimensions
numsides="CaloSides"
zmin="HcalEndcap_zmin"
rmin="HcalEndcapP_rmin"
rmax="HcalBarrel_rmax"/>
<layer repeat="HcalEndcapLayers" vis="HcalEndcapVis" >
<slice material="Steel235" thickness="HcalSteelThickness"/>
<slice material="PyrexGlass" thickness="HcalPyrexThickness"/>
<slice material="RPCGasDefault" thickness="HcalRPCGasThickness" sensitive="yes" limits="cal_limits"/>
<slice material="PyrexGlass" thickness="HcalPyrexThickness"/>
<slice material="G10" thickness="HcalG10Thickness"/>
<slice material="Air" thickness="HcalAirThickness"/>
</layer>
</detector>
<detector
id="HCalEndcapN_ID"
name="HcalEndcapN"
type="refdet_PolyhedraEndcapCalorimeter2"
readout="HcalEndcapHits"
vis="HcalEndcapVis"
calorimeterType="HAD_ENDCAP" reflect="true">
<dimensions
numsides="CaloSides"
zmin="HcalEndcap_zmin"
rmin="HcalEndcapN_rmin"
rmax="HcalBarrel_rmax"/>
<layer repeat="HcalEndcapLayers" vis="HcalEndcapVis" >
<slice material="Steel235" thickness="HcalSteelThickness"/>
<slice material="PyrexGlass" thickness="HcalPyrexThickness"/>
<slice material="RPCGasDefault" thickness="HcalRPCGasThickness" sensitive="yes" limits="cal_limits"/>
<slice material="PyrexGlass" thickness="HcalPyrexThickness"/>
<slice material="G10" thickness="HcalG10Thickness"/>
<slice material="Air" thickness="HcalAirThickness"/>
</layer>
</detector>
</detectors>
<!-- Definition of the readout segmentation/definition -->
<readouts>
</readouts>
<plugins>
</plugins>
<fields>
</fields>
</lccdd>
#include "DDRec/Surface.h"
#include "DDRec/DetectorData.h"
#include "DD4hep/OpticalSurfaces.h"
#include "DD4hep/DetFactoryHelper.h"
#include "DD4hep/Printout.h"
#include <XML/Helper.h>
//////////////////////////////////////////////////
// Far Forward Ion Zero Degree Calorimeter - Ecal
//////////////////////////////////////////////////
using namespace std;
using namespace dd4hep;
static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens)
{
xml_det_t x_det = e;
string detName = x_det.nameStr();
int detID = x_det.id();
xml_dim_t dim = x_det.dimensions();
double Width = dim.x();
double Thickness = dim.z();
xml_dim_t pos = x_det.position();
xml_dim_t rot = x_det.rotation();
Material Vacuum = desc.material("Vacuum");
xml_comp_t mod = x_det.child(_Unicode(module));
string modName = mod.nameStr();
Material mPbWO4 = desc.material(mod.materialStr());
double mThickness = mod.attr<double>(_Unicode(thickness));
double mWidth = mod.attr<double>(_Unicode(width));
double mGap = mod.attr<double>(_Unicode(gap));
int mNTowers = mod.attr<double>(_Unicode(ntower));
// Create Global Volume
Box ffi_ZDC_GVol_Solid(Width * 0.5, Width * 0.5, Thickness * 0.5);
Volume detVol("ffi_ZDC_GVol_Logic", ffi_ZDC_GVol_Solid, Vacuum);
detVol.setVisAttributes(desc.visAttributes(x_det.visStr()));
// Construct Tower
// Single Module
Box ffi_ZDC_ECAL_Solid_Tower(mWidth * 0.5, mWidth * 0.5, mThickness * 0.5);
Volume modVol("ffi_ZDC_ECAL_Logic_Tower", ffi_ZDC_ECAL_Solid_Tower, mPbWO4);
modVol.setVisAttributes(desc.visAttributes(mod.visStr()));
sens.setType("calorimeter");
modVol.setSensitiveDetector(sens);
// Module Position
double mod_x = 0.0 * mm;
double mod_y = 0.0 * mm;
double mod_z = -1.0 * Thickness / 2.0 + mThickness / 2.0 + 2.0 * mm;
int k = -1;
// Place Modules
for (int j = 0; j < mNTowers; j++) {
if (j == 0)
mod_y = Width / 2.0 - mWidth / 2.0 - mGap;
else
mod_y -= (mWidth + mGap);
if (abs(mod_y + mWidth / 2.0) > Width / 2.0)
continue;
mod_x = Width / 2.0 - (mWidth + mGap) * 0.5;
for (int i = 0; i < mNTowers; i++) {
if (i > 0)
mod_x -= (mWidth + mGap);
if (abs(mod_x + mWidth / 2.0) > Width / 2.0)
continue;
k++;
string module_name = detName + _toString(k,"_ECAL_Phys_%d");
PlacedVolume pv_mod = detVol.placeVolume(modVol, Position(mod_x,mod_y,mod_z));
pv_mod.addPhysVolID("module",k+1);
}
}
DetElement det(detName, detID);
Volume motherVol = desc.pickMotherVolume(det);
Transform3D tr(RotationZYX(rot.z(), -rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z()));
PlacedVolume detPV = motherVol.placeVolume(detVol, tr);
detPV.addPhysVolID("system", detID);
det.setPlacement(detPV);
return det;
}
DECLARE_DETELEMENT(ffi_ZDC_ECAL, createDetector)
#include "DDRec/Surface.h"
#include "DDRec/DetectorData.h"
#include "DD4hep/OpticalSurfaces.h"
#include "DD4hep/DetFactoryHelper.h"
#include "DD4hep/Printout.h"
#include <XML/Helper.h>
#include <XML/Layering.h>
//////////////////////////////////////////////////
// Far Forward Ion Zero Degree Calorimeter - Hcal
//////////////////////////////////////////////////
using namespace std;
using namespace dd4hep;
static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens)
{
xml_det_t x_det = e;
string detName = x_det.nameStr();
int detID = x_det.id();
xml_dim_t dim = x_det.dimensions();
double Width = dim.x();
double Length = dim.z();
xml_dim_t pos = x_det.position();
double z = pos.z();
xml_dim_t rot = x_det.rotation();
Material Vacuum = desc.material("Vacuum");
int layer_num = 1;
int slice_num = 1;
double totWidth = Layering(x_det).totalThickness();
Box envelope (Width/2.0, Width/2.0, totWidth/2.0);
Volume envelopeVol(detName+"_envelope", envelope, Vacuum);
envelopeVol.setVisAttributes(desc.visAttributes(x_det.visStr()));
PlacedVolume pv;
xml_comp_t x_layer = x_det.child(_U(layer));
// Read layers
for(xml_coll_t c(x_det,_U(layer)); c; ++c) {
xml_comp_t x_layer = c;
int repeat = x_layer.repeat();
double layerWidth = 0;
for(xml_coll_t l(x_layer,_U(slice)); l; ++l)
layerWidth += xml_comp_t(l).thickness();
// Loop over repeat#
for(int i=0; i< repeat; i++) {
double zlayer = z;
string layer_name = detName + _toString(layer_num,"_layer%d");
Volume layer_vol(layer_name,Box(Width/2.0, Width/2.0,layerWidth/2.0), Vacuum);
// Loop over slices
for(xml_coll_t l(x_layer,_U(slice)); l; ++l) {
xml_comp_t x_slice = l;
double w = x_slice.thickness();
string slice_name = layer_name + _toString(slice_num,"slice%d");
Material slice_mat = desc.material(x_slice.materialStr());
Volume slice_vol (slice_name,Box(Width/2.0, Width/2.0,w/2.0),slice_mat);
if(x_slice.isSensitive()) {
sens.setType("calorimeter");
slice_vol.setSensitiveDetector(sens);
}
slice_vol.setAttributes(desc,x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr());
pv = layer_vol.placeVolume(slice_vol, Transform3D(RotationZYX(0, 0, 0),Position(0.0,0.0,z-zlayer-layerWidth/2.0+w/2.0)));
pv.addPhysVolID("slice", slice_num);
z += w;
++slice_num;
}
string layer_vis = dd4hep::getAttrOrDefault(x_layer, _Unicode(vis), "InvisibleWithDaughters");
layer_vol.setAttributes(desc, x_layer.regionStr(), x_layer.limitsStr(), layer_vis);
pv = envelopeVol.placeVolume(layer_vol, Transform3D(RotationZYX(0, 0, 0), Position(0,0,zlayer-pos.z()-totWidth/2.0+layerWidth/2.0)));
pv.addPhysVolID("layer", layer_num);
++layer_num;
}
}
DetElement det(detName, detID);
Volume motherVol = desc.pickMotherVolume(det);
Transform3D tr(RotationZYX(rot.z(), -rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z() + totWidth/2.0));
PlacedVolume phv = motherVol.placeVolume(envelopeVol, tr);
phv.addPhysVolID("system", detID);
det.setPlacement(phv);
return det;
}
DECLARE_DETELEMENT(ffi_ZDC_HCAL, createDetector)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment