]>
Commit | Line | Data |
---|---|---|
3e87ef69 | 1 | // $Id$ |
2 | ||
02f030e3 | 3 | // Author: Uli Frankenfeld <uli.frankenfeld@gsi.de> |
4 | //*-- Copyright © ALICE HLT Group | |
5 | ||
6 | ||
aac30464 | 7 | #include "speedtest.h" |
8 | ||
9 | int main(int arg,char **arc){ | |
10 | int n = 0; | |
11 | if(arg!=2) {cerr<<"usage: speedtest #loops \n";return -1;} | |
12 | n = atoi(arc[1]); | |
13 | // cerr<<"allocate: "<<n*sizeof(AliL3ConfMapPoint)<<" Bytes"<<endl; | |
14 | // AliL3ConfMapPoint *array = new AliL3ConfMapPoint[n]; | |
15 | cerr<<"allocate: "<<n*sizeof(double)<<" Bytes"<<endl; | |
16 | double *array = new double[n]; | |
17 | // cerr<<"allocate: "<<n*sizeof(int)<<" Bytes"<<endl; | |
18 | // int *array = new int[n]; | |
19 | // cerr<<"allocate: "<<n*sizeof(AliL3SpacePointData)<<" Bytes"<<endl; | |
20 | // AliL3SpacePointData *array = new AliL3SpacePointData[n]; | |
21 | ||
22 | AliL3SpacePointData hit; | |
23 | hit.fX=103.55; | |
24 | hit.fY=22.33; | |
25 | hit.fZ=95.312; | |
26 | hit.fID=(4<<25)|14042; | |
27 | hit.fPadRow=77; | |
28 | hit.fXYErr=1; | |
29 | hit.fZErr=2.5; | |
30 | ||
31 | cerr<<"start loop"<<endl; | |
32 | double initCpuTime,cpuTime; | |
33 | initCpuTime = CpuTime(); | |
34 | ||
35 | /* | |
36 | for(int i=0;i<n;i++){ | |
37 | array[i].SetHitNumber(hit.fID); | |
38 | array[i].SetPadRow(hit.fPadRow); | |
39 | Int_t slice = (hit.fID>>25) & 0x7f; | |
40 | array[i].SetSector(slice); | |
41 | array[i].SetX(hit.fX); | |
42 | array[i].SetY(hit.fY); | |
43 | array[i].SetZ(hit.fZ); | |
44 | array[i].SetXerr(sqrt((double)hit.fXYErr)); | |
45 | // array[i].SetYerr(sqrt(hit.fXYErr)); | |
46 | // array[i].SetZerr(sqrt(hit.fZErr)); | |
47 | } | |
48 | */ | |
49 | // for(int i=0;i<n;i++) array[i].ReadHits(&hit); | |
50 | for(int i=0;i<n;i++) array[i]=sqrt(i); | |
51 | // for(int i=0;i<n;i++) array[i]=i; | |
52 | // for(int i=0;i<n;i++) array[i].fX=hit.fX; | |
53 | ||
54 | cpuTime = CpuTime() - initCpuTime; | |
55 | // cerr<<"cpuTime: "<<cpuTime<<endl; | |
56 | printf("cpuTime: %d ms\n",int(cpuTime*1000)); | |
57 | return 0; | |
58 | } | |
59 |