+ fLinearFitterHistoArray.Delete();
+ fLinearFitterPArray.Delete();
+ fLinearFitterEArray.Delete();
+
+}
+//_____________________________________________________________________________
+void AliTRDCalibraVdriftLinearFit::Copy(TObject &c) const
+{
+ //
+ // Copy function
+ //
+
+ AliTRDCalibraVdriftLinearFit& target = (AliTRDCalibraVdriftLinearFit &) c;
+
+ // Copy only the histos
+ for (Int_t idet = 0; idet < 540; idet++){
+ if(fLinearFitterHistoArray.UncheckedAt(idet)){
+ TH2S *hped1 = (TH2S *)target.GetLinearFitterHisto(idet,kTRUE);
+ //hped1->SetDirectory(0);
+ hped1->Add((const TH2S *)fLinearFitterHistoArray.UncheckedAt(idet));
+ }
+ }
+
+ TObject::Copy(c);
+
+}
+//_____________________________________________________________________________
+Long64_t AliTRDCalibraVdriftLinearFit::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)
+ {
+ AliTRDCalibraVdriftLinearFit* entry = dynamic_cast<AliTRDCalibraVdriftLinearFit*>(obj);
+ if (entry == 0) continue;
+
+ // Copy only the histos
+ for (Int_t idet = 0; idet < 540; idet++){
+ if(entry->GetLinearFitterHisto(idet)){
+ TH2S *hped1 = (TH2S *)GetLinearFitterHisto(idet,kTRUE);
+ Double_t entriesa = hped1->GetEntries();
+ Double_t entriesb = ((TH2S *)entry->GetLinearFitterHisto(idet))->GetEntries();
+ if((entriesa + entriesb) < 5*32767) hped1->Add(entry->GetLinearFitterHisto(idet));
+ }
+ }
+
+ count++;
+ }
+
+ return count;