QualityControl  1.5.1
O2 Data Quality Control Framework
HmpidEquipment.h
1 // Copyright CERN and copyright holders of ALICE O2. This software is
2 // distributed under the terms of the GNU General Public License v3 (GPL
3 // Version 3), copied verbatim in the file "COPYING".
4 //
5 // See http://alice-o2.web.cern.ch/license for full licensing information.
6 //
7 // In applying this license CERN does not waive the privileges and immunities
8 // granted to it by virtue of its status as an Intergovernmental Organization
9 // or submit itself to any jurisdiction.
10 
17 
18 #ifndef COMMON_HMPIDEQUIPMENT_H_
19 #define COMMON_HMPIDEQUIPMENT_H_
20 
21 #include <cstdio>
22 #include <stdint.h>
23 #include <iostream>
24 
26 {
27 
28 const int MAXERRORS = 13;
29 const int MAXHMPIDERRORS = 5;
30 
31 const int ERR_NOTKNOWN = 0;
32 const int ERR_ROWMARKEMPTY = 1;
33 const int ERR_DUPLICATEPAD = 2;
34 const int ERR_ROWMARKWRONG = 3;
35 const int ERR_ROWMARKLOST = 4;
36 const int ERR_ROWMARKERROR = 5;
37 const int ERR_LOSTEOEMARK = 6;
38 const int ERR_DOUBLEEOEMARK = 7;
39 const int ERR_WRONGSIZEINEOE = 8;
40 const int ERR_DOUBLEMARKWORD = 9;
41 const int ERR_WRONGSIZESEGMENTMARK = 10;
42 const int ERR_LOSTEOSMARK = 11;
43 const int ERR_HMPID = 12;
44 
45 // ---- HMPID geometry -------
46 const int MAXEQUIPMENTS = 14;
47 
48 const int N_SEGMENTS = 3;
49 const int N_COLXSEGMENT = 8;
50 const int N_COLUMNS = 24;
51 const int N_DILOGICS = 10;
52 const int N_CHANNELS = 48;
53 
54 const int N_MODULES = 7;
55 const int N_XROWS = 160;
56 const int N_YCOLS = 144;
57 
58 const int N_EQUIPMENTTOTALPADS = N_SEGMENTS * N_COLXSEGMENT * N_DILOGICS * N_CHANNELS;
59 const int N_HMPIDTOTALPADS = MAXEQUIPMENTS * N_SEGMENTS * N_COLXSEGMENT * N_DILOGICS * N_CHANNELS;
60 
61 // ---- HMPID error def -------
62 const int TH_FILENOTEXISTS = 9;
63 const int TH_OPENFILE = 8;
64 const int TH_CREATEFILE = 7;
65 const int TH_READFILE = 6;
66 const int TH_WRITEFILE = 5;
67 const int TH_WRONGEQUIPINDEX = 19;
68 const int TH_WRONGHEADER = 15;
69 const int TH_WRONGFILELEN = 14;
70 const int TH_NULLBUFFERPOINTER = 13;
71 const int TH_BUFFEREMPTY = 12;
72 const int TH_WRONGBUFFERDIM = 11;
73 
75 {
76 
77  private:
78  uint32_t mEquipmentId;
79  uint32_t mCruId;
80  uint32_t mLinkId;
81 
82  public:
83  uint32_t mPadSamples[N_COLUMNS][N_DILOGICS][N_CHANNELS];
84  double mPadSum[N_COLUMNS][N_DILOGICS][N_CHANNELS];
85  double mPadSquares[N_COLUMNS][N_DILOGICS][N_CHANNELS];
86 
87  int mErrors[MAXERRORS];
88 
89  int mWillBeRowMarker;
90  int mWillBeSegmentMarker;
91  int mWillBeEoE;
92  int mWillBePad;
93  int mRowSize;
94  int mSegment;
95  int mColumnCounter;
96  int mWordsPerRowCounter;
97  int mWordsPerSegCounter;
98  int mWordsPerDilogicCounter;
99 
100  int mErrorsCounter;
101  int mErrorPadsPerEvent;
102 
103  int mEventNumber;
104  int mNumberOfEvents;
105  float mEventSizeAverage;
106  int mEventSize;
107 
108  int mSampleNumber;
109  float mPadsPerEventAverage;
110 
111  float mBusyTimeValue;
112  float mBusyTimeAverage;
113  int mBusyTimeSamples;
114  int mNumberOfEmptyEvents;
115  int mNumberOfWrongEvents;
116  int mTotalPads;
117  int mTotalErrors;
118 
119  public:
120  HmpidEquipment(int Equipment, int Cru, int Link);
121  ~HmpidEquipment();
122 
123  int getEquipmentId()
124  {
125  return (mEquipmentId);
126  };
127  int getEquipmentId(int cru, int link);
128 
129  void init();
130  void resetPadMap();
131  void resetErrors();
132  void setError(int ErrType);
133  void setPad(int col, int dil, int cha, int charge);
134 };
135 
136 void hmpidCoordsModule2Equipment(int Mod, int Col, int Row, int* Equi, int* Colu, int* Dilo, int* Chan);
137 void hmpidCoordsEquipment2Module(int Equi, int Colu, int Dilo, int Chan, int* Mod, int* Col, int* Row);
138 
139 } // namespace o2::quality_control_modules::hmpid
140 
141 #endif /* COMMON_HMPIDEQUIPMENT_H_ */
void init()
Inits the members for the decoding.
Definition: HmpidEquipment.cxx:47
Definition: HmpidDecoder.h:44
void setError(int ErrType)
Definition: HmpidEquipment.cxx:107
void setPad(int col, int dil, int cha, int charge)
Definition: HmpidEquipment.cxx:120
void resetPadMap()
Resets the matrix that contains the results of the decoding.
Definition: HmpidEquipment.cxx:84
~HmpidEquipment()
Destructor : do nothing.
Definition: HmpidEquipment.cxx:41
HmpidEquipment(int Equipment, int Cru, int Link)
Definition: HmpidEquipment.cxx:32
void resetErrors()
Resets the decoding errors statistics.
Definition: HmpidEquipment.cxx:97