FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairMQChunkMerger.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 FAIRMQCHUNKMERGER_H_
16 #define FAIRMQCHUNKMERGER_H_
17 
18 #include <FairMQDevice.h>
19 #include <map>
20 #include <string>
21 #include <utility> // pair
22 
23 class TObject;
25 
26 typedef std::multimap<std::pair<int, int>, std::pair<int, TObject*>> MultiMapDef;
27 
28 class FairMQChunkMerger : public FairMQDevice
29 {
30  public:
32  virtual ~FairMQChunkMerger();
33 
34  void SetNofParts(int iparts) { fNofParts = iparts; }
35 
36  protected:
37  bool MergeData(FairMQParts&, int);
38  virtual void Init();
39 
40  private:
41  std::string fInputChannelName;
42  std::string fOutputChannelName;
43 
44  std::map<std::pair<int, int>, int> fNofPartsPerEventMap; // number of parts for pair<event number,run id>
45  MultiMapDef fObjectMap; // TObjects for given pair<pair<event number, run,id>part>
46 
47  std::pair<int, int> fEvRIPair;
48  std::pair<int, TObject*> fEvCOPair;
49  std::pair<MultiMapDef::iterator, MultiMapDef::iterator> fRet;
50 
51  int fNofReceivedMessages;
52  int fNofSentMessages;
53 
54  int fNofParts;
55  FairMCSplitEventHeader* fMCSplitEventHeader;
56 
58  FairMQChunkMerger& operator=(const FairMQChunkMerger&);
59 };
60 
61 #endif /* FAIRMQCHUNKMERGER_H_ */
bool MergeData(FairMQParts &, int)
std::multimap< std::pair< std::pair< int, int >, int >, TObject * > MultiMapDef
void SetNofParts(int iparts)