PandaRoot
PndMQHitsEventBuilder.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  * PndMQHitsEventBuilder.h
15  *
16  * Created on: 21.10.2015
17  * Author: Stockmanns
18  */
19 
20 #ifndef MVD_MVDOFFLINETBANALYSIS_TOPIX4_MQ_PNDMQHITSEVENTBUILDER_H_
21 #define MVD_MVDOFFLINETBANALYSIS_TOPIX4_MQ_PNDMQHITSEVENTBUILDER_H_
22 
23 #include <vector>
24 #include <array>
25 
26 #include "PndSdsHit.h"
27 
28 using namespace std;
29 
31  public:
32  PndMQHitsEventBuilder(int nChannels = 4);
33  virtual ~PndMQHitsEventBuilder();
34 
35  void AddData(vector<vector<vector<PndSdsHit>>> &data);
36  vector<vector<PndSdsHit>> GetEvents();
37  vector<int> GetSensorsInEvent() { return fSensorsInEvent; }
38  std::vector<int> GetInputDataLevel()
39  {
40  std::vector<int> result;
41  for (auto &channelIter : fInputData) {
42  result.push_back(channelIter.size());
43  }
44  return result;
45  }
46 
47  protected:
48  vector<bool> GetChannelsInEvent(vector<vector<PndSdsHit>> &eventData);
49  int FindFirstChannel(vector<vector<PndSdsHit>> &eventData);
50  vector<PndSdsHit> GetNextEvent();
51  vector<int> fSensorsInEvent;
52 
53  bool HasData();
54 
55  private:
56  vector<vector<vector<PndSdsHit>>> fInputData; //< array of InputChannels. An InputChannel contains PndSdsHits grouped in events
57  int fNChannels;
58  int fEventCounter;
59 };
60 
61 #endif /* MVD_MVDOFFLINETBANALYSIS_TOPIX4_MQ_PNDMQHITSEVENTBUILDER_H_ */
std::vector< int > GetInputDataLevel()
STL namespace.
vector< int > GetSensorsInEvent()