49 if (conf.
exists(
"outputSeedCollectionName"))
85 std::vector<std::string> layerStringList = conf.
getParameter<std::vector<std::string>>(
"layerList");
87 for(
auto it=layerStringList.cbegin(); it < layerStringList.cend(); ++it)
89 std::vector<TrackingLayer> trackingLayerList;
92 while (pos != std::string::npos)
98 trackingLayerList.push_back(layerSpec);
99 line=line.substr(pos+1,std::string::npos);
108 std::vector<edm::InputTag> defaultSkip;
109 std::vector<edm::InputTag> skipSimTrackIdTags = conf.
getUntrackedParameter<std::vector<edm::InputTag> >(
"skipSimTrackIdTags",defaultSkip);
110 for (
unsigned int k=0;
k<skipSimTrackIdTags.size(); ++
k ) {
126 if (conf.
exists(
"skipPVCompatibility"))
128 skipPVCompatibility = conf.
getParameter<
bool>(
"skipPVCompatibility");
216 bool compatible=
false;
233 const std::vector<TrajectorySeedHitCandidate>& trackerRecHits,
234 std::vector<int>& hitIndicesInTree,
240 if (hitIndicesInTree[node->
getIndex()]<0)
251 hitIndicesInTree[node->
getIndex()]=trackerHit;
260 for (
unsigned int ichild = 0; ichild<node->
getChildrenSize(); ++ichild)
276 const std::vector<TrajectorySeedHitCandidate>& trackerRecHits,
277 std::vector<int> hitIndicesInTree,
278 bool processSkippedHits
281 for (
unsigned int irecHit = start; irecHit<trackerRecHits.size(); ++irecHit)
283 unsigned int currentHitIndex=irecHit;
285 for (
unsigned int inext=currentHitIndex+1; inext< trackerRecHits.size(); ++inext)
288 if (trackerRecHits[currentHitIndex].getTrackingLayer()==trackerRecHits[inext].getTrackingLayer())
291 if (processSkippedHits)
300 if (seedHits.size()>0)
315 processSkippedHits=
true;
324 std::vector<unsigned int> seedIndices(seedNode->
getDepth()+1);
335 return std::vector<unsigned int>();
346 std::set<unsigned int> skipSimTrackIds;
350 for (
unsigned int j=0;
j<skipSimTrackIds_temp->size(); ++
j ) {
351 unsigned int mySimTrackId = (*skipSimTrackIds_temp)[
j];
352 skipSimTrackIds.insert((
unsigned int)mySimTrackId);
386 if(theGSRecHits->size() == 0)
394 const unsigned int currentSimTrackId = *itSimTrackId;
396 if(skipSimTrackIds.find(currentSimTrackId)!=skipSimTrackIds.end())
continue;
398 const SimTrack& theSimTrack = (*theSimTracks)[currentSimTrackId];
400 int vertexIndex = theSimTrack.
vertIndex();
406 const SimVertex& theSimVertex = (*theSimVtx)[vertexIndex];
417 unsigned int numberOfNonEqualHits=0;
419 std::vector<TrajectorySeedHitCandidate> trackerRecHits;
423 previousTrackerHit=currentTrackerHit;
429 ++numberOfNonEqualHits;
436 trackerRecHits.push_back(
std::move(currentTrackerHit));
440 if ( numberOfNonEqualHits <
minRecHits)
continue;
457 std::vector<unsigned int> seedHitNumbers =
iterateHits(0,trackerRecHits,hitIndicesInTree,
true);
459 if (seedHitNumbers.size()>0)
464 for (
unsigned ihit=0; ihit<seedHitNumbers.size(); ++ihit )
472 (*theSimVtx)[vertexIndex].
position().
y(),
473 (*theSimVtx)[vertexIndex].
position().
z());
476 float charge = theSimTrack.
charge();
481 if(trackerRecHits[seedHitNumbers[0]].
subDetId() !=1 ||trackerRecHits[seedHitNumbers[0]].
subDetId() !=2)
483 errorMatrix = errorMatrix * 0.0000001;
500 float localErrors[15];
502 for (
int i=0;
i<dim; ++
i)
504 for (
int j=0;
j<=
i; ++
j)
506 localErrors[k++] =
m(
i,
j);
509 int surfaceSide =
static_cast<int>(initialTSOS.
surfaceSide());
583 unsigned int nVertices =
vertices->size();
589 double R1 =
std::sqrt ( (thePos1.X()-x0)*(thePos1.X()-x0) + (thePos1.Y()-y0)*(thePos1.Y()-y0) );
590 double R2 =
std::sqrt ( (thePos2.X()-x0)*(thePos2.X()-x0) + (thePos2.Y()-y0)*(thePos2.Y()-y0) );
595 for (
unsigned iv=0; iv<nVertices; ++iv )
598 double zV = (*vertices)[iv].z();
600 double checkRZ1 = forward ?
603 double checkRZ2 = forward ?
609 bool compat = forward ?
610 checkRZmin < R1 && R1 < checkRZmax :
611 checkRZmin < thePos1.Z()-zV && thePos1.Z()-zV < checkRZmax;
bool passHitTuplesCuts(const SeedingNode< TrackingLayer > &seedingNode, const std::vector< TrajectorySeedHitCandidate > &trackerRecHits, const std::vector< int > &hitIndicesInTree, const TrajectorySeedHitCandidate ¤tTrackerHit) const
method checks if a TrajectorySeedHitCandidate fulfills the quality requirements.
void setCharge(float q)
set the MEASURED charge
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const final
tuple start
Check for commandline option errors.
const MagneticField * magneticField
std::pair< const_iterator, const_iterator > range
iterator range
double zImpactParameter(double x0=0, double y0=0.) const
Longitudinal impact parameter.
TrajectorySeedProducer(const edm::ParameterSet &conf)
std::string outputSeedCollectionName
const LocalTrajectoryParameters & localParameters() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const SingleSet & getSingleSet() const
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
const reco::VertexCollection * vertices
bool isForward() const
Is it a forward hit ?
double largerError() const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
bool propagateToBeamCylinder(const XYZTLorentzVector &v, double radius=0.)
virtual void produce(edm::Event &e, const edm::EventSetup &es)
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
GlobalPoint globalPosition() const
The global position.
const DATA & getData() const
float charge() const
charge
unsigned int getChildrenSize() const
const Plane & surface() const
The nominal surface of the GeomDet.
edm::EDGetTokenT< SiTrackerGSMatchedRecHit2DCollection > recHitToken
edm::InputTag hitProducer
unsigned int getDepth() const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
uint32_t rawId() const
get the raw id
const SeedingNode * getParent() const
PropagatorWithMaterial * thePropagator
bool insert(const std::vector< DATA > &dataList)
unsigned int numberOfNodes() const
unsigned int absMinRecHits
C::const_iterator const_iterator
constant access iterator type
unsigned int numberOfRoots() const
const TrackerTopology * trackerTopology
std::vector< TrajectorySeed > TrajectorySeedCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
unsigned int subDetId[18]
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
virtual ~TrajectorySeedProducer()
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.
double Z() const
z of vertex
virtual void beginRun(edm::Run const &run, const edm::EventSetup &es)
static TrackingLayer createFromString(std::string layerSpecification)
bool compatibleWithBeamAxis(const GlobalPoint &gpos1, const GlobalPoint &gpos2, double error, bool forward) const
const AlgebraicSymMatrix55 & matrix() const
const math::XYZTLorentzVectorD & position() const
const LocalTrajectoryError & localError() const
edm::EDGetTokenT< edm::SimVertexContainer > simVertexToken
bool isHitOnLayer(const TrajectorySeedHitCandidate &trackerRecHit, const TrackingLayer &layer) const
bool pass2HitsCuts(const TrajectorySeedHitCandidate &hit1, const TrajectorySeedHitCandidate &hit2) const
virtual TrackingRecHit * clone() const =0
int vertIndex() const
index of the vertex in the Event container (-1 if no vertex)
std::vector< edm::EDGetTokenT< std::vector< int > > > skipSimTrackIdTokens
edm::EDGetTokenT< edm::SimTrackContainer > simTrackToken
virtual bool passSimTrackQualityCuts(const SimTrack &theSimTrack, const SimVertex &theSimVertex) const
method checks if a SimTrack fulfills the quality requirements.
virtual TrackingRecHit const * hit() const
std::vector< std::vector< TrackingLayer > > seedingLayers
edm::InputTag theBeamSpot
const SeedingNode< DATA > * getRoot(unsigned int i) const
math::XYZPoint beamspotPosition
GlobalVector globalMomentum() const
const math::XYZTLorentzVectorD & momentum() const
static int position[264][3]
edm::EDGetTokenT< reco::VertexCollection > recoVertexToken
const TrackerGeometry * trackerGeometry
const SeedingNode< TrackingLayer > * insertHit(const std::vector< TrajectorySeedHitCandidate > &trackerRecHits, std::vector< int > &hitIndicesInTree, const SeedingNode< TrackingLayer > *node, unsigned int trackerHit) const
method inserts hit into the tree structure at an empty position.
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken
unsigned int getIndex() const
DetId geographicalId() const
const TrackingLayer & getTrackingLayer() const
SeedingTree< TrackingLayer > _seedingTree
unsigned int numberOfHits
bool isOnTheSameLayer(const TrajectorySeedHitCandidate &other) const
Check if two hits are on the same layer of the same subdetector.
const MagneticFieldMap * magneticFieldMap
double xyImpactParameter(double x0=0., double y0=0.) const
Transverse impact parameter.
const SeedingNode< DATA > * getChild(unsigned int ichild) const
math::XYZTLorentzVector XYZTLorentzVector
virtual const TrackerGeomDet * idToDet(DetId) const