Skip to content

Commit

Permalink
Renamed DDDRCaloTubes to DRBarrelTubes for consistency with endcaps
Browse files Browse the repository at this point in the history
  • Loading branch information
s6anloes committed Dec 9, 2024
1 parent 55dba8b commit 6d23cbe
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/compact/1.0/compact.xsd">-->

<info name="DDDRCaloTubes"
<info name="DRBarrelTubes"
title=""
author="Andreas Loeschcke Centeno"
status="development"
Expand Down Expand Up @@ -238,10 +238,10 @@

<detectors>
<detector
name="DDDRCaloTubes"
type="DDDRCaloTubes"
name="DRBarrelTubes"
type="DRBarrelTubes"
id="DetID_DRBarrelTubes"
readout="MyReadout"
readout="DRBarrelTubeRO"
vis="DRBTVis" >

<type_flags type=" DetType_CALORIMETER + DetType_ELECTROMAGNETIC + DetType_BARREL"/>
Expand Down Expand Up @@ -270,7 +270,7 @@
</detectors>

<readouts>
<readout name="MyReadout">
<readout name="DRBarrelTubeRO">
<!-- NO SPACES BETWEEN ID DESCRIPTORS!!! -->
<id>system:5,stave:10,tower:-8,air:1,col:-11,row:7,clad:1,core:1,cherenkov:1</id>

Expand Down
2 changes: 1 addition & 1 deletion FCCee/IDEA/compact/IDEA_o2_v01/IDEA_o2_v01.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<include ref="DREndcapTubes_o1_v01.xml"/>

<!-- Import tubes-based dual-readout barrel calorimeter -->
<include ref="DDDRCaloTubes_o1_v01.xml"/>
<include ref="DRBarrelTubes_o1_v01.xml"/>

<!-- Import muon system -->
<include ref="../IDEA_o1_v03/MuonSystem_o1_v01.xml"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

using namespace dd4hep;

namespace DDDRCaloTubes {
namespace DRBarrelTubes {

class DRTubesconstructor {
public:
Expand Down Expand Up @@ -165,6 +165,6 @@ class DRTubesconstructor {

};

} // namespace DDDRCaloTubes
} // namespace DRBarrelTubes

#endif // DRCONSTRUCTOR_H
4 changes: 2 additions & 2 deletions detector/calorimeter/dual-readout-tubes/include/DRutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using namespace dd4hep;


// Utility functions for the construction of the barrel dual-readout calorimeter (based on tubes)
namespace DDDRCaloTubes
namespace DRBarrelTubes
{
// Quick rounding functions
int fast_floor(double x);
Expand All @@ -22,6 +22,6 @@ namespace DDDRCaloTubes
std::vector<double> get_plane_equation(const Position& point1, const Position& point2, const Position& point3);
Position get_intersection(const std::vector<double>& plane_coefficients, const Position& line_point, const Direction& line_direction);
Position get_intersection(const Direction& plane_normal, const Position& plane_point, const Position& line_point, const Direction& line_direction);
} // namespace DDDRCaloTubes
} // namespace DRBarrelTubes

#endif // DRutils_h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static Ref_t create_detector(Detector& description,
Volume mother_volume = description.pickMotherVolume(s_detElement);

// Helper class to construct the calorimeter
DDDRCaloTubes::DRTubesconstructor constructor(&description, entities, &sens);
DRBarrelTubes::DRTubesconstructor constructor(&description, entities, &sens);
constructor.construct_calorimeter(barrel_volume);


Expand All @@ -54,4 +54,4 @@ static Ref_t create_detector(Detector& description,
}


DECLARE_DETELEMENT(DDDRCaloTubes,create_detector)
DECLARE_DETELEMENT(DRBarrelTubes,create_detector)
28 changes: 14 additions & 14 deletions detector/calorimeter/dual-readout-tubes/src/DRTubesconstructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#include <TMatrixD.h>

using namespace dd4hep;
using namespace DDDRCaloTubes;
using namespace DRBarrelTubes;

DDDRCaloTubes::DRTubesconstructor::DRTubesconstructor(Detector* description,
DRBarrelTubes::DRTubesconstructor::DRTubesconstructor(Detector* description,
xml_h& entities,
SensitiveDetector* sens):
m_entities(entities)
Expand Down Expand Up @@ -96,7 +96,7 @@ DDDRCaloTubes::DRTubesconstructor::DRTubesconstructor(Detector* description,
}

// Function to calculate all tower parameters which are derived from user given values
void DDDRCaloTubes::DRTubesconstructor::calculate_tower_parameters()
void DRBarrelTubes::DRTubesconstructor::calculate_tower_parameters()
{
// Angle where endcap and barrel meet
m_barrel_endcap_angle = std::atan2(m_calo_inner_half_z, m_calo_inner_r);
Expand Down Expand Up @@ -156,7 +156,7 @@ void DDDRCaloTubes::DRTubesconstructor::calculate_tower_parameters()
}

// Function to calculate tower parameters specifically for phi direction
void DDDRCaloTubes::DRTubesconstructor::calculate_phi_parameters()
void DRBarrelTubes::DRTubesconstructor::calculate_phi_parameters()
{
double num_phi_towers_d = 360.0*deg/m_tower_phi;
if (num_phi_towers_d < 0.0) throw std::runtime_error("Negative tower phi coverage not allowed");
Expand Down Expand Up @@ -195,7 +195,7 @@ void DDDRCaloTubes::DRTubesconstructor::calculate_phi_parameters()
Anytime a variable contains "edge" it refers to the edge that would be running in y direction in this sketch with global coordinates
(but is the x direction in the local coordinate system of the Trap volume).
*/
void DDDRCaloTubes::DRTubesconstructor::calculate_theta_parameters()
void DRBarrelTubes::DRTubesconstructor::calculate_theta_parameters()
{
// How much the front faces of the already placed towers cover in global z direction in the global coordinate system
double covered_z = std::tan(m_covered_theta)*m_calo_inner_r;
Expand Down Expand Up @@ -272,7 +272,7 @@ void DDDRCaloTubes::DRTubesconstructor::calculate_theta_parameters()

// Check if tube of this (half-)length already exists, if not, create it
// and store it in the corresponding volume map
void DDDRCaloTubes::DRTubesconstructor::assert_tube_existence(int key, bool cher)
void DRBarrelTubes::DRTubesconstructor::assert_tube_existence(int key, bool cher)
{
std::unordered_map<int, Volume>* tube_volume_map;

Expand Down Expand Up @@ -342,7 +342,7 @@ void DDDRCaloTubes::DRTubesconstructor::assert_tube_existence(int key, bool cher

// Similar to calculate_tower_width (see abelow), but for the encasing trapezoid support volume
// Width is calculated for any given point in th z-y plane
double DDDRCaloTubes::DRTubesconstructor::calculate_trap_width(double given_y, double given_z, bool backface)
double DRBarrelTubes::DRTubesconstructor::calculate_trap_width(double given_y, double given_z, bool backface)
{
// Calculate width (x_direction) of trapezoid at given y
// Assuming y=0 corresponds to right angle edge of the tower
Expand Down Expand Up @@ -384,7 +384,7 @@ double DDDRCaloTubes::DRTubesconstructor::calculate_trap_width(double given_y, d
|______> x
/
|/_ z */
double DDDRCaloTubes::DRTubesconstructor::calculate_tower_width(int given_row, bool backface)
double DRBarrelTubes::DRTubesconstructor::calculate_tower_width(int given_row, bool backface)
{
// Calculate width (x_direction) of tower at given row
// Assuming row 0 is at the right angle edge
Expand All @@ -404,7 +404,7 @@ double DDDRCaloTubes::DRTubesconstructor::calculate_tower_width(int given_row, b


// Place all tubes which make up the tower
void DDDRCaloTubes::DRTubesconstructor::assemble_tower(Volume& tower_air_volume)
void DRBarrelTubes::DRTubesconstructor::assemble_tower(Volume& tower_air_volume)
{
// Y-distance of rightangle wall from coordinate system origin
// Used throughout this function
Expand Down Expand Up @@ -619,7 +619,7 @@ void DDDRCaloTubes::DRTubesconstructor::assemble_tower(Volume& tower_air_volume)


// Function to calculate the position of the tower inside the stave
void DDDRCaloTubes::DRTubesconstructor::calculate_tower_position()
void DRBarrelTubes::DRTubesconstructor::calculate_tower_position()
{
// Since the Trapezoids are defined including polar and azimuthal angles, we need to convert between cartesian and polar coordinates
double trap_centre_r = m_trap_half_length/std::cos(m_trap_polar_angle);
Expand All @@ -645,7 +645,7 @@ void DDDRCaloTubes::DRTubesconstructor::calculate_tower_position()


// Function to construct the trapezoidal supoprt structure for the tower in which fibres are placed
void DDDRCaloTubes::DRTubesconstructor::construct_tower_trapezoid(Volume& trap_volume)
void DRBarrelTubes::DRTubesconstructor::construct_tower_trapezoid(Volume& trap_volume)
{
// Coordinate conversion, since the Trap volume uses polar coordinates
double delta_y = (m_trap_backface_y - m_trap_frontface_y)/2.0;
Expand Down Expand Up @@ -695,7 +695,7 @@ void DDDRCaloTubes::DRTubesconstructor::construct_tower_trapezoid(Volume& trap_v
}


void DDDRCaloTubes::DRTubesconstructor::construct_tower(Volume& trap_volume)
void DRBarrelTubes::DRTubesconstructor::construct_tower(Volume& trap_volume)
{
// For each placed tower, recalculate the parameters
this->calculate_theta_parameters();
Expand All @@ -706,7 +706,7 @@ void DDDRCaloTubes::DRTubesconstructor::construct_tower(Volume& trap_volume)

// Placement of the tower in the stave volume
// One tower is being placed twice, once in the forward and once in the backward region
void DDDRCaloTubes::DRTubesconstructor::place_tower(Volume& stave_volume,
void DRBarrelTubes::DRTubesconstructor::place_tower(Volume& stave_volume,
Volume& tower_volume,
unsigned int tower)
{
Expand Down Expand Up @@ -735,7 +735,7 @@ void DDDRCaloTubes::DRTubesconstructor::place_tower(Volume& stave_volume,
// Highest level function to construct the calorimeter
// In first loop all the towers are created and placed inside a stave
// In the second loop the staves are placed in the calorimeter
void DDDRCaloTubes::DRTubesconstructor::construct_calorimeter(Volume& calorimeter_volume)
void DRBarrelTubes::DRTubesconstructor::construct_calorimeter(Volume& calorimeter_volume)
{
// Parameters for stave contruction. Shape is a trapezoid over the full barrel region (forward and backward)
double dy1 = m_calo_inner_half_z;
Expand Down
4 changes: 2 additions & 2 deletions detector/calorimeter/dual-readout-tubes/src/DRutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using namespace dd4hep;

namespace DDDRCaloTubes
namespace DRBarrelTubes
{
// Fast rounding function which do not do some safety checks the std:: functions provide, since we don't expect problems with the input
int fast_floor(double x)
Expand Down Expand Up @@ -55,4 +55,4 @@ namespace DDDRCaloTubes
return intersection;
}

} // namespace DDDRCaloTubes
} // namespace DRBarrelTubes

0 comments on commit 6d23cbe

Please sign in to comment.