]>
Commit | Line | Data |
---|---|---|
fa3d1cc7 | 1 | #include <Riostream.h> |
8fd1d27e | 2 | #include "TVirtualMCApplication.h" |
df14e7fb | 3 | #include "TGeoMaterial.h" |
4 | #include "TGeoManager.h" | |
5 | #include "TFlukaCerenkov.h" | |
a7bb59a2 | 6 | |
7 | #ifndef WITH_ROOT | |
fa3d1cc7 | 8 | #include "TFluka.h" |
a7bb59a2 | 9 | #else |
10 | #include "TFlukaGeo.h" | |
11 | #endif | |
12 | ||
7dac99f1 | 13 | #include "Fdimpar.h" //(DIMPAR) fluka include |
14 | #include "Ftrackr.h" //(TRACKR) fluka common | |
fa3d1cc7 | 15 | #ifndef WIN32 |
16 | # define endraw endraw_ | |
17 | #else | |
18 | # define endraw ENDRAW | |
19 | #endif | |
20 | extern "C" { | |
21 | void endraw(Int_t& icode, Int_t& mreg, Double_t& rull, Double_t& xsco, Double_t& ysco, Double_t& zsco) | |
22 | { | |
4b81a588 | 23 | TFluka* fluka = (TFluka*) gMC; |
2bc4c610 | 24 | Int_t verbosityLevel = fluka->GetVerbosityLevel(); |
25 | Bool_t debug = (verbosityLevel>=3)?kTRUE:kFALSE; | |
4b81a588 | 26 | fluka->SetCaller(3); |
27 | fluka->SetIcode(icode); | |
28 | fluka->SetRull(rull); | |
29 | fluka->SetXsco(xsco); | |
30 | fluka->SetYsco(ysco); | |
31 | fluka->SetZsco(zsco); | |
32 | fluka->SetMreg(mreg); | |
33 | if (icode == 11) { | |
2bc4c610 | 34 | if (debug) cout << " For icode=" << icode << " Stepping is NOT called" << endl; |
4b81a588 | 35 | return; |
36 | } | |
df14e7fb | 37 | if (TRACKR.jtrack == -1) { |
38 | // Handle quantum efficiency the G3 way | |
2bc4c610 | 39 | if (debug) printf("endraw: Cerenkov photon depositing energy: %d %e\n", mreg, rull); |
df14e7fb | 40 | TGeoMaterial* material = (gGeoManager->GetCurrentVolume())->GetMaterial(); |
2bc4c610 | 41 | // Int_t nmat = material->GetIndex(); |
df14e7fb | 42 | TFlukaCerenkov* cerenkov = dynamic_cast<TFlukaCerenkov*> (material->GetCerenkovProperties()); |
43 | if (cerenkov) { | |
44 | Double_t eff = (cerenkov->GetQuantumEfficiency(rull)); | |
45 | if (gRandom->Rndm() > eff) { | |
46 | rull = 0.; | |
47 | fluka->SetRull(rull); | |
48 | } | |
49 | } | |
50 | } | |
7dac99f1 | 51 | (TVirtualMCApplication::Instance())->Stepping(); |
fbf08100 | 52 | fluka->SetTrackIsNew(kFALSE); |
fa3d1cc7 | 53 | } // end of endraw |
54 | } // end of extern "C" | |
55 |