ATLAS Offline Software
Loading...
Searching...
No Matches
windows.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define THRES   5
#define NBINS   50
#define BOUND   2

Functions

int give_nearest_bin (const float(*)[NBINS][BOUND], int, int, int, int)
int windows (float, float, int, int)

Macro Definition Documentation

◆ BOUND

#define BOUND   2

Definition at line 10 of file windows.h.

◆ NBINS

#define NBINS   50

Definition at line 9 of file windows.h.

◆ THRES

#define THRES   5

Definition at line 8 of file windows.h.

Function Documentation

◆ give_nearest_bin()

int give_nearest_bin ( const float(*)[NBINS][BOUND],
int thr,
int bin,
int bound,
int step )

Definition at line 65 of file windows.cxx.

67{
68 int previous = (bin <= NBINS/2)? bin + step : bin - step;
69 int next = (bin <= NBINS/2)? bin - step : bin + step;
70
71 if (window[thr][previous-1][bound]) return previous;
72 if (window[thr][next-1][bound]) return next;
73
74 if (next == 1 || next == NBINS) return next;
75
76 return give_nearest_bin(window,thr,bin,bound,step+1);
77}
@ previous
Definition BinningData.h:32
int give_nearest_bin(const float(*window)[NBINS][BOUND], int thr, int bin, int bound, int step)
Definition windows.cxx:65
#define NBINS
Definition windows.h:9

◆ windows()

int windows ( float distance,
float eta_pivot,
int thr,
int sector )

Definition at line 14 of file windows.cxx.

15{
16
17 int bin=0,s=0;
18
19 for (int j=1;j<=50;j++)
20 {
21 if ((eta_pivot>=-1.1+(j-1)*0.044)&&(eta_pivot<-1.1+j*0.044)) bin = j;
22 }
23
24 int sector_type=((sector + 1)/2)%2;
25
26 const float (*window)[NBINS][BOUND] = 0;
27
28
29 if (sector_type == 0)
30 {
31 window = Large_win;
32 }
33 else if (sector_type == 1 &&
34 !( sector==21 || sector==22 || sector==25 || sector==26 ))
35 {
36 window = Small_win;
37 }
38 else
39 {
40 window = Foot_win;
41 }
42
43 if(distance <= 0)
44 {
45 if (!window[thr][bin-1][0])
46 {
47 bin = give_nearest_bin(window,thr,bin,0,1);
48 }
49
50 if(distance>=window[thr][bin-1][0]) s = 1;
51 }
52 else
53 {
54 if (!window[thr][bin-1][1])
55 {
56 bin = give_nearest_bin(window,thr,bin,1,1);
57 }
58
59 if(distance<=window[thr][bin-1][1]) s = 1;
60 }
61
62 return s;
63}
static const float Foot_win[THRES][NBINS][BOUND]
Definition foot.h:14
static const float Large_win[THRES][NBINS][BOUND]
Definition large.h:12
static const float Small_win[THRES][NBINS][BOUND]
Definition small.h:14
#define BOUND
Definition windows.h:10