CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
RPDisplacementGenerator Class Reference

This class introduces displacements of RP. It actually shifts and rotates PSimHit positions. It doesn't test whether the displaced hit is still on the detector's surface. This check takes place later in the process. It is done via edge effectivity. More...

#include <RPDisplacementGenerator.h>

Public Types

using RotationMatrix = ROOT::Math::Rotation3D
 
using Translation = ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > >
 

Public Member Functions

PSimHit displace (const PSimHit &)
 returns displaced PSimHit More...
 
 RPDisplacementGenerator (const edm::ParameterSet &, RPDetId, const edm::EventSetup &)
 

Static Public Member Functions

static uint32_t rawToDecId (uint32_t raw)
 

Private Member Functions

Local3DPoint displacePoint (const Local3DPoint &)
 displaces a point More...
 

Private Attributes

RPDetId detId_
 ID of the detector. More...
 
bool isOn_
 set to false to bypass displacements More...
 
RotationMatrix rotation_
 
Translation shift_
 displacement More...
 

Detailed Description

This class introduces displacements of RP. It actually shifts and rotates PSimHit positions. It doesn't test whether the displaced hit is still on the detector's surface. This check takes place later in the process. It is done via edge effectivity.

PSimHit points are given in the "local Det frame" (PSimHit.h)

Definition at line 26 of file RPDisplacementGenerator.h.

Member Typedef Documentation

◆ RotationMatrix

using RPDisplacementGenerator::RotationMatrix = ROOT::Math::Rotation3D

Definition at line 28 of file RPDisplacementGenerator.h.

◆ Translation

using RPDisplacementGenerator::Translation = ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double> >

Definition at line 29 of file RPDisplacementGenerator.h.

Constructor & Destructor Documentation

◆ RPDisplacementGenerator()

RPDisplacementGenerator::RPDisplacementGenerator ( const edm::ParameterSet ps,
RPDetId  _detId,
const edm::EventSetup iSetup 
)

Definition at line 19 of file RPDisplacementGenerator.cc.

22  : detId_(_detId) {
23  isOn_ = ps.getParameter<bool>("RPDisplacementOn");
24 
25  // read the alignment correction
27  if (auto rec = iSetup.tryToGet<VeryForwardMisalignedGeometryRecord>()) {
28  iSetup.get<VeryForwardMisalignedGeometryRecord>().get(alignments);
29  }
30 
31  unsigned int decId = rawToDecId(detId_);
32 
33  math::XYZVectorD S_m;
34  RotationMatrix R_m;
35 
36  if (alignments.isValid()) {
37  const CTPPSRPAlignmentCorrectionData &ac = alignments->getFullSensorCorrection(decId);
38  S_m = ac.getTranslation();
39  R_m = ac.getRotationMatrix();
40  } else
41  isOn_ = false;
42 
43  // transform shift and rotation to the local coordinate frame
46  const DetGeomDesc *g = geom->sensor(detId_);
47  const RotationMatrix &R_l = g->rotation();
48  rotation_ = R_l.Inverse() * R_m.Inverse() * R_l;
49  shift_ = R_l.Inverse() * R_m.Inverse() * S_m;
50 
51  LogDebug("RPDisplacementGenerator").log([&](auto &log) {
52  log << " det id = " << decId << ", isOn = " << isOn_ << "\n";
53  if (isOn_) {
54  log << " shift = " << shift_ << "\n";
55  log << " rotation = " << rotation_ << "\n";
56  }
57  });
58 }

References detId_, g, relativeConstraints::geom, edm::EventSetup::get(), get, edm::ParameterSet::getParameter(), CTPPSRPAlignmentCorrectionData::getRotationMatrix(), CTPPSRPAlignmentCorrectionData::getTranslation(), isOn_, dqm-mbProfile::log, LogDebug, rawToDecId(), rotation_, shift_, and edm::EventSetup::tryToGet().

Member Function Documentation

◆ displace()

PSimHit RPDisplacementGenerator::displace ( const PSimHit input)

returns displaced PSimHit

Definition at line 69 of file RPDisplacementGenerator.cc.

69  {
70  if (!isOn_)
71  return input;
72 
73  const Local3DPoint &ep = input.entryPoint(), &xp = input.exitPoint();
74  const Local3DPoint &dep = displacePoint(ep), &dxp = displacePoint(xp);
75 
76  LogDebug("RPDisplacementGenerator::displace\n") << " entry point: " << ep << " -> " << dep << "\n"
77  << " exit point : " << xp << " -> " << dxp << "\n";
78 
79  return PSimHit(dep,
80  dxp,
81  input.pabs(),
82  input.tof(),
83  input.energyLoss(),
84  input.particleType(),
85  input.detUnitId(),
86  input.trackId(),
87  input.thetaAtEntry(),
88  input.phiAtEntry(),
89  input.processType());
90 }

References displacePoint(), SiStripBadComponentsDQMServiceTemplate_cfg::ep, input, isOn_, and LogDebug.

◆ displacePoint()

