Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:30:27

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 namespace edm {
0010   class ParameterSet;
0011   class EventSetup;
0012 }  // namespace edm
0013 
0014 class PSimHit;
0015 
0016 /**
0017  * \ingroup TotemDigiProduction
0018  * \brief This class introduces displacements of RP.
0019  * It actually shifts and rotates PSimHit positions. It doesn't test whether the displaced
0020  * hit is still on the detector's surface. This check takes place later in the process. It
0021  * is done via edge effectivity.
0022  *
0023  * PSimHit points are given in the "local Det frame" (PSimHit.h)
0024  */
0025 
0026 class RPDisplacementGenerator {
0027 public:
0028   using RotationMatrix = ROOT::Math::Rotation3D;
0029   using Translation = ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>>;
0030 
0031   RPDisplacementGenerator(const edm::ParameterSet &, RPDetId, const edm::EventSetup &);
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