X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=ESDCheck%2FAliHMPIDQATask.cxx;h=a4e65a7a8558d09d33a1dbbced5e7b4c0ae0cd06;hp=86a294a4f1bcc357142669356bed0489e62f275e;hb=587c4393ed5c55d728ed94887bf2882aa7849c9b;hpb=0b28fd572e7c99af7c7f6d12acd7044923da6cdf diff --git a/ESDCheck/AliHMPIDQATask.cxx b/ESDCheck/AliHMPIDQATask.cxx index 86a294a4f1b..a4e65a7a855 100644 --- a/ESDCheck/AliHMPIDQATask.cxx +++ b/ESDCheck/AliHMPIDQATask.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include "AliHMPIDQATask.h" #include "AliESD.h" @@ -41,6 +42,7 @@ AliHMPIDQATask::AliHMPIDQATask(const char *name) : AliAnalysisTask(name,""), fChain(0), fESD(0), + fOutputContainer(0), fhHMPIDCkovP(0), fhHMPIDMipXY(0), fhHMPIDDifXY(0), @@ -72,7 +74,7 @@ AliHMPIDQATask::~AliHMPIDQATask() } //______________________________________________________________________________ -void AliHMPIDQATask::Init(const Option_t*) +void AliHMPIDQATask::ConnectInputData(const Option_t*) { // Initialisation of branch container and histograms @@ -85,24 +87,23 @@ void AliHMPIDQATask::Init(const Option_t*) return ; } - if (!fESD) { - // One should first check if the branch address was taken by some other task - char ** address = (char **)GetBranchAddress(0, "ESD") ; - if (address) - fESD = (AliESD *)(*address) ; - if (!fESD) - fChain->SetBranchAddress("ESD", &fESD) ; + // One should first check if the branch address was taken by some other task + char ** address = (char **)GetBranchAddress(0, "ESD"); + if (address) { + fESD = (AliESD*)(*address); + } else { + fESD = new AliESD(); + SetBranchAddress(0, "ESD", &fESD); } - // The output objects will be written to - TDirectory * cdir = gDirectory ; - // Open a file for output #0 - char outputName[1024] ; - sprintf(outputName, "%s.root", GetName() ) ; - OpenFile(0, outputName , "RECREATE") ; - if (cdir) - cdir->cd() ; - +} + +//________________________________________________________________________ +void AliHMPIDQATask::CreateOutputObjects() +{ // create histograms + + OpenFile(0) ; + fhHMPIDCkovP = new TH2F("CkovP" , "#theta_{c}, [rad];P, [GeV]", 150, 0, 7 ,100, -3, 1); fhHMPIDSigP = new TH2F("SigP" ,"#sigma_{#theta_c}" , 150, 0, 7 ,100, 0, 1e20); fhHMPIDMipXY = new TH2F("MipXY" ,"mip position" , 260, 0,130 ,252,0,126); @@ -177,7 +178,20 @@ void AliHMPIDQATask::Exec(Option_t *) void AliHMPIDQATask::Terminate(Option_t *) { // Processing when the event loop is ended - + fOutputContainer = (TObjArray*)GetOutputData(0); + fhHMPIDCkovP = (TH2F*)fOutputContainer->At(0); + fhHMPIDSigP = (TH2F*)fOutputContainer->At(1); + fhHMPIDMipXY = (TH2F*)fOutputContainer->At(2); + fhHMPIDDifXY = (TH2F*)fOutputContainer->At(3); + fhHMPIDProb[0] = (TH1F*)fOutputContainer->At(4); + fhHMPIDProb[1] = (TH1F*)fOutputContainer->At(5); + fhHMPIDProb[2] = (TH1F*)fOutputContainer->At(6); + fhHMPIDProb[3] = (TH1F*)fOutputContainer->At(7); + fhHMPIDProb[4] = (TH1F*)fOutputContainer->At(8); + + Bool_t problem = kFALSE ; + AliInfo(Form(" *** %s Report:", GetName())) ; + Float_t n = 1.292 ; //mean freon ref idx TF1 * hHMPIDpPi = new TF1("RiPiTheo", "acos(sqrt(x*x+[0]*[0])/(x*[1]))", 1.2, 7) ; hHMPIDpPi->SetLineWidth(1) ; @@ -227,10 +241,18 @@ void AliHMPIDQATask::Terminate(Option_t *) cHMPID->Print("HMPID.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())) ; }