diff --git a/Detectors/Upgrades/ITS3/base/include/ITS3Base/SpecsV2.h b/Detectors/Upgrades/ITS3/base/include/ITS3Base/SpecsV2.h index 83db7632e72f4..cb6af1dcfc5b7 100644 --- a/Detectors/Upgrades/ITS3/base/include/ITS3Base/SpecsV2.h +++ b/Detectors/Upgrades/ITS3/base/include/ITS3Base/SpecsV2.h @@ -147,8 +147,7 @@ namespace apts { constexpr double pitchX{15.0 * mu}; constexpr double pitchZ{15.0 * mu}; -constexpr double responseUpperLimit{10 * mu}; -constexpr double responseYShift{responseUpperLimit - silicon::thicknessOut}; +constexpr double responseYShift{15.5 * mu}; } // namespace apts namespace moss { diff --git a/Detectors/Upgrades/ITS3/macros/test/CheckClustersITS3.C b/Detectors/Upgrades/ITS3/macros/test/CheckClustersITS3.C index 006271a1ea7bd..f245a047377ae 100644 --- a/Detectors/Upgrades/ITS3/macros/test/CheckClustersITS3.C +++ b/Detectors/Upgrades/ITS3/macros/test/CheckClustersITS3.C @@ -225,28 +225,33 @@ void CheckClustersITS3(const std::string& clusfile = "o2clus_its.root", locH = gman->getMatrixL2G(chipID) ^ (hit.GetPos()); // inverse conversion from global to local locHsta = gman->getMatrixL2G(chipID) ^ (hit.GetPosStart()); - float x0 = locHsta.X(), dltx = locH.X() - x0; - float y0 = locHsta.Y(), dlty = locH.Y() - y0; - float z0 = locHsta.Z(), dltz = locH.Z() - z0; - auto r = (0.5 * (Segmentation::SensorLayerThickness - Segmentation::SensorLayerThicknessEff) - y0) / dlty; - - if (!isIB) { - locH.SetXYZ(x0 + r * dltx, y0 + r * dlty, z0 + r * dltz); + float x0, y0, z0, dltx, dlty, dltz, r; + if (isIB) { + float xFlat{0.}, yFlat{0.}; + mMosaixSegmentations[layer].curvedToFlat(locC.X(), locC.Y(), xFlat, yFlat); + locC.SetCoordinates(xFlat, yFlat, locC.Z()); + mMosaixSegmentations[layer].curvedToFlat(locH.X(), locH.Y(), xFlat, yFlat); + locH.SetCoordinates(xFlat, yFlat, locH.Z()); + mMosaixSegmentations[layer].curvedToFlat(locHsta.X(), locHsta.Y(), xFlat, yFlat); + locHsta.SetCoordinates(xFlat, yFlat, locHsta.Z()); + x0 = locHsta.X(); + dltx = locH.X() - x0; + y0 = locHsta.Y(); + dlty = locH.Y() - y0; + z0 = locHsta.Z(); + dltz = locH.Z() - z0; + r = (o2::its3::constants::pixelarray::pixels::apts::responseYShift - y0) / dlty; } else { - // compare in local flat coordinates - float xFlatEnd{0.}, yFlatEnd{0.}; - mMosaixSegmentations[layer].curvedToFlat(locH.X(), locH.Y(), xFlatEnd, yFlatEnd); - locH.SetXYZ(xFlatEnd, yFlatEnd, locH.Z()); - float xFlatSta{0.}, yFlatSta{0.}; - mMosaixSegmentations[layer].curvedToFlat(locHsta.X(), locHsta.Y(), xFlatSta, yFlatSta); - locHsta.SetXYZ(xFlatSta, yFlatSta, locHsta.Z()); - - // not really precise, but okish - locH.SetXYZ(0.5f * (locH.X() + locHsta.X()), 0.5f * (locH.Y() + locHsta.Y()), 0.5f * (locH.Z() + locHsta.Z())); - - mMosaixSegmentations[layer].curvedToFlat(locC.X(), locC.Y(), xFlatSta, yFlatSta); - locC.SetXYZ(xFlatSta, yFlatSta, locC.Z()); + x0 = locHsta.X(); + dltx = locH.X() - x0; + y0 = locHsta.Y(); + dlty = locH.Y() - y0; + z0 = locHsta.Z(); + dltz = locH.Z() - z0; + r = (0.5 * (Segmentation::SensorLayerThickness - Segmentation::SensorLayerThicknessEff) - y0) / dlty; } + locH.SetXYZ(x0 + r * dltx, y0 + r * dlty, z0 + r * dltz); + float theta = std::acos(gloC.Z() / gloC.Rho()); float eta = -std::log(std::tan(theta / 2)); diff --git a/Detectors/Upgrades/ITS3/macros/test/CreateDictionariesITS3.C b/Detectors/Upgrades/ITS3/macros/test/CreateDictionariesITS3.C index 459e3c59d1e82..c02b4bc238955 100644 --- a/Detectors/Upgrades/ITS3/macros/test/CreateDictionariesITS3.C +++ b/Detectors/Upgrades/ITS3/macros/test/CreateDictionariesITS3.C @@ -33,6 +33,7 @@ #define ENABLE_UPGRADES #include "DetectorsCommonDataFormats/DetID.h" #include "ITSBase/GeometryTGeo.h" +#include "ITS3Base/SpecsV2.h" #include "ITSMFTBase/SegmentationAlpide.h" #include "ITS3Base/SegmentationMosaix.h" #include "DataFormatsITSMFT/CompCluster.h" @@ -94,7 +95,7 @@ void CreateDictionariesITS3(bool saveDeltas = true, TNtuple* nt = nullptr; if (saveDeltas) { fout = TFile::Open("CreateDictionaries.root", "recreate"); - nt = new TNtuple("nt", "hashes ntuple", "hash:layer:chipID:xhf:zhf:xcf:zcf:dx:dz:outlimDx:outlimDz"); + nt = new TNtuple("nt", "hashes ntuple", "hash:layer:chipID:xhf:zhf:xcf:zcf:dx:dz:outlimDx:outlimDz:clusterSize:eta"); } const o2::steer::DigitizationContext* digContext = nullptr; @@ -270,16 +271,34 @@ void CreateDictionariesITS3(bool saveDeltas = true, auto xyzLocE = gman->getMatrixL2G(chipID) ^ (hit.GetPos()); // inverse conversion from global to local auto xyzLocS = gman->getMatrixL2G(chipID) ^ (hit.GetPosStart()); o2::math_utils::Vector3D xyzLocM; - xyzLocM.SetCoordinates(0.5f * (xyzLocE.X() + xyzLocS.X()), 0.5f * (xyzLocE.Y() + xyzLocS.Y()), 0.5f * (xyzLocE.Z() + xyzLocS.Z())); auto locC = o2::its3::TopologyDictionary::getClusterCoordinates(cluster, pattern, false); int layer = gman->getLayer(chipID); + float x0, y0, z0, dltx, dlty, dltz, r; if (ib) { float xFlat{0.}, yFlat{0.}; - mMosaixSegmentations[layer].curvedToFlat(xyzLocM.X(), xyzLocM.Y(), xFlat, yFlat); - xyzLocM.SetCoordinates(xFlat, yFlat, xyzLocM.Z()); mMosaixSegmentations[layer].curvedToFlat(locC.X(), locC.Y(), xFlat, yFlat); locC.SetCoordinates(xFlat, yFlat, locC.Z()); + mMosaixSegmentations[layer].curvedToFlat(xyzLocE.X(), xyzLocE.Y(), xFlat, yFlat); + xyzLocE.SetCoordinates(xFlat, yFlat, xyzLocE.Z()); + mMosaixSegmentations[layer].curvedToFlat(xyzLocS.X(), xyzLocS.Y(), xFlat, yFlat); + xyzLocS.SetCoordinates(xFlat, yFlat, xyzLocS.Z()); + x0 = xyzLocS.X(); + dltx = xyzLocE.X() - x0; + y0 = xyzLocS.Y(); + dlty = xyzLocE.Y() - y0; + z0 = xyzLocS.Z(); + dltz = xyzLocE.Z() - z0; + r = (o2::its3::constants::pixelarray::pixels::apts::responseYShift - y0) / dlty; + } else { + x0 = xyzLocS.X(); + dltx = xyzLocE.X() - x0; + y0 = xyzLocS.Y(); + dlty = xyzLocE.Y() - y0; + z0 = xyzLocS.Z(); + dltz = xyzLocE.Z() - z0; + r = (0.5 * (Segmentation::SensorLayerThickness - Segmentation::SensorLayerThicknessEff) - y0) / dlty; } + xyzLocM.SetXYZ(x0 + r * dltx, y0 + r * dlty, z0 + r * dltz); auto pitchX = (ib) ? o2::its3::SegmentationMosaix::PitchRow : o2::itsmft::SegmentationAlpide::PitchRow; auto pitchZ = (ib) ? o2::its3::SegmentationMosaix::PitchCol : o2::itsmft::SegmentationAlpide::PitchCol; @@ -302,7 +321,13 @@ void CreateDictionariesITS3(bool saveDeltas = true, } } if (saveDeltas) { - nt->Fill(topology.getHash(), layer, chipID, xyzLocM.X(), xyzLocM.Z(), locC.X(), locC.Z(), dX, dZ, outLimitDx, outLimitDz); + auto vectDiff = xyzLocE - xyzLocS; + auto theta = std::acos(vectDiff.Z() / std::hypot(vectDiff.X(), vectDiff.Y(), vectDiff.Z())); + auto eta = -std::log(std::tan(theta / 2)); + if (ib) { + LOGP(info, "Yhit flat start: {}, end: {}, middle: {}", xyzLocS.Y(), xyzLocE.Y(), xyzLocM.Y()); + } + nt->Fill(topology.getHash(), layer, chipID, xyzLocM.X(), xyzLocM.Z(), locC.X(), locC.Z(), dX, dZ, outLimitDx, outLimitDz, pattern.getNPixels(), eta); } } } else { diff --git a/Detectors/Upgrades/ITS3/reconstruction/src/TopologyDictionary.cxx b/Detectors/Upgrades/ITS3/reconstruction/src/TopologyDictionary.cxx index 61ab051ffb565..0d1deb77b7c2e 100644 --- a/Detectors/Upgrades/ITS3/reconstruction/src/TopologyDictionary.cxx +++ b/Detectors/Upgrades/ITS3/reconstruction/src/TopologyDictionary.cxx @@ -13,6 +13,7 @@ #include "ITS3Reconstruction/TopologyDictionary.h" #include "ITS3Base/SegmentationMosaix.h" +#include "ITS3Base/SpecsV2.h" #include "ITSMFTBase/SegmentationAlpide.h" #include "CommonUtils/StringUtils.h" #include @@ -202,6 +203,7 @@ math_utils::Point3D TopologyDictionary::getClusterCoordinates(const itsmft::C auto layer = its3::constants::detID::getDetID2Layer(cl.getSensorID()); mIBSegmentations[layer].detectorToLocalUnchecked(cl.getRow(), cl.getCol(), locCl); locCl.SetX(locCl.X() + this->getXCOG(cl.getPatternID(), true) * its3::SegmentationMosaix::PitchRow); + locCl.SetY(its3::constants::pixelarray::pixels::apts::responseYShift); locCl.SetZ(locCl.Z() + this->getZCOG(cl.getPatternID(), true) * its3::SegmentationMosaix::PitchCol); float xCurved{0.f}, yCurved{0.f}; mIBSegmentations[layer].flatToCurved(locCl.X(), locCl.Y(), xCurved, yCurved);