28 std::vector<weightedTrajectorySeed> *candidateweightedRef) {
40 cout <<
"Configuration or IO is not set yet" << endl;
50 std::vector<weightedTrajectorySeed> *weightedSeedsRef) {
51 std::vector<weightedTrajectorySeed> sortweightedSeeds;
52 std::vector<weightedTrajectorySeed> tempweightedSeeds;
53 std::vector<TrackingRecHit const *> tempRecHits;
55 while (!weightedSeedsRef->empty()) {
56 cout <<
"Finding the weighted seeds group from " << weightedSeedsRef->size() <<
" seeds which share some recHits" 60 tempweightedSeeds.clear();
62 for (vector<weightedTrajectorySeed>::iterator itweightedseed = weightedSeedsRef->begin();
63 itweightedseed != weightedSeedsRef->end();
65 auto const &recHitsRange = itweightedseed->first.recHits();
67 cout <<
"Always take the 1st weighted seed to be the referrence." << endl;
68 for (
auto const &
hit : recHitsRange) {
69 cout <<
"Put its recHits to tempRecHits" << endl;
70 tempRecHits.push_back(&
hit);
72 cout <<
"Put it to tempweightedSeeds" << endl;
73 tempweightedSeeds.push_back(*itweightedseed);
74 cout <<
"Then erase from weightedSeedsRef->" << endl;
75 itweightedseed = weightedSeedsRef->erase(itweightedseed);
77 cout <<
"Come to other weighted seed for checking " << itweightedseed->first.nHits() <<
" recHits from " 78 << tempRecHits.size() <<
" temp recHits" << endl;
79 unsigned int ShareRecHitsNumber = 0;
80 for (
auto const &
hit : recHitsRange) {
85 cout <<
"This seed is found to belong to current share group" << endl;
86 for (
auto const &
hit : recHitsRange) {
88 cout <<
"Put its extra recHits to tempRecHits" << endl;
89 tempRecHits.push_back(&
hit);
92 cout <<
"Put it to tempSeeds" << endl;
93 tempweightedSeeds.push_back(*itweightedseed);
94 cout <<
"Then erase from SeedsRef" << endl;
95 itweightedseed = weightedSeedsRef->erase(itweightedseed);
103 vector<weightedTrajectorySeed>::iterator bestweightediter;
106 unsigned NumberofHits = 0;
107 cout <<
"Find " << tempweightedSeeds.size() <<
" seeds into one trajectory group" << endl;
108 for (vector<weightedTrajectorySeed>::iterator itweightedseed = tempweightedSeeds.begin();
109 itweightedseed != tempweightedSeeds.end();
111 unsigned int nHits = itweightedseed->first.nHits();
114 double weightedQuality = itweightedseed->second;
115 cout <<
"Find a weighted seed with quality " << weightedQuality << endl;
116 if ((NumberofHits <
nHits) || (NumberofHits ==
nHits && weightedQuality <
Quality)) {
117 NumberofHits =
nHits;
119 bestweightedSeed = *itweightedseed;
120 bestweightediter = itweightedseed;
123 cout <<
"Best good temp seed's quality is " <<
Quality << endl;
124 sortweightedSeeds.push_back(bestweightedSeed);
125 tempweightedSeeds.erase(bestweightediter);
128 for (
auto const &
hit : bestweightedSeed.first.recHits()) {
129 tempRecHits.push_back(&
hit);
132 for (vector<weightedTrajectorySeed>::iterator itweightedseed = tempweightedSeeds.begin();
133 itweightedseed != tempweightedSeeds.end();) {
134 cout <<
"Checking the temp weighted seed's " << itweightedseed->first.nHits() <<
" hits to " << tempRecHits.size()
135 <<
" temp recHits" << endl;
136 bool isShare =
false;
137 for (
auto const &
hit : itweightedseed->first.recHits()) {
142 if (isShare ==
true) {
143 cout <<
"Find one temp seed share some recHits with best weighted seed" << endl;
144 itweightedseed = tempweightedSeeds.erase(itweightedseed);
146 cout <<
"This seed has no relation with best weighted seed" << endl;
147 weightedSeedsRef->push_back(*itweightedseed);
148 itweightedseed = tempweightedSeeds.erase(itweightedseed);
153 weightedSeedsRef->clear();
154 *weightedSeedsRef = sortweightedSeeds;
160 bool istheSame =
false;
162 cout <<
"Checking from " <<
recHits.size() <<
" temp recHits" << endl;
165 DetId RPCId1 =
hit.geographicalId();
168 cout <<
"The hit's position: " << gpos1.
x() <<
", " << gpos1.
y() <<
", " << gpos1.
z() << endl;
170 cout <<
"Checking the " << (
n++) <<
" th recHit from tempRecHits" << endl;
175 cout <<
"The temp hit's position: " << gpos2.
x() <<
", " << gpos2.
y() <<
", " << gpos2.
z() << endl;
177 if ((gpos1.
x() == gpos2.
x()) && (gpos1.
y() == gpos2.
y()) && (gpos1.
z() == gpos2.
z())) {
178 cout <<
"This hit is found to be the same" << endl;
void setGeometry(const RPCGeometry &iGeom)
T getParameter(std::string const &) const
bool isShareHit(const std::vector< TrackingRecHit const *> &RecHits, const TrackingRecHit &hit, const RPCGeometry &rpcGeometry)
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
bool isCheckcandidateOverlap
std::vector< weightedTrajectorySeed > * candidateweightedSeedsRef
std::vector< weightedTrajectorySeed > * goodweightedSeedsRef
RPCSeedPattern::weightedTrajectorySeed weightedTrajectorySeed
unsigned int ShareRecHitsNumberThreshold
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
void configure(const edm::ParameterSet &iConfig)
void CheckOverlap(const RPCGeometry &iGeom, std::vector< weightedTrajectorySeed > *SeedsRef)
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
const RPCGeometry * rpcGeometry
void setIO(std::vector< weightedTrajectorySeed > *goodweightedRef, std::vector< weightedTrajectorySeed > *candidateweightedRef)