32 if (cleaner ==
"SeedCleanerByHitPosition") {
34 }
else if (cleaner ==
"CachingSeedCleanerByHitPosition") {
36 }
else if (cleaner ==
"CachingSeedCleanerBySharedInput") {
38 }
else if (cleaner ==
"none") {
41 throw cms::Exception(
"OutInRedundantSeedCleaner not found", cleaner);
67 std::vector<Trajectory> tmpO;
68 tmpO.erase(tmpO.begin(), tmpO.end() ) ;
70 std::vector<Trajectory>
result;
71 result.erase(result.begin(), result.end() ) ;
74 std::vector<Trajectory> rawResult;
106 std::vector<Trajectory> theTmpTrajectories;
107 for(TrajectorySeedCollection::const_iterator iSeed=outInSeeds.begin(); iSeed!=outInSeeds.end();iSeed++){
109 theTmpTrajectories.clear();
115 DetId tmpId =
DetId( iSeed->startingState().detId());
117 GlobalVector gv = tmpDet->surface().toGlobal( iSeed->startingState().parameters().momentum() );
120 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";
125 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder::track returned " << theTmpTrajectories.size() <<
" trajectories" <<
"\n";
129 for(std::vector<Trajectory>::const_iterator it=theTmpTrajectories.begin();
130 it!=theTmpTrajectories.end(); it++){
131 if( it->isValid() ) {
132 rawResult.push_back(*it);
140 LogDebug(
"OutInConversionTrackFinder") <<
" OutInConversionTrackFinder::track Good seeds " << goodSeed <<
"\n";
141 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder::track rawResult size after cleaning " << rawResult.size() <<
"\n";
145 std::vector<Trajectory> unsmoothedResult;
148 for (std::vector<Trajectory>::const_iterator itraw = rawResult.begin(); itraw != rawResult.end(); itraw++) {
149 if((*itraw).isValid()) {
150 tmpO.push_back( *itraw );
151 LogDebug(
"OutInConversionTrackFinder") <<
" rawResult num hits " << (*itraw).foundHits() <<
"\n";
157 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size() <<
" before sorting " <<
"\n";
165 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO after sorting " <<
"\n";
170 for (
int i=tmpO.size()-1;
i>=0;
i--) {
171 unsmoothedResult.push_back( tmpO[
i] );
173 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder unsmoothedResult size " << unsmoothedResult.size() <<
"\n";
183 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size() <<
" after clearing " <<
"\n";
184 for (std::vector<Trajectory>::const_iterator it = unsmoothedResult.begin(); it != unsmoothedResult.end(); it++) {
185 if( !it->isValid() )
continue;
187 std::pair<TrajectoryStateOnSurface, const GeomDet*> initState =
theInitialState_->innerState( *it);
191 if (! initState.first.isValid() || initState.second == 0) {
192 LogDebug(
"OutInConversionTrackFinder") <<
"invalid innerState, will not make TrackCandidate" <<
"\n";;
199 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size() <<
" after filling " <<
"\n";
201 std::vector<Trajectory>::iterator it=tmpO.begin();
204 result.push_back(*it);
205 if ( tmpO.size() > 1) result.push_back(*(++it));
215 for (std::vector<Trajectory>::const_iterator it = result.begin(); it != result.end(); it++) {
218 if(it->direction() ==
alongMomentum)
LogDebug(
"OutInConversionTrackFinder") <<
"OutInConv along momentum... " << std::endl;
221 std::pair<TrajectoryStateOnSurface, const GeomDet*> initState =
theInitialState_->innerState( *it);
223 assert(initState.second == recHits.
front().
det());
226 if (! initState.first.isValid() || initState.second ==
nullptr) {
227 LogDebug(
"OutInConversionTrackFinder") <<
"invalid innerState, will not make TrackCandidate" << std::endl;
236 if (!propagated.
isValid())
continue;
241 initState.second->geographicalId().rawId());
243 LogDebug(
"OutInConversionTrackFinder")<<
"OutInConversionTrackFinder Number of hits for the track candidate " << recHits.
size() <<
" TSOS charge " << initState.first.charge() <<
"\n";
T getParameter(std::string const &) const
virtual ~OutInConversionTrackFinder()
edm::ESHandle< Propagator > thePropagator_
std::vector< TrackCandidate > TrackCandidateCollection
OutInConversionTrackFinder(const edm::ParameterSet &config, const BaseCkfTrajectoryBuilder *trajectoryBuilder)
Geom::Phi< T > phi() const
virtual void clean(TrajectoryPointerContainer &) 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
const TrackingGeometry * geomTracker() const
RedundantSeedCleaner * theSeedCleaner_
virtual std::vector< Trajectory > tracks(const TrajectorySeedCollection &seeds, TrackCandidateCollection &candidates) const
TrajectoryCleanerBySharedHits * theTrajectoryCleaner_
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
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_