]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ESDCheck/AliT0QATask.cxx
clean up of reading ESD (preparation for adding nonflow etc)
[u/mrichter/AliRoot.git] / ESDCheck / AliT0QATask.cxx
index a0353cfef5729ede2097e416151e0774b3db32c0..e6666bf600c5972099f8fcb26d38f9972ab0a142 100644 (file)
@@ -27,6 +27,7 @@
 #include <TH1F.h>
 #include <TLegend.h> 
 #include <TROOT.h>
+#include <TString.h> 
 
 #include "AliT0QATask.h" 
 #include "AliESD.h" 
@@ -38,6 +39,7 @@ AliT0QATask::AliT0QATask(const char *name) :
   AliAnalysisTask(name,""),  
   fChain(0),
   fESD(0), 
+  fOutputContainer(0),
   fhT01(0),
   fhT02(0),
   fhT03(0)
@@ -89,6 +91,9 @@ void AliT0QATask::ConnectInputData(const Option_t*)
 void AliT0QATask::CreateOutputObjects()
 {
   // create histograms   
+
+  OpenFile(0) ; 
+
   fhT01 = new TH1F("hRealVertex", "Primary vertex", 100,   -20,    20);
   fhT02 = new TH1F("hT0start",    "T0 start time",  100, 12400, 12600);
   fhT03 = new TH1F("hT0vertex",   "T0vertex",       100,   -20,    20);
@@ -142,13 +147,17 @@ void AliT0QATask::Terminate(Option_t *)
   fhT02 = (TH1F*)fOutputContainer->At(1);
   fhT03 = (TH1F*)fOutputContainer->At(2);
 
+  Bool_t problem = kFALSE ; 
+  AliInfo(Form(" *** %s Report:", GetName())) ; 
+
   Float_t mean = fhT02->GetMean();
 
   printf ("mean time T0 ps %f\n", mean) ;
 
-  if ( mean > 12600 || mean < 12400 ) 
+  if ( mean > 12600 || mean < 12400 ) {
    AliWarning (" !!!!!!!!!!-----events sample is WRONG - T0 unreal -------");  
-
+   problem = kTRUE ;
+  }
   TCanvas  * cTO1 = new TCanvas("cT01", "T0 ESD Test", 400, 10, 600, 700) ;
   cTO1->Divide(2, 2) ;
 
@@ -165,10 +174,18 @@ void AliT0QATask::Terminate(Option_t *)
   cTO1->Print("T0.eps");
 
   char line[1024] ; 
-  sprintf(line, ".!tar -zcvf %s.tar.gz *.eps", GetName()) ; 
+  sprintf(line, ".!tar -zcf %s.tar.gz *.eps", GetName()) ; 
   gROOT->ProcessLine(line);
   sprintf(line, ".!rm -fR *.eps"); 
   gROOT->ProcessLine(line);
  
-  AliInfo(Form("!!! All the eps files are in %s.tar.gz !!! \n", GetName())) ;
+  AliInfo(Form("!!! All the eps files are in %s.tar.gz !!!", GetName())) ;
+
+  TString report ; 
+  if(problem)
+    report="Problems found, please check!!!";  
+  else 
+    report="OK";
+
+  AliInfo(Form("*** %s Summary Report: %s\n",GetName(), report.Data())) ; 
 }