29 if (cleaner ==
"CachingSeedCleanerBySharedInput") {
31 }
else if (cleaner ==
"none") {
34 throw cms::Exception(
"InOutRedundantSeedCleaner not found, please use CachingSeedCleanerBySharedInput or none", cleaner);
56 std::vector<Trajectory> tmpO;
57 tmpO.erase(tmpO.begin(), tmpO.end() ) ;
59 std::vector<Trajectory>
result;
60 result.erase(result.begin(), result.end() ) ;
63 std::vector<Trajectory> rawResult;
70 for(TrajectorySeedCollection::const_iterator iSeed=inOutSeeds.begin(); iSeed!=inOutSeeds.end();iSeed++){
74 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::tracks hits in the seed " << iSeed->nHits() <<
"\n";
75 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::tracks seed starting state position " << iSeed->startingState().parameters().position() <<
" momentum " << iSeed->startingState().parameters().momentum() <<
" charge " << iSeed->startingState().parameters().charge() <<
"\n";
76 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::tracks seed starting state para, vector " << iSeed->startingState().parameters().vector() <<
"\n";
80 std::vector<Trajectory> theTmpTrajectories;
84 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::track returned " << theTmpTrajectories.size() <<
" trajectories for this seed " <<
"\n";
88 for(std::vector<Trajectory>::const_iterator it=theTmpTrajectories.begin(); it!=theTmpTrajectories.end(); it++){
90 rawResult.push_back(*it);
99 LogDebug(
"InOutConversionTrackFinder") <<
"InOutConversionTrackFinder::track Good seeds " << goodSeed <<
"\n" ;
100 LogDebug(
"InOutConversionTrackFinder") <<
"InOutConversionTrackFinder::track rawResult size after cleaning " << rawResult.size() <<
"\n";
105 std::vector<Trajectory> unsmoothedResult;
106 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::track Start second cleaning " <<
"\n";
108 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::track rawResult size after cleaning " << rawResult.size() <<
"\n";
113 for (std::vector<Trajectory>::const_iterator itraw = rawResult.begin(); itraw != rawResult.end(); itraw++) {
115 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder looping of rawResult after cleaning " << tra <<
"\n";
116 if((*itraw).isValid()) {
118 tmpO.push_back( *itraw );
119 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::track rawResult num of valid recHits per trajectory " << (*itraw).foundHits() <<
"\n";
124 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder tmpO size " << tmpO.size() <<
" before sorting " <<
"\n";
132 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder tmpO after sorting " <<
"\n";
137 for (
int i=tmpO.size()-1;
i>=0;
i--) {
138 unsmoothedResult.push_back( tmpO[
i] );
140 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder unsmoothedResult size " << unsmoothedResult.size() <<
"\n";
149 for (std::vector<Trajectory>::const_iterator it = unsmoothedResult.begin(); it != unsmoothedResult.end(); it++) {
152 if(it->direction() !=
alongMomentum)
LogDebug(
"InOutConversionTrackFinder") <<
"InOutConv not along momentum... " << std::endl;
157 std::pair<TrajectoryStateOnSurface, const GeomDet*> initState =
theInitialState_->innerState( *it);
161 if ( (!initState.first.isValid()) | (initState.second ==
nullptr)) {
162 LogDebug(
"InOutConversionTrackFinder") <<
"invalid innerState, will not make TrackCandidate" << std::endl;
169 if (!propagated.
isValid())
continue;
174 initState.second->geographicalId().rawId());
176 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::track Making the result: seed position " << it->seed().startingState().parameters().position() <<
" seed momentum " << it->seed().startingState().parameters().momentum() <<
" charge " << it->seed().startingState().parameters().charge () <<
"\n";
177 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::track TSOS charge " << initState.first.charge() <<
"\n";
179 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::track PTrajectoryStateOnDet* state position " 180 << state.parameters().position() <<
" momentum " << state.parameters().momentum() <<
" charge " << state.parameters().charge () <<
"\n";
182 result.push_back(*it);
186 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::track Returning " << result.size() <<
" valid In Out Trajectories " <<
"\n";
T getParameter(std::string const &) const
TrajectoryCleanerBySharedHits * theTrajectoryCleaner_
edm::ESHandle< Propagator > thePropagator_
InOutConversionTrackFinder(const edm::ParameterSet &config, const BaseCkfTrajectoryBuilder *trajectoryBuilder)
std::vector< TrackCandidate > TrackCandidateCollection
std::unique_ptr< TransientInitialStateEstimator > theInitialState_
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
RedundantSeedCleaner * theSeedCleaner_
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
std::vector< Trajectory > tracks(const TrajectorySeedCollection &seeds, TrackCandidateCollection &candidate) const override
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 ...
~InOutConversionTrackFinder() override
const BaseCkfTrajectoryBuilder * theCkfTrajectoryBuilder_