Quantum efficiency implemented by setting energy deposition to zero to flag inefficiency.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 May 2004 12:13:41 +0000 (12:13 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 May 2004 12:13:41 +0000 (12:13 +0000)
("the G3 way").

TFluka/endraw.cxx
TFluka/queffc.cxx

index 0841634b5016ef4597b5ea367fdea375d339a4e5..ab33cb1d827c7990cb2760eb2a100aab198fe078 100644 (file)
@@ -1,5 +1,8 @@
 #include <Riostream.h>
 #include "TVirtualMCApplication.h"
+#include "TGeoMaterial.h"
+#include "TGeoManager.h"
+#include "TFlukaCerenkov.h"
 
 #ifndef WITH_ROOT
 #include "TFluka.h"
@@ -29,6 +32,20 @@ void endraw(Int_t& icode, Int_t& mreg, Double_t& rull, Double_t& xsco, Double_t&
     cout << " For icode=" << icode << " Stepping is NOT called" << endl;
     return;
   }
+  if (TRACKR.jtrack == -1) {
+// Handle quantum efficiency the G3 way
+      printf("endraw: Cerenkov photon depositing energy: %d %e\n", mreg, rull);
+      TGeoMaterial* material = (gGeoManager->GetCurrentVolume())->GetMaterial();
+      Int_t nmat = material->GetIndex();
+      TFlukaCerenkov*  cerenkov = dynamic_cast<TFlukaCerenkov*> (material->GetCerenkovProperties());
+      if (cerenkov) {
+         Double_t eff = (cerenkov->GetQuantumEfficiency(rull));
+         if (gRandom->Rndm() > eff) {
+             rull = 0.;
+             fluka->SetRull(rull);
+         }
+      }
+  }
   (TVirtualMCApplication::Instance())->Stepping();
   fluka->SetTrackIsNew(kFALSE);
 } // end of endraw
index 4b16e0f13701e056d9195c24626dfc3c538270f8..73c96b62ec60fcc3e6fa65be2738bd0f954a298e 100644 (file)
 # define queffc QUEFFC
 #endif
 extern "C" {
-    Double_t queffc(Double_t& wvlngt, Double_t& /*omgpho*/)
+    Double_t queffc(Double_t& /*wvlngt*/, Double_t& /*omgpho*/)
     {
-       TGeoMaterial* material = (gGeoManager->GetCurrentVolume())->GetMaterial();
-       Int_t nmat = material->GetIndex();
-       TFlukaCerenkov*  cerenkov = dynamic_cast<TFlukaCerenkov*> (material->GetCerenkovProperties());
-       Double_t y = 1.;
-       if (cerenkov->IsSensitive()) 
-           y = (cerenkov->GetQuantumEfficiencyByWaveLength(wvlngt));
-       
-//     printf("queff: %e %d %e\n", wvlngt, nmat, y);
-       return (y);
+       Double_t eff = TFlukaCerenkov::GetGlobalMaximumEfficiency();
+       return (eff);
     }
 }