32 std::string cleaner =
conf_.
getParameter<std::string>(
"InOutRedundantSeedCleaner");
33 if (cleaner ==
"SeedCleanerByHitPosition") {
35 }
else if (cleaner ==
"CachingSeedCleanerByHitPosition") {
37 }
else if (cleaner ==
"CachingSeedCleanerBySharedInput") {
40 }
else if (cleaner ==
"none") {
43 throw cms::Exception(
"InOutRedundantSeedCleaner not found", cleaner);
65 std::vector<Trajectory> tmpO;
66 tmpO.erase(tmpO.begin(), tmpO.end() ) ;
68 std::vector<Trajectory>
result;
69 result.erase(result.begin(), result.end() ) ;
72 std::vector<Trajectory> rawResult;
79 for(TrajectorySeedCollection::const_iterator iSeed=inOutSeeds.begin(); iSeed!=inOutSeeds.end();iSeed++){
83 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::tracks hits in the seed " << iSeed->nHits() <<
"\n";
84 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::tracks seed starting state position " << iSeed->startingState().parameters().position() <<
" momentum " << iSeed->startingState().parameters().momentum() <<
" charge " << iSeed->startingState().parameters().charge() <<
"\n";
85 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::tracks seed starting state para, vector " << iSeed->startingState().parameters().vector() <<
"\n";
89 std::vector<Trajectory> theTmpTrajectories;
93 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::track returned " << theTmpTrajectories.size() <<
" trajectories for this seed " <<
"\n";
97 for(std::vector<Trajectory>::const_iterator it=theTmpTrajectories.begin(); it!=theTmpTrajectories.end(); it++){
99 rawResult.push_back(*it);
108 LogDebug(
"InOutConversionTrackFinder") <<
"InOutConversionTrackFinder::track Good seeds " << goodSeed <<
"\n" ;
109 LogDebug(
"InOutConversionTrackFinder") <<
"InOutConversionTrackFinder::track rawResult size after cleaning " << rawResult.size() <<
"\n";
114 std::vector<Trajectory> unsmoothedResult;
115 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::track Start second cleaning " <<
"\n";
117 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::track rawResult size after cleaning " << rawResult.size() <<
"\n";
122 for (std::vector<Trajectory>::const_iterator itraw = rawResult.begin(); itraw != rawResult.end(); itraw++) {
124 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder looping of rawResult after cleaning " << tra <<
"\n";
125 if((*itraw).isValid()) {
127 tmpO.push_back( *itraw );
128 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::track rawResult num of valid recHits per trajectory " << (*itraw).foundHits() <<
"\n";
133 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder tmpO size " << tmpO.size() <<
" before sorting " <<
"\n";
141 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder tmpO after sorting " <<
"\n";
146 for (
int i=tmpO.size()-1;
i>=0;
i--) {
147 unsmoothedResult.push_back( tmpO[
i] );
149 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder unsmoothedResult size " << unsmoothedResult.size() <<
"\n";
157 for (std::vector<Trajectory>::const_iterator it = unsmoothedResult.begin(); it != unsmoothedResult.end(); it++) {
159 if( !it->isValid() )
continue;
163 for (Trajectory::RecHitContainer::const_iterator hitIt = thits.begin(); hitIt != thits.end(); hitIt++) {
164 recHits.
push_back( (**hitIt).hit()->clone());
171 if (! initState.first.isValid() || initState.second == 0) {
178 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";
179 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::track TSOS charge " << initState.first.charge() <<
"\n";
184 result.push_back(*it);
190 LogDebug(
"InOutConversionTrackFinder") <<
" InOutConversionTrackFinder::track Returning " << result.size() <<
" valid In Out Trajectories " <<
"\n";
T getParameter(std::string const &) const
const TrajectoryBuilder * theCkfTrajectoryBuilder_
TrajectoryCleanerBySharedHits * theTrajectoryCleaner_
LocalPoint position() const
Local x and y position coordinates.
std::vector< TrackCandidate > TrackCandidateCollection
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_
virtual std::vector< Trajectory > tracks(const TrajectorySeedCollection seeds, TrackCandidateCollection &candidate) const
std::vector< TrajectorySeed > TrajectorySeedCollection
LocalVector momentum() const
Momentum vector in the local frame.
RedundantSeedCleaner * theSeedCleaner_
virtual TrajectoryContainer trajectories(const TrajectorySeed &) const =0
ConstRecHitContainer RecHitContainer
TrackCharge charge() const
Charge (-1, 0 or 1)
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
virtual ~InOutConversionTrackFinder()
InOutConversionTrackFinder(const edm::EventSetup &es, const edm::ParameterSet &config)
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 ...
const LocalTrajectoryParameters & parameters() const