FairRoot/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 
30 using namespace std;
31 
32 
33 
35 {
36 public :
37  PndBurstVectorBuilderBase() //: fThreshold(2E3), fOffset(2E3), fHasBoostSerialization(false), fCurrentThreshold(fThreshold), fCurrentOffset(fOffset + fThreshold)
38  {}
39 
41  {}
42 
43  virtual std::vector< std::vector<FairTimeStamp* > > ProcessData(TClonesArray* data) = 0;
44 
45  virtual std::vector< std::vector<FairTimeStamp* > > GetLastData() = 0;
46 
47 // virtual void SetThreshold(double val){ fThreshold = val;}
48 // virtual void SetOffset(double val){ fOffset = val;}
49 //
50 // virtual double GetThreshold(){return fThreshold;}
51 // virtual double GetOffset(){return fOffset;}
52 
53  virtual int GetBurstId (FairTimeStamp* data){
54  int result = data->GetTimeStamp() / fBurstContainer.GetThreshold();
55  return result;
56  }
57 
58 // template <class Archive>
59 // void serialize(Archive& ar, const unsigned int version)
60 // {
61 // ar& fData;
64 // }
65 
66  protected:
67 // double fThreshold;
68 // double fOffset;
69 // double fCurrentThreshold;
70 // double fCurrentOffset;
71 
72 // #ifndef __CINT__ // for BOOST serialization
73 // friend class boost::serialization::access;
74 // bool fHasBoostSerialization;
75 // #endif // for BOOST serialization
76  std::vector<FairTimeStamp* > fData;
77 // std::vector<FairTimeStamp* > fCurrentOutput;
78 // std::vector<std::vector<FairTimeStamp* > > fNextOutputs;
80 };
81 
82 template<typename T>
84 {
85  public:
86 
88  {}
89 
91  {}
92 
93  std::vector< std::vector<FairTimeStamp* > > ProcessData(TClonesArray* data);
94 
95  std::vector< std::vector<FairTimeStamp* > > GetLastData();
96 
97 };
98 
99 #include "PndBurstVectorBuilder.tpl"
100 
101 #endif /* PndBurstVectorBuilder_H_ */
std::vector< FairTimeStamp * > fData
virtual int GetBurstId(FairTimeStamp *data)