Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-06-01 07:07:33

0001 
0002 #include <set>
0003 #include <map>
0004 #include <vector>
0005 
0006 #include <TVector3.h>
0007 
0008 #ifndef _OPTICAL_PHOTON_
0009 #define _OPTICAL_PHOTON_
0010 
0011 #include "TransientParticle.h"
0012 #include "CherenkovPhotonDetector.h"
0013 class ReflectionPoint;
0014 #include "RefractionPoint.h"
0015 #include "SinglePDF.h"
0016 
0017 class OpticalPhoton: public TransientParticle {
0018  public:
0019  OpticalPhoton(): TransientParticle(0), m_VertexRefractiveIndex(0.0), m_PhotonDetector(0), 
0020     m_VolumeCopy(0), m_DetectionTime(0.0), 
0021     m_Detected(false)/*, m_Phi(0.0)*/ {};//, m_Selected(false) {};
0022   ~OpticalPhoton() {};
0023   
0024   inline bool IsCharged( void )                          const { return false; };
0025 
0026   inline void SetDetected(bool what = true)                    { m_Detected = what; };
0027   inline void SetDetectionTime(double value)                   { m_DetectionTime = value; };
0028   inline void SetVertexRefractiveIndex(double value)           { m_VertexRefractiveIndex = value; };
0029   inline void SetVertexPosition(const TVector3 &position)      { m_VertexPosition = position; };
0030   inline void SetVertexMomentum(const TVector3 &momentum)      { m_VertexMomentum = momentum; };
0031   inline void SetVertexParentMomentum(const TVector3 &momentum){ m_VertexParentMomentum = momentum; };
0032   inline void SetVolumeCopy(uint64_t copy)                     { m_VolumeCopy = copy; };
0033   inline void SetDetectionPosition(const TVector3 &position)   { m_DetectionPosition = position; };
0034   inline void SetPhotonDetector(CherenkovPhotonDetector *pd)   { m_PhotonDetector = pd; };
0035 
0036   inline void AddReflectionPoint(ReflectionPoint *reflection)  {
0037     m_ReflectionPoints.push_back(reflection);
0038   };
0039   unsigned ReflectionPointCount( void )                  const { return m_ReflectionPoints.size(); };
0040   const ReflectionPoint *GetReflectionPoint(unsigned id) const { 
0041     return (id < m_ReflectionPoints.size() ? m_ReflectionPoints[id] : 0);
0042   };
0043   inline void AddRefractionPoint(const RefractionPoint *refraction) {
0044     m_RefractionPoints.push_back(refraction);
0045   };
0046   unsigned RefractionPointCount( void )                  const { return m_RefractionPoints.size(); };
0047   const RefractionPoint *GetRefractionPoint(unsigned id) const { 
0048     return (id < m_RefractionPoints.size() ? m_RefractionPoints[id] : 0);
0049   };
0050 
0051   inline double GetVertexRefractiveIndex( void )         const { return m_VertexRefractiveIndex; };
0052   inline double GetDetectionTime( void )                 const { return m_DetectionTime; };
0053   inline const TVector3 &GetVertexPosition( void )       const { return m_VertexPosition; };
0054   inline const TVector3 &GetVertexMomentum( void )       const { return m_VertexMomentum; };
0055   inline const TVector3 &GetVertexParentMomentum( void ) const { return m_VertexParentMomentum; };
0056   inline const TVector3 &GetDetectionPosition( void )    const { return m_DetectionPosition; };
0057 
0058   inline bool WasDetected( void )                        const { return m_Detected; };
0059   inline uint64_t GetVolumeCopy( void )                  const { return m_VolumeCopy; };
0060 
0061   inline CherenkovPhotonDetector *GetPhotonDetector( void ) const {
0062     return dynamic_cast<CherenkovPhotonDetector*>(m_PhotonDetector.GetObject());
0063   };
0064 
0065  private:
0066   // Vertex and 3D at birth as given by GEANT; 
0067   TVector3 m_VertexPosition, m_VertexMomentum, m_VertexParentMomentum;
0068 
0069   // Refractive index for this wave length (if radiator was known);
0070   double m_VertexRefractiveIndex;
0071 
0072   // Reflection points on the mirrors; 
0073   std::vector<ReflectionPoint*> m_ReflectionPoints;
0074   // Refraction points on the radiator boundaries;
0075   std::vector<const RefractionPoint*> m_RefractionPoints;
0076 
0077   // Photon detector, where photon ended up; volume copy number; position and time;
0078   TRef m_PhotonDetector;
0079   uint64_t m_VolumeCopy;
0080   TVector3 m_DetectionPosition;
0081   double m_DetectionTime;
0082 
0083   // 'true' if the photon was actually detected; QE-based and geometric efficiency accounted; 
0084   bool m_Detected;
0085 
0086   // Transient variables for some convenience in an analysis script;
0087  public:
0088   //inline bool WasSelected( void )                        const { return m_Selected; };
0089   //bool m_Selected;                                          //!
0090   std::set<std::pair<unsigned, CherenkovRadiator*>> _m_Selected; //!
0091   std::map<CherenkovRadiator*, VectorPDF> _m_PDF;           //!
0092 
0093   // Average estimated phi angle; no need to know it precisely (?);
0094   std::map<CherenkovRadiator*, double> m_Phi;                  //!
0095 
0096 #ifndef DISABLE_ROOT_IO
0097   ClassDef(OpticalPhoton, 3);
0098 #endif
0099 };
0100 
0101 #endif