PandaRoot
PndMQDataDuplicator.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 PndMQDataDuplicator_H_
28 #define PndMQDataDuplicator_H_
29 
30 #include <string>
31 #include <boost/serialization/access.hpp>
32 #include <boost/archive/text_iarchive.hpp>
33 #include <boost/archive/binary_iarchive.hpp>
34 #include <boost/archive/binary_oarchive.hpp>
35 #include <boost/serialization/vector.hpp>
36 
37 #include "FairMQDevice.h"
38 
39 #include "PndSdsDigiTopix4.h"
40 
41 class PndMQDataDuplicator : public FairMQDevice {
42  public:
44  virtual ~PndMQDataDuplicator();
45 
46  template <class Archive>
47  void serialize(Archive &ar, const unsigned int version)
48  {
49  ar &fTopixData;
50  }
51 
52  void SetRateRatio(int channel, int ratio)
53  {
54  if (channel > fRates.size() - 1) {
55  fRates.resize(channel + 1, 0);
56  }
57  fRates[channel] = ratio;
58  }
59 
60  protected:
61  virtual void Run();
62 
63  std::vector<int> fRates;
64 
65 #ifndef __CINT__ // for BOOST serialization
68 #endif // for BOOST serialization
69  std::vector<PndSdsDigiTopix4> fTopixData;
70 };
71 
72 #endif /* PndMQDataDuplicator_H_ */
void SetRateRatio(int channel, int ratio)
std::vector< PndSdsDigiTopix4 > fTopixData
virtual void Run()
void serialize(Archive &ar, const unsigned int version)
friend class boost::serialization::access
virtual ~PndMQDataDuplicator()
std::vector< int > fRates