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 **************************************************************************/
18 /////////////////////////////////////////////////////////////////////////
19 //Steering Class for PID in the ITS //
20 //The PID is based on the likelihood of all the four ITS' layers, //
21 //without using the truncated mean for the dE/dx. The response //
22 //functions for each layer are convoluted Landau-Gaussian functions. //
23 // Origin: Elena Bruna bruna@to.infn.it, Massimo Masera masera@to.infn.it//
24 /////////////////////////////////////////////////////////////////////////
28 #include "AliITSSteerPid.h"
30 ClassImp(AliITSSteerPid)
32 //______________________________________________________________
33 AliITSSteerPid::AliITSSteerPid():
45 // default constructor
47 //______________________________________________________________
48 AliITSSteerPid::~AliITSSteerPid(){
54 //______________________________________________________________________
55 AliITSSteerPid::AliITSSteerPid(const AliITSSteerPid &ob) :TObject(ob),
56 fClonarr2(ob.fClonarr2),
58 fVect2lay1(ob.fVect2lay1),
59 fVect2lay2(ob.fVect2lay2),
60 fVect2lay3(ob.fVect2lay3),
61 fVect2lay4(ob.fVect2lay4),
62 fFitTree(ob.fFitTree),
64 fPCenter(ob.fPCenter),
69 //______________________________________________________________________
70 AliITSSteerPid& AliITSSteerPid::operator=(const AliITSSteerPid& ob){
71 // Assignment operator
72 this->~AliITSSteerPid();
73 new(this) AliITSSteerPid(ob);
77 //______________________________________________________________
78 void AliITSSteerPid::InitLayer(TString fileITS,TString fileFitPar){
79 // it opens the files useful for the PID
80 TFile *fClonarr2=new TFile (fileITS,"r");
81 fVect2=(TClonesArray*)fClonarr2->Get("vectfitits_0");//truncated mean
82 fVect2lay1=(TClonesArray*)fClonarr2->Get("vectfitits_1");//lay 1
83 fVect2lay2=(TClonesArray*)fClonarr2->Get("vectfitits_2");//lay 2
84 fVect2lay3=(TClonesArray*)fClonarr2->Get("vectfitits_3");//lay 3
85 fVect2lay4=(TClonesArray*)fClonarr2->Get("vectfitits_4");//lay 4
87 TFile *fFitPar=new TFile (fileFitPar);
88 fFitTree=(TTree*)fFitPar->Get("tree");
92 //______________________________________________________________
93 AliITSPidParItem* AliITSSteerPid::GetItemLayer(Int_t nolay,Float_t mom){
94 // it gives an AliITSPidParItem object for a given momentum and ITS layer
95 if(nolay==1) return Item(fVect2lay1,mom);
96 if(nolay==2) return Item(fVect2lay2,mom);
97 if(nolay==3) return Item(fVect2lay3,mom);
98 if(nolay==4) return Item(fVect2lay4,mom);
99 if(nolay!=1&&nolay!=2&&nolay!=3&&nolay!=4) {
100 fItem=new AliITSPidParItem();
107 //______________________________________________________________
108 void AliITSSteerPid::GetParFitLayer(Int_t nolay,Float_t mom,Double_t *parp,Double_t *park,Double_t *parpi){
109 //it gives the parameters of the convoluted functions (WL, MP, WG) for
110 //protons, kaons and pions for a given momentum and ITS layer
112 Double_t parfit0pro[3]={0,0,0};
113 Double_t parfit1pro[3]={0,0,0};
114 Double_t parfit3pro[3]={0,0,0};
115 Double_t parfit0kao[3]={0,0,0};
116 Double_t parfit1kao[3]={0,0,0};
117 Double_t parfit3kao[3]={0,0,0};
118 Double_t parfit0pi[3]={0,0,0};
119 Double_t parfit1pi[3]={0,0,0};
120 Double_t parfit3pi[3]={0,0,0};
122 fFitTree->SetBranchAddress("par0pro",parfit0pro);
123 fFitTree->SetBranchAddress("par1pro",parfit1pro);
124 fFitTree->SetBranchAddress("par3pro",parfit3pro);
126 fFitTree->SetBranchAddress("par0kao",parfit0kao);
127 fFitTree->SetBranchAddress("par1kao",parfit1kao);
128 fFitTree->SetBranchAddress("par3kao",parfit3kao);
130 fFitTree->SetBranchAddress("par0pi",parfit0pi);
131 fFitTree->SetBranchAddress("par1pi",parfit1pi);
132 fFitTree->SetBranchAddress("par3pi",parfit3pi);
133 fFitTree->GetEvent(nolay);
135 GetLangausProPars(mom,parfit0pro,parfit1pro,parfit3pro,parp);
136 GetLangausKaoPars(mom,parfit0kao,parfit1kao,parfit3kao,park);
137 GetLangausPiPars(mom,parfit0pi,parfit1pi,parfit3pi,parpi);
140 }//______________________________________________________________
141 void AliITSSteerPid::GetLangausProPars(Float_t mom,Double_t *parfit0,Double_t *parfit1,Double_t *parfit3,Double_t *par){
143 //It finds the parameters of the convoluted Landau-Gaussian response
144 //function for protons (Width Landau, Most Probable, Width Gaussian)
145 par[0]=parfit0[0]+parfit0[1]/mom;
146 par[1]=parfit1[0]/(mom*mom)+parfit1[1]/(mom*mom)*TMath::Log(mom*mom)+parfit1[2];
147 par[2]=parfit3[0]/(mom*mom)+parfit3[1]/(mom*mom)*TMath::Log(mom*mom)+parfit3[2];
149 //______________________________________________________________
150 void AliITSSteerPid::GetLangausKaoPars(Float_t mom,Double_t *parfit0,Double_t *parfit1,Double_t *parfit3,Double_t *par){
151 // It finds the parameters of the convoluted Landau-Gaussian response
152 //function for kaons (Width Landau, Most Probable, Width Gaussian)
154 par[0]=parfit0[0]+parfit0[1]/(mom*mom);
155 par[1]=parfit1[0]/(mom*mom)+parfit1[1]/(mom*mom)*TMath::Log(mom*mom)+parfit1[2];
156 par[2]=parfit3[0]/(mom*mom)+parfit3[1]/(mom*mom)*TMath::Log(mom*mom)+parfit3[2];
159 //______________________________________________________________
160 void AliITSSteerPid::GetLangausPiPars(Float_t mom,Double_t *parfit0,Double_t *parfit1,Double_t *parfit3,Double_t *par){
161 //It finds the parameters of the convoluted Landau-Gaussian response
162 //function for pions (Width Landau, Most Probable, Width Gaussian)
164 par[0]=parfit0[0]/(mom*mom)+parfit0[1]/(mom*mom)*TMath::Log(mom*mom)+parfit0[2];
165 par[1]=parfit1[0]/(mom)+parfit1[1]/(mom)*TMath::Log(mom*mom)+parfit1[2];
166 par[2]=parfit3[0]/(mom*mom)+parfit3[1]/(mom*mom)*TMath::Log(mom*mom)+parfit3[2];
171 //______________________________________________________________
172 AliITSPidParItem* AliITSSteerPid::Item(TClonesArray *Vect,Float_t mom){
174 //it gives an AliITSPidParItem object taken from the TClonesArray.
177 AliITSPidParItem* punt;
179 for (Int_t a=0;a<50;a++){
180 punt=(AliITSPidParItem*)Vect->At(a);
181 Float_t centerp=punt->GetMomentumCenter();
182 Float_t widthp=punt->GetWidthMom();
183 if (mom>(centerp-widthp/2) && mom<=(centerp+widthp/2)) mybin=a;
185 if (mybin!=-1) fItem=(AliITSPidParItem*)Vect->At(mybin);
189 for (Int_t ii=0;ii<52;ii++) fBuff[ii]=0;
190 fItem = new AliITSPidParItem(fPCenter,fPWidth,fBuff);