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 to benchmark the V0 pid capabilties
20 // runs over reconstructed V0 candidates and uses MC information for
21 // further analysis [purity, PID perfortmance]
24 // Matus Kalisky <matus.kalisky@cern.ch>
27 #include "TIterator.h"
29 #include "AliVParticle.h"
30 #include "AliESDtrack.h"
31 #include "AliMCParticle.h"
32 #include "AliMCEvent.h"
34 #include "AliHFEcollection.h"
36 #include "AliHFEV0pidMC.h"
37 ClassImp(AliHFEV0pidMC)
39 //____________________________________________________________
40 AliHFEV0pidMC::AliHFEV0pidMC():
46 // default constructor
50 //____________________________________________________________
51 AliHFEV0pidMC::~AliHFEV0pidMC(){
55 if (fColl) delete fColl;
56 //if (fV0cuts) delete fV0cuts;
58 //____________________________________________________________
59 void AliHFEV0pidMC::Init(){
64 fColl = new AliHFEcollection("V0pidMC", "MC based V0 benchmarking");
66 fColl->CreateTH1F("h_QA_nParticles", "QA on track processing", 10, -0.5, 9.5);
68 const Int_t nBins = 20;
69 const Float_t pMin = 0.1;
70 const Float_t pMax = 10.;
73 fColl->CreateTH1F("h_Electron", "all electron candidates (no MC); p (GeV/c); counts", nBins, pMin, pMax, 0);
74 fColl->CreateTH1F("h_PionK0", "all K0 pion candidates (no MC); p (GeV/c); counts", nBins, pMin, pMax, 0);
75 fColl->CreateTH1F("h_PionL", "all Lambda pion candidates (no MC); p (GeV/c); counts", nBins, pMin, pMax, 0);
76 fColl->CreateTH1F("h_Kaon", "all Kaon candidates (no MC); p (GeV/c); counts", nBins, pMin, pMax, 0);
77 fColl->CreateTH1F("h_Proton", "all Lambda proton candidates (no MC); p (GeV/c); counts", nBins, pMin, pMax, 0);
79 fColl->CreateTH1F("h_mis_Electron", "all NON electron candidates MC tagged; p (GeV/c); counts", nBins, pMin, pMax, 0);
80 fColl->CreateTH1F("h_mis_PionK0", "all NON K0 pion candidates MC tagged; p (GeV/c); counts", nBins, pMin, pMax, 0);
81 fColl->CreateTH1F("h_mis_PionL", "all NON Lambda pion candidates MC tagged ; p (GeV/c); counts", nBins, pMin, pMax, 0);
82 fColl->CreateTH1F("h_mis_Kaon", "all NON Kaon candidates MC tagged; p (GeV/c); counts", nBins, pMin, pMax, 0);
83 fColl->CreateTH1F("h_mis_Proton", "all NON Lambda proton candidates MC tagged; p (GeV/c); counts", nBins, pMin, pMax, 0);
85 fColl->CreateTH1Fvector1(5, "h_tag_Electron", "electron candidate MC tagged; p (GeV/c); counts", nBins, pMin, pMax, 0);
86 fColl->CreateTH1Fvector1(5, "h_tag_PionK0", "K0 pion candidate MC tagged; p (GeV/c); counts", nBins, pMin, pMax, 0);
87 fColl->CreateTH1Fvector1(5, "h_tag_PionL", "Lambda pion candidate MC tagged; p (GeV/c); counts", nBins, pMin, pMax, 0);
88 fColl->CreateTH1Fvector1(5, "h_tag_Kaon", "kaon candidate MC tagged; p (GeV/c); counts", nBins, pMin, pMax, 0);
89 fColl->CreateTH1Fvector1(5, "h_tag_Proton", "Lambda proton candidate MC tagged; p (GeV/c); counts", nBins, pMin, pMax, 0);
92 //____________________________________________________________
93 Bool_t AliHFEV0pidMC::Process(TObjArray * const particles, Int_t type){
95 // process the selected V0 daughter tracks
99 const TString typeName[5] = {"Electron", "PionK0", "PionL", "Kaon", "Proton"};
100 const Int_t typePID[5] = {0, 2, 2, 3, 4};
102 if(!fMC) return kFALSE;
103 if(!particles) return kFALSE;
105 AliVParticle *recTrack = NULL;
106 TIterator *trackIter = particles->MakeIterator();
107 while((recTrack = dynamic_cast<AliVParticle *>(trackIter->Next()))){
108 fColl->Fill("h_QA_nParticles", 0);
110 AliESDtrack *track = dynamic_cast<AliESDtrack *>(recTrack);
112 const AliExternalTrackParam *ext = track->GetOuterParam();
115 Int_t label = track->GetLabel();
117 fColl->Fill("h_QA_nParticles", 1);
120 AliMCParticle *mcpD = dynamic_cast<AliMCParticle*>(fMC->GetTrack(label));
122 fColl->Fill("h_QA_nParticles", 2);
126 Float_t p = ext->P();
127 //Short_t charge = ext->Charge();
128 Int_t pdgD = mcpD->PdgCode();
129 AliMCParticle *mcpM = dynamic_cast<AliMCParticle*>(fMC->GetTrack(mcpD->GetMother()));
131 fColl->Fill("h_QA_nParticles", 3);
134 //Int_t pdgM = mcpM->PdgCode();
137 hname = "h_" + typeName[type];
138 fColl->Fill(hname, p);
139 Int_t pidD = PDGtoPIDdaughter(pdgD);
141 // all misidentified candidates
142 hname = "h_mis_" + typeName[type];
143 if(typePID[type] != pidD){
144 fColl->Fill(hname, p);
147 // for every particle fill detailed information about the missidentified particles
148 hname = "h_tag_" + typeName[type];
149 Int_t aliPID = PDGtoAliPID(pdgD);
150 fColl->Fill(hname, aliPID, p);
152 }// .. loop over array
157 //____________________________________________________________
158 Int_t AliHFEV0pidMC::PDGtoPIDdaughter(Int_t pdg) const {
160 // convert PDG to local pid
162 switch (TMath::Abs(pdg)){
164 return 0; // electron gamma
166 return 2; // pion K0 or pion Lambda
170 return 4; // proton Lambda
177 //____________________________________________________________
178 Int_t AliHFEV0pidMC::PDGtoPIDmother(Int_t pdg) const {
180 // convert PDG to local pid
182 switch (TMath::Abs(pdg)){
197 //____________________________________________________________
198 Int_t AliHFEV0pidMC::PDGtoAliPID(Int_t pdg) const {
200 // convert PDG to AliPID
203 switch (TMath::Abs(pdg)){
205 return 0; // electron