Line data Source code
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 : //
20 : // modified 10/08/15 by Lucas Altenkaemper <altenkaemper@physi.uni-heidelberg.de>
21 : //
22 :
23 :
24 : #include "AliLog.h"
25 : #include "AliTRDdEdxParams.h"
26 :
27 176 : ClassImp(AliTRDdEdxParams);
28 :
29 0 : AliTRDdEdxParams::AliTRDdEdxParams(const TString name, const TString title): TNamed(name,title)
30 0 : {
31 : //
32 : //constructor
33 : //
34 0 : }
35 :
36 : Int_t AliTRDdEdxParams::GetIter(const Int_t itype, const Int_t nch, const Int_t ncls, const Bool_t etaCorrection) const
37 : {
38 : //
39 : //return array iterator
40 : //
41 :
42 : Int_t itNch = -999, itNcls = -999, itEtaCorr = -999;
43 :
44 : //hard coded cuts // <4, 4, 5 or 6 layer
45 0 : if (nch == 6) {
46 : itNch = 0;
47 0 : } else if (nch == 5) {
48 : itNch = 1;
49 0 : } else if (nch == 4) {
50 : itNch = 2;
51 0 : } else if (nch < 4){
52 : itNch = 3;
53 0 : }
54 :
55 0 : if (nch != 0 && ncls/nch >= 17) { // QA cut minimum ncls
56 : itNcls = 0;
57 0 : }
58 : else {
59 : itNcls = 1;
60 : }
61 :
62 0 : if (etaCorrection) { // eta correction
63 : itEtaCorr = 0;
64 0 : } else {
65 : itEtaCorr = 1;
66 : }
67 :
68 0 : const Int_t finaliter = itEtaCorr*80 + itNcls*40 + itNch*10 + itype;
69 :
70 0 : if (finaliter < 0 || finaliter >= MAXSIZE) {
71 0 : AliError(Form("out of range itype %d, nch %d, ncls %d\n", itype, nch, ncls));
72 0 : }
73 :
74 0 : return finaliter;
75 : }
76 :
77 : const TVectorF& AliTRDdEdxParams::GetParameter(const TVectorF par[], const Int_t itype, const Int_t nch, const Int_t ncls, const Bool_t etaCorrection)const
78 : {
79 : //
80 : //return parameter for particle itype from par[]
81 : //
82 :
83 0 : const Int_t iter = GetIter(itype, nch, ncls, etaCorrection);
84 :
85 0 : return par[iter];
86 : }
87 :
88 : void AliTRDdEdxParams::SetParameter(TVectorF par[], const Int_t itype, const Int_t nch, const Int_t ncls, const Int_t npar, const Float_t vals[], const Bool_t etaCorrection)
89 : {
90 : //
91 : //set parameter, vals of dimension npar, for particle itype
92 : //
93 :
94 0 : const Int_t iter = GetIter(itype, nch, ncls, etaCorrection);
95 :
96 0 : TVectorF p2(npar, vals);
97 :
98 0 : par[iter].ResizeTo(p2);
99 0 : par[iter] = p2;
100 0 : }
101 :
102 : void AliTRDdEdxParams::Print(Option_t* option) const
103 : {
104 : //
105 : //print all members
106 : //
107 :
108 0 : TObject::Print(option);
109 :
110 0 : printf("\n======================= Mean ========================\n");
111 0 : for(Int_t ii = 0; ii < MAXSIZE; ii++){
112 0 : printf("%d: Nrows() %d\n",ii, fMeanPar[ii].GetNrows());
113 0 : if(fMeanPar[ii].GetNrows()) fMeanPar[ii].Print();
114 : }
115 :
116 0 : printf("\n======================= Sigma ========================\n");
117 0 : for(Int_t ii = 0; ii < MAXSIZE; ii++){
118 0 : printf("%d: Nrows() %d\n",ii, fSigmaPar[ii].GetNrows());
119 0 : if(fSigmaPar[ii].GetNrows()) fSigmaPar[ii].Print();
120 : }
121 :
122 0 : printf("AliTRDdEdxParams::Print done.\n\n");
123 0 : }
|