diff --git a/Geometry/VeryForwardData/data/2021/v1/CTPPS_Timing_Stations_Assembly.xml b/Geometry/VeryForwardData/data/2021/v1/CTPPS_Timing_Stations_Assembly.xml index be6209c2aff3d..8b9afff8c16ec 100644 --- a/Geometry/VeryForwardData/data/2021/v1/CTPPS_Timing_Stations_Assembly.xml +++ b/Geometry/VeryForwardData/data/2021/v1/CTPPS_Timing_Stations_Assembly.xml @@ -2,10 +2,10 @@ - - - - + + + + diff --git a/Geometry/VeryForwardGeometryBuilder/interface/DetGeomDesc.h b/Geometry/VeryForwardGeometryBuilder/interface/DetGeomDesc.h index 93061074b2086..73af791612245 100644 --- a/Geometry/VeryForwardGeometryBuilder/interface/DetGeomDesc.h +++ b/Geometry/VeryForwardGeometryBuilder/interface/DetGeomDesc.h @@ -107,6 +107,8 @@ class DetGeomDesc { void print() const; + void invertZSign() { m_trans.SetZ(-m_trans.z()); } + private: void deleteComponents(); // deletes just the first daughters void deepDeleteComponents(); // traverses the tree and deletes all nodes. diff --git a/Geometry/VeryForwardGeometryBuilder/src/DetGeomDescBuilder.cc b/Geometry/VeryForwardGeometryBuilder/src/DetGeomDescBuilder.cc index 1bbe604204591..5e1725410c267 100644 --- a/Geometry/VeryForwardGeometryBuilder/src/DetGeomDescBuilder.cc +++ b/Geometry/VeryForwardGeometryBuilder/src/DetGeomDescBuilder.cc @@ -1,5 +1,6 @@ #include "Geometry/VeryForwardGeometryBuilder/interface/DetGeomDescBuilder.h" +#include "DataFormats/CTPPSDetId/interface/CTPPSDetId.h" #include "DetectorDescription/DDCMS/interface/DDDetector.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -33,8 +34,15 @@ void detgeomdescbuilder::buildDetGeomDescDescendants(DDFilteredView& fv, DetGeom return; do { - // Create node, and add it to the geoInfoParent's list. + // Create node DetGeomDesc* child = new DetGeomDesc(fv, isRun2); + + // legacy Run2 z sign fix for diamond detectors + const auto& detId = child->geographicalID(); + if (isRun2 && detId.subdetId() == CTPPSDetId::sdTimingDiamond) + child->invertZSign(); + + // add the to the geoInfoParent's list. geoInfo->addComponent(child); // Recursion @@ -62,8 +70,15 @@ std::unique_ptr detgeomdescbuilder::buildDetGeomDescFromCompactView // Construct the tree of children geo info (DetGeomDesc). do { - // Create node, and add it to the geoInfoRoot's list. + // Create node DetGeomDesc* child = new DetGeomDesc(fv, isRun2); + + // legacy Run2 z sign fix for diamond detectors + const auto& detId = child->geographicalID(); + if (isRun2 && detId.subdetId() == CTPPSDetId::sdTimingDiamond) + child->invertZSign(); + + // add the node to the geoInfoRoot's list. geoInfoRoot->addComponent(child); } while (fv.next(0)); diff --git a/RecoPPS/ProtonReconstruction/plugins/CTPPSProtonProducer.cc b/RecoPPS/ProtonReconstruction/plugins/CTPPSProtonProducer.cc index cba96e78b40c1..41f538d941fd5 100644 --- a/RecoPPS/ProtonReconstruction/plugins/CTPPSProtonProducer.cc +++ b/RecoPPS/ProtonReconstruction/plugins/CTPPSProtonProducer.cc @@ -411,8 +411,7 @@ void CTPPSProtonProducer::produce(edm::Event &iEvent, const edm::EventSetup &iSe continue; // interpolation from tracking RPs - const double z_ti = - -hGeometry->rpTranslation(tr_ti.rpId()).z(); // the minus sign fixes a bug in the diamond geometry + const double z_ti = hGeometry->rpTranslation(tr_ti.rpId()).z(); const double f_i = (z_ti - z_j) / (z_i - z_j), f_j = (z_i - z_ti) / (z_i - z_j); const double x_inter = f_i * tr_i.x() + f_j * tr_j.x(); const double x_inter_unc_sq = @@ -499,7 +498,7 @@ void CTPPSProtonProducer::produce(edm::Event &iEvent, const edm::EventSetup &iSe // save single-RP results (un-indexed) for (const auto &p : singleRPResultsIndexed) - pOutSingleRP->emplace_back(std::move(p.second)); + pOutSingleRP->emplace_back(p.second); } // dump log diff --git a/Validation/CTPPS/plugins/CTPPSDirectProtonSimulation.cc b/Validation/CTPPS/plugins/CTPPSDirectProtonSimulation.cc index 06d825c6b25b2..1f4cee5a01065 100644 --- a/Validation/CTPPS/plugins/CTPPSDirectProtonSimulation.cc +++ b/Validation/CTPPS/plugins/CTPPSDirectProtonSimulation.cc @@ -458,9 +458,7 @@ void CTPPSDirectProtonSimulation::processProton( const auto &gl_a1 = geometry.localToGlobal(detId, CTPPSGeometry::Vector(1, 0, 0)) - gl_o; const auto &gl_a2 = geometry.localToGlobal(detId, CTPPSGeometry::Vector(0, 1, 0)) - gl_o; - double gl_o_z = gl_o.z(); - if (detId.subdetId() == CTPPSDetId::sdTimingDiamond) - gl_o_z = -gl_o_z; // fix bug in diamond geometry + const double gl_o_z = gl_o.z(); TMatrixD A(3, 3); TVectorD B(3);