PandaRoot
PndBurstVectorBuilder.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 version 3 (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
15 #ifndef PndBurstVectorBuilder_H_
16 #define PndBurstVectorBuilder_H_
17 
18 #include "FairTimeStamp.h"
19 
20 #include "PndBurstContainer.h"
21 
22 #include "TClonesArray.h"
23 
24 #include <boost/serialization/access.hpp>
25 #include <boost/archive/text_iarchive.hpp>
26 #include <boost/archive/binary_iarchive.hpp>
27 #include <boost/serialization/vector.hpp>
28 
29 using namespace std;
30 
32  public:
33  PndBurstVectorBuilderBase() //: fThreshold(2E3), fOffset(2E3), fHasBoostSerialization(false), fCurrentThreshold(fThreshold), fCurrentOffset(fOffset + fThreshold)
34  {
35  }
36 
38 
39  virtual std::vector<std::vector<FairTimeStamp *>> ProcessData(TClonesArray *data) = 0;
40 
41  virtual std::vector<std::vector<FairTimeStamp *>> GetLastData() = 0;
42 
43  // virtual void SetThreshold(double val){ fThreshold = val;}
44  // virtual void SetOffset(double val){ fOffset = val;}
45  //
46  // virtual double GetThreshold(){return fThreshold;}
47  // virtual double GetOffset(){return fOffset;}
48 
49  virtual int GetBurstId(FairTimeStamp *data)
50  {
51  int result = data->GetTimeStamp() / fBurstContainer.GetThreshold();
52  return result;
53  }
54 
55  // template <class Archive>
56  // void serialize(Archive& ar, const unsigned int version)
57  // {
58  // ar& fData;
61  // }
62 
63  protected:
64  // double fThreshold;
65  // double fOffset;
66  // double fCurrentThreshold;
67  // double fCurrentOffset;
68 
69  // #ifndef __CINT__ // for BOOST serialization
70  // friend class boost::serialization::access;
71  // bool fHasBoostSerialization;
72  // #endif // for BOOST serialization
73  std::vector<FairTimeStamp *> fData;
74  // std::vector<FairTimeStamp* > fCurrentOutput;
75  // std::vector<std::vector<FairTimeStamp* > > fNextOutputs;
77 };
78 
79 template <typename T>
81  public:
83 
85 
86  std::vector<std::vector<FairTimeStamp *>> ProcessData(TClonesArray *data);
87 
88  std::vector<std::vector<FairTimeStamp *>> GetLastData();
89 };
90 
91 #include "PndBurstVectorBuilder.tpl"
92 
93 #endif /* PndBurstVectorBuilder_H_ */
STL namespace.
std::vector< FairTimeStamp * > fData
virtual int GetBurstId(FairTimeStamp *data)