Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../DetectorDescription/Schema/DDLSchema.xsd">
<ConstantsSection label="CTPPS_Timing_Stations_Assembly.xml" eval="true">
<!--positions of the stations from the IP5 to the first element of the station-->
<Constant name="CTPPS_Timing_Negative_Station_Position_z_1" value="-215.078*m"/>
<Constant name="CTPPS_Timing_Positive_Station_Position_z_1" value="215.078*m"/>
<Constant name="CTPPS_Timing_Negative_Station_Position_z_2" value="-215.7*m"/>
<Constant name="CTPPS_Timing_Positive_Station_Position_z_2" value="215.7*m"/>
<Constant name="CTPPS_Timing_Negative_Station_Position_z_1" value="+215.078*m"/>
<Constant name="CTPPS_Timing_Positive_Station_Position_z_1" value="-215.078*m"/>
<Constant name="CTPPS_Timing_Negative_Station_Position_z_2" value="+215.700*m"/>
<Constant name="CTPPS_Timing_Positive_Station_Position_z_2" value="-215.700*m"/>
</ConstantsSection>
<PosPartSection label="CTPPS_Timing_Stations_Assembly.xml">
<PosPart copyNumber="22">
Expand Down
2 changes: 2 additions & 0 deletions Geometry/VeryForwardGeometryBuilder/interface/DetGeomDesc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
19 changes: 17 additions & 2 deletions Geometry/VeryForwardGeometryBuilder/src/DetGeomDescBuilder.cc
Original file line number Diff line number Diff line change
@@ -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"

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -62,8 +70,15 @@ std::unique_ptr<DetGeomDesc> 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));

Expand Down
5 changes: 2 additions & 3 deletions RecoPPS/ProtonReconstruction/plugins/CTPPSProtonProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions Validation/CTPPS/plugins/CTPPSDirectProtonSimulation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down