Updated code to read LV.and.HV status maps during a run. Waiting numbering conversion...
[u/mrichter/AliRoot.git] / TOF / AliTOFLvHvDataPoints.h
CommitLineData
ea932f75 1#ifndef ALITOFLVHVDATAPOINTS_H
2#define ALITOFLVHVDATAPOINTS_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id: $ */
8
9/////////////////////////////////////////////////////////
10// //
11// AliTOFLvHvDataPoints class //
12// main aim to introduce //
13// the aliases for the TOF LV and HV DCS data points //
14// to be then stored in the OCDB, and to process them. //
15// //
16/////////////////////////////////////////////////////////
17
b7a60cff 18#include "TObject.h"
ea932f75 19
20class TMap;
21class TClonesArray;
22class TString;
b7a60cff 23class TH1C;
24
25class AliTOFDCSmaps;
ea932f75 26
27class AliTOFLvHvDataPoints : public TObject {
28public:
29 enum {kNsectors=18, kNplates=5, kNddl=72, kNpads=18*91*96, kNmaxDataPoints=77777};
30
31 AliTOFLvHvDataPoints();
32 AliTOFLvHvDataPoints(Int_t nRun, UInt_t startTime, UInt_t endTime, UInt_t startTimeDCSQuery, UInt_t endTimeDCSQuery );
33 AliTOFLvHvDataPoints(const AliTOFLvHvDataPoints & data);
34 AliTOFLvHvDataPoints& operator=(const AliTOFLvHvDataPoints & data);
35 ~AliTOFLvHvDataPoints();
36
37 void SetRun(Int_t run) {fRun = run;}
38 void SetStartTime(Int_t startTime) {fStartTime = startTime;}
39 void SetEndTime(Int_t endTime) {fEndTime = endTime;}
40 void SetStartTimeDCSQuery(Int_t startTimeDCSQuery) {fStartTimeDCSQuery = startTimeDCSQuery;}
41 void SetEndTimeDCSQuery(Int_t endTimeDCSQuery) {fEndTimeDCSQuery = endTimeDCSQuery;}
42 Int_t GetRun() const {return fRun;}
43 Int_t GetStartTime() const {return fStartTime;}
44 Int_t GetEndTime() const {return fEndTime;}
45 Int_t GetStartTimeDCSQuery() const {return fStartTimeDCSQuery;}
46 Int_t GetEndTimeDCSQuery() const {return fEndTimeDCSQuery;}
b7a60cff 47
ea932f75 48 Bool_t ProcessData(TMap& aliasMap);
49
50 const char* GetAliasNameXLV(Int_t pos) const
51 {return pos<kNddl ? fAliasNamesXLVmap[pos].Data() : 0;}
52
53 const char* GetAliasNameXHV(Int_t pos1, Int_t pos2) const
54 {return pos1<kNsectors&&pos2<kNplates ? fAliasNamesXHVmap[pos1][pos2].Data() : 0;}
55
56 void Draw(const Option_t* /*option*/);
57 void DrawHVandLVMap(Int_t index);
58 void DrawHVMap(Int_t index);
59 void DrawLVMap(Int_t index);
60
61 void SetFDRFlag(Bool_t flag) {fFDR = flag;}
62 Bool_t GetFDRFlag() const {return fFDR;}
63
64 Int_t GetNumberOfHVandLVmaps() const { return fNumberOfHVandLVmaps; };
b7a60cff 65 AliTOFDCSmaps * GetHVandLVmapAtSOR() const { return fMap[0]; };
ea932f75 66 AliTOFDCSmaps * GetHVandLVmapAtEOR() ;
b7a60cff 67 AliTOFDCSmaps * GetHVandLVmap(Int_t index) const { if (index>=fNumberOfHVandLVmaps) return 0x0; else return fMap[index]; };
ea932f75 68 Int_t GetNumberOfLVmaps() const { return fNumberOfLVdataPoints; };
b7a60cff 69 AliTOFDCSmaps * GetLVmap(Int_t index) const { if (index>=fNumberOfLVdataPoints) return 0x0; else return fLVDataPoints[index]; };
ea932f75 70 Int_t GetNumberOfHVmaps() const { return fNumberOfHVdataPoints; };
b7a60cff 71 AliTOFDCSmaps * GetHVmap(Int_t index) const { if (index>=fNumberOfHVdataPoints) return 0x0; else return fHVDataPoints[index]; };
ea932f75 72
73private:
74 void Init();
75 void CreateHisto(int nbin);
b7a60cff 76 void FillHVarrayPerDataPoint(Int_t sector, Int_t plate, UInt_t baseWord, Short_t *array) const;
77 void FillLVarrayPerDataPoint(Int_t nDDL, UInt_t baseWord, Short_t *array) const;
78 void GetStripsConnectedToFEAC(Int_t nDDL, Int_t nFEAC, Int_t *iStrip, Int_t &firstPadX, Int_t &lastPadX) const;
ea932f75 79
80 Bool_t ReadHVDataPoints(TMap& aliasMap);
81 Bool_t ReadLVDataPoints(TMap& aliasMap);
82
83 Bool_t MergeMaps();
84 Bool_t MergeHVmap();
85 Bool_t MergeLVmap();
86
87 Int_t InsertHVDataPoint(AliTOFDCSmaps *object);
88 Int_t FindHVdpIndex(Int_t z) const;
89 Int_t InsertLVDataPoint(AliTOFDCSmaps *object);
90 Int_t FindLVdpIndex(Int_t z) const;
91 Int_t fRun; // Run number
92 Int_t fStartTime; // start time
93 Int_t fEndTime; // end time
94 Int_t fStartTimeDCSQuery; // start time DCSQuery
95 Int_t fEndTimeDCSQuery; // end time DCSQuery
96
97 Bool_t fIsProcessed; // bool to know processing status
98 Bool_t fFDR; // bool to know whether we are in a FDR run
99
100 AliTOFDCSmaps *fLVDataPoints[kNmaxDataPoints]; // LV status map VS time
101 AliTOFDCSmaps *fHVDataPoints[kNmaxDataPoints]; // HV status map VS time
102 AliTOFDCSmaps *fMap[kNmaxDataPoints]; // LV&&HV status map VS time
103
104 Int_t fNumberOfLVdataPoints; // number of found LV status dps
105 Int_t fNumberOfHVdataPoints; // number of found HV status dps
106 Int_t fNumberOfHVandLVmaps; // number of found LV&&HV status maps
107
108 TString fAliasNamesXLVmap[kNddl]; // aliases for LV map
109 TString fAliasNamesXHVmap[kNsectors][kNplates]; // aliases for HV map
b7a60cff 110
111 AliTOFDCSmaps *fStartingLVmap; // starting value for LV map
112 AliTOFDCSmaps *fStartingHVmap; // starting value for HV map
ea932f75 113
114 TH1C * fHisto; // histogram
115
b7a60cff 116 ClassDef(AliTOFLvHvDataPoints, 2);
ea932f75 117};
118
119#endif