FairRoot/PandaRoot
PndMvdMQFileSink.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 version 3 (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
15 #ifndef PndMvdMQFileSink_H_
16 #define PndMvdMQFileSink_H_
17 
18 #include "TClonesArray.h"
19 #include "TFile.h"
20 #include "TFolder.h"
21 #include "TTree.h"
22 #include "FairEventHeader.h"
23 
24 #include "FairMQDevice.h"
25 
26 class PndMvdMQFileSink : public FairMQDevice
27 {
28  public:
29  enum
30  {
31  OutputFileName = FairMQDevice::Last,
33  };
34 
36  virtual ~PndMvdMQFileSink();
37 
38  void SetProperty(const int key, const std::string& value);
39  void SetProperty(const int key, const int value);
40  std::string GetProperty(const int key, const std::string& default_ = "");
41  int GetProperty(const int key, const int default_ = 0);
42 
43  void SetOutputFileName(std::string tempString) { fFileName = tempString; }
44  void AddOutputBranch (std::string classString, std::string branchString)
45  {
46  fClassNames .push_back(classString);
47  fBranchNames.push_back(branchString);
48  }
49  std::string GetOutputFileName () { return fFileName;}
50 
51  protected:
52  virtual void Init();
53  virtual void Run();
54 
55  private:
56  std::string fFileName;
57  std::string fTreeName;
58 
59  std::vector<std::string> fBranchNames;
60  std::vector<std::string> fClassNames;
61 
62  std::string fFileOption;
63  bool fFlowMode;
64  bool fWrite;
65 
66  TFile* fOutFile;
67  TTree* fTree;
68  unsigned int fNObjects;
69  TObject** fOutputObjects;
70  /* FairEventHeader* fEventHeader; */
71  /* TClonesArray* fOutput; */
72  TFolder* fFolder;
73 
74 };
75 
76 #endif /* PndMvdMQFileSink_H_ */
std::string GetOutputFileName()
std::string fFileName
void SetProperty(const int key, const std::string &value)
std::string GetProperty(const int key, const std::string &default_="")
void AddOutputBranch(std::string classString, std::string branchString)
std::string fFileOption
virtual void Init()
TObject ** fOutputObjects
std::string fTreeName
std::vector< std::string > fBranchNames
void SetOutputFileName(std::string tempString)
virtual void Run()
unsigned int fNObjects
std::vector< std::string > fClassNames