]>
Commit | Line | Data |
---|---|---|
0116859c | 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 | ||
7d855b04 | 16 | /// \class AliTPCInverseCorrection |
17 | /// \brief AliTPCInverseCorrection class | |
18 | /// | |
19 | /// This is a wrapper that inverts an AliTPCCorrection. This is done by | |
20 | /// swapping the CalculateCorrection and CalculateInverseCorrection functions. | |
21 | /// The wrapped correction is supplied as a pointer and the class relies | |
22 | /// on the fact, that this pointer keeps pointing to the right object. | |
23 | /// However, the ownership is not changed, i.e. the wrapped correction | |
24 | /// will not be deleted when this correction is destructed. | |
25 | /// | |
26 | /// \author Magnus Mager, Stefan Rossegger, Jim Thomas | |
27 | /// \date 27/04/2010 | |
0116859c | 28 | |
29 | #include <TString.h> | |
30 | #include "AliTPCInverseCorrection.h" | |
e527a1b9 | 31 | #include <TTimeStamp.h> |
32 | ||
0116859c | 33 | |
34 | AliTPCInverseCorrection::AliTPCInverseCorrection() | |
35 | : fCorrection(0) { | |
7d855b04 | 36 | /// default constructor |
37 | /// (only meant for ROOT I/O) | |
38 | ||
0116859c | 39 | } |
40 | ||
7d855b04 | 41 | AliTPCInverseCorrection::AliTPCInverseCorrection(AliTPCCorrection *correction) |
0116859c | 42 | : fCorrection(correction) { |
7d855b04 | 43 | /// Constructor that is creating the inverse of the supplied correction. |
44 | /// It automatically sets the name ("inv_[correction name]") and tile | |
45 | /// ("Inverse of [correction title]"). | |
46 | ||
0116859c | 47 | TString name,title; |
48 | name ="inv_"; | |
49 | name +=correction->GetName(); | |
50 | title ="Inverse of "; | |
51 | title+=correction->GetTitle(); | |
52 | SetName(name.Data()); | |
53 | SetTitle(title.Data()); | |
54 | } | |
55 | ||
56 | AliTPCInverseCorrection::~AliTPCInverseCorrection() { | |
7d855b04 | 57 | /// virtual destructor |
58 | ||
c9cbd2f2 | 59 | if (fCorrection) delete fCorrection; |
0116859c | 60 | } |
61 | ||
e527a1b9 | 62 | |
63 | void AliTPCInverseCorrection::Init() { | |
7d855b04 | 64 | /// Initialization funtion (not used at the moment) |
65 | ||
e527a1b9 | 66 | if (fCorrection) fCorrection->Init(); |
67 | ||
68 | } | |
69 | ||
70 | void AliTPCInverseCorrection::Update(const TTimeStamp &timeStamp) { | |
7d855b04 | 71 | /// Update function |
72 | ||
e527a1b9 | 73 | if (fCorrection) fCorrection->Update(timeStamp); |
74 | ||
75 | } | |
76 | ||
1b923461 | 77 | void AliTPCInverseCorrection::Print(Option_t* option) const { |
7d855b04 | 78 | /// Print function to check which correction classes are used |
79 | /// option=="d" prints details regarding the setted magnitude | |
80 | /// option=="a" prints the C0 and C1 coefficents for calibration purposes | |
1b923461 | 81 | |
82 | printf("Inverse of "); | |
83 | if (fCorrection) fCorrection->Print(option); | |
84 | } | |
85 | ||
0116859c | 86 | void AliTPCInverseCorrection::GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]) { |
7d855b04 | 87 | /// This is just calling the CalculateInverseCorrection of the wrapped |
88 | /// correction -- or puts dr=0 if the latter is 0. | |
89 | ||
0116859c | 90 | if (fCorrection) |
91 | fCorrection->GetDistortion(x,roc,dx); | |
92 | else | |
93 | for (Int_t j=0;j<3;++j) dx[j]=0.; | |
94 | } | |
95 | ||
1b923461 | 96 | void AliTPCInverseCorrection:: SetOmegaTauT1T2(Float_t omegaTau,Float_t t1,Float_t t2) { |
7d855b04 | 97 | /// Virtual funtion to pass the wt values (might become event dependent) to the inherited classes |
98 | /// t1 and t2 represent the "effective omegaTau" corrections and were measured in a dedicated | |
99 | /// calibration run | |
100 | ||
1b923461 | 101 | if (fCorrection) fCorrection->SetOmegaTauT1T2(omegaTau, t1, t2); |
102 | } | |
103 | ||
0116859c | 104 | void AliTPCInverseCorrection::GetDistortion(const Float_t x[],const Short_t roc,Float_t dx[]) { |
7d855b04 | 105 | /// This is just calling the CalculateCorrection of the wrapped |
106 | /// correction -- or puts dr=0 if the latter is 0. | |
107 | ||
0116859c | 108 | if (fCorrection) |
109 | fCorrection->GetCorrection(x,roc,dx); | |
110 | else | |
111 | for (Int_t j=0;j<3;++j) dx[j]=0.; | |
112 | } | |
113 | ||
7d855b04 | 114 | /// \cond CLASSIMP |
0116859c | 115 | ClassImp(AliTPCInverseCorrection) |
7d855b04 | 116 | /// \endcond |