//
//
// Logs:
//
//  $Log: LContainer.h,v $
//  Revision 1.6  2004/04/09 13:21:05  cvs
//  added cputime logging...
//
//  Revision 1.5  2003/09/25 10:57:40  cvs
//  added force member to LDataHeader class
//
//  Revision 1.4  2003/07/09 10:53:13  cvs
//  added some verbosity and changed LContainer class. The LData isnt changed. Corrected daemon mode of hoppserv, since network connection is dependend on process pid. So the connection should be opened by child processes.
//
//  Revision 1.3  2003/07/01 12:17:18  cvs
//  New LData organization. data is stored in TH2F histograms. This enables easier manipulation. Found a bug in drawing averaged velocity vs time. The average number was calcuated over whole times.
//
//  Revision 1.2  2003/06/26 09:27:11  cvs
//  added log fields...
//
#ifndef _LCONTAINER__
#define _LCONTAINER__

#include "Config.h"
#include "Util.h"
#include "LDataHeader.h"

class LContainer: public TObject {
 protected:
  Long_t fjobID;      //identification of job
  Int_t fmax;         //max number of bins
  Int_t fN;           //number of tracks
  Float_t** fp;       //pointers to position tracks
  Float_t** fe;       //pointer to energy tracks
  Float_t*  fttime;   //pointer to ttime 
  Int_t*  ftrackn;    //pointer to ttime 
  Double_t* fcpu_time;//pointer to cputime
  TString* flog;      //log field 

 private:
  Int_t cur;          //! current empty track index(where to store)

 public:
  LContainer();
  LContainer(const Long_t jobID,const Int_t bins,const Int_t ntracks);
  LContainer(const LDataHeader* header);
  virtual ~LContainer();

  Int_t Add(const Int_t n,const Float_t* track,const Float_t* tracke,const Float_t ttime,Double_t cputime);

  LContainer* Prepare();
  virtual void Print(Option_t* option)const;
  Int_t GetN() const {return fN;}
  Float_t* GetPositionTrack(Int_t i) const {return fp[i];};
  Float_t* GetEnergyTrack(Int_t i) const {return fe[i];};
  Float_t GetTTime(Int_t i) const {return fttime[i];};
  Double_t GetCPUtime(Int_t i) const {return fcpu_time[i];};
  Int_t GetTrackN(Int_t i) const {return ftrackn[i];};
  void SetJobID(const Long_t id){fjobID=id;}
  Long_t GetJobID() const {return fjobID;}
  Int_t GetCurrent() const {return cur;}

  void SetLog(const char* bla);
  const char* GetLog();

  ClassDef(LContainer,3)  //Container class for transfering multiple tracks 
};

#endif //_LDATA_HEADER__




