48 produces<TrackCandidateCollection>();
63 simTrackToken = consumes<edm::SimTrackContainer>(simTrackLabel);
66 seedToken = consumes<edm::View<TrajectorySeed> >(seedLabel);
107 std::unique_ptr<HitMaskHelper> hitMaskHelper;
118 for (
unsigned seednr = 0; seednr < seeds->size(); ++seednr){
122 std::vector<int32_t> recHitCombinationIndices;
138 recHitCombinationIndices.push_back(icomb);
140 for(
auto icomb : recHitCombinationIndices)
142 if(icomb < 0 ||
unsigned(icomb) >= recHitCombinations->size()){
143 throw cms::Exception(
"TrackCandidateProducer") <<
" found seed with recHitCombination out or range: " << icomb << std::endl;
148 std::vector<TrajectorySeedHitCandidate> recHitCandidates;
154 recHitCandidates.push_back(seedHit);
156 bool passedLastSeedHit =
false;
158 for (
const auto & _hit : recHitCombination) {
160 if(seed.
nHits()==0)passedLastSeedHit=
true;
162 if(!passedLastSeedHit)
167 passedLastSeedHit=
true;
174 && hitMaskHelper->mask(_hit.get())){
181 if( recHitCandidates.size() == 0 ) {
182 recHitCandidates.push_back(recHitCandidate);
186 recHitCandidates.push_back(recHitCandidate);
190 else if( recHitCandidate.
subDetId() != recHitCandidates.back().subDetId() ||
191 recHitCandidate.
layerNumber() != recHitCandidates.back().layerNumber() ) {
192 recHitCandidates.push_back(recHitCandidate);
196 else if ( recHitCandidate.
localError() < recHitCandidates.back().localError() ){
197 recHitCandidates.back() = recHitCandidate;
206 std::reverse(recHitCandidates.begin(),recHitCandidates.end());
227 const GeomDet* gdet = trackerGeometry->idToDet(seedDetId);
233 if (!initialTSOS.
isValid())
continue;
PropagationDirection direction() const
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
unsigned int minNumberOfCrossedLayers
static std::vector< int > matchRecHitCombinations(const TrajectorySeed &seed, const FastTrackerRecHitCombinationCollection &recHitCombinationCollection, const std::vector< SimTrack > &simTrackCollection, double maxMatchEstimator, const Propagator &propagator, const MagneticField &magneticField, const TrackerGeometry &trackerGeometry)
edm::EDGetTokenT< edm::View< TrajectorySeed > > seedToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< edm::SimVertexContainer > simVertexToken
bool sameId(const FastTrackerRecHit *other, size_t i=0, size_t j=0) const
edm::EDGetTokenT< edm::SimTrackContainer > simTrackToken
TrackCandidateProducer(const edm::ParameterSet &conf)
std::vector< TrackCandidate > TrackCandidateCollection
void split(const FastTrackerRecHit &hitIn, edm::OwnVector< TrackingRecHit > &hitsOut, bool reverseHits) const
BaseTrackerRecHit const * hit() const final
bool exists(std::string const ¶meterName) const
checks if a parameter exists
FastTrackerRecHitSplitter hitSplitter
virtual void produce(edm::Event &e, const edm::EventSetup &es) override
uint32_t rawId() const
get the raw id
const SurfaceType & surface() const
edm::EDGetTokenT< FastTrackerRecHitCombinationCollection > recHitCombinationsToken
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
recHitContainer::const_iterator const_iterator
std::pair< const_iterator, const_iterator > range
unsigned int detId() const
edm::EDGetTokenT< std::vector< bool > > hitMasksToken
double maxSeedMatchEstimator
std::vector< FastTrackerRecHitRef > FastTrackerRecHitCombination
PTrajectoryStateOnDet const & startingState() const
T const * product() const
T const * product() const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
unsigned int nHits() const
void setRecHitCombinationIndex(edm::OwnVector< T > &recHits, int32_t icomb)
double localError() const
const FastTrackerRecHit * hit() const
The Hit itself.
unsigned int layerNumber() const
The Layer Number.
DetId geographicalId() const
int32_t getRecHitCombinationIndex(const T &object)
unsigned int subDetId() const
The subdet Id.
std::string propagatorLabel