Local3DPoint RPDisplacementGenerator::displacePoint ( const Local3DPoint p)
private

displaces a point

input is in mm, shifts are in mm too

Definition at line 60 of file RPDisplacementGenerator.cc.

60  {
62 
63  Translation v(p.x(), p.y(), p.z());
64  v = rotation_ * v - shift_;
65 
66  return Local3DPoint(v.x(), v.y(), v.z());
67 }

References AlCaHLTBitMon_ParallelJobs::p, rotation_, shift_, and findQualityFiles::v.

Referenced by displace().

◆ rawToDecId()

uint32_t RPDisplacementGenerator::rawToDecId ( uint32_t  raw)
static

Member Data Documentation

◆ detId_

RPDetId RPDisplacementGenerator::detId_
private

ID of the detector.

Definition at line 40 of file RPDisplacementGenerator.h.

Referenced by RPDisplacementGenerator().

◆ isOn_

bool RPDisplacementGenerator::isOn_
private

set to false to bypass displacements

Definition at line 47 of file RPDisplacementGenerator.h.

Referenced by displace(), and RPDisplacementGenerator().

◆ rotation_

RotationMatrix RPDisplacementGenerator::rotation_
private

Definition at line 44 of file RPDisplacementGenerator.h.

Referenced by displacePoint(), and RPDisplacementGenerator().

◆ shift_

Translation RPDisplacementGenerator::shift_
private

displacement

Definition at line 43 of file RPDisplacementGenerator.h.

Referenced by displacePoint(), and RPDisplacementGenerator().

VeryForwardRealGeometryRecord
Event setup record containing the real (actual) geometry information.
Definition: VeryForwardRealGeometryRecord.h:22
RPDisplacementGenerator::displacePoint
Local3DPoint displacePoint(const Local3DPoint &)
displaces a point
Definition: RPDisplacementGenerator.cc:60
input
static const std::string input
Definition: EdmProvDump.cc:48
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CTPPSRPAlignmentCorrectionData::getTranslation
math::XYZVectorD getTranslation() const
Definition: CTPPSRPAlignmentCorrectionData.h:145
findQualityFiles.v
v
Definition: findQualityFiles.py:179
RotationMatrix
ROOT::Math::Rotation3D RotationMatrix
Definition: PGeometricDetBuilder.cc:21
CTPPSDetId::startArmBit
static const uint32_t startArmBit
Definition: CTPPSDetId.h:49
RPDisplacementGenerator::rawToDecId
static uint32_t rawToDecId(uint32_t raw)
Definition: RPDisplacementGenerator.cc:92
TotemRPDetId::startPlaneBit
static const uint32_t startPlaneBit
Definition: TotemRPDetId.h:46
RPDisplacementGenerator::rotation_
RotationMatrix rotation_
Definition: RPDisplacementGenerator.h:44
edm::EventSetup::tryToGet
std::optional< T > tryToGet() const
Definition: EventSetup.h:101
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
CTPPSDetId::startStationBit
static const uint32_t startStationBit
Definition: CTPPSDetId.h:50
RPDisplacementGenerator::detId_
RPDetId detId_
ID of the detector.
Definition: RPDisplacementGenerator.h:40
edm::ESHandle
Definition: DTSurvey.h:22
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
Point3DBase< float, LocalTag >
RPDisplacementGenerator::isOn_
bool isOn_
set to false to bypass displacements
Definition: RPDisplacementGenerator.h:47
math::XYZVectorD
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > XYZVectorD
spatial vector with cartesian internal representation
Definition: Vector3D.h:8
RPDisplacementGenerator::shift_
Translation shift_
displacement
Definition: RPDisplacementGenerator.h:43
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
DetGeomDesc
Definition: DetGeomDesc.h:49
Translation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > Translation
Definition: PGeometricDetBuilder.cc:20
get
#define get
CTPPSDetId::maskStation
static const uint32_t maskStation
Definition: CTPPSDetId.h:50
VeryForwardMisalignedGeometryRecord
Event setup record containing the misaligned geometry information. It is used for alignment studies o...
Definition: VeryForwardMisalignedGeometryRecord.h:23
CTPPSDetId::startRPBit
static const uint32_t startRPBit
Definition: CTPPSDetId.h:51
CTPPSRPAlignmentCorrectionData::getRotationMatrix
ROOT::Math::Rotation3D getRotationMatrix() const
Definition: CTPPSRPAlignmentCorrectionData.h:149
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
CTPPSRPAlignmentCorrectionData
Alignment correction for an element of the CT-PPS detector. Within the geometry description,...
Definition: CTPPSRPAlignmentCorrectionData.h:58
PSimHit
Definition: PSimHit.h:15
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86
g
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
TotemRPDetId::maskPlane
static const uint32_t maskPlane
Definition: TotemRPDetId.h:46
Local3DPoint
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9
CTPPSDetId::maskArm
static const uint32_t maskArm
Definition: CTPPSDetId.h:49
CTPPSDetId::maskRP
static const uint32_t maskRP
Definition: CTPPSDetId.h:51