FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairRunOnline.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 #ifndef FAIRRUNONLINE_H
9 #define FAIRRUNONLINE_H
10 
18 #include "FairRootManager.h"
19 #include "FairRun.h"
20 
21 #include <Rtypes.h>
22 #include <TString.h>
23 
24 class FairField;
25 class FairSource;
26 class THttpServer;
27 class TObject;
28 
29 class FairRunOnline : public FairRun
30 {
31  public:
32  static FairRunOnline* Instance();
33  virtual ~FairRunOnline();
34  FairRunOnline();
35  FairRunOnline(FairSource* source);
36 
38  void Init();
40  void Run(Int_t Ev_start, Int_t Ev_end);
41 
42  void Reinit(UInt_t runId);
43  UInt_t getRunId() { return fRunId; }
45  FairField* GetField() { return fField; }
47  void SetField(FairField* ffield) { fField = ffield; }
48 
52  void SetAutoFinish(Bool_t val) { fAutomaticFinish = val; }
54  void SetSource(FairSource* source) { fRootManager->SetSource(source); }
57 
63  void InitContainers();
64  void SetContainerStatic(Bool_t tempBool = kTRUE);
65  Bool_t GetContainerStatic() { return fStatic; };
66 
68  void AddObject(TObject* object);
69 
74  void ActivateHttpServer(Int_t refreshRate = 10000, Int_t httpPort = 8080);
75 
80  void RegisterHttpCommand(TString name, TString command);
81 
83  THttpServer* GetHttpServer() { return fServer; }
84 
86  void Finish();
87 
88  private:
89  Bool_t fAutomaticFinish;
90 
91  FairRunOnline(const FairRunOnline& M);
92  FairRunOnline& operator=(const FairRunOnline&) { return *this; }
93 
95  Int_t EventLoop();
96 
97  protected:
102  Bool_t fStatic;
104 
105  Int_t fNevents;
106  THttpServer* fServer;
108 
109  virtual void Fill();
110 
112 };
113 
114 #endif // FAIRRUNONLINE_H
void ActivateHttpServer(Int_t refreshRate=10000, Int_t httpPort=8080)
THttpServer * GetHttpServer()
Definition: FairRunOnline.h:83
Int_t fServerRefreshRate
FairSource * GetSource()
Definition: FairRunOnline.h:56
FairRootManager * fRootManager
Definition: FairRun.h:193
UInt_t getRunId()
Definition: FairRunOnline.h:43
void SetContainerStatic(Bool_t tempBool=kTRUE)
void SetAutoFinish(Bool_t val)
Definition: FairRunOnline.h:52
void AddObject(TObject *object)
void Reinit(UInt_t runId)
FairSource * GetSource()
FairField * fField
virtual void Fill()
Bool_t fIsInitialized
Definition: FairRunOnline.h:99
void SetSource(FairSource *source)
Definition: FairRunOnline.h:54
THttpServer * fServer
ClassDef(FairRunOnline, 0)
void Run(Int_t Ev_start, Int_t Ev_end)
FairField * GetField()
Definition: FairRunOnline.h:45
Bool_t GetContainerStatic()
Definition: FairRunOnline.h:65
static FairRunOnline * fgRinstance
void RegisterHttpCommand(TString name, TString command)
void SetSource(FairSource *tempSource)
static FairRunOnline * Instance()
UInt_t fRunId
Definition: FairRun.h:201
void SetField(FairField *ffield)
Definition: FairRunOnline.h:47
virtual ~FairRunOnline()