28 if (cleaner ==
"CachingSeedCleanerBySharedInput") {
30 }
else if (cleaner ==
"none") {
33 throw cms::Exception(
"OutInRedundantSeedCleaner not found, please use CachingSeedCleanerBySharedInput or none",
48 std::vector<Trajectory> tmpO;
49 tmpO.erase(tmpO.begin(), tmpO.end());
51 std::vector<Trajectory>
result;
52 result.erase(result.begin(), result.end());
54 std::vector<Trajectory> rawResult;
82 std::vector<Trajectory> theTmpTrajectories;
83 for (TrajectorySeedCollection::const_iterator iSeed = outInSeeds.begin(); iSeed != outInSeeds.end(); iSeed++) {
84 theTmpTrajectories.clear();
89 DetId tmpId =
DetId(iSeed->startingState().detId());
91 GlobalVector gv = tmpDet->surface().toGlobal(iSeed->startingState().parameters().momentum());
94 LogDebug(
"OutInConversionTrackFinder") <<
" OutInConversionTrackFinder::tracks seed starting state position "
95 << iSeed->startingState().parameters().position() <<
" momentum "
96 << iSeed->startingState().parameters().momentum() <<
" charge "
97 << iSeed->startingState().parameters().charge() <<
" R " << gv.
perp()
98 <<
" eta " << gv.
eta() <<
" phi " << gv.
phi() <<
"\n";
102 LogDebug(
"OutInConversionTrackFinder")
103 <<
"OutInConversionTrackFinder::track returned " << theTmpTrajectories.size() <<
" trajectories"
108 for (std::vector<Trajectory>::const_iterator it = theTmpTrajectories.begin(); it != theTmpTrajectories.end();
111 rawResult.push_back(*it);
118 LogDebug(
"OutInConversionTrackFinder") <<
" OutInConversionTrackFinder::track Good seeds " << goodSeed <<
"\n";
119 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder::track rawResult size after cleaning "
120 << rawResult.size() <<
"\n";
125 std::vector<Trajectory> unsmoothedResult;
128 for (std::vector<Trajectory>::const_iterator itraw = rawResult.begin(); itraw != rawResult.end(); itraw++) {
129 if ((*itraw).isValid()) {
130 tmpO.push_back(*itraw);
131 LogDebug(
"OutInConversionTrackFinder") <<
" rawResult num hits " << (*itraw).foundHits() <<
"\n";
135 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size()
136 <<
" before sorting "
144 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO after sorting "
150 for (
int i = tmpO.size() - 1;
i >= 0;
i--) {
151 unsmoothedResult.push_back(tmpO[
i]);
153 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder unsmoothedResult size "
154 << unsmoothedResult.size() <<
"\n";
162 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size()
163 <<
" after clearing "
165 for (std::vector<Trajectory>::const_iterator it = unsmoothedResult.begin(); it != unsmoothedResult.end(); it++) {
169 std::pair<TrajectoryStateOnSurface, const GeomDet*> initState =
theInitialState_->innerState(*it);
173 if (!initState.first.isValid() || initState.second ==
nullptr) {
174 LogDebug(
"OutInConversionTrackFinder") <<
"invalid innerState, will not make TrackCandidate"
182 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder tmpO size " << tmpO.size() <<
" after filling "
185 std::vector<Trajectory>::iterator it = tmpO.begin();
188 result.push_back(*it);
190 result.push_back(*(++it));
199 for (std::vector<Trajectory>::const_iterator it = result.begin(); it != result.end(); it++) {
202 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConv along momentum... " << std::endl;
205 std::pair<TrajectoryStateOnSurface, const GeomDet*> initState =
theInitialState_->innerState(*it);
210 if (!initState.first.isValid() || initState.second ==
nullptr) {
211 LogDebug(
"OutInConversionTrackFinder") <<
"invalid innerState, will not make TrackCandidate" << std::endl;
225 LogDebug(
"OutInConversionTrackFinder") <<
"OutInConversionTrackFinder Number of hits for the track candidate "
226 << recHits.
size() <<
" TSOS charge " << initState.first.charge() <<
"\n";
std::vector< Trajectory > tracks(const TrajectorySeedCollection &seeds, TrackCandidateCollection &candidates) const override
edm::ESHandle< Propagator > thePropagator_
std::vector< TrackCandidate > TrackCandidateCollection
Geom::Phi< T > phi() const
std::unique_ptr< TransientInitialStateEstimator > theInitialState_
virtual void done()=0
Tells the cleaner that the seeds are finished, and so it can clear any cache it has.
const TrackerGeometry * geomTracker() const
const Plane & surface() const
The nominal surface of the GeomDet.
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
void clean(TrajectoryPointerContainer &) const override
std::vector< TrajectorySeed > TrajectorySeedCollection
const GeomDet * det() const
const TrackerGeomDet * idToDet(DetId) const override
virtual TrajectoryContainer trajectories(const TrajectorySeed &) const =0
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
RedundantSeedCleaner * theSeedCleaner_
TrajectoryCleanerBySharedHits * theTrajectoryCleaner_
T getParameter(std::string const &) const
~OutInConversionTrackFinder() override
OutInConversionTrackFinder(const edm::ParameterSet &config, const BaseCkfTrajectoryBuilder *trajectoryBuilder, edm::ConsumesCollector iC)
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_