13 const std::vector<std::vector<int> > pat1delta{{-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5},
17 {-4, -3, -2, -1, 0, 1, 2, 3, 4},
18 {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5}};
21 const std::vector<std::vector<int> > pat2delta{{3, 4, 5}, {1, 2}, {0}, {-2, -1, 0}, {-4, -3, -2}, {-5, -4, -3}};
24 const std::vector<std::vector<int> > pat3delta{{-5, -4, -3}, {-2, -1}, {0}, {0, 1, 2}, {2, 3, 4}, {3, 4, 5}};
27 const std::vector<std::vector<int> > pat4delta{{2, 3, 4}, {1, 2}, {0}, {-2, -1}, {-4, -3, -2}, {-4, -3, -2}
32 const std::vector<std::vector<int> > pat5delta{{-4, -3, -2}, {-2, -1}, {0}, {1, 2}, {2, 3, 4}, {2, 3, 4}
37 const std::vector<std::vector<int> > pat6delta{{1, 2, 3}, {0, 1}, {0}, {-1, 0}, {-2, -1}, {-3, -2, -1}};
40 const std::vector<std::vector<int> > pat7delta{{-3, -2, -1}, {-1, 0}, {0}, {0, 1}, {1, 2}, {1, 2, 3}};
43 const std::vector<std::vector<int> > pat8delta{{0, 1, 2}, {0, 1}, {0}, {-1, 0}, {-2, -1, 0}, {-2, -1, 0}};
46 const std::vector<std::vector<int> > pat9delta{{-2, -1, 0}, {-1, 0}, {0}, {0, 1}, {0, 1, 2}, {0, 1, 2}};
49 const std::vector<std::vector<int> > patAdelta{{-1, 0, 1}, {0}, {0}, {0}, {-1, 0, 1}, {-1, 0, 1}};
51 const std::vector<std::vector<std::vector<int> > > patIndexToPatternDelta{pat0delta,
72 const auto& compRange = hCSCComparators.get(layerId);
75 for (
auto compDigiItr = compRange.first; compDigiItr != compRange.second; compDigiItr++) {
76 const auto& compDigi = *compDigiItr;
79 const int stubHalfStrip(compDigi.getHalfStrip());
87 compDigis.push_back(compDigi);
102 const auto& detId =
p.first;
105 float radius_tmp = 0.0;
109 if (
p.second.empty())
113 for (
const auto&
hit :
p.second) {
114 const float fractional_strip =
hit.getFractionalStrip();
115 const auto& layer_geo = cscChamber->layer(detId.layer())->
geometry();
116 const float wire = layer_geo->middleWireOfGroup(stub.
getKeyWG() + 1);
119 const LocalPoint& csc_intersect = layer_geo->intersectionOfStripAndWire(fractional_strip, wire);
121 const float gpphi = csc_gp.
phi();
125 phi_tmp += (gpphi - 2 *
M_PI);
126 else if (!
phis_.empty() and gpphi < 0 and phis_[0] > 0 and (gpphi -
phis_[0]) < -
M_PI)
127 phi_tmp += (gpphi + 2 *
M_PI);
129 phi_tmp += (csc_gp.
phi());
132 radius_tmp += csc_gp.
perp();
136 radius_tmp = radius_tmp / (
p.second).
size();
139 zs_.push_back(z_tmp);
142 phi_tmp = phi_tmp / (
p.second).
size();
143 phis_.push_back(phi_tmp);
153 std::vector<float>& fit_phi_layers,
154 std::vector<float>& fit_z_layers,
157 fit_phi_layers.clear();
158 fit_z_layers.clear();
176 const LocalPoint& csc_intersect = layer_geo->intersectionOfStripAndWire(fractional_strip, wire);
195 float stripPhiPitch = layer_geo->stripPhiPitch();
204 const float fit_z = cscChamber->layer(
i + 1)->centerOfStrip(20).z();
206 fit_z_layers.push_back(fit_z);
207 fit_phi_layers.push_back(fit_phi);
209 fit_phi_layers.push_back((std::floor(fit_phi / stripPhiPitch) + 0.5) * stripPhiPitch);
216 if (
phis_.size() >= 3) {
217 float Sxx = 0, Sxy = 0, Sx = 0, Sy = 0,
S = 0;
218 for (
unsigned i = 0;
i <
phis_.size(); ++
i) {
220 Sxx +=
zs_[
i] *
zs_[
i] * sigma2_inv;
223 Sy +=
phis_[
i] * sigma2_inv;
226 float delta =
S * Sxx - Sx * Sx;
237 int index =
id.iChamberType() - 1;
245 const std::vector<int>& subpat = patIndexToPatternDelta[
pattern].at(layer - 1);
249 const int halfStripDelta = halfStrip - keyStrip;
250 return (
std::find(subpat.begin(), subpat.end(), halfStripDelta + 1) != subpat.end()
or
251 std::find(subpat.begin(), subpat.end(), halfStripDelta) != subpat.end()
or
252 std::find(subpat.begin(), subpat.end(), halfStripDelta - 1) != subpat.end());