]>
Commit | Line | Data |
---|---|---|
aec0ec32 | 1 | // |
9477aa42 | 2 | // Class AliRsnAnalysisSE |
aec0ec32 | 3 | // |
9477aa42 | 4 | // Virtual Class derivated from AliRsnVAnalysisTaskSE which will be base class |
5 | // for all RSN SE tasks | |
aec0ec32 | 6 | // |
9477aa42 | 7 | // authors: Martin Vala (martin.vala@cern.ch) |
8 | // Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it) | |
aec0ec32 | 9 | // |
9477aa42 | 10 | |
4fbb2459 | 11 | #include <Riostream.h> |
2dab9030 | 12 | #include <TList.h> |
4fbb2459 | 13 | #include "AliESDEvent.h" |
14 | #include "AliMCEvent.h" | |
15 | #include "AliAODEvent.h" | |
16 | ||
6f4a992c | 17 | #include "AliRsnCutSet.h" |
18 | #include "AliRsnVATProcessInfo.h" | |
aec0ec32 | 19 | #include "AliRsnAnalysisSE.h" |
20 | ||
21 | ClassImp(AliRsnAnalysisSE) | |
22 | ||
5eb970a4 | 23 | //_____________________________________________________________________________ |
2dab9030 | 24 | AliRsnAnalysisSE::AliRsnAnalysisSE(const char *name, Bool_t useKine) : |
25 | AliRsnVAnalysisTaskSE(name, useKine), | |
26 | fRsnAnalysisManager(), | |
cf4668f7 | 27 | fEventCuts("eventCuts", AliRsnCut::kEvent), |
2dab9030 | 28 | fOutList(0x0), |
cf4668f7 | 29 | fZeroEventPercentWarning(100), |
2dab9030 | 30 | fUseZeroEventWarning(kTRUE) |
aec0ec32 | 31 | { |
15d5fd02 | 32 | // |
4fbb2459 | 33 | // Default constructor. |
15d5fd02 | 34 | // |
cf4668f7 | 35 | AliDebug(AliLog::kDebug+2, "<-"); |
2dab9030 | 36 | DefineOutput(2, TList::Class()); |
5eb970a4 | 37 | AliDebug(AliLog::kDebug+2,"->"); |
aec0ec32 | 38 | } |
39 | ||
4fbb2459 | 40 | //_____________________________________________________________________________ |
41 | AliRsnAnalysisSE::AliRsnAnalysisSE(const AliRsnAnalysisSE& copy) : | |
42 | AliRsnVAnalysisTaskSE(copy), | |
43 | fRsnAnalysisManager(copy.fRsnAnalysisManager), | |
44 | fEventCuts(copy.fEventCuts), | |
2dab9030 | 45 | fOutList(0x0), |
4fbb2459 | 46 | fZeroEventPercentWarning(copy.fZeroEventPercentWarning), |
47 | fUseZeroEventWarning(copy.fUseZeroEventWarning) | |
aec0ec32 | 48 | { |
4fbb2459 | 49 | // |
50 | // Copy constructor. | |
51 | // | |
aec0ec32 | 52 | } |
53 | ||
32992791 | 54 | //_____________________________________________________________________________ |
55 | AliRsnAnalysisSE& AliRsnAnalysisSE::operator=(const AliRsnAnalysisSE& copy) | |
56 | { | |
57 | // | |
58 | // Copy constructor. | |
59 | // | |
60 | ||
61 | AliRsnVAnalysisTaskSE::operator=(copy); | |
62 | ||
63 | fRsnAnalysisManager = copy.fRsnAnalysisManager; | |
64 | fEventCuts = copy.fEventCuts; | |
65 | if (fOutList) fOutList->Clear(); | |
66 | fZeroEventPercentWarning = copy.fZeroEventPercentWarning; | |
67 | fUseZeroEventWarning = copy.fUseZeroEventWarning; | |
68 | ||
69 | return (*this); | |
70 | } | |
0d73200d | 71 | |
5eb970a4 | 72 | //_____________________________________________________________________________ |
73 | void AliRsnAnalysisSE::RsnUserCreateOutputObjects() | |
aec0ec32 | 74 | { |
4fbb2459 | 75 | // |
76 | // Creation of output objects. | |
77 | // These are created through the utility methods in the analysis manager, | |
78 | // which produces a list of histograms for each specified set of pairs. | |
79 | // Each of these lists is added to the main list of this task. | |
80 | // | |
81 | ||
5eb970a4 | 82 | AliDebug(AliLog::kDebug+2,"<-"); |
aec0ec32 | 83 | |
32992791 | 84 | if (fOutList) fOutList->Clear(); |
2dab9030 | 85 | fOutList = new TList; |
86 | fRsnAnalysisManager.InitAllPairs(fOutList); | |
4fbb2459 | 87 | |
2dab9030 | 88 | PostData(2, fOutList); |
aec0ec32 | 89 | |
5eb970a4 | 90 | AliDebug(AliLog::kDebug+2,"->"); |
aec0ec32 | 91 | } |
92 | ||
4fbb2459 | 93 | //_____________________________________________________________________________ |
94 | void AliRsnAnalysisSE::RsnUserExec(Option_t*) | |
aec0ec32 | 95 | { |
4fbb2459 | 96 | // |
97 | // Execution of the analysis task. | |
98 | // Recovers the input event and processes it with all included pair objects. | |
99 | // | |
100 | ||
5eb970a4 | 101 | AliDebug(AliLog::kDebug+2,"<-"); |
4fbb2459 | 102 | |
103 | fTaskInfo.SetEventUsed(kFALSE); | |
104 | ||
5eb970a4 | 105 | if (fESDEvent) { |
4fbb2459 | 106 | AliDebug(AliLog::kDebug+1, Form("fESDEvent is %p", fESDEvent)); |
107 | AliDebug(AliLog::kDebug, Form("ESD tracks %d", fESDEvent->GetNumberOfTracks())); | |
5eb970a4 | 108 | } |
109 | if (fMCEvent) { | |
4fbb2459 | 110 | AliDebug(AliLog::kDebug+1, Form("fMCEvent is %p", fMCEvent)); |
111 | AliDebug(AliLog::kDebug, Form("MC tracks %d", fMCEvent->GetNumberOfTracks())); | |
5eb970a4 | 112 | } |
113 | if (fAODEventIn) { | |
4fbb2459 | 114 | AliDebug(AliLog::kDebug+1, Form("fAODEventIn is %p", fAODEventIn)); |
115 | AliDebug(AliLog::kDebug, Form("AOD(in) tracks %d", fAODEventIn->GetNumberOfTracks())); | |
aec0ec32 | 116 | } |
5eb970a4 | 117 | if (fAODEventOut) { |
4fbb2459 | 118 | AliDebug(AliLog::kDebug+1, Form("fAODEventOut if %p", fAODEventOut)); |
119 | AliDebug(AliLog::kDebug, Form("AOD(out) tracks %d", fAODEventOut->GetNumberOfTracks())); | |
5eb970a4 | 120 | } |
aec0ec32 | 121 | |
4fbb2459 | 122 | // Removing empty events |
123 | if (fRsnEvent.GetMultiplicity()<=0) { | |
124 | AliDebug(AliLog::kDebug, "Zero event!!! Skipping ..."); | |
125 | fTaskInfo.SetEventUsed(kFALSE); | |
126 | if (fUseZeroEventWarning) | |
127 | { | |
2dab9030 | 128 | TH1I *hist = (TH1I*)fInfoList->FindObject(fTaskInfo.GetEventHistogramName()); |
4fbb2459 | 129 | if (!hist) return; |
102dd8c7 | 130 | Double_t zeroEventPercent = 0.0; |
131 | if (hist->Integral() > 1) zeroEventPercent = (Double_t)hist->GetBinContent(1) / hist->Integral() * 100; | |
4fbb2459 | 132 | if ((zeroEventPercent>fZeroEventPercentWarning)&&(fEntry>100)) |
133 | AliWarning(Form("%3.2f%% Events are with zero tracks (CurrentEvent=%d)!!!",zeroEventPercent,fEntry)); | |
134 | } | |
cf4668f7 | 135 | return; |
4fbb2459 | 136 | } |
137 | ||
138 | // if general event cuts are added to the task (recommended) | |
139 | // they are checked here on the RSN event interface and, | |
140 | // if the event does not pass them, it is skipped and ProcessInfo | |
141 | // is updated accordingly | |
cf4668f7 | 142 | // if (fEventCuts) { |
143 | if (!fEventCuts.IsSelected(&fRsnEvent)) { | |
4fbb2459 | 144 | fTaskInfo.SetEventUsed(kFALSE); |
6f4a992c | 145 | return; |
146 | } | |
cf4668f7 | 147 | // } |
aec0ec32 | 148 | |
4fbb2459 | 149 | // if cuts are passed or not cuts were defined, |
150 | // update the task info... | |
151 | fTaskInfo.SetEventUsed(kTRUE); | |
aec0ec32 | 152 | |
4fbb2459 | 153 | // the virtual class has already sorted tracks in the PID index |
154 | // so we need here just to call the execution of analysis | |
2e521c29 | 155 | if (!fMCOnly) fRsnAnalysisManager.ProcessAllPairs(&fRsnEvent, &fRsnEvent); |
156 | else fRsnAnalysisManager.ProcessAllPairsMC(&fRsnEvent, &fRsnEvent); | |
2dab9030 | 157 | PostData(2, fOutList); |
158 | ||
5eb970a4 | 159 | AliDebug(AliLog::kDebug+2,"->"); |
aec0ec32 | 160 | } |
161 | ||
aec0ec32 | 162 | |
5eb970a4 | 163 | //_____________________________________________________________________________ |
4fbb2459 | 164 | void AliRsnAnalysisSE::RsnTerminate(Option_t*) |
5eb970a4 | 165 | { |
4fbb2459 | 166 | // |
167 | // Termination. | |
168 | // Could be added some monitor histograms here. | |
169 | // | |
170 | ||
5eb970a4 | 171 | AliDebug(AliLog::kDebug+2,"<-"); |
172 | AliDebug(AliLog::kDebug+2,"->"); | |
aec0ec32 | 173 | } |
174 |