Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 10:04:59

0001 #ifndef SimPPS_RPDigiProducer_RP_DISPLACEMENT_GENERATOR_H
0002 #define SimPPS_RPDigiProducer_RP_DISPLACEMENT_GENERATOR_H
0003 
0004 #include "SimPPS/RPDigiProducer/interface/RPSimTypes.h"
0005 #include "DataFormats/CTPPSDetId/interface/TotemRPDetId.h"
0006 #include <Math/Rotation3D.h>
0007 #include <map>
0008 
0009 class PSimHit;
0010 
0011 /**
0012  * \ingroup TotemDigiProduction
0013  * \brief This class introduces displacements of RP.
0014  * It actually shifts and rotates PSimHit positions. It doesn't test whether the displaced
0015  * hit is still on the detector's surface. This check takes place later in the process. It
0016  * is done via edge effectivity.
0017  *
0018  * PSimHit points are given in the "local Det frame" (PSimHit.h)
0019  */
0020 class CTPPSRPAlignmentCorrectionsData;
0021 class CTPPSGeometry;
0022 
0023 class RPDisplacementGenerator {
0024 public:
0025   using RotationMatrix = ROOT::Math::Rotation3D;
0026   using Translation = ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>>;
0027 
0028   RPDisplacementGenerator(bool iIsOn,
0029                           RPDetId,
0030                           const CTPPSRPAlignmentCorrectionsData* alignments,
0031                           const CTPPSGeometry& geom);
0032 
0033   /// returns displaced PSimHit
0034   PSimHit displace(const PSimHit&);
0035 
0036   static uint32_t rawToDecId(uint32_t raw);
0037 
0038 private:
0039   /// ID of the detector
0040   RPDetId detId_;
0041 
0042   /// displacement
0043   Translation shift_;
0044   RotationMatrix rotation_;
0045 
0046   /// set to false to bypass displacements
0047   bool isOn_;
0048 
0049   /// displaces a point
0050   Local3DPoint displacePoint(const Local3DPoint&);
0051 };
0052 
0053 #endif