]>
Commit | Line | Data |
---|---|---|
7264822f | 1 | /************************************************************************** |
2 | * Copyright(c) 2006-07, 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 | // Class describing TPC temperature sensors (including pointers to graphs/fits// | |
20 | // Authors: Marian Ivanov, Haavard Helstrup and Martin Siska // | |
21 | // // | |
22 | //////////////////////////////////////////////////////////////////////////////// | |
23 | ||
24 | ||
25 | // Running instructions: | |
26 | /* | |
27 | TClonesArray * arr = AliDCSSensor::ReadList("TempSensor.txt"); | |
28 | TFile f("TempSensors.root","RECREATE"); | |
29 | TTree * tree = new TTree("TempSensor", "TempSensor"); | |
30 | tree->Branch("Temp",&arr); | |
31 | tree->Fill(); | |
32 | tree->Write(); | |
33 | ||
34 | */ | |
35 | // | |
36 | ||
37 | ||
38 | #include "AliDCSSensor.h" | |
ee256dfd | 39 | ClassImp(AliDCSSensor) |
7264822f | 40 | |
41 | ||
42 | AliDCSSensor::AliDCSSensor(): | |
43 | fId(), | |
44 | fIdDCS(0), | |
45 | fStartTime(0), | |
46 | fGraph(0), | |
47 | fFit(0), | |
48 | fX(0), | |
49 | fY(0), | |
50 | fZ(0) | |
51 | { | |
52 | // | |
53 | // Standard constructor | |
54 | // | |
55 | } | |
56 | ||
57 | AliDCSSensor::AliDCSSensor(const AliDCSSensor& source) : | |
58 | TNamed(source), | |
59 | fId(source.fId), | |
60 | fIdDCS(source.fIdDCS), | |
61 | fStartTime(source.fStartTime), | |
62 | fGraph(source.fGraph), | |
63 | fFit(source.fFit), | |
64 | fX(source.fX), | |
65 | fY(source.fY), | |
66 | fZ(source.fZ) | |
67 | // | |
68 | // Copy constructor | |
69 | // | |
70 | { } | |
71 | ||
72 | AliDCSSensor& AliDCSSensor::operator=(const AliDCSSensor& source){ | |
73 | // | |
74 | // assignment operator | |
75 | // | |
76 | if (&source == this) return *this; | |
77 | new (this) AliDCSSensor(source); | |
78 | ||
79 | return *this; | |
80 | } | |
81 | ||
82 | //_____________________________________________________________________________ | |
83 | Double_t AliDCSSensor::GetValue(UInt_t timeSec) | |
84 | { | |
85 | // | |
86 | // Get temperature value for actual sensor | |
87 | // timeSec given as offset from start-of-run measured in seconds | |
88 | // | |
89 | Double_t timeHrs = timeSec/3600.0; | |
90 | return fFit->Eval(timeHrs,0); | |
91 | } | |
92 | //_____________________________________________________________________________ | |
93 | Double_t AliDCSSensor::GetValue(TTimeStamp time) | |
94 | { | |
95 | // Get temperature value for actual sensor | |
96 | // time given as absolute TTimeStamp | |
97 | // | |
98 | Double_t timeHrs = (time.GetSec() - fStartTime)/3600.0; | |
99 | return fFit->Eval(timeHrs,0); | |
100 | } | |
101 | ||
102 |