]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSpidESD2.cxx
Coding convention violations: suppression
[u/mrichter/AliRoot.git] / ITS / AliITSpidESD2.cxx
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
16 /* $Id$ */
17
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"
29 #include "AliESDEvent.h"
30 #include "AliESDtrack.h"
31 #include "AliITSLoader.h"
32 #include "AliITSPidParams.h"
33 #include "AliITSPident.h"
34 #include "AliLog.h"
35
36 ClassImp(AliITSpidESD2)
37 //_________________________________________________________________________
38 AliITSpidESD2::AliITSpidESD2():
39   AliITSpidESD(),
40   fPidPars(0)
41
42   //  The main constructor
43   fPidPars=new AliITSPidParams("default");
44 }
45
46
47 //_________________________________________________________________________
48 AliITSpidESD2::~AliITSpidESD2(){
49   //destructor
50
51   if(fPidPars)delete fPidPars;
52 }
53
54
55 //______________________________________________________________________
56 AliITSpidESD2::AliITSpidESD2(const AliITSpidESD2 &ob) :AliITSpidESD(ob),
57 fPidPars(ob.fPidPars) 
58 {
59   // Copy constructor
60 }
61
62
63 //______________________________________________________________________
64 AliITSpidESD2& AliITSpidESD2::operator=(const AliITSpidESD2& ob ){
65   // Assignment operator
66   this->~AliITSpidESD2();
67   new(this) AliITSpidESD2(ob);
68   return *this;
69 }
70
71     
72 //______________________________________________________________________
73 void AliITSpidESD2::GetITSpidSingleTrack(AliESDtrack* esdtr, Double_t condprobfun[]){
74   // Method to calculate PID probabilities for a single track
75   
76   
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);
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
90
91
92 //_________________________________________________________________________
93 Int_t AliITSpidESD2::MakePID(AliESDEvent *event){
94   //  This function calculates the "detector response" PID probabilities 
95
96   Int_t ntrk=event->GetNumberOfTracks();
97   const Int_t kns=AliPID::kSPECIES;
98   Double_t condprobfun[kns];
99     
100   for (Int_t i=0; i<ntrk; i++) {
101     AliESDtrack *esdtr=event->GetTrack(i);
102     if ((esdtr->GetStatus()&AliESDtrack::kITSin )==0){
103       if ((esdtr->GetStatus()&AliESDtrack::kITSout)==0) continue;
104     }
105     GetITSpidSingleTrack(esdtr,condprobfun);
106     esdtr->SetITSpid(condprobfun);
107   }
108   return 0;
109 }