30 float pphi1min,
float pphi1max,
31 float phi2min,
float phi2max,
32 float z2minB,
float z2maxB,
33 float r2minF,
float r2maxF,
34 float rMinI,
float rMaxI,
35 bool searchInTIDTEC) :
36 ephi1min(ephi1min), ephi1max(ephi1max),
37 pphi1min(pphi1min), pphi1max(pphi1max),
38 phi2min(phi2min), phi2max(phi2max),
39 z2minB(z2minB), z2maxB(z2maxB),
40 r2minF(r2minF), r2maxF(r2maxF),
41 rMinI(rMinI), rMaxI(rMaxI),
42 searchInTIDTEC(searchInTIDTEC),
43 theTrackerGeometry(0),
45 theGeomSearchTracker(0),
72 if ( layer != cyliter->layerNumber() )
continue;
83 std::vector<TrajectorySeedHitCandidate>& theHits) {
86 FastPixelHitMatcher::ConstRecHitPointer> >
result;
88 std::cout <<
"[FastPixelHitMatcher::compatibleHits] entering .. " << std::endl;
91 double zCluster = thePos.
z();
92 double rCluster = thePos.
perp();
95 double theLength = thePos.
mag();
97 theMom *= energy / theLength;
105 std::cout <<
"elec/posi before propagation " << std::endl << myElec << std::endl << myPosi << std::endl;
113 std::cout <<
"elec/posi after propagation " << std::endl << myElec << std::endl << myPosi << std::endl;
117 bool thereIsASeed =
false;
118 unsigned nHits = theHits.size();
120 for (
unsigned firstHit=0; firstHit<nHits-1; ++firstHit ) {
121 for (
unsigned secondHit=firstHit+1; secondHit<nHits; ++secondHit ) {
124 thereIsASeed =
isASeed(myElec,myPosi,theVertex,
130 std::cout <<
"Is there a seed with hits " << firstHit <<
" & "<< secondHit <<
"? " << thereIsASeed << std::endl;
132 if ( !thereIsASeed )
continue;
136 theHits[firstHit].
hit());
139 theHits[secondHit].
hit());
140 result.push_back(std::pair<
141 FastPixelHitMatcher::ConstRecHitPointer,
142 FastPixelHitMatcher::ConstRecHitPointer>(theFirstHit,theSecondHit));
161 std::cout <<
"isASeed: The two hits are not on the same layer - OK " << std::endl;
165 if ( hit1.
subDetId() > 2 )
return false;
167 std::cout <<
"isASeed: The first hits is on the pixel detector " << std::endl;
175 std::cout <<
"isASeed: rzok (1) = " << rzok << std::endl;
177 if ( !rzok )
return false;
190 }
else if ( hit2.
subDetId() == 2 ) {
196 std::cout <<
"isASeed: rzok (2) = " << rzok << std::endl;
198 if ( !rzok )
return false;
206 std::cout <<
"isASeed: elec1 to be propagated to first layer" << std::endl;
211 std::cout <<
"isASeed: posi1 to be propagated to first layer" << std::endl;
217 std::cout <<
"isASeed: elec1 / posi1 " << elec1 <<
" " << posi1 << std::endl;
220 if ( !elec1 && !posi1 )
return false;
226 std::cout <<
"isASeed: elec2 to be propagated to second layer" << std::endl;
232 std::cout <<
"isASeed: posi2 to be propagated to second layer" << std::endl;
238 std::cout <<
"isASeed: elec2 / posi2 " << elec2 <<
" " << posi2 << std::endl;
240 if ( !elec2 && !posi2 )
return false;
250 double phimin,
double phimax,
257 std::cout <<
"propagateToLayer: propagateToLayer: Before propagation (0) " << myPart << std::endl;
264 double zCyl =
thePixelLayers[layer]->forward() ? fabs(theHit.
z()) : 999.;
272 std::cout <<
"propagateToLayer: Success ? " << success << std::endl;
273 std::cout <<
"propagateToLayer: After propagation (1) " << myPart << std::endl;
274 std::cout <<
"propagateToLayer: The hit " << theHit << std::endl;
279 double dphi = myPart.
vertex().phi() - theHit.
phi();
281 dphi = dphi + 2.*
M_PI;
282 else if ( dphi >
M_PI )
283 dphi = dphi - 2.*
M_PI;
285 std::cout <<
"propagateToLayer: Phi range ? " << phimin <<
" < " << dphi <<
" < " << phimax << std::endl;
287 if ( dphi < phimin || dphi > phimax ) success =
false;
296 std::cout <<
"propagateToLayer: After propagation (2) " << myPart << std::endl;
312 double pxHitz = theHit.
z();
313 double pxHitr = theHit.
perp();
314 return pxHitz - pxHitr*(zCluster-pxHitz)/(rCluster-pxHitr);
322 float rzMin,
float rzMax,
328 double zHit = theHit.
z();
329 double rHit = theHit.
perp();
334 double checkRZ = forward ?
335 (zHit-
zVertex)/(zCluster-zVertex) * rCluster
337 zVertex + rHit * (zCluster-
zVertex)/rCluster;
343 checkRZ+rzMin < rHit && rHit < checkRZ+rzMax
345 checkRZ+rzMin < zHit && zHit < checkRZ+rzMax;
unsigned int cylinderNumber() const
The global layer number in the nested cylinder geometry.
Geom::Phi< T > phi() const
std::list< TrackerLayer >::const_iterator cylinderEnd() const
Returns the last pointer in the cylinder list.
void setPropagationConditions(double r, double z, bool firstLoop=true)
Set the propagation characteristics (rCyl, zCyl and first loop only)
GlobalPoint globalPosition() const
The global position.
std::vector< const TrackerLayer * > thePixelLayers
virtual ~FastPixelHitMatcher()
double zVertex(double zCluster, double rCluster, GlobalPoint &theHit)
static RecHitPointer build(const GeomDet *geom, const TrackingRecHit *rh)
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
bool isASeed(const ParticlePropagator &myElec, const ParticlePropagator &myPosi, const GlobalPoint &theVertex, double rCluster, double zCluster, const TrajectorySeedHitCandidate &hit1, const TrajectorySeedHitCandidate &hit2)
bool propagateToLayer(ParticlePropagator &myPart, const GlobalPoint &theVertex, GlobalPoint &theHit, double phimin, double phimax, unsigned layer)
const GeometricSearchTracker * theGeomSearchTracker
const MagneticFieldMap * theFieldMap
const XYZTLorentzVector & vertex() const
the vertex fourvector
std::vector< std::pair< ConstRecHitPointer, ConstRecHitPointer > > compatibleHits(const GlobalPoint &xmeas, const GlobalPoint &vprim, float energy, std::vector< TrajectorySeedHitCandidate > &theHits)
FastPixelHitMatcher(float, float, float, float, float, float, float, float, float, float, float, float, bool)
const TrackerGeometry * theTrackerGeometry
std::list< TrackerLayer >::const_iterator cylinderBegin() const
Returns the first pointer in the cylinder list.
const TrackerInteractionGeometry * _theGeometry
bool checkRZCompatibility(double zCluster, double rCluster, double zVertex, float rzMin, float rzMax, GlobalPoint &theHit, bool forward)
bool propagateToNominalVertex(const XYZTLorentzVector &hit2=XYZTLorentzVector(0., 0., 0., 0.))
void setES(const MagneticFieldMap *aFieldMap, const TrackerGeometry *aTrackerGeometry, const GeometricSearchTracker *geomSearchTracker, const TrackerInteractionGeometry *interactionGeometry)
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.
void setVertex(const XYZTLorentzVector &vtx)
set the vertex
math::XYZTLorentzVector XYZTLorentzVector