PandaRoot
MvdMQ/src/devices/PndMvdMQFileSampler.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 PndMvdMQFileSampler_H_
28 #define PndMvdMQFileSampler_H_
29 
30 #include <string>
31 
32 #include "TClonesArray.h"
33 
34 #include "FairFileSource.h"
35 #include "FairRunAna.h"
36 
37 #include "FairMQDevice.h"
38 
39 class PndMvdMQFileSampler : public FairMQDevice {
40  public:
41  enum { InputFileName = FairMQDevice::Last, Last };
42 
44  virtual ~PndMvdMQFileSampler();
45 
46  void AddInputFileName(std::string tempString) { fFileNames.push_back(tempString); }
47  void AddInputChannelBranchName(std::pair<std::string, std::string> tempString)
48  {
49  fBranchNames.push_back(tempString);
50  fPorts.insert(tempString.first);
51  }
52 
53  void SetMaxIndex(int64_t tempInt) { fMaxIndex = tempInt; }
54 
55  protected:
56  virtual void Run();
57  virtual void InitTask();
58 
59  private:
60  FairRunAna *fRunAna;
61  FairFileSource *fSource;
62  std::multimap<std::string, TObject *> fInputObjects; //< multimap of port and object
63  std::map<std::string, TObject *> fInputBranches;
64  TObject *fEventHeaderPointer;
65  std::set<std::string> fPorts;
66  int fNObjects;
67  int64_t fMaxIndex;
68  std::vector<std::pair<std::string, std::string>> fBranchNames;
69  std::vector<std::string> fFileNames;
70 };
71 
72 #endif /* PndMvdMQFileSampler_H_ */
virtual void Run()
virtual ~PndMvdMQFileSampler()
void AddInputFileName(std::string tempString)
void AddInputChannelBranchName(std::pair< std::string, std::string > tempString)
virtual void InitTask()