1 #include <unordered_map>
31 "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.06);
48 desc.add<
bool>(
"useBendingCorrection",
false);
49 desc.add<
double>(
"CAThetaCut", 0.00125);
50 desc.add<
double>(
"CAPhiCut", 0.1);
53 validatorCACut.
add<
string>(
"seedingLayers",
"BPix1+BPix2+BPix3");
54 validatorCACut.
add<
double>(
"cut", 0.00125);
55 std::vector<edm::ParameterSet> defaultCACutVector;
59 defaultCACutVector.push_back(defaultCACut);
60 desc.addVPSet(
"CAThetaCut_byTriplets", validatorCACut, defaultCACutVector);
61 desc.addVPSet(
"CAPhiCut_byTriplets", validatorCACut, defaultCACutVector);
63 desc.add<
double>(
"CAHardPtCut", 0);
66 descMaxChi2.
add<
double>(
"pt1", 0.8);
67 descMaxChi2.add<
double>(
"pt2", 2);
68 descMaxChi2.add<
double>(
"value1", 50);
69 descMaxChi2.add<
double>(
"value2", 8);
70 descMaxChi2.add<
bool>(
"enabled",
true);
75 descComparitor.setAllowAnything();
86 for (
unsigned int i = 0;
i <
layers.size();
i++) {
87 for (
unsigned int j = 0;
j < 3; ++
j) {
90 if (foundVertex ==
g.theLayers.end()) {
106 g.theLayerPairs.clear();
107 for (
unsigned int i = 0;
i <
g.theLayers.size();
i++) {
108 g.theLayers[
i].theInnerLayers.clear();
109 g.theLayers[
i].theInnerLayerPairs.clear();
110 g.theLayers[
i].theOuterLayers.clear();
111 g.theLayers[
i].theOuterLayerPairs.clear();
112 for (
auto&
v :
g.theLayers[
i].isOuterHitOfCell)
120 std::vector<const HitDoublets*>& hitDoublets) {
121 for (
unsigned int i = 0;
i <
layers.size();
i++) {
122 for (
unsigned int j = 0;
j < 3; ++
j) {
126 if (foundVertex ==
g.theLayers.end()) {
133 auto innerVertex =
std::find(
g.theLayers.begin(),
g.theLayers.end(),
layers[
i][
j - 1].name());
137 if (
std::find(
g.theLayerPairs.begin(),
g.theLayerPairs.end(), tmpInnerLayerPair) ==
g.theLayerPairs.end()) {
138 auto found = std::find_if(regionLayerPairs.
begin(),
139 regionLayerPairs.
end(),
141 return pair.innerLayerIndex() ==
layers[
i][
j - 1].index() &&
142 pair.outerLayerIndex() ==
layers[
i][
j].index();
144 if (
found != regionLayerPairs.
end()) {
145 hitDoublets.emplace_back(&(
found->doublets()));
146 g.theLayerPairs.push_back(tmpInnerLayerPair);
147 g.theLayers[
vertexIndex].theInnerLayers.push_back(innerVertex -
g.theLayers.begin());
148 innerVertex->theOuterLayers.push_back(
vertexIndex);
149 g.theLayers[
vertexIndex].theInnerLayerPairs.push_back(
g.theLayerPairs.size() - 1);
150 innerVertex->theOuterLayerPairs.push_back(
g.theLayerPairs.size() - 1);
160 std::vector<OrderedHitSeeds>&
result,
165 std::vector<const HitDoublets*> hitDoublets;
167 std::vector<CACell::CAntuplet> foundTriplets;
170 for (
const auto& regionLayerPairs : regionDoublets) {
173 foundTriplets.clear();
176 createGraphStructure(
layers,
g);
180 clearGraphStructure(
layers,
g);
182 fillGraph(
layers, regionLayerPairs,
g, hitDoublets);
191 std::array<float, 3> bc_r;
192 std::array<float, 3> bc_z;
193 std::array<float, 3> bc_errZ2;
194 std::array<GlobalPoint, 3> gps;
195 std::array<GlobalError, 3> ges;
196 std::array<bool, 3> barrels;
198 unsigned int numberOfFoundTriplets = foundTriplets.size();
199 for (
unsigned int tripletId = 0; tripletId < numberOfFoundTriplets; ++tripletId) {
200 OrderedHitTriplet tmpTriplet(allCells[foundTriplets[tripletId][0]].getInnerHit(),
201 allCells[foundTriplets[tripletId][0]].getOuterHit(),
202 allCells[foundTriplets[tripletId][1]].getOuterHit());
205 for (
unsigned int i = 0;
i < 2; ++
i) {
206 auto const& ahit = allCells[foundTriplets[tripletId][
i]].getInnerHit();
207 gps[
i] = ahit->globalPosition();
208 ges[
i] = ahit->globalPositionError();
209 barrels[
i] =
isBarrel(ahit->geographicalId().subdetId());
212 auto const& ahit = allCells[foundTriplets[tripletId][1]].getOuterHit();
213 gps[2] = ahit->globalPosition();
214 ges[2] = ahit->globalPositionError();
215 barrels[2] =
isBarrel(ahit->geographicalId().subdetId());
221 const float thisMaxChi2 = maxChi2Eval.
value(abscurv);
222 float chi2 = std::numeric_limits<float>::quiet_NaN();
227 const float simpleCot = (gps.back().z() - gps.front().z()) / (gps.back().perp() - gps.front().perp());
229 for (
int i = 0;
i < 3; ++
i) {
240 RZLine rzLine(gps, ges, barrels);