diff --git a/Detector/DetCRD/CMakeLists.txt b/Detector/DetCRD/CMakeLists.txt index e8a695c1db6834417602d4901c18a9663c5a98e8..6f874165663fcaadff3b2819f66c730c9763d80b 100644 --- a/Detector/DetCRD/CMakeLists.txt +++ b/Detector/DetCRD/CMakeLists.txt @@ -27,6 +27,7 @@ gaudi_add_module(DetCRD src/Tracker/SiTracker_itkbarrel_v02_geo.cpp src/Tracker/SiTracker_otkbarrel_v01_geo.cpp src/Tracker/SiTracker_otkendcap_v01_geo.cpp + src/Other/ParaffinEndcap_v01.cpp LINK ${DD4hep_COMPONENT_LIBRARIES} DetIdentifier diff --git a/Detector/DetCRD/compact/CRD_common_v01/ParaffinEndcap_v01_01.xml b/Detector/DetCRD/compact/CRD_common_v01/ParaffinEndcap_v01_01.xml new file mode 100644 index 0000000000000000000000000000000000000000..b5c32c1c97272866c07f5d13e83b4917edbadb84 --- /dev/null +++ b/Detector/DetCRD/compact/CRD_common_v01/ParaffinEndcap_v01_01.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<lccdd> + + <define> + <constant name="pos_z" value="562.5*cm"/> + <constant name="shape_rmin" value="65*cm"/> + <constant name="shape_rmax" value="520*cm"/> + <constant name="shape_hz" value="5*cm"/> + </define> + + + <detectors> + <detector id="DetID_WAX_ENDCAP" name="ParaffinEndcap" type="ParaffinEndcap_v01" vis="VisibleGreen" material="ParaffinWax"> + <!-- Use cm as unit if you want to use Pandora for reconstruction --> + <position x="0" y="0" z="pos_z"/> + <dimensions rmin="shape_rmin" rmax="shape_rmax" dz="shape_hz"/> + </detector> + </detectors> + + +</lccdd> diff --git a/Detector/DetCRD/compact/CRD_common_v02/materials.xml b/Detector/DetCRD/compact/CRD_common_v02/materials.xml index a3aa26ae84a0bba980463fb0f013fb4176e1dd94..868157a2ffc7eef086c5e67b8ea27dd7630717ff 100644 --- a/Detector/DetCRD/compact/CRD_common_v02/materials.xml +++ b/Detector/DetCRD/compact/CRD_common_v02/materials.xml @@ -827,6 +827,12 @@ <fraction n="0.895" ref="Al"/> </material> + <material name="ParaffinWax"> + <D value="0.9" unit="g/cm3"/> + <composite n="25" ref="C"/> + <composite n="52" ref="H"/> + </material> + </materials> <surfaces> diff --git a/Detector/DetCRD/compact/TDR_o1_v01/TDR_Dimensions_v01_01.xml b/Detector/DetCRD/compact/TDR_o1_v01/TDR_Dimensions_v01_01.xml index 9fbab6c756c72bf2c7eaf9f9a94464f667895656..07863eea09dd6c56633575cd70c7d16afe7caebf 100644 --- a/Detector/DetCRD/compact/TDR_o1_v01/TDR_Dimensions_v01_01.xml +++ b/Detector/DetCRD/compact/TDR_o1_v01/TDR_Dimensions_v01_01.xml @@ -53,6 +53,7 @@ <constant name="DetID_YOKE_ENDCAP" value=" 31"/> <constant name="DetID_MUON" value=" 10"/> <constant name="DetID_MUON_ENDCAP" value=" 11"/> + <constant name="DetID_WAX_ENDCAP" value=" 12"/> <constant name="DetID_bwd" value="-1"/> <constant name="DetID_barrel" value=" 0"/> diff --git a/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01.xml b/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01.xml index 7c7b2625861114fd9a0810b3548ea4766065d95b..881750ac07571d87ad4dafedaa1cdb6dc53b553b 100644 --- a/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01.xml +++ b/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01.xml @@ -57,6 +57,7 @@ <!--muon detector--> <include ref="../CRD_common_v01/Muon_Barrel_v01_03.xml"/> <include ref="../CRD_common_v01/Muon_Endcap_v01_02.xml"/> + <include ref="../CRD_common_v01/ParaffinEndcap_v01_01.xml"/> <fields> <field name="InnerSolenoid" type="solenoid" diff --git a/Detector/DetCRD/src/Other/ParaffinEndcap_v01.cpp b/Detector/DetCRD/src/Other/ParaffinEndcap_v01.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5f106c9c614da9c4b7f3e98cb62ffc312bdbfe2b --- /dev/null +++ b/Detector/DetCRD/src/Other/ParaffinEndcap_v01.cpp @@ -0,0 +1,64 @@ +#include "DD4hep/DetFactoryHelper.h" +#include "XML/Layering.h" +#include "XML/Utilities.h" +#include "DDRec/DetectorData.h" +#include "DDSegmentation/Segmentation.h" + +#define MYDEBUG(x) std::cout << __FILE__ << ":" << __LINE__ << ": " << x << std::endl; +#define MYDEBUGVAL(x) std::cout << __FILE__ << ":" << __LINE__ << ": " << #x << ": " << x << std::endl; + +using dd4hep::rec::LayeredCalorimeterData; +static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector, + xml_h e, + dd4hep::SensitiveDetector sens) { + + xml_det_t x_det = e; + + std::string det_name = x_det.nameStr(); + std::string det_type = x_det.typeStr(); + MYDEBUGVAL(det_name); + MYDEBUGVAL(det_type); + xml_dim_t pos (x_det.child(_U(position))); + xml_dim_t dim (x_det.child(_U(dimensions))); + + + dd4hep::DetElement sdet("det",1770); + + dd4hep::Material det_mat(theDetector.material("ParaffinWax")); + dd4hep::Volume det_vol(det_name+"_vol", dd4hep::Tube(dim.rmin(), dim.rmax(), dim.dz()), det_mat); + + dd4hep::Transform3D transform(dd4hep::Rotation3D(), + dd4hep::Position(pos.x(),pos.y(),pos.z())); + dd4hep::Transform3D transform_01(dd4hep::Rotation3D(), + dd4hep::Position(pos.x(),pos.y(),-1*pos.z())); + + + //Create caloData object to extend driver with data required for reconstruction + + dd4hep::PlacedVolume pv; + dd4hep::DetElement both_endcap(det_name, x_det.id()); + dd4hep::Volume motherVol = theDetector.pickMotherVolume(both_endcap); + dd4hep::DetElement sdetA = sdet; + dd4hep::Ref_t(sdetA)->SetName((det_name+"_A").c_str()); + dd4hep::DetElement sdetB = sdet.clone(det_name+"_B",1769); + dd4hep::Assembly assembly("assembly"); + pv = assembly.placeVolume(det_vol,transform); + + sdetA.setPlacement(pv); + + pv = assembly.placeVolume(det_vol,transform_01); + + sdetB.setPlacement(pv); + + pv = motherVol.placeVolume(assembly); + both_endcap.setPlacement(pv); + both_endcap.add(sdetA); + both_endcap.add(sdetB); + + MYDEBUG("create_detector DONE. "); + return both_endcap; + + +} + +DECLARE_DETELEMENT(ParaffinEndcap_v01, create_detector) diff --git a/Detector/DetIdentifier/include/DetIdentifier/CEPCConf.h b/Detector/DetIdentifier/include/DetIdentifier/CEPCConf.h index a4c0ec33309b7b753f8e9c4696de6b4fb80fe700..11809c872955fa088e7768dd0ecbb581988610ca 100644 --- a/Detector/DetIdentifier/include/DetIdentifier/CEPCConf.h +++ b/Detector/DetIdentifier/include/DetIdentifier/CEPCConf.h @@ -29,6 +29,7 @@ namespace CEPCConf{ static const int YOKE_ENDCAP = 31; static const int MUON = 10; static const int MUON_ENDCAP = 11; + static const int WAX_ENDCAP = 12; static const int bwd = -1; static const int barrel = 0;