From c8e2c4b0a5ab16ee674bf59f422471861dbab065 Mon Sep 17 00:00:00 2001 From: Giovanni Marchiori Date: Thu, 21 Sep 2023 17:53:11 +0200 Subject: [PATCH] add a comment to the code --- .../src/ECalBarrelInclined_geo.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Detector/DetFCChhECalInclined/src/ECalBarrelInclined_geo.cpp b/Detector/DetFCChhECalInclined/src/ECalBarrelInclined_geo.cpp index d5951922..72a7bb0c 100644 --- a/Detector/DetFCChhECalInclined/src/ECalBarrelInclined_geo.cpp +++ b/Detector/DetFCChhECalInclined/src/ECalBarrelInclined_geo.cpp @@ -186,6 +186,15 @@ static dd4hep::detail::Ref_t createECalBarrelInclined(dd4hep::Detector& aLcdd, uint numPlanes = round(M_PI / asin((passiveThickness + activeThickness + readoutThickness) / (2. * caloDim.rmin() * cos(angle)))); + // The following code checks if the xml geometry file contains a constant defining + // the number of planes in the barrel. In that case, it makes the program abort + // if the number of planes in the xml is different from the one calculated from + // the geometry. This is because the number of plane information (retrieved from the + // xml) is used in other parts of the code (the readout for the FCC-ee ECAL with + // inclined modules). In principle the code above should be refactored so that the number + // of planes is one of the inputs of the calculation and other geometrical parameters + // are adjusted accordingly. This is left for the future, and we use the workaround + // below to enforce for the time being that the number of planes is "correct" int nModules = -1; try { nModules = aLcdd.constant("ECalBarrelNumPlanes"); @@ -199,7 +208,6 @@ static dd4hep::detail::Ref_t createECalBarrelInclined(dd4hep::Detector& aLcdd, // make the code crash (incidentSvc does not work) assert(nModules == numPlanes); } - //std::cout << "Number of modules read from detector metadata and used in readout class: " << m_nModules << std::endl; double dPhi = 2. * M_PI / numPlanes; lLog << MSG::INFO << "number of passive plates = " << numPlanes << " azim. angle difference = " << dPhi << endmsg; lLog << MSG::INFO << " distance at inner radius (cm) = " << 2. * M_PI * caloDim.rmin() / numPlanes << "\n"