AliPhysics  9c66e61 (9c66e61)
TInfo.h
Go to the documentation of this file.
1 #if !defined(__CINT__) || defined(__MAKECINT__)
2 #include <Riostream.h>
3 #include <TArrayF.h>
4 #include <TString.h>
5 
6 class TH2;
7 
8 #ifndef _TINFO_
9 #define _TINFO_
10 class TInfo : public TObject {
11  public:
12  TInfo(Int_t rn=0) : fRunNo(rn), fAvgT(160), fRmsT(160), fMinT(160), fMaxT(160), fAvTime(0), fFirstTime(0), fLastTime(0), fNFaulty(25) {;}
13  virtual ~TInfo() {;}
14  Float_t AbsMinT(Int_t t=1) const;
15  Float_t AbsMaxT(Int_t t=2) const;
16  TArrayF &AvgT() { return fAvgT; }
17  Float_t AvgT(Int_t ns) const { return fMinT.At(ns); }
18  Float_t AvgTempSM(Int_t sm, Int_t type=3) const;
19  UInt_t AvTime() const { return fAvTime; }
20  Float_t Diff(Int_t ns ) const { return fMaxT.At(ns)-fMinT.At(ns); }
21  UInt_t FirstTime() const { return fFirstTime; }
22  UInt_t GetAverageTime() const { return fAvTime;}
23  UInt_t GetFirstTime() const { return fFirstTime;}
24  TH2 *GetHist(Int_t type=1) const;
25  UInt_t GetLastTime() const { return fLastTime;}
26  const char *GetName() const { return Form("TempInfo_%d",fRunNo); }
27  Int_t GetRunNo() const { return fRunNo; }
28  Int_t GetNFaulty() const { return fNFaulty; }
29  Double_t Fraction() const { return 1.*Nvalid()/(NSensors()-GetNFaulty()); }
30  UInt_t LastTime() const { return fAvTime; }
31  Bool_t IsValid(Int_t ns) const { return ((fMinT.At(ns)>0)&&(fMaxT.At(ns)>0)); }
32  Int_t RunNo() const { return fRunNo; }
33  Float_t T(Int_t ns, Int_t t) const;
34  Float_t MinT(Int_t ns) const { return fMinT.At(ns); }
35  Float_t MaxT(Int_t ns) const { return fMaxT.At(ns); }
36  TArrayF &MinT() { return fMinT; }
37  TArrayF &MaxT() { return fMaxT; }
38  Int_t Nvalid() const { Int_t ret=0; for (Int_t i=0;i<160;++i) ret += IsValid(i); return ret;}
39  void Print(Option_t *option="") const;
40  TArrayF &RmsT() { return fRmsT; }
41  Float_t RmsT(Int_t ns) const { return fMaxT.At(ns); }
42  void Set(Int_t ns, Float_t avg, Float_t rms, Float_t min, Float_t max) { fAvgT.SetAt(avg,ns); fRmsT.SetAt(rms,ns); fMinT.SetAt(min,ns); fMaxT.SetAt(max,ns); }
43  void SetNFaulty(Int_t n) { fNFaulty=n; }
44  void SetTime(UInt_t av, UInt_t f, UInt_t l) { fAvTime=av; fFirstTime=f; fLastTime=l; }
45 
46  static const char *Type(Int_t t);
47  static Int_t GetBin(Int_t ns);
48  static Int_t SM(Int_t ns) { return ns/8; }
49  static Int_t NSensors() { return 160; }
50  static Int_t SensId(Int_t sm, Int_t row, Int_t col);
51 
52  protected:
53  Int_t fRunNo; // run number
54  TArrayF fAvgT; // avg temperature per sensor
55  TArrayF fRmsT; // rms temperature per sensor
56  TArrayF fMinT; // min temperature per sensor
57  TArrayF fMaxT; // max temperature per sensor
58  UInt_t fAvTime; // average start time
59  UInt_t fFirstTime; // first time
60  UInt_t fLastTime; // last time
62  ClassDef(TInfo, 4); // Temperature info class
63 };
64 #endif
65 #endif
Float_t Diff(Int_t ns) const
Definition: TInfo.h:20
Float_t MinT(Int_t ns) const
Definition: TInfo.h:34
TArrayF & MaxT()
Definition: TInfo.h:37
TArrayF fRmsT
Definition: TInfo.h:55
double Double_t
Definition: External.C:58
Int_t RunNo() const
Definition: TInfo.h:32
UInt_t GetLastTime() const
Definition: TInfo.h:25
Definition: TInfo.h:10
UInt_t fAvTime
Definition: TInfo.h:58
static Int_t NSensors()
Definition: TInfo.h:49
TArrayF fAvgT
Definition: TInfo.h:54
Int_t GetNFaulty() const
Definition: TInfo.h:28
UInt_t GetAverageTime() const
Definition: TInfo.h:22
Float_t AbsMaxT(Int_t t=2) const
Definition: TInfo.cxx:23
static Int_t GetBin(Int_t ns)
Definition: TInfo.cxx:99
TArrayF & RmsT()
Definition: TInfo.h:40
Float_t RmsT(Int_t ns) const
Definition: TInfo.h:41
Int_t fNFaulty
Definition: TInfo.h:61
Int_t fRunNo
Definition: TInfo.h:53
virtual ~TInfo()
Definition: TInfo.h:13
TInfo(Int_t rn=0)
Definition: TInfo.h:12
void SetNFaulty(Int_t n)
Definition: TInfo.h:43
Int_t Nvalid() const
Definition: TInfo.h:38
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
const char * GetName() const
Definition: TInfo.h:26
void SetTime(UInt_t av, UInt_t f, UInt_t l)
Definition: TInfo.h:44
Bool_t IsValid(Int_t ns) const
Definition: TInfo.h:31
static Int_t SM(Int_t ns)
Definition: TInfo.h:48
TArrayF fMaxT
Definition: TInfo.h:57
Float_t AvgT(Int_t ns) const
Definition: TInfo.h:17
UInt_t GetFirstTime() const
Definition: TInfo.h:23
Float_t AvgTempSM(Int_t sm, Int_t type=3) const
Definition: TInfo.cxx:36
TH2 * GetHist(Int_t type=1) const
Definition: TInfo.cxx:51
void Print(Option_t *option="") const
Definition: TInfo.cxx:71
UInt_t AvTime() const
Definition: TInfo.h:19
Float_t MaxT(Int_t ns) const
Definition: TInfo.h:35
static Int_t SensId(Int_t sm, Int_t row, Int_t col)
Definition: TInfo.cxx:281
TArrayF & MinT()
Definition: TInfo.h:36
Definition: External.C:220
Float_t T(Int_t ns, Int_t t) const
Definition: TInfo.cxx:80
void Set(Int_t ns, Float_t avg, Float_t rms, Float_t min, Float_t max)
Definition: TInfo.h:42
TArrayF fMinT
Definition: TInfo.h:56
UInt_t FirstTime() const
Definition: TInfo.h:21
UInt_t fFirstTime
Definition: TInfo.h:59
const char Option_t
Definition: External.C:48
Float_t AbsMinT(Int_t t=1) const
Definition: TInfo.cxx:10
Double_t Fraction() const
Definition: TInfo.h:29
bool Bool_t
Definition: External.C:53
static const char * Type(Int_t t)
Definition: TInfo.cxx:323
UInt_t fLastTime
Definition: TInfo.h:60
Int_t GetRunNo() const
Definition: TInfo.h:27
UInt_t LastTime() const
Definition: TInfo.h:30
TArrayF & AvgT()
Definition: TInfo.h:16