X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TFluka%2Frflctv.cxx;h=5d24f95ed280c7db03e976a374741f193e75ee71;hb=1c82a8b5d72bfec811764927570f13d6ac699e8a;hp=d312b0ed074dae57f7b28a61e12756c5aefa8514;hpb=1b866d4b08cd17bf26aa42f10dad896d5fb987bc;p=u%2Fmrichter%2FAliRoot.git diff --git a/TFluka/rflctv.cxx b/TFluka/rflctv.cxx index d312b0ed074..5d24f95ed28 100644 --- a/TFluka/rflctv.cxx +++ b/TFluka/rflctv.cxx @@ -1,15 +1,27 @@ #include "Fdimpar.h" //(DIMPAR) fluka include #include "Ftrackr.h" //(TRACKR) fluka common #include "Fiounit.h" //(IOUNIT) fluka common +#include "TFluka.h" +#include "TGeoMaterial.h" +#include "TFlukaCerenkov.h" + + #ifndef WIN32 # define rflctv rflctv_ #else # define rflctv RFLCTV #endif extern "C" { -Double_t rflctv(Double_t& wvlngt, Double_t& omgpho, Int_t& mmat) +Double_t rflctv(Double_t& wvlngt, Double_t& /*omgpho*/, Int_t& mmat) { - printf("rflctv called %e %e %d \n", wvlngt, omgpho, mmat); - return (0.); +// +// Return reflectivity (1-r) for given photon energy and material +// + TFluka* fluka = (TFluka*) gMC; + TGeoMaterial* material = (TGeoMaterial*) (fluka->GetFlukaMaterials())->At(fluka->GetMaterialIndex(mmat)); + TFlukaCerenkov* cerenkov = dynamic_cast (material->GetCerenkovProperties()); + Double_t y = 0.; + if (cerenkov->IsMetal()) y = (cerenkov->GetReflectivityByWaveLength(wvlngt)); + return (y); } }