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();
87 for (
unsigned int i = 0;
i < layers.
size();
i++) {
88 for (
unsigned int j = 0;
j < 3; ++
j) {
95 vertexIndex = foundVertex - g.
theLayers.begin();
121 std::vector<const HitDoublets*>& hitDoublets) {
122 for (
unsigned int i = 0;
i < layers.
size();
i++) {
123 for (
unsigned int j = 0;
j < 3; ++
j) {
124 auto vertexIndex = 0;
130 vertexIndex = foundVertex - g.
theLayers.begin();
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()));
149 innerVertex->theOuterLayers.push_back(vertexIndex);
151 innerVertex->theOuterLayerPairs.push_back(g.
theLayerPairs.size() - 1);
161 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());
220 const float abscurv =
std::abs(curvature);
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) {
234 bc_z[
i] = point.
z() - region.
origin().
z();
235 bc_errZ2[
i] = (barrels[
i]) ? error.
czz() : error.
rerr(point) *
sqr(simpleCot);
238 chi2 = rzLine.
chi2();
240 RZLine rzLine(gps, ges, barrels);
241 chi2 = rzLine.
chi2();
253 result[
index].emplace_back(tmpTriplet);
const QuantityDependsPt maxChi2
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_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 find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
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
const bool useBendingCorrection
CAHitTripletGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
T curvature(T InversePt, const MagneticField &field)
Range curvature(double transverseIP) const
const MagneticField * theField
bool getData(T &iHolder) const
std::vector< CALayer > theLayers
void addParameter(std::string const &name, T const &value)
Abs< T >::type abs(const T &t)
uint16_t const *__restrict__ x
void initEvent(const edm::Event &ev, const edm::EventSetup &es)
tuple extraHitRPhitolerance
T inversePt(T curvature, const MagneticField &field)
float value(float curvature) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< CALayerPair > theLayerPairs
const TrackingRegion & region() const
tuple useBendingCorrection
T rerr(const GlobalPoint &aPoint) const
static constexpr unsigned int minLayers
T getParameter(std::string const &) const
std::vector< int > theRootLayers
static void fillDescriptions(edm::ParameterSetDescription &desc)
const float extraHitRPhitolerance
QuantityDependsPtEval evaluator(const MagneticField &field) const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken
std::unique_ptr< SeedComparitor > theComparitor
unsigned short size() const
Get the number of SeedingLayerSets.
void findTriplets(const std::vector< const HitDoublets * > &hitDoublets, std::vector< CACell::CAntuplet > &foundTriplets, const TrackingRegion ®ion, const CACut &thetaCut, const CACut &phiCut, const float hardPtCut)
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 hitNtuplets(const IntermediateHitDoublets ®ionDoublets, std::vector< OrderedHitSeeds > &result, const SeedingLayerSetsHits &layers)