]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCSensorTempArray.cxx
b661daedb3f25a662c4e168a207c2ad365d54316
[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
29 //_____________________________________________________________________________
30 AliTPCSensorTempArray::AliTPCSensorTempArray():AliDCSSensorArray()
31 {
32   //
33   // AliTPCSensorTempArray default constructor
34   //
35  
36 }
37 //_____________________________________________________________________________
38 AliTPCSensorTempArray::AliTPCSensorTempArray(Int_t run) : AliDCSSensorArray() 
39 {
40   //
41   // Read configuration from OCDB
42   //
43
44      
45   AliCDBEntry *entry =
46             AliCDBManager::Instance()->Get("TPC/Config/Temperature",run); 
47   TTree *tree = (TTree*) entry->GetObject();
48   fSensors = AliTPCSensorTemp::ReadTree(tree);
49   fSensors->BypassStreamer(kFALSE);
50   
51 }
52 //_____________________________________________________________________________
53 AliTPCSensorTempArray::AliTPCSensorTempArray(UInt_t startTime, UInt_t endTime,
54                        TTree* confTree)
55              :AliDCSSensorArray()
56 {
57   //
58   // AliTPCSensorTempArray constructor for Shuttle preprocessor 
59   //  (confTree read from OCDB)
60   //
61   fSensors = AliTPCSensorTemp::ReadTree(confTree);
62   fSensors->BypassStreamer(kFALSE);
63   fStartTime = TTimeStamp(startTime);
64   fEndTime   = TTimeStamp(endTime);
65 }
66
67 //_____________________________________________________________________________
68 AliTPCSensorTempArray::AliTPCSensorTempArray(const char *fname) : 
69                                                   AliDCSSensorArray()
70 {
71   //
72   // AliTPCSensorTempArray constructor
73   //
74   fSensors = AliTPCSensorTemp::ReadList(fname);
75   fSensors->BypassStreamer(kFALSE);
76 }
77
78
79 //_____________________________________________________________________________
80 AliTPCSensorTempArray::AliTPCSensorTempArray(const AliTPCSensorTempArray &c):
81   AliDCSSensorArray(c)
82 {
83   //
84   // AliTPCSensorTempArray copy constructor
85   //
86
87 }
88
89 ///_____________________________________________________________________________
90 AliTPCSensorTempArray::~AliTPCSensorTempArray()
91 {
92   //
93   // AliTPCSensorTempArray destructor
94   //
95 }
96
97 //_____________________________________________________________________________
98 AliTPCSensorTempArray &AliTPCSensorTempArray::operator=(const AliTPCSensorTempArray &c)
99 {
100   //
101   // Assignment operator
102   //
103
104   if (this != &c) ((AliTPCSensorTempArray &) c).Copy(*this);
105   return *this;
106
107 }
108
109 //_____________________________________________________________________________
110 void AliTPCSensorTempArray::Copy(TObject &c) const
111 {
112   //
113   // Copy function
114   //
115
116   TObject::Copy(c);
117 }
118 //_____________________________________________________________________________
119 void AliTPCSensorTempArray::ReadSensors(const char *dbEntry) 
120 {
121   //
122   // Read list of temperature sensors from text file
123   //
124   AliCDBEntry *entry = AliCDBManager::Instance()->Get(dbEntry); 
125   TTree *tree = (TTree*) entry->GetObject();
126   fSensors = AliTPCSensorTemp::ReadTree(tree);
127
128 }  
129
130 //_____________________________________________________________________________
131 AliTPCSensorTemp* AliTPCSensorTempArray::GetSensor(Int_t type, Int_t side, Int_t sector, Int_t num) 
132 {
133  //
134  //  Return sensor information for sensor specified by type, side, sector and num
135  //
136  Int_t nsensors = fSensors->GetEntries();
137  for (Int_t isensor=0; isensor<nsensors; isensor++) {
138    AliTPCSensorTemp *entry = (AliTPCSensorTemp*)fSensors->At(isensor);
139    if (entry->GetSide() == side &&
140        entry->GetType() == type &&
141        entry->GetSector() == sector &&
142        entry->GetNum() == num ) return entry;
143  }
144  return 0;
145 }
146 //_____________________________________________________________________________
147
148 AliTPCSensorTemp* AliTPCSensorTempArray::GetSensor(Int_t IdDCS){
149   return dynamic_cast<AliTPCSensorTemp*>(AliDCSSensorArray::GetSensor(IdDCS));
150 }
151 //_____________________________________________________________________________
152
153 AliTPCSensorTemp* AliTPCSensorTempArray::GetSensor(Double_t x, Double_t y, Double_t z){
154   return dynamic_cast<AliTPCSensorTemp*>(AliDCSSensorArray::GetSensor(x,y,z));
155 }