]>
Commit | Line | Data |
---|---|---|
3a72645a | 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 | // Class AliHFEpidQAmanager | |
17 | // Does steering of the PID QA. The PID QA manager is initialized according | |
18 | // to the configuration used for PID. It contains PID objects inheriting | |
19 | // from AliHFEdetPIDqa, which are | |
20 | // AliHFEtpcPIDqa | |
21 | // AliHFEtrdPIDqaV1 | |
22 | // AliHFEtofPIDqa | |
23 | // PID QA objects are filled for every detector before PID decision and | |
24 | // after PID decision for tracks which are selected by the given detector | |
25 | // as electron candidates. | |
26 | // | |
27 | // Author | |
28 | // Markus Fasel <M.Fasel@gsi.de> | |
29 | // | |
30 | #include <TList.h> | |
31 | ||
32 | #include "AliAODpidUtil.h" | |
33 | #include "AliESDpid.h" | |
34 | #include "AliVParticle.h" | |
35 | ||
36 | #include "AliHFEtpcPIDqa.h" | |
37 | #include "AliHFEtrdPIDqaV1.h" | |
38 | #include "AliHFEtofPIDqa.h" | |
39 | #include "AliHFEpidQAmanager.h" | |
40 | ||
41 | ClassImp(AliHFEpidQAmanager) | |
42 | ||
43 | //____________________________________________________________ | |
44 | AliHFEpidQAmanager::AliHFEpidQAmanager(): | |
45 | TObject() | |
46 | { | |
47 | // | |
48 | // Dummy constructor | |
49 | // | |
50 | memset(fDetPIDqa, 0, sizeof(AliHFEdetPIDqa *) * AliHFEpid::kNdetectorPID); | |
51 | SetOwner(); | |
52 | } | |
53 | ||
54 | //____________________________________________________________ | |
55 | AliHFEpidQAmanager::AliHFEpidQAmanager(const AliHFEpidQAmanager &ref): | |
56 | TObject(ref) | |
57 | { | |
58 | // | |
59 | // Copy constructor | |
60 | // | |
61 | ref.Copy(*this); | |
62 | SetOwner(); | |
63 | } | |
64 | ||
65 | //____________________________________________________________ | |
66 | AliHFEpidQAmanager &AliHFEpidQAmanager::operator=(const AliHFEpidQAmanager &ref){ | |
67 | // | |
68 | // Assignment operator | |
69 | // | |
70 | if(this != &ref) ref.Copy(*this); | |
71 | SetOwner(); | |
72 | return *this; | |
73 | } | |
74 | ||
75 | //____________________________________________________________ | |
76 | void AliHFEpidQAmanager::Copy(TObject &o) const{ | |
77 | // | |
78 | // Make copy | |
79 | // | |
80 | TObject::Copy(o); | |
81 | AliHFEpidQAmanager &target = dynamic_cast<AliHFEpidQAmanager &>(o); | |
82 | ||
83 | for(Int_t idet = 0; idet < AliHFEpid::kNdetectorPID; idet++){ | |
84 | if(target.fDetPIDqa[idet]) delete target.fDetPIDqa[idet]; | |
85 | if(fDetPIDqa[idet]) target.CreateDetPIDqa(static_cast<AliHFEpid::EDETtype_t>(idet)); | |
86 | } | |
87 | } | |
88 | ||
89 | //____________________________________________________________ | |
90 | AliHFEpidQAmanager::~AliHFEpidQAmanager(){ | |
91 | // | |
92 | // Destructor | |
93 | // | |
94 | if(IsOwner()) | |
95 | for(Int_t idet = 0; idet < AliHFEpid::kNdetectorPID; idet++){ | |
96 | if(fDetPIDqa[idet]) delete fDetPIDqa[idet]; | |
97 | } | |
98 | } | |
99 | ||
100 | //____________________________________________________________ | |
101 | void AliHFEpidQAmanager::Initialize(AliHFEpid *pid){ | |
102 | // | |
103 | // Initialize PID QA manager according to the detector | |
104 | // configuration used in the PID | |
105 | // | |
106 | for(Int_t idet = 0; idet < AliHFEpid::kNdetectorPID; idet++) | |
107 | if(pid->HasDetector(static_cast<AliHFEpid::EDETtype_t>(idet))){ | |
108 | CreateDetPIDqa(static_cast<AliHFEpid::EDETtype_t>(idet)); | |
109 | fDetPIDqa[idet]->Initialize(); | |
110 | } | |
111 | } | |
112 | ||
113 | //____________________________________________________________ | |
114 | void AliHFEpidQAmanager::CreateDetPIDqa(AliHFEpid::EDETtype_t idet){ | |
115 | // | |
116 | // Create new PID QA object | |
117 | // | |
118 | switch(idet){ | |
119 | case AliHFEpid::kTPCpid: | |
120 | fDetPIDqa[idet] = new AliHFEtpcPIDqa("TPCQA"); | |
121 | break; | |
122 | case AliHFEpid::kTRDpid: | |
123 | fDetPIDqa[idet] = new AliHFEtrdPIDqaV1("TRDQA"); | |
124 | break; | |
125 | case AliHFEpid::kTOFpid: | |
126 | fDetPIDqa[idet] = new AliHFEtofPIDqa("TOFQA"); | |
127 | break; | |
128 | default: | |
129 | break; | |
130 | }; | |
131 | } | |
132 | ||
133 | //____________________________________________________________ | |
134 | void AliHFEpidQAmanager::ProcessTrack(AliHFEpidObject *track, AliHFEpid::EDETtype_t det, AliHFEdetPIDqa::EStep_t step){ | |
135 | // | |
136 | // Process single Track | |
137 | // | |
138 | if(!fDetPIDqa[det]){ | |
139 | AliDebug(1, Form("QA for detector %d not available", det)); | |
140 | return; | |
141 | } | |
142 | AliDebug(1, Form("Doing QA for detector %d\n", det)); | |
143 | fDetPIDqa[det]->ProcessTrack(track, step); | |
144 | } | |
145 | ||
146 | //____________________________________________________________ | |
147 | TList *AliHFEpidQAmanager::MakeList(const Char_t *name){ | |
148 | // | |
149 | // Make List of PID QA objects | |
150 | // | |
151 | TList *list = new TList; | |
152 | list->SetName(name); | |
153 | list->SetOwner(); | |
154 | for(Int_t idet = 0; idet < AliHFEpid::kNdetectorPID; idet++){ | |
155 | if(fDetPIDqa[idet]) list->Add(fDetPIDqa[idet]); | |
156 | } | |
157 | ReleaseOwnerShip(); | |
158 | return list; | |
159 | } | |
160 | ||
161 | //____________________________________________________________ | |
162 | void AliHFEpidQAmanager::SetESDpid(AliESDpid *esdpid){ | |
163 | // | |
164 | // Publish ESD PID | |
165 | // | |
166 | for(Int_t idet = 0; idet < AliHFEpid::kNdetectorPID; idet++) | |
167 | if(fDetPIDqa[idet]) fDetPIDqa[idet]->SetESDpid(esdpid); | |
168 | } | |
169 | ||
170 | //____________________________________________________________ | |
171 | void AliHFEpidQAmanager::SetAODpid(AliAODpidUtil *aodpid){ | |
172 | // | |
173 | // Publish AOD PID | |
174 | // | |
175 | for(Int_t idet = 0; idet < AliHFEpid::kNdetectorPID; idet++) | |
176 | if(fDetPIDqa[idet]) fDetPIDqa[idet]->SetAODpid(aodpid); | |
177 | } | |
178 |