File indexing completed on 2025-08-06 08:17:23
0001 #ifndef FUN4ALLRAW_SINGLEMICROMEGASPOOLINPUT_V1_H
0002 #define FUN4ALLRAW_SINGLEMICROMEGASPOOLINPUT_V1_H
0003
0004 #include "MicromegasBcoMatchingInformation_v1.h"
0005 #include "SingleStreamingInput.h"
0006
0007 #include <phool/PHTimer.h>
0008
0009 #include <array>
0010 #include <list>
0011 #include <map>
0012 #include <memory>
0013 #include <set>
0014 #include <string>
0015 #include <vector>
0016
0017 class MicromegasRawHit;
0018 class Packet;
0019
0020 class TFile;
0021 class TH1;
0022
0023 class SingleMicromegasPoolInput_v1 : public SingleStreamingInput
0024 {
0025 public:
0026 explicit SingleMicromegasPoolInput_v1(const std::string &name = "SingleMicromegasPoolInput_v1");
0027 ~SingleMicromegasPoolInput_v1() override;
0028 void FillPool(const unsigned int nevents = 1) override;
0029
0030 void CleanupUsedPackets(const uint64_t bclk) override
0031 { CleanupUsedPackets(bclk,false); }
0032
0033 void CleanupUsedPackets(const uint64_t bclk, bool ) override;
0034
0035 void ClearCurrentEvent() override;
0036 bool GetSomeMoreEvents();
0037 void Print(const std::string &what = "ALL") const override;
0038 void CreateDSTNode(PHCompositeNode *topNode) override;
0039
0040 void SetBcoRange(const unsigned int value) { m_BcoRange = value; }
0041 void ConfigureStreamingInputManager() override;
0042 void SetNegativeBco(const unsigned int value) { m_NegativeBco = value; }
0043
0044
0045 void SetBcoPoolSize(const unsigned int value) { m_BcoPoolSize = value; }
0046
0047
0048 void FillBcoQA(uint64_t ) override;
0049
0050
0051 void createQAHistos() override;
0052
0053 private:
0054 std::array<Packet *, 10> plist{};
0055 unsigned int m_NumSpecialEvents{0};
0056 unsigned int m_BcoRange{0};
0057 unsigned int m_NegativeBco{0};
0058
0059
0060 unsigned int m_BcoPoolSize{1};
0061
0062
0063
0064
0065
0066
0067
0068 std::map<uint64_t, std::set<int>> m_BeamClockPacket;
0069
0070
0071 std::map<uint64_t, std::set<int>> m_BeamClockFEE;
0072
0073
0074 std::map<uint64_t, std::vector<MicromegasRawHit *>> m_MicromegasRawHitMap;
0075
0076
0077
0078 std::map<int, uint64_t> m_FEEBclkMap;
0079
0080
0081
0082
0083
0084
0085
0086 std::set<uint64_t> m_BclkStack;
0087
0088
0089 using bco_matching_information_map_t = std::map<unsigned int, MicromegasBcoMatchingInformation_v1>;
0090 bco_matching_information_map_t m_bco_matching_information_map;
0091
0092
0093 std::map<int,uint64_t> m_fee_waveform_count_total{};
0094
0095
0096 std::map<int,uint64_t> m_fee_waveform_count_dropped_bco{};
0097
0098
0099 std::map<int,uint64_t> m_waveform_count_total{};
0100
0101
0102 std::map<int,uint64_t> m_waveform_count_dropped_bco{};
0103
0104
0105 std::map<int,uint64_t> m_waveform_count_dropped_pool{};
0106
0107
0108 PHTimer m_timer{ "SingleMicromegasPoolInput_v1" };
0109
0110
0111
0112
0113
0114 TH1 *h_packet_stat{nullptr};
0115
0116
0117 TH1 *h_packet{nullptr};
0118
0119
0120 TH1 *h_waveform{nullptr};
0121
0122
0123 TH1 *h_waveform_count_total{nullptr};
0124
0125
0126
0127 TH1 *h_waveform_count_dropped_bco{nullptr};
0128
0129
0130 TH1 *h_waveform_count_dropped_pool{nullptr};
0131
0132
0133
0134 };
0135
0136 #endif