Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-10 10:18:06

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