Public Member Functions | |
TrackFileNTuple (G4String category, G4String name, G4String fields, G4String filename) | |
~TrackFileNTuple () | |
virtual void | appendRow (float data[], int n) |
virtual bool | readRow (float data[], int ndata) |
virtual int | getNData () |
void | flush () |
void | close () |
void | doSummary () |
Private Attributes | |
BLTrackFile * | tf |
G4String | title |
int | entries |
Static Private Attributes | |
static std::vector < TrackFileNTuple * > | list |
TrackFileNTuple::TrackFileNTuple | ( | G4String | category, | |
G4String | name, | |||
G4String | fields, | |||
G4String | filename | |||
) |
References entries, list, tf, and title.
00299 { 00300 if(filename == "") filename = name+".txt"; 00301 if(filename.find(".txt") == filename.npos) 00302 filename += ".txt"; 00303 tf = new BLTrackFile(filename,category+"/"+name,"w"); 00304 title = name; 00305 entries = 0; 00306 list.push_back(this); 00307 }
TrackFileNTuple::~TrackFileNTuple | ( | ) | [inline] |
void TrackFileNTuple::appendRow | ( | float | data[], | |
int | n | |||
) | [virtual] |
Implements BLNTuple.
References entries, tf, and BLTrackFile::write().
00310 { 00311 assert(n == NTrackFileFields); 00312 00313 G4ThreeVector pos(data[0]*mm,data[1]*mm,data[2]*mm); 00314 G4ThreeVector momentum(data[3]*MeV,data[4]*MeV,data[5]*MeV); 00315 G4double time = data[6]*ns; 00316 int PDGid = (int)data[7]; 00317 int eventID = (int)data[8]; 00318 int trackID = (int)data[9]; 00319 int parentID = (int)data[10]; 00320 double weight = data[11]; 00321 tf->write(pos,time,momentum,PDGid,eventID,trackID,parentID,weight); 00322 00323 ++entries; 00324 }
virtual bool TrackFileNTuple::readRow | ( | float | data[], | |
int | ndata | |||
) | [inline, virtual] |
virtual int TrackFileNTuple::getNData | ( | ) | [inline, virtual] |
void TrackFileNTuple::flush | ( | ) | [inline, virtual] |
void TrackFileNTuple::close | ( | ) | [inline, virtual] |
void TrackFileNTuple::doSummary | ( | ) | [inline, virtual] |
BLTrackFile* TrackFileNTuple::tf [private] |
Referenced by appendRow(), and TrackFileNTuple().
G4String TrackFileNTuple::title [private] |
Referenced by TrackFileNTuple().
int TrackFileNTuple::entries [private] |
Referenced by appendRow(), and TrackFileNTuple().
std::vector< TrackFileNTuple * > TrackFileNTuple::list [static, private] |