Code clean-up. (Andrei Gheata).
[u/mrichter/AliRoot.git] / TFluka / rfrndx.cxx
CommitLineData
1b866d4b 1#include "Fdimpar.h" //(DIMPAR) fluka include
2#include "Ftrackr.h" //(TRACKR) fluka common
3#include "Fiounit.h" //(IOUNIT) fluka common
1b904a0d 4#include "TFlukaGeo.h"
5#include "TGeoMaterial.h"
6#include "TGeoManager.h"
7#include "TFlukaCerenkov.h"
8
1b866d4b 9#ifndef WIN32
10# define rfrndx rfrndx_
11#else
12# define rfrndx RFRNDX
13#endif
14extern "C" {
2bc4c610 15Double_t rfrndx(Double_t& wvlngt, Double_t& /*omgpho*/, Int_t& mmat)
1b866d4b 16{
1b904a0d 17//
18// Return refraction index for given photon energy and material
19//
20 TFluka* fluka = (TFluka*) gMC;
21 TGeoMaterial* material = (TGeoMaterial*) (gGeoManager->GetListOfMaterials())->At(fluka->GetMaterialIndex(mmat));
22 TFlukaCerenkov* cerenkov = dynamic_cast<TFlukaCerenkov*> (material->GetCerenkovProperties());
23 Double_t y = (cerenkov->GetRefractionIndexByWaveLength(wvlngt));
24 return (y);
1b866d4b 25}
26}