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) {
91 if (foundVertex ==
g.theLayers.end()) {
107 g.theLayerPairs.clear();
108 for (
unsigned int i = 0;
i <
g.theLayers.size();
i++) {
109 g.theLayers[
i].theInnerLayers.clear();
110 g.theLayers[
i].theInnerLayerPairs.clear();
111 g.theLayers[
i].theOuterLayers.clear();
112 g.theLayers[
i].theOuterLayerPairs.clear();
113 for (
auto&
v :
g.theLayers[
i].isOuterHitOfCell)
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) {
127 if (foundVertex ==
g.theLayers.end()) {
134 auto innerVertex =
std::find(
g.theLayers.begin(),
g.theLayers.end(),
layers[
i][
j - 1].name());
138 if (
std::find(
g.theLayerPairs.begin(),
g.theLayerPairs.end(), tmpInnerLayerPair) ==
g.theLayerPairs.end()) {
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()));
147 g.theLayerPairs.push_back(tmpInnerLayerPair);
148 g.theLayers[
vertexIndex].theInnerLayers.push_back(innerVertex -
g.theLayers.begin());
149 innerVertex->theOuterLayers.push_back(
vertexIndex);
150 g.theLayers[
vertexIndex].theInnerLayerPairs.push_back(
g.theLayerPairs.size() - 1);
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());
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);
T getParameter(std::string const &) const
const QuantityDependsPt maxChi2
void setCutValuesByLayerIds(CAGraph &caLayers)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
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)
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)
const_iterator begin() const
const MagneticField * theField
QuantityDependsPtEval evaluator(const MagneticField &field) const
void addParameter(std::string const &name, T const &value)
Abs< T >::type abs(const T &t)
void initEvent(const edm::Event &ev, const edm::EventSetup &es)
const TrackingRegion & region() const
T inversePt(T curvature, const MagneticField &field)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static constexpr unsigned int minLayers
Square< F >::type sqr(const F &f)
static void fillDescriptions(edm::ParameterSetDescription &desc)
const float extraHitRPhitolerance
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken
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)
std::unique_ptr< SeedComparitor > theComparitor
*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
const_iterator end() const
void hitNtuplets(const IntermediateHitDoublets ®ionDoublets, std::vector< OrderedHitSeeds > &result, const SeedingLayerSetsHits &layers)
float value(float curvature) const
Range curvature(double transverseIP) const