Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New b0 ecal geo #788

Merged
merged 30 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c7dd754
fix correct rotation
michael-pitt May 10, 2024
0018d13
updated geometry
michael-pitt May 10, 2024
7f1d76b
center B0ECAL around the hadron beampipe
michael-pitt May 10, 2024
a13f1bd
move B0ECAL forward by 15cm
michael-pitt May 10, 2024
aa8d87e
shift b0 had beampipe to x=-16cm
michael-pitt May 10, 2024
756cd96
increase inner radius of B0ECAL
michael-pitt May 10, 2024
8ec3d6b
B0ECAL optimize
michael-pitt May 10, 2024
ec0dbd2
B0ECAL optimize
michael-pitt May 10, 2024
8faf6bd
B0ECAL nominal_z=688cm
michael-pitt May 12, 2024
4a11f27
push B0ECAL back
michael-pitt Jul 9, 2024
32bea92
update geometry
michael-pitt Aug 20, 2024
61c8dd7
shift B0 detector
michael-pitt Aug 24, 2024
98643a0
Merge branch 'main' into New_B0ECAL_geo
michael-pitt Aug 24, 2024
561c161
Merge branch 'main' into New_B0ECAL_geo
michael-pitt Aug 24, 2024
e0b0b29
B0ECAL PWO
michael-pitt Aug 24, 2024
ad06125
B0ECAL fix
michael-pitt Aug 27, 2024
456573d
fix one crystal
michael-pitt Sep 17, 2024
be20747
restore 0.2mm shifts
michael-pitt Sep 21, 2024
4e9f9d9
Merge branch 'main' into New_B0ECAL_geo
michael-pitt Sep 26, 2024
ca78440
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 29, 2024
8e8f9ff
remove overlap, update tracker+ECAL
michael-pitt Oct 14, 2024
67750ac
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 14, 2024
e52d7c5
organize individual placements B0ECAL
michael-pitt Oct 14, 2024
660d5cb
add B0Window + fix const.
michael-pitt Oct 15, 2024
56160d0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 15, 2024
313484f
variable sized tracker layers
michael-pitt Oct 15, 2024
9acffff
Revert "variable sized tracker layers"
veprbl Nov 12, 2024
cb3f552
revert changes to B0 tracker
veprbl Nov 12, 2024
1f0a442
minor indentation nitpicks
veprbl Nov 12, 2024
1badc20
Merge remote-tracking branch 'origin/main' into New_B0ECAL_geo
veprbl Nov 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions compact/definitions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ The unused IDs below are saved for future use.

#### (10-24) Interaction region beamline

- Beampipe ID : 10
- Unused IDs: 11-24
- Beampipe ID : 10-11
- Unused IDs: 12-24

</documentation>
<constant name="BeamPipe_ID" value="10"/>
Expand Down Expand Up @@ -297,6 +297,7 @@ The unused IDs below are saved for future use.
<constant name="B2PF_ID" value="177"/>
<constant name="Q0EF_ID" value="180"/>
<constant name="Q1EF_ID" value="181"/>
<constant name="B0Window_ID" value="182"/>

<documentation>
#### (190-199) Far Backward Beamline Detectors
Expand Down
192 changes: 163 additions & 29 deletions compact/far_forward/B0_ECal.xml

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion compact/far_forward/beampipe_hadron_B0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@
<detectors>

<detector id="BeamPipeB0_ID" name="BeamPipeB0" type="forwardBeamPipeBrazil" vis="BeamPipeVis">
<position x="-0.165*m" y="0*m" z="6.4*m" />
<position x="-0.165*m" y="0*m" z="B0PF_CenterPosition" />
<rotation x="0*rad" y="0*rad" z="0*rad" />
</detector>

<detector id="B0Window_ID" name="B0Window" type="B0Window" material="StainlessSteel" vis="AnlLightGray">
<dimensions r="B0PF_InnerRadius" z="B0Win_thickness" x="1.9*Q0EF_InnerRadius" y="Beampipe_rmax" />
<position x="B0PF_XPosition" y="0" z="B0PF_CenterPosition-B0PF_Length/2.0+B0Win_thickness" />
<rotation x="0*rad" y="0*rad" z="0*rad" />
</detector>
</detectors>


Expand Down
3 changes: 3 additions & 0 deletions compact/far_forward/definitions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
<constant name="B1PF_InnerRadius" value="13.5*cm"/>
<constant name="B1APF_InnerRadius" value="16.8*cm"/>
<constant name="B2PF_InnerRadius" value="20.0*cm"/>

<constant name="B0Win_thickness" value="4.0*mm"/>

<comment>
The inner radii are temporarily enlarged so the inner coils (UnionSolid) are not built with overlapping volumes
Overlapping boolean volumes may cause issues in DAWN view, even if they were good in simulation
Expand Down
5 changes: 0 additions & 5 deletions src/B0ECal_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) {
addModuleNumbers(sector, nmod);
}

for (xml_coll_t disk(plm, _Unicode(disk)); disk; ++disk) {
auto [sector, nmod] = ip6::geo::add_disk(build_module, desc, detVol, disk, sens, sector_id++);
addModuleNumbers(sector, nmod);
}

// position and rotation of parent volume
Volume motherVol = desc.pickMotherVolume(det);
Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z()));
Expand Down
56 changes: 56 additions & 0 deletions src/B0Window_geo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
// Copyright (C) 2022 Dhevan Gangadharan

