Fixes for bug #52499: Field polarities inconsistiency
[u/mrichter/AliRoot.git] / STEER / AliDCSSensorArray.h
CommitLineData
7264822f 1#ifndef AliDCSSensorArray_H
2#define AliDCSSensorArray_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6
7///////////////////////////////////////////////////////////////////////////////
8// //
9// Calibration class for DCS sensors //
10// //
11///////////////////////////////////////////////////////////////////////////////
12
13#include "TNamed.h"
14#include "TMap.h"
15#include "TObjString.h"
16#include "AliCDBManager.h"
17#include "AliCDBEntry.h"
18#include "AliDCSValue.h"
19#include "AliDCSSensor.h"
20
21class TGraph;
22class TTimeStamp;
23
24
25class AliDCSSensorArray : public TNamed {
26 public:
27 AliDCSSensorArray();
24938b4c 28 AliDCSSensorArray(TClonesArray *arr);
29 AliDCSSensorArray(Int_t run, const char* dbEntry);
30 AliDCSSensorArray(UInt_t startTime, UInt_t endTime, TTree* confTree);
17984b61 31 AliDCSSensorArray(UInt_t startTime, UInt_t endTime, TClonesArray *sensors);
82dfb6c8 32 AliDCSSensorArray(const AliDCSSensorArray &c);
7264822f 33 virtual ~AliDCSSensorArray();
34 AliDCSSensorArray &operator=(const AliDCSSensorArray &c);
7264822f 35 void SetStartTime (const TTimeStamp& start) { fStartTime = start; }
36 void SetEndTime (const TTimeStamp& end) { fEndTime = end; }
82dfb6c8 37 TTimeStamp GetStartTime () const { return fStartTime; }
38 TTimeStamp GetEndTime () const { return fEndTime; }
e5250086 39 void SetMinGraph(const Int_t minGraph) { fMinGraph=minGraph;}
40 Int_t GetMinGraph() const { return fMinGraph; }
41 void SetMinPoints(const Int_t minPoints) { fMinPoints=minPoints;}
42 Int_t GetMinPoints() const { return fMinPoints; }
82dfb6c8 43 void SetIter(const Int_t iter ) { fIter=iter; }
44 Int_t GetIter() const { return fIter; }
e5250086 45 void SetMaxDelta(const Double_t maxDelta) { fMaxDelta= maxDelta;}
82dfb6c8 46 Double_t GetMaxDelta() const { return fMaxDelta; }
e5250086 47 void SetFitReq(const Int_t fitReq) { fFitReq=fitReq; }
48 Int_t GetFitReq() const {return fFitReq;}
49 void SetValCut(const Int_t valCut) { fValCut=valCut;}
82dfb6c8 50 Int_t GetValCut() const {return fValCut;}
e5250086 51 void SetDiffCut(const Int_t diffCut) { fDiffCut=diffCut; }
52 Int_t GetDiffCut() const {return fDiffCut;}
53
24938b4c 54 void SetGraph (TMap *map);
55 void MakeSplineFit(TMap *map, Bool_t keepMap=kFALSE);
0baf4718 56 void MakeSplineFitAddPoints(TMap *map);
57 TMap* ExtractDCS (TMap *dcsMap, Bool_t keepStart=kFALSE);
58 TGraph* MakeGraph (TObjArray *valueSet, Bool_t keepStart=kFALSE);
24938b4c 59 void ClearGraph();
82dfb6c8 60 void ClearFit();
0baf4718 61 Double_t GetValue (UInt_t timeSec, Int_t sensor);
7264822f 62 AliDCSSensor* GetSensor (Int_t IdDCS);
63 AliDCSSensor* GetSensor (Double_t x, Double_t y, Double_t z);
24938b4c 64 AliDCSSensor* GetSensor (const TString& stringID);
8cb8848e 65 AliDCSSensor* GetSensorNum (Int_t ind);
9663477d 66 Int_t SetSensor (const TString& stringID, const AliDCSSensor& sensor);
67 void SetSensorNum (const Int_t ind, const AliDCSSensor& sensor);
82dfb6c8 68 void RemoveSensorNum(Int_t ind);
69 void RemoveSensor(Int_t IdDCS);
e7097603 70 void AddSensors(AliDCSSensorArray *sensors);
bf84b403 71 TArrayI OutsideThreshold(Double_t threshold, UInt_t timeSec=0, Bool_t below=kTRUE) const;
8cb8848e 72 Int_t NumSensors() const { return fSensors->GetEntries(); }
67a165ed 73 Int_t NumFits() const;
82dfb6c8 74
8cb8848e 75 Int_t GetFirstIdDCS() const;
82dfb6c8 76 Int_t GetLastIdDCS() const;
7264822f 77
67a165ed 78
7264822f 79 protected:
e5250086 80 Int_t fMinGraph; // minimum #points of graph to be fitted
81 Int_t fMinPoints; // minimum number of points per knot in fit
82 Int_t fIter; // number of iterations for spline fit
83 Double_t fMaxDelta; // precision parameter for spline fit
84 Int_t fFitReq; // fit requirement, 2 = continuous 2nd derivative
85 Int_t fValCut; // cut on absolute value read from DCS map
86 Int_t fDiffCut; // cut on difference in value read from DCS map
87 TTimeStamp fStartTime; // start time for measurements in this entry
88 TTimeStamp fEndTime; // end time for measurements in this entry
89 TClonesArray *fSensors; // Array of sensors
7264822f 90
67a165ed 91
92
e5250086 93 ClassDef(AliDCSSensorArray,3) // TPC calibration class for parameters which are saved per pad
7264822f 94
95};
96
97#endif