Public Member Functions | |
AsciiNTuple (G4String category, G4String name, G4String fields, G4String filename) | |
~AsciiNTuple () | |
virtual void | appendRow (float data[], int n) |
virtual bool | readRow (float data[], int ndata) |
virtual int | getNData () |
virtual G4String | getFieldNames () |
virtual void | annotate (G4String line) |
void | flush () |
void | close () |
void | doSummary () |
Private Attributes | |
FILE * | fd |
G4String | title |
int | entries |
int | nfields |
G4String | fields |
AsciiNTuple::AsciiNTuple | ( | G4String | category, | |
G4String | name, | |||
G4String | fields, | |||
G4String | filename | |||
) |
References entries, fd, nfields, and title.
00464 { 00465 if(filename == "") filename = name+".txt"; 00466 if(filename.find(".txt") == filename.npos) 00467 filename += ".txt"; 00468 fd = fopen(filename.c_str(),"w"); 00469 title = name; 00470 entries = 0; 00471 fields = _fields; 00472 00473 fprintf(fd,"# %s\n",name.c_str()); 00474 G4String s(fields); 00475 nfields = 1; 00476 for(;;) { 00477 unsigned p = s.find(":"); 00478 if(p == s.npos) break; 00479 s.replace(p,1," "); 00480 ++nfields; 00481 } 00482 fprintf(fd,"#%s\n",s.c_str()); 00483 }
AsciiNTuple::~AsciiNTuple | ( | ) | [inline] |
void AsciiNTuple::appendRow | ( | float | data[], | |
int | n | |||
) | [virtual] |
virtual bool AsciiNTuple::readRow | ( | float | data[], | |
int | ndata | |||
) | [inline, virtual] |
virtual int AsciiNTuple::getNData | ( | ) | [inline, virtual] |
virtual G4String AsciiNTuple::getFieldNames | ( | ) | [inline, virtual] |
virtual void AsciiNTuple::annotate | ( | G4String | line | ) | [inline, virtual] |
void AsciiNTuple::close | ( | ) | [inline, virtual] |
void AsciiNTuple::doSummary | ( | ) | [inline, virtual] |
FILE* AsciiNTuple::fd [private] |
Referenced by appendRow(), and AsciiNTuple().
G4String AsciiNTuple::title [private] |
Referenced by AsciiNTuple().
int AsciiNTuple::entries [private] |
Referenced by appendRow(), and AsciiNTuple().
int AsciiNTuple::nfields [private] |
Referenced by AsciiNTuple().
G4String AsciiNTuple::fields [private] |