File indexing completed on 2024-04-06 12:21:39
0001
0002
0003
0004 #include "L1Trigger/RPCTechnicalTrigger/interface/TTUWedgeORLogic.h"
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 TTUWedgeORLogic::TTUWedgeORLogic() {
0016 m_triggersignal = false;
0017
0018
0019
0020
0021
0022 m_wedgeSector[2] = 1;
0023 m_wedgeSector[3] = 1;
0024 m_wedgeSector[4] = 1;
0025 m_wedgeSector[5] = 1;
0026 m_wedgeSector[6] = 1;
0027 m_wedgeSector[7] = 3;
0028 m_wedgeSector[8] = 3;
0029 m_wedgeSector[9] = 3;
0030 m_wedgeSector[10] = 3;
0031 m_wedgeSector[11] = 3;
0032
0033
0034
0035
0036
0037
0038 m_maxwedges = m_wedgeSector.size();
0039
0040 m_option = 0;
0041
0042 m_debug = false;
0043 }
0044
0045
0046
0047 TTUWedgeORLogic::~TTUWedgeORLogic() {}
0048
0049
0050 void TTUWedgeORLogic::setBoardSpecs(const TTUBoardSpecs::TTUBoardConfig& boardspecs) {
0051 m_wheelMajority[boardspecs.m_Wheel1Id] = 3;
0052
0053 if ((boardspecs.m_MaxNumWheels > 1) && (boardspecs.m_Wheel2Id != 0))
0054 m_wheelMajority[boardspecs.m_Wheel2Id] = 3;
0055
0056 if (m_debug)
0057 std::cout << "TTUWedgeORLogic::setBoardSpecs> intialization: " << m_wheelMajority.size() << '\t'
0058 << boardspecs.m_MaxNumWheels << '\t' << boardspecs.m_Wheel1Id << '\t' << boardspecs.m_Wheel2Id << '\t'
0059 << m_wheelMajority[boardspecs.m_Wheel1Id] << '\t' << m_wheelMajority[boardspecs.m_Wheel2Id] << '\n';
0060 }
0061
0062 bool TTUWedgeORLogic::process(const TTUInput& inmap) {
0063 if (m_debug)
0064 std::cout << "TTUWedgeORLogic::process starts" << std::endl;
0065
0066 m_triggersignal = false;
0067
0068
0069
0070
0071
0072
0073
0074 int nhits(0);
0075 int sector_indx(0);
0076 int firstsector = m_option;
0077
0078 m_maxsectors = m_wedgeSector[firstsector];
0079
0080 for (int j = 0; j < m_maxsectors; ++j) {
0081 sector_indx = (firstsector - 1) + j;
0082 if (sector_indx >= 12)
0083 sector_indx = 0;
0084 nhits += inmap.input_sec[sector_indx].count();
0085 }
0086
0087
0088 bool use_forcing = false;
0089
0090 if (use_forcing) {
0091 for (int j = 0; j < m_maxsectors; ++j) {
0092 sector_indx = (firstsector - 1) + j;
0093
0094 if (firstsector <= 6) {
0095
0096 bool hasLayer1 = inmap.input_sec[sector_indx][0];
0097
0098 if (!hasLayer1) {
0099 m_triggersignal = false;
0100 return true;
0101 }
0102 }
0103 }
0104 }
0105
0106 int majority = m_wheelMajority[inmap.m_wheelId];
0107
0108 if (m_debug)
0109 std::cout << "TTUWedgeORLogic::setBoardSpecs> configuration W: " << inmap.m_wheelId << '\t' << "M: " << majority
0110 << '\n';
0111
0112 if (nhits >= majority)
0113 m_triggersignal = true;
0114
0115 if (m_debug)
0116 std::cout << "TTUWedgeORLogic wedge decision: "
0117 << "wheel: " << inmap.m_wheelId << '\t' << "quadrant: " << m_option << '\t' << "fsector: " << firstsector
0118 << '\t' << "nhits: " << nhits << '\t' << "maj: " << majority << '\t' << "Dec: " << m_triggersignal
0119 << std::endl;
0120
0121 if (m_debug)
0122 std::cout << "TTUWedgeORLogic>process ends" << std::endl;
0123
0124 return true;
0125 }