File indexing completed on 2024-04-06 12:21:35
0001 #ifndef L1RCT_h
0002 #define L1RCT_h
0003
0004 #include <bitset>
0005 #include <iomanip>
0006 #include <iostream>
0007 #include <string>
0008 #include <vector>
0009
0010 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTCrate.h"
0011 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTNeighborMap.h"
0012
0013 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0014 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
0015 #include "DataFormats/L1CaloTrigger/interface/L1CaloCollections.h"
0016 #include "DataFormats/L1CaloTrigger/interface/L1CaloRegion.h"
0017
0018 class L1RCTLookupTables;
0019
0020 class L1RCT {
0021 public:
0022 L1RCT(const L1RCTLookupTables *rctLookupTables);
0023
0024
0025 void input();
0026
0027
0028 void input(const std::vector<std::vector<std::vector<unsigned short>>> &barrelIn,
0029 const std::vector<std::vector<unsigned short>> &hfIn);
0030
0031
0032
0033
0034 void processEvent();
0035
0036 void fileInput(const char *filename);
0037
0038 void digiInput(const EcalTrigPrimDigiCollection &ecalCollection, const HcalTrigPrimDigiCollection &hcalCollection);
0039
0040 void randomInput();
0041
0042 void print();
0043 void printCrate(int i) { crates.at(i).print(); }
0044 void printJSC(int i) { crates.at(i).printJSC(); }
0045 void printJSC() {
0046 for (int i = 0; i < 18; i++) {
0047 std::cout << "JSC for Crate " << i << std::endl;
0048 crates.at(i).printJSC();
0049 }
0050 }
0051 void printRC(int i, int j) { crates.at(i).printRC(j); }
0052 void printEIC(int i, int j) { crates.at(i).printEIC(j); }
0053 void printEICEdges(int i, int j) { crates.at(i).printEICEdges(j); }
0054
0055 L1CaloEmCollection getIsolatedEGObjects(unsigned crate);
0056
0057 L1CaloEmCollection getNonisolatedEGObjects(unsigned crate);
0058
0059 std::vector<unsigned short> getJetRegions(unsigned crate) { return crates.at(crate).getJetRegions(); }
0060
0061 std::vector<L1CaloRegion> getRegions(unsigned crate);
0062
0063 unsigned short ecalCompressedET(int crate, int card, int tower) { return barrel.at(crate).at(card).at(tower) / 2; }
0064 unsigned short ecalFineGrainBit(int crate, int card, int tower) { return barrel.at(crate).at(card).at(tower) & 1; }
0065 unsigned short hcalCompressedET(int crate, int card, int tower) {
0066 return barrel.at(crate).at(card).at(tower + 32) / 2;
0067 }
0068 unsigned short hcalFineGrainBit(int crate, int card, int tower) {
0069 return barrel.at(crate).at(card).at(tower + 32) & 1;
0070 }
0071 unsigned short hfCompressedET(int crate, int tower) { return hf.at(crate).at(tower) / 2; }
0072 unsigned short hfFineGrainBit(int crate, int tower) { return hf.at(crate).at(tower) & 1; }
0073
0074 private:
0075 L1RCT();
0076
0077 const L1RCTLookupTables *rctLookupTables_;
0078
0079
0080
0081
0082 void makeCrates();
0083 void configureCards();
0084 void shareNeighbors();
0085
0086 L1RCTRegion empty;
0087
0088
0089
0090
0091
0092
0093 L1RCTNeighborMap neighborMap;
0094
0095
0096
0097
0098
0099
0100
0101 std::vector<L1RCTCrate> crates;
0102
0103
0104
0105
0106
0107
0108
0109
0110 std::vector<std::vector<std::vector<unsigned short>>> barrel;
0111 std::vector<std::vector<unsigned short>> hf;
0112 };
0113
0114 #endif