#include "DD4hep/DetFactoryHelper.h"
#include "DD4hep/Printout.h"
#include "DD4hep/Shapes.h"
#include "DDRec/DetectorData.h"
#include "DDRec/Surface.h"
#include "XML/Layering.h"
#include <XML/Helper.h>

using namespace std;
using namespace dd4hep;

static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector /*sens*/) {

xml_det_t x_det = e;
xml_comp_t x_dim = x_det.dimensions();
xml_comp_t x_pos = x_det.position();
xml_comp_t x_rot = x_det.rotation();
//
string det_name = x_det.nameStr();
string mat_name = dd4hep::getAttrOrDefault<string>(x_det, _U(material), "StainlessSteel");
//
double sizeR = x_dim.r();
double sizeZ = x_dim.z();
double sizeR_el = x_dim.x();
double sizeR_had = x_dim.y();
double posX = x_pos.x();
double posY = x_pos.y();
double posZ = x_pos.z();
double rotX = x_rot.x();
double rotY = x_rot.y();
double rotZ = x_rot.z();

Tube tube(0.0, sizeR, sizeZ);
Tube tube_el(0.0, sizeR_el, sizeZ);
Tube tube_had(0.0, sizeR_had, sizeZ);
SubtractionSolid exit_window(tube, tube_had, Position(0.0, 0.0, 0.0));
exit_window = SubtractionSolid(exit_window, tube_el, Position(-posX, 0.0, 0.0));

Volume vol(det_name + "_vol_ExitWindow", exit_window, description.material(mat_name));
vol.setVisAttributes(description.visAttributes(x_det.visStr()));

Transform3D pos(RotationZYX(rotX, rotY, rotZ), Position(posX, posY, posZ));

DetElement det(det_name, x_det.id());
Volume motherVol = description.pickMotherVolume(det);
PlacedVolume phv = motherVol.placeVolume(vol, pos);

det.setPlacement(phv);

return det;
}

DECLARE_DETELEMENT(B0Window, create_detector)
20 changes: 13 additions & 7 deletions src/forwardBeamPipeBrazil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens *
string det_name = x_det.nameStr();
DetElement sdet(det_name, x_det.id());
Assembly assembly(det_name + "_assembly");
Material m_Al = det.material("Aluminum");
Material m_Be = det.material("Beryllium");
Material m_SS = det.material("StainlessSteel");
Material m_vac = det.material("Vacuum");
string vis_name = x_det.visStr();
Material m_Al = det.material("Aluminum");
Material m_Be = det.material("Beryllium");
Material m_SS = det.material("StainlessSteel");
Material m_vac = det.material("Vacuum");
string vis_name = x_det.visStr();
xml_comp_t x_pos = x_det.position();

PlacedVolume pv_assembly;

Expand Down Expand Up @@ -48,6 +49,10 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens *
-0.0454486856; //This is the angle of the proton orbit from the end of B1APF to the beginning of B2PF
double crossingAngle = -0.025; //relevant for the neutral cone

double b0PFCenter_z =
x_pos
.z(); // location of the center of B0 magnet, used to define the hadron beampipe inside the magnet

double b1APFEndPoint_z =
22062.3828 * dd4hep::mm; //location of proton orbit at b1APF exit -- in mm
double b1APFEndPoint_x = 654.3372 * dd4hep::mm; //location of proton orbit at b1APF exit -- in mm
Expand Down Expand Up @@ -467,8 +472,9 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens *
sdet.setAttributes(det, v_b0_hadron_tube, x_det.regionStr(), x_det.limitsStr(), vis_name);

auto pv_pipe_8 = assembly.placeVolume(
v_b0_hadron_tube,
Transform3D(RotationY(crossingAngle), Position(-16.5, 0.0, 640.0))); // 2353.06094)));
v_b0_hadron_tube, Transform3D(RotationY(crossingAngle),
Position(b0PFCenter_z * sin(crossingAngle), 0.0,
b0PFCenter_z * cos(crossingAngle)))); // 2353.06094)));
pv_pipe_8.addPhysVolID("sector", 1);
DetElement pipe_de_8(sdet, Form("sector_pipe_%d_de", pieceIdx), 1);
pipe_de_8.setPlacement(pv_pipe_6);
Expand Down
14 changes: 7 additions & 7 deletions src/magnetVacuumFF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens *
// that beam pipe geometry
//-------------------------------------------

radii_magnet[0] = 2.9; // cm
lengths_magnet[0] = 120.0; // cm
rotation_magnet[0] = -0.025; // radians
x_elem_magnet[0] = -16.5; // cm
y_elem_magnet[0] = 0.0; // cm
z_elem_magnet[0] = 640.0; // cm
radii_magnet[0] = 2.9; // cm
lengths_magnet[0] = 120.0; // cm
rotation_magnet[0] = -0.025; // radians
x_elem_magnet[0] = 640.0 * sin(-0.025); // cm
y_elem_magnet[0] = 0.0; // cm
z_elem_magnet[0] = 640.0 * cos(-0.025); // cm

//-------------------------------------------
//calculate entrance/exit points of magnets
Expand Down Expand Up @@ -176,7 +176,7 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens *
for (int gapIdx = 0; gapIdx < numGaps; gapIdx++) {

inRadius.push_back(0.0);
outRadius.push_back(radii_magnet[gapIdx + 1]);
outRadius.push_back(radii_magnet[gapIdx]);
phi_initial.push_back(0.0);
phi_final.push_back(2 * M_PI);
nxLow.push_back(-(length_gap[gapIdx] / 2.0) *
Expand Down