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