WCSimParameters.cc

Go to the documentation of this file.
00001 #include "WCSimParameters.hh"
00002 
00003 #include "WCSimGeometry.hh"
00004 
00005 #include <cmath>
00006 #include <iostream>
00007 #include <cassert>
00008 
00009 ClassImp(WCSimParameters)
00010 
00011 static WCSimParameters* fgParameters = 0;
00012 
00013 WCSimParameters* WCSimParameters::Instance()
00014 {
00015   if( !fgParameters ){
00016     fgParameters = new WCSimParameters();
00017   }
00018 
00019   if( !fgParameters ){
00020     assert(fgParameters);
00021   }
00022 
00023   if( fgParameters ){
00024 
00025   }
00026 
00027   return fgParameters;
00028 }
00029   
00030 WCSimParameters::WCSimParameters()
00031 {
00032   fUseSimpleTimeResolution = 0;
00033   fUseSimpleTimeSlew = 0;
00034   fUseSimpleRefractiveIndex = 0;
00035 }
00036 
00037 WCSimParameters::~WCSimParameters()
00038 {
00039 
00040 }
00041   
00042 void WCSimParameters::UseSimpleParameters()
00043 {
00044   WCSimParameters::UseSimpleTimeResolution();
00045   WCSimParameters::UseSimpleTimeSlew();
00046   WCSimParameters::UseSimpleRefractiveIndex();
00047 }
00048 
00049 void WCSimParameters::UseSimpleTimeResolution()
00050 {
00051   WCSimParameters::Instance()->SetSimpleTimeResolution();
00052 }
00053 
00054 void WCSimParameters::UseSimpleTimeSlew()
00055 {
00056   WCSimParameters::Instance()->SetSimpleTimeSlew();
00057 }
00058 
00059 void WCSimParameters::UseSimpleRefractiveIndex()
00060 {
00061   WCSimParameters::Instance()->SetSimpleRefractiveIndex();
00062 }
00063 
00064 Double_t WCSimParameters::TimeResolution(Double_t Q)
00065 {
00066   if( WCSimParameters::Instance()->SimpleTimeResolution() ){
00067     return WCSimParameters::Instance()->GetSimpleTimeResolution(Q);
00068   }
00069   else {
00070     return WCSimParameters::Instance()->GetTimeResolution(Q);
00071   }
00072 }
00073 
00074 Double_t WCSimParameters::TimeSlew(Double_t Q)
00075 {
00076   if( WCSimParameters::Instance()->SimpleTimeSlew() ){
00077     return WCSimParameters::Instance()->GetSimpleTimeSlew();
00078   }
00079   else{
00080     return WCSimParameters::Instance()->GetTimeSlew(Q);
00081   }
00082 }
00083 
00084 Double_t WCSimParameters::RefractiveIndex(Double_t L)
00085 {
00086   if( WCSimParameters::Instance()->SimpleRefractiveIndex() ){
00087     return WCSimParameters::Instance()->GetSimpleRefractiveIndex();
00088   }
00089   else{
00090     return WCSimParameters::Instance()->GetRefractiveIndex(L);
00091   }
00092 }
00093 
00094 void WCSimParameters::PrintParameters()
00095 {
00096   WCSimParameters::Instance()->RunPrintParameters();
00097 }
00098 
00099 void WCSimParameters::RunPrintParameters()
00100 {
00101   std::cout << " *** WCSimParameters::PrintParameters() *** " << std::endl;
00102 
00103   std::cout << "  Reco Parameters: " << std::endl
00104             << "   UseSimpleTimeResolution = " << fUseSimpleTimeResolution << std::endl
00105             << "   UseSimpleTimeSlew = " << fUseSimpleTimeSlew << std::endl
00106             << "   UseSimpleRefractiveIndex = " << fUseSimpleRefractiveIndex << std::endl;
00107 
00108   return;
00109 }
00110 
00111 Double_t WCSimParameters::SpeedOfLight()
00112 {
00113   return 29.9792458;  // velocity of light [cm/ns]
00114 }
00115 
00116 Double_t WCSimParameters::CherenkovAngle()
00117 {
00118   return 42.0;  // degrees
00119 }
00120 
00121 Double_t WCSimParameters::ThetaC()
00122 {
00123   return 42.0;  // degrees
00124 }
00125 
00126 Double_t WCSimParameters::CosThetaC()
00127 {
00128   return 0.743144825477394244;  // return TMath::Cos(42.0*TMath::Pi()/180.0);
00129 }
00130 
00131 Double_t WCSimParameters::GetTimeResolution(Double_t Q)
00132 {  
00133   /*
00134    // Old Parameterisation (lifted from WCSim)
00135    // ========================================
00136    Double_t qpes = Q;
00137    if( qpes<0.5 ) qpes = 0.5;
00138    if( qpes>32.0 ) qpes = 32.0;
00139    Double_t res = 0.33 + sqrt(2.0/qpes);  
00140   */
00141 
00142   /* 
00143    // Sep'2010: parameterisation, including scattered light:
00144    // ======================================================
00145    Double_t c0 = +0.271, c1 = +3.037, c2 = +2.543;
00146 
00147    // Aug'2011: re-parameterisation, excluding scattered light:
00148    // ========================================================
00149    Double_t c0 = +0.013, c1 = +3.592, c2 = -1.635; // [c2 is -ve, take care]
00150 
00151    // Nov'2011: re-parameterisation, for 200 kton geometry:
00152    // =====================================================
00153    Double_t c0 = -0.005, c1 = +3.634, c2 = -1.458; // [c2 is -ve, take care]
00154   */
00155 
00156   Double_t qpes = Q;
00157   Double_t qpesLow = 0.0;
00158   if( qpes<0.25 ) qpes = 0.25;
00159   if( qpes>40.0 ) qpes = 40.0;
00160 
00161   Double_t c0 = -0.005;
00162   Double_t c1 = +3.634;
00163   Double_t c2 = -1.458;
00164 
00165   if( c2<0.0 ){
00166     qpesLow = (2.0*c2/c1)*(2.0*c2/c1);
00167     if( qpes<qpesLow ) qpes = qpesLow;
00168   }
00169 
00170   Double_t res = c0 
00171                + c1/sqrt(qpes) 
00172                + c2/qpes;
00173   
00174   return res;
00175 }
00176 
00177 Double_t WCSimParameters::GetTimeSlew(Double_t Q)
00178 {   
00179   /*
00180    // Sep'2010: parameterisation, including scattered light:
00181    // ======================================================
00182    Double_t c0 = +3.406, c1 = -2.423, c2 = +0.335;
00183 
00184    // Aug'2011: re-parameterisation, excluding scattered light:
00185    // =========================================================
00186    Double_t c0 = +2.234, c1 = -1.362, c2 = +0.125;  
00187 
00188    // Nov'2011: re-parameterisation, for 200 kton geometry:
00189    // =====================================================
00190    Double_t c0 = +2.436, c1 = -1.291, c2 = +0.089;  
00191   */
00192 
00193   Double_t qpes = Q;
00194   if( qpes<0.25 ) qpes = 0.25;
00195   if( qpes>40.0 ) qpes = 40.0;
00196 
00197   Double_t c0 = +2.436;
00198   Double_t c1 = -1.291;
00199   Double_t c2 = +0.089;
00200 
00201   Double_t dt = c0 
00202               + c1*log(qpes) 
00203               + c2*log(qpes)*log(qpes);
00204 
00205   return dt;
00206 }
00207 
00208 Double_t WCSimParameters::GetRefractiveIndex(Double_t r)
00209 {
00210   Double_t c = 29.98;       
00211   Double_t n0 = 1.33;        // Old Attempt:
00212   Double_t L0 = 0.0;         // 40.0     
00213   Double_t dndx = 0.000123;  // 0.00015  
00214 
00215   Double_t L = r/c;
00216 
00217   Double_t n = n0*(1.0+dndx*(L-L0));
00218   
00219   return n;
00220 }
00221 
00222 Double_t WCSimParameters::GetSimpleTimeResolution(Double_t Q)
00223 {  
00224   Double_t qpes = Q;
00225   if( qpes<0.25 ) qpes = 0.25;
00226   if( qpes>64.0 ) qpes = 64.0;
00227 
00228   Double_t res = 2.0/sqrt(qpes);
00229 
00230   return res;
00231 }