FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairMQPixelSamplerBin.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  ********************************************************************************/
15 #ifndef FAIRMQPIXELSAMPLERBIN_H_
16 #define FAIRMQPIXELSAMPLERBIN_H_
17 
18 #include <FairMQDevice.h>
19 #include <cstdint>
20 #include <string>
21 #include <thread>
22 #include <vector>
23 
24 class FairFileSource;
25 class FairRunAna;
26 class TObject;
27 
28 class FairMQPixelSamplerBin : public FairMQDevice
29 {
30  public:
32  virtual ~FairMQPixelSamplerBin();
33 
34  void AddInputFileName(const std::string& tempString) { fFileNames.push_back(tempString); }
35  void AddInputBranchName(const std::string& tempString) { fBranchNames.push_back(tempString); }
36 
37  void SetMaxIndex(int64_t tempInt) { fMaxIndex = tempInt; }
38 
39  void ListenForAcks();
40 
41  void SetOutputChannelName(const std::string& tstr) { fOutputChannelName = tstr; }
42  void SetAckChannelName(const std::string& tstr) { fAckChannelName = tstr; }
43 
44  protected:
45  virtual bool ConditionalRun();
46  virtual void PreRun();
47  virtual void PostRun();
48  virtual void InitTask();
49 
50  private:
51  std::string fOutputChannelName;
52  std::string fAckChannelName;
53 
54  FairRunAna* fRunAna;
55  FairFileSource* fSource;
56  TObject* fInputObjects[100];
57  int fNObjects;
58  int64_t fMaxIndex;
59 
60  int fEventCounter;
61 
62  std::vector<std::string> fBranchNames;
63  std::vector<std::string> fFileNames;
64 
67 
68  std::thread fAckListener;
69 };
70 
71 #endif /* FAIRMQPIXELSAMPLER_H_ */
void SetMaxIndex(int64_t tempInt)
void SetAckChannelName(const std::string &tstr)
void AddInputBranchName(const std::string &tempString)
void SetOutputChannelName(const std::string &tstr)
void AddInputFileName(const std::string &tempString)