29 "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.1);
46 desc.
add<
bool>(
"fitFastCircle",
false);
47 desc.
add<
bool>(
"fitFastCircleChi2Cut",
false);
48 desc.
add<
bool>(
"useBendingCorrection",
false);
49 desc.
add<
double>(
"CAThetaCut", 0.00125);
50 desc.
add<
double>(
"CAPhiCut", 10);
51 desc.
add<
double>(
"CAHardPtCut", 0);
52 desc.
addOptional<
bool>(
"CAOnlyOneLastHitPerLayerFilter")
54 "Deprecated and has no effect. To be fully removed later when the parameter is no longer used in HLT "
57 descMaxChi2.
add<
double>(
"pt1", 0.2);
58 descMaxChi2.
add<
double>(
"pt2", 1.5);
59 descMaxChi2.
add<
double>(
"value1", 500);
60 descMaxChi2.
add<
double>(
"value2", 50);
61 descMaxChi2.
add<
bool>(
"enabled",
true);
66 descComparitor.setAllowAnything();
76 for (
unsigned int i = 0;
i <
layers.size();
i++) {
77 for (
unsigned int j = 0;
j < 4; ++
j) {
80 if (foundVertex ==
g.theLayers.end()) {
95 g.theLayerPairs.clear();
96 for (
unsigned int i = 0;
i <
g.theLayers.size();
i++) {
97 g.theLayers[
i].theInnerLayers.clear();
98 g.theLayers[
i].theInnerLayerPairs.clear();
99 g.theLayers[
i].theOuterLayers.clear();
100 g.theLayers[
i].theOuterLayerPairs.clear();
101 for (
auto&
v :
g.theLayers[
i].isOuterHitOfCell)
108 std::vector<const HitDoublets*>& hitDoublets) {
109 for (
unsigned int i = 0;
i <
layers.size();
i++) {
110 for (
unsigned int j = 0;
j < 4; ++
j) {
113 if (foundVertex ==
g.theLayers.end()) {
120 auto innerVertex =
std::find(
g.theLayers.begin(),
g.theLayers.end(),
layers[
i][
j - 1].name());
124 if (
std::find(
g.theLayerPairs.begin(),
g.theLayerPairs.end(), tmpInnerLayerPair) ==
g.theLayerPairs.end()) {
125 auto found = std::find_if(regionLayerPairs.
begin(),
126 regionLayerPairs.
end(),
128 return pair.innerLayerIndex() ==
layers[
i][
j - 1].index() &&
129 pair.outerLayerIndex() ==
layers[
i][
j].index();
131 if (
found != regionLayerPairs.
end()) {
132 hitDoublets.emplace_back(&(
found->doublets()));
133 g.theLayerPairs.push_back(tmpInnerLayerPair);
134 g.theLayers[
vertexIndex].theInnerLayers.push_back(innerVertex -
g.theLayers.begin());
135 innerVertex->theOuterLayers.push_back(
vertexIndex);
136 g.theLayers[
vertexIndex].theInnerLayerPairs.push_back(
g.theLayerPairs.size() - 1);
137 innerVertex->theOuterLayerPairs.push_back(
g.theLayerPairs.size() - 1);
147 std::vector<OrderedHitSeeds>&
result,
152 std::vector<const HitDoublets*> hitDoublets;
154 const int numberOfHitsInNtuplet = 4;
155 std::vector<CACell::CAntuplet> foundQuadruplets;
158 for (
const auto& regionLayerPairs : regionDoublets) {
161 foundQuadruplets.clear();
163 createGraphStructure(
layers,
g);
165 clearGraphStructure(
layers,
g);
168 fillGraph(
layers, regionLayerPairs,
g, hitDoublets);
174 ca.
evolve(numberOfHitsInNtuplet);
176 ca.
findNtuplets(foundQuadruplets, numberOfHitsInNtuplet);
183 std::array<float, 4> bc_r;
184 std::array<float, 4> bc_z;
185 std::array<float, 4> bc_errZ2;
186 std::array<GlobalPoint, 4> gps;
187 std::array<GlobalError, 4> ges;
188 std::array<bool, 4> barrels;
190 unsigned int numberOfFoundQuadruplets = foundQuadruplets.size();
193 for (
unsigned int quadId = 0; quadId < numberOfFoundQuadruplets; ++quadId) {
195 for (
unsigned int i = 0;
i < 3; ++
i) {
196 auto const& ahit = allCells[foundQuadruplets[quadId][
i]].getInnerHit();
197 gps[
i] = ahit->globalPosition();
198 ges[
i] = ahit->globalPositionError();
199 barrels[
i] =
isBarrel(ahit->geographicalId().subdetId());
202 auto const& ahit = allCells[foundQuadruplets[quadId][2]].getOuterHit();
203 gps[3] = ahit->globalPosition();
204 ges[3] = ahit->globalPositionError();
205 barrels[3] =
isBarrel(ahit->geographicalId().subdetId());
213 const float thisMaxChi2 = maxChi2Eval.
value(abscurv);
215 SeedingHitSet tmpTriplet(allCells[foundQuadruplets[quadId][0]].getInnerHit(),
216 allCells[foundQuadruplets[quadId][2]].getInnerHit(),
217 allCells[foundQuadruplets[quadId][2]].getOuterHit());
224 float chi2 = std::numeric_limits<float>::quiet_NaN();
228 const float simpleCot = (gps.back().z() - gps.front().z()) / (gps.back().perp() - gps.front().perp());
230 for (
int i = 0;
i < 4; ++
i) {
241 RZLine rzLine(gps, ges, barrels);
257 result[
index].emplace_back(allCells[foundQuadruplets[quadId][0]].getInnerHit(),
258 allCells[foundQuadruplets[quadId][1]].getInnerHit(),
259 allCells[foundQuadruplets[quadId][2]].getInnerHit(),
260 allCells[foundQuadruplets[quadId][2]].getOuterHit());