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