Line data Source code
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 :
18 : #include "TObject.h"
19 :
20 : class TMap;
21 : class TClonesArray;
22 : class TString;
23 : class TH1C;
24 :
25 : class AliTOFDCSmaps;
26 :
27 : class AliTOFLvHvDataPoints : public TObject {
28 : public:
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 0 : void SetRun(Int_t run) {fRun = run;}
38 0 : void SetStartTime(Int_t startTime) {fStartTime = startTime;}
39 0 : void SetEndTime(Int_t endTime) {fEndTime = endTime;}
40 0 : void SetStartTimeDCSQuery(Int_t startTimeDCSQuery) {fStartTimeDCSQuery = startTimeDCSQuery;}
41 0 : void SetEndTimeDCSQuery(Int_t endTimeDCSQuery) {fEndTimeDCSQuery = endTimeDCSQuery;}
42 0 : void SetNSecondsBeforeEOR(Int_t nSecondsBeforeEOR) {fNSecondsBeforeEOR = nSecondsBeforeEOR;}
43 0 : Int_t GetRun() const {return fRun;}
44 0 : Int_t GetStartTime() const {return fStartTime;}
45 0 : Int_t GetEndTime() const {return fEndTime;}
46 0 : Int_t GetStartTimeDCSQuery() const {return fStartTimeDCSQuery;}
47 0 : Int_t GetEndTimeDCSQuery() const {return fEndTimeDCSQuery;}
48 0 : Int_t GetNSecondsBeforeEOR() const {return fNSecondsBeforeEOR;}
49 : Bool_t ProcessData(TMap& aliasMap);
50 :
51 :
52 : const char* GetAliasNameXLV(Int_t pos) const
53 0 : {return pos<kNddl ? fAliasNamesXLVmap[pos].Data() : 0;}
54 :
55 : const char* GetAliasNameXHV(Int_t pos1, Int_t pos2) const
56 0 : {return pos1<kNsectors&&pos2<kNplates ? fAliasNamesXHVmap[pos1][pos2].Data() : 0;}
57 :
58 : void Draw(const Option_t* /*option*/);
59 : void DrawHVandLVMap(Int_t index);
60 : void DrawHVMap(Int_t index);
61 : void DrawLVMap(Int_t index);
62 :
63 0 : void SetFDRFlag(Bool_t flag) {fFDR = flag;}
64 0 : Bool_t GetFDRFlag() const {return fFDR;}
65 :
66 0 : Int_t GetNumberOfHVandLVmaps() const { return fNumberOfHVandLVmaps; };
67 0 : AliTOFDCSmaps * GetHVandLVmapAtSOR() const { return fMap[0]; };
68 : AliTOFDCSmaps * GetHVandLVmapAtEOR() ;
69 0 : AliTOFDCSmaps * GetHVandLVmap(Int_t index) const { if (index>=fNumberOfHVandLVmaps) return 0x0; else return fMap[index]; };
70 0 : Int_t GetNumberOfLVmaps() const { return fNumberOfLVdataPoints; };
71 0 : AliTOFDCSmaps * GetLVmap(Int_t index) const { if (index>=fNumberOfLVdataPoints) return 0x0; else return fLVDataPoints[index]; };
72 0 : Int_t GetNumberOfHVmaps() const { return fNumberOfHVdataPoints; };
73 0 : AliTOFDCSmaps * GetHVmap(Int_t index) const { if (index>=fNumberOfHVdataPoints) return 0x0; else return fHVDataPoints[index]; };
74 :
75 : private:
76 : void Init();
77 : void CreateHisto(int nbin);
78 : void FillHVarrayPerDataPoint(Int_t sector, Int_t plate, UInt_t baseWord, Short_t *array) const;
79 : void FillLVarrayPerDataPoint(Int_t nDDL, UInt_t baseWord, Short_t *array) const;
80 : void GetStripsConnectedToFEAC(Int_t nDDL, Int_t nFEAC, Int_t *iStrip, Int_t &firstPadX, Int_t &lastPadX) const;
81 :
82 : Bool_t ReadHVDataPoints(TMap& aliasMap);
83 : Bool_t ReadLVDataPoints(TMap& aliasMap);
84 :
85 : Bool_t MergeMaps();
86 : Bool_t MergeHVmap();
87 : Bool_t MergeLVmap();
88 :
89 : Int_t InsertHVDataPoint(AliTOFDCSmaps *object);
90 : Int_t FindHVdpIndex(Int_t z) const;
91 : Int_t InsertLVDataPoint(AliTOFDCSmaps *object);
92 : Int_t FindLVdpIndex(Int_t z) const;
93 : Int_t fRun; // Run number
94 : Int_t fStartTime; // start time
95 : Int_t fEndTime; // end time
96 : Int_t fStartTimeDCSQuery; // start time DCSQuery
97 : Int_t fEndTimeDCSQuery; // end time DCSQuery
98 :
99 : Bool_t fIsProcessed; // bool to know processing status
100 : Bool_t fFDR; // bool to know whether we are in a FDR run
101 :
102 : AliTOFDCSmaps *fLVDataPoints[kNmaxDataPoints]; // LV status map VS time
103 : AliTOFDCSmaps *fHVDataPoints[kNmaxDataPoints]; // HV status map VS time
104 : AliTOFDCSmaps *fMap[kNmaxDataPoints]; // LV&&HV status map VS time
105 :
106 : Int_t fNumberOfLVdataPoints; // number of found LV status dps
107 : Int_t fNumberOfHVdataPoints; // number of found HV status dps
108 : Int_t fNumberOfHVandLVmaps; // number of found LV&&HV status maps
109 :
110 : TString fAliasNamesXLVmap[kNddl]; // aliases for LV map
111 : TString fAliasNamesXHVmap[kNsectors][kNplates]; // aliases for HV map
112 :
113 : AliTOFDCSmaps *fStartingLVmap; // starting value for LV map
114 : AliTOFDCSmaps *fStartingHVmap; // starting value for HV map
115 :
116 : TH1C * fHisto; // histogram
117 :
118 : Int_t fNSecondsBeforeEOR; // time window to choose if a run ended correctly or not [s]
119 :
120 26 : ClassDef(AliTOFLvHvDataPoints, 3);
121 : };
122 :
123 : #endif
|