Line data Source code
1 : #ifndef ALIGENEXTEXEC_H
2 : #define ALIGENEXTEXEC_H
3 :
4 : /* Copyright(c) 1998-2015, ALICE Experiment at CERN, All rights reserved. *
5 : * See cxx source for full Copyright notice */
6 :
7 : // Event generator that can runs an external executable
8 : // to produce events which are read as HepMC.
9 : //
10 : // Author: Jochen Klein <Jochen.Klein@cern.ch>
11 :
12 : #include "AliGenExtFile.h"
13 :
14 : class AliGenReader;
15 : class TTree;
16 :
17 : class AliGenExtExec : public AliGenExtFile
18 : {
19 : public:
20 : AliGenExtExec(const TString &scriptpath = "./gen.sh");
21 : AliGenExtExec(Int_t npart, const TString &scriptpath = "./gen.sh");
22 :
23 : virtual ~AliGenExtExec();
24 :
25 : enum GenExtMode_t {
26 : kFIFO = 0,
27 : kAlternatingFiles
28 : };
29 :
30 : enum GenExtInput_t {
31 : kHepMC = 0,
32 : kEPOSroot
33 : };
34 :
35 : virtual void SetPathScript(const TString &path = "./gen.sh");
36 : virtual void SetPathFIFO(const TString &path = "gen.hepmc");
37 : virtual void SetPathFile1(const TString &path = "gen1.root");
38 : virtual void SetPathFile2(const TString &path = "gen2.root");
39 0 : virtual void SetMode(GenExtMode_t mode) { fMode = mode; }
40 0 : virtual void SetInput(GenExtInput_t input) { fInput = input; }
41 :
42 : virtual void Init();
43 : virtual void Generate();
44 :
45 : protected:
46 : Bool_t StartGen();
47 : Bool_t StopGen();
48 :
49 : // configuration settings
50 : TString fPathScript; // path to executable script
51 : TString fPathFIFO; // path used for FIFO
52 : TString fPathFile1; // path used for file 1
53 : TString fPathFile2; // path used for file 2
54 : Int_t fEventNumberInFileMax; // max number of events in file
55 : GenExtMode_t fMode; // mode for external generator
56 : GenExtInput_t fInput; // input type to choose reader
57 :
58 : // transient variables
59 : Int_t fPID; //! PID of running generator
60 : Int_t fFileConnected; //! which file is connected (for alternating files)
61 : Int_t fEventNumberInFile; //! event number in file
62 :
63 : private:
64 : AliGenExtExec(const AliGenExtExec &ext); // not implemented
65 : AliGenExtExec & operator=(const AliGenExtExec & rhs); // not implemented
66 :
67 6 : ClassDef(AliGenExtExec, 2)
68 : };
69 :
70 : #endif
|