31 if (cleaner ==
"SeedCleanerByHitPosition") {
33 }
else if (cleaner ==
"CachingSeedCleanerByHitPosition") {
35 }
else if (cleaner ==
"CachingSeedCleanerBySharedInput") {
37 }
else if (cleaner ==
"none") {
40 throw cms::Exception(
"OutInRedundantSeedCleaner not found", cleaner);
66 std::vector<Trajectory> tmpO;
67 tmpO.erase(tmpO.begin(), tmpO.end() ) ;
69 std::vector<Trajectory>
result;
70 result.erase(result.begin(), result.end() ) ;
73 std::vector<Trajectory> rawResult;
105 std::vector<Trajectory> theTmpTrajectories;
106 for(TrajectorySeedCollection::const_iterator iSeed=outInSeeds.begin(); iSeed!=outInSeeds.end();iSeed++){
108 theTmpTrajectories.clear();
114 DetId tmpId =
DetId( iSeed->startingState().detId());
116 GlobalVector gv = tmpDet->surface().toGlobal( iSeed->startingState().parameters().momentum() );
119 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";
124 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder::track returned " << theTmpTrajectories.size() <<
" trajectories" <<
"\n";
128 for(std::vector<Trajectory>::const_iterator it=theTmpTrajectories.begin();
129 it!=theTmpTrajectories.end(); it++){
130 if( it->isValid() ) {
131 rawResult.push_back(*it);
139 LogDebug(
"OutInConversionTrackFinder") <<
" OutInConversionTrackFinder::track Good seeds " << goodSeed <<
"\n";
140 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder::track rawResult size after cleaning " << rawResult.size() <<
"\n";
144 std::vector<Trajectory> unsmoothedResult;
147 for (std::vector<Trajectory>::const_iterator itraw = rawResult.begin(); itraw != rawResult.end(); itraw++) {
148 if((*itraw).isValid()) {
149 tmpO.push_back( *itraw );
150 LogDebug(
"OutInConversionTrackFinder") <<
" rawResult num hits " << (*itraw).foundHits() <<
"\n";
156 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size() <<
" before sorting " <<
"\n";
164 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO after sorting " <<
"\n";
169 for (
int i=tmpO.size()-1;
i>=0;
i--) {
170 unsmoothedResult.push_back( tmpO[
i] );
172 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder unsmoothedResult size " << unsmoothedResult.size() <<
"\n";
182 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size() <<
" after clearing " <<
"\n";
183 for (std::vector<Trajectory>::const_iterator it = unsmoothedResult.begin(); it != unsmoothedResult.end(); it++) {
184 if( !it->isValid() )
continue;
190 if (! initState.first.isValid() || initState.second == 0) {
191 LogDebug(
"OutInConversionTrackFinder") <<
"invalid innerState, will not make TrackCandidate" <<
"\n";;
198 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size() <<
" after filling " <<
"\n";
200 std::vector<Trajectory>::iterator it=tmpO.begin();
203 result.push_back(*it);
204 if ( tmpO.size() > 1) result.push_back(*(++it));
213 for (std::vector<Trajectory>::const_iterator it = result.begin(); it != result.end(); it++) {
220 for (Trajectory::RecHitContainer::const_iterator hitIt = thits.begin(); hitIt != thits.end(); hitIt++) {
221 recHits.
push_back( (**hitIt).hit()->clone());
227 if (! initState.first.isValid() || initState.second == 0) {
233 if(
useSplitHits_ && (initState.second != thits.front()->det()) && thits.front()->det() ){
235 if (!propagated.
isValid())
continue;
237 thits.front()->det()->geographicalId().rawId());
240 initState.second->geographicalId().rawId());
242 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()
const TrajectoryBuilder * theCkfTrajectoryBuilder_
edm::ESHandle< Propagator > thePropagator_
std::vector< TrackCandidate > TrackCandidateCollection
Geom::Phi< T > phi() const
virtual void clean(TrajectoryPointerContainer &) const
virtual void done()=0
Tells the cleaner that the seeds are finished, and so it can clear any cache it has.
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.
TransientInitialStateEstimator * theInitialState_
std::vector< TrajectorySeed > TrajectorySeedCollection
const TrackingGeometry * geomTracker() const
virtual TrajectoryContainer trajectories(const TrajectorySeed &) const =0
virtual const GeomDet * idToDet(DetId) const =0
RedundantSeedCleaner * theSeedCleaner_
virtual std::vector< Trajectory > tracks(const TrajectorySeedCollection &seeds, TrackCandidateCollection &candidates) const
ConstRecHitContainer RecHitContainer
TrajectoryCleanerBySharedHits * theTrajectoryCleaner_
OutInConversionTrackFinder(const edm::EventSetup &es, const edm::ParameterSet &config)
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
const MeasurementTracker * theMeasurementTracker_
std::pair< TrajectoryStateOnSurface, const GeomDet * > innerState(const Trajectory &traj, bool doBackFit=true) const
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 ...