-
Notifications
You must be signed in to change notification settings - Fork 0
/
scanner.h
173 lines (122 loc) · 4.46 KB
/
scanner.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#ifndef _SCANNER_H_
#define _SCANNER_H_
#include <iostream>
#include <fstream>
#include <cmath>
#include <sys/stat.h>
#include <sys/types.h>
#include <cstring>
#include <iomanip>
#include <algorithm>
#include "events.h"
#include "healpixmap.h"
#include "maptools.h"
#include "agntools.h"
#include "TStopwatch.h"
//! Scan procedure
class TScanner
{
public :
//! Constructor
TScanner(const vector<TEvent> & events, const vector<TAgn> & sources, const THealpixMap & cMap);
//! Sets #fEmin and #fEmax
void SetRangeEnergy(double eMin, double eMax);
//! Sets #fNagn, #fZmin, #fZmax, #fZstep and #fNzStep
void SetRangeRedshift(double zMin, double zMax, double zStep);
//! Sets #fPsiMin, #fPsiMax, #fPsiStep and #fNpsi.
void SetRangeAngle(double psiMin, double psiMax, double psiStep);
//! Dump the ranges in energy, redshift and separation angle to the terminal.
void PrintRanges();
//! Calls the #bigN function.
int GetBigN(double eMinPar);
//! Calls the #littleP function.
double GetLittleP(double zMaxPar, double psiMaxPar);
//! Calls the #littleK function.
int GetLittleK(double zMaxPar, double psiMaxPar, double eMinPar);
//! Cheat, if you know your minimum-big-P parameters in advance
void SetScanResults(double eMinAtMin, double zMaxAtMin, double psiMaxAtMin, double & minBigP, double & littlePAtMin, int & littleKAtMin, int & bigNAtMin);
//! Perform the scan
void PerformScan(bool timerOn);
//! Print the result of the scan
void PrintScanResults(double & eMinAtMin, double & zMaxAtMin, double & psiMaxAtMin, double & minBigP, double & littlePAtMin, int & littleKAtMin, int & bigNAtMin);
//! Events that correlate with an AGN
vector<TEvent> GetEventsThatCorrelate();
//! Events that do not correlate with an AGN
vector<TEvent> GetEventsThatDoNotCorrelate();
//! AGNs within #fZmaxAtMin
vector<TAgn> SourcesCloserZmax();
//! Informations about events and AGNs at #fMinBigP
void PrintEventsAndNearAGN();
/*!
Returns 1 if there is an AGN with z \f$ \leq \f$ zMaxPar with angular distance \f$ \psi \leq \f$ psiMaxPar
from test. Returns 0 if it's not the case.
*/
int IsSourceNearTest(double lTest, double bTest, double zMaxPar, double psiMaxPar);
private :
/*!
Initializes #fNbPix, #fLpix, #fBpix, #fMinBigP, #fEminAtMin, #fZmaxAtMin, #fPsiMaxAtMin, #fLittlePAtMin,
#fLittleKAtMin and #fBigNAtMin.
*/
void Init();
//! Returns little-p for a given zMaxPar and psiMaxpar.
double littleP(double zMaxPar, double psiMaxPar);
//! Returns the number of events that correlate.
int littleK(double zMaxPar, double psiMaxPar, double eMinPar);
//! Returns the total number of events in set #fEmin \f$ \leq E \leq \f$ #fEmax with \f$ E \geq \f$ eMinPar.
int bigN(double eMinPar);
//! Events.
vector<TEvent> fEvents;
//! Number of events.
unsigned int fNevents;
//! Coverage Map.
THealpixMap fCovMap;
//! Number of pixels of the map.
unsigned int fNbPix;
//! Galactic longitude of th pixels.
vector<double> fLpix;
//! Galactic latitude of the pixels.
vector<double> fBpix;
//! Minimum energy of the events to be considered for the scan.
double fEmin;
//! Maximum energy of the events to be considered for the scan.
double fEmax;
//! Minimum redshift of the AGNs to be considered for the scan.
double fZmin;
//! maximum redshift of the AGNs of the sources to be considered.
double fZmax;
//! Step in redshift
double fZstep;
//! Number of step in redshift
unsigned int fNzStep;
//! Minimum values of the redshift.
vector<double> fZmins;
//! AGNs.
vector<TAgn> fAGNs;
//! Number of AGNs.
unsigned int fNagn;
//! Minimum separation angle between AGNs and events.
double fPsiMin;
//! Maximum separation angle betxeen AGNs and events.
double fPsiMax;
//! Step in separation angles
double fPsiStep;
//! Minimum values of the separation angles
vector<double> fPsis;
//! Number of separation angles
unsigned int fNpsi;
//! Minimum Probability
double fMinBigP;
//! Lower value of the energy at #fMinBigP
double fEminAtMin;
//! Upper value of the redshift at #fMinBigP
double fZmaxAtMin;
//! Upper value of the separation angle at #fMinBigP
double fPsiMaxAtMin;
//! Little-P at #fMinBigP
double fLittlePAtMin;
//! Number of events that correlate at #fMinBigP
int fLittleKAtMin;
//! Total number of events at #fMinBigP
int fBigNAtMin;
};
#endif