// Author: Ingo Froehlich
// Written: 14/05/2007
// Modified: 
// PFileOutput Class Header

#ifndef _PFILEOUTPUT_H_
#define _PFILEOUTPUT_H_

#include "PParticle.h"
#include "PBulkInterface.h"
#include "PChannel.h"

class PFileOutput: public PBulkInterface {

 private:

 protected:

     Int_t cnt;              //! number of total particles in event
     Int_t subcnt;           //! number of particles in branch
     Int_t getVERTEX;        //! transport getVERTEX switch from PReaction
     Int_t writeINDEX;       //! transport writeINDEX switch from PReaction
     Int_t allPARTICLES;     //! transport allPARTICLES switch from PReaction
     Int_t asciiOUTPUT;      //! transport asciiOUTPUT switch from PReaction
     PChannel **channel;     //! transport channel array from PReaction
     Int_t      nChannel;    //! transport number of channels in array

     Int_t branchNum;        //! Branch number, 0:std branch, >0:additional branches
     const char *branchName; //! Branch name

     const char *filename;

  public:
    PFileOutput();

    void SetHeader(Int_t _cnt, 
		   Int_t _allPARTICLES,
		   Int_t _getVERTEX,
		   Int_t _asciiOUTPUT,
		   Int_t _writeINDEX,
		   PChannel **_channel,
                   Int_t _nCahnnel
		  ) {
	//number of expected WriteParticles:
	cnt          = _cnt;
	//PReaction flags:
	allPARTICLES = _allPARTICLES;
	getVERTEX    = _getVERTEX;
	asciiOUTPUT  = _asciiOUTPUT;
	writeINDEX   = _writeINDEX;
	channel      = _channel;
        nChannel     = _nCahnnel;
    };

    void SetBranchHeader(Int_t _subcnt, Int_t _branchNum, const char *_branchName) {
	subcnt     = _subcnt;
	branchNum  = _branchNum;
	branchName = _branchName;
    };

    virtual bool OpenFile(const char *_filename);      //filename
    virtual bool CloseFile(void);                //
    virtual bool WriteEvent(void);               //next event
    virtual bool WriteEventHeader(void);
    virtual bool WriteBranchHeader(void);
    virtual bool WriteParticle(PParticle *par);  //write single particle

    const char  *GetFilename() {
	return filename;
    };

    ClassDef(PFileOutput, 0) // Pluto file output base class
};
#endif 

















 PFileOutput.h:1
 PFileOutput.h:2
 PFileOutput.h:3
 PFileOutput.h:4
 PFileOutput.h:5
 PFileOutput.h:6
 PFileOutput.h:7
 PFileOutput.h:8
 PFileOutput.h:9
 PFileOutput.h:10
 PFileOutput.h:11
 PFileOutput.h:12
 PFileOutput.h:13
 PFileOutput.h:14
 PFileOutput.h:15
 PFileOutput.h:16
 PFileOutput.h:17
 PFileOutput.h:18
 PFileOutput.h:19
 PFileOutput.h:20
 PFileOutput.h:21
 PFileOutput.h:22
 PFileOutput.h:23
 PFileOutput.h:24
 PFileOutput.h:25
 PFileOutput.h:26
 PFileOutput.h:27
 PFileOutput.h:28
 PFileOutput.h:29
 PFileOutput.h:30
 PFileOutput.h:31
 PFileOutput.h:32
 PFileOutput.h:33
 PFileOutput.h:34
 PFileOutput.h:35
 PFileOutput.h:36
 PFileOutput.h:37
 PFileOutput.h:38
 PFileOutput.h:39
 PFileOutput.h:40
 PFileOutput.h:41
 PFileOutput.h:42
 PFileOutput.h:43
 PFileOutput.h:44
 PFileOutput.h:45
 PFileOutput.h:46
 PFileOutput.h:47
 PFileOutput.h:48
 PFileOutput.h:49
 PFileOutput.h:50
 PFileOutput.h:51
 PFileOutput.h:52
 PFileOutput.h:53
 PFileOutput.h:54
 PFileOutput.h:55
 PFileOutput.h:56
 PFileOutput.h:57
 PFileOutput.h:58
 PFileOutput.h:59
 PFileOutput.h:60
 PFileOutput.h:61
 PFileOutput.h:62
 PFileOutput.h:63
 PFileOutput.h:64
 PFileOutput.h:65
 PFileOutput.h:66
 PFileOutput.h:67
 PFileOutput.h:68
 PFileOutput.h:69
 PFileOutput.h:70
 PFileOutput.h:71
 PFileOutput.h:72
 PFileOutput.h:73
 PFileOutput.h:74
 PFileOutput.h:75
 PFileOutput.h:76
 PFileOutput.h:77
 PFileOutput.h:78
 PFileOutput.h:79
 PFileOutput.h:80
 PFileOutput.h:81
 PFileOutput.h:82
 PFileOutput.h:83
 PFileOutput.h:84
 PFileOutput.h:85
 PFileOutput.h:86
 PFileOutput.h:87
 PFileOutput.h:88
 PFileOutput.h:89
 PFileOutput.h:90
 PFileOutput.h:91