46 produces<TrackCandidateCollection>();
56 simTrackToken = consumes<edm::SimTrackContainer>(simTrackLabel);
59 seedToken = consumes<edm::View<TrajectorySeed> >(seedLabel);
62 recHitToken = consumes<SiTrackerGSMatchedRecHit2DCollection>(recHitLabel);
100 for (
unsigned seednr = 0; seednr < seeds->size(); ++seednr){
104 edm::LogError(
"TrackCandidateProducer") <<
"empty trajectory seed in TrajectorySeedCollection" << std::endl;
115 std::vector<TrajectorySeedHitCandidate> recHitCandidates;
117 unsigned numberOfCrossedLayers = 0;
118 for ( ; recHitIter != recHitEnd; ++recHitIter) {
120 if ( recHitCandidates.size() == 0 || !recHitCandidate.
isOnTheSameLayer(recHitCandidates.back()) ) {
121 ++numberOfCrossedLayers;
124 if( recHitCandidates.size() == 0 ||
126 recHitCandidate.
subDetId() != recHitCandidates.back().subDetId() ||
127 recHitCandidate.
layerNumber() != recHitCandidates.back().layerNumber() ){
128 recHitCandidates.push_back(recHitCandidate);
130 else if ( recHitCandidate.
localError() < recHitCandidates.back().localError() ){
131 recHitCandidates.back() = recHitCandidate;
141 if(
splitHits && recHitCandidates[
index].matchedHit()->isMatched()){
152 LogDebug(
"FastTracking")<<
"reversing the order of the hits";
153 std::reverse(recHitCandidates.begin(),recHitCandidates.end());
157 int vertexIndex = simTracks->at(simTrackId).vertIndex();
159 simVertices->at(vertexIndex).position().y(),
160 simVertices->at(vertexIndex).position().z());
161 GlobalVector momentum( simTracks->at(simTrackId).momentum().x() ,
162 simTracks->at(simTrackId).momentum().y() ,
163 simTracks->at(simTrackId).momentum().z() );
164 float charge = simTracks->at(simTrackId).charge();
173 if (!initialTSOS.
isValid())
continue;
178 output->push_back(newTrackCandidate);
PropagationDirection direction() const
T getParameter(std::string const &) const
unsigned int minNumberOfCrossedLayers
std::pair< const_iterator, const_iterator > range
iterator range
edm::EDGetTokenT< edm::View< TrajectorySeed > > seedToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< edm::SimVertexContainer > simVertexToken
edm::EDGetTokenT< edm::SimTrackContainer > simTrackToken
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
TrackCandidateProducer(const edm::ParameterSet &conf)
std::vector< TrackCandidate > TrackCandidateCollection
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const Plane & surface() const
The nominal surface of the GeomDet.
virtual void produce(edm::Event &e, const edm::EventSetup &es) override
uint32_t rawId() const
get the raw id
C::const_iterator const_iterator
constant access iterator type
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< SiTrackerGSMatchedRecHit2DCollection > recHitToken
T const * product() const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
unsigned int nHits() const
static int position[264][3]
double localError() const
unsigned int layerNumber() const
The Layer Number.
DetId geographicalId() const
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