26 TB.
checkFile(gSystem->Getenv(
"CWB_ROOTLOGON_FILE"));
27 TB.
checkFile(gSystem->Getenv(
"CWB_PARAMETERS_FILE"));
28 TB.
checkFile(gSystem->Getenv(
"CWB_NETC_FILE"));
34 char env_label[32];
sprintf(env_label,
"CWB_MPLUGIN_%d",
i+1);
35 cwb_mplugin[
i]=
TString(gSystem->Getenv(env_label));
37 if(cwb_mplugin[
i].CompareTo(
"")!=0) {
38 TString DirName = gSystem->DirName(cwb_mplugin[0]);
39 TString BaseName = gSystem->BaseName(cwb_mplugin[0]);
42 if(!overwrite) gSystem->Exit(1);
44 cout <<
"cwb_mplugin.C error : output file name not declared !!!" << endl;
48 if(cwb_mplugin[
i].CompareTo(
"")!=0) {
50 cwb_mplugin_macro[
i] = TMacro(cwb_mplugin[i]);
56 cout <<
"Output Plugin Name : " << endl << endl;
57 cout << 0 <<
" -> : " << cwb_mplugin[0] << endl;
58 cout << endl <<
"Input Plugin Names : " << endl << endl;
60 if(cwb_mplugin[
i].CompareTo(
"")!=0) {
61 cout <<
i <<
" -> " << cwb_mplugin[
i] << endl;
68 cout <<
"Do you want to continue it ? (y/n) ";
71 }
while ((strcmp(answer,
"y")!=0)&&(strcmp(answer,
"n")!=0));
72 if (strcmp(answer,
"n")==0) gSystem->Exit(0);
77 out.open(cwb_mplugin[0].Data(),
ios::out);
78 if(!out.good()) {cout <<
"cwb_mplugin.C - Error : Opening File : " 79 << cwb_mplugin[0] << endl;gSystem->Exit(1);}
82 out <<
"// -------------------------------------------------------------------------" << endl;
83 out <<
"// WARNING, NOT EDIT : This is a multi plugin generated with cwb_mplugin !!!" << endl;
84 out <<
"// NOTE : The main is listed on the bottom " << endl;
86 out <<
"// INPUT PLUGINS : " << endl;
89 if(cwb_mplugin[
i].CompareTo(
"")!=0) {
90 out <<
"// " <<
i <<
" - " << gSystem->BaseName(cwb_mplugin[
i]) << endl;
94 out <<
"// -------------------------------------------------------------------------" << endl;
98 if(cwb_mplugin[
i].CompareTo(
"")!=0) {
100 char user_plugin_name[32];
sprintf(user_plugin_name,
"CWB_UserPlugin_%d(",
i);
101 char user_plugin_namespace[32];
sprintf(user_plugin_namespace,
"CWB_UserPluginNamespace_%d",
i);
102 TList* fLines = cwb_mplugin_macro[
i].GetListOfLines();
106 out <<
"// -------------------------------------------------------------------------" << endl;
107 out <<
"// --> BEGIN CWB_USER PLUGIN CODE " <<
i << endl;
108 out <<
"// " << endl;
109 out <<
"// " << gSystem->BaseName(cwb_mplugin[
i]) << endl;
110 out <<
"// -------------------------------------------------------------------------" << endl;
112 while ((obj = (TObjString*)
next())) {
115 sline.ReplaceAll(
" ",
"");
116 if(sline.BeginsWith(
"#include")||sline.BeginsWith(
"#define")||sline.BeginsWith(
"#pragma")) {
117 if(!include) out <<
"}" << endl;
121 if(include) out <<
"namespace " << user_plugin_namespace <<
" {" << endl << endl;
125 out << line.Data() << endl;
127 out <<
"}" << endl << endl;
128 out <<
"// -------------------------------------------------------------------------" << endl;
129 out <<
"// --> END CWB_USER PLUGIN CODE " << i << endl;
130 out <<
"// " << endl;
131 out <<
"// " << gSystem->BaseName(cwb_mplugin[i]) << endl;
132 out <<
"// -------------------------------------------------------------------------" << endl;
138 out <<
"// -------------------------------------------------------------------------" << endl;
139 out <<
"// --> MAIN CWB_USER PLUGIN CODE " << endl;
140 out <<
"// " << endl;
141 out <<
"// INPUT PLUGINS : " << endl;
142 out <<
"// " << endl;
144 if(cwb_mplugin[
i].CompareTo(
"")!=0) {
145 out <<
"// " <<
i <<
" - " << gSystem->BaseName(cwb_mplugin[
i]) << endl;
148 out <<
"// " << endl;
149 out <<
"// -------------------------------------------------------------------------" << endl;
151 out <<
"#define XIFO 4" << endl;
152 out <<
"#pragma GCC system_header" << endl;
153 out <<
"#include \"cwb.hh\"" << endl;
157 out <<
"void" << endl;
158 out <<
"CWB_Plugin(TFile* jfile, CWB::config* cfg, network* net, WSeries<double>* x, TString ifo, int type) {" << endl;
161 if(cwb_mplugin[
i].CompareTo(
"")!=0) {
162 char user_plugin_namespace[32];
sprintf(user_plugin_namespace,
"CWB_UserPluginNamespace_%d",
i);
163 out <<
" " << user_plugin_namespace;
164 out <<
"::CWB_Plugin(jfile, cfg, net, x, ifo, type); // CALL USER PLUGIN CODE " <<
i << endl;
171 cout <<
"Output Plugin Name : " << cwb_mplugin[0] << endl << endl;
TString cwb_mplugin[nPLUGIN]
TIter next(twave->GetListOfBranches())
TMacro cwb_mplugin_macro[nPLUGIN]
strcpy(RunLabel, RUN_LABEL)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)