Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:11

0001 #ifndef FastSimDataFormats_CTPPSFastSim_CTPPSFastRecHit_H
0002 #define FastSimDataFormats_CTPPSFastSim_CTPPSFastRecHit_H
0003 
0004 #include "DataFormats/DetId/interface/DetId.h"
0005 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0006 
0007 #include <vector>
0008 
0009 class CTPPSFastRecHit {
0010 public:
0011   //destructor
0012   // ~CTPPSFastRecHit() {}
0013   CTPPSFastRecHit() : theDetUnitId(0) {}
0014   // constructor
0015   // requires the DetId, the hit position, the ToF and the CellId
0016   // For the Tracker, ToF and CellId = 0
0017   // For the timing x = x_CellId, y = y_CellId, z = z_detector
0018 
0019   CTPPSFastRecHit(const Local3DPoint& entry, unsigned int detId, float tof, unsigned int cellId)
0020       : theEntryPoint(entry), theDetUnitId(detId), theTof(tof), theCellId(cellId) {}
0021   /// Entry point in the local Det frame
0022   Local3DPoint entryPoint() const { return theEntryPoint; }
0023 
0024   /* Time of flight in nanoseconds from the primary interaction
0025          *  to the entry point. Always positive in a PSimHit,
0026          *  but may become negative in a SimHit due to bunch assignment.
0027          */
0028   float timeOfFlight() const { return tof(); }
0029 
0030   /// deprecated name for timeOfFlight()
0031   float tof() const { return theTof; }
0032 
0033   /* The DetUnit identifier, to be interpreted in the context of the
0034          *  detector system that produced the hit.
0035          *  For CTPPS its content has: Detector(CTPPS), SubDet (Tracker or Timing)
0036          *  ArmF(z>0)/ArmB(z<0),  Pot and Plane (= 0)
0037          */
0038   unsigned int detUnitId() const { return theDetUnitId; }
0039   //the ToF cell number
0040   unsigned int cellId() const { return theCellId; }
0041 
0042   void setTof(float tof) { theTof = tof; }
0043 
0044   void setLocal3DPoint(const Local3DPoint& entry) { theEntryPoint = entry; }
0045 
0046   void setDetUnitId(unsigned int detId) { theDetUnitId = detId; }
0047 
0048   void setCellId(unsigned int cellId) { theCellId = cellId; }
0049 
0050 protected:
0051   // properties
0052   Local3DPoint theEntryPoint;  // position at entry
0053   // association
0054   unsigned int theDetUnitId;
0055   float theTof;  // Time Of Flight
0056   unsigned int theCellId;
0057 };
0058 
0059 #endif  //CTPPSFastRecHit_H