]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixing two bugs
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 28 Apr 2010 20:05:01 +0000 (20:05 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 28 Apr 2010 20:05:01 +0000 (20:05 +0000)
AliTPCcalibDB.cxx     - index out of range protection
AliTPCcalibDButil.cxx - chacking the type of class

bug #66632: Crash in AliTPCcalibDButil
[bug #66126] Worrying message in TPC reconstruction

TPC/AliTPCcalibDB.cxx
TPC/AliTPCcalibDButil.cxx

index e056a3dfafaa094e1053aaf917844281af5b6766..808311c58f8edb2e49e10f5f62b9d6683caab1d5 100644 (file)
@@ -476,9 +476,11 @@ void AliTPCcalibDB::UpdateNonRec(){
     fDataQA=dynamic_cast<AliTPCdataQA*>(entry->GetObject());
   }
   // High voltage
-  entry = AliCDBManager::Instance()->Get("TPC/Calib/HighVoltage",fRun);
-  if (entry)  {
-    fVoltageArray.AddAt(entry->GetObject(),fRun);
+  if (fRun>=0){
+    entry = AliCDBManager::Instance()->Get("TPC/Calib/HighVoltage",fRun);
+    if (entry)  {
+      fVoltageArray.AddAt(entry->GetObject(),fRun);
+    }
   }
 
 }
@@ -889,6 +891,7 @@ void AliTPCcalibDB::UpdateRunInformations( Int_t run, Bool_t force){
   // - > Don't use it for reconstruction - Only for Calibration studies
   //
   if (run<=0) return;
+  fRun=run;
   AliCDBEntry * entry = 0;
   if (run>= fRunList.fN){
     fRunList.Set(run*2+1);
@@ -1019,6 +1022,9 @@ AliGRPObject *AliTPCcalibDB::GetGRP(Int_t run){
   //
   // Get GRP object for given run 
   //
+  if (run>= ((Instance()->fGRPArray)).GetEntriesFast()){
+    Instance()->UpdateRunInformations(run);    
+  }
   AliGRPObject * grpRun = dynamic_cast<AliGRPObject *>((Instance()->fGRPArray).At(run));
   if (!grpRun) {
     Instance()->UpdateRunInformations(run);
index 951563087a5c8ab9f9c6f1157a89b10d8c85bb02..08311204530d85cec921ca9135c7ad5073166034 100644 (file)
@@ -2523,7 +2523,7 @@ void AliTPCcalibDButil::FilterTracks(Int_t run, Double_t cutSigma, TTreeSRedirec
   Double_t medianY=0;
   if (!arrT) return;
   for (Int_t i=0; i<arrT->GetEntries();i++){
-    TGraphErrors *graph= (TGraphErrors*)arrT->At(i);
+    TGraphErrors *graph= dynamic_cast<TGraphErrors*>(arrT->At(i));
     if (!graph) continue;
     if (graph->GetN()<kMinPoints){
       delete graph;