]>
Commit | Line | Data |
---|---|---|
b5014544 | 1 | // |
2 | // Test of the "NextSignal" interface of the AliFMDRawReader | |
3 | // | |
4 | // w/ZS: 08000059807016.10.root | |
5 | // w/o ZS: 08000053726000.10.root | |
6 | ||
7 | Int_t ReadEvent(AliRawReader* reader) | |
8 | { | |
9 | if (!reader) return -1; | |
10 | if (!reader->NextEvent()) return -1; | |
11 | Int_t evno = reader->GetEventIndex(); | |
12 | // if (evno % 10 == 0) std::cout << "." << std::flush; | |
13 | std::cout << "In event # " << evno << "/" | |
14 | << reader->GetNumberOfEvents() << std::endl; | |
15 | return evno; | |
16 | } | |
17 | ||
18 | void | |
19 | TestRawReader(const char* file= | |
20 | //"/media/cholm_data/alice/data/08000053726000.10.root" // w/o ZS | |
21 | "/media/cholm_data/alice/data/08000059807016.10.root" // w/ZS | |
22 | ) | |
23 | { | |
162637e4 | 24 | AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); |
b5014544 | 25 | AliCDBManager::Instance()->SetRun(59807); |
26 | AliFMDParameters::Instance()->Init(); | |
27 | AliLog::SetModuleDebugLevel("FMD", 2); | |
28 | ||
29 | AliRawReader* rawReader = AliRawReader::Create(file); | |
30 | if (!rawReader) return; | |
31 | ||
32 | AliFMDRawReader* fmdReader = new AliFMDRawReader(rawReader, 0); | |
33 | ||
34 | AliFMDBoolMap seen; | |
35 | ||
36 | Int_t evno = -1; | |
37 | while ((evno = ReadEvent(rawReader)) >= 0) { | |
38 | if (evno < 25) continue; | |
39 | if (evno > 120) break; | |
40 | ||
41 | UShort_t det, sec, str, fac; | |
42 | Short_t adc; | |
43 | Bool_t zs; | |
44 | Char_t rng; | |
45 | seen.Reset(kFALSE); | |
46 | ||
47 | while (fmdReader->NextSignal(det, rng, sec, str, adc, zs, fac)) { | |
48 | Printf("FMD%d%c[%02d,%03d]: %4d", det,rng,sec,str,adc); | |
49 | seen(det,rng,sec,str) = kTRUE; | |
50 | } | |
51 | #if 0 | |
52 | for (det = 1; det <= 3; det++) { | |
53 | UShort_t nrng = (det == 1 ? 1 : 2); | |
54 | for (UShort_t ir = 0; ir < nrng; ir++) { | |
55 | Char_t rng = (ir == 0 ? 'I' : 'O'); | |
56 | UShort_t nsec = (ir == 0 ? 20 : 40); | |
57 | UShort_t nstr = (ir == 0 ? 512 : 256); | |
58 | for (sec = 0; sec < nsec; sec++) { | |
59 | for (str = 0; str < nstr; str++) { | |
60 | if (!seen(det,rng,sec,str)) | |
61 | Printf("FMD%d%c[%02d,%03d] not seen", det,rng,sec,str); | |
62 | } | |
63 | } | |
64 | } | |
65 | } | |
66 | #endif | |
67 | } | |
68 | } | |
69 | ||
70 | ||
71 |