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

typedef ROOT::Math::Rotation3D RotationMatrix
 

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...
 
DDRotationMatrix rotation_
 
DDTranslation 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 28 of file RPDisplacementGenerator.h.

Member Typedef Documentation

typedef ROOT::Math::Rotation3D RPDisplacementGenerator::RotationMatrix

Definition at line 30 of file RPDisplacementGenerator.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file RPDisplacementGenerator.cc.

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

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
45  iSetup.get<VeryForwardRealGeometryRecord>().get(geom);
46  const DetGeomDesc *g = geom->sensor(detId_);
47  const DDRotationMatrix &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 }
#define LogDebug(id)
T getParameter(std::string const &) const
std::optional< T > tryToGet() const
Definition: EventSetup.h:94
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
RPDetId detId_
ID of the detector.
ROOT::Math::Rotation3D getRotationMatrix() const
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
Event setup record containing the real (actual) geometry information.
static uint32_t rawToDecId(uint32_t raw)
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
Geometrical description of a sensor.
Definition: DetGeomDesc.h:35
ROOT::Math::Rotation3D RotationMatrix
RotationMatrix rotation() const
geometry information
Definition: DetGeomDesc.h:64
const DetGeomDesc * sensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
Event setup record containing the misaligned geometry information. It is used for alignment studies o...
T get() const
Definition: EventSetup.h:73
DDTranslation shift_
displacement
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.

Member Function Documentation

PSimHit RPDisplacementGenerator::displace ( const PSimHit input)

returns displaced PSimHit

Definition at line 69 of file RPDisplacementGenerator.cc.

References PSimHit::detUnitId(), displacePoint(), PSimHit::energyLoss(), PSimHit::entryPoint(), SiStripBadComponentsDQMServiceTemplate_cfg::ep, PSimHit::exitPoint(), input, isOn_, LogDebug, PSimHit::pabs(), PSimHit::particleType(), PSimHit::phiAtEntry(), PSimHit::processType(), PSimHit::thetaAtEntry(), PSimHit::tof(), and PSimHit::trackId().

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 }
#define LogDebug(id)
float tof() const
deprecated name for timeOfFlight()
Definition: PSimHit.h:76
Geom::Theta< float > thetaAtEntry() const
fast and more accurate access to momentumAtEntry().theta()
Definition: PSimHit.h:61
static std::string const input
Definition: EdmProvDump.cc:48
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:46
bool isOn_
set to false to bypass displacements
float pabs() const
fast and more accurate access to momentumAtEntry().mag()
Definition: PSimHit.h:67
unsigned short processType() const
Definition: PSimHit.h:120
float energyLoss() const
The energy deposit in the PSimHit, in ???.
Definition: PSimHit.h:79
int particleType() const
Definition: PSimHit.h:89
unsigned int trackId() const
Definition: PSimHit.h:106
Geom::Phi< float > phiAtEntry() const
fast and more accurate access to momentumAtEntry().phi()
Definition: PSimHit.h:64
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:43
Local3DPoint displacePoint(const Local3DPoint &)
displaces a point
unsigned int detUnitId() const
Definition: PSimHit.h:97
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.

References rotation_, shift_, findQualityFiles::v, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by displace().

60  {
62 
63  DDTranslation v(p.x(), p.y(), p.z());
64  v = rotation_ * v - shift_;
65 
66  return Local3DPoint(v.x(), v.y(), v.z());
67 }
T y() const
Definition: PV3DBase.h:60
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
T z() const
Definition: PV3DBase.h:61
DDTranslation shift_
displacement
T x() const
Definition: PV3DBase.h:59
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9
uint32_t RPDisplacementGenerator::rawToDecId ( uint32_t  raw)
static

Definition at line 92 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().

92  {
93  return ((raw >> CTPPSDetId::startArmBit) & CTPPSDetId::maskArm) * 1000 +
95  ((raw >> CTPPSDetId::startRPBit) & CTPPSDetId::maskRP) * 10 +
97 }
static const uint32_t startRPBit
Definition: CTPPSDetId.h:47
static const uint32_t maskStation
Definition: CTPPSDetId.h:46
static const uint32_t maskRP
Definition: CTPPSDetId.h:47
static const uint32_t maskArm
Definition: CTPPSDetId.h:45
static const uint32_t startStationBit
Definition: CTPPSDetId.h:46
static const uint32_t startPlaneBit
Definition: TotemRPDetId.h:41
static const uint32_t startArmBit
Definition: CTPPSDetId.h:45
static const uint32_t maskPlane
Definition: TotemRPDetId.h:41

Member Data Documentation

RPDetId RPDisplacementGenerator::detId_
private

ID of the detector.

Definition at line 41 of file RPDisplacementGenerator.h.

Referenced by RPDisplacementGenerator().

bool RPDisplacementGenerator::isOn_
private

set to false to bypass displacements

Definition at line 48 of file RPDisplacementGenerator.h.

Referenced by displace(), and RPDisplacementGenerator().

DDRotationMatrix RPDisplacementGenerator::rotation_
private

Definition at line 45 of file RPDisplacementGenerator.h.

Referenced by displacePoint(), and RPDisplacementGenerator().

DDTranslation RPDisplacementGenerator::shift_
private

displacement

Definition at line 44 of file RPDisplacementGenerator.h.

Referenced by displacePoint(), and RPDisplacementGenerator().