1 #ifndef SiStripHitEfficiencyHelpers_H
2 #define SiStripHitEfficiencyHelpers_H
8 #include <fmt/printf.h>
15 inline unsigned int checkLayer(
unsigned int iidd,
const TrackerTopology* tTopo) {
16 switch (
DetId(iidd).subdetId()) {
34 }
else if (k > 4 && k < 11) {
36 }
else if (k > 10 && k < 14) {
37 return fmt::format(
"TID {0}{1:d}", ringlabel, k - 10);
38 }
else if (k > 13 && k < 14 + nTEClayers) {
39 return fmt::format(
"TEC {0}{1:d}", ringlabel, k - 13);
48 double error =
sqrt(parameters.second.xx() + xerr * xerr);
49 double separation =
abs(parameters.first.x() - xx);
50 double consistency = separation /
error;
54 inline bool isDoubleSided(
unsigned int iidd,
const TrackerTopology* tTopo) {
56 switch (
DetId(iidd).subdetId()) {
59 return (layer == 1 || layer == 2);
62 return (layer == 5 || layer == 6);
64 layer = tTopo->
tidRing(iidd) + 10;
65 return (layer == 11 || layer == 12);
67 layer = tTopo->
tecRing(iidd) + 13;
68 return (layer == 14 || layer == 15 || layer == 18);
74 inline bool check2DPartner(
unsigned int iidd,
const std::vector<TrajectoryMeasurement>& traj) {
75 unsigned int partner_iidd = 0;
76 bool found2DPartner =
false;
78 if ((iidd & 0x3) == 1)
79 partner_iidd = iidd + 1;
80 if ((iidd & 0x3) == 2)
81 partner_iidd = iidd - 1;
84 for (
const auto& tm : traj) {
85 if (tm.recHit()->geographicalId().rawId() == partner_iidd) {
86 found2DPartner =
true;
89 return found2DPartner;
92 inline bool isInBondingExclusionZone(
93 unsigned int iidd,
unsigned int TKlayers,
double yloc,
double yErr,
const TrackerTopology* tTopo) {
94 constexpr
float exclusionWidth = 0.4;
95 constexpr
float TOBexclusion = 0.0;
96 constexpr
float TECexRing5 = -0.89;
97 constexpr
float TECexRing6 = -0.56;
98 constexpr
float TECexRing7 = 0.60;
102 const int ringnumber = ((iidd >> 5) & 0x7);
106 if ((TKlayers >= 5 && TKlayers < 11) || ((subdetector == 6) && ((ringnumber >= 5) && (ringnumber <= 7)))) {
108 float highzone = 0.0;
110 float higherr = yloc + 5.0 * yErr;
111 float lowerr = yloc - 5.0 * yErr;
112 if (TKlayers >= 5 && TKlayers < 11) {
114 highzone = TOBexclusion + exclusionWidth;
115 lowzone = TOBexclusion - exclusionWidth;
116 }
else if (ringnumber == 5) {
118 highzone = TECexRing5 + exclusionWidth;
119 lowzone = TECexRing5 - exclusionWidth;
120 }
else if (ringnumber == 6) {
122 highzone = TECexRing6 + exclusionWidth;
123 lowzone = TECexRing6 - exclusionWidth;
124 }
else if (ringnumber == 7) {
126 highzone = TECexRing7 + exclusionWidth;
127 lowzone = TECexRing7 - exclusionWidth;
130 if ((highzone <= higherr) && (highzone >= lowerr))
132 if ((lowzone >= lowerr) && (lowzone <= higherr))
134 if ((higherr <= highzone) && (higherr >= lowzone))
136 if ((lowerr >= lowzone) && (lowerr <= highzone))
146 ClusterInfo(
float xRes,
float xResPull,
float xLoc) : xResidual(xRes), xResidualPull(xResPull), xLocal(xLoc) {}
149 inline float calcPhi(
float x,
float y) {
151 if ((x >= 0) && (y >= 0))
152 phi = std::atan(y / x);
153 else if ((x >= 0) && (y <= 0))
154 phi = std::atan(y / x) + 2 *
M_PI;
155 else if ((x <= 0) && (y >= 0))
156 phi = std::atan(y / x) +
M_PI;
158 phi = std::atan(y / x) +
M_PI;
159 phi = phi * 180.0 /
M_PI;
std::pair< LocalPoint, LocalError > LocalValues
unsigned int tibLayer(const DetId &id) const
constexpr char const * layerName[numberOfLayers]
unsigned int tidRing(const DetId &id) const
unsigned int tecRing(const DetId &id) const
ring id
unsigned int tidWheel(const DetId &id) const
constexpr std::array< uint8_t, layerIndexSize > layer
Abs< T >::type abs(const T &t)
unsigned int tecWheel(const DetId &id) const
unsigned int tobLayer(const DetId &id) const