ROBAST logo
/******************************************************************************
 * Copyright (C) 2006-, Akira Okumura                                         *
 * All rights reserved.                                                       *
 *****************************************************************************/

///////////////////////////////////////////////////////////////////////////////
//
// ASchottFormula
//
// SCHOTT's formula for calculation of refractive index. SCHOTT does not use
// this formula in its catalog any more. Sellmeier's formula is used instead.
//
///////////////////////////////////////////////////////////////////////////////

#include "ASchottFormula.h"
#include "AOpticsManager.h"
#include "TMath.h"

ClassImp(ASchottFormula);

ASchottFormula::ASchottFormula() : ARefractiveIndex() {}

//_____________________________________________________________________________
ASchottFormula::ASchottFormula(Double_t A0, Double_t A1, Double_t A2,
                               Double_t A3, Double_t A4, Double_t A5)
    : ARefractiveIndex() {
  fPar[0] = A0;
  fPar[1] = A1;
  fPar[2] = A2;
  fPar[3] = A3;
  fPar[4] = A4;
  fPar[5] = A5;
}

//_____________________________________________________________________________
ASchottFormula::ASchottFormula(const Double_t* p) {
  for (Int_t i = 0; i < 6; i++) {
    fPar[i] = p[i];
  }
}

//_____________________________________________________________________________
Double_t ASchottFormula::GetRefractiveIndex(Double_t lambda) const {
  // Calculate the refractive index at wavelength = lambda (m)
  // Use AOpticsManager::m() to get the unit length in (m)
  //
  // n(lambda)^2 = A0 + A1*lamda^2 + A2*lamda^-2 + A3*lamda^-4 + A4*lamda^-6 +
  // A5*lamda^-8 where lambda is measured in (um)
  lambda /= AOpticsManager::um();  // Convert (nm) to (um)
  return TMath::Sqrt(fPar[0] + fPar[1] * TMath::Power(lambda, 2.) +
                     fPar[2] * TMath::Power(lambda, -2.) +
                     fPar[3] * TMath::Power(lambda, -4.) +
                     fPar[4] * TMath::Power(lambda, -6.) +
                     fPar[5] * TMath::Power(lambda, -8.));
}
 ASchottFormula.cxx:1
 ASchottFormula.cxx:2
 ASchottFormula.cxx:3
 ASchottFormula.cxx:4
 ASchottFormula.cxx:5
 ASchottFormula.cxx:6
 ASchottFormula.cxx:7
 ASchottFormula.cxx:8
 ASchottFormula.cxx:9
 ASchottFormula.cxx:10
 ASchottFormula.cxx:11
 ASchottFormula.cxx:12
 ASchottFormula.cxx:13
 ASchottFormula.cxx:14
 ASchottFormula.cxx:15
 ASchottFormula.cxx:16
 ASchottFormula.cxx:17
 ASchottFormula.cxx:18
 ASchottFormula.cxx:19
 ASchottFormula.cxx:20
 ASchottFormula.cxx:21
 ASchottFormula.cxx:22
 ASchottFormula.cxx:23
 ASchottFormula.cxx:24
 ASchottFormula.cxx:25
 ASchottFormula.cxx:26
 ASchottFormula.cxx:27
 ASchottFormula.cxx:28
 ASchottFormula.cxx:29
 ASchottFormula.cxx:30
 ASchottFormula.cxx:31
 ASchottFormula.cxx:32
 ASchottFormula.cxx:33
 ASchottFormula.cxx:34
 ASchottFormula.cxx:35
 ASchottFormula.cxx:36
 ASchottFormula.cxx:37
 ASchottFormula.cxx:38
 ASchottFormula.cxx:39
 ASchottFormula.cxx:40
 ASchottFormula.cxx:41
 ASchottFormula.cxx:42
 ASchottFormula.cxx:43
 ASchottFormula.cxx:44
 ASchottFormula.cxx:45
 ASchottFormula.cxx:46
 ASchottFormula.cxx:47
 ASchottFormula.cxx:48
 ASchottFormula.cxx:49
 ASchottFormula.cxx:50
 ASchottFormula.cxx:51
 ASchottFormula.cxx:52
 ASchottFormula.cxx:53
 ASchottFormula.cxx:54
 ASchottFormula.cxx:55