ROBAST logo
// Author: Akira Okumura <mailto:oxon@mac.com>
/******************************************************************************
 * Copyright (C) 2006-, Akira Okumura                                         *
 * All rights reserved.                                                       *
 *****************************************************************************/

#ifndef A_MIXED_REFRACTIVE_INDEX_H
#define A_MIXED_REFRACTIVE_INDEX_H

#include "ARefractiveIndex.h"

///////////////////////////////////////////////////////////////////////////////
//
// AMixedRefractiveIndex
//
// Refractive index for two mixed materials
//
///////////////////////////////////////////////////////////////////////////////

class AMixedRefractiveIndex : public ARefractiveIndex {
 private:
  std::shared_ptr<ARefractiveIndex> fMaterialA;
  std::shared_ptr<ARefractiveIndex> fMaterialB;
  Double_t fFractionA;
  Double_t fFractionB;

  void SetExtinctionCoefficient(std::shared_ptr<TGraph>){};
  void SetRefractiveIndex(std::shared_ptr<TGraph>){};

 public:
  AMixedRefractiveIndex(std::shared_ptr<ARefractiveIndex> materialA,
                        std::shared_ptr<ARefractiveIndex> materialB,
                        Double_t fractionA, Double_t fractionB);
  virtual ~AMixedRefractiveIndex() {}

  virtual Double_t GetRefractiveIndex(Double_t lambda) const {
    Double_t nA = fMaterialA->GetRefractiveIndex(lambda);
    Double_t nB = fMaterialB->GetRefractiveIndex(lambda);
    return nA * fFractionA + nB * fFractionB;
  }
  virtual Double_t GetExtinctionCoefficient(Double_t lambda) const {
    Double_t kA = fMaterialA->GetExtinctionCoefficient(lambda);
    Double_t kB = fMaterialB->GetExtinctionCoefficient(lambda);
    return kA * fFractionA + kB * fFractionB;
  }
  void SetFraction(Double_t fractionA, Double_t fractionB) {
    fFractionA = fractionA / (fractionA + fractionB);
    fFractionB = fractionB / (fractionA + fractionB);
  }

  ClassDef(AMixedRefractiveIndex, 1)
};

#endif  // A_MIXED_REFRACTIVE_INDEX_H
 AMixedRefractiveIndex.h:1
 AMixedRefractiveIndex.h:2
 AMixedRefractiveIndex.h:3
 AMixedRefractiveIndex.h:4
 AMixedRefractiveIndex.h:5
 AMixedRefractiveIndex.h:6
 AMixedRefractiveIndex.h:7
 AMixedRefractiveIndex.h:8
 AMixedRefractiveIndex.h:9
 AMixedRefractiveIndex.h:10
 AMixedRefractiveIndex.h:11
 AMixedRefractiveIndex.h:12
 AMixedRefractiveIndex.h:13
 AMixedRefractiveIndex.h:14
 AMixedRefractiveIndex.h:15
 AMixedRefractiveIndex.h:16
 AMixedRefractiveIndex.h:17
 AMixedRefractiveIndex.h:18
 AMixedRefractiveIndex.h:19
 AMixedRefractiveIndex.h:20
 AMixedRefractiveIndex.h:21
 AMixedRefractiveIndex.h:22
 AMixedRefractiveIndex.h:23
 AMixedRefractiveIndex.h:24
 AMixedRefractiveIndex.h:25
 AMixedRefractiveIndex.h:26
 AMixedRefractiveIndex.h:27
 AMixedRefractiveIndex.h:28
 AMixedRefractiveIndex.h:29
 AMixedRefractiveIndex.h:30
 AMixedRefractiveIndex.h:31
 AMixedRefractiveIndex.h:32
 AMixedRefractiveIndex.h:33
 AMixedRefractiveIndex.h:34
 AMixedRefractiveIndex.h:35
 AMixedRefractiveIndex.h:36
 AMixedRefractiveIndex.h:37
 AMixedRefractiveIndex.h:38
 AMixedRefractiveIndex.h:39
 AMixedRefractiveIndex.h:40
 AMixedRefractiveIndex.h:41
 AMixedRefractiveIndex.h:42
 AMixedRefractiveIndex.h:43
 AMixedRefractiveIndex.h:44
 AMixedRefractiveIndex.h:45
 AMixedRefractiveIndex.h:46
 AMixedRefractiveIndex.h:47
 AMixedRefractiveIndex.h:48
 AMixedRefractiveIndex.h:49
 AMixedRefractiveIndex.h:50
 AMixedRefractiveIndex.h:51
 AMixedRefractiveIndex.h:52
 AMixedRefractiveIndex.h:53
 AMixedRefractiveIndex.h:54