]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFCalibTask.cxx
reducing macro to minimum AliReconstruction functionality, disable QA and TriggerESD...
[u/mrichter/AliRoot.git] / TOF / AliTOFCalibTask.cxx
index 731a3a6eb0545ce646650ebcba319d3be8e503a6..3f440c532f751a0295e95a1a62575bab271a2f6d 100644 (file)
  **************************************************************************/
 /*
 $Log$
+Revision 1.6  2007/10/05 10:44:11  zampolli
+Oversight for debugging purpose fixed
+
+Revision 1.5  2007/10/05 10:38:10  zampolli
+Oversight fixed
+
+Revision 1.4  2007/10/04 15:36:44  zampolli
+Updates to new TOF offline calibration schema
+
 Revision 1.3  2007/07/31 07:26:16  zampolli
 Bug fixed in the $ field
 
@@ -185,7 +194,7 @@ AliTOFCalibTask:: ~AliTOFCalibTask()
 
   AliInfo("TOF Calib Task: Deleting");
   delete[] fbigarray;
-  delete findexarray;
+  delete[] findexarray;
   delete fOutputContainer;
   delete fhToT;
   delete fhTime;
@@ -362,10 +371,8 @@ void AliTOFCalibTask::ConnectInputData(const Option_t*)
     fESD = (AliESDEvent*)(*address);
   } else {
     fESD = new AliESDEvent();
-    AliInfo(" qui ok ");
-    //    fESD = (AliESDEvent*)fChain->GetTree()->GetUserInfo()->FindObject("AliESDEvent");
-    fESD->ReadFromTree(fChain) ;  
   }
+  fESD->ReadFromTree(fChain) ;  
 
   BookHistos();
 
@@ -384,6 +391,12 @@ Bool_t AliTOFCalibTask::Notify()
     return kFALSE;
   }
   
+  char ** address = (char **)GetBranchAddress(0, "ESD");
+  if (address) {
+    fESD = (AliESDEvent*)(*address);
+  } else {
+    fESD = new AliESDEvent();
+  }
   fESD->ReadFromTree(fChain) ;  
 
   return kTRUE;
@@ -430,7 +443,7 @@ void AliTOFCalibTask::Exec(Option_t * opt)
     nselected++;
     Int_t ich = Int_t(t->GetTOFCalChannel()); 
     fhch->Fill(ich);
-    ich=3;
+    //    ich=3; //only for debug purpose
     AliDebug(2,Form(" ESD in channel %i, filling array %i",t->GetTOFCalChannel(),ich));
     Float_t tot = t->GetTOFsignalToT();
     Float_t time = t->GetTOFsignalRaw();
@@ -491,7 +504,6 @@ void AliTOFCalibTask::Terminate(Option_t *)
 
   for (Int_t i = 0;i<TOFCHANNELS;i++){
     Int_t size=findexarray[i]*NIDX;
-    if (i==3) AliInfo(Form(" entries %i in channel %i ",findexarray[i],i));
     AliDebug(2, Form(" entries %i in channel %i ",findexarray[i],i));
     if (findexarray[i]<=2) {
       AliDebug(1, Form(" not enough statistics for combined PID for channel %i, putting all the tracks as if they were pions",i));
@@ -731,6 +743,10 @@ Bool_t AliTOFCalibTask::CombPID(Float_t *smallarray, Int_t size){
        smallarray[idxextimePr]=-1;
       }
     }
+    delete[] exptof; 
+    delete[] timeofflight;
+    delete[] texp;
+    delete[] index;
     
   }
   return 1;
@@ -791,6 +807,11 @@ Float_t  AliTOFCalibTask::LoopCombPID(Int_t itrkinset, Int_t ntrkinset, Float_t
        
        chisquarebest=chisquare;
       }
+      delete[] besttimezero;
+      delete[] bestchisquare;
+      delete[] bestweightedtimezero;
+      delete[] weightedtimezero;
+      delete[] timezero;
     }
   }
   return chisquarebest;