FOR009NTuple Class Reference

Inheritance diagram for FOR009NTuple:

BLNTuple

List of all members.

Public Member Functions

 FOR009NTuple (G4String category, G4String name, G4String fields, G4String filename)
 ~FOR009NTuple ()
virtual void appendRow (float data[], int n)
virtual bool readRow (float data[], int ndata)
virtual int getNData ()
virtual bool needsReference ()
void flush ()
void close ()
void doSummary ()

Private Attributes

G4String title
int entries

Static Private Attributes

static BLFOR009for009file = 0
static std::vector
< FOR009NTuple * > 
for009list


Constructor & Destructor Documentation

FOR009NTuple::FOR009NTuple ( G4String  category,
G4String  name,
G4String  fields,
G4String  filename 
)

References entries, for009file, for009list, and title.

00377 {
00378         if(for009file == 0) {
00379                 if(filename == "") filename = name+".txt";
00380                 if(filename.find(".txt") == filename.npos)
00381                         filename += ".txt";
00382                 for009file = new BLFOR009(filename,category+"/"+name,"w");
00383         }
00384         title = name;
00385         entries = 0;
00386         for009list.push_back(this);
00387 }

FOR009NTuple::~FOR009NTuple (  )  [inline]

00343 { }


Member Function Documentation

void FOR009NTuple::appendRow ( float  data[],
int  n 
) [virtual]

Implements BLNTuple.

References entries, for009file, and BLFOR009::write().

00390 {
00391         assert(n == NTraceFileFields);
00392 
00393         G4ThreeVector pos(data[0]*mm,data[1]*mm,data[2]*mm);
00394         G4ThreeVector momentum(data[3]*MeV,data[4]*MeV,data[5]*MeV);
00395         G4ThreeVector Bfield(data[12]*tesla,data[13]*tesla,data[14]*tesla);
00396         G4ThreeVector Efield(data[15]*(megavolt/meter),
00397                         data[16]*(megavolt/meter),data[17]*(megavolt/meter));
00398         G4double time = data[6]*ns;
00399         int PDGid = (int)data[7];
00400         int eventID = (int)data[8];
00401         int trackID = (int)data[9];
00402         int parentID = (int)data[10];
00403         double weight = data[11];
00404         for009file->write(pos,time,momentum,Bfield,Efield,PDGid,eventID,trackID,
00405                                                         parentID,weight);
00406 
00407         ++entries;
00408 }

virtual bool FOR009NTuple::readRow ( float  data[],
int  ndata 
) [inline, virtual]

Implements BLNTuple.

00345 { return false; }

virtual int FOR009NTuple::getNData (  )  [inline, virtual]

Implements BLNTuple.

00346 { return NTraceFileFields; }

virtual bool FOR009NTuple::needsReference (  )  [inline, virtual]

Reimplemented from BLNTuple.

00347 { return true; }

void FOR009NTuple::flush (  )  [inline, virtual]

Implements BLNTuple.

00348 { }

void FOR009NTuple::close (  )  [virtual]

Implements BLNTuple.

References BLFOR009::close(), and for009file.

Referenced by AsciiNTuple::~AsciiNTuple().

00411 {
00412         if(for009file) for009file->close();
00413         for009file = 0;
00414 }

void FOR009NTuple::doSummary (  )  [inline, virtual]

Implements BLNTuple.

00350 { /* close provides summary per region */ }


Member Data Documentation

G4String FOR009NTuple::title [private]

int FOR009NTuple::entries [private]

BLFOR009 * FOR009NTuple::for009file = 0 [static, private]

Referenced by appendRow(), close(), and FOR009NTuple().

std::vector< FOR009NTuple * > FOR009NTuple::for009list [static, private]

Referenced by FOR009NTuple().


The documentation for this class was generated from the following file:
g4beamline