#include <TLegend.h>
#include <TROOT.h>
#include <TVector3.h>
+#include <TString.h>
#include "AliHMPIDQATask.h"
#include "AliESD.h"
AliAnalysisTask(name,""),
fChain(0),
fESD(0),
+ fOutputContainer(0),
fhHMPIDCkovP(0),
fhHMPIDMipXY(0),
fhHMPIDDifXY(0),
}
//______________________________________________________________________________
-void AliHMPIDQATask::Init(const Option_t*)
+void AliHMPIDQATask::ConnectInputData(const Option_t*)
{
// Initialisation of branch container and histograms
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);
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) ;
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())) ;
}