Moved to Makefile.
[u/mrichter/AliRoot.git] / HLT / programs / speedtest.cxx
CommitLineData
aac30464 1#include "speedtest.h"
2
3int main(int arg,char **arc){
4 int n = 0;
5 if(arg!=2) {cerr<<"usage: speedtest #loops \n";return -1;}
6 n = atoi(arc[1]);
7// cerr<<"allocate: "<<n*sizeof(AliL3ConfMapPoint)<<" Bytes"<<endl;
8// AliL3ConfMapPoint *array = new AliL3ConfMapPoint[n];
9 cerr<<"allocate: "<<n*sizeof(double)<<" Bytes"<<endl;
10 double *array = new double[n];
11// cerr<<"allocate: "<<n*sizeof(int)<<" Bytes"<<endl;
12// int *array = new int[n];
13// cerr<<"allocate: "<<n*sizeof(AliL3SpacePointData)<<" Bytes"<<endl;
14// AliL3SpacePointData *array = new AliL3SpacePointData[n];
15
16 AliL3SpacePointData hit;
17 hit.fX=103.55;
18 hit.fY=22.33;
19 hit.fZ=95.312;
20 hit.fID=(4<<25)|14042;
21 hit.fPadRow=77;
22 hit.fXYErr=1;
23 hit.fZErr=2.5;
24
25 cerr<<"start loop"<<endl;
26 double initCpuTime,cpuTime;
27 initCpuTime = CpuTime();
28
29/*
30 for(int i=0;i<n;i++){
31 array[i].SetHitNumber(hit.fID);
32 array[i].SetPadRow(hit.fPadRow);
33 Int_t slice = (hit.fID>>25) & 0x7f;
34 array[i].SetSector(slice);
35 array[i].SetX(hit.fX);
36 array[i].SetY(hit.fY);
37 array[i].SetZ(hit.fZ);
38 array[i].SetXerr(sqrt((double)hit.fXYErr));
39// array[i].SetYerr(sqrt(hit.fXYErr));
40// array[i].SetZerr(sqrt(hit.fZErr));
41 }
42*/
43// for(int i=0;i<n;i++) array[i].ReadHits(&hit);
44 for(int i=0;i<n;i++) array[i]=sqrt(i);
45// for(int i=0;i<n;i++) array[i]=i;
46// for(int i=0;i<n;i++) array[i].fX=hit.fX;
47
48 cpuTime = CpuTime() - initCpuTime;
49// cerr<<"cpuTime: "<<cpuTime<<endl;
50 printf("cpuTime: %d ms\n",int(cpuTime*1000));
51 return 0;
52}
53