]>
Commit | Line | Data |
---|---|---|
9dc4f671 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | //______________________________________________________________________________ | |
17 | // Analysis task for high pt particle correlations | |
18 | // author: R.Diaz, J. Rak, D.J. Kim | |
19 | // ALICE Group University of Jyvaskyla | |
20 | // Finland | |
21 | // Fill the analysis containers for ESD or AOD | |
22 | // Adapted for AliAnalysisTaskSE and AOD objects | |
23 | ////////////////////////////////////////////////////////////////////////////// | |
24 | ||
25 | #include "AliAnalysisTaskSE.h" | |
26 | #include "AliAODHandler.h" | |
27 | #include "AliAnalysisManager.h" | |
28 | #include "AliLog.h" | |
29 | ||
30 | #include "AliJDiHadronCorrTask.h" | |
31 | #include "AliJEventHeader.h" | |
32 | #include "AliJRunHeader.h" | |
33 | #include "AliJCORRANTask.h" | |
34 | #include "AliJCard.h" | |
35 | ||
36 | //______________________________________________________________________________ | |
37 | AliJDiHadronCorrTask::AliJDiHadronCorrTask() : | |
38 | AliAnalysisTaskSE("AliJDiHadronCorrTaskTask"), | |
39 | fFilterTask(NULL), | |
40 | fFilterTaskName(""), | |
41 | fJCORRAN(0x0), | |
42 | fOutput(NULL) | |
43 | { | |
44 | DefineOutput (1, TDirectory::Class()); | |
45 | } | |
46 | ||
47 | //______________________________________________________________________________ | |
48 | AliJDiHadronCorrTask::AliJDiHadronCorrTask(const char *name, TString inputformat): | |
49 | AliAnalysisTaskSE(name), | |
50 | fFilterTask(NULL), | |
51 | fFilterTaskName(""), | |
52 | fJCORRAN(0x0), | |
53 | fOutput(NULL) | |
54 | { | |
55 | // Constructor | |
56 | AliInfo("---- AliJDiHadronCorrTask Constructor ----"); | |
57 | ||
58 | JUNUSED(inputformat); | |
59 | DefineOutput (1, TDirectory::Class()); | |
60 | } | |
61 | ||
62 | //____________________________________________________________________________ | |
63 | AliJDiHadronCorrTask::AliJDiHadronCorrTask(const AliJDiHadronCorrTask& ap) : | |
64 | AliAnalysisTaskSE(ap.GetName()), | |
65 | fFilterTask(ap.fFilterTask), | |
66 | fFilterTaskName(ap.fFilterTaskName), | |
67 | fJCORRAN( ap.fJCORRAN ), | |
68 | fOutput( ap.fOutput ) | |
69 | { | |
70 | ||
71 | AliInfo("----DEBUG AliJDiHadronCorrTask COPY ----"); | |
72 | ||
73 | } | |
74 | ||
75 | //_____________________________________________________________________________ | |
76 | AliJDiHadronCorrTask& AliJDiHadronCorrTask::operator = (const AliJDiHadronCorrTask& ap) | |
77 | { | |
78 | // assignment operator | |
79 | ||
80 | AliInfo("----DEBUG AliJDiHadronCorrTask operator= ----"); | |
81 | this->~AliJDiHadronCorrTask(); | |
82 | new(this) AliJDiHadronCorrTask(ap); | |
83 | return *this; | |
84 | } | |
85 | ||
86 | //______________________________________________________________________________ | |
87 | AliJDiHadronCorrTask::~AliJDiHadronCorrTask() | |
88 | { | |
89 | // destructor | |
90 | ||
91 | delete fJCORRAN; | |
92 | ||
93 | } | |
94 | ||
95 | //________________________________________________________________________ | |
96 | ||
97 | void AliJDiHadronCorrTask::UserCreateOutputObjects() | |
98 | { | |
99 | //=== create the jcorran outputs objects | |
100 | if(fDebug > 1) printf("AliJDiHadronCorrTask::UserCreateOutPutData() \n"); | |
101 | ||
102 | //=== Get AnalysisManager | |
103 | AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager(); | |
104 | if(!man->GetOutputEventHandler()) { | |
105 | Fatal("UserCreateOutputObjects", "This task needs an AOD handler"); | |
106 | return; | |
107 | } | |
108 | ||
109 | fFilterTask = (AliJCORRANTask*)(man->GetTask( fFilterTaskName )); | |
110 | ||
111 | OpenFile(1); | |
112 | fOutput = gDirectory;//->mkdir("JDiHadronCorr"); | |
113 | fOutput->cd(); | |
114 | ||
115 | // Order should be kept | |
116 | // TODO : better implementation | |
117 | //bool orignalTH1AdddirectoryStatus=TH1::AddDirectoryStatus(); | |
118 | // TODO Why? | |
119 | //TH1::AddDirectory(kTRUE); | |
120 | //if( !orignalTH1AdddirectoryStatus ) cout<<"DEBUG :: TH1::AddDirectory is turned on"<<endl; | |
121 | fJCORRAN->SetRunHeader( fFilterTask->GetJRunHeader() );//TODO | |
122 | fJCORRAN->UserCreateOutputObjects(); | |
123 | fJCORRAN->SetHeaderList(fFilterTask->GetFilter()->GetHeaderList() ); | |
124 | fJCORRAN->SetTrackList( fFilterTask->GetFilter()->GetTrackList() ); | |
125 | fJCORRAN->SetMCTrackList( fFilterTask->GetFilter()->GetMCTrackList() ); | |
126 | fJCORRAN->GetCard()->WriteCard(fOutput); | |
127 | ||
128 | PostData( 1, fOutput ); | |
129 | //TH1::AddDirectory( orignalTH1AdddirectoryStatus ); | |
130 | //cout<<"DEBYG :: TH1::AddDirectory get orignal Value = "<<( orignalTH1AdddirectoryStatus?"True":"False" )<<endl; | |
131 | ||
132 | cout << "Add(fAliRunHeader) in UserCreateObject() ======= " << endl; | |
133 | ||
134 | } | |
135 | ||
136 | //______________________________________________________________________________ | |
137 | void AliJDiHadronCorrTask::UserExec(Option_t* /*option*/) | |
138 | { | |
139 | ||
140 | // Processing of one event | |
141 | if(fDebug > 5) cout << "------- AliJDiHadronCorrTask Exec-------"<<endl; | |
142 | //if(!((Entry()-1)%100)) cout << Form(" Processing event # %lld", Entry()) << endl; | |
143 | ||
144 | ||
145 | //cout << "AliJDiHadronCorrTask::UserExec fFilterTask->GetFilter()->GetEventSuccess() = " << fFilterTask->GetFilter()->GetEventSuccess() << endl; | |
146 | if( fFilterTask->GetFilter()->GetEventSuccess() ){ | |
147 | fJCORRAN->UserExec(); | |
148 | PostData(1, fOutput ); | |
149 | } | |
150 | ||
151 | ||
152 | if(fDebug > 5) cout << "\t------- End UserExec "<<endl; | |
153 | } | |
154 | ||
155 | //______________________________________________________________________________ | |
156 | void AliJDiHadronCorrTask::Init() | |
157 | { | |
158 | // Intialisation of parameters | |
159 | AliInfo("Doing initialization") ; | |
160 | fJCORRAN->Init(); | |
161 | } | |
162 | ||
163 | //______________________________________________________________________________ | |
164 | void AliJDiHadronCorrTask::Terminate(Option_t *) | |
165 | { | |
87beb1a6 | 166 | /* |
9dc4f671 | 167 | fJCORRAN->Terminate(); |
168 | OpenFile(1); | |
169 | fOutput->cd(); | |
170 | ||
171 | cout<<"# Write Data "<<endl; | |
172 | //write Trigg ID and Assoc ID | |
173 | fOutput->Write(0,TObject::kOverwrite); | |
174 | PostData(1,fOutput); | |
87beb1a6 | 175 | */ |
9dc4f671 | 176 | cout<<"AliJDiHadronCorrTask Analysis DONE !!"<<endl; |
177 | ||
178 | } |