29 "extraHitRPhitolerance")),
34 caThetaCut(
cfg.getParameter<double>(
"CAThetaCut"),
36 caPhiCut(
cfg.getParameter<double>(
"CAPhiCut"),
38 caHardPtCut(
cfg.getParameter<double>(
"CAHardPtCut")) {
41 if (comparitorName !=
"none") {
47 desc.add<
double>(
"extraHitRPhitolerance", 0.1);
48 desc.add<
bool>(
"fitFastCircle",
false);
49 desc.add<
bool>(
"fitFastCircleChi2Cut",
false);
50 desc.add<
bool>(
"useBendingCorrection",
false);
51 desc.add<
double>(
"CAThetaCut", 0.00125);
52 desc.add<
double>(
"CAPhiCut", 10);
55 validatorCACut.
add<
string>(
"seedingLayers",
"BPix1+BPix2+BPix3");
56 validatorCACut.add<
double>(
"cut", 0.00125);
57 std::vector<edm::ParameterSet> defaultCACutVector;
61 defaultCACutVector.push_back(defaultCACut);
62 desc.addVPSet(
"CAThetaCut_byTriplets", validatorCACut, defaultCACutVector);
63 desc.addVPSet(
"CAPhiCut_byTriplets", validatorCACut, defaultCACutVector);
65 desc.add<
double>(
"CAHardPtCut", 0);
66 desc.addOptional<
bool>(
"CAOnlyOneLastHitPerLayerFilter")
68 "Deprecated and has no effect. To be fully removed later when the parameter is no longer used in HLT "
71 descMaxChi2.
add<
double>(
"pt1", 0.2);
72 descMaxChi2.
add<
double>(
"pt2", 1.5);
73 descMaxChi2.
add<
double>(
"value1", 500);
74 descMaxChi2.
add<
double>(
"value2", 50);
75 descMaxChi2.
add<
bool>(
"enabled",
true);
80 descComparitor.setAllowAnything();
90 for (
unsigned int i = 0;
i <
layers.size();
i++) {
91 for (
unsigned int j = 0;
j < 4; ++
j) {
94 if (foundVertex ==
g.theLayers.end()) {
109 g.theLayerPairs.clear();
110 for (
unsigned int i = 0;
i <
g.theLayers.size();
i++) {
111 g.theLayers[
i].theInnerLayers.clear();
112 g.theLayers[
i].theInnerLayerPairs.clear();
113 g.theLayers[
i].theOuterLayers.clear();
114 g.theLayers[
i].theOuterLayerPairs.clear();
115 for (
auto&
v :
g.theLayers[
i].isOuterHitOfCell)
122 std::vector<const HitDoublets*>& hitDoublets) {
123 for (
unsigned int i = 0;
i <
layers.size();
i++) {
124 for (
unsigned int j = 0;
j < 4; ++
j) {
127 if (foundVertex ==
g.theLayers.end()) {
134 auto innerVertex =
std::find(
g.theLayers.begin(),
g.theLayers.end(),
layers[
i][
j - 1].name());
138 if (
std::find(
g.theLayerPairs.begin(),
g.theLayerPairs.end(), tmpInnerLayerPair) ==
g.theLayerPairs.end()) {
139 auto found = std::find_if(regionLayerPairs.
begin(),
140 regionLayerPairs.
end(),
142 return pair.innerLayerIndex() ==
layers[
i][
j - 1].index() &&
143 pair.outerLayerIndex() ==
layers[
i][
j].index();
145 if (
found != regionLayerPairs.
end()) {
146 hitDoublets.emplace_back(&(
found->doublets()));
147 g.theLayerPairs.push_back(tmpInnerLayerPair);
148 g.theLayers[
vertexIndex].theInnerLayers.push_back(innerVertex -
g.theLayers.begin());
149 innerVertex->theOuterLayers.push_back(
vertexIndex);
150 g.theLayers[
vertexIndex].theInnerLayerPairs.push_back(
g.theLayerPairs.size() - 1);
151 innerVertex->theOuterLayerPairs.push_back(
g.theLayerPairs.size() - 1);
161 std::vector<OrderedHitSeeds>&
result,
166 std::vector<const HitDoublets*> hitDoublets;
168 const int numberOfHitsInNtuplet = 4;
169 std::vector<CACell::CAntuplet> foundQuadruplets;
172 for (
const auto& regionLayerPairs : regionDoublets) {
175 foundQuadruplets.clear();
177 createGraphStructure(
layers,
g);
181 clearGraphStructure(
layers,
g);
184 fillGraph(
layers, regionLayerPairs,
g, hitDoublets);
190 ca.
evolve(numberOfHitsInNtuplet);
192 ca.
findNtuplets(foundQuadruplets, numberOfHitsInNtuplet);
199 std::array<float, 4> bc_r;
200 std::array<float, 4> bc_z;
201 std::array<float, 4> bc_errZ2;
202 std::array<GlobalPoint, 4> gps;
203 std::array<GlobalError, 4> ges;
204 std::array<bool, 4> barrels;
206 unsigned int numberOfFoundQuadruplets = foundQuadruplets.size();
209 for (
unsigned int quadId = 0; quadId < numberOfFoundQuadruplets; ++quadId) {
211 for (
unsigned int i = 0;
i < 3; ++
i) {
212 auto const& ahit = allCells[foundQuadruplets[quadId][
i]].getInnerHit();
213 gps[
i] = ahit->globalPosition();
214 ges[
i] = ahit->globalPositionError();
215 barrels[
i] =
isBarrel(ahit->geographicalId().subdetId());
218 auto const& ahit = allCells[foundQuadruplets[quadId][2]].getOuterHit();
219 gps[3] = ahit->globalPosition();
220 ges[3] = ahit->globalPositionError();
221 barrels[3] =
isBarrel(ahit->geographicalId().subdetId());
229 const float thisMaxChi2 = maxChi2Eval.
value(abscurv);
231 SeedingHitSet tmpTriplet(allCells[foundQuadruplets[quadId][0]].getInnerHit(),
232 allCells[foundQuadruplets[quadId][2]].getInnerHit(),
233 allCells[foundQuadruplets[quadId][2]].getOuterHit());
240 float chi2 = std::numeric_limits<float>::quiet_NaN();
244 const float simpleCot = (gps.back().z() - gps.front().z()) / (gps.back().perp() - gps.front().perp());
246 for (
int i = 0;
i < 4; ++
i) {
257 RZLine rzLine(gps, ges, barrels);
273 result[
index].emplace_back(allCells[foundQuadruplets[quadId][0]].getInnerHit(),
274 allCells[foundQuadruplets[quadId][1]].getInnerHit(),
275 allCells[foundQuadruplets[quadId][2]].getInnerHit(),
276 allCells[foundQuadruplets[quadId][2]].getOuterHit());