]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/STEERBase/AliTRDdEdxParams.cxx
4e15df9ea50c638e33330ef2b282e3c05da6b04d
[u/mrichter/AliRoot.git] / STEER / STEERBase / AliTRDdEdxParams.cxx
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
22 ClassImp(AliTRDdEdxParams);
23
24 AliTRDdEdxParams::AliTRDdEdxParams(const TString name, const TString title): TNamed(name,title)
25 {
26   //
27   //constructor
28   //
29 }
30
31 void AliTRDdEdxParams::CheckType(const Int_t itype, const TString tag) const 
32 {
33   //
34   //check if itype is in range
35   //
36
37   if(itype<0 || itype>=MAXNPAR){
38     AliError(Form("AliTRDdEdxParams::CheckType %s itype out of range %d\n", tag.Data(), itype));
39   }
40 }
41
42 const TVectorF AliTRDdEdxParams::GetParameter(const TVectorF par[], const Int_t itype)const
43 {
44   //
45   //return parameter for particle itype from par[]
46   //
47
48   CheckType(itype, "GetParameter");
49
50   return par[itype];
51 }
52
53 void AliTRDdEdxParams::SetParameter(TVectorF par[], const Int_t itype, const Int_t npar, const Float_t vals[])
54 {
55   //
56   //set parameter, vals of dimension npar, for particle itype
57   //
58
59   CheckType(itype, "SetParameter");
60
61   TVectorF p2(npar, vals);
62
63   par[itype].ResizeTo(p2);
64   par[itype] = p2;
65 }
66
67 void AliTRDdEdxParams::Print(Option_t* option) const
68 {
69   //
70   //print all members
71   //
72
73   TObject::Print(option);
74
75   printf("\n======================= Mean ========================\n");
76   for(Int_t ii=0; ii<MAXNPAR; ii++){
77     printf("%d: Nrows() %d\n",ii, fMeanPar[ii].GetNrows());
78     if(fMeanPar[ii].GetNrows()) fMeanPar[ii].Print();
79   }
80
81   printf("\n======================= Sigma ========================\n");
82
83   for(Int_t ii=0; ii<MAXNPAR; ii++){
84     printf("%d: Nrows() %d\n",ii, fSigmaPar[ii].GetNrows());
85     if(fSigmaPar[ii].GetNrows()) fSigmaPar[ii].Print();
86   }
87   printf("AliTRDdEdxParams::Print done.\n\n");
88 }