31 if (
i1.subdetId() !=
i2.subdetId()) {
53 if (
a->geographicalId() <
b->geographicalId())
55 if (
b->geographicalId() <
a->geographicalId())
58 if (
a->localPosition().x() <
b->localPosition().x() - 1
e-5)
60 if (
b->localPosition().x() <
a->localPosition().x() - 1
e-5)
63 if (
a->localPosition().y() <
b->localPosition().y() - 1
e-5)
65 if (
b->localPosition().y() <
a->localPosition().y() - 1
e-5)
80 if (
a->geographicalId() !=
b->geographicalId())
83 if (fabs(
a->localPosition().x() -
b->localPosition().x()) < 1
e-5 &&
84 fabs(
a->localPosition().y() -
b->localPosition().y()) < 1
e-5)
93 if (
i1.subdetId() !=
i2.subdetId())
104 constexpr
int max[4] = {20, 32, 44, 64};
107 if (dphi >
max[aLayer] / 2)
108 dphi =
max[aLayer] - dphi;
112 if (dphi == 1 &&
dz <= 1)
120 constexpr
int max = 24;
127 if (dphi <= 1 &&
dr <= 1 && !(dphi == 0 &&
dr == 0))
136 const vector<const TrackingRecHit *> &recHitsB)
const {
139 for (vector<const TrackingRecHit *>::const_iterator recHitA = recHitsA.begin(); recHitA != recHitsA.end(); recHitA++)
140 for (vector<const TrackingRecHit *>::const_iterator recHitB = recHitsB.begin(); recHitB != recHitsB.end();
142 if (!
areSame(*recHitA, *recHitB))
143 if (!
isCompatible((*recHitA)->geographicalId(), (*recHitB)->geographicalId()))
154 typedef map<const TrackingRecHit *, vector<unsigned int>,
HitComparator> RecHitMap;
160 LogTrace(
"MinBiasTracking") <<
" [TrackCleaner] initial tracks : " <<
tracks.size();
162 for (
unsigned int i = 0;
i <
tracks.size();
i++)
176 for (
unsigned int i = 0;
i <
tracks.size();
i++)
185 typedef map<unsigned int, int, less<unsigned int> > TrackMap;
187 for (
unsigned int i = 0;
i <
tracks.size();
i++) {
205 vector<unsigned int> sharing = recHitMap[*
recHit];
207 for (vector<unsigned int>::iterator
j = sharing.begin();
j != sharing.end();
j++)
213 for (TrackMap::iterator sharing = trackMap.begin(); sharing != trackMap.end(); sharing++) {
214 unsigned int j = (*sharing).first;
228 for (vector<const TrackingRecHit *>::const_iterator recHitA =
tracks[
i].
second.begin();
229 recHitA !=
tracks[
i].second.end();
236 recHitMap[*
recHit].push_back(
i);
244 LogTrace(
"TrackCleaner") <<
" Merge #" <<
i <<
" #" <<
j <<
", first now has " 257 LogTrace(
"TrackCleaner") <<
" Clash #" <<
i <<
" #" <<
j <<
" keep lower d0 " <<
tracks[
i].first->d0()
258 <<
" " <<
tracks[
j].first->d0() <<
", keep #" 264 if ((*sharing).second > 1) {
272 LogTrace(
"TrackCleaner") <<
" Sharing " << (*sharing).second <<
" remove by size";
280 LogTrace(
"TrackCleaner") <<
" Sharing " << (*sharing).second <<
" remove by d0";
285 if ((*sharing).second > 0) {
298 }
while (changes > 0);
303 for (
unsigned int i = 0;
i <
tracks.size();
i++)
307 delete tracks_[
i].first;
309 LogTrace(
"MinBiasTracking") <<
" [TrackCleaner] cleaned tracks : " << cleaned.size();
311 for (
unsigned int i = 0;
i < cleaned.size();
i++)
unsigned int pxbLayer(const DetId &id) const
bool isCompatible(const DetId &i1, const DetId &i2) const
unsigned int pxfBlade(const DetId &id) const
unsigned int pxfModule(const DetId &id) const
unsigned int pxbLadder(const DetId &id) const
TracksWithRecHits cleanTracks(const TracksWithRecHits &tracksWithRecHits) const override
bool canBeMerged(const std::vector< const TrackingRecHit *> &recHitsA, const std::vector< const TrackingRecHit *> &recHitsB) const
U second(std::pair< T, U > const &p)
HitComparatorByRadius(const TrackerTopology *tTopo)
bool operator()(const TrackingRecHit *a, const TrackingRecHit *b) const
bool areSame(const TrackingRecHit *a, const TrackingRecHit *b) const
bool operator()(const TrackingRecHit *a, const TrackingRecHit *b) const
unsigned int pxfDisk(const DetId &id) const
Abs< T >::type abs(const T &t)
unsigned int pxfPanel(const DetId &id) const
const TrackerTopology * tTopo_
unsigned int pxfSide(const DetId &id) const
auto const & tracks
cannot be loose
TrackCleaner(const TrackerTopology *tTopo)
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
unsigned int pxbModule(const DetId &id) const
static std::string getInfo(const DetId &id, const TrackerTopology *tTopo)
pixeltrackfitting::TracksWithRecHits TracksWithRecHits
const TrackerTopology * tTopo_