34 std::string cleaner =
conf_.
getParameter<std::string>(
"OutInRedundantSeedCleaner");
35 if (cleaner ==
"SeedCleanerByHitPosition") {
37 }
else if (cleaner ==
"CachingSeedCleanerByHitPosition") {
39 }
else if (cleaner ==
"CachingSeedCleanerBySharedInput") {
41 }
else if (cleaner ==
"none") {
44 throw cms::Exception(
"OutInRedundantSeedCleaner not found", cleaner);
70 std::vector<Trajectory> tmpO;
71 tmpO.erase(tmpO.begin(), tmpO.end() ) ;
73 std::vector<Trajectory>
result;
74 result.erase(result.begin(), result.end() ) ;
77 std::vector<Trajectory> rawResult;
109 std::vector<Trajectory> theTmpTrajectories;
110 for(TrajectorySeedCollection::const_iterator iSeed=outInSeeds.begin(); iSeed!=outInSeeds.end();iSeed++){
112 theTmpTrajectories.clear();
118 DetId tmpId =
DetId( iSeed->startingState().detId());
120 GlobalVector gv = tmpDet->surface().toGlobal( iSeed->startingState().parameters().momentum() );
123 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";
128 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder::track returned " << theTmpTrajectories.size() <<
" trajectories" <<
"\n";
132 for(std::vector<Trajectory>::const_iterator it=theTmpTrajectories.begin();
133 it!=theTmpTrajectories.end(); it++){
134 if( it->isValid() ) {
135 rawResult.push_back(*it);
143 LogDebug(
"OutInConversionTrackFinder") <<
" OutInConversionTrackFinder::track Good seeds " << goodSeed <<
"\n";
144 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder::track rawResult size after cleaning " << rawResult.size() <<
"\n";
148 std::vector<Trajectory> unsmoothedResult;
151 for (std::vector<Trajectory>::const_iterator itraw = rawResult.begin(); itraw != rawResult.end(); itraw++) {
152 if((*itraw).isValid()) {
153 tmpO.push_back( *itraw );
154 LogDebug(
"OutInConversionTrackFinder") <<
" rawResult num hits " << (*itraw).foundHits() <<
"\n";
160 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size() <<
" before sorting " <<
"\n";
168 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO after sorting " <<
"\n";
173 for (
int i=tmpO.size()-1;
i>=0;
i--) {
174 unsmoothedResult.push_back( tmpO[
i] );
176 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder unsmoothedResult size " << unsmoothedResult.size() <<
"\n";
186 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size() <<
" after clearing " <<
"\n";
187 for (std::vector<Trajectory>::const_iterator it = unsmoothedResult.begin(); it != unsmoothedResult.end(); it++) {
188 if( !it->isValid() )
continue;
194 if (! initState.first.isValid() || initState.second == 0) {
195 LogDebug(
"OutInConversionTrackFinder") <<
"invalid innerState, will not make TrackCandidate" <<
"\n";;
202 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size() <<
" after filling " <<
"\n";
204 std::vector<Trajectory>::iterator it=tmpO.begin();
207 result.push_back(*it);
208 if ( tmpO.size() > 1) result.push_back(*(++it));
217 for (std::vector<Trajectory>::const_iterator it = result.begin(); it != result.end(); it++) {
224 for (Trajectory::RecHitContainer::const_iterator hitIt = thits.begin(); hitIt != thits.end(); hitIt++) {
225 recHits.
push_back( (**hitIt).hit()->clone());
231 if (! initState.first.isValid() || initState.second == 0) {
237 if(
useSplitHits_ && (initState.second != thits.front()->det()) && thits.front()->det() ){
239 if (!propagated.
isValid())
continue;
241 thits.front()->det()->geographicalId().rawId());
244 initState.second->geographicalId().rawId());
246 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_
ConstRecHitContainer RecHitContainer
TrajectoryCleanerBySharedHits * theTrajectoryCleaner_
OutInConversionTrackFinder(const edm::EventSetup &es, const edm::ParameterSet &config)
virtual std::vector< Trajectory > tracks(const TrajectorySeedCollection seeds, TrackCandidateCollection &candidates) const
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 ...