//////////////////////////////////////////////////////////////////// /// \class RAT::DU::GroupVelocity /// /// \brief Return the total transit time using group velocities /// /// \author Phil G Jones /// /// REVISION HISTORY:\n /// - 21 July 2011 : New File.\n /// - 2014-03-01 : P G Jones - refactor as part of ds review, moved from ds. /// - 2014-07-14 J.R.Wilson - change name of scint volume to inner_av /// - 2014-04-02 : M Mottram - updated to work with partial fill. /// - 2015-04-16 : K Majumdar - will first attempt to find explicit group velocities in Optics files, otherwise will calculate them internally /// - 2015-05-13 : R Stainforth - Added PMT bucket time calculation. /// /// /// \details As Brief /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_DU_GroupVelocity__ #define __RAT_DU_GroupVelocity__ #include #include #include namespace RAT { namespace DU { class GroupVelocity : public TObject { public: /// Called at the start of a run, loads from the database void BeginOfRun(); /// Calculate the transit time by distance inline double CalcByDistance( const double distInInnerAV, const double distInAV, const double distInWater ) const; /// Calculate the transit time by distance, for a photon of specified energy inline double CalcByDistance( const double distInInnerAV, const double distInAV, const double distInWater, const double energy ) const; /// Calculate the approximate time a photon spends inside the PMT bucket region /// before hitting the cathode double PMTBucketTime( double incidentAngle ); // This ROOT macro adds dictionary methods to this class. // The number is 0 as this class is never, and should never be written to disc. // It assumes this class has no virtual methods, use ClassDef if change this. ClassDefNV( GroupVelocity, 0 ); private: /// Helper function to load the group velocity from the table into TGraph /// /// @param[in] dbTable to load the group velocity from /// @param[out] property graph void LoadGroupVelocity( DBLinkPtr dbTable, TGraph& property ); TGraph fInnerAVGroupVelocity; ///< Group Velocity as a function of energy in scintillator TGraph fAVGroupVelocity; ///< Group Velocity as a function of energy in av TGraph fWaterGroupVelocity; ///< Group Velocity as a function of energy in water }; double GroupVelocity::CalcByDistance( const double distInInnerAV, const double distInAV, const double distInWater ) const { return CalcByDistance( distInInnerAV, distInAV, distInWater, 3.103125 * 1e-6 ); //400nm } double GroupVelocity::CalcByDistance( const double distInInnerAV, const double distInAV, const double distInWater, const double energy ) const { return distInInnerAV / fInnerAVGroupVelocity.Eval( energy ) + distInAV / fAVGroupVelocity.Eval( energy ) + distInWater / fWaterGroupVelocity.Eval( energy ); } } // namespace DU } // namespace RAT #endif