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