File indexing completed on 2024-04-06 12:21:49
0001 #include "L1Trigger/TrackFindingTMTT/interface/DegradeBend.h"
0002 #include "L1Trigger/TrackFindingTMTT/interface/TrackerModule.h"
0003
0004 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0005 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
0006 #include "FWCore/Utilities/interface/Exception.h"
0007
0008 #include <map>
0009 #include <set>
0010 #include <utility>
0011 #include <cmath>
0012 #include <algorithm>
0013 #include <iostream>
0014
0015 using namespace std;
0016
0017 namespace tmtt {
0018
0019
0020
0021
0022
0023
0024 void DegradeBend::degrade(float bend,
0025 bool psModule,
0026 const DetId& stDetId,
0027 float windowFEnew,
0028 float& degradedBend,
0029 unsigned int& numInGroup) const {
0030
0031 unsigned int windowHalfStrips;
0032 this->work(bend, psModule, stDetId, windowFEnew, degradedBend, numInGroup, windowHalfStrips);
0033 }
0034
0035
0036
0037 void DegradeBend::work(float bend,
0038 bool psModule,
0039 const DetId& stDetId,
0040 float windowFEnew,
0041 float& degradedBend,
0042 unsigned int& numInGroup,
0043 unsigned int& windowHalfStrips) const {
0044
0045
0046
0047 const double* storedHalfWindow = sw_->storedWindowSize(theTrackerTopo_, stDetId);
0048
0049
0050 const double window = std::min(*storedHalfWindow, double(windowFEnew));
0051 windowHalfStrips = (unsigned int)(2 * window);
0052
0053
0054
0055 int b = std::round(2 * bend);
0056
0057 if ((unsigned int)(std::abs(b)) <= windowHalfStrips) {
0058
0059 degradedBend = stubAlgo_->degradeBend(psModule, windowHalfStrips, b);
0060 } else {
0061
0062 numInGroup = 0;
0063 constexpr float rejectedStubBend = 99999.;
0064 degradedBend = rejectedStubBend;
0065 }
0066 }
0067 }