1 #ifndef SiStripHitEfficiencyHelpers_H 2 #define SiStripHitEfficiencyHelpers_H 8 #include <fmt/printf.h> 18 k_LayersAtTOBEnd = 10,
19 k_LayersAtTIDEnd = 13,
20 k_LayersAtTECEnd = 22,
24 inline unsigned int checkLayer(
unsigned int iidd,
const TrackerTopology* tTopo) {
25 switch (
DetId(iidd).subdetId()) {
29 return tTopo->
tobLayer(iidd) + bounds::k_LayersAtTIBEnd;
31 return tTopo->
tidWheel(iidd) + bounds::k_LayersAtTOBEnd;
33 return tTopo->
tecWheel(iidd) + bounds::k_LayersAtTIDEnd;
35 return bounds::k_LayersStart;
41 if (
k > bounds::k_LayersStart &&
k <= bounds::k_LayersAtTIBEnd) {
43 }
else if (
k > bounds::k_LayersAtTIBEnd &&
k <= bounds::k_LayersAtTOBEnd) {
44 return fmt::format(
"TOB L{:d}",
k - bounds::k_LayersAtTIBEnd);
45 }
else if (
k > bounds::k_LayersAtTOBEnd &&
k <= bounds::k_LayersAtTIDEnd) {
46 return fmt::format(
"TID {0}{1:d}", ringlabel,
k - bounds::k_LayersAtTOBEnd);
47 }
else if (
k > bounds::k_LayersAtTIDEnd &&
k <= bounds::k_LayersAtTIDEnd + nTEClayers) {
48 return fmt::format(
"TEC {0}{1:d}", ringlabel,
k - bounds::k_LayersAtTIDEnd);
59 double consistency = separation /
error;
63 inline bool isDoubleSided(
unsigned int iidd,
const TrackerTopology* tTopo) {
65 switch (
DetId(iidd).subdetId()) {
83 inline bool check2DPartner(
unsigned int iidd,
const std::vector<TrajectoryMeasurement>& traj) {
84 unsigned int partner_iidd = 0;
85 bool found2DPartner =
false;
87 if ((iidd & 0x3) == 1)
88 partner_iidd = iidd + 1;
89 if ((iidd & 0x3) == 2)
90 partner_iidd = iidd - 1;
93 for (
const auto& tm : traj) {
94 if (tm.recHit()->geographicalId().rawId() == partner_iidd) {
95 found2DPartner =
true;
98 return found2DPartner;
101 inline bool isInBondingExclusionZone(
102 unsigned int iidd,
unsigned int TKlayers,
double yloc,
double yErr,
const TrackerTopology* tTopo) {
103 constexpr
float exclusionWidth = 0.4;
104 constexpr
float TOBexclusion = 0.0;
105 constexpr
float TECexRing5 = -0.89;
106 constexpr
float TECexRing6 = -0.56;
107 constexpr
float TECexRing7 = 0.60;
111 const int ringnumber = ((iidd >> 5) & 0x7);
115 if ((TKlayers >= 5 && TKlayers < 11) || ((
subdetector == 6) && ((ringnumber >= 5) && (ringnumber <= 7)))) {
117 float highzone = 0.0;
119 float higherr = yloc + 5.0 * yErr;
120 float lowerr = yloc - 5.0 * yErr;
121 if (TKlayers >= 5 && TKlayers < 11) {
123 highzone = TOBexclusion + exclusionWidth;
124 lowzone = TOBexclusion - exclusionWidth;
125 }
else if (ringnumber == 5) {
127 highzone = TECexRing5 + exclusionWidth;
128 lowzone = TECexRing5 - exclusionWidth;
129 }
else if (ringnumber == 6) {
131 highzone = TECexRing6 + exclusionWidth;
132 lowzone = TECexRing6 - exclusionWidth;
133 }
else if (ringnumber == 7) {
135 highzone = TECexRing7 + exclusionWidth;
136 lowzone = TECexRing7 - exclusionWidth;
139 if ((highzone <= higherr) && (highzone >= lowerr))
141 if ((lowzone >= lowerr) && (lowzone <= higherr))
143 if ((higherr <= highzone) && (higherr >= lowzone))
145 if ((lowerr >= lowzone) && (lowerr <= highzone))
155 ClusterInfo(
float xRes,
float xResPull,
float xLoc) : xResidual(xRes), xResidualPull(xResPull), xLocal(xLoc) {}
158 inline float calcPhi(
float x,
float y) {
160 if ((
x >= 0) && (
y >= 0))
161 phi = std::atan(
y /
x);
162 else if ((
x >= 0) && (
y <= 0))
164 else if ((
x <= 0) && (
y >= 0))
std::pair< LocalPoint, LocalError > LocalValues
unsigned int tobLayer(const DetId &id) const
constexpr char const * layerName[numberOfLayers]
unsigned int tidWheel(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
unsigned int tecRing(const DetId &id) const
ring id
constexpr std::array< uint8_t, layerIndexSize > layer
Abs< T >::type abs(const T &t)
unsigned int tidRing(const DetId &id) const
unsigned int tibLayer(const DetId &id) const