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  public:
28  enum { OutputFileName = FairMQDevice::Last, Last };
29 
31  virtual ~PndMvdMQFileSink();
32 
33  void SetProperty(const int key, const std::string &value);
34  void SetProperty(const int key, const int value);
35  std::string GetProperty(const int key, const std::string &default_ = "");
36  int GetProperty(const int key, const int default_ = 0);
37 
38  void SetOutputFileName(std::string tempString) { fFileName = tempString; }
39  void AddOutputBranch(std::string classString, std::string branchString)
40  {
41  fClassNames.push_back(classString);
42  fBranchNames.push_back(branchString);
43  }
44  std::string GetOutputFileName() { return fFileName; }
45 
46  protected:
47  virtual void Init();
48  virtual void Run();
49 
50  private:
51  std::string fFileName;
52  std::string fTreeName;
53 
54  std::vector<std::string> fBranchNames;
55  std::vector<std::string> fClassNames;
56 
57  std::string fFileOption;
58  bool fFlowMode;
59  bool fWrite;
60 
61  TFile *fOutFile;
62  TTree *fTree;
63  unsigned int fNObjects;
64  TObject **fOutputObjects;
65  /* FairEventHeader* fEventHeader; */
66  /* TClonesArray* fOutput; */
67  TFolder *fFolder;
68 };
69 
70 #endif /* PndMvdMQFileSink_H_ */
std::string GetOutputFileName()
void SetProperty(const int key, const std::string &value)
virtual ~PndMvdMQFileSink()
std::string GetProperty(const int key, const std::string &default_="")
void AddOutputBranch(std::string classString, std::string branchString)
void SetOutputFileName(std::string tempString)
virtual void Run()
virtual void Init()