37 #include <unordered_set>
57 produces<TrajectorySeedCollection>();
72 std::vector<std::string> layerStringList = conf.
getParameter<std::vector<std::string>>(
"layerList");
73 for(
auto it=layerStringList.cbegin(); it < layerStringList.cend(); ++it)
75 std::vector<TrackingLayer> trackingLayerList;
78 while (pos != std::string::npos)
84 trackingLayerList.push_back(layerSpec);
85 line=line.substr(pos+1,std::string::npos);
92 if(conf.
exists(
"RegionFactoryPSet")){
115 for(Regions::const_iterator ir=
regions.begin(); ir <
regions.end(); ++ir){
118 auto loc = gs.
position-(*ir)->origin().basicVector();
120 loc.perp(),gs.
position.
z(),gs.errorR,gs.errorZ);
122 float u = innerLayer->
isBarrel() ? loc.perp() : gs.position.z();
123 float v = innerLayer->
isBarrel() ? gs.position.z() : loc.perp();
124 float dv = innerLayer->
isBarrel() ? gs.errorZ : gs.errorR;
126 Range allowed = checkRZ->
range(u);
127 float vErr = nSigmaRZ * dv;
128 Range hitRZ(v-vErr, v+vErr);
129 Range crossRange = allowed.intersection(hitRZ);
131 if( ! crossRange.empty()){
140 const std::vector<TrajectorySeedHitCandidate>& trackerRecHits,
141 std::vector<int>& hitIndicesInTree,
147 if (hitIndicesInTree[node->
getIndex()]<0)
158 hitIndicesInTree[node->
getIndex()]=trackerHit;
167 for (
unsigned int ichild = 0; ichild<node->
getChildrenSize(); ++ichild)
183 const std::vector<TrajectorySeedHitCandidate>& trackerRecHits,
184 std::vector<int> hitIndicesInTree,
185 bool processSkippedHits
188 for (
unsigned int irecHit = start; irecHit<trackerRecHits.size(); ++irecHit)
190 unsigned int currentHitIndex=irecHit;
192 for (
unsigned int inext=currentHitIndex+1; inext< trackerRecHits.size(); ++inext)
195 if (trackerRecHits[currentHitIndex].getTrackingLayer()==trackerRecHits[inext].getTrackingLayer())
197 if (processSkippedHits)
206 if (seedHits.size()>0)
219 processSkippedHits=
true;
228 std::vector<unsigned int> seedIndices(seedNode->
getDepth()+1);
239 return std::vector<unsigned int>();
266 std::unique_ptr<HitMaskHelper> hitMaskHelper;
287 edm::LogWarning(
"TrajectorySeedProducer") <<
" RegionFactory is not initialised properly, please check your configuration. Producing empty seed collection" << std::endl;
295 for (
unsigned icomb=0; icomb<recHitCombinations->size(); ++icomb)
303 unsigned int layersCrossed=0;
306 std::vector<TrajectorySeedHitCandidate> trackerRecHits;
307 for (
const auto & _hit : recHitCombination )
310 if(hitMaskHelper && hitMaskHelper->mask(_hit.get()))
313 previousTrackerHit=currentTrackerHit;
324 trackerRecHits.push_back(
std::move(currentTrackerHit));
352 std::vector<unsigned int> seedHitNumbers =
iterateHits(0,trackerRecHits,hitIndicesInTree,
true);
355 if (seedHitNumbers.size()>1){
358 for(
unsigned iIndex = 0;iIndex < seedHitNumbers.size();++iIndex){
365 seedHits.
size() >=3 ? &seedHits[2] :
nullptr,
366 seedHits.
size() >=4 ? &seedHits[3] :
nullptr));
bool passHitTuplesCuts(const SeedingNode< TrackingLayer > &seedingNode, const std::vector< TrajectorySeedHitCandidate > &trackerRecHits, const std::vector< int > &hitIndicesInTree, const TrajectorySeedHitCandidate ¤tTrackerHit) const
method checks if a SimTrack fulfills the quality requirements.
T getParameter(std::string const &) const
tuple start
Check for commandline option errors.
const MagneticField * magneticField
TrajectorySeedProducer(const edm::ParameterSet &conf)
TrackingRecHitGlobalState globalState() const
std::unique_ptr< TrackingRegionProducer > theRegionProducer
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< std::vector< bool > > hitMasksToken
virtual Range range(const float &rORz) const =0
const SingleSet & getSingleSet() const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
virtual void produce(edm::Event &e, const edm::EventSetup &es)
const DATA & getData() const
unsigned int getChildrenSize() const
unsigned int getDepth() const
const SeedingNode * getParent() const
bool insert(const std::vector< DATA > &dataList)
unsigned int numberOfNodes() const
unsigned int numberOfRoots() const
const TrackerTopology * trackerTopology
std::vector< TrajectorySeed > TrajectorySeedCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
const GeomDet * det() const
const edm::EventSetup * es_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
virtual std::vector< unsigned int > iterateHits(unsigned int start, const std::vector< TrajectorySeedHitCandidate > &trackerRecHits, std::vector< int > hitIndicesInTree, bool processSkippedHits) const
method tries to insert all hits into the tree structure.
const DetLayer * detLayer(const DetId &id) const
obsolete method. Use idToLayer() instead.
DetId geographicalId() const
The label of this GeomDet.
static TrackingLayer createFromString(std::string layerSpecification)
bool isHitOnLayer(const TrajectorySeedHitCandidate &trackerRecHit, const TrackingLayer &layer) const
const MeasurementTracker & measurementTracker() const
bool pass2HitsCuts(const TrajectorySeedHitCandidate &hit1, const TrajectorySeedHitCandidate &hit2) const
std::vector< FastTrackerRecHitRef > FastTrackerRecHitCombination
PixelRecoRange< float > Range
T const * product() const
virtual const Surface::PositionType & position() const
Returns position of the surface.
std::vector< std::vector< TrackingLayer > > seedingLayers
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
edm::EDGetTokenT< FastTrackerRecHitCombinationCollection > recHitCombinationsToken
const MeasurementTrackerEvent * measurementTrackerEvent
const SeedingNode< DATA > * getRoot(unsigned int i) const
unsigned int minLayersCrossed
void setRecHitCombinationIndex(edm::OwnVector< T > &recHits, int32_t icomb)
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrackerEventToken
const TrackerGeometry * trackerGeometry
const SeedingNode< TrackingLayer > * insertHit(const std::vector< TrajectorySeedHitCandidate > &trackerRecHits, std::vector< int > &hitIndicesInTree, const SeedingNode< TrackingLayer > *node, unsigned int trackerHit) const
const FastTrackerRecHit * hit() const
The Hit itself.
unsigned int getIndex() const
const TrackingLayer & getTrackingLayer() const
SeedingTree< TrackingLayer > _seedingTree
bool isOnTheSameLayer(const TrajectorySeedHitCandidate &other) const
Check if two hits are on the same layer of the same subdetector.
const GeometricSearchTracker * geometricSearchTracker() const
std::unique_ptr< SeedCreator > seedCreator
const MagneticFieldMap * magneticFieldMap
T get(const Candidate &c)
const SeedingNode< DATA > * getChild(unsigned int ichild) const