-
Notifications
You must be signed in to change notification settings - Fork 0
/
PixelNoiseMaskFile.hh
71 lines (55 loc) · 1.71 KB
/
PixelNoiseMaskFile.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef PIXELNOISEMASKFILE
#define PIXELNOISEMASKFILE
#include <iostream>
#include <vector>
#include "TObject.h"
// ----------------------------------------------------------------------
// Representation of pixel noise mask files
// ----------------------------------------
//
// pixel chip has 256 x 250 pixels (col x row)
// noise mask file has 256 x 256 entries!
// Entries with col > 249 are ignored, but must be present
//
// Noisy pixels have word = 0x00
// Other pixels (presumably) have a tune DAC value or so instead.
//
// The following format is used:
// row value
// ----------
// 0 0xYY first row
// ... 0xYY
// 249 0xYY last row
// 250 0xDA
// 251 0xDA
// 252 0xDA
// 253 0xcn cn = column number (in hex)
// 254 0xDA
// 255 0xzz zz = 1 (if LVDS errors occurred on chip in run)
// ----------------------------------------------------------------------
class PixelNoiseMaskFile: public TObject {
public:
// -- create nmf with no noise (all physical values are 0xff)
PixelNoiseMaskFile(uint8_t val = 0xff);
// -- create nmf from a vector
PixelNoiseMaskFile(std::vector<uint8_t> &v);
// -- create nmf reading from file
PixelNoiseMaskFile(const std::string filename);
// -- d'tor
~PixelNoiseMaskFile();
// -- fill all words with value
void fill(uint8_t value);
// -- print a short summary
void summarize();
// -- print all (ncol = 32, 64, 256)
void print(int ncol = 256);
// -- given an index, return in a pair the column and row
std::pair<int, int> colrowFromIdx(int idx);
// -- given column and row, return the index
int idxFromColRow(int col, int row);
private:
std::vector<uint8_t> fWords;
int VERBOSE;
ClassDef(PixelNoiseMaskFile,1)
};
#endif