]>
Commit | Line | Data |
---|---|---|
d85cd79c | 1 | #include "TFile.h" |
3d86166d | 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 | //_______________________________________________________ | |
28efdace | 53 | void AliTRDrecoTask::GetRefFigure(Int_t /*ifig*/, Int_t &first, Int_t &last, Option_t */*opt*/) |
3d86166d | 54 | { |
55 | AliWarning("Retrieving reference figures not implemented."); | |
56 | first = 0; last = 0; | |
57 | } | |
58 | ||
59 | //_______________________________________________________ | |
28efdace | 60 | Bool_t AliTRDrecoTask::Load(const Char_t *filename) |
3d86166d | 61 | { |
d85cd79c | 62 | if(!TFile::Open(filename)) return kFALSE; |
63 | TObjArray *o = (TObjArray*)gFile->Get(GetName()); | |
64 | fContainer = (TObjArray*)o->Clone(GetName()); | |
65 | gFile->Close(); | |
3d86166d | 66 | return kFALSE; |
67 | } | |
68 | ||
69 | //_______________________________________________________ | |
70 | Bool_t AliTRDrecoTask::PostProcess() | |
71 | { | |
72 | AliWarning("Post processing of reference histograms not implemented."); | |
73 | return kFALSE; | |
74 | } | |
75 | ||
76 | //_______________________________________________________ | |
77 | void AliTRDrecoTask::SetDebugLevel(Int_t level) | |
78 | { | |
79 | fDebugLevel = level; | |
80 | if(fDebugLevel>=2){ | |
81 | TDirectory *savedir = gDirectory; | |
82 | fDebugStream = new TTreeSRedirector(Form("TRD.Debug%s.root", GetName())); | |
83 | savedir->cd(); | |
84 | } | |
85 | } |