]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSSteerPid.cxx
Missing copy constructor and assignment operator are added
[u/mrichter/AliRoot.git] / ITS / AliITSSteerPid.cxx
CommitLineData
e62c1aea 1/////////////////////////////////////////////////////////////////////////
2//Steering Class for PID in the ITS //
3//The PID is based on the likelihood of all the four ITS' layers, //
4//without using the truncated mean for the dE/dx. The response //
5//functions for each layer are convoluted Landau-Gaussian functions. //
6// Origin: Elena Bruna bruna@to.infn.it, Massimo Masera masera@to.infn.it//
7/////////////////////////////////////////////////////////////////////////
8
9#include "AliITSSteerPid.h"
10
11ClassImp(AliITSSteerPid)
12
13 //______________________________________________________________
14 AliITSSteerPid::AliITSSteerPid(){
15 // default constructor
16 fClonarr2=0;
17 fVect2=0;
18 fItem=0;
19 fFitTree=0;
20}
21//______________________________________________________________
22AliITSSteerPid::~AliITSSteerPid(){
23 // destructor
24 delete fClonarr2;
25 delete fFitTree;
26}
27
28//______________________________________________________________________
29AliITSSteerPid::AliITSSteerPid(const AliITSSteerPid &ob) :TObject(ob) {
30 // Copy constructor
31 // Copies are not allowed. The method is protected to avoid misuse.
32 Error("AliITSSteerPid","Copy constructor not allowed\n");
33}
34
35//______________________________________________________________________
36AliITSSteerPid& AliITSSteerPid::operator=(const AliITSSteerPid& /* ob */){
37 // Assignment operator
38 // Assignment is not allowed. The method is protected to avoid misuse.
39 Error("= operator","Assignment operator not allowed\n");
40 return *this;
41}
42
43//______________________________________________________________
44void AliITSSteerPid::InitLayer(TString fileITS,TString fileFitPar){
45 // it opens the files useful for the PID
e62c1aea 46 TFile *fClonarr2=new TFile (fileITS,"r");
47 fVect2=(TClonesArray*)fClonarr2->Get("vectfitits_0");//truncated mean
48 fVect2lay1=(TClonesArray*)fClonarr2->Get("vectfitits_1");//lay 1
49 fVect2lay2=(TClonesArray*)fClonarr2->Get("vectfitits_2");//lay 2
50 fVect2lay3=(TClonesArray*)fClonarr2->Get("vectfitits_3");//lay 3
51 fVect2lay4=(TClonesArray*)fClonarr2->Get("vectfitits_4");//lay 4
52
53 TFile *fFitPar=new TFile (fileFitPar);
54 fFitTree=(TTree*)fFitPar->Get("tree");
55
e62c1aea 56}
57
58//______________________________________________________________
59AliITSPidParItem* AliITSSteerPid::GetItemLayer(Int_t nolay,Float_t mom){
60 // it gives an AliITSPidParItem object for a given momentum and ITS layer
61 if(nolay==1) return Item(fVect2lay1,mom);
62 if(nolay==2) return Item(fVect2lay2,mom);
63 if(nolay==3) return Item(fVect2lay3,mom);
64 if(nolay==4) return Item(fVect2lay4,mom);
65 if(nolay!=1&&nolay!=2&&nolay!=3&&nolay!=4) {
66 fItem=new AliITSPidParItem();
67 return fItem;
68
69 }
70 return 0;
71}
72
73//______________________________________________________________
74void AliITSSteerPid::GetParFitLayer(Int_t nolay,Float_t mom,Double_t *parp,Double_t *park,Double_t *parpi){
149c4c59 75 //it gives the parameters of the convoluted functions (WL, MP, WG) for
76 //protons, kaons and pions for a given momentum and ITS layer
e62c1aea 77
78 Double_t parfit0pro[3]={0,0,0};
79 Double_t parfit1pro[3]={0,0,0};
80 Double_t parfit3pro[3]={0,0,0};
81 Double_t parfit0kao[3]={0,0,0};
82 Double_t parfit1kao[3]={0,0,0};
83 Double_t parfit3kao[3]={0,0,0};
84 Double_t parfit0pi[3]={0,0,0};
85 Double_t parfit1pi[3]={0,0,0};
86 Double_t parfit3pi[3]={0,0,0};
87
88 fFitTree->SetBranchAddress("par0pro",parfit0pro);
89 fFitTree->SetBranchAddress("par1pro",parfit1pro);
90 fFitTree->SetBranchAddress("par3pro",parfit3pro);
91
92 fFitTree->SetBranchAddress("par0kao",parfit0kao);
93 fFitTree->SetBranchAddress("par1kao",parfit1kao);
94 fFitTree->SetBranchAddress("par3kao",parfit3kao);
95
96 fFitTree->SetBranchAddress("par0pi",parfit0pi);
97 fFitTree->SetBranchAddress("par1pi",parfit1pi);
98 fFitTree->SetBranchAddress("par3pi",parfit3pi);
99 fFitTree->GetEvent(nolay);
100
101 GetLangausProPars(mom,parfit0pro,parfit1pro,parfit3pro,parp);
102 GetLangausKaoPars(mom,parfit0kao,parfit1kao,parfit3kao,park);
103 GetLangausPiPars(mom,parfit0pi,parfit1pi,parfit3pi,parpi);
104
105
106}//______________________________________________________________
107void AliITSSteerPid::GetLangausProPars(Float_t mom,Double_t *parfit0,Double_t *parfit1,Double_t *parfit3,Double_t *par){
108
149c4c59 109 //It finds the parameters of the convoluted Landau-Gaussian response
110 //function for protons (Width Landau, Most Probable, Width Gaussian)
e62c1aea 111 par[0]=parfit0[0]+parfit0[1]/mom;
112 par[1]=parfit1[0]/(mom*mom)+parfit1[1]/(mom*mom)*TMath::Log(mom*mom)+parfit1[2];
113 par[2]=parfit3[0]/(mom*mom)+parfit3[1]/(mom*mom)*TMath::Log(mom*mom)+parfit3[2];
114}
115//______________________________________________________________
116void AliITSSteerPid::GetLangausKaoPars(Float_t mom,Double_t *parfit0,Double_t *parfit1,Double_t *parfit3,Double_t *par){
149c4c59 117 // It finds the parameters of the convoluted Landau-Gaussian response
118 //function for kaons (Width Landau, Most Probable, Width Gaussian)
e62c1aea 119
120 par[0]=parfit0[0]+parfit0[1]/(mom*mom);
121 par[1]=parfit1[0]/(mom*mom)+parfit1[1]/(mom*mom)*TMath::Log(mom*mom)+parfit1[2];
122 par[2]=parfit3[0]/(mom*mom)+parfit3[1]/(mom*mom)*TMath::Log(mom*mom)+parfit3[2];
123}
124
125//______________________________________________________________
126void AliITSSteerPid::GetLangausPiPars(Float_t mom,Double_t *parfit0,Double_t *parfit1,Double_t *parfit3,Double_t *par){
149c4c59 127 //It finds the parameters of the convoluted Landau-Gaussian response
128 //function for pions (Width Landau, Most Probable, Width Gaussian)
e62c1aea 129
130 par[0]=parfit0[0]/(mom*mom)+parfit0[1]/(mom*mom)*TMath::Log(mom*mom)+parfit0[2];
131 par[1]=parfit1[0]/(mom)+parfit1[1]/(mom)*TMath::Log(mom*mom)+parfit1[2];
132 par[2]=parfit3[0]/(mom*mom)+parfit3[1]/(mom*mom)*TMath::Log(mom*mom)+parfit3[2];
133}
134
135
136
137//______________________________________________________________
138AliITSPidParItem* AliITSSteerPid::Item(TClonesArray *Vect,Float_t mom){
139
140 //it gives an AliITSPidParItem object taken from the TClonesArray.
141 Int_t mybin=-1;
142
143 AliITSPidParItem* punt;
144
145 for (Int_t a=0;a<50;a++){
146 punt=(AliITSPidParItem*)Vect->At(a);
147 Float_t centerp=punt->GetMomentumCenter();
148 Float_t widthp=punt->GetWidthMom();
149 if (mom>(centerp-widthp/2) && mom<=(centerp+widthp/2)) mybin=a;
150 }
151 if (mybin!=-1) fItem=(AliITSPidParItem*)Vect->At(mybin);
152 else {
153 fPCenter=0;
154 fPWidth=0;
155 for (Int_t ii=0;ii<52;ii++) fBuff[ii]=0;
156 fItem = new AliITSPidParItem(fPCenter,fPWidth,fBuff);
157 }
158
159 return fItem;
160
161
162
163}