#include <TCanvas.h>
#include <TChain.h>
#include <TFile.h>
-#include <TH1F.h>
#include <TH2F.h>
#include <TLine.h>
#include <TROOT.h>
#include <TStyle.h>
+#include <TString.h>
#include "AliPMDQATask.h"
#include "AliPMDUtility.h"
AliAnalysisTask(name,""),
fChain(0),
fESD(0),
+ fOutputContainer(0),
fhPMDP1(0),
fhPMDC2(0),
fhPMDP2(0),
DefineOutput(0, TObjArray::Class()) ;
}
+//______________________________________________________________________________
+AliPMDQATask::AliPMDQATask(const AliPMDQATask& ta) :
+AliAnalysisTask(ta.GetName(), ""),
+fChain(ta.fChain),
+fESD(ta.fESD),
+fOutputContainer(ta.fOutputContainer),
+fhPMDP1(ta.fhPMDP1),
+fhPMDC2(ta.fhPMDC2),
+fhPMDP2(ta.fhPMDP2),
+fhPMDC3(ta.fhPMDC3),
+fhPMDP3(ta.fhPMDP3),
+fhPMDP4(ta.fhPMDP4),
+fhPMDC5(ta.fhPMDC5),
+fhPMDP5(ta.fhPMDP5),
+fhPMDCP0(ta.fhPMDCP0),
+fhPMDCP1(ta.fhPMDCP1),
+fhPMDCP2(ta.fhPMDCP2),
+fhPMDCP3(ta.fhPMDCP3),
+fhPMDCP4(ta.fhPMDCP4),
+fhPMDSM1(ta.fhPMDSM1),
+fhPMDSM2(ta.fhPMDSM2),
+fhPMDSM3(ta.fhPMDSM3),
+fhPMDSM4(ta.fhPMDSM4),
+fhPMDSM5(ta.fhPMDSM5),
+fhPMDSM6(ta.fhPMDSM6),
+fhPMDSM7(ta.fhPMDSM7),
+fhPMDSM8(ta.fhPMDSM8),
+fhPMDSM9(ta.fhPMDSM9),
+fhPMDSM10(ta.fhPMDSM10),
+fhPMDSM11(ta.fhPMDSM11),
+fhPMDSM12(ta.fhPMDSM12),
+fhPMDSM13(ta.fhPMDSM13),
+fhPMDSM14(ta.fhPMDSM14),
+fhPMDSM15(ta.fhPMDSM15),
+fhPMDSM16(ta.fhPMDSM16),
+fhPMDSM17(ta.fhPMDSM17),
+fhPMDSM18(ta.fhPMDSM18),
+fhPMDSM19(ta.fhPMDSM19),
+fhPMDSM20(ta.fhPMDSM20),
+fhPMDSM21(ta.fhPMDSM21),
+fhPMDSM22(ta.fhPMDSM22),
+fhPMDSM23(ta.fhPMDSM23),
+fhPMDSM24(ta.fhPMDSM24),
+fhPMDSM (ta.fhPMDSM)
+{
+ // copy constructor
+}
+
+//_____________________________________________________________________________
+AliPMDQATask& AliPMDQATask::operator = (const AliPMDQATask& ap)
+{
+ // assignment operator
+
+ this->~AliPMDQATask();
+ new(this) AliPMDQATask(ap);
+ return *this;
+}
+
//______________________________________________________________________________
AliPMDQATask::~AliPMDQATask()
{
}
//______________________________________________________________________________
-void AliPMDQATask::Init(const Option_t*)
+void AliPMDQATask::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 AliPMDQATask::CreateOutputObjects()
+{
// create histograms
+ OpenFile(0) ;
+
fhPMDP1 = new TH2F("fhPMDP1","XY of Clusters",100,-100.,100.,100,-100.,100.);
fhPMDC2 = new TH1F("fhPMDC2","CPV PHI",200,-1,9);
fhPMDP2 = new TH1F("fhPMDP2","PRE PHI",200,-1,9);
void AliPMDQATask::Terminate(Option_t *)
{
// Processing when the event loop is ended
-
+ fOutputContainer = (TObjArray*)GetOutputData(0);
+
+ fhPMDP1 = (TH2F*)fOutputContainer->At(0);
+ fhPMDC2 = (TH1F*)fOutputContainer->At(1);
+ fhPMDP2 = (TH1F*)fOutputContainer->At(2);
+ fhPMDC3 = (TH1F*)fOutputContainer->At(3);
+ fhPMDP3 = (TH1F*)fOutputContainer->At(4);
+ fhPMDP4 = (TH1F*)fOutputContainer->At(5);
+ fhPMDC5 = (TH1F*)fOutputContainer->At(6);
+ fhPMDP5 = (TH1F*)fOutputContainer->At(7);
+ fhPMDCP0 = (TH2F*)fOutputContainer->At(8);
+ fhPMDCP1 = (TH2F*)fOutputContainer->At(9);
+ fhPMDCP2 = (TH2F*)fOutputContainer->At(10);
+ fhPMDCP3 = (TH2F*)fOutputContainer->At(11);
+ fhPMDCP4 = (TH2F*)fOutputContainer->At(12);
+
+ fhPMDSM1 = (TH2F*)fOutputContainer->At(13);
+ fhPMDSM2 = (TH2F*)fOutputContainer->At(14);
+ fhPMDSM3 = (TH2F*)fOutputContainer->At(15);
+ fhPMDSM4 = (TH2F*)fOutputContainer->At(16);
+ fhPMDSM5 = (TH2F*)fOutputContainer->At(17);
+ fhPMDSM6 = (TH2F*)fOutputContainer->At(18);
+ fhPMDSM7 = (TH2F*)fOutputContainer->At(19);
+ fhPMDSM8 = (TH2F*)fOutputContainer->At(20);
+ fhPMDSM9 = (TH2F*)fOutputContainer->At(21);
+ fhPMDSM10 = (TH2F*)fOutputContainer->At(22);
+ fhPMDSM11 = (TH2F*)fOutputContainer->At(23);
+ fhPMDSM12 = (TH2F*)fOutputContainer->At(24);
+ fhPMDSM13 = (TH2F*)fOutputContainer->At(25);
+ fhPMDSM14 = (TH2F*)fOutputContainer->At(26);
+ fhPMDSM15 = (TH2F*)fOutputContainer->At(27);
+ fhPMDSM16 = (TH2F*)fOutputContainer->At(28);
+ fhPMDSM17 = (TH2F*)fOutputContainer->At(29);
+ fhPMDSM18 = (TH2F*)fOutputContainer->At(30);
+ fhPMDSM19 = (TH2F*)fOutputContainer->At(31);
+ fhPMDSM20 = (TH2F*)fOutputContainer->At(32);
+ fhPMDSM21 = (TH2F*)fOutputContainer->At(33);
+ fhPMDSM22 = (TH2F*)fOutputContainer->At(34);
+ fhPMDSM23 = (TH2F*)fOutputContainer->At(35);
+ fhPMDSM24 = (TH2F*)fOutputContainer->At(36);
+ fhPMDSM = (TH1F*)fOutputContainer->At(37);
+
+ Bool_t problem = kFALSE ;
+ AliInfo(Form(" *** %s Report:", GetName())) ;
+
gStyle->SetOptStat(110000);
gStyle->SetOptFit(1);
cPMD4->Print("CPVPREAdc.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);
- 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())) ;
}
//______________________________________________________________________________
-void AliPMDQATask::CalculateSMN( Float_t clsX, Float_t clsY, Int_t & smn)
+void AliPMDQATask::CalculateSMN( Float_t clsX, Float_t clsY, Int_t & smn) const
{
Double_t xcon[96] = {75.133, 54.204, 53.254, 32.326, 31.376,10.447,
75.133, 54.204, 53.254, 32.326, 31.376,10.447,
}
//______________________________________________________________________________
-void AliPMDQATask::DrawPMDBoundary()
+void AliPMDQATask::DrawPMDBoundary() const
{
// Draw PMD boundaries
}
//______________________________________________________________________________
-void AliPMDQATask::DrawPMDBoundarySM1()
+void AliPMDQATask::DrawPMDBoundarySM1() const
{
// Draw boundaries of Super Module 1
}
//______________________________________________________________________________
-void AliPMDQATask::DrawPMDBoundarySM2()
+void AliPMDQATask::DrawPMDBoundarySM2() const
{
// Draw boundaries of Super Module 2
//______________________________________________________________________________
-void AliPMDQATask::DrawPMDBoundarySM3()
+void AliPMDQATask::DrawPMDBoundarySM3() const
{
// Draw boundaries of Super Module 3
}
//______________________________________________________________________________
-void AliPMDQATask::DrawPMDBoundarySM4()
+void AliPMDQATask::DrawPMDBoundarySM4() const
{
// Draw boundaries of Super Module 4