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 **************************************************************************/
19 // Class AliHFEpidQAmanager
20 // Does steering of the PID QA. The PID QA manager is initialized according
21 // to the configuration used for PID. It contains PID objects inheriting
22 // from AliHFEdetPIDqa, which are
26 // PID QA objects are filled for every detector before PID decision and
27 // after PID decision for tracks which are selected by the given detector
28 // as electron candidates.
31 // Markus Fasel <M.Fasel@gsi.de>
35 #include "AliAODpidUtil.h"
36 #include "AliESDpid.h"
37 #include "AliVParticle.h"
39 #include "AliHFEtpcPIDqa.h"
40 #include "AliHFEtrdPIDqaV1.h"
41 #include "AliHFEtofPIDqa.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");
144 //____________________________________________________________
145 void AliHFEpidQAmanager::ProcessTrack(const AliHFEpidObject *track, AliHFEpid::EDETtype_t det, AliHFEdetPIDqa::EStep_t step){
147 // Process single Track
150 AliDebug(1, Form("QA for detector %d not available", det));
153 AliDebug(1, Form("Doing QA for detector %d\n", det));
154 fDetPIDqa[det]->ProcessTrack(track, step);
157 //____________________________________________________________
158 TList *AliHFEpidQAmanager::MakeList(const Char_t *name){
160 // Make List of PID QA objects
162 TList *list = new TList;
165 for(Int_t idet = 0; idet < AliHFEpid::kNdetectorPID; idet++){
166 if(fDetPIDqa[idet]) list->Add(fDetPIDqa[idet]);