1 #include <unordered_map>
31 "extraHitRPhitolerance")),
34 caThetaCut(
cfg.getParameter<double>(
"CAThetaCut")),
35 caPhiCut(
cfg.getParameter<double>(
"CAPhiCut")),
36 caHardPtCut(
cfg.getParameter<double>(
"CAHardPtCut")) {
39 if (comparitorName !=
"none") {
45 desc.
add<
double>(
"extraHitRPhitolerance", 0.06);
46 desc.
add<
bool>(
"useBendingCorrection",
false);
47 desc.
add<
double>(
"CAThetaCut", 0.00125);
48 desc.
add<
double>(
"CAPhiCut", 0.1);
49 desc.
add<
double>(
"CAHardPtCut", 0);
52 descMaxChi2.
add<
double>(
"pt1", 0.8);
53 descMaxChi2.add<
double>(
"pt2", 2);
54 descMaxChi2.add<
double>(
"value1", 50);
55 descMaxChi2.add<
double>(
"value2", 8);
56 descMaxChi2.add<
bool>(
"enabled",
true);
61 descComparitor.setAllowAnything();
72 for (
unsigned int i = 0;
i <
layers.size();
i++) {
73 for (
unsigned int j = 0;
j < 3; ++
j) {
76 if (foundVertex ==
g.theLayers.end()) {
92 g.theLayerPairs.clear();
93 for (
unsigned int i = 0;
i <
g.theLayers.size();
i++) {
94 g.theLayers[
i].theInnerLayers.clear();
95 g.theLayers[
i].theInnerLayerPairs.clear();
96 g.theLayers[
i].theOuterLayers.clear();
97 g.theLayers[
i].theOuterLayerPairs.clear();
98 for (
auto&
v :
g.theLayers[
i].isOuterHitOfCell)
106 std::vector<const HitDoublets*>& hitDoublets) {
107 for (
unsigned int i = 0;
i <
layers.size();
i++) {
108 for (
unsigned int j = 0;
j < 3; ++
j) {
112 if (foundVertex ==
g.theLayers.end()) {
119 auto innerVertex =
std::find(
g.theLayers.begin(),
g.theLayers.end(),
layers[
i][
j - 1].name());
123 if (
std::find(
g.theLayerPairs.begin(),
g.theLayerPairs.end(), tmpInnerLayerPair) ==
g.theLayerPairs.end()) {
124 auto found = std::find_if(regionLayerPairs.
begin(),
125 regionLayerPairs.
end(),
127 return pair.innerLayerIndex() ==
layers[
i][
j - 1].index() &&
128 pair.outerLayerIndex() ==
layers[
i][
j].index();
130 if (
found != regionLayerPairs.
end()) {
131 hitDoublets.emplace_back(&(
found->doublets()));
132 g.theLayerPairs.push_back(tmpInnerLayerPair);
133 g.theLayers[
vertexIndex].theInnerLayers.push_back(innerVertex -
g.theLayers.begin());
134 innerVertex->theOuterLayers.push_back(
vertexIndex);
135 g.theLayers[
vertexIndex].theInnerLayerPairs.push_back(
g.theLayerPairs.size() - 1);
136 innerVertex->theOuterLayerPairs.push_back(
g.theLayerPairs.size() - 1);
146 std::vector<OrderedHitSeeds>&
result,
151 std::vector<const HitDoublets*> hitDoublets;
153 std::vector<CACell::CAntuplet> foundTriplets;
156 for (
const auto& regionLayerPairs : regionDoublets) {
159 foundTriplets.clear();
162 createGraphStructure(
layers,
g);
164 clearGraphStructure(
layers,
g);
166 fillGraph(
layers, regionLayerPairs,
g, hitDoublets);
175 std::array<float, 3> bc_r;
176 std::array<float, 3> bc_z;
177 std::array<float, 3> bc_errZ2;
178 std::array<GlobalPoint, 3> gps;
179 std::array<GlobalError, 3> ges;
180 std::array<bool, 3> barrels;
182 unsigned int numberOfFoundTriplets = foundTriplets.size();
183 for (
unsigned int tripletId = 0; tripletId < numberOfFoundTriplets; ++tripletId) {
184 OrderedHitTriplet tmpTriplet(allCells[foundTriplets[tripletId][0]].getInnerHit(),
185 allCells[foundTriplets[tripletId][0]].getOuterHit(),
186 allCells[foundTriplets[tripletId][1]].getOuterHit());
189 for (
unsigned int i = 0;
i < 2; ++
i) {
190 auto const& ahit = allCells[foundTriplets[tripletId][
i]].getInnerHit();
191 gps[
i] = ahit->globalPosition();
192 ges[
i] = ahit->globalPositionError();
193 barrels[
i] =
isBarrel(ahit->geographicalId().subdetId());
196 auto const& ahit = allCells[foundTriplets[tripletId][1]].getOuterHit();
197 gps[2] = ahit->globalPosition();
198 ges[2] = ahit->globalPositionError();
199 barrels[2] =
isBarrel(ahit->geographicalId().subdetId());
205 const float thisMaxChi2 = maxChi2Eval.
value(abscurv);
206 float chi2 = std::numeric_limits<float>::quiet_NaN();
211 const float simpleCot = (gps.back().z() - gps.front().z()) / (gps.back().perp() - gps.front().perp());
213 for (
int i = 0;
i < 3; ++
i) {
224 RZLine rzLine(gps, ges, barrels);