1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
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
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.
28 // Markus Fasel <M.Fasel@gsi.de>
32 #include "AliAODpidUtil.h"
33 #include "AliESDpid.h"
34 #include "AliVParticle.h"
36 #include "AliHFEtpcPIDqa.h"
37 #include "AliHFEtrdPIDqaV1.h"
38 #include "AliHFEtofPIDqa.h"
39 #include "AliHFEitsPIDqa.h"
40 #include "AliHFEemcalPIDqa.h" //s.s
41 #include "AliHFEbayesPIDqa.h"
42 #include "AliHFEpidQAmanager.h"
44 ClassImp(AliHFEpidQAmanager)
46 //____________________________________________________________
47 AliHFEpidQAmanager::AliHFEpidQAmanager():
53 memset(fDetPIDqa, 0, sizeof(AliHFEdetPIDqa *) * AliHFEpid::kNdetectorPID);
54 memset(fDetPID, 0, sizeof(AliHFEdetPIDqa *) * AliHFEpid::kNdetectorPID);
58 //____________________________________________________________
59 AliHFEpidQAmanager::AliHFEpidQAmanager(const AliHFEpidQAmanager &ref):
69 //____________________________________________________________
70 AliHFEpidQAmanager &AliHFEpidQAmanager::operator=(const AliHFEpidQAmanager &ref){
72 // Assignment operator
74 if(this != &ref) ref.Copy(*this);
79 //____________________________________________________________
80 void AliHFEpidQAmanager::Copy(TObject &o) const{
85 AliHFEpidQAmanager &target = dynamic_cast<AliHFEpidQAmanager &>(o);
87 for(Int_t idet = 0; idet < AliHFEpid::kNdetectorPID; idet++){
88 target.fDetPID[idet] = fDetPID[idet];
89 if(target.fDetPIDqa[idet]) delete target.fDetPIDqa[idet];
90 if(fDetPIDqa[idet]) target.CreateDetPIDqa(static_cast<AliHFEpid::EDETtype_t>(idet));
94 //____________________________________________________________
95 AliHFEpidQAmanager::~AliHFEpidQAmanager(){
100 for(Int_t idet = 0; idet < AliHFEpid::kNdetectorPID; idet++){
101 if(fDetPIDqa[idet]) delete fDetPIDqa[idet];
105 //____________________________________________________________
106 void AliHFEpidQAmanager::Initialize(AliHFEpid *pid){
108 // Initialize PID QA manager according to the detector
109 // configuration used in the PID
111 for(Int_t idet = 0; idet < AliHFEpid::kNdetectorPID; idet++){
112 // Initialize Array for detector PID for all detectors
113 fDetPID[idet] = pid->GetDetPID(static_cast<AliHFEpid::EDETtype_t>(idet));
114 if(pid->HasDetector(static_cast<AliHFEpid::EDETtype_t>(idet))){
115 CreateDetPIDqa(static_cast<AliHFEpid::EDETtype_t>(idet));
117 fDetPIDqa[idet]->SetPIDqaManager(this);
118 fDetPIDqa[idet]->Initialize();
124 //____________________________________________________________
125 void AliHFEpidQAmanager::CreateDetPIDqa(AliHFEpid::EDETtype_t idet){
127 // Create new PID QA object
130 case AliHFEpid::kTPCpid:
131 fDetPIDqa[idet] = new AliHFEtpcPIDqa("TPCQA");
133 case AliHFEpid::kTRDpid:
134 fDetPIDqa[idet] = new AliHFEtrdPIDqaV1("TRDQA");
136 case AliHFEpid::kTOFpid:
137 fDetPIDqa[idet] = new AliHFEtofPIDqa("TOFQA");
139 case AliHFEpid::kITSpid:
140 fDetPIDqa[idet] = new AliHFEitsPIDqa("ITSQA");
142 case AliHFEpid::kEMCALpid: //s.s (name)
143 fDetPIDqa[idet] = new AliHFEemcalPIDqa("EMCALQA"); // s.s
145 case AliHFEpid::kBAYESpid:
146 fDetPIDqa[idet] = new AliHFEbayesPIDqa("BAYESQA");
154 //____________________________________________________________
155 void AliHFEpidQAmanager::ProcessTrack(const AliHFEpidObject *track, AliHFEpid::EDETtype_t det, AliHFEdetPIDqa::EStep_t step){
157 // Process single Track
160 AliDebug(1, Form("QA for detector %d not available", det));
163 AliDebug(1, Form("Doing QA for detector %d\n", det));
164 fDetPIDqa[det]->ProcessTrack(track, step);
167 //____________________________________________________________
168 TList *AliHFEpidQAmanager::MakeList(const Char_t *name){
170 // Make List of PID QA objects
172 TList *list = new TList;
175 for(Int_t idet = 0; idet < AliHFEpid::kNdetectorPID; idet++){
176 if(fDetPIDqa[idet]) list->Add(fDetPIDqa[idet]);