]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/AliRsnAnalysisME.cxx
Made a general review to fix as possible most coding conventions violations.
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnAnalysisME.cxx
CommitLineData
5eb970a4 1//
2// Class AliRsnAnalysisME
3//
4// TODO
4fbb2459 5// TODO
5eb970a4 6//
7// authors: Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
8// Martin Vala (martin.vala@cern.ch)
9//
10
4fbb2459 11#include "AliESDEvent.h"
12#include "AliMCEvent.h"
13#include "AliAODEvent.h"
14
5eb970a4 15#include "AliRsnAnalysisME.h"
16
17ClassImp(AliRsnAnalysisME)
18
19//_____________________________________________________________________________
20AliRsnAnalysisME::AliRsnAnalysisME(const char *name) :
21 AliRsnVAnalysisTaskME(name),
e79f56bd 22 fRsnAnalysisManager(),
23 fPIDIndex(0),
24 fPIDIndexMix(0),
25 fEvent(),
4fbb2459 26 fEventMix()
5eb970a4 27{
28//
29// Default constructor
30//
31 AliDebug(AliLog::kDebug+2,"<-");
32 AliDebug(AliLog::kDebug+2,"->");
33}
34
35AliRsnAnalysisME::AliRsnAnalysisME(const AliRsnAnalysisME& copy) : AliRsnVAnalysisTaskME(copy),
e79f56bd 36 fRsnAnalysisManager(copy.fRsnAnalysisManager),
37 fPIDIndex(copy.fPIDIndex),
38 fPIDIndexMix(copy.fPIDIndexMix),
39 fEvent(copy.fEvent),
4fbb2459 40 fEventMix(copy.fEvent)
5eb970a4 41{
42 AliDebug(AliLog::kDebug+2,"<-");
43 AliDebug(AliLog::kDebug+2,"->");
44}
45
46//_____________________________________________________________________________
47void AliRsnAnalysisME::RsnUserCreateOutputObjects()
48{
4fbb2459 49//
50// TODO
51//
5eb970a4 52 AliLog::SetClassDebugLevel(GetName(), fLogType);
53 AliDebug(AliLog::kDebug+2,"<-");
54// AliRsnVAnalysisTaskME::UserCreateOutputObjects();
55
56// fRsnEvent = new AliRsnEvent();
57// fRsnEvent->SetName("rsnEvents");
58// fRsnEvent->Init();
59// AddAODBranch("AliRsnEvent", &fRsnEvent);
60
61// fOutList = new TList();
62//
63// fOutList->Add(fTaskInfo.GenerateInfoList());
64
4fbb2459 65// fOutList->Add();
66 fRsnAnalysisManager.InitAllPairMgrs(fOutList);
5eb970a4 67// fRsnAnalysisManager.Print();
68
69 AliDebug(AliLog::kDebug+2,"->");
70}
71
4fbb2459 72void AliRsnAnalysisME::RsnUserExec(Option_t*)
5eb970a4 73{
4fbb2459 74//
75// TODO
76//
77
5eb970a4 78 AliDebug(AliLog::kDebug+2,"<-");
79 if (fESDEvent) {
80 AliDebug(AliLog::kDebug+1,Form("fESDEvent if %p",fESDEvent));
81 AliDebug(AliLog::kDebug,Form("ESD tracks %d",fESDEvent->GetNumberOfTracks()));
82 }
83 if (fMCEvent) {
84 AliDebug(AliLog::kDebug+1,Form("fMCEvent if %p",fMCEvent));
85 AliDebug(AliLog::kDebug,Form("MC tracks %d",fMCEvent->GetNumberOfTracks()));
86 }
87 if (fAODEvent) {
88 AliDebug(AliLog::kDebug+1,Form("fAODEvent if %p",fAODEvent));
89 AliDebug(AliLog::kDebug,Form("AOD tracks %d",fAODEvent->GetNumberOfTracks()));
90 }
91
92 AliAODEvent* aod1 = (AliAODEvent*)GetEvent(0);
93 AliAODEvent* aod2 = (AliAODEvent*)GetEvent(1);
94
95 // assign events
96 fEvent.SetRef(aod1);
97 fEventMix.SetRef(aod2);
98 if (fEvent.GetMultiplicity() < 2) return;
99 if (fEventMix.GetMultiplicity() < 2) return;
100
101 // sort tracks w.r. to PID
102 fPIDIndex.ResetAll(fEvent.GetMultiplicity());
4fbb2459 103 fEvent.SetPriorProbability(fPrior);
104 fPIDIndex.FillFromEvent(&fEvent);
5eb970a4 105 fPIDIndex.SetCorrectIndexSize();
106
107 fPIDIndexMix.ResetAll(fEventMix.GetMultiplicity());
4fbb2459 108 fEventMix.SetPriorProbability(fPrior);
109 fPIDIndexMix.FillFromEvent(&fEventMix);
5eb970a4 110 fPIDIndexMix.SetCorrectIndexSize();
111
112 fRsnAnalysisManager.ProcessAllPairMgrs(&fPIDIndex, &fEvent, &fPIDIndexMix, &fEventMix);
113
114 AliDebug(AliLog::kDebug,Form("AOD tracks %d",aod1->GetNumberOfTracks()));
115 AliDebug(AliLog::kDebug,Form("AOD tracks %d",aod2->GetNumberOfTracks()));
116 AliDebug(AliLog::kDebug+2,"->");
117}
118
119
120//_____________________________________________________________________________
4fbb2459 121void AliRsnAnalysisME::RsnTerminate(Option_t*)
5eb970a4 122{
4fbb2459 123//
124// TODO
125//
126
5eb970a4 127 AliDebug(AliLog::kDebug+2,"<-");
128 AliDebug(AliLog::kDebug+2,"->");
129}
130
4fbb2459 131//_____________________________________________________________________________
5eb970a4 132AliRsnAnalysisManager* AliRsnAnalysisME::GetAnalysisManager(TString name)
133{
4fbb2459 134//
135// Gets all prior probabilities to out
136//
137
5eb970a4 138 if (!name.IsNull()) {
139 SetAnalysisManagerName(name.Data());
140 }
141 return &fRsnAnalysisManager;
142}
143
144//_____________________________________________________________________________
145void AliRsnAnalysisME::SetPriorProbability(AliPID::EParticleType type, Double_t p)
146{
147 //
148 // Sets the prior probability for Realistic PID, for a
149 // given particle species.
150 //
151
152 if (type >= 0 && type < (Int_t)AliPID::kSPECIES) {
153 fPrior[type] = p;
154 }
155
156}
157
158//_____________________________________________________________________________
159void AliRsnAnalysisME::DumpPriors()
160{
161 //
162 // Print all prior probabilities
163 //
164
165 Int_t i;
166 for (i = 0; i < AliPID::kSPECIES; i++) {
167 AliInfo(Form("Prior probability for %10s = %3.5f", AliPID::ParticleName((AliPID::EParticleType)i), fPrior[i]));
168 }
169}
170
171//_____________________________________________________________________________
4fbb2459 172void AliRsnAnalysisME::GetPriorProbability(Double_t *out) const
5eb970a4 173{
4fbb2459 174//
175// Gets all prior probabilities to out
176//
5eb970a4 177
178 Int_t i;
179 for (i=0;i<AliPID::kSPECIES;i++) {
180 out[i] = fPrior[i];
181 }
182}