Added V0A23 (V0 rings 2-3), V0C01 (V0 rings 0-1) and V0S = V0A23+V0C01
[u/mrichter/AliRoot.git] / STEER / STEERBase / AliTRDdEdxParams.cxx
CommitLineData
9c499471 1/**************************************************************************
2 * Copyright(c) 1998-1999, 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// Xianguo Lu <lu@physi.uni-heidelberg.de>
17//
18
19#include "AliLog.h"
20#include "AliTRDdEdxParams.h"
21
22ClassImp(AliTRDdEdxParams);
23
24AliTRDdEdxParams::AliTRDdEdxParams(const TString name, const TString title): TNamed(name,title)
25{
26 //
27 //constructor
28 //
29}
30
a8da1749 31Int_t AliTRDdEdxParams::GetIter(const Int_t itype, const Int_t nch, const Int_t ncls) const
9c499471 32{
33 //
a8da1749 34 //return array iterator
9c499471 35 //
36
a8da1749 37 Int_t itNch = -999, itNcls = -999;
38
39 //hard coded cuts
40 if(nch==6){
41 itNch = 0;
42 }
43 else{
44 itNch = 1;
45 }
46
f8a569cc 47 if(nch!=0 && ncls/nch>=18){
a8da1749 48 itNcls = 0;
49 }
50 else{
51 itNcls = 1;
9c499471 52 }
a8da1749 53
54 const Int_t finaliter = itype*2*2 + itNch*2 + itNcls;
55
56 if(finaliter<0 || finaliter>= MAXSIZE){
57 AliError(Form("out of range itype %d nch %d ncls %d\n", itype, nch, ncls));
58 }
59
60 return finaliter;
9c499471 61}
62
a8da1749 63const TVectorF& AliTRDdEdxParams::GetParameter(const TVectorF par[], const Int_t itype, const Int_t nch, const Int_t ncls)const
9c499471 64{
65 //
66 //return parameter for particle itype from par[]
67 //
68
a8da1749 69 const Int_t iter = GetIter(itype, nch, ncls);
9c499471 70
a8da1749 71 return par[iter];
9c499471 72}
73
a8da1749 74void AliTRDdEdxParams::SetParameter(TVectorF par[], const Int_t itype, const Int_t nch, const Int_t ncls, const Int_t npar, const Float_t vals[])
9c499471 75{
76 //
77 //set parameter, vals of dimension npar, for particle itype
78 //
79
a8da1749 80 const Int_t iter = GetIter(itype, nch, ncls);
9c499471 81
82 TVectorF p2(npar, vals);
83
a8da1749 84 par[iter].ResizeTo(p2);
85 par[iter] = p2;
9c499471 86}
87
88void AliTRDdEdxParams::Print(Option_t* option) const
89{
90 //
91 //print all members
92 //
93
94 TObject::Print(option);
95
96 printf("\n======================= Mean ========================\n");
a8da1749 97 for(Int_t ii=0; ii<MAXSIZE; ii++){
9c499471 98 printf("%d: Nrows() %d\n",ii, fMeanPar[ii].GetNrows());
99 if(fMeanPar[ii].GetNrows()) fMeanPar[ii].Print();
100 }
101
102 printf("\n======================= Sigma ========================\n");
103
a8da1749 104 for(Int_t ii=0; ii<MAXSIZE; ii++){
9c499471 105 printf("%d: Nrows() %d\n",ii, fSigmaPar[ii].GetNrows());
106 if(fSigmaPar[ii].GetNrows()) fSigmaPar[ii].Print();
107 }
108 printf("AliTRDdEdxParams::Print done.\n\n");
109}