]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALTriggerDCSConfigDB.cxx
changed definition of AliHLTCaloClusterDataStruct from class to struct
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALTriggerDCSConfigDB.cxx
index 23c28ab20c792bdd24e881d4a6c882a67b285764..525adfa8b0c76dd3114493b0ec0577c25ea5cce2 100644 (file)
@@ -253,28 +253,37 @@ void AliEMCALTriggerDCSConfigDB::GetSTUSegmentation(Int_t ssg[], Int_t spg[], In
        //
        //
        const AliEMCALTriggerDCSConfig* dcsConf = dynamic_cast<const AliEMCALTriggerDCSConfig*>(GetCachedCDBObject(kIDTriggerConfig));
-
-       AliEMCALTriggerSTUDCSConfig* stuConf = dcsConf->GetSTUDCSConfig();
-       
-       Int_t fw = stuConf->GetFw();
-       
-       switch ( fw )
-       {
-               case 2223:
-                       ssg[0] = 1;
-                       ssg[1] = 1;
-                       spg[0] = 2;
-                       spg[1] = 2;
-                       
-                       ssj[0] = 4;
-                       ssj[1] = 4;
-                       spj[0] = 2;
-                       spj[1] = 2;
-                       break;
-               default:
-                       AliError("Firmware version do not match!");
-                       break;
-       }
+  if(dcsConf){
+    AliEMCALTriggerSTUDCSConfig* stuConf = dcsConf->GetSTUDCSConfig();
+    if(stuConf){
+      Int_t fw = stuConf->GetFw();
+      
+      switch ( fw )
+      {
+        case 2223:
+          ssg[0] = 1;
+          ssg[1] = 1;
+          spg[0] = 2;
+          spg[1] = 2;
+          
+          ssj[0] = 4;
+          ssj[1] = 4;
+          spj[0] = 2;
+          spj[1] = 2;
+          break;
+        default:
+          AliError("Firmware version do not match!");
+          break;
+      }
+    }
+    else {
+      AliError("STUDCSConfig is null!");
+    }
+  }
+  else {
+    AliError("DCSConfig is null!");
+  }
+  
 }
 
 //_____________________________________________________________________________
@@ -282,15 +291,19 @@ Int_t AliEMCALTriggerDCSConfigDB::GetTRUSegmentation(Int_t iTRU)
 {
        //
        const AliEMCALTriggerDCSConfig* dcsConf = dynamic_cast<const AliEMCALTriggerDCSConfig*>(GetCachedCDBObject(kIDTriggerConfig));
+  if(dcsConf){ 
+    AliEMCALTriggerTRUDCSConfig* truConf = dcsConf->GetTRUDCSConfig(iTRU);
+    if(truConf){
+      Int_t sel = truConf->GetL0SEL();
        
-       AliEMCALTriggerTRUDCSConfig* truConf = dcsConf->GetTRUDCSConfig(iTRU);
-
-       Int_t sel = truConf->GetL0SEL();
-       
-       if (sel & 0x0001)
-               return 2;
-       else
-               return 1;
+      if (sel & 0x0001)
+        return 2;
+      else
+        return 1;
+    } else AliError("TRUDCSConf Null!") ;
+  }else AliError("TriggerDCSConf Null!") ;
+  
+  return -1;
 }
 
 //_____________________________________________________________________________
@@ -300,8 +313,12 @@ Int_t AliEMCALTriggerDCSConfigDB::GetTRUGTHRL0(Int_t iTRU)
        //
        //
        const AliEMCALTriggerDCSConfig* dcsConf = dynamic_cast<const AliEMCALTriggerDCSConfig*>(GetCachedCDBObject(kIDTriggerConfig));
-       
-       AliEMCALTriggerTRUDCSConfig* truConf = dcsConf->GetTRUDCSConfig(iTRU);
-       
-       return truConf->GetGTHRL0();
+  if(dcsConf){ 
+    AliEMCALTriggerTRUDCSConfig* truConf = dcsConf->GetTRUDCSConfig(iTRU);
+    if(truConf){
+      return truConf->GetGTHRL0();
+    } else AliError("TRUDCSConf Null!") ;
+  }else AliError("TriggerDCSConf Null!") ;
+  
+  return -1;
 }