30 if (cleaner ==
"CachingSeedCleanerBySharedInput") {
32 }
else if (cleaner ==
"none") {
35 throw cms::Exception(
"OutInRedundantSeedCleaner not found, please use CachingSeedCleanerBySharedInput or none", cleaner);
61 std::vector<Trajectory> tmpO;
62 tmpO.erase(tmpO.begin(), tmpO.end() ) ;
64 std::vector<Trajectory>
result;
65 result.erase(result.begin(), result.end() ) ;
68 std::vector<Trajectory> rawResult;
100 std::vector<Trajectory> theTmpTrajectories;
101 for(TrajectorySeedCollection::const_iterator iSeed=outInSeeds.begin(); iSeed!=outInSeeds.end();iSeed++){
103 theTmpTrajectories.clear();
109 DetId tmpId =
DetId( iSeed->startingState().detId());
111 GlobalVector gv = tmpDet->surface().toGlobal( iSeed->startingState().parameters().momentum() );
114 LogDebug(
"OutInConversionTrackFinder") <<
" OutInConversionTrackFinder::tracks seed starting state position " << iSeed->startingState().parameters().position() <<
" momentum " << iSeed->startingState().parameters().momentum() <<
" charge " << iSeed->startingState().parameters().charge() <<
" R " << gv.
perp() <<
" eta " << gv.
eta() <<
" phi " << gv.
phi() <<
"\n";
119 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder::track returned " << theTmpTrajectories.size() <<
" trajectories" <<
"\n";
123 for(std::vector<Trajectory>::const_iterator it=theTmpTrajectories.begin();
124 it!=theTmpTrajectories.end(); it++){
125 if( it->isValid() ) {
126 rawResult.push_back(*it);
134 LogDebug(
"OutInConversionTrackFinder") <<
" OutInConversionTrackFinder::track Good seeds " << goodSeed <<
"\n";
135 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder::track rawResult size after cleaning " << rawResult.size() <<
"\n";
139 std::vector<Trajectory> unsmoothedResult;
142 for (std::vector<Trajectory>::const_iterator itraw = rawResult.begin(); itraw != rawResult.end(); itraw++) {
143 if((*itraw).isValid()) {
144 tmpO.push_back( *itraw );
145 LogDebug(
"OutInConversionTrackFinder") <<
" rawResult num hits " << (*itraw).foundHits() <<
"\n";
151 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size() <<
" before sorting " <<
"\n";
159 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO after sorting " <<
"\n";
164 for (
int i=tmpO.size()-1;
i>=0;
i--) {
165 unsmoothedResult.push_back( tmpO[
i] );
167 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder unsmoothedResult size " << unsmoothedResult.size() <<
"\n";
177 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size() <<
" after clearing " <<
"\n";
178 for (std::vector<Trajectory>::const_iterator it = unsmoothedResult.begin(); it != unsmoothedResult.end(); it++) {
179 if( !it->isValid() )
continue;
181 std::pair<TrajectoryStateOnSurface, const GeomDet*> initState =
theInitialState_->innerState( *it);
185 if (! initState.first.isValid() || initState.second ==
nullptr) {
186 LogDebug(
"OutInConversionTrackFinder") <<
"invalid innerState, will not make TrackCandidate" <<
"\n";;
193 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size() <<
" after filling " <<
"\n";
194 if ( !tmpO.empty() ) {
195 std::vector<Trajectory>::iterator it=tmpO.begin();
198 result.push_back(*it);
199 if ( tmpO.size() > 1) result.push_back(*(++it));
209 for (std::vector<Trajectory>::const_iterator it = result.begin(); it != result.end(); it++) {
212 if(it->direction() ==
alongMomentum)
LogDebug(
"OutInConversionTrackFinder") <<
"OutInConv along momentum... " << std::endl;
215 std::pair<TrajectoryStateOnSurface, const GeomDet*> initState =
theInitialState_->innerState( *it);
217 assert(initState.second == recHits.
front().
det());
220 if (! initState.first.isValid() || initState.second ==
nullptr) {
221 LogDebug(
"OutInConversionTrackFinder") <<
"invalid innerState, will not make TrackCandidate" << std::endl;
230 if (!propagated.
isValid())
continue;
235 initState.second->geographicalId().rawId());
237 LogDebug(
"OutInConversionTrackFinder")<<
"OutInConversionTrackFinder Number of hits for the track candidate " << 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_