]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCSensorTempArray.cxx
First version of the SHUTTLE preprocessor (Haavard, Marian)
[u/mrichter/AliRoot.git] / TPC / AliTPCSensorTempArray.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
17 ///////////////////////////////////////////////////////////////////////////////
18 //                                                                           //
19 //  TPC calibration class for parameters which saved per pad                 //
20 //  Authors: Marian Ivanov and Haavard Helstrup                              //
21 //                                                                           //
22 ///////////////////////////////////////////////////////////////////////////////
23
24 #include "AliTPCSensorTempArray.h"
25
26 ClassImp(AliTPCSensorTempArray)
27
28 const char kFname[] = "TempSensor.txt";
29 const Int_t  kMinGraph = 10;       // minimum #points of graph to be fitted
30 const Int_t  kMinPoints = 10;      // minimum number of points per knot in fit
31 const Int_t  kIter = 10;           // number of iterations for spline fit
32 const Double_t  kMaxDelta = 0.00;  // precision parameter for spline fit
33 const Int_t  kFitReq = 2;          // fit requirement, 2 = continuous 2nd derivative
34
35 //_____________________________________________________________________________
36 AliTPCSensorTempArray::AliTPCSensorTempArray():AliDCSSensorArray()
37 {
38   //
39   // AliTPCSensorTempArray default constructor
40   //
41   fSensors = 0;
42   fFirstSensor = 0;
43   fLastSensor = 0;
44   TTimeStamp defTime(2000,1,1,0,0,0);
45   fStartTime = defTime;
46   fEndTime = defTime;
47
48 }
49 //_____________________________________________________________________________
50 AliTPCSensorTempArray::AliTPCSensorTempArray(Int_t prevRun) : 
51                 AliDCSSensorArray(prevRun,"TPC/Calib/Temperature")
52 {
53 }
54 //_____________________________________________________________________________
55 AliTPCSensorTempArray::AliTPCSensorTempArray(UInt_t startTime, UInt_t endTime)
56              :AliDCSSensorArray()
57 {
58   //
59   // AliTPCSensorTempArray default constructor
60   //
61   fSensors = AliTPCSensorTemp::ReadListInd(kFname,fFirstSensor,fLastSensor);
62   fStartTime = TTimeStamp(startTime);
63   fEndTime   = TTimeStamp(endTime);
64
65 }
66
67 //_____________________________________________________________________________
68 AliTPCSensorTempArray::AliTPCSensorTempArray(const char *fname) : 
69                                                   AliDCSSensorArray()
70 {
71   //
72   // AliTPCSensorTempArray constructor
73   //
74   fSensors = AliTPCSensorTemp::ReadListInd(fname,fFirstSensor,fLastSensor);
75   fSensors->BypassStreamer(kFALSE);
76   TTimeStamp defTime(2000,1,1,0,0,0);
77   fStartTime = defTime;
78   fEndTime = defTime;
79
80 }
81
82
83 //_____________________________________________________________________________
84 AliTPCSensorTempArray::AliTPCSensorTempArray(const AliTPCSensorTempArray &c):
85   AliDCSSensorArray(c)
86 {
87   //
88   // AliTPCSensorTempArray copy constructor
89   //
90
91 }
92
93 ///_____________________________________________________________________________
94 AliTPCSensorTempArray::~AliTPCSensorTempArray()
95 {
96   //
97   // AliTPCSensorTempArray destructor
98   //
99   fSensors->Delete();
100   delete fSensors;
101
102 }
103
104 //_____________________________________________________________________________
105 AliTPCSensorTempArray &AliTPCSensorTempArray::operator=(const AliTPCSensorTempArray &c)
106 {
107   //
108   // Assignment operator
109   //
110
111   if (this != &c) ((AliTPCSensorTempArray &) c).Copy(*this);
112   return *this;
113
114 }
115
116 //_____________________________________________________________________________
117 void AliTPCSensorTempArray::Copy(TObject &c) const
118 {
119   //
120   // Copy function
121   //
122
123   TObject::Copy(c);
124 }
125 //_____________________________________________________________________________
126 void AliTPCSensorTempArray::ReadSensors(const char *fname) 
127 {
128   //
129   // Read list of temperature sensors from text file
130   //
131   fSensors = AliTPCSensorTemp::ReadListInd(fname,fFirstSensor,fLastSensor);
132 }  
133 //_____________________________________________________________________________
134 void AliTPCSensorTempArray::SetGraph(TMap *map) 
135 {
136   // 
137   // Read graphs from DCS maps 
138   //
139   AliDCSSensorArray::SetGraph(map,"tpc_temp:PT_%d.Temperature");
140 }  
141 //_____________________________________________________________________________
142 void AliTPCSensorTempArray::MakeSplineFit(TMap *map) 
143 {
144   // 
145   // Make spline fits from DCS maps 
146   //
147   AliDCSSensorArray::MakeSplineFit(map,"tpc_temp:PT_%d.Temperature");
148 }  
149
150
151 //_____________________________________________________________________________
152 TMap* AliTPCSensorTempArray::ExtractDCS(TMap *dcsMap) 
153 {
154  //
155  // Extract temperature graphs from DCS maps
156  //
157
158  TMap *values = AliDCSSensorArray::ExtractDCS(dcsMap,"tpc_temp:PT_%d.Temperature");
159  return values;
160 }
161