8 #ifdef _USE_ROOT6 // ------------------------------------------------------ ROOT6
10 #define SETVAR(MODE,VAR,TYPE,SIZE1,SIZE2) { \
12 global = (TGlobal*)gROOT->GetGlobal("gPOINTER",true); \
13 if(global==NULL) sprintf(cmdline,"void* gPOINTER = (void*)&%s;",#VAR); \
14 else sprintf(cmdline,"gPOINTER = (void*)&%s;",#VAR); \
15 gROOT->ProcessLine(cmdline); \
16 global = (TGlobal*)gROOT->GetGlobal("gPOINTER",true); \
18 void* gPOINTER=NULL; \
19 memcpy((void*)&gPOINTER,(void*)global->GetAddress(),sizeof(void*)); \
20 memcpy((void*)&VAR,(void*)gPOINTER,SIZE1*SIZE2*sizeof(TYPE)); \
23 global = (TGlobal*)gROOT->GetGlobal(#VAR,true); \
25 if(SIZE1==1 && SIZE2==1) strcpy(cmdline,#TYPE" "#VAR";"); \
26 if(SIZE1>1 && SIZE2==1) strcpy(cmdline,#TYPE" "#VAR"["#SIZE1"];"); \
27 if(SIZE1>1 && SIZE2>1) strcpy(cmdline,#TYPE" "#VAR"["#SIZE1"]["#SIZE2"];"); \
28 gROOT->ProcessLine(cmdline); \
29 global = (TGlobal*)gROOT->GetGlobal(#VAR,true); \
31 if(SIZE1==1 && SIZE2==1) { \
32 void* pVAR = (void*)&VAR; \
33 global = (TGlobal*)gROOT->GetGlobal(#VAR,true); \
34 sprintf(cmdline,#VAR" = *("#TYPE"*)%p;",pVAR); \
36 void* pVAR = (void*)&VAR; \
37 global = (TGlobal*)gROOT->GetGlobal(#VAR,true); \
38 sprintf(cmdline,"memcpy((void*)%p,(void*)%p,"#SIZE1"*"#SIZE2"*sizeof("#TYPE"));", \
39 (void*)global->GetAddress(),pVAR); \
41 gROOT->ProcessLine(cmdline); \
44 #else // -------------------------------------------------------------- ROOT5
46 #define SETVAR(MODE,VAR,TYPE,SIZE1,SIZE2) { \
48 global = (TGlobal*)gROOT->GetGlobal("gPOINTER",true); \
49 if(global==NULL) sprintf(cmdline,"void* gPOINTER = (void*)&%s;",#VAR); \
50 else sprintf(cmdline,"gPOINTER = (void*)&%s;",#VAR); \
51 gROOT->ProcessLine(cmdline); \
52 global = (TGlobal*)gROOT->GetGlobal("gPOINTER",true); \
54 void* gPOINTER=NULL; \
55 memcpy((void*)&gPOINTER,(void*)global->GetAddress(),sizeof(void*)); \
56 memcpy((void*)&VAR,(void*)gPOINTER,SIZE1*SIZE2*sizeof(TYPE)); \
59 global = (TGlobal*)gROOT->GetListOfGlobals()->FindObject(#VAR); \
61 if(SIZE1==1 && SIZE2==1) strcpy(cmdline,#TYPE" "#VAR";"); \
62 if(SIZE1>1 && SIZE2==1) strcpy(cmdline,#TYPE" "#VAR"["#SIZE1"];"); \
63 if(SIZE1>1 && SIZE2>1) strcpy(cmdline,#TYPE" "#VAR"["#SIZE1"]["#SIZE2"];"); \
64 gROOT->ProcessLine(cmdline); \
65 global = (TGlobal*)gROOT->GetGlobal(#VAR,true); \
67 sprintf(cmdline,"memcpy((void*)%p,(void*)%p,"#SIZE1"*"#SIZE2"*sizeof("#TYPE"));", \
68 (void*)global->GetAddress(),(void*)&VAR); \
69 gROOT->ProcessLine(cmdline); \
72 #endif // ---------------------------------------------------------- END MACRO
74 #define EXPORT(TYPE,VAR,CMD) { \
75 TGlobal* global = (TGlobal*)gROOT->GetGlobal(#VAR,true); \
76 char __cmdline[128]; \
77 if(global==NULL) sprintf(__cmdline,"%s %s;",#TYPE,CMD); \
78 else sprintf(__cmdline,"%s;",CMD); \
79 gROOT->ProcessLine(__cmdline); \
83 #define PRINT(ARG1,ARG2,ARG3,ARG4) { \
84 printf(" "#ARG1" "#ARG2"\t= "#ARG3";\t\t// "#ARG4"\n",ARG2); \
178 strcpy(this->analysis,
"");
352 for(
int i=0;
i<gApplication->Argc();
i++) {
354 if(
TString(gApplication->Argv(
i)).EndsWith(
".C")) {
357 if(file1==NULL) {check=
false;
continue;}
359 if(file2==NULL) {
delete [] file1;check=
false;
continue;}
363 if(strlen(file1)==strlen(file2)) {
364 for(
int i=0;
i<strlen(file1);
i++) {
if(file1[
i]!=file2[
i]) check=
false;
break;}
369 if(check==
true)
return;
375 gROOT->ProcessLine(
"#include \"xroot.hh\"");
376 gROOT->Macro(umacro,&err);
378 cout <<
"CWB::config::Import : Error Loading Macro " << umacro.Data() << endl;
396 if(fname.Sizeof()>1)
Print(fname);
411 SETVAR(MODE,analysis,
char,8,1);
418 SETVAR(MODE,cfg_search,
char,1,1);
422 SETVAR(MODE,cfg_search,
char,1,1);
435 SETVAR(MODE,inRate,
size_t,1,1);
439 SETVAR(MODE,TFgap,
double,1,1);
464 SETVAR(MODE,segOverlap,
double,1,1);
499 SETVAR(MODE,iwindow,
double,1,1);
521 SETVAR(MODE,subnet,
double,1,1);
522 SETVAR(MODE,subcut,
double,1,1);
529 SETVAR(MODE,cfg_gamma,
double,1,1);
533 SETVAR(MODE,cfg_gamma,
double,1,1);
536 SETVAR(MODE,gamma,
double,1,1);
604 SETVAR(MODE,condor_tag,
char,1024,1);
610 SETVAR(MODE,frRetryTime,
int,1,1);
622 global = (TGlobal*)gROOT->GetListOfGlobals()->FindObject(
"plugin");
628 if(list->GetSize()==0) {
629 cout <<
"CWB::config::SetVar - Error loading plugin : "
630 <<
plugin.GetTitle() << endl;
635 global = (TGlobal*)gROOT->GetListOfGlobals()->FindObject(
"plugin");
653 global = (TGlobal*)gROOT->GetListOfGlobals()->FindObject(
"configPlugin");
659 if(list->GetSize()==0) {
660 cout <<
"CWB::config::SetVar - Error loading configPlugin : "
667 global = (TGlobal*)gROOT->GetListOfGlobals()->FindObject(
"configPlugin");
671 global = (TGlobal*)gROOT->GetGlobal(
"configPlugin",
true);
673 char tmpFile[1024]=
"";
727 FILE* stream = stdout;
729 if((stream = fopen(option,
"w")) == NULL) {
730 cout <<
"CWB::config::Print : Error opening file " << option << endl;
735 if(
nIFO==0) {
for(
int n=0;
n<
NIFO_MAX-1;
n++) comma[
n]=
','; comma[NIFO_MAX-1]=
' ';}
736 else {
for(
int n=0;
n<
nIFO-1;
n++) comma[
n]=
','; comma[nIFO-1]=
' ';}
740 fprintf(stream,
" #ifndef CWB_USER_PARAMETER_FILE\n");
741 fprintf(stream,
" #define CWB_USER_PARAMETER_FILE\n\n");
743 fprintf(stream,
" #include \"xroot.hh\" // defines macro to manage ROOT5 vs ROOT6\n");
746 fprintf(stream,
" char analysis[8] \t= \"%s\";\t\t// cWB analysis\n",analysis);
747 fprintf(stream,
" bool online\t\t= %d;\t\t// true/false -> online/offline\n",
online);
749 fprintf(stream,
" int nIFO\t\t= %d;\t\t// size of network starting with first detector ifo[]\n",
nIFO);
750 fprintf(stream,
" SEARCH(char)\t\t= '%c';\t\t// see description below\n",
search);
751 fprintf(stream,
" bool optim\t\t= %d;\t\t// true -> optimal resolution likelihood analysis\n",
optim);
755 fprintf(stream,
" char ifo[NIFO_MAX][8];\n");
756 fprintf(stream,
" char refIFO[4];\t\t\t// reference IFO\n");
758 fprintf(stream,
" // user define detectors list : is selected if detectorParams[n].name!=\"\"\n");
759 fprintf(stream,
" // {name, latitude, longitude, elevation, AltX, AzX, AltY, AzY}\n");
760 fprintf(stream,
" detectorParams detParms[NIFO_MAX];\n");
763 fprintf(stream,
" char ifo[%d][8]\t= {%s};\n",nIFO,ifos);
764 fprintf(stream,
" char refIFO[4]\t= \"%s\";\t\t// reference IFO\n",
refIFO);
766 fprintf(stream,
" // user define detectors list : is selected if detectorParams[n].name!=\"\"\n");
767 fprintf(stream,
" // {name, latitude, longitude, elevation, AltX, AzX, AltY, AzY}\n");
768 fprintf(stream,
" detectorParams detParms[%d] = {\n",nIFO);
769 for(
int i=0;
i<
nIFO;
i++)
fprintf(stream,
" {\"%s\", %g, %g, %g, %g, %g, %g, %g},\n",
777 fprintf(stream,
" // cWB settings\n");
780 fprintf(stream,
" size_t inRate\t\t= %lu;\t// input data rate\n",inRate);
781 fprintf(stream,
" double bpp\t\t= %g;\t// probability for pixel selection\n",
bpp);
783 fprintf(stream,
" double Tgap\t\t= %g;\t// time gap between clusters (sec)\n",
Tgap);
784 fprintf(stream,
" double Fgap\t\t= %g;\t// frequency gap between clusters (Hz)\n",
Fgap);
786 fprintf(stream,
" double Tgap\t\t= %g;\t// defragmentation time gap between clusters (sec)\n",
Tgap);
787 fprintf(stream,
" double Fgap\t\t= %g;\t// defragmentation frequency gap between clusters (Hz)\n",
Fgap);
788 fprintf(stream,
" double TFgap\t\t= %g;\t// threshold on the time-frequency separation between two pixels\n",TFgap);
790 fprintf(stream,
" double fLow\t\t= %g;\t// low frequency of the search\n",
fLow);
791 fprintf(stream,
" double fHigh\t\t= %g;\t// high frequency of the search\n",
fHigh);
792 fprintf(stream,
" size_t fResample\t= %lu;\t\t// if>0 the inRate is resampled to fResample\n",
fResample);
793 fprintf(stream,
" double Acore\t\t= %g;\t// threshold for selection of core pixels\n",
Acore);
794 fprintf(stream,
" double Tlpr\t\t= %g;\t// training time for LPR filter\n",
Tlpr);
798 fprintf(stream,
" double x2or\t\t= %g;\t// 2 OR threshold\n",
x2or);
800 fprintf(stream,
" double netRHO\t\t= %g;\t// threshold on rho\n",
netRHO);
802 fprintf(stream,
" double netRHO\t\t= %g;\t// (4.5-5.5) - kills weak clusters to reduce output pixel rate (supercluster)\n",
netRHO);
804 fprintf(stream,
" double netCC\t\t= %g;\t// threshold on network correlation\n",
netCC);
807 fprintf(stream,
" // wavelet transformation settings\n");
810 fprintf(stream,
" int levelR\t\t= %d;\t\t// resampling level : inRate[fResample]/(2^levelR) Hz\n",
levelR);
811 fprintf(stream,
" int levelF\t\t= %d;\t\t// level where second LPR filter is applied\n",
levelF);
812 fprintf(stream,
" int levelD\t\t= %d;\t\t// decomposition level\n",
levelD);
813 fprintf(stream,
" int l_low\t\t= %d;\t\t// low frequency resolution level (2^l_low Hz)\n",
l_low);
814 fprintf(stream,
" int l_high\t\t= %d;\t\t// high frequency resolution level (2^l_high Hz)\n",
l_high);
817 fprintf(stream,
" // time shift analysis settings\n");
820 fprintf(stream,
" // segments\n");
822 fprintf(stream,
" double segLen\t\t= %g;\t// Segment length [sec]\n",
segLen);
823 fprintf(stream,
" double segMLS\t\t= %g;\t// Minimum Segment Length after DQ_CAT1 [sec]\n",
segMLS);
824 fprintf(stream,
" double segTHR\t\t= %g;\t// Minimum Segment Length after DQ_CAT2 [sec]\n",
segTHR);
825 fprintf(stream,
" double segEdge\t= %g;\t// wavelet boundary offset [sec]\n",
segEdge);
826 fprintf(stream,
" double segOverlap\t= %g;\t// overlap between job segments [sec]\n",segOverlap);
831 fprintf(stream,
" size_t lagSize\t= %lu;\t\t// number of lags (simulation=1)\n",
lagSize);
832 fprintf(stream,
" double lagStep\t= %g;\t// time interval between lags [sec]\n",
lagStep);
833 fprintf(stream,
" size_t lagOff\t\t= %lu;\t\t// first lag id (lagOff=0 - include zero lag )\n",
lagOff);
834 fprintf(stream,
" size_t lagMax\t\t= %lu;\t\t// 0/>0 - standard/extended lags\n",
lagMax);
835 if(
lagFile==NULL)
fprintf(stream,
" char* lagFile\t= NULL;\t\t// lag file list\n");
837 fprintf(stream,
" char* lagFile\t= new char[1024];\t\t// lag file list\n");
840 fprintf(stream,
" char lagMode[2]\t= \"%s\";\t\t// w/r - write/read lag list\n",
lagMode);
842 fprintf(stream,
" size_t* lagSite\t= NULL;\t\t// site index starting with 0\n");
845 fprintf(stream,
" size_t lagSite[%d]\t= {%s};\t\t// site index starting with 0\n",nIFO,sites);
849 fprintf(stream,
" double shift[NIFO_MAX] = {%s};\t// use for standard shifts\n",shifts);
851 fprintf(stream,
" double shift[%d]\t= {%s};\t// use for standard shifts\n",nIFO,shifts);
855 fprintf(stream,
" // multi lags\n");
856 fprintf(stream,
" int mlagStep\t= %d;\t\t// if mlagStep=0 then 'standard lag mode'\n",
mlagStep);
857 fprintf(stream,
" \t\t\t\t\t// else cicle over lags with step mlagStep\n");
860 fprintf(stream,
" // super lags\n");
861 fprintf(stream,
" int slagSize\t= %d;\t\t// number of super lags (simulation=1) - if slagSize=0 -> Standard Segments\n",
slagSize);
862 fprintf(stream,
" int slagMin\t= %d;\t\t// select the minimum available slag distance : slagMin must be <= slagMax\n",
slagMin);
863 fprintf(stream,
" int slagMax\t= %d;\t\t// select the maximum available slag distance\n",
slagMax);
864 fprintf(stream,
" int slagOff\t= %d;\t\t// first slag id (slagOff=0 - include zero slag )\n",
slagOff);
866 fprintf(stream,
" size_t* slagSite\t= NULL;\t\t// site index starting with 0\n");
870 fprintf(stream,
" size_t slagSite[%d]\t= {%s};\t\t// site index starting with 0\n",nIFO,sites);
872 if(
slagFile==NULL)
fprintf(stream,
" char* slagFile\t= NULL;\t\t// slag file list\n");
874 fprintf(stream,
" char* slagFile\t= new char[1024];\t\t// slag file list\n");
879 fprintf(stream,
" // whitening parameters\n");
880 fprintf(stream,
" double whiteWindow\t= %g;\t// time window dT. if = 0 - dT=T, where T is wavearray duration\n",
whiteWindow);
881 fprintf(stream,
" double whiteStride\t= %g;\t// noise sampling interval (window stride)\n",
whiteStride);
884 fprintf(stream,
" int Psave\t\t= %d;\t\t// Skymap probability to be saved in the final output root file\n",
Psave);
885 fprintf(stream,
" \t\t\t\t\t// (saved if !=0 : see nSky)\n");
888 fprintf(stream,
" // DC corrections\n");
891 fprintf(stream,
" double dcCal[NIFO_MAX] = {%s};\t// use for standard dcCals\n",dcCals);
893 fprintf(stream,
" double dcCal[%d]\t= {%s};\t// use for standard dcCals\n",nIFO,dcCals);
897 fprintf(stream,
" // simulation parameters\n");
898 fprintf(stream,
" int simulation\t= %d;\t\t// 1 for simulation, 0 for production\n",
simulation);
899 fprintf(stream,
" double iwindow\t= %g;\t// analysis time window for injections (Range = Tinj +/- iwindow/2)\n",iwindow);
900 fprintf(stream,
" int nfactor\t\t= %d;\t\t// number of strain factors\n",
nfactor);
902 fprintf(stream,
" double factors[FACTORS_MAX];\t\t\t// array of strain factors\n");
904 fprintf(stream,
" double factors[] = {\t\t\t// array of strain factors\n");
911 fprintf(stream,
" // noise shift data\n");
912 char dataShifts[64]=
"";
914 fprintf(stream,
" double dataShift[NIFO_MAX] = {%s};\t// use for standard dataShifts\n",dataShifts);
916 fprintf(stream,
" double dataShift[%d]\t= {%s};\t// use for standard dataShifts\n",nIFO,dataShifts);
920 fprintf(stream,
" // use this parameter to shift in time the injections (sec)\n");
921 fprintf(stream,
" // use {0,0,0} to set mdc_shift to 0\n");
922 fprintf(stream,
" // if {-1,0,0} the shift is automaticaly selected\n");
923 fprintf(stream,
" // {startMDC, stopMDC}\n");
927 fprintf(stream,
" // delay filter\n");
931 fprintf(stream,
" char filter[1024] = \"%s\";\t\t// delay filter suffix: \"\", or \"up1\", or \"up2\" [1G]\n",
filter);
933 fprintf(stream,
" \t\t\t\t\t// catalog of WDM cross-talk coefficients [2G]\n");
935 fprintf(stream,
" size_t upTDF\t\t= %lu;\t\t// upsample factor to obtain rate of TD filter\n",
upTDF);
936 fprintf(stream,
" \t\t\t\t\t// TDRate = (inRate>>levelR)*upTDF [2G]\n");
937 fprintf(stream,
" size_t TDSize\t\t= %lu;\t\t// time-delay filter size (max 20) [2G]\n",
TDSize);
942 fprintf(stream,
" // coherence stage\n");
945 fprintf(stream,
" int pattern\t= %d;\t\t// select pixel pattern used to produce the energy max maps for pixel's selection [2G]\n",
pattern);
948 fprintf(stream,
" // supercluster stage\n");
951 fprintf(stream,
" int BATCH\t= %d;\t\t// max number of pixel to process in one loadTDamp batch [2G]\n",
BATCH);
952 fprintf(stream,
" int LOUD\t= %d;\t\t\t// number of pixel per cluster to load TD amplitudes [2G]\n",
LOUD);
953 fprintf(stream,
" double subnet\t= %g;\t\t// sub network threshold (supercluster) [2G]\n",subnet);
954 fprintf(stream,
" double subcut\t= %g;\t\t// sub network threshold in the skyloop (supercluster) [2G]\n",subcut);
958 fprintf(stream,
" // regulator\n");
962 fprintf(stream,
" double delta\t= %g;\t\t// [0/1] -> [weak/soft]\n",
delta);
963 fprintf(stream,
" GAMMA(double)\t= %g;\t\t// set params in net5, [0/1]->net5=[nIFO/0],\n",gamma);
964 fprintf(stream,
" \t\t\t\t\t// if net5>[threshold=(nIFO-1)] weak/soft[according to delta] else hard\n");
967 fprintf(stream,
" double delta\t= %g;\t\t// 2G: [-1:1] - regulate 2 Detector sky locations\n",
delta);
968 fprintf(stream,
" \t\t\t\t\t// 2G: delta=0 : regulator is disabled, delta<0 : select Lo as skystat instead of Lr\n");
969 fprintf(stream,
" GAMMA(double)\t= %g;\t\t// 2G: [-1,1] - \n",gamma);
970 fprintf(stream,
" \t\t\t\t\t// 2G: gamma=0 : regulator is disabled, gamma<0 : sky prior is applied\n");
974 fprintf(stream,
" // sky settings\n");
977 fprintf(stream,
" bool EFEC\t\t= %d;\t\t// Earth Fixed / Selestial coordinates\n",
EFEC);
978 fprintf(stream,
" size_t mode\t\t= %lu;\t\t// sky search mode\n",
mode);
979 fprintf(stream,
" double angle\t\t= %g;\t// angular resolution\n",
angle);
980 fprintf(stream,
" double Theta1\t\t= %g;\t// start theta\n",
Theta1);
981 fprintf(stream,
" double Theta2\t\t= %g;\t// end theta\n",
Theta2);
982 fprintf(stream,
" double Phi1\t\t= %g;\t// start theta\n",
Phi1);
983 fprintf(stream,
" double Phi2\t\t= %g;\t// end theta\n",
Phi2);
984 fprintf(stream,
" double mask\t\t= %g;\t// sky mask fraction\n",
mask);
985 fprintf(stream,
" size_t healpix\t= %lu;\t\t// if not 0 use healpix sky map (healpix order)\n",
healpix);
988 fprintf(stream,
" // error regions settings\n");
992 fprintf(stream,
" double precision\t= %g;\t// No = nIFO*(K+KZero)+precision*E\n",
precision);
994 fprintf(stream,
" double precision\t= %g;\t// set parameters for big clusters events management",
precision);
998 fprintf(stream,
" // file dump mode\n");
1001 fprintf(stream,
" // job file options\n");
1002 fprintf(stream,
" CWB_JOBF_OPTIONS jobfOptions;\n");
1003 fprintf(stream,
" jobfOptions = CWB_JOBF_SAVE_DISABLE;\n");
1020 fprintf(stream,
" // output root file options\n");
1021 fprintf(stream,
" CWB_OUTF_OPTIONS outfOptions;\n");
1022 fprintf(stream,
" outfOptions = CWB_OUTF_SAVE_DISABLE;\n");
1026 fprintf(stream,
" bool dumpHistory\t= %d;\t\t// dump history into output root file\n",
dumpHistory);
1027 fprintf(stream,
" bool dump\t\t= %d;\t\t// dump triggers into ascii file\n",
dump);
1028 fprintf(stream,
" bool savemode\t\t= %d;\t\t// temporary save clusters on disc\n",
savemode);
1029 fprintf(stream,
" bool cedDump\t\t= %d;\t\t// dump ced plots with rho>cedRHO\n",
cedDump);
1031 fprintf(stream,
" long nSky\t\t= %lu;\t\t// # of skymap prob pixels dumped to ascii\n",
nSky);
1032 fprintf(stream,
" \t\t\t\t\t//(nSky=0 -> (#pixels==1000 || cum prob > 0.99))\n");
1035 fprintf(stream,
" // directories, file names\n");
1044 fprintf(stream,
" char channelNamesRaw[NIFO_MAX][50];\n");
1046 fprintf(stream,
" char channelNamesRaw[%d][50] = {\n",
nIFO);
1051 fprintf(stream,
" char channelNamesMDC[NIFO_MAX][50];\n");
1053 fprintf(stream,
" char channelNamesMDC[%d][50] = {\n",
nIFO);
1059 fprintf(stream,
" // working dir\n");
1078 fprintf(stream,
" // data label\n");
1082 fprintf(stream,
" // condor declarations\n");
1086 fprintf(stream,
" // Define a Unique Tag for Condor Jobs\n");
1087 fprintf(stream,
" char condor_tag[1024]\t= \"%s\";\n",condor_tag);
1090 fprintf(stream,
" // frame files list : [0:nIFO-1]/[nIFO:2*nIFO-1] contains strain/mdc file names\n");
1091 fprintf(stream,
" // If all mdc channels are in a single frame file -> mdc must be declared in the nIFO position\n");
1093 fprintf(stream,
" char frFiles[2*NIFO_MAX][1024];\n");
1095 fprintf(stream,
" char frFiles[%d][1024] = {\n",2*
nIFO);
1101 fprintf(stream,
" // frame reading retry time (sec) : 0 -> disable\n");
1102 fprintf(stream,
" int frRetryTime = %d;\n",frRetryTime);
1105 fprintf(stream,
" // dq file list\n");
1106 fprintf(stream,
" // {ifo, dqcat_file, dqcat[0/1/2], shift[sec], inverse[false/true], 4columns[true/false]}\n");
1109 fprintf(stream,
" dqfile DQF[DQF_MAX];\n");
1112 for(
int i=0;
i<
nDQF;
i++)
fprintf(stream,
" {\"%s\", \"%s\", (CWB_CAT)%d, %g, %d, %d},\n",
1118 fprintf(stream,
" // read and dump data on local disk (nodedir)\n");
1123 fprintf(stream,
" // cwb config path\n");
1124 fprintf(stream,
" char cwb_config_env[1024]\t= \"%s\";\n",cwb_config_env);
1125 fprintf(stream,
" // cluster site name\n");
1129 fprintf(stream,
" // plugin name\n");
1130 fprintf(stream,
" TMacro plugin;\n");
1133 pluginPath.ReplaceAll(
"_C.so",
".C");
1134 fprintf(stream,
" plugin = TMacro(\"%s\");\n",pluginPath.Data());
1135 fprintf(stream,
" plugin.SetTitle(\"%s\");\n",
plugin.GetTitle());
1137 fprintf(stream,
" TMacro configPlugin;\n");
1143 fprintf(stream,
" bool dataPlugin\t= %d;\t\t// if dataPlugin=true disable read data from frames\n",
dataPlugin);
1144 fprintf(stream,
" bool mdcPlugin\t= %d;\t\t// if mdcPlugin=true disable read data from frames\n",
mdcPlugin);
1145 fprintf(stream,
" bool dcPlugin\t\t= %d;\t\t// if dcPlugin=true disable built-in data conditioning (only 2G)\n",
dcPlugin);
1146 fprintf(stream,
" bool cohPlugin\t= %d;\t\t// if cohPlugin=true disable built-in coherence stage (only 2G)\n",
cohPlugin);
1147 fprintf(stream,
" bool scPlugin\t\t= %d;\t\t// if scPlugin=true disable built-in supercluster function (only 2G)\n",
scPlugin);
1148 fprintf(stream,
" bool outPlugin\t= %d;\t\t// if outPlugin=true disable built-in output wave file (only 2G)\n",
outPlugin);
1154 fprintf(stream,
" // statistics\n");
1155 fprintf(stream,
" // L - likelihood\n");
1156 fprintf(stream,
" // c - network correlation coefficient\n");
1157 fprintf(stream,
" // A - energy disbalance asymmetry\n");
1158 fprintf(stream,
" // P - penalty factor based on correlation coefficients <x,s>/sqrt(<x,x>*<s,s>)\n");
1159 fprintf(stream,
" // E - total energy in the data streams\n");
1161 fprintf(stream,
" // search modes\n");
1162 fprintf(stream,
" // 'c' - un-modeled search, fast S5 cWB version, requires constraint settings\n");
1163 fprintf(stream,
" // 'h' - un-modeled search, S5 cWB version, requires constraint settings\n");
1164 fprintf(stream,
" // 'B' - un-modeled search, max(P*L*c/E)\n");
1165 fprintf(stream,
" // 'b' - un-modeled search, max(P*L*c*A/E)\n");
1166 fprintf(stream,
" // 'I' - elliptical plarisation, max(P*L*c/E)\n");
1167 fprintf(stream,
" // 'S' - linear plarisation, max(P*L*c/E)\n");
1168 fprintf(stream,
" // 'G' - circular plarisation, max(P*L*c/E)\n");
1169 fprintf(stream,
" // 'i' - elliptical plarisation, max(P*L*c*A/E)\n");
1170 fprintf(stream,
" // 's' - linear plarisation, max(P*L*c*A/E)\n");
1171 fprintf(stream,
" // 'g' - circular plarisation, max(P*L*c*A/E)\n");
1173 fprintf(stream,
" // search modes\n");
1174 fprintf(stream,
" // r - un-modeled\n");
1175 fprintf(stream,
" // i - iota - wave (no dispersion correction)\n");
1176 fprintf(stream,
" // p - Psi - wave\n");
1177 fprintf(stream,
" // l,s - linear\n");
1178 fprintf(stream,
" // c,g - circular\n");
1179 fprintf(stream,
" // e,b - elliptical (no dispersion correction)\n");
1199 if(
sizeof(filename)==0) {
1200 cout <<
"CWB::config::DumpPlugin - Error : no input filename" << endl;
1206 for(
int i=0;
i<list->GetSize();
i++) {
1207 TObjString*
string = (TObjString*)list->At(
i);
1208 cout <<
string->GetString() << endl;
1211 plugin.SaveSource(filename);
1212 cout <<
"plugin saved into : " << filename << endl;
1227 if(
sizeof(filename)==0) {
1228 cout <<
"CWB::config::DumpConfigPlugin - Error : no input filename" << endl;
1234 for(
int i=0;
i<list->GetSize();
i++) {
1235 TObjString*
string = (TObjString*)list->At(
i);
1236 cout <<
string->GetString() << endl;
1240 cout <<
"configPlugin saved into : " << filename << endl;
1254 gRandom->SetSeed(0);
1255 int rnID =
int(gRandom->Rndm(13)*1.e9);
1256 UserGroup_t*
uinfo = gSystem->GetUserInfo();
1258 gSystem->Exec(
TString(
"mkdir -p /dev/shm/")+uname);
1261 sprintf(ofile1,
"/dev/shm/%s/cwb_config_1_%d.txt",uname.Data(),
rnID);
1263 sprintf(ofile2,
"/dev/shm/%s/cwb_config_2_%d.txt",uname.Data(),
rnID);
1265 config.
Print(ofile1);
1266 this->
Print(ofile2);
1270 gSystem->Exec(
TString(
"rm ")+ofile1);
1271 gSystem->Exec(
TString(
"rm ")+ofile2);
1283 gRandom->SetSeed(0);
1284 int rnID =
int(gRandom->Rndm(13)*1.e9);
1285 UserGroup_t*
uinfo = gSystem->GetUserInfo();
1287 gSystem->Exec(
TString(
"mkdir -p /dev/shm/")+uname);
1290 sprintf(fName,
"/dev/shm/%s/cwb_config_%d.C",uname.Data(),
rnID);
1296 if (getenv(
"CWB_CONFIG_VIEWER") != NULL) {
1297 sprintf(tmpStr,
"%s %s", getenv(
"CWB_CONFIG_VIEWER"), fName);
1298 ret = system(tmpStr);
1300 sprintf(tmpStr,
"vim %s", fName);
1305 sprintf(tmpStr,
"vim %s", fName);
1309 sprintf(tmpStr,
"rm -f %s", fName);
1324 if(
sizeof(filename)==0) {
1325 cout <<
"CWB::config::DumpConfig - Error : no input filename" << endl;
1341 cout <<
"------> Set Sigle Detector Mode !!!" << endl;
1385 cout <<
"CWB::config::SetSingleDetectorMode - Error : ifo[0] not defined !!! " << endl;
1399 {cout<<
"config::Check : analisys parameter non valid "<<analysis<<endl;
exit(1);}
1402 if(gSystem->Getenv(
"CWB_ANALYSIS")!=NULL) {
1403 if(
TString(analysis)!=
TString(gSystem->Getenv(
"CWB_ANALYSIS"))) {
1404 cout <<
"CWB::config::Check - Error : analysis=" << analysis;
1405 cout <<
" is inconsistent with the environment CWB_ANALYSIS="
1406 << gSystem->Getenv(
"CWB_ANALYSIS") << endl;
1407 cout <<
" check analysis parameter in user_parameters.C" << endl;
1408 cout <<
" check CWB_ANALYSIS env in watenv setup" << endl;
1409 cout <<
" use 'cwb_setpipe 1G/2G' command to switch analysis type" << endl;
1414 cout <<
"CWB_ANALYSIS env not defined in watenv setup" << endl;
1415 cout <<
"add in watenv setup the following statement" << endl;
1417 cout <<
"setenv CWB_ANALYSIS '1G' # 1G analysis " << endl;
1418 cout <<
"or" << endl;
1419 cout <<
"setenv CWB_ANALYSIS '2G' # 2G analysis " << endl;
1424 if(nIFO<=0 || nIFO>
XIFO) {
1425 cout<<
"config::Check : nIFO parameter non valid -> "<<
nIFO<<endl;
1426 cout<<
" WAT is compiled with XIFO = "<<XIFO<<endl<<endl;
1433 cout<<
"config::Check : Error - when nIFO=2 & ifo[0]=ifo[1] -> lagSize must be 1"<<endl;
1438 cout<<
"config::Check : Error - when nIFO=2 & ifo[0]=ifo[1] -> slagSize must be 0 or 1"<<endl;
1439 cout<<
" if slagSize=1 -> slagMin=slagMax=slagOff=0, slagFile=NULL "<<endl;
1450 if(detName1==detName2) {
1451 cout<<
"config::Check : Error - ifo["<<n<<
"]=ifo["<<m<<
"]"<<endl;
1452 cout<<
"config::Check : when nIFO>2 detector names must be different"<<endl;
1462 {cout<<
"config::Check : 1G search parameter non valid "<<
search<<endl;
exit(1);}
1465 char _search = std::tolower(
search);
1466 if((_search!=
'r')&&(_search!=
'i')&&(_search!=
'p')&&
1467 (_search!=
'l')&&(_search!=
's')&&(_search!=
'c')&&
1468 (_search!=
'g')&&(_search!=
'e')&&(_search!=
'b'))
1469 {cout<<
"config::Check : 2G search parameter non valid "<<
search<<endl;
exit(1);}
1471 {cout<<
"config::Check : 2G delta parameter non valid "<<
delta<<
" - must be [-1:1]"<<endl;
exit(1);}
1473 {cout<<
"config::Check : 2G gamma parameter non valid "<<gamma<<
" - must be [-1:1]"<<endl;
exit(1);}
1476 {cout<<
"config::Check : precision must be integer : "<<
precision<<endl;
exit(1);}
1479 {cout<<
"config::Check : precision is enabled only for healpix>0 : "<<
precision<<endl;
exit(1);}
1483 int csize = iprecision%65536;
1484 int order = (iprecision-csize)/65536;
1486 {cout<<
"config::Check : precision must be defined with csize>0 && order>0 : "<<csize<<
" " <<order<<endl;
exit(1);}
1488 {cout<<
"config::Check : precision must be defined with order<=healpix : "<<order<<endl;
exit(1);}
1494 if(!((x != 0) && ((x & (~x + 1)) == x)) ||
upTDF<=0)
1495 {cout<<
"config::Check : upTDF parameter non valid : must be power of 2 : "<<
upTDF<<endl;
exit(1);}
1499 if(!((x != 0) && ((x & (~x + 1)) == x)) || inRate<=0)
1500 {cout<<
"config::Check : inRate parameter non valid : must be power of 2 : "<<inRate<<endl;
exit(1);}
1503 {cout<<
"config::Check : levelR parameter non valid "<<
levelR<<endl;
exit(1);}
1506 {cout<<
"config::Check : levelF must be <= levelD "<<
levelF<<
" " <<
levelD<<endl;
exit(1);}
1509 {cout<<
"config::Check : l_low must be <= l_high "<<
l_low<<
" " <<
l_high<<endl;
exit(1);}
1512 {cout<<
"config::Check : l_low must be >0 "<<
l_low<<endl;
exit(1);}
1515 cout<<
"config::Check : number of resolutions must le NRES_MAX="<<
NRES_MAX<<endl;
1516 cout<<
" l_low : "<<
l_low <<endl;
1517 cout<<
" l_high : "<<
l_high<<endl;
1523 {cout<<
"config::Check : l_high must be <= levelD "<<
l_high<<
" " <<
levelD<<endl;
exit(1);}
1526 {cout<<
"config::Check : simulation parameter not valid [0:3] "<<
simulation<<endl;
exit(1);}
1529 {cout<<
"config::Check : simulation parameter not valid [0:4] "<<
simulation<<endl;
exit(1);}
1532 {cout<<
"config::Check : nfactor must be 1 when simulation=0 "<<endl;
exit(1);}
1535 {cout<<
"config::Check : lagSize must be 1 when simulation!=0 "<<endl;
exit(1);}
1538 {cout<<
"config::Check : segLen must be ge whiteWindow"<<endl;
exit(1);}
1541 {cout<<
"config::Check : dcPlugin ot outPlugin not enabled in 1G"<<endl;
exit(1);}
1544 if(fmod(
segLen,1)) {cout<<
"config::Check : segLen must be integer"<<endl;
exit(1);}
1545 if(fmod(
segMLS,1)) {cout<<
"config::Check : segMLS must be integer"<<endl;
exit(1);}
1546 if(fmod(
segTHR,1)) {cout<<
"config::Check : segTHR must be integer"<<endl;
exit(1);}
1547 if(fmod(
segEdge,1)) {cout<<
"config::Check : segEdge must be integer"<<endl;
exit(1);}
1548 if(fmod(segOverlap,1)) {cout<<
"config::Check : segOverlap must be integer"<<endl;
exit(1);}
1550 if(
segLen<=0) {cout<<
"config::Check : segLen must be >0"<<endl;
exit(1);}
1551 if(
segMLS<=0) {cout<<
"config::Check : segMLS must be >0"<<endl;
exit(1);}
1553 if(
segTHR<0) {cout<<
"config::Check : segTHR must be >=0"<<endl;
exit(1);}
1554 if(
segEdge<0) {cout<<
"config::Check : segEdge must be >=0"<<endl;
exit(1);}
1555 if(segOverlap<0) {cout<<
"config::Check : segOverlap must be >=0"<<endl;
exit(1);}
1557 if(
segMLS>
segLen) {cout<<
"config::Check : segMLS must be <= segLen"<<endl;
exit(1);}
1561 cout<<
"config::Check : when simulation=0 factors[0] lagStep must be >0"<<endl;
1565 cout<<
"config::Check : when simulation=0 lagMax must be <= segMLS/lagStep"<<endl;
1572 cout<<
"config::Check : nfactor must be > 0"<<endl;
1578 cout<<
"config::Check : factors["<<
i<<
"]="<<
factors[
i]<<endl;
1579 cout<<
"config::Check : factors must be > 0"<<endl;
1587 cout<<
"config::Check : jobfOptions=CWB_JOBF_SAVE_TRGFILE is not allowed in simulation mode!!!"<<endl;
1595 cout<<
"config::Check : when simulation=4 factors[0] is the offset and must be integer>0"<<endl;
1599 cout<<
"config::Check : when simulation=4 factors[0] is the offset and must be integer>=0"<<endl;
1610 cout<<
"config::Check : when simulation=4 only factors[0] must be declared"<<endl;
1611 cout<<
" factors are generated automatically by the pipeline"<<endl;
1613 cout<<
"factors[1]=offset;"<<endl;
1614 cout<<
"factors[2]=offset+1;"<<endl;
1616 cout<<
"factors[N]=offset+N-1;"<<endl;
1618 cout<<
"where offset=factors[0] which must be integer>0"<<endl;
1619 cout<<
"where N=nfactor"<<endl;
1620 cout<<
"if factors[0]==0 then factors[0] is set to 1"<<endl;
1629 cout<<
"config::Check : error : mdc_shift.stopMDC must be > =mdc_shift.startMDC"<<endl;
1637 CWB::config::Streamer(TBuffer &R__b) {
1645 if (R__b.IsReading()) {
1646 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
if (R__v) { }
1647 TNamed::Streamer(R__b);
1648 if(R__v > 1) R__b.ReadStaticArray((
char*)analysis);
1649 if(R__v > 3) R__b >>
online;
1652 if(R__v > 13) R__b >>
optim;
1653 R__b.ReadStaticArray((
char*)
ifo);
1654 R__b.ReadStaticArray((
char*)
refIFO);
1656 for (R__i = 0; R__i < 9; R__i++)
1659 if(R__v > 1) R__b >> inRate;
1663 if(R__v > 11) R__b >> TFgap;
1681 if(R__v > 12) R__b >> segOverlap;
1690 R__b.ReadStaticArray((
char*)
lagMode);
1695 R__b.ReadStaticArray((
double*)
shift);
1712 R__b.ReadStaticArray((
double*)
dcCal);
1716 R__b.ReadStaticArray((
double*)
factors);
1717 R__b.ReadStaticArray((
double*)
dataShift);
1719 if(R__v > 3) R__b.ReadStaticArray((
char*)
wdmXTalk);
1720 if(R__v > 3) R__b >>
upTDF;
1721 if(R__v > 4) R__b >>
TDSize;
1722 R__b.ReadStaticArray((
char*)
filter);
1723 if(R__v > 20) R__b >>
pattern;
1724 if(R__v > 4) R__b >>
BATCH;
1725 if(R__v > 4) R__b >>
LOUD;
1726 if(R__v > 4) R__b >> subnet;
1727 if(R__v > 18) R__b >> subcut;
1740 if((R__v < 7)||(R__v > 19)) R__b >>
precision;
1743 R__b >> *
reinterpret_cast<Int_t*
>(ptr_jobfOptions);
1747 R__b >> *
reinterpret_cast<Int_t*
>(ptr_outfOptions);
1750 if(R__v < 3) R__b >> bool_dummy;
1763 R__b.ReadStaticArray((
char*)
work_dir);
1771 R__b.ReadStaticArray((
char*)
log_dir);
1772 R__b.ReadStaticArray((
char*)
data_dir);
1773 R__b.ReadStaticArray((
char*)
tmp_dir);
1774 R__b.ReadStaticArray((
char*)
ced_dir);
1775 R__b.ReadStaticArray((
char*)
pp_dir);
1776 R__b.ReadStaticArray((
char*)
dump_dir);
1777 R__b.ReadStaticArray((
char*)
www_dir);
1780 if(R__v > 17) R__b.ReadStaticArray((
char*)condor_tag);
1781 R__b.ReadStaticArray((
char*)
frFiles);
1782 if(R__v > 3) R__b >> frRetryTime;
1785 for (R__i = 0; R__i <
DQF_MAX; R__i++) R__b.StreamObject(&(
DQF[R__i]),
typeid(
dqfile));
1787 for (R__i = 0; R__i < 20; R__i++) R__b.StreamObject(&(
DQF[R__i]),
typeid(
dqfile));
1789 R__b.ReadStaticArray((
char*)
nodedir);
1790 if(R__v > 22) R__b.ReadStaticArray((
char*)cwb_config_env);
1794 if(R__v > 21) R__b.ReadStaticArray((
char*)
parPlugin);
1801 if(R__v > 21) R__b.ReadStaticArray((
char*)
comment);
1802 R__b.CheckByteCount(R__s, R__c, thisClass::IsA());
1804 R__c = R__b.WriteVersion(thisClass::IsA(), kTRUE);
1805 TNamed::Streamer(R__b);
1806 R__b.WriteArray(analysis, 8);
1811 R__b.WriteArray((
char*)
ifo, 72);
1812 R__b.WriteArray(
refIFO, 4);
1814 for (R__i = 0; R__i < 9; R__i++)
1849 R__b.WriteArray(
shift, 9);
1862 R__b.WriteArray(
dcCal, 9);
1872 R__b.WriteArray(
filter, 1024);
1913 R__b.WriteArray(
log_dir, 1024);
1915 R__b.WriteArray(
tmp_dir, 1024);
1916 R__b.WriteArray(
ced_dir, 1024);
1917 R__b.WriteArray(
pp_dir, 1024);
1919 R__b.WriteArray(
www_dir, 1024);
1922 R__b.WriteArray(condor_tag, 1024);
1924 R__b << frRetryTime;
1926 for (R__i = 0; R__i <
DQF_MAX; R__i++)
1927 R__b.StreamObject(&(
DQF[R__i]),
typeid(
dqfile));
1929 R__b.WriteArray(
nodedir, 1024);
1930 R__b.WriteArray(cwb_config_env, 1024);
1941 R__b.WriteArray(
comment, 1024);
1942 R__b.SetByteCount(R__c, kTRUE);
char site_cluster_env[1024]
void Export(TString fname="")
void Print(Option_t *option="")
fprintf(stdout,"start=%f duration=%f rate=%f\n", x.start(), x.size()/x.rate(), x.rate())
char channelNamesMDC[NIFO_MAX][50]
cout<< cfg-> nodedir<< endl;cfg-> Import("../../../cwb/macros/cwb_inet.C")
CWB_OUTF_OPTIONS outfOptions
char channelNamesRaw[NIFO_MAX][50]
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<< "\t layers : "<< nLAYERS<< "\t dF(hz) : "<< dF<< "\t 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
char frFiles[NIFO_MAX+1][256]
CWB_JOBF_OPTIONS jobfOptions
void Import(TString umacro="")
#define SETVAR(MODE, VAR, TYPE, SIZE1, SIZE2)
void DumpPlugin(const char *filename="")
int Compare(CWB::config config)
double dataShift[NIFO_MAX]
#define EXPORT(TYPE, VAR, CMD)
double fabs(const Complex &x)
void DumpConfig(const char *filename="", Option_t *option="")
void DumpConfigPlugin(const char *filename="")
strcpy(RunLabel, RUN_LABEL)
virtual void Browse(TBrowser *b)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
detectorParams detParms[4]
void SetSingleDetectorMode()