]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add protection against failed retrieval of the CDB cal object
authorarcelli <arcelli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 28 Feb 2007 18:09:23 +0000 (18:09 +0000)
committerarcelli <arcelli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 28 Feb 2007 18:09:23 +0000 (18:09 +0000)
TOF/AliTOFAlignment.cxx
TOF/AliTOFcalib.cxx
TOF/AliTOFcalib.h

index 670c3ee967f89e43e49e29af3a628d09748dd8b4..393340a9704fa3c6b3f2a5ce75bb40060e048e5f 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.11  2006/09/19 14:31:26  cvetan
+Bugfixes and clean-up of alignment object classes. Introduction of so called symbolic names used to identify the alignable volumes (Raffaele and Cvetan)
+
 Revision 1.10  2006/08/22 13:26:05  arcelli
 removal of effective c++ warnings (C.Zampolli)
 
@@ -200,6 +203,10 @@ void AliTOFAlignment::ReadParFromCDB(Char_t *sel, Int_t nrun)
   Char_t  out[100];
   sprintf(out,"%s/%s",sel,sel1); 
   AliCDBEntry *entry = man->Get(out,nrun);
+  if (!entry) { 
+    AliError(Form("Failed to get entry: %s",out));
+    return; 
+  }
   fTOFAlignObjArray=(TObjArray*)entry->GetObject();
   fNTOFAlignObj=fTOFAlignObjArray->GetEntries();
   AliInfo(Form("Number of Alignable Volumes from CDB: %d",fNTOFAlignObj));
index 94378d846cd08cf14af32cbc9f907bfb26fc70da..5bd47102abef89e785e72054310efc0f258e5298 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.10  2006/08/22 13:30:49  arcelli
+removal of effective c++ warnings (C.Zampolli)
+
 Revision 1.9  2006/04/20 22:30:50  hristov
 Coding conventions (Annalisa)
 
@@ -775,7 +778,7 @@ void AliTOFcalib::WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFC
 }
 //_____________________________________________________________________________
 
-void AliTOFcalib::ReadParFromCDB(Char_t *sel, Int_t nrun)
+Bool_t AliTOFcalib::ReadParFromCDB(Char_t *sel, Int_t nrun)
 {
   //Read calibration parameters from the CDB
   AliCDBManager *man = AliCDBManager::Instance();
@@ -784,8 +787,14 @@ void AliTOFcalib::ReadParFromCDB(Char_t *sel, Int_t nrun)
   Char_t  out[100];
   sprintf(out,"%s/%s",sel,sel1); 
   AliCDBEntry *entry = man->Get(out,nrun);
+  if (!entry) { 
+    AliError(Form("Failed to get entry: %s",out));
+    return kFALSE; 
+  }
   AliTOFCal *cal =(AliTOFCal*)entry->GetObject();
   fTOFCal = cal;
+  return kTRUE; 
+  
 }
 //_____________________________________________________________________________
 void AliTOFcalib::WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun)
index b6911b881b0419f570394ac5a4f44b4d7919d273..a2ab38e46db530dd18f00a117c89f215a9ef8d3c 100644 (file)
@@ -51,7 +51,7 @@ public:
   void ReadSimParFromCDB(Char_t *sel, Int_t nrun);
   void WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFCal *cal);
   void WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun);
-  void ReadParFromCDB(Char_t *sel, Int_t nrun);
+  Bool_t ReadParFromCDB(Char_t *sel, Int_t nrun);
   Int_t GetIndex(Int_t *detId); // Get channel index for Calibration 
 
  public: