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 "AliHFEpidQAmanager.h"
41 ClassImp(AliHFEpidQAmanager)
43 //____________________________________________________________
44 AliHFEpidQAmanager::AliHFEpidQAmanager():
50 memset(fDetPIDqa, 0, sizeof(AliHFEdetPIDqa *) * AliHFEpid::kNdetectorPID);
51 memset(fDetPID, 0, sizeof(AliHFEdetPIDqa *) * AliHFEpid::kNdetectorPID);
55 //____________________________________________________________
56 AliHFEpidQAmanager::AliHFEpidQAmanager(const AliHFEpidQAmanager &ref):
66 //____________________________________________________________
67 AliHFEpidQAmanager &AliHFEpidQAmanager::operator=(const AliHFEpidQAmanager &ref){
69 // Assignment operator
71 if(this != &ref) ref.Copy(*this);
76 //____________________________________________________________
77 void AliHFEpidQAmanager::Copy(TObject &o) const{
82 AliHFEpidQAmanager &target = dynamic_cast<AliHFEpidQAmanager &>(o);
84 for(Int_t idet = 0; idet < AliHFEpid::kNdetectorPID; idet++){
85 target.fDetPID[idet] = fDetPID[idet];
86 if(target.fDetPIDqa[idet]) delete target.fDetPIDqa[idet];
87 if(fDetPIDqa[idet]) target.CreateDetPIDqa(static_cast<AliHFEpid::EDETtype_t>(idet));
91 //____________________________________________________________
92 AliHFEpidQAmanager::~AliHFEpidQAmanager(){
97 for(Int_t idet = 0; idet < AliHFEpid::kNdetectorPID; idet++){
98 if(fDetPIDqa[idet]) delete fDetPIDqa[idet];
102 //____________________________________________________________
103 void AliHFEpidQAmanager::Initialize(AliHFEpid *pid){
105 // Initialize PID QA manager according to the detector
106 // configuration used in the PID
108 for(Int_t idet = 0; idet < AliHFEpid::kNdetectorPID; idet++){
109 // Initialize Array for detector PID for all detectors
110 fDetPID[idet] = pid->GetDetPID(static_cast<AliHFEpid::EDETtype_t>(idet));
111 if(pid->HasDetector(static_cast<AliHFEpid::EDETtype_t>(idet))){
112 CreateDetPIDqa(static_cast<AliHFEpid::EDETtype_t>(idet));
113 fDetPIDqa[idet]->SetPIDqaManager(this);
114 fDetPIDqa[idet]->Initialize();
119 //____________________________________________________________
120 void AliHFEpidQAmanager::CreateDetPIDqa(AliHFEpid::EDETtype_t idet){
122 // Create new PID QA object
125 case AliHFEpid::kTPCpid:
126 fDetPIDqa[idet] = new AliHFEtpcPIDqa("TPCQA");
128 case AliHFEpid::kTRDpid:
129 fDetPIDqa[idet] = new AliHFEtrdPIDqaV1("TRDQA");
131 case AliHFEpid::kTOFpid:
132 fDetPIDqa[idet] = new AliHFEtofPIDqa("TOFQA");
139 //____________________________________________________________
140 void AliHFEpidQAmanager::ProcessTrack(const AliHFEpidObject *track, AliHFEpid::EDETtype_t det, AliHFEdetPIDqa::EStep_t step){
142 // Process single Track
145 AliDebug(1, Form("QA for detector %d not available", det));
148 AliDebug(1, Form("Doing QA for detector %d\n", det));
149 fDetPIDqa[det]->ProcessTrack(track, step);
152 //____________________________________________________________
153 TList *AliHFEpidQAmanager::MakeList(const Char_t *name){
155 // Make List of PID QA objects
157 TList *list = new TList;
160 for(Int_t idet = 0; idet < AliHFEpid::kNdetectorPID; idet++){
161 if(fDetPIDqa[idet]) list->Add(fDetPIDqa[idet]);