]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Protection in case of wrong sector number (alpha)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Jan 2004 18:38:12 +0000 (18:38 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Jan 2004 18:38:12 +0000 (18:38 +0000)
RICH/AliRICHParam.h

index b7d2471875fc841038853c26ede6768ee14fc166..8be0ed7bea526cfd5391febd5caf21fd6da7877a 100644 (file)
@@ -5,6 +5,7 @@
 #include <TMath.h>
 #include <TVector2.h>
 #include <TRandom.h>
+#include <TError.h>
 
 
 static const int kNCH=7;           //number of RICH chambers 
@@ -61,7 +62,14 @@ public:
   
   static Bool_t   IsResolveClusters()         {return fgIsResolveClusters;}  //go after resolved clusters?
   static Bool_t   IsWireSag()                 {return fgIsWireSag;}          //take wire sagita in account?
-  static Int_t    HV(Int_t sector)            {return fgHV[sector-1];}       //high voltage for this sector
+  static Int_t    HV(Int_t sector)            {
+    if (sector>=1 && sector <=6)
+      return fgHV[sector-1];
+    else {
+      ::Error("HV","Wrong sector %d",sector);
+      return kBad;
+    } 
+  }       //high voltage for this sector
   static void     IsResolveClusters(Bool_t a) {fgIsResolveClusters=a;}  
   static void     SetWireSag(Bool_t status)   {fgIsWireSag=status;}  
   static void     SetHV(Int_t sector,Int_t hv){fgHV[sector-1]=hv;}