PandaRoot
PndMvdMQFileSink.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /********************************************************************************
14  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
15  * *
16  * This software is distributed under the terms of the *
17  * GNU Lesser General Public Licence version 3 (LGPL) version 3, *
18  * copied verbatim in the file "LICENSE" *
19  ********************************************************************************/
27 #ifndef PndMvdMQFileSink_H_
28 #define PndMvdMQFileSink_H_
29 
30 #include "TClonesArray.h"
31 #include "TFile.h"
32 #include "TFolder.h"
33 #include "TTree.h"
34 #include "FairEventHeader.h"
35 
36 #include "FairMQDevice.h"
37 
38 class PndMvdMQFileSink : public FairMQDevice {
39  public:
40  enum { OutputFileName = FairMQDevice::Last, Last };
41 
43  virtual ~PndMvdMQFileSink();
44 
45  void SetProperty(const int key, const std::string &value);
46  void SetProperty(const int key, const int value);
47  std::string GetProperty(const int key, const std::string &default_ = "");
48  int GetProperty(const int key, const int default_ = 0);
49 
50  void SetOutputFileName(std::string tempString) { fFileName = tempString; }
51  void AddOutputBranch(std::string classString, std::string branchString)
52  {
53  fClassNames.push_back(classString);
54  fBranchNames.push_back(branchString);
55  }
56  std::string GetOutputFileName() { return fFileName; }
57 
58  protected:
59  virtual void Init();
60  virtual void Run();
61 
62  private:
63  std::string fFileName;
64  std::string fTreeName;
65 
66  std::vector<std::string> fBranchNames;
67  std::vector<std::string> fClassNames;
68 
69  std::string fFileOption;
70  bool fFlowMode;
71  bool fWrite;
72 
73  TFile *fOutFile;
74  TTree *fTree;
75  unsigned int fNObjects;
76  TObject **fOutputObjects;
77  /* FairEventHeader* fEventHeader; */
78  /* TClonesArray* fOutput; */
79  TFolder *fFolder;
80 };
81 
82 #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()