244 std::vector<const HitDoublets *> hitDoublets;
255 const int numberOfHitsInNtuplet = 4;
256 std::vector<CACell::CAntuplet> foundQuadruplets;
261 for(
const auto& regionLayerPairs: regionDoublets) {
265 foundQuadruplets.clear();
267 createGraphStructure(layers, g);
270 clearGraphStructure(layers, g);
273 fillGraph(layers, g, hitDoublets,
276 std::vector<const HitDoublets *>& hitDoublets) {
278 auto found = std::find_if(regionLayerPairs.begin(), regionLayerPairs.end(),
279 std::bind(layerPairEqual, _1, inner.
index(), outer.
index()));
280 if(
found != regionLayerPairs.end()) {
281 hitDoublets.emplace_back(&(
found->doublets()));
289 ca.createAndConnectCells(hitDoublets, region,
caThetaCut,
292 ca.evolve(numberOfHitsInNtuplet);
294 ca.findNtuplets(foundQuadruplets, numberOfHitsInNtuplet);
296 auto & allCells = ca.getAllCells();
301 std::array<float, 4> bc_r;
302 std::array<float, 4> bc_z;
303 std::array<float, 4> bc_errZ2;
304 std::array<GlobalPoint, 4> gps;
305 std::array<GlobalError, 4> ges;
306 std::array<bool, 4> barrels;
307 bool hasAlreadyPushedACandidate =
false;
309 unsigned int previousfourthLayerId = 0;
310 std::array<unsigned int, 2> previousCellIds ={{0,0}};
311 unsigned int previousSideId = 0;
312 int previousSubDetId = 0;
314 unsigned int numberOfFoundQuadruplets = foundQuadruplets.size();
317 for (
unsigned int quadId = 0; quadId < numberOfFoundQuadruplets; ++quadId)
324 for(
unsigned int i = 0;
i< 3; ++
i)
326 auto const& ahit = allCells[foundQuadruplets[quadId][
i]].getInnerHit();
327 gps[
i] = ahit->globalPosition();
328 ges[
i] = ahit->globalPositionError();
329 barrels[
i] =
isBarrel(ahit->geographicalId().subdetId());
332 auto const& ahit = allCells[foundQuadruplets[quadId][2]].getOuterHit();
333 gps[3] = ahit->globalPosition();
334 ges[3] = ahit->globalPositionError();
335 barrels[3] =
isBarrel(ahit->geographicalId().subdetId());
338 const auto fourthLayerId = tTopo->
layer(ahit->geographicalId());
339 const auto sideId = tTopo->
side(ahit->geographicalId());
340 const auto subDetId = ahit->geographicalId().subdetId();
341 const auto isTheSameTriplet = (quadId != 0) && (foundQuadruplets[quadId][0] == previousCellIds[0]) && (foundQuadruplets[quadId][1] == previousCellIds[1]);
342 const auto isTheSameFourthLayer = (quadId != 0) && (fourthLayerId == previousfourthLayerId) && (
subDetId == previousSubDetId) && (sideId == previousSideId);
344 previousCellIds = {{foundQuadruplets[quadId][0], foundQuadruplets[quadId][1]}};
345 previousfourthLayerId = fourthLayerId;
348 if(!(isTheSameTriplet && isTheSameFourthLayer ))
351 hasAlreadyPushedACandidate =
false;
363 const float abscurv =
std::abs(curvature);
364 const float thisMaxChi2 = maxChi2Eval.value(abscurv);
367 SeedingHitSet tmpTriplet(allCells[foundQuadruplets[quadId][0]].getInnerHit(),
368 allCells[foundQuadruplets[quadId][2]].getInnerHit(),
369 allCells[foundQuadruplets[quadId][2]].getOuterHit());
378 float chi2 = std::numeric_limits<float>::quiet_NaN();
383 const float simpleCot = ( gps.back().z() - gps.front().z() ) / (gps.back().perp() - gps.front().perp() );
385 for (
int i=0;
i < 4; ++
i)
391 bc_z[
i] = point.
z() - region.
origin().
z();
392 bc_errZ2[
i] = (barrels[
i]) ? error.
czz() : error.
rerr(point)*
sqr(simpleCot);
395 chi2 = rzLine.chi2();
399 RZLine rzLine(gps, ges, barrels);
400 chi2 = rzLine.chi2();
417 if (chi2 < selectedChi2)
420 if(hasAlreadyPushedACandidate)
424 result[
index].emplace_back(allCells[foundQuadruplets[quadId][0]].getInnerHit(),
425 allCells[foundQuadruplets[quadId][1]].getInnerHit(),
426 allCells[foundQuadruplets[quadId][2]].getInnerHit(),
427 allCells[foundQuadruplets[quadId][2]].getOuterHit());
428 hasAlreadyPushedACandidate =
true;
433 result[
index].emplace_back(allCells[foundQuadruplets[quadId][0]].getInnerHit(),
434 allCells[foundQuadruplets[quadId][1]].getInnerHit(),
435 allCells[foundQuadruplets[quadId][2]].getInnerHit(),
436 allCells[foundQuadruplets[quadId][2]].getOuterHit());
const bool useBendingCorrection
GlobalPoint const & origin() const
unsigned int side(const DetId &id) const
std::unique_ptr< SeedComparitor > theComparitor
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
T inversePt(T curvature, const edm::EventSetup &iSetup)
unsigned int subDetId[21]
T curvature(T InversePt, const edm::EventSetup &iSetup)
Abs< T >::type abs(const T &t)
const float extraHitRPhitolerance
const bool fitFastCircleChi2Cut
unsigned short LayerIndex
const QuantityDependsPt maxChi2
T rerr(const GlobalPoint &aPoint) const
unsigned int layer(const DetId &id) const
Square< F >::type sqr(const F &f)
const bool caOnlyOneLastHitPerLayerFilter
QuantityDependsPtEval evaluator(const edm::EventSetup &es) const
T const * product() const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point