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

#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 (bool iIsOn, RPDetId, const CTPPSRPAlignmentCorrectionsData *alignments, const CTPPSGeometry &geom)
 

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

Definition at line 23 of file RPDisplacementGenerator.h.

Member Typedef Documentation

◆ RotationMatrix

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

Definition at line 25 of file RPDisplacementGenerator.h.

◆ Translation

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

Definition at line 26 of file RPDisplacementGenerator.h.

Constructor & Destructor Documentation

◆ RPDisplacementGenerator()

RPDisplacementGenerator::RPDisplacementGenerator ( bool  iIsOn,
RPDetId  _detId,
const CTPPSRPAlignmentCorrectionsData alignments,
const CTPPSGeometry geom 
)

Definition at line 15 of file RPDisplacementGenerator.cc.

References detId_, g, relativeConstraints::geom, CTPPSRPAlignmentCorrectionsData::getFullSensorCorrection(), CTPPSRPAlignmentCorrectionData::getRotationMatrix(), CTPPSRPAlignmentCorrectionData::getTranslation(), isOn_, dqm-mbProfile::log, LogDebug, rawToDecId(), rotation_, and shift_.

19  : detId_(_detId) {
20  isOn_ = iIsOn;
21 
22  unsigned int decId = rawToDecId(detId_);
23 
24  math::XYZVectorD S_m;
25  RotationMatrix R_m;
26 
27  if (alignments) {
28  const CTPPSRPAlignmentCorrectionData &ac = alignments->getFullSensorCorrection(decId);
29  S_m = ac.getTranslation();
30  R_m = ac.getRotationMatrix();
31  } else
32  isOn_ = false;
33 
34  // transform shift and rotation to the local coordinate frame
35  const DetGeomDesc *g = geom.sensor(detId_);
36  const RotationMatrix &R_l = g->rotation();
37  rotation_ = R_l.Inverse() * R_m.Inverse() * R_l;
38  shift_ = R_l.Inverse() * R_m.Inverse() * S_m;
39 
40  LogDebug("RPDisplacementGenerator").log([&](auto &log) {
41  log << " det id = " << decId << ", isOn = " << isOn_ << "\n";
42  if (isOn_) {
43  log << " shift = " << shift_ << "\n";
44  log << " rotation = " << rotation_ << "\n";
45  }
46  });
47 }
ROOT::Math::Rotation3D getRotationMatrix() const
RPDetId detId_
ID of the detector.
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
static uint32_t rawToDecId(uint32_t raw)
CTPPSRPAlignmentCorrectionData getFullSensorCorrection(unsigned int id, bool useRPErrors=false) const
Translation shift_
displacement
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > XYZVectorD
spatial vector with cartesian internal representation
Definition: Vector3D.h:8
bool isOn_
set to false to bypass displacements
ROOT::Math::Rotation3D RotationMatrix
Alignment correction for an element of the CT-PPS detector. Within the geometry description, every sensor (more generally every element) is given its translation and rotation. These two quantities shall be understood in local-to-global coordinate transform. That is, if r_l is a point in local coordinate system and x_g in global, then it holds.
#define LogDebug(id)

Member Function Documentation

◆ displace()

PSimHit RPDisplacementGenerator::displace ( const PSimHit input)

returns displaced PSimHit

Definition at line 58 of file RPDisplacementGenerator.cc.

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

58  {
59  if (!isOn_)
60  return input;
61 
62  const Local3DPoint &ep = input.entryPoint(), &xp = input.exitPoint();
63  const Local3DPoint &dep = displacePoint(ep), &dxp = displacePoint(xp);
64 
65  LogDebug("RPDisplacementGenerator::displace\n") << " entry point: " << ep << " -> " << dep << "\n"
66  << " exit point : " << xp << " -> " << dxp << "\n";
67 
68  return PSimHit(dep,
69  dxp,
70  input.pabs(),
71  input.tof(),
72  input.energyLoss(),
73  input.particleType(),
74  input.detUnitId(),
75  input.trackId(),
76  input.thetaAtEntry(),
77  input.phiAtEntry(),
78  input.processType());
79 }
static std::string const input
Definition: EdmProvDump.cc:50
bool isOn_
set to false to bypass displacements
Local3DPoint displacePoint(const Local3DPoint &)
displaces a point
#define LogDebug(id)

◆ displacePoint()

Local3DPoint RPDisplacementGenerator::displacePoint ( const Local3DPoint p)
private

displaces a point

input is in mm, shifts are in mm too

Definition at line 49 of file RPDisplacementGenerator.cc.

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

Referenced by displace().

49  {
51 
52  Translation v(p.x(), p.y(), p.z());
53  v = rotation_ * v - shift_;
54 
55  return Local3DPoint(v.x(), v.y(), v.z());
56 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > Translation
Translation shift_
displacement
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9

◆ rawToDecId()

uint32_t RPDisplacementGenerator::rawToDecId ( uint32_t  raw)
static

Definition at line 81 of file RPDisplacementGenerator.cc.

References CTPPSDetId::maskArm, TotemRPDetId::maskPlane, CTPPSDetId::maskRP, CTPPSDetId::maskStation, CTPPSDetId::startArmBit, TotemRPDetId::startPlaneBit, CTPPSDetId::startRPBit, and CTPPSDetId::startStationBit.

Referenced by DeadChannelsManager::isChannelDead(), and RPDisplacementGenerator().

81  {
82  return ((raw >> CTPPSDetId::startArmBit) & CTPPSDetId::maskArm) * 1000 +
84  ((raw >> CTPPSDetId::startRPBit) & CTPPSDetId::maskRP) * 10 +
86 }
static const uint32_t startRPBit
Definition: CTPPSDetId.h:53
static const uint32_t maskStation
Definition: CTPPSDetId.h:52
static const uint32_t maskRP
Definition: CTPPSDetId.h:53
static const uint32_t maskArm
Definition: CTPPSDetId.h:51
static const uint32_t startStationBit
Definition: CTPPSDetId.h:52
static const uint32_t startPlaneBit
Definition: TotemRPDetId.h:41
static const uint32_t startArmBit
Definition: CTPPSDetId.h:51
static const uint32_t maskPlane
Definition: TotemRPDetId.h:41

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().