X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=HLT%2FPHOS%2FAliHLTPHOSCommonDefs.h;h=1398d02eb7f3ad149392b1be4c6cae0348a882f2;hp=f2f794292d7ea2968da2b4a2f962d93df53627c1;hb=dabc4c3539d0091176df20d5623ea57c298601df;hpb=f094c95139a03a86831e0ad33d1544bdc79f3b9b diff --git a/HLT/PHOS/AliHLTPHOSCommonDefs.h b/HLT/PHOS/AliHLTPHOSCommonDefs.h index f2f794292d7..1398d02eb7f 100644 --- a/HLT/PHOS/AliHLTPHOSCommonDefs.h +++ b/HLT/PHOS/AliHLTPHOSCommonDefs.h @@ -1,52 +1,91 @@ -#ifndef ALIPHOSCOMMONDEFS_H -#define ALIPHOSCOMMONDEFS_H - -//Hardware constants -#define N_MODULES 5 /**(y)?(y):(x)) +#define MAX(x,y) ((x)>(y)?(x):(y)) +#define ADJUST_TO_HIGHER(size,step) ((((size)+(step)-1)/(step))*(step)) +#define ADJUST_TO_LOWER(size,step) (((size)/(step))*(step)) + +///////////////////////////////////////////// +// Find index of maximum in array of any type +///////////////////////////////////////////// + +#define __IMPLEMENT__findIndexOfMax(type) \ + inline int findIndexOfMax(type *data, int count) \ + { int m=0; for(int i=1; idata[m]) m=i; return m;} +__IMPLEMENT__findIndexOfMax(char) +__IMPLEMENT__findIndexOfMax(unsigned char) +__IMPLEMENT__findIndexOfMax(int) +__IMPLEMENT__findIndexOfMax(unsigned int) +__IMPLEMENT__findIndexOfMax(short int) +__IMPLEMENT__findIndexOfMax(unsigned short int) +__IMPLEMENT__findIndexOfMax(long long) +__IMPLEMENT__findIndexOfMax(unsigned long long) +__IMPLEMENT__findIndexOfMax(float) +__IMPLEMENT__findIndexOfMax(double) + +///////////////////////////////////////////// +// Find index of minimum in array of any type +///////////////////////////////////////////// +#define __IMPLEMENT__findIndexOfMin(type) \ + inline int findIndexOfMin(type *data, int count) \ + { int m=0; for(int i=1; i