Local and global quantum efficiency maxima are stored.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 May 2004 12:14:50 +0000 (12:14 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 May 2004 12:14:50 +0000 (12:14 +0000)
TFluka/TFlukaCerenkov.cxx
TFluka/TFlukaCerenkov.h

index a4945a350f98d8f814b7de2096bd776f35201af6..e662a001aafcc04e170888be504024657a9bdcd1 100644 (file)
@@ -1,5 +1,7 @@
 #include "TFlukaCerenkov.h"
 
+Double_t TFlukaCerenkov::fgGlobalMaximumEfficiency = 0.;
+   
 ClassImp(TFlukaCerenkov);
 
 
@@ -11,7 +13,8 @@ TFlukaCerenkov::TFlukaCerenkov()
       fWaveLength(0),
       fAbsorptionCoefficient(0),
       fQuantumEfficiency(0),
-      fRefractionIndex(0)
+      fRefractionIndex(0),
+      fMaximumEfficiency(0.)
 {
 // Default constructor
 }
@@ -26,6 +29,7 @@ TFlukaCerenkov::TFlukaCerenkov(Int_t npckov, Float_t *ppckov, Float_t *absco, Fl
     fAbsorptionCoefficient = new Float_t[fSamples];
     fRefractionIndex       = new Float_t[fSamples];
     fQuantumEfficiency     = new Float_t[fSamples];
+    
     for (Int_t i = 0; i < fSamples; i++) {
        fEnergy[i]             = ppckov[i];
        fWaveLength[i]         = khc / ppckov[i];
@@ -37,9 +41,19 @@ TFlukaCerenkov::TFlukaCerenkov(Int_t npckov, Float_t *ppckov, Float_t *absco, Fl
        fRefractionIndex[i]    = rindex[i];
        fQuantumEfficiency[i]  = effic[i];
        //
+       // Find local maximum quantum efficiency
+       if (effic[i] > fMaximumEfficiency) fMaximumEfficiency = effic[i];
+       //
        // Flag is sensitive if quantum efficiency 0 < eff < 1 for at least one value.
        if (effic[i] < 1. && effic[i] > 0.) fIsSensitive = 1;
     }
+    // Find global  maximum quantum efficiency
+    if (fMaximumEfficiency > GetGlobalMaximumEfficiency()) {
+       SetGlobalMaximumEfficiency(fMaximumEfficiency);
+    }
+    printf("Maximum eff. %f\n",  GetGlobalMaximumEfficiency());
+       
+    
 }
 
 Float_t TFlukaCerenkov::GetAbsorptionCoefficient(Float_t energy)
index afe2b1c4ac5b0ea3fbc4e2bcc0891e597dfd3ce1..3af83890273ce3e6d14c426928688a3712e7de21 100644 (file)
@@ -42,19 +42,24 @@ public:
     virtual Int_t     GetNSamples()          {return fSamples;}
     virtual Bool_t    IsMetal()              {return fIsMetal;}
     virtual Bool_t    IsSensitive()          {return fIsSensitive;}
-    
+    virtual Double_t  GetMaximumEfficiency() const             {return fMaximumEfficiency;}
+    static  Double_t  GetGlobalMaximumEfficiency()             {return fgGlobalMaximumEfficiency;}
+    static  void      SetGlobalMaximumEfficiency(Double_t eff) {fgGlobalMaximumEfficiency = eff;}
  protected:
     virtual Float_t  Interpolate(Float_t energy, Float_t* array1, Float_t* array2);
     
  protected:
-    Int_t        fSamples;               // Number of sampling points
-    Bool_t       fIsMetal;               // Flag for metals
-    Bool_t       fIsSensitive;           // Flag for metals  
-    Float_t*     fEnergy;                // [fSamples] Energy                 (GeV) 
-    Float_t*     fWaveLength;            // [fSamples] Wafelength             (cm)
-    Float_t*     fAbsorptionCoefficient; // [fSamples] Absorption Coefficient (1/cm)
-    Float_t*     fQuantumEfficiency;     // [fSamples] Quantum efficiency
-    Float_t*     fRefractionIndex;       // [fSamples] Refraction Index    
+    Int_t        fSamples;                  // Number of sampling points
+    Bool_t       fIsMetal;                  // Flag for metals
+    Bool_t       fIsSensitive;              // Flag for metals  
+    Float_t*     fEnergy;                   // [fSamples] Energy                 (GeV) 
+    Float_t*     fWaveLength;               // [fSamples] Wafelength             (cm)
+    Float_t*     fAbsorptionCoefficient;    // [fSamples] Absorption Coefficient (1/cm)
+    Float_t*     fQuantumEfficiency;        // [fSamples] Quantum efficiency
+    Float_t*     fRefractionIndex;          // [fSamples] Refraction Index
+    Double_t     fMaximumEfficiency;        // Local maximum quantum efficiency
+    // static 
+    static Double_t fgGlobalMaximumEfficiency; // Global maximum quantum efficiency
     
     ClassDef(TFlukaCerenkov, 1)          // CerenkovProperties
 };