47 produces<TrackCandidateCollection>();
62 simTrackToken = consumes<edm::SimTrackContainer>(simTrackLabel);
65 seedToken = consumes<edm::View<TrajectorySeed> >(seedLabel);
104 std::unique_ptr<HitMaskHelper> hitMaskHelper;
115 for (
unsigned seednr = 0; seednr < seeds->size(); ++seednr){
120 edm::LogError(
"TrackCandidateProducer") <<
"empty trajectory seed in TrajectorySeedCollection: skip" << std::endl;
126 if(icomb < 0 ||
unsigned(icomb) >= recHitCombinations->size()){
127 throw cms::Exception(
"TrackCandidateProducer") <<
" found seed with recHitCombination out or range: " << icomb << std::endl;
132 std::vector<TrajectorySeedHitCandidate> recHitCandidates;
134 unsigned numberOfCrossedLayers = 0;
135 for (
const auto & _hit : recHitCombination) {
140 && hitMaskHelper->mask(_hit.get())){
145 if ( recHitCandidates.size() == 0 || !recHitCandidate.
isOnTheSameLayer(recHitCandidates.back()) ) {
146 ++numberOfCrossedLayers;
151 if( recHitCandidates.size() == 0 ) {
152 recHitCandidates.push_back(recHitCandidate);
156 recHitCandidates.push_back(recHitCandidate);
160 else if( recHitCandidate.
subDetId() != recHitCandidates.back().subDetId() ||
161 recHitCandidate.
layerNumber() != recHitCandidates.back().layerNumber() ) {
162 recHitCandidates.push_back(recHitCandidate);
166 else if ( recHitCandidate.
localError() < recHitCandidates.back().localError() ){
167 recHitCandidates.back() = recHitCandidate;
190 LogDebug(
"FastTracking")<<
"reversing the order of the hits";
191 std::reverse(recHitCandidates.begin(),recHitCandidates.end());
200 const GeomDet* gdet = trackerGeometry->idToDet(seedDetId);
206 if (!initialTSOS.
isValid())
continue;
PropagationDirection direction() const
T getParameter(std::string const &) const
unsigned int minNumberOfCrossedLayers
edm::EDGetTokenT< edm::View< TrajectorySeed > > seedToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< edm::SimVertexContainer > simVertexToken
edm::EDGetTokenT< edm::SimTrackContainer > simTrackToken
TrackCandidateProducer(const edm::ParameterSet &conf)
std::vector< TrackCandidate > TrackCandidateCollection
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void split(const FastTrackerRecHit &hitIn, edm::OwnVector< TrackingRecHit > &hitsOut) const
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.
unsigned int detId() const
edm::EDGetTokenT< std::vector< bool > > hitMasksToken
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
unsigned int layerNumber() const
The Layer Number.
DetId geographicalId() const
int32_t getRecHitCombinationIndex(const T &object)
bool isOnTheSameLayer(const TrajectorySeedHitCandidate &other) const
Check if two hits are on the same layer of the same subdetector.
unsigned int subDetId() const
The subdet Id.
std::string propagatorLabel