File indexing completed on 2025-12-10 10:18:05
0001 #pragma once
0002
0003 #include <map>
0004
0005 class TDatabasePDG;
0006 #include <TRandom.h>
0007
0008 #include "GeantImport.h"
0009
0010
0011 #define _THETA_BIN_COUNT_ (180/5)
0012 #define _THETA_BIN_WIDTH_ (M_PI / _THETA_BIN_COUNT_)
0013
0014 namespace IRT2 {
0015
0016 class Calibration : public virtual GeantImport {
0017 public:
0018 Calibration ();
0019 ~Calibration() {};
0020
0021 TDatabasePDG *m_DatabasePDG;
0022
0023 void PerformCalibration(unsigned stat = 0);
0024
0025 CherenkovEvent *GetNextEvent(bool calibration = false);
0026
0027 void ImportTrackingSmearing(const char *ftheta, const char *fphi);
0028
0029
0030
0031 void SetDefaultSinglePhotonThetaResolution(double value) {
0032 m_DefaultSinglePhotonThetaResolution = value;
0033 };
0034
0035 void ExportModifiedOpticsFile(const char *fname);
0036
0037 protected:
0038 void CalibratePhotonEmissionPoints( void );
0039 virtual CherenkovEvent *GetEvent(unsigned ev, bool calibration = false) = 0;
0040 void UpdateYields( void );
0041
0042 bool AutomaticCalibrationRequired( void ) const { return m_AutomaticCalibrationRequired; };
0043
0044 double GetDefaultSinglePhotonThetaResolution( void ) const {
0045 return m_DefaultSinglePhotonThetaResolution;
0046 };
0047
0048 private:
0049 bool m_AutomaticCalibrationRequired;
0050
0051 unsigned m_CurrentEvent;
0052
0053
0054 unsigned m_CalibrationBinStat[_THETA_BIN_COUNT_];
0055
0056 TRandom m_rndm;
0057
0058 bool m_UseActsTracking;
0059
0060 #if _OBSOLETE_
0061 std::map<std::pair<double, double>, std::pair<double, double>> m_ThetaSmearing, m_PhiSmearing;
0062
0063 std::pair<double, double> GetTrackingSmearing(double momentum, double eta);
0064 std::pair<double, double> GetTrackingSmearing(const TVector3 &momentum) {
0065 return GetTrackingSmearing(momentum.Mag(), momentum.Eta());
0066 };
0067 #endif
0068
0069 double m_DefaultSinglePhotonThetaResolution;
0070 };
0071
0072 }