27 if (cleaner ==
"CachingSeedCleanerBySharedInput") {
29 }
else if (cleaner ==
"none") {
32 throw cms::Exception(
"OutInRedundantSeedCleaner not found, please use CachingSeedCleanerBySharedInput or none",
47 std::vector<Trajectory> tmpO;
48 tmpO.erase(tmpO.begin(), tmpO.end());
50 std::vector<Trajectory>
result;
51 result.erase(result.begin(), result.end());
53 std::vector<Trajectory> rawResult;
81 std::vector<Trajectory> theTmpTrajectories;
82 for (TrajectorySeedCollection::const_iterator iSeed = outInSeeds.begin(); iSeed != outInSeeds.end(); iSeed++) {
83 theTmpTrajectories.clear();
88 DetId tmpId =
DetId(iSeed->startingState().detId());
90 GlobalVector gv = tmpDet->surface().toGlobal(iSeed->startingState().parameters().momentum());
93 LogDebug(
"OutInConversionTrackFinder") <<
" OutInConversionTrackFinder::tracks seed starting state position " 94 << iSeed->startingState().parameters().position() <<
" momentum " 95 << iSeed->startingState().parameters().momentum() <<
" charge " 96 << iSeed->startingState().parameters().charge() <<
" R " << gv.
perp()
97 <<
" eta " << gv.
eta() <<
" phi " << gv.
phi() <<
"\n";
101 LogDebug(
"OutInConversionTrackFinder")
102 <<
"OutInConversionTrackFinder::track returned " << theTmpTrajectories.size() <<
" trajectories" 107 for (std::vector<Trajectory>::const_iterator it = theTmpTrajectories.begin(); it != theTmpTrajectories.end();
110 rawResult.push_back(*it);
117 LogDebug(
"OutInConversionTrackFinder") <<
" OutInConversionTrackFinder::track Good seeds " << goodSeed <<
"\n";
118 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder::track rawResult size after cleaning " 119 << rawResult.size() <<
"\n";
124 std::vector<Trajectory> unsmoothedResult;
127 for (std::vector<Trajectory>::const_iterator itraw = rawResult.begin(); itraw != rawResult.end(); itraw++) {
128 if ((*itraw).isValid()) {
129 tmpO.push_back(*itraw);
130 LogDebug(
"OutInConversionTrackFinder") <<
" rawResult num hits " << (*itraw).foundHits() <<
"\n";
134 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size()
135 <<
" before sorting " 143 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO after sorting " 149 for (
int i = tmpO.size() - 1;
i >= 0;
i--) {
150 unsmoothedResult.push_back(tmpO[
i]);
152 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder unsmoothedResult size " 153 << unsmoothedResult.size() <<
"\n";
161 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size()
162 <<
" after clearing " 164 for (std::vector<Trajectory>::const_iterator it = unsmoothedResult.begin(); it != unsmoothedResult.end(); it++) {
168 std::pair<TrajectoryStateOnSurface, const GeomDet*> initState =
theInitialState_->innerState(*it);
172 if (!initState.first.isValid() || initState.second ==
nullptr) {
173 LogDebug(
"OutInConversionTrackFinder") <<
"invalid innerState, will not make TrackCandidate" 181 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size() <<
" after filling " 184 std::vector<Trajectory>::iterator it = tmpO.begin();
187 result.push_back(*it);
189 result.push_back(*(++it));
198 for (std::vector<Trajectory>::const_iterator it = result.begin(); it != result.end(); it++) {
201 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConv along momentum... " << std::endl;
204 std::pair<TrajectoryStateOnSurface, const GeomDet*> initState =
theInitialState_->innerState(*it);
206 assert(initState.second == recHits.
front().
det());
209 if (!initState.first.isValid() || initState.second ==
nullptr) {
210 LogDebug(
"OutInConversionTrackFinder") <<
"invalid innerState, will not make TrackCandidate" << std::endl;
224 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder Number of hits for the track candidate " 225 << recHits.
size() <<
" TSOS charge " << initState.first.charge() <<
"\n";
T getParameter(std::string const &) const
edm::ESHandle< Propagator > thePropagator_
std::vector< TrackCandidate > TrackCandidateCollection
OutInConversionTrackFinder(const edm::ParameterSet &config, const BaseCkfTrajectoryBuilder *trajectoryBuilder)
Geom::Phi< T > phi() const
std::unique_ptr< TransientInitialStateEstimator > theInitialState_
virtual const GeomDet * idToDet(DetId) const =0
virtual void done()=0
Tells the cleaner that the seeds are finished, and so it can clear any cache it has.
const Plane & surface() const
The nominal surface of the GeomDet.
virtual TrajectoryContainer trajectories(const TrajectorySeed &) const =0
virtual void add(const Trajectory *traj)=0
Informs the cleaner that a new trajectory has been made, in case the cleaner keeps a local collection...
virtual bool good(const TrajectorySeed *seed)=0
Returns true if the seed is not overlapping with another trajectory.
const TransientTrackingRecHitBuilder * hitBuilder() const
std::vector< TrajectorySeed > TrajectorySeedCollection
const GeomDet * det() const
void clean(TrajectoryPointerContainer &) const override
const TrackingGeometry * geomTracker() const
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
RedundantSeedCleaner * theSeedCleaner_
TrajectoryCleanerBySharedHits * theTrajectoryCleaner_
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
~OutInConversionTrackFinder() override
std::vector< Trajectory > tracks(const TrajectorySeedCollection &seeds, TrackCandidateCollection &candidates) const override
const MeasurementTracker * theMeasurementTracker_
virtual void init(const std::vector< Trajectory > *vect)=0
Provides the cleaner a pointer to the vector where trajectories are stored, in case it does not want ...
const BaseCkfTrajectoryBuilder * theCkfTrajectoryBuilder_