2 #include <TStopwatch.h>
3 #include <AliFMDFloatMap.h>
6 TestValue(UShort_t d, Char_t r, UShort_t s, UShort_t t, Float_t v)
8 return d * 1000000 + ((r=='I')+1) * 100000 + s * 1000 + t + v;
11 struct TestOne : public AliFMDMap::ForOne
13 Bool_t operator()(UShort_t d, Char_t r, UShort_t s, UShort_t t, Float_t v)
15 // Caculate a simple number from d, r, s, t, v
16 Float_t x = TestValue(d, r, s, t, v);
17 return x > -1000000000; // Always true
19 Bool_t operator()(UShort_t,Char_t,UShort_t,UShort_t,Int_t) {return true;}
20 Bool_t operator()(UShort_t,Char_t,UShort_t,UShort_t,Bool_t) {return true;}
21 Bool_t operator()(UShort_t,Char_t,UShort_t,UShort_t,UShort_t) {return true;}
25 AccessOneByOne(AliFMDFloatMap& m)
32 AccessByCoords(AliFMDFloatMap& m)
34 for (UShort_t d = 1; d <= 3; d++) {
35 UShort_t nr = (d == 1 ? 1 : 2);
36 for (UShort_t q = 0; q < nr; q++) {
37 Char_t r = (q == 0 ? 'I' : 'O');
38 UShort_t ns = (q == 0 ? 20 : 40);
39 UShort_t nt = (q == 0 ? 512 : 256);
40 for (UShort_t s = 0; s < ns; s++) {
41 for (UShort_t t = 0; t < nt; t++) {
42 Float_t x = TestValue(d, r, s, t, m(d,r,s,t));
43 if (x < -1000000000) break;
51 FillRandom(AliFMDFloatMap& m)
53 Float_t* data = m.Data();
54 UInt_t max = 51200; // m.MaxIndex();
56 for (UInt_t i = 0; i < max; i++)
57 data[i] = gRandom->Uniform(1);
61 TestMapAccess(Int_t n=1000)
68 for (Int_t i = 0; i < n; i++) {
77 for (Int_t i = 0; i < n; i++) {
90 main(int argc, char** argv)
94 std::stringstream s(argv[1]);