beam replaced by beamcm
[u/mrichter/AliRoot.git] / TFluka / abscff.cxx
CommitLineData
1b866d4b 1#include "Fdimpar.h" //(DIMPAR) fluka include
2#include "Ftrackr.h" //(TRACKR) fluka common
3#include "Fiounit.h" //(IOUNIT) fluka common
bcf1cd9c 4#include "TFluka.h"
1b904a0d 5#include "TGeoMaterial.h"
6#include "TFlukaCerenkov.h"
1b904a0d 7
8
1b866d4b 9#ifndef WIN32
10# define abscff abscff_
11#else
12# define abscff ABSCFF
13#endif
14extern "C" {
2bc4c610 15Double_t abscff(Double_t& wvlngt, Double_t& /*omgpho*/, Int_t& mmat)
1b866d4b 16{
1b904a0d 17//
18// Return absorption length for given photon energy and material
19//
42179f55 20
1b904a0d 21 TFluka* fluka = (TFluka*) gMC;
42179f55 22//
23// Check if stopping has been required by user
24//
25 if (fluka->GetStoppingCondition()) {
26 fluka->ResetStoppingCondition();
27 return (1.e15);
28 }
29//
30// Get absorption coefficient for current material
31//
bcf1cd9c 32 TGeoMaterial* material = (TGeoMaterial*) (fluka->GetFlukaMaterials())->At(fluka->GetMaterialIndex(mmat));
1b904a0d 33 TFlukaCerenkov* cerenkov = dynamic_cast<TFlukaCerenkov*> (material->GetCerenkovProperties());
34 Double_t y = (cerenkov->GetAbsorptionCoefficientByWaveLength(wvlngt));
35 return (y);
36
1b866d4b 37}
38}
39
40