21 #pragma GCC system_header 29 #include "TObjArray.h" 30 #include "TObjString.h" 40 #define REGRESSION_FILTER_LENGTH 8 41 #define REGRESSION_MATRIX_FRACTION 0.95 42 #define REGRESSION_SOLVE_EIGEN_THR 0. 43 #define REGRESSION_SOLVE_EIGEN_NUM 10 44 #define REGRESSION_SOLVE_REGULATOR 'h' 45 #define REGRESSION_APPLY_THR 0.8 73 #define LL_RMSFILE "" // is the root file which contains the noise rms used for whitening data 75 #define LL_FITSFILE "" // if fitsfile!="" the cWB fits skymap is saved into fitsfile.fits 77 #define LL_GRMS false // if grms==true && rmsfile!="" -> RMS whitening is provided by the user by the rmsfile parameter 114 cout <<
"-----> CWB_Plugin_LowLatency.C" << endl;
115 cout <<
"ifo " << ifo.Data() << endl;
116 cout <<
"type " << type << endl;
134 cout <<
"CWB_Plugin_LowLatency.C -> implemented only for 2G" << endl;
149 if(
id<0) {cout <<
"CWB_Plugin_LowLatency.C : Error - bad ifo id" << endl; gSystem->Exit(1);}
156 for(
int level=cfg->
l_high; level>=cfg->
l_low; level--) {
167 rr.
add(*hot,const_cast<char*>(
"target"));
181 if(gOPT.rmsfile!=
"") {
183 cout <<
"CWB_Plugin_LowLatency.C -> LOAD WHITENING FILE: " << gOPT.rmsfile << endl;
185 TFile *frms =
new TFile(gOPT.rmsfile);
187 cout <<
"CWB_Plugin_LowLatency.C -> Failed to open RMS whitening file " << gOPT.rmsfile << endl;
195 cout <<
"CWB_Plugin_LowLatency.C -> Object RMS doesn't exist !!! " << endl;
204 double tcenter = (x->
start()+x->
stop())/2.;
205 double rms_start = tcenter - length/2.;
217 if(gOPT.rmsfile!=
"") {
219 cout <<
"CWB_Plugin_LowLatency.C -> SAVE WHITENING FILE: " << gOPT.rmsfile << endl;
222 TFile *frms =
id==0 ?
new TFile(gOPT.rmsfile,
"RECREATE") :
new TFile(gOPT.rmsfile,
"UPDATE");
224 cout <<
"CWB_Plugin_LowLatency.C -> Failed to create file !!! " << endl;
263 for(
int k=0;
k<
K;
k++) {
265 id = net->
getwc(
k)->
get(const_cast<char*>(
"ID"), 0,
'L', rate);
269 int ID = size_t(
id.data[
j]+0.5);
277 cout <<
"CWB_Plugin_WF - event parameters : ID -> " << ID << endl;
279 cout <<
"rec_theta : " << EVT->
theta[0] <<
" rec_phi : " << EVT->
phi[0] << endl;
280 cout <<
"SNRnet : " << sqrt(EVT->
likelihood) <<
" netcc[0] : " << EVT->
netcc[0]
281 <<
" rho[0] : " << EVT->
rho[0] <<
" size : " << EVT->
size[0] << endl;
293 cout <<
"-----------------------------------------" << endl;
294 cout <<
"LowLatency config options " << endl;
295 cout <<
"-----------------------------------------" << endl << endl;
296 cout <<
"LL_RMSFILE " << gOPT.rmsfile << endl;
297 cout <<
"LL_GRMS " << gOPT.grms << endl;
298 cout <<
"LL_FITSFILE " << gOPT.fitsfile << endl;
309 if(!out.good()) {cout <<
"DumpUserOptions : Error Opening File : " << ofName << endl;
exit(1);}
318 out <<
"--------------------------------" << endl;
319 out <<
"LL config options " << endl;
320 out <<
"--------------------------------" << endl;
323 out <<
"ll_grms " << gOPT.grms << endl;
324 out << tabs << info << endl;
326 out <<
"ll_rmsfile " << gOPT.rmsfile << endl;
327 out << tabs << info << endl;
329 out <<
"ll_fitsfile " << gOPT.fitsfile << endl;
330 out << tabs << info << endl;
344 if(options.CompareTo(
"")!=0) {
345 cout << options << endl;
346 if(!options.Contains(
"--")) {
349 for(
int j=0;
j<token->GetEntries();
j++){
351 TObjString* tok = (TObjString*)token->At(
j);
352 TString stok = tok->GetString();
354 if(stok.Contains(
"ll_rmsfile=")) {
356 rmsfile.Remove(0,rmsfile.Last(
'=')+1);
357 gOPT.rmsfile=rmsfile;
360 if(stok.Contains(
"ll_grms=")) {
362 grms.Remove(0,grms.Last(
'=')+1);
366 if(stok.Contains(
"ll_fitsfile=")) {
368 fitsfile.Remove(0,fitsfile.Last(
'=')+1);
369 gOPT.fitsfile=fitsfile;
382 skymap skyprob = skyprobcc;
385 std::vector<float>* vP;
386 std::vector<int>* vI;
388 vP = &(NET->
wc_List[lag].p_Map[ID-1]);
389 vI = &(NET->
wc_List[lag].p_Ind[ID-1]);
392 for(
int j=0;
j<
int(vP->size());
j++) {
398 skyprob.
set(k,(*vP)[
j]);
400 ra = skyprob.
getRA(i);
402 skyprobcc.
set(k,(*vP)[j]);
405 skyprobcc.Dump2fits(const_cast<char*>(gOPT.fitsfile.Data()),EVT->
time[0],const_cast<char*>(
""),
const_cast<char*
>(
"PROB"),const_cast<char*>(
"pix-1"),
'C');
monster wdmMRA
list of pixel pointers for MRA
std::vector< char * > ifoName
detector * getifo(size_t n)
param: detector index
void white(double dT=0, int wtype=1, double offset=0., double stride=0.)
what it does: see algorithm description in wseries.hh
Float_t * rho
biased null statistics
void setMatrix(double edge=0., double f=1.)
std::vector< netcluster > wc_List
void PrintUserOptions(CWB::config *cfg)
#define REGRESSION_APPLY_THR
char * watversion(char c='s')
void bandpass(wavearray< DataType_t > &ts, double flow, double fhigh, int n=-1)
Int_t * size
cluster volume
cout<< endl;cout<< "ts size = "<< ts.size()<< " ts rate = "<< ts.rate()<< endl;tf.Forward(ts, wdm);int levels=tf.getLevel();cout<< "tf size = "<< tf.size()<< endl;double dF=tf.resolution();double dT=1./(2 *dF);cout<< "rate(hz) : "<< RATE<< "\ layers : "<< nLAYERS<< "\ dF(hz) : "<< dF<< "\ dT(ms) : "<< dT *1000.<< endl;int itime=TIME_PIXEL_INDEX;int ifreq=FREQ_PIXEL_INDEX;int index=(levels+1) *itime+ifreq;double time=itime *dT;double freq=(ifreq >0) ? ifreq *dF :dF/4;cout<< endl;cout<< "PIXEL TIME = "<< time<< " sec "<< endl;cout<< "PIXEL FREQ = "<< freq<< " Hz "<< endl;cout<< endl;wavearray< double > x
wavearray< double > get(char *name, size_t index=0, char atype='R', int type=1, bool=true)
param: string with parameter name param: index in the amplitude array, which define detector param: c...
void ReadUserOptions(TString options)
double getTheta(size_t i)
size_t add(WSeries< double > &target, char *name, double fL=0., double fH=0.)
virtual void start(double s)
#define REGRESSION_SOLVE_EIGEN_NUM
#define REGRESSION_MATRIX_FRACTION
network ** net
NOISE_MDC_SIMULATION.
#define REGRESSION_SOLVE_REGULATOR
size_t getSkyIndex(double th, double ph)
param: theta param: phi
virtual size_t size() const
void output2G(TTree *, network *, size_t, int, double)
void PrintAnalysisInfo(CWB_STAGE stage, TString comment, TString info, bool out=true, bool log=true)
wavearray< double > hot[2]
#define IMPORT(TYPE, VAR)
void apply(double threshold=0., char c='a')
WSeries< double > pTF[nRES]
printf("total live time: non-zero lags = %10.1f \, liveTot)
void solve(double th, int nE=0, char c='s')
Float_t * netcc
effective correlated SNR
void DumpUserOptions(TString odir, CWB::config *cfg)
wavearray< double > getClean()
void CWB_Plugin(TFile *jfile, CWB::config *cfg, network *net, WSeries< double > *x, TString ifo, int type)
COHERENCE.
void DumpSkymap(network *NET, int lag, netevent *EVT, int ID)
Float_t * phi
sqrt(h+*h+ + hx*hx)
netevent EVT(itree, nifo)
Float_t * theta
[0]-reconstructed, [1]-injected phi angle, [2]-RA
Double_t * time
beam pattern coefficients for hx
WSeries< double > * getTFmap()
param: no parameters
virtual void stop(double s)
void Forward(int n=-1)
param: wavelet - n is number of steps (-1 means full decomposition)
netcluster * getwc(size_t n)
param: delay index
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
void set(size_t i, double a)
param: sky index param: value to set
double factors[FACTORS_MAX]
#define REGRESSION_SOLVE_EIGEN_THR
void Inverse(int n=-1)
param: n - number of steps (-1 means full reconstruction)
virtual WSeries< double > white(double, int, double=0., double=0.)
what it does: each wavelet layer is devided into k intervals.
#define REGRESSION_FILTER_LENGTH