]>
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. |
5faf5a07 | 34 | // Defines another output slot for histograms/ntuples |
15d5fd02 | 35 | // |
5faf5a07 | 36 | |
2dab9030 | 37 | DefineOutput(2, TList::Class()); |
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 | // | |
5faf5a07 | 58 | // Assigment operator. |
32992791 | 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, | |
5faf5a07 | 78 | // which asks all the AliRsnPair objects to initialize their output which |
79 | // is then linked to the TList data member of this, which will contain all the output. | |
4fbb2459 | 80 | // |
81 | ||
5faf5a07 | 82 | if (!fOutList) fOutList = new TList; |
83 | fOutList->Clear(); | |
84 | ||
2dab9030 | 85 | fRsnAnalysisManager.InitAllPairs(fOutList); |
4fbb2459 | 86 | |
2dab9030 | 87 | PostData(2, fOutList); |
aec0ec32 | 88 | } |
89 | ||
4fbb2459 | 90 | //_____________________________________________________________________________ |
91 | void AliRsnAnalysisSE::RsnUserExec(Option_t*) | |
aec0ec32 | 92 | { |
4fbb2459 | 93 | // |
94 | // Execution of the analysis task. | |
5faf5a07 | 95 | // Recovers the input event and processes it with all included pair objects, |
96 | // using 'reconstructed' or 'MonteCarlo' functions depending on MC-only flag. | |
4fbb2459 | 97 | // |
98 | ||
5faf5a07 | 99 | if (fMCOnly) |
100 | fRsnAnalysisManager.ProcessAllPairsMC(); | |
101 | else | |
102 | fRsnAnalysisManager.ProcessAllPairs(); | |
4fbb2459 | 103 | |
2dab9030 | 104 | PostData(2, fOutList); |
aec0ec32 | 105 | } |
106 | ||
5eb970a4 | 107 | //_____________________________________________________________________________ |
4fbb2459 | 108 | void AliRsnAnalysisSE::RsnTerminate(Option_t*) |
5eb970a4 | 109 | { |
4fbb2459 | 110 | // |
111 | // Termination. | |
112 | // Could be added some monitor histograms here. | |
113 | // | |
aec0ec32 | 114 | } |
115 | ||
5faf5a07 | 116 | //______________________________________________________________________________ |
117 | Bool_t AliRsnAnalysisSE::EventProcess() | |
118 | { | |
119 | // | |
120 | // Customized event pre-processing. | |
121 | // First checks if the current event passes all cuts, | |
122 | // and if it does, updates the informations and then | |
123 | // call the operations which are already defined in the | |
124 | // omonyme function in mother class | |
125 | // | |
126 | ||
127 | // initially, an event is expected to be bad | |
128 | fTaskInfo.SetEventUsed(kFALSE); | |
129 | ||
130 | // check #1: number of tracks in event (reject empty events) | |
131 | Int_t ntracks = fRsnEvent.GetMultiplicity(); | |
132 | Double_t zeroEventPercent = 0.0; | |
133 | if (ntracks < 1) | |
134 | { | |
135 | // if using the checker for amount of empty events, update it | |
136 | if (fUseZeroEventWarning) | |
137 | { | |
138 | TH1I *hist = (TH1I*)fInfoList->FindObject(fTaskInfo.GetEventHistogramName()); | |
139 | if (hist) | |
140 | { | |
141 | if (hist->Integral() > 1) zeroEventPercent = (Double_t)hist->GetBinContent(1) / hist->Integral() * 100; | |
142 | if ((zeroEventPercent > fZeroEventPercentWarning) && (fEntry > 100)) | |
143 | AliWarning(Form("%3.2f%% Events are with zero tracks (CurrentEvent=%d)!!!", zeroEventPercent, fEntry)); | |
144 | } | |
145 | } | |
146 | ||
147 | // empty events are rejected by default | |
148 | fTaskInfo.SetEventUsed(kFALSE); | |
149 | AliDebug(AliLog::kDebug, "Empty event. Skipping..."); | |
150 | return kFALSE; | |
151 | } | |
152 | ||
153 | // check the event cuts and update the info data accordingly | |
154 | // events not passing the cuts must be rejected | |
155 | if (!fEventCuts.IsSelected(&fRsnEvent)) | |
156 | { | |
157 | fTaskInfo.SetEventUsed(kFALSE); | |
158 | return kFALSE; | |
159 | } | |
160 | ||
161 | // if we reach this point, cuts were passed; | |
162 | // then additional operations can be done | |
163 | ||
164 | // find leading particle (without any PID/momentum restriction) | |
165 | fRsnEvent.SelectLeadingParticle(0); | |
166 | ||
167 | // final return value is positive | |
168 | // but call the mother class method which updates info object | |
169 | fTaskInfo.SetEventUsed(kTRUE); | |
170 | return AliRsnVAnalysisTaskSE::EventProcess(); | |
171 | } |