8 :
MeasurementDet(gdet), thePixelCPE(cpe), theLowerDet(nullptr), theUpperDet(nullptr) {}
16 "TkStackMeasurementDet ERROR: Trying to glue a det which is not a TkPhase2OTMeasurementDet");
24 if (
data.phase2OTVectorHits().empty())
26 LogTrace(
"MeasurementTracker") <<
" is not empty";
29 LogTrace(
"MeasurementTracker") <<
" and is active";
34 std::vector<bool> skipClustersUpper(
data.phase2OTClustersToSkip().empty() ? 0 : upperDetSet.
size(),
false);
35 std::vector<bool> skipClustersLower(
data.phase2OTClustersToSkip().empty() ? 0 : lowerDetSet.
size(),
false);
38 if (!
data.phase2OTData().handle()->data().empty()) {
39 begin = &(
data.phase2OTData().handle()->data().front());
41 if (!
data.phase2OTClustersToSkip().empty()) {
42 if (!lowerDetSet.
empty()) {
45 edm::LogError(
"IndexMisMatch") <<
"TkStackMeasurementDet cannot create hit because of index mismatch.";
48 unsigned int indexl = cil - begin;
49 if (
data.phase2OTClustersToSkip()[indexl]) {
51 skipClustersLower[iLocalL] =
true;
55 if (!upperDetSet.
empty()) {
58 edm::LogError(
"IndexMisMatch") <<
"TkStackMeasurementDet cannot create hit because of index mismatch.";
61 unsigned int indexu = ciu - begin;
62 if (
data.phase2OTClustersToSkip()[indexu]) {
64 skipClustersUpper[iLocalU] =
true;
71 auto iterator =
data.phase2OTVectorHits().find(detIdStack);
72 if (iterator ==
data.phase2OTVectorHits().end())
74 for (
const auto& vecHit :
data.phase2OTVectorHits()[detIdStack]) {
75 if (!
data.phase2OTClustersToSkip().empty()) {
76 if (skipClustersLower[vecHit.lowerCluster().key() - lowerDetSet.
offset()])
78 if (skipClustersUpper[vecHit.upperCluster().key() - upperDetSet.
offset()])
81 result.push_back(std::make_shared<VectorHit>(vecHit));
84 iterator =
data.phase2OTVectorHitsRej().find(detIdStack);
85 if (iterator ==
data.phase2OTVectorHitsRej().end())
87 for (
const auto& vecHit :
data.phase2OTVectorHitsRej()[detIdStack]) {
88 if (!
data.phase2OTClustersToSkip().empty()) {
89 if (skipClustersLower[vecHit.lowerCluster().key() - lowerDetSet.
offset()])
91 if (skipClustersUpper[vecHit.upperCluster().key() - upperDetSet.
offset()])
94 result.push_back(std::make_shared<VectorHit>(vecHit));
104 LogDebug(
"MeasurementTracker") <<
"TkStackMeasurementDet::measurements";
111 LogTrace(
"MeasurementTracker") <<
" is active";
113 auto oldSize =
result.size();
116 for (
auto&&
hit : allHits) {
117 std::pair<bool, double> diffEst = est.
estimate(stateOnThisDet, *
hit);
119 LogDebug(
"MeasurementTracker") <<
"New vh added with chi2: " << diffEst.second;
124 if (
result.size() > oldSize)
129 LogDebug(
"MeasurementTracker") <<
"adding missing hit";