30 "extraHitRPhitolerance")),
35 caThetaCut(cfg.getParameter<double>(
"CAThetaCut"),
37 caPhiCut(cfg.getParameter<double>(
"CAPhiCut"),
39 caHardPtCut(cfg.getParameter<double>(
"CAHardPtCut")) {
42 if (comparitorName !=
"none") {
48 desc.
add<
double>(
"extraHitRPhitolerance", 0.1);
49 desc.
add<
bool>(
"fitFastCircle",
false);
50 desc.
add<
bool>(
"fitFastCircleChi2Cut",
false);
51 desc.
add<
bool>(
"useBendingCorrection",
false);
52 desc.
add<
double>(
"CAThetaCut", 0.00125);
53 desc.
add<
double>(
"CAPhiCut", 10);
56 validatorCACut.
add<
string>(
"seedingLayers",
"BPix1+BPix2+BPix3");
57 validatorCACut.add<
double>(
"cut", 0.00125);
58 std::vector<edm::ParameterSet> defaultCACutVector;
62 defaultCACutVector.push_back(defaultCACut);
63 desc.
addVPSet(
"CAThetaCut_byTriplets", validatorCACut, defaultCACutVector);
64 desc.
addVPSet(
"CAPhiCut_byTriplets", validatorCACut, defaultCACutVector);
66 desc.
add<
double>(
"CAHardPtCut", 0);
67 desc.
addOptional<
bool>(
"CAOnlyOneLastHitPerLayerFilter")
69 "Deprecated and has no effect. To be fully removed later when the parameter is no longer used in HLT "
72 descMaxChi2.
add<
double>(
"pt1", 0.2);
73 descMaxChi2.
add<
double>(
"pt2", 1.5);
74 descMaxChi2.
add<
double>(
"value1", 500);
75 descMaxChi2.
add<
double>(
"value2", 50);
76 descMaxChi2.
add<
bool>(
"enabled",
true);
81 descComparitor.setAllowAnything();
92 for (
unsigned int i = 0;
i < layers.
size();
i++) {
93 for (
unsigned int j = 0;
j < 4; ++
j) {
100 vertexIndex = foundVertex - g.
theLayers.begin();
124 std::vector<const HitDoublets*>& hitDoublets) {
125 for (
unsigned int i = 0;
i < layers.
size();
i++) {
126 for (
unsigned int j = 0;
j < 4; ++
j) {
127 auto vertexIndex = 0;
132 vertexIndex = foundVertex - g.
theLayers.begin();
141 auto found = std::find_if(regionLayerPairs.
begin(),
142 regionLayerPairs.
end(),
144 return pair.innerLayerIndex() == layers[
i][
j - 1].index() &&
145 pair.outerLayerIndex() == layers[
i][
j].index();
147 if (
found != regionLayerPairs.
end()) {
148 hitDoublets.emplace_back(&(
found->doublets()));
151 innerVertex->theOuterLayers.push_back(vertexIndex);
153 innerVertex->theOuterLayerPairs.push_back(g.
theLayerPairs.size() - 1);
163 std::vector<OrderedHitSeeds>&
result,
167 std::vector<const HitDoublets*> hitDoublets;
169 const int numberOfHitsInNtuplet = 4;
170 std::vector<CACell::CAntuplet> foundQuadruplets;
173 for (
const auto& regionLayerPairs : regionDoublets) {
176 foundQuadruplets.clear();
178 createGraphStructure(layers, g);
182 clearGraphStructure(layers, g);
185 fillGraph(layers, regionLayerPairs, g, hitDoublets);
191 ca.
evolve(numberOfHitsInNtuplet);
193 ca.
findNtuplets(foundQuadruplets, numberOfHitsInNtuplet);
200 std::array<float, 4> bc_r;
201 std::array<float, 4> bc_z;
202 std::array<float, 4> bc_errZ2;
203 std::array<GlobalPoint, 4> gps;
204 std::array<GlobalError, 4> ges;
205 std::array<bool, 4> barrels;
207 unsigned int numberOfFoundQuadruplets = foundQuadruplets.size();
210 for (
unsigned int quadId = 0; quadId < numberOfFoundQuadruplets; ++quadId) {
212 for (
unsigned int i = 0;
i < 3; ++
i) {
213 auto const& ahit = allCells[foundQuadruplets[quadId][
i]].getInnerHit();
214 gps[
i] = ahit->globalPosition();
215 ges[
i] = ahit->globalPositionError();
216 barrels[
i] =
isBarrel(ahit->geographicalId().subdetId());
219 auto const& ahit = allCells[foundQuadruplets[quadId][2]].getOuterHit();
220 gps[3] = ahit->globalPosition();
221 ges[3] = ahit->globalPositionError();
222 barrels[3] =
isBarrel(ahit->geographicalId().subdetId());
229 const float abscurv =
std::abs(curvature);
230 const float thisMaxChi2 = maxChi2Eval.
value(abscurv);
232 SeedingHitSet tmpTriplet(allCells[foundQuadruplets[quadId][0]].getInnerHit(),
233 allCells[foundQuadruplets[quadId][2]].getInnerHit(),
234 allCells[foundQuadruplets[quadId][2]].getOuterHit());
241 float chi2 = std::numeric_limits<float>::quiet_NaN();
245 const float simpleCot = (gps.back().z() - gps.front().z()) / (gps.back().perp() - gps.front().perp());
247 for (
int i = 0;
i < 4; ++
i) {
252 bc_z[
i] = point.
z() - region.
origin().
z();
253 bc_errZ2[
i] = (barrels[
i]) ? error.
czz() : error.
rerr(point) *
sqr(simpleCot);
256 chi2 = rzLine.
chi2();
258 RZLine rzLine(gps, ges, barrels);
259 chi2 = rzLine.
chi2();
274 result[
index].emplace_back(allCells[foundQuadruplets[quadId][0]].getInnerHit(),
275 allCells[foundQuadruplets[quadId][1]].getInnerHit(),
276 allCells[foundQuadruplets[quadId][2]].getInnerHit(),
277 allCells[foundQuadruplets[quadId][2]].getOuterHit());
tuple fitFastCircleChi2Cut
void findNtuplets(std::vector< CACell::CAntuplet > &, const unsigned int)
const edm::EventSetup & c
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
float value(float curvature) const
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
void setCutValuesByLayerIds(CAGraph &caLayers)
const bool useBendingCorrection
const_iterator begin() const
GlobalPoint const & origin() const
uint16_t *__restrict__ id
constexpr bool isNotFinite(T x)
const_iterator end() const
std::vector< CACell > & getAllCells()
void createAndConnectCells(const std::vector< const HitDoublets * > &, const TrackingRegion &, const CACut &, const CACut &, const float)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::unique_ptr< SeedComparitor > theComparitor
static constexpr unsigned int minLayers
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
QuantityDependsPtEval evaluator(const MagneticField &field) const
T curvature(T InversePt, const MagneticField &field)
bool getData(T &iHolder) const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken
std::vector< CALayer > theLayers
void addParameter(std::string const &name, T const &value)
void initEvent(const edm::Event &ev, const edm::EventSetup &es)
Abs< T >::type abs(const T &t)
const float extraHitRPhitolerance
uint16_t const *__restrict__ x
const MagneticField * theField
tuple extraHitRPhitolerance
T inversePt(T curvature, const MagneticField &field)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< CALayerPair > theLayerPairs
const bool fitFastCircleChi2Cut
const TrackingRegion & region() const
tuple useBendingCorrection
CAHitQuadrupletGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
const QuantityDependsPt maxChi2
T rerr(const GlobalPoint &aPoint) const
T getParameter(std::string const &) const
std::vector< int > theRootLayers
void hitNtuplets(const IntermediateHitDoublets ®ionDoublets, std::vector< OrderedHitSeeds > &result, const SeedingLayerSetsHits &layers)
static void fillDescriptions(edm::ParameterSetDescription &desc)
unsigned short size() const
Get the number of SeedingLayerSets.
tuple size
Write out results.
*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
void evolve(const unsigned int)