46 theTrackCandidateOutput(
true),
47 theTrajectoryOutput(
false),
48 useSplitting(conf.getParameter<bool>(
"useHitsSplitting")),
51 theMaxNSeeds(conf.getParameter<unsigned int>(
"maxNSeeds")),
52 theTrajectoryBuilderName(conf.getParameter<std::string>(
"TrajectoryBuilder")),
53 theTrajectoryBuilder(0),
54 theTrajectoryCleanerName(conf.getParameter<std::string>(
"TrajectoryCleaner")),
55 theTrajectoryCleaner(0),
57 theNavigationSchoolName(conf.getParameter<std::string>(
"NavigationSchool")),
58 theNavigationSchool(0),
79 if (cleaner ==
"SeedCleanerByHitPosition") {
81 }
else if (cleaner ==
"SeedCleanerBySharedInput") {
83 }
else if (cleaner ==
"CachingSeedCleanerByHitPosition") {
85 }
else if (cleaner ==
"CachingSeedCleanerBySharedInput") {
87 }
else if (cleaner ==
"none") {
151 std::auto_ptr<std::vector<Trajectory> > outputT (
new std::vector<Trajectory>());
154 LogError(
"TooManySeeds")<<
"Exceeded maximum numeber of seeds! theMaxNSeeds="<<
theMaxNSeeds<<
" nSeed="<<(*collseed).size();
161 if ((*collseed).size()>0){
163 vector<Trajectory> rawResult;
164 rawResult.reserve(collseed->size() * 4);
171 vector<Trajectory> theTmpTrajectories;
174 size_t collseed_size = collseed->size();
175 for (
size_t j = 0;
j < collseed_size;
j++){
179 LogDebug(
"CkfTrackCandidateMakerBase")<<
" Seed cleaning kills seed "<<
j;
184 theTmpTrajectories.clear();
188 LogDebug(
"CkfPattern") <<
"======== In-out trajectory building found " << theTmpTrajectories.size()
189 <<
" trajectories from seed " << j <<
" ========"<<endl
197 LogDebug(
"CkfPattern") <<
"======== In-out trajectory cleaning gave the following valid trajectories from seed "
198 << j <<
" ========"<<endl
207 LogDebug(
"CkfPattern") <<
"======== Out-in trajectory building found " << theTmpTrajectories.size()
208 <<
" valid/invalid trajectories from seed " << j <<
" ========"<<endl
215 LogDebug(
"CkfPattern") <<
"======== Trajectory cleaning gave the following valid trajectories from seed "
216 << j <<
" ========"<<endl
219 for(vector<Trajectory>::iterator it=theTmpTrajectories.begin();
220 it!=theTmpTrajectories.end(); it++){
221 if( it->isValid() ) {
222 it->setSeedRef(collseed->refAt(j));
224 rawResult.push_back(*it);
232 theTmpTrajectories.clear();
234 LogDebug(
"CkfPattern") <<
"rawResult trajectories found so far = " << rawResult.size();
244 LogDebug(
"CkfPattern") <<
"======== Final cleaning of entire event found " << rawResult.size()
245 <<
" valid/invalid trajectories ======="<<endl
248 LogDebug(
"CkfPattern") <<
"removing invalid trajectories.";
250 vector<Trajectory> & unsmoothedResult(rawResult);
251 unsmoothedResult.erase(std::remove_if(unsmoothedResult.begin(),unsmoothedResult.end(),
253 unsmoothedResult.end());
265 output->reserve(unsmoothedResult.size());
266 for (vector<Trajectory>::const_iterator it = unsmoothedResult.begin();
267 it != unsmoothedResult.end(); it++) {
271 LogDebug(
"CkfPattern") <<
"retrieving "<<(
useSplitting?
"splitted":
"un-splitted")<<
" hits from trajectory";
275 LogDebug(
"CkfPattern") <<
"cloning hits into new collection.";
276 for (Trajectory::RecHitContainer::const_iterator hitIt = thits.begin();
277 hitIt != thits.end(); hitIt++) {
278 recHits.
push_back( (**hitIt).hit()->clone());
281 LogDebug(
"CkfPattern") <<
"getting initial state.";
283 std::pair<TrajectoryStateOnSurface, const GeomDet*> initState =
287 if (! initState.first.isValid() || initState.second == 0) {
293 if(
useSplitting && (initState.second != thits.front()->det()) && thits.front()->det() ){
294 LogDebug(
"CkfPattern") <<
"propagating to hit front in case of splitting.";
296 if (!propagated.
isValid())
continue;
298 thits.front()->det()->geographicalId().rawId());
302 initState.second->geographicalId().rawId());
304 LogDebug(
"CkfPattern") <<
"pushing a TrackCandidate.";
313 LogTrace(
"CkfPattern|TrackingRegressionTest") <<
"========== CkfTrackCandidateMaker Info =========="
314 <<
"number of Seed: " << collseed->size()<<endl
virtual ~CkfTrackCandidateMakerBase()
T getParameter(std::string const &) const
virtual void deleteAssocDebugger()
static std::string dumpCandidates(collection &candidates)
void setEventSetup(const edm::EventSetup &es)
Call this at each event until this object will come from the EventSetup as it should.
bool theTrackCandidateOutput
virtual void rebuildSeedingRegion(const TrajectorySeed &, TrajectoryContainer &result) const
const TrajectoryBuilder * theTrajectoryBuilder
std::vector< TrackCandidate > TrackCandidateCollection
virtual void printHitsDebugger(edm::Event &e)
edm::ESHandle< GeometricSearchTracker > theGeomSearchTracker
virtual void done()=0
Tells the cleaner that the seeds are finished, and so it can clear any cache it has.
tuple cleanTrajectoryAfterInOut
unsigned int theMaxNSeeds
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.
static std::string regressionTest(const TrackerGeometry &tracker, std::vector< Trajectory > &unsmoothedResult)
const TrajectoryCleaner * theTrajectoryCleaner
const NavigationSchool * theNavigationSchool
std::string theNavigationSchoolName
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void produceBase(edm::Event &e, const edm::EventSetup &es)
virtual void clean(TrajectoryContainer &) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual TrajectoryContainer trajectories(const TrajectorySeed &) const =0
virtual void beginRunBase(edm::Run &, edm::EventSetup const &es)
std::string theTrajectoryCleanerName
ConstRecHitContainer RecHitContainer
T const * product() const
bool doSeedingRegionRebuilding
TransientInitialStateEstimator * theInitialState
void setEventSetup(const edm::EventSetup &es)
Initialize EventSetup objects at each event.
std::string theTrajectoryBuilderName
tuple doSeedingRegionRebuilding
virtual void countSeedsDebugger()
virtual void setEvent(const edm::Event &event) const =0
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 ...
bool cleanTrajectoryAfterInOut
edm::InputTag theSeedLabel
RedundantSeedCleaner * theSeedCleaner
edm::ESHandle< MagneticField > theMagField