Problem in merging of the time component
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Jun 2010 17:57:40 +0000 (17:57 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Jun 2010 17:57:40 +0000 (17:57 +0000)
Check the presence of TOF histogram

Marian

TPC/AliTPCcalibTime.cxx

index 153e02f..78e2578 100644 (file)
@@ -863,8 +863,18 @@ Long64_t AliTPCcalibTime::Merge(TCollection *const li) {
       if (cal->GetResHistoTPCITS(imeas) && cal->GetResHistoTPCITS(imeas)){
        fResHistoTPCITS[imeas]->Add(cal->fResHistoTPCITS[imeas]);
        fResHistoTPCvertex[imeas]->Add(cal->fResHistoTPCvertex[imeas]);
-       fResHistoTPCTRD[imeas]->Add(cal->fResHistoTPCTRD[imeas]);
-       fResHistoTPCTOF[imeas]->Add(cal->fResHistoTPCTOF[imeas]);
+      }
+      if (cal->fResHistoTPCTRD[imeas]){
+       if (fResHistoTPCTRD[imeas])
+         fResHistoTPCTRD[imeas]->Add(cal->fResHistoTPCTRD[imeas]);
+       else
+         fResHistoTPCTRD[imeas]=(THnSparse*)cal->fResHistoTPCTRD[imeas]->Clone();
+      }
+      if  (cal->fResHistoTPCTOF[imeas]){
+       if (fResHistoTPCTOF[imeas])
+         fResHistoTPCTOF[imeas]->Add(cal->fResHistoTPCTOF[imeas]);
+       else
+         fResHistoTPCTOF[imeas]=(THnSparse*)cal->fResHistoTPCTOF[imeas]->Clone();      
       }
     }
     TObjArray* addArray=cal->GetHistoDrift();