1 #ifndef SiStripHitEfficiencyHelpers_H 2 #define SiStripHitEfficiencyHelpers_H 9 #include <fmt/printf.h> 19 k_LayersAtTOBEnd = 10,
20 k_LayersAtTIDEnd = 13,
21 k_LayersAtTECEnd = 22,
23 k_END_OF_LAYS_AND_RINGS = 35
26 inline unsigned int checkLayer(
unsigned int iidd,
const TrackerTopology* tTopo) {
27 switch (
DetId(iidd).subdetId()) {
31 return tTopo->
tobLayer(iidd) + bounds::k_LayersAtTIBEnd;
33 return tTopo->
tidWheel(iidd) + bounds::k_LayersAtTOBEnd;
35 return tTopo->
tecWheel(iidd) + bounds::k_LayersAtTIDEnd;
37 return bounds::k_LayersStart;
43 if (
k > bounds::k_LayersStart &&
k <= bounds::k_LayersAtTIBEnd) {
45 }
else if (
k > bounds::k_LayersAtTIBEnd &&
k <= bounds::k_LayersAtTOBEnd) {
46 return fmt::format(
"TOB L{:d}",
k - bounds::k_LayersAtTIBEnd);
47 }
else if (
k > bounds::k_LayersAtTOBEnd &&
k <= bounds::k_LayersAtTIDEnd) {
48 return fmt::format(
"TID {0}{1:d}", ringlabel,
k - bounds::k_LayersAtTOBEnd);
49 }
else if (
k > bounds::k_LayersAtTIDEnd &&
k <= bounds::k_LayersAtTIDEnd + nTEClayers) {
50 return fmt::format(
"TEC {0}{1:d}", ringlabel,
k - bounds::k_LayersAtTIDEnd);
52 return "should never be here!";
56 inline std::string layerSideName(Long_t
k,
const bool showRings,
const unsigned int nTEClayers) {
58 if (
k > bounds::k_LayersStart &&
k <= bounds::k_LayersAtTIBEnd) {
60 }
else if (
k > bounds::k_LayersAtTIBEnd &&
k <= bounds::k_LayersAtTOBEnd) {
61 return fmt::format(
"TOB L{:d}",
k - bounds::k_LayersAtTIBEnd);
62 }
else if (
k > bounds::k_LayersAtTOBEnd &&
k < 14) {
63 return fmt::format(
"TID- {0}{1:d}", ringlabel,
k - bounds::k_LayersAtTOBEnd);
64 }
else if (
k > 13 &&
k < 17) {
66 }
else if (
k > 16 &&
k < 17 + nTEClayers) {
68 }
else if (
k > 16 + nTEClayers) {
69 return fmt::format(
"TEC+ {0}{1:d}", ringlabel,
k - 16 - nTEClayers);
71 return "shoud never be here!";
80 double consistency = separation /
error;
84 inline bool isDoubleSided(
unsigned int iidd,
const TrackerTopology* tTopo) {
86 switch (
DetId(iidd).subdetId()) {
104 inline bool check2DPartner(
unsigned int iidd,
const std::vector<TrajectoryMeasurement>& traj) {
105 unsigned int partner_iidd = 0;
106 bool found2DPartner =
false;
108 if ((iidd & 0x3) == 1)
109 partner_iidd = iidd + 1;
110 if ((iidd & 0x3) == 2)
111 partner_iidd = iidd - 1;
114 for (
const auto& tm : traj) {
115 if (tm.recHit()->geographicalId().rawId() == partner_iidd) {
116 found2DPartner =
true;
119 return found2DPartner;
122 inline bool isInBondingExclusionZone(
123 unsigned int iidd,
unsigned int TKlayers,
double yloc,
double yErr,
const TrackerTopology* tTopo) {
124 constexpr
float exclusionWidth = 0.4;
125 constexpr
float TOBexclusion = 0.0;
126 constexpr
float TECexRing5 = -0.89;
127 constexpr
float TECexRing6 = -0.56;
128 constexpr
float TECexRing7 = 0.60;
132 const int ringnumber = ((iidd >> 5) & 0x7);
136 if ((TKlayers >= 5 && TKlayers < 11) || ((
subdetector == 6) && ((ringnumber >= 5) && (ringnumber <= 7)))) {
138 float highzone = 0.0;
140 float higherr = yloc + 5.0 * yErr;
141 float lowerr = yloc - 5.0 * yErr;
142 if (TKlayers >= 5 && TKlayers < 11) {
144 highzone = TOBexclusion + exclusionWidth;
145 lowzone = TOBexclusion - exclusionWidth;
146 }
else if (ringnumber == 5) {
148 highzone = TECexRing5 + exclusionWidth;
149 lowzone = TECexRing5 - exclusionWidth;
150 }
else if (ringnumber == 6) {
152 highzone = TECexRing6 + exclusionWidth;
153 lowzone = TECexRing6 - exclusionWidth;
154 }
else if (ringnumber == 7) {
156 highzone = TECexRing7 + exclusionWidth;
157 lowzone = TECexRing7 - exclusionWidth;
160 if ((highzone <= higherr) && (highzone >= lowerr))
162 if ((lowzone >= lowerr) && (lowzone <= higherr))
164 if ((higherr <= highzone) && (higherr >= lowzone))
166 if ((lowerr >= lowzone) && (lowerr <= highzone))
176 ClusterInfo(
float xRes,
float xResPull,
float xLoc) : xResidual(xRes), xResidualPull(xResPull), xLocal(xLoc) {}
179 inline float calcPhi(
float x,
float y) {
181 if ((
x >= 0) && (
y >= 0))
182 phi = std::atan(
y /
x);
183 else if ((
x >= 0) && (
y <= 0))
185 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