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