]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDCalibraVector.cxx
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / TRD / AliTRDCalibraVector.cxx
index 40b638835ecc8e3e50d01e91b2545f9761c71380..8b928fe2e95fb98e0b9083a9bf657faadc1392d5 100644 (file)
@@ -167,19 +167,49 @@ AliTRDCalibraVector::~AliTRDCalibraVector()
   // AliTRDCalibraVector destructor
   //
 
-  if(fPHEntries) delete fPHEntries;
-  if(fPHMean) delete fPHMean;
-  if(fPHSquares) delete fPHSquares;
-  if(fPRFEntries) delete fPRFEntries;
-  if(fPRFMean) delete fPRFMean;
-  if(fPRFSquares) delete fPRFSquares;
-  if(fCHEntries) delete fCHEntries;
+  for (Int_t i=0; i<540; i++) {
+    delete fPHEntries[i];
+    delete fPHMean[i];
+    delete fPHSquares[i];
+    delete fPRFEntries[i];
+    delete fPRFMean[i];
+    delete fPRFSquares[i];
+    delete fCHEntries[i];
+  }
+
   if(fHisto) delete fHisto;
   if(fGraph) delete fGraph;
   if(fCalVector) delete fCalVector;
 
 }
 //_____________________________________________________________________________
+Long64_t AliTRDCalibraVector::Merge(const TCollection* list) 
+{
+  // Merge list of objects (needed by PROOF)
+
+  if (!list)
+    return 0;
+  
+  if (list->IsEmpty())
+    return 1;
+  
+  TIterator* iter = list->MakeIterator();
+  TObject* obj = 0;
+  
+  // collection of generated histograms
+  Int_t count=0;
+  while((obj = iter->Next()) != 0) 
+    {
+      AliTRDCalibraVector* entry = dynamic_cast<AliTRDCalibraVector*>(obj);
+      if (entry == 0) continue; 
+      
+      if(this->Add(entry)) count++;
+    
+    }
+  
+  return count;
+}
+//_____________________________________________________________________________
 void AliTRDCalibraVector::TestInit(Int_t i, Int_t detmax)
 {
   //
@@ -953,10 +983,12 @@ TGraphErrors *AliTRDCalibraVector::ConvertVectorPHTGraphErrors(Int_t det, Int_t
   // Axis
   Float_t sf = 10.0;
   AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
-  if (!parCom) {
+  if (parCom) {
+    sf = parCom->GetSamplingFrequency();
+  }
+  else {
     AliInfo("Could not get CommonParam, take the default 10MHz");
   }
-  sf = parCom->GetSamplingFrequency();
   // Axis
   Double_t x[35];  // Xaxis
   Double_t y[35];  // Sum/entries
@@ -1422,3 +1454,4 @@ void AliTRDCalibraVector::SetNzNrphi(Int_t i, Int_t nz, Int_t nrphi)
   }
   
 }
+