File indexing completed on 2024-04-06 12:19:54
0001 #ifndef GCTTESTENERGYALGOS_H_
0002 #define GCTTESTENERGYALGOS_H_
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include <vector>
0016 #include <fstream>
0017 #include <stdint.h>
0018
0019 class L1GlobalCaloTrigger;
0020 class L1CaloRegion;
0021
0022 class L1GctChannelMask;
0023
0024 class gctTestEnergyAlgos {
0025 public:
0026
0027 struct etmiss_vec {
0028 unsigned mag;
0029 unsigned phi;
0030 };
0031
0032
0033 gctTestEnergyAlgos();
0034 ~gctTestEnergyAlgos();
0035
0036
0037 std::vector<L1CaloRegion> loadEvent(L1GlobalCaloTrigger*& gct, const bool simpleEvent, const int16_t bx);
0038 std::vector<L1CaloRegion> loadEvent(L1GlobalCaloTrigger*& gct,
0039 const std::string& fileName,
0040 bool& endOfFile,
0041 const int16_t bx);
0042 std::vector<L1CaloRegion> loadEvent(L1GlobalCaloTrigger*& gct,
0043 const std::vector<L1CaloRegion>& inputRegions,
0044 const int16_t bx);
0045
0046
0047 void setBxRange(const int bxStart, const int numOfBx);
0048
0049
0050 bool checkEnergySums(const L1GlobalCaloTrigger* gct) const;
0051
0052
0053 void configure(const L1GctChannelMask* mask) { m_chanMask = mask; }
0054
0055 private:
0056
0057
0058 etmiss_vec randomMissingEtVector() const;
0059
0060 std::vector<unsigned> randomTestData(const int size, const unsigned max) const;
0061
0062 L1CaloRegion nextRegionFromFile(const unsigned ieta, const unsigned iphi, const int16_t bx);
0063
0064
0065 void loadInputRegions(L1GlobalCaloTrigger*& gct, const std::vector<L1CaloRegion>& inputRegions, const int16_t bx);
0066
0067
0068
0069
0070
0071
0072 int etComponent(const unsigned Emag0, const unsigned fact0, const unsigned Emag1, const unsigned fact1) const;
0073
0074 etmiss_vec trueMissingEt(const int ex, const int ey) const;
0075
0076
0077
0078 const L1GctChannelMask* m_chanMask;
0079
0080 int m_bxStart;
0081 int m_numOfBx;
0082
0083 std::vector<unsigned> etStripSums;
0084 std::vector<bool> inMinusOvrFlow;
0085 std::vector<bool> inPlusOverFlow;
0086
0087 std::ifstream regionEnergyMapInputFile;
0088 };
0089
0090 #endif