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 <TObject.h>
0008 #include <TVector3.h>
0009 
0010 #include "CherenkovPhotonDetector.h"
0011 #include "SinglePDF.h"
0012 
0013 namespace IRT2 {
0014 
0015 class ChargedParticle;
0016 class IRT;
0017 
0018 class DigitizedHitSolution {
0019  public:
0020  DigitizedHitSolution(): m_Best(0), m_thp(0.0), m_tt(0.0), m_ccdf(0.0), m_rbest(0) {};
0021   ~DigitizedHitSolution() {};
0022 
0023   // FIXME: very inefficient;
0024   CherenkovRadiator *GetRadiator( void ) {
0025     for(auto &ptr: m_All)
0026       if (&ptr.second == m_Best)
0027     return ptr.first.first;
0028 
0029     return 0;
0030   };
0031 
0032   void AssignVariables(IRTSolution *best, double thp, double tt, CherenkovRadiator *rptr, double ccdf) {
0033     m_Best  = best;
0034     m_thp   = thp;
0035     m_tt    = tt;
0036     m_rbest = rptr;
0037     m_ccdf  = ccdf;
0038   };
0039 
0040   std::map<std::pair<CherenkovRadiator*, IRT*>, IRTSolution> m_All;
0041   IRTSolution* m_Best;      
0042 
0043   double m_thp, m_tt, m_ccdf;
0044   CherenkovRadiator *m_rbest;
0045 };
0046 
0047 class DigitizedHit {
0048  public:
0049  DigitizedHit(): m_BackgroundCandidate(false), m_IRTs(0), m_PhotonDetector(0), 
0050     m_Copy(0), m_iX(0), m_iY(0) {};
0051   ~DigitizedHit() {
0052     m_Selected.clear();
0053   };
0054 
0055   double GetAverageDetectionTime( void ) const {
0056     double ret = 0.0;
0057 
0058     for(auto t: m_DetectionTimes)
0059       ret += t;
0060 
0061     return (m_DetectionTimes.size() ? ret / m_DetectionTimes.size() : 0.0);
0062   };
0063   double GetDetectionTime(unsigned ih) const { 
0064     return (ih < m_DetectionTimes.size() ? m_DetectionTimes[ih] : 0.0);
0065   };
0066   unsigned GetPhotonCount( void ) const { return m_DetectionTimes.size(); };
0067 
0068   inline const TVector3 &GetDetectionPosition( void )    const { return m_DetectionPosition; };
0069 
0070   // FIXME: private;
0071   bool m_BackgroundCandidate;                                     //!
0072   std::set<std::pair<ChargedParticle*, double>> m_Selected;       //!
0073   std::map<ChargedParticle*, DigitizedHitSolution> m_Solutions;   //!
0074 
0075   TVector3 m_DetectionPosition;                                   //!
0076   std::vector<TVector3> m_DirectionSeeds;                         //!
0077   std::vector<IRT*> *m_IRTs;                                      //!
0078 
0079   CherenkovPhotonDetector *m_PhotonDetector;                      //!
0080   unsigned m_Copy;                                                //!
0081 
0082   // Essentially should be unsigned values [0 .. dim-1];
0083   int m_iX, m_iY;                                                 //!
0084 
0085   std::vector<double> m_DetectionTimes;                           //!
0086 
0087   // FIXME: remove once EICrecon debugging is over;
0088   //TVector3 m_PhotonVertexPosition;                                //!
0089   //TVector3 m_PhotonVertexMomentum;                                //!
0090 };
0091 
0092 } // namespace IRT2