]>
Commit | Line | Data |
---|---|---|
e62c1aea | 1 | /************************************************************************** |
2 | * Copyright(c) 2005-2007, 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 | ||
1fad94b4 | 16 | /* $Id$ */ |
17 | ||
e62c1aea | 18 | //-----------------------------------------------------------------------// |
19 | // ITS PID class --- method # 2 // | |
20 | // // | |
21 | // // | |
22 | //The PID is based on the likelihood of all the four ITS' layers, // | |
23 | //without using the truncated mean for the dE/dx. The response // | |
24 | //functions for each layer are convoluted Landau-Gaussian functions. // | |
25 | // Origin: Elena Bruna bruna@to.infn.it, Massimo Masera masera@to.infn.it// | |
26 | //-----------------------------------------------------------------------// | |
27 | ||
28 | #include "AliITSpidESD2.h" | |
af885e0f | 29 | #include "AliESDEvent.h" |
e62c1aea | 30 | #include "AliESDtrack.h" |
e62c1aea | 31 | #include "AliITSLoader.h" |
b536a002 | 32 | #include "AliITSPidParams.h" |
e62c1aea | 33 | #include "AliITSPident.h" |
e62c1aea | 34 | #include "AliLog.h" |
35 | ||
36 | ClassImp(AliITSpidESD2) | |
37 | //_________________________________________________________________________ | |
1919a678 | 38 | AliITSpidESD2::AliITSpidESD2(): |
39 | AliITSpidESD(), | |
b536a002 | 40 | fPidPars(0) |
1919a678 | 41 | { |
e62c1aea | 42 | // The main constructor |
b536a002 | 43 | fPidPars=new AliITSPidParams("default"); |
e62c1aea | 44 | } |
1919a678 | 45 | |
46 | ||
e62c1aea | 47 | //_________________________________________________________________________ |
48 | AliITSpidESD2::~AliITSpidESD2(){ | |
49 | //destructor | |
50 | ||
b536a002 | 51 | if(fPidPars)delete fPidPars; |
e62c1aea | 52 | } |
1919a678 | 53 | |
54 | ||
e62c1aea | 55 | //______________________________________________________________________ |
94631b2f | 56 | AliITSpidESD2::AliITSpidESD2(const AliITSpidESD2 &ob) :AliITSpidESD(ob), |
b536a002 | 57 | fPidPars(ob.fPidPars) |
94631b2f | 58 | { |
e62c1aea | 59 | // Copy constructor |
e62c1aea | 60 | } |
61 | ||
1919a678 | 62 | |
e62c1aea | 63 | //______________________________________________________________________ |
94631b2f | 64 | AliITSpidESD2& AliITSpidESD2::operator=(const AliITSpidESD2& ob ){ |
e62c1aea | 65 | // Assignment operator |
94631b2f | 66 | this->~AliITSpidESD2(); |
67 | new(this) AliITSpidESD2(ob); | |
e62c1aea | 68 | return *this; |
69 | } | |
70 | ||
1919a678 | 71 | |
72 | //______________________________________________________________________ | |
73 | void AliITSpidESD2::GetITSpidSingleTrack(AliESDtrack* esdtr, Double_t condprobfun[]){ | |
74 | // Method to calculate PID probabilities for a single track | |
75 | ||
1919a678 | 76 | |
b536a002 | 77 | Double_t prip=0.33; |
78 | Double_t prik=0.33; | |
79 | Double_t pripi=0.33; | |
80 | Double_t prie=0.; | |
81 | AliITSPident mypid(esdtr,fPidPars,prip,prik,pripi,prie); | |
1919a678 | 82 | condprobfun[0]=mypid.GetProdCondFunPi();//el --PID in the ITS does not distinguish among Pi,el,mu |
83 | condprobfun[1]=mypid.GetProdCondFunPi();//mu | |
84 | condprobfun[2]=mypid.GetProdCondFunPi();//pi | |
85 | condprobfun[3]=mypid.GetProdCondFunK();//kaon | |
86 | condprobfun[4]=mypid.GetProdCondFunPro();//pro | |
87 | return; | |
88 | } | |
89 | ||
e62c1aea | 90 | |
1919a678 | 91 | |
92 | //_________________________________________________________________________ | |
93 | Int_t AliITSpidESD2::MakePID(AliESDEvent *event){ | |
e62c1aea | 94 | // This function calculates the "detector response" PID probabilities |
1919a678 | 95 | |
e62c1aea | 96 | Int_t ntrk=event->GetNumberOfTracks(); |
1919a678 | 97 | const Int_t kns=AliPID::kSPECIES; |
98 | Double_t condprobfun[kns]; | |
99 | ||
e62c1aea | 100 | for (Int_t i=0; i<ntrk; i++) { |
101 | AliESDtrack *esdtr=event->GetTrack(i); | |
1919a678 | 102 | if ((esdtr->GetStatus()&AliESDtrack::kITSin )==0){ |
e62c1aea | 103 | if ((esdtr->GetStatus()&AliESDtrack::kITSout)==0) continue; |
e62c1aea | 104 | } |
1919a678 | 105 | GetITSpidSingleTrack(esdtr,condprobfun); |
e62c1aea | 106 | esdtr->SetITSpid(condprobfun); |
1fad94b4 | 107 | } |
e62c1aea | 108 | return 0; |
109 | } |