From a172b9f1d69ba46a46386585f84f3414611274ce Mon Sep 17 00:00:00 2001 From: Swathi Sasikumar Date: Fri, 26 Jul 2024 13:17:30 +0200 Subject: [PATCH 1/4] Include the layered calorimeter data part from version 1 for Pandora PFA --- ...leLiquid_InclinedTrapezoids_o1_v01_geo.cpp | 4 +- ...leLiquid_InclinedTrapezoids_o1_v03_geo.cpp | 64 +++++++++++++++++++ 2 files changed, 66 insertions(+), 2 deletions(-) diff --git a/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v01_geo.cpp b/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v01_geo.cpp index 2f3777384..193f46a4c 100644 --- a/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v01_geo.cpp +++ b/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v01_geo.cpp @@ -624,8 +624,8 @@ static dd4hep::detail::Ref_t createECalBarrelInclined(dd4hep::Detector& aLcdd, caloLayer.outer_thickness = difference_bet_r1r2 / 2; caloLayer.absorberThickness = absorberThickness; - caloLayer.cellSize0 = 2 * dd4hep::mm; - caloLayer.cellSize1 = 2 * dd4hep::mm; + caloLayer.cellSize0 = 20 * dd4hep::mm; + caloLayer.cellSize1 = 20 * dd4hep::mm; caloData->layers.push_back(caloLayer); } diff --git a/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v03_geo.cpp b/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v03_geo.cpp index 288b8c158..e7593d885 100644 --- a/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v03_geo.cpp +++ b/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v03_geo.cpp @@ -687,8 +687,72 @@ static dd4hep::detail::Ref_t createECalBarrelInclined(dd4hep::Detector& aLcdd, caloData->layoutType = dd4hep::rec::LayeredCalorimeterData::BarrelLayout; caloDetElem.addExtension(caloData); + caloData->extent[0] = Rmin; + caloData->extent[1] = Rmax; // or r_max ? + caloData->extent[2] = 0.; // NN: for barrel detectors this is 0 + caloData->extent[3] = caloDim.dz(); + + // Set type flags dd4hep::xml::setDetectorTypeFlag(xmlDetElem, caloDetElem); + dd4hep::rec::MaterialManager matMgr(envelopeVol); + dd4hep::rec::LayeredCalorimeterData::Layer caloLayer; + + double rad_first = Rmin; + double rad_last = 0; + double scale_fact = dR / (-Rmin * cos(angle) + sqrt(pow(Rmax, 2) - pow(Rmin * sin(angle), 2))); + // since the layer height is given along the electrode and not along the radius it needs to be scaled to get the values of layer height radially + std::cout << "Scaling factor " << scale_fact << std::endl; + for (size_t il = 0; il < layerHeight.size(); il++) { + double thickness_sen = 0.; + double absorberThickness = 0.; + + rad_last = rad_first + (layerHeight[il] * scale_fact); + dd4hep::rec::Vector3D ivr1 = dd4hep::rec::Vector3D(0., rad_first, 0); // defining starting vector points of the given layer + dd4hep::rec::Vector3D ivr2 = dd4hep::rec::Vector3D(0., rad_last, 0); // defining end vector points of the given layer + + std::cout << "radius first " << rad_first << " radius last " << rad_last << std::endl; + const dd4hep::rec::MaterialVec &materials = matMgr.materialsBetween(ivr1, ivr2); // calling material manager to get material info between two points + auto mat = matMgr.createAveragedMaterial(materials); // creating average of all the material between two points to calculate X0 and lambda of averaged material + const double nRadiationLengths = mat.radiationLength(); + const double nInteractionLengths = mat.interactionLength(); + const double difference_bet_r1r2 = (ivr1 - ivr2).r(); + const double value_of_x0 = layerHeight[il] / nRadiationLengths; + const double value_of_lambda = layerHeight[il] / nInteractionLengths; + std::string str1("LAr"); + + for (size_t imat = 0; imat < materials.size(); imat++) { + + std::string str2(materials.at(imat).first.name()); + if (str1.compare(str2) == 0){ + thickness_sen += materials.at(imat).second; + } + else { + absorberThickness += materials.at(imat).second; + } + } + rad_first = rad_last; + std::cout << "The sensitive thickness is " << thickness_sen << std::endl; + std::cout << "The absorber thickness is " << absorberThickness << std::endl; + std::cout << "The radiation length is " << value_of_x0 << " and the interaction length is " << value_of_lambda << std::endl; + + caloLayer.distance = rad_first; + caloLayer.sensitive_thickness = thickness_sen; + caloLayer.inner_nRadiationLengths = value_of_x0 / 2.0; + caloLayer.inner_nInteractionLengths = value_of_lambda / 2.0; + caloLayer.inner_thickness = difference_bet_r1r2 / 2.0; + + caloLayer.outer_nRadiationLengths = value_of_x0 / 2.0; + caloLayer.outer_nInteractionLengths = value_of_lambda / 2.0; + caloLayer.outer_thickness = difference_bet_r1r2 / 2; + + caloLayer.absorberThickness = absorberThickness; + caloLayer.cellSize0 = 20 * dd4hep::mm; + caloLayer.cellSize1 = 20 * dd4hep::mm; + + caloData->layers.push_back(caloLayer); + } + return caloDetElem; } From 9bd98551592d075e8bd02119de6a54af9ef75b41 Mon Sep 17 00:00:00 2001 From: Swathi Sasikumar Date: Fri, 26 Jul 2024 16:42:28 +0200 Subject: [PATCH 2/4] update the LAr ECal barrel xml file to the latest version --- .../CLD/compact/CLD_o4_v05/LAr_ECalBarrel.xml | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/FCCee/CLD/compact/CLD_o4_v05/LAr_ECalBarrel.xml b/FCCee/CLD/compact/CLD_o4_v05/LAr_ECalBarrel.xml index 55519bd5a..30dcef57a 100644 --- a/FCCee/CLD/compact/CLD_o4_v05/LAr_ECalBarrel.xml +++ b/FCCee/CLD/compact/CLD_o4_v05/LAr_ECalBarrel.xml @@ -45,13 +45,13 @@ - - - + + + - + @@ -71,7 +71,6 @@ - @@ -82,21 +81,21 @@ - - - system:5,cryo:1,type:3,subtype:3,layer:8,module:11,eta:9 + + + system:4,cryo:1,type:3,subtype:3,layer:8,module:11,eta:9 - - - system:5,cryo:1,type:3,subtype:3,layer:8,eta:9,phi:10 + + + system:4,cryo:1,type:3,subtype:3,layer:8,eta:9,phi:10 - + From fec3b6ac0b564ab6dc33acb27033f95af675a212 Mon Sep 17 00:00:00 2001 From: Swathi Sasikumar Date: Mon, 29 Jul 2024 11:33:28 +0200 Subject: [PATCH 3/4] Update ECalBarrel_NobelLiquid_InclinedTrapezoid_o1_v02_geo.cpp with layered calo data information for Pandora --- ...leLiquid_InclinedTrapezoids_o1_v02_geo.cpp | 63 ++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v02_geo.cpp b/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v02_geo.cpp index bdb269ed6..6d9525da3 100644 --- a/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v02_geo.cpp +++ b/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v02_geo.cpp @@ -656,9 +656,70 @@ static dd4hep::detail::Ref_t createECalBarrelInclined(dd4hep::Detector& aLcdd, caloData->layoutType = dd4hep::rec::LayeredCalorimeterData::BarrelLayout; caloDetElem.addExtension(caloData); + caloData->extent[0] = Rmin; + caloData->extent[1] = Rmax; // or r_max ? + caloData->extent[2] = 0.; // NN: for barrel detectors this is 0 + caloData->extent[3] = caloDim.dz(); + // Set type flags dd4hep::xml::setDetectorTypeFlag(xmlDetElem, caloDetElem); - + dd4hep::rec::MaterialManager matMgr(envelopeVol); + dd4hep::rec::LayeredCalorimeterData::Layer caloLayer; + + double rad_first = Rmin; + double rad_last = 0; + double scale_fact = dR / (-Rmin * cos(angle) + sqrt(pow(Rmax, 2) - pow(Rmin * sin(angle), 2))); + // since the layer height is given along the electrode and not along the radius it needs to be scaled to get the values of layer height radially + std::cout << "Scaling factor " << scale_fact << std::endl; + for (size_t il = 0; il < layerHeight.size(); il++) { + double thickness_sen = 0.; + double absorberThickness = 0.; + + rad_last = rad_first + (layerHeight[il] * scale_fact); + dd4hep::rec::Vector3D ivr1 = dd4hep::rec::Vector3D(0., rad_first, 0); // defining starting vector points of the given layer + dd4hep::rec::Vector3D ivr2 = dd4hep::rec::Vector3D(0., rad_last, 0); // defining end vector points of the given layer + + std::cout << "radius first " << rad_first << " radius last " << rad_last << std::endl; + const dd4hep::rec::MaterialVec &materials = matMgr.materialsBetween(ivr1, ivr2); // calling material manager to get material info between two points + auto mat = matMgr.createAveragedMaterial(materials); // creating average of all the material between two points to calculate X0 and lambda of averaged material + const double nRadiationLengths = mat.radiationLength(); + const double nInteractionLengths = mat.interactionLength(); + const double difference_bet_r1r2 = (ivr1 - ivr2).r(); + const double value_of_x0 = layerHeight[il] / nRadiationLengths; + const double value_of_lambda = layerHeight[il] / nInteractionLengths; + std::string str1("LAr"); + + for (size_t imat = 0; imat < materials.size(); imat++) { + + std::string str2(materials.at(imat).first.name()); + if (str1.compare(str2) == 0){ + thickness_sen += materials.at(imat).second; + } + else { + absorberThickness += materials.at(imat).second; + } + } + rad_first = rad_last; + std::cout << "The sensitive thickness is " << thickness_sen << std::endl; + std::cout << "The absorber thickness is " << absorberThickness << std::endl; + std::cout << "The radiation length is " << value_of_x0 << " and the interaction length is " << value_of_lambda << std::endl; + + caloLayer.distance = rad_first; + caloLayer.sensitive_thickness = thickness_sen; + caloLayer.inner_nRadiationLengths = value_of_x0 / 2.0; + caloLayer.inner_nInteractionLengths = value_of_lambda / 2.0; + caloLayer.inner_thickness = difference_bet_r1r2 / 2.0; + + caloLayer.outer_nRadiationLengths = value_of_x0 / 2.0; + caloLayer.outer_nInteractionLengths = value_of_lambda / 2.0; + caloLayer.outer_thickness = difference_bet_r1r2 / 2; + + caloLayer.absorberThickness = absorberThickness; + caloLayer.cellSize0 = 20 * dd4hep::mm; + caloLayer.cellSize1 = 20 * dd4hep::mm; + + caloData->layers.push_back(caloLayer); + } return caloDetElem; } } // namespace det From 8824bac75db34016bb3e24a19838753a770e6a4b Mon Sep 17 00:00:00 2001 From: Swathi Sasikumar Date: Tue, 30 Jul 2024 11:28:57 +0200 Subject: [PATCH 4/4] Add MaterialManager and Vector3D headers to both the versions of LAr ECAL --- .../ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v02_geo.cpp | 2 ++ .../ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v03_geo.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v02_geo.cpp b/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v02_geo.cpp index 6d9525da3..8299b6bd1 100644 --- a/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v02_geo.cpp +++ b/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v02_geo.cpp @@ -1,6 +1,8 @@ #include "DD4hep/DetFactoryHelper.h" #include "DD4hep/Handle.h" #include "XML/Utilities.h" +#include "DDRec/MaterialManager.h" +#include "DDRec/Vector3D.h" #include diff --git a/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v03_geo.cpp b/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v03_geo.cpp index e7593d885..330f5162a 100644 --- a/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v03_geo.cpp +++ b/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v03_geo.cpp @@ -1,6 +1,8 @@ #include "DD4hep/DetFactoryHelper.h" #include "DD4hep/Handle.h" #include "XML/Utilities.h" +#include "DDRec/MaterialManager.h" +#include "DDRec/Vector3D.h" #include