48 if (!
file) {
file=
new std::fstream(); }
49 else { (
file->clear()); }
53 if (strcmp(status,
"in")==0) {
57 if (strcmp(status,
"out")==0) {
66 Error(
"open",
"Output file %s exists already and will not be recreated.",
70 }
else { Error(
"open",
"Invalid file option!"); }
72 if (
file->rdbuf()->is_open()==0) {
73 Fatal(
"open",
"Failed to open file %s",
filename.Data());
82 if (
file &&
file->rdbuf()->is_open()==1) {
return kTRUE; }
107 else { cout<<
"Open input file: "<<
filename<<endl; }
108 }
else { cout<<
"No file open."<<endl; }
123 set->read(*
file,media);
148 TString simRefRun,historyDate;
150 while(!(*file).eof()) {
152 buf=buf.Strip(buf.kBoth);
153 if (!buf.IsNull() && buf(0,2)!=
"//" && buf(0,1)!=
"*") {
154 if (buf.Contains(
".geo")||buf.Contains(
"_gdb")) {
157 if (buf.Contains(
".setup")) {
160 if (buf.Contains(
"SimulRefRunDb:")) {
162 if (k) { simRefRun=buf(k,buf.Length()-
k); }
164 if (buf.Contains(
"HistoryDateDb:")) {
166 if (buf.Length()>
k) {
167 historyDate=buf(k,buf.Length()-
k);
168 historyDate=historyDate.Strip(historyDate.kBoth);
179 if (historyDate.Length()>0) { rc=oraIo->
setHistoryDate(historyDate.Data()); }
180 if (rc&&simRefRun.Length()>0) { rc=oraIo->
setSimulRefRun(simRefRun.Data()); }
189 const Int_t maxbuf=256;
193 Int_t maxModules=0, secNo=-1;
196 while(!(*file).eof()) {
197 (*file).getline(buf,maxbuf);
198 if (strlen(buf)>=3 && buf[1]!=
'/') {
206 Ssiz_t
n=s.First(
']');
211 Error(
"readDetectorSetup",
"Detector %s not found",det.Data());
212 if (mod) {
delete [] mod; }
216 mod=
new Int_t[maxModules];
219 char* ss=strtok(buf,d);
220 if (ss&&strlen(ss)>3) {
221 secNo=(Int_t)(ss[3]-
'0')-1;
222 for(Int_t i=0; i<maxModules&&mod; i++) {
224 if (ss) { sscanf(ss,
"%i",&mod[i]); }
226 set->setModules(secNo,mod);
229 if (mod) {
delete [] mod; }
235 if (mod) {
delete [] mod; }