ROOT logo
// $Id: AEVEventBatch.h 2088 2008-11-23 20:26:46Z matevz $

// Copyright (C) 1999-2008, Matevz Tadel. All rights reserved.
// This file is part of GLED, released under GNU General Public License version 2.
// For the licensing terms see $GLEDSYS/LICENSE or http://www.gnu.org/.

#ifndef AliEnViz_AEVEventBatch_H
#define AliEnViz_AEVEventBatch_H

#include <Glasses/ZNode.h>
#include <Stones/SEvTaskState.h>
#include <Stones/ZColor.h>

#include <TRandom.h>

class AEVEventBatch : public ZNode {
  MAC_RNR_FRIENDS(AEVEventBatch);
  friend class AEVDistAnRep;

public:
  enum RnrMode_e { RM_Combined, RM_Bar };

private:
  void _init();

protected:
  Int_t		mNWorkers;	// X{GS}  7 ValOut(-width=>4)
  Double_t	mDataSizeMB;	// X{GS}  7 ValOut(-width=>8, -join=>1)
  Double_t	mDataDoneMB;	// X{GS}  7 ValOut(-width=>8)

  SEvTaskState	mEvState;	// X{GSR} 7 StoneOutput(Fmt=>"%c: %d [ %d | %d | %d ]", Args=>[State, NAll, NOK, NFail, NProc])

  Float_t	mTPerEvAvg;	// X{GS}  7 Value(-range=>[0,1e6,1,1000], join=>1);
  Float_t	mTPerEvSgm;	// X{GS}  7 Value(-range=>[0,1e3,1,1000]);

  Float_t	mFracFail;	// X{GS}  7 Value(-range=>[0,1,1,1000]);

  Int_t		mSimEvs;	// X{GS}  7 Value(-range=>[0,1e3,1,1], -join=>1);
  Int_t		mProcAvg;	// X{GS}  7 Value(-range=>[0,1e3,1,1]);

  RnrMode_e	mRnrMode;	// X{GS}  7 PhonyEnum()

  Float_t	mHDepth;	// X{GS}  7 Value(-range=>[0,10,1,100]);
  ZColor	mColAll;	// X{GSP} 7 ColorButt(-join=>1)
  ZColor	mColOK;		// X{GSP} 7 ColorButt()
  ZColor	mColFail;	// X{GSP} 7 ColorButt(-join=>1)
  ZColor	mColProc;	// X{GSP} 7 ColorButt()

  TRandom	mRnd;

public:
  AEVEventBatch(const Text_t* n="AEVEventBatch", const Text_t* t=0) :
    ZNode(n,t) { _init(); }

  virtual void AdEnlightenment();

  void Reinit();
  void Reinit(Int_t n_events);

  void FakeInit(); // X{E} 7 MButt(-join=>1)
  void FakeProc(); // X{E} 7 MButt()

  Bool_t IsDone() {
    return mEvState.GetNProc() == 0 && mEvState.GetNToDo() == 0;
  }

  void IncProcessing(Int_t delta=1) {
    if(mEvState.GetState() == 'W') mEvState.SetState('R');
    mEvState.IncNProc(delta);
    Stamp(FID());
  }
  void DecProcessing(Int_t delta=-1) {
    mEvState.IncNProc(delta);
    Stamp(FID());
  }

  void Finalize() {
    if(mEvState.GetState() != 'F') {
      mEvState.SetNProc(0);
      mEvState.IncNFail(mEvState.GetNLeft());
      mEvState.SetState('F');
    }
    Stamp(FID());
  }

#include "AEVEventBatch.h7"
  ClassDef(AEVEventBatch, 1);
}; // endclass AEVEventBatch


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