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) {
96 if (foundVertex ==
g.theLayers.end()) {
111 g.theLayerPairs.clear();
112 for (
unsigned int i = 0;
i <
g.theLayers.size();
i++) {
113 g.theLayers[
i].theInnerLayers.clear();
114 g.theLayers[
i].theInnerLayerPairs.clear();
115 g.theLayers[
i].theOuterLayers.clear();
116 g.theLayers[
i].theOuterLayerPairs.clear();
117 for (
auto&
v :
g.theLayers[
i].isOuterHitOfCell)
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) {
129 if (foundVertex ==
g.theLayers.end()) {
136 auto innerVertex =
std::find(
g.theLayers.begin(),
g.theLayers.end(),
layers[
i][
j - 1].name());
140 if (
std::find(
g.theLayerPairs.begin(),
g.theLayerPairs.end(), tmpInnerLayerPair) ==
g.theLayerPairs.end()) {
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()));
149 g.theLayerPairs.push_back(tmpInnerLayerPair);
150 g.theLayers[
vertexIndex].theInnerLayers.push_back(innerVertex -
g.theLayers.begin());
151 innerVertex->theOuterLayers.push_back(
vertexIndex);
152 g.theLayers[
vertexIndex].theInnerLayerPairs.push_back(
g.theLayerPairs.size() - 1);
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());
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) {
258 RZLine rzLine(gps, ges, barrels);
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());
T getParameter(std::string const &) const
void findNtuplets(std::vector< CACell::CAntuplet > &, const unsigned int)
void setCutValuesByLayerIds(CAGraph &caLayers)
const bool useBendingCorrection
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
float value(float curvature) const
constexpr bool isNotFinite(T x)
std::vector< CACell > & getAllCells()
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
T curvature(T InversePt, const MagneticField &field)
const_iterator begin() const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken
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
const MagneticField * theField
const TrackingRegion & region() const
T inversePt(T curvature, const MagneticField &field)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const bool fitFastCircleChi2Cut
CAHitQuadrupletGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
const QuantityDependsPt maxChi2
QuantityDependsPtEval evaluator(const MagneticField &field) const
void createAndConnectCells(const std::vector< const HitDoublets *> &, const TrackingRegion &, const CACut &, const CACut &, const float)
Square< F >::type sqr(const F &f)
void hitNtuplets(const IntermediateHitDoublets ®ionDoublets, std::vector< OrderedHitSeeds > &result, const SeedingLayerSetsHits &layers)
static void fillDescriptions(edm::ParameterSetDescription &desc)
*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)
const_iterator end() const