]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/qaRec/AliTRDrecoTask.cxx
new convention for drawing QA results.
[u/mrichter/AliRoot.git] / TRD / qaRec / AliTRDrecoTask.cxx
1 #include "TFile.h"
2 #include "TObjArray.h"
3 #include "TDirectory.h"
4 #include "TTreeStream.h"
5
6 #include "AliLog.h"
7 #include "AliAnalysisTask.h"
8
9 #include "AliTRDrecoTask.h"
10
11 ClassImp(AliTRDrecoTask)
12
13 //_______________________________________________________
14 AliTRDrecoTask::AliTRDrecoTask(const char *name, const char *title)
15   : AliAnalysisTask(name, title)
16   ,fNRefFigures(0)
17   ,fDebugLevel(0)
18   ,fContainer(0x0)
19   ,fTracks(0x0)
20   ,fDebugStream(0x0)
21 {
22   DefineInput(0, TObjArray::Class());
23   DefineOutput(0, TObjArray::Class());
24 }
25
26 //_______________________________________________________
27 AliTRDrecoTask::~AliTRDrecoTask() 
28 {
29   if(fDebugStream){ 
30     delete fDebugStream;
31     fDebugStream = 0x0;
32   }
33
34   if(fContainer){
35     //fContainer->Delete();
36     delete fContainer;
37     fContainer = 0x0;
38   }
39 }
40
41 //_______________________________________________________
42 void AliTRDrecoTask::ConnectInputData(Option_t *)
43 {
44   //
45   // Connect input data
46   //
47
48   fTracks = dynamic_cast<TObjArray *>(GetInputData(0));
49 }
50
51
52 //_______________________________________________________
53 void AliTRDrecoTask::GetRefFigure(Int_t /*ifig*/)
54 {
55   AliWarning("Retrieving reference figures not implemented.");
56 }
57
58 //_______________________________________________________
59 Bool_t AliTRDrecoTask::Load(const Char_t *filename)
60 {
61   if(!TFile::Open(filename)) return kFALSE;
62   TObjArray *o = (TObjArray*)gFile->Get(GetName());
63   fContainer = (TObjArray*)o->Clone(GetName());
64   gFile->Close();
65   return kFALSE;
66 }
67
68 //_______________________________________________________
69 Bool_t AliTRDrecoTask::PostProcess()
70 {
71   AliWarning("Post processing of reference histograms not implemented.");
72   return kFALSE;
73 }
74
75 //_______________________________________________________
76 void AliTRDrecoTask::SetDebugLevel(Int_t level)
77 {
78   fDebugLevel = level;
79   if(fDebugLevel>=2){
80     TDirectory *savedir = gDirectory;
81     fDebugStream = new TTreeSRedirector(Form("TRD.Debug%s.root", GetName()));
82     savedir->cd();
83   }
84 }