31 float pphi1min,
float pphi1max,
32 float phi2min,
float phi2max,
33 float z2minB,
float z2maxB,
34 float r2minF,
float r2maxF,
35 float rMinI,
float rMaxI,
36 bool searchInTIDTEC) :
37 ephi1min(ephi1min), ephi1max(ephi1max),
38 pphi1min(pphi1min), pphi1max(pphi1max),
39 phi2min(phi2min), phi2max(phi2max),
40 z2minB(z2minB), z2maxB(z2maxB),
41 r2minF(r2minF), r2maxF(r2maxF),
42 rMinI(rMinI), rMaxI(rMaxI),
43 searchInTIDTEC(searchInTIDTEC),
44 theTrackerGeometry(0),
46 theGeomSearchTracker(0),
73 if ( layer != cyliter->layerNumber() )
continue;
84 std::vector<TrackerRecHit>& theHits) {
87 FastPixelHitMatcher::ConstRecHitPointer> >
result;
89 std::cout <<
"[FastPixelHitMatcher::compatibleHits] entering .. " << std::endl;
92 double zCluster = thePos.
z();
93 double rCluster = thePos.
perp();
96 double theLength = thePos.
mag();
98 theMom *= energy / theLength;
106 std::cout <<
"elec/posi before propagation " << std::endl << myElec << std::endl << myPosi << std::endl;
114 std::cout <<
"elec/posi after propagation " << std::endl << myElec << std::endl << myPosi << std::endl;
118 bool thereIsASeed =
false;
119 unsigned nHits = theHits.size();
121 for (
unsigned firstHit=0; firstHit<nHits-1; ++firstHit ) {
122 for (
unsigned secondHit=firstHit+1; secondHit<nHits; ++secondHit ) {
125 thereIsASeed =
isASeed(myElec,myPosi,theVertex,
131 std::cout <<
"Is there a seed with hits " << firstHit <<
" & "<< secondHit <<
"? " << thereIsASeed << std::endl;
133 if ( !thereIsASeed )
continue;
137 theHits[firstHit].
hit());
140 theHits[secondHit].
hit());
141 result.push_back(std::pair<
142 FastPixelHitMatcher::ConstRecHitPointer,
143 FastPixelHitMatcher::ConstRecHitPointer>(theFirstHit,theSecondHit));
162 std::cout <<
"isASeed: The two hits are not on the same layer - OK " << std::endl;
166 if ( hit1.
subDetId() > 2 )
return false;
168 std::cout <<
"isASeed: The first hits is on the pixel detector " << std::endl;
176 std::cout <<
"isASeed: rzok (1) = " << rzok << std::endl;
178 if ( !rzok )
return false;
191 }
else if ( hit2.
subDetId() == 2 ) {
197 std::cout <<
"isASeed: rzok (2) = " << rzok << std::endl;
199 if ( !rzok )
return false;
207 std::cout <<
"isASeed: elec1 to be propagated to first layer" << std::endl;
212 std::cout <<
"isASeed: posi1 to be propagated to first layer" << std::endl;
218 std::cout <<
"isASeed: elec1 / posi1 " << elec1 <<
" " << posi1 << std::endl;
221 if ( !elec1 && !posi1 )
return false;
227 std::cout <<
"isASeed: elec2 to be propagated to second layer" << std::endl;
233 std::cout <<
"isASeed: posi2 to be propagated to second layer" << std::endl;
239 std::cout <<
"isASeed: elec2 / posi2 " << elec2 <<
" " << posi2 << std::endl;
241 if ( !elec2 && !posi2 )
return false;
258 std::cout <<
"propagateToLayer: propagateToLayer: Before propagation (0) " << myPart << std::endl;
265 double zCyl =
thePixelLayers[layer]->forward() ? fabs(theHit.
z()) : 999.;
273 std::cout <<
"propagateToLayer: Success ? " << success << std::endl;
274 std::cout <<
"propagateToLayer: After propagation (1) " << myPart << std::endl;
275 std::cout <<
"propagateToLayer: The hit " << theHit << std::endl;
280 double dphi = myPart.
vertex().phi() - theHit.
phi();
282 dphi = dphi + 2.*
M_PI;
283 else if ( dphi >
M_PI )
284 dphi = dphi - 2.*
M_PI;
286 std::cout <<
"propagateToLayer: Phi range ? " << phimin <<
" < " << dphi <<
" < " << phimax << std::endl;
288 if ( dphi < phimin || dphi > phimax ) success =
false;
297 std::cout <<
"propagateToLayer: After propagation (2) " << myPart << std::endl;
313 double pxHitz = theHit.
z();
314 double pxHitr = theHit.
perp();
315 return pxHitz - pxHitr*(zCluster-pxHitz)/(rCluster-pxHitr);
323 float rzMin,
float rzMax,
329 double zHit = theHit.
z();
330 double rHit = theHit.
perp();
335 double checkRZ = forward ?
336 (zHit-
zVertex)/(zCluster-zVertex) * rCluster
338 zVertex + rHit * (zCluster-
zVertex)/rCluster;
344 checkRZ+rzMin < rHit && rHit < checkRZ+rzMax
346 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.
bool isOnTheSameLayer(const TrackerRecHit &other) const
Check if two hits are on the same layer of the same subdetector.
std::vector< const TrackerLayer * > thePixelLayers
virtual ~FastPixelHitMatcher()
double zVertex(double zCluster, double rCluster, GlobalPoint &theHit)
static RecHitPointer build(const GeomDet *geom, const TrackingRecHit *rh)
std::vector< std::pair< ConstRecHitPointer, ConstRecHitPointer > > compatibleHits(const GlobalPoint &xmeas, const GlobalPoint &vprim, float energy, std::vector< TrackerRecHit > &theHits)
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
bool isASeed(const ParticlePropagator &myElec, const ParticlePropagator &myPosi, const GlobalPoint &theVertex, double rCluster, double zCluster, const TrackerRecHit &hit1, const TrackerRecHit &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
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)
unsigned int subDetId() const
The subdet Id.
bool propagateToNominalVertex(const XYZTLorentzVector &hit2=XYZTLorentzVector(0., 0., 0., 0.))
void setES(const MagneticFieldMap *aFieldMap, const TrackerGeometry *aTrackerGeometry, const GeometricSearchTracker *geomSearchTracker, const TrackerInteractionGeometry *interactionGeometry)
void setVertex(const XYZTLorentzVector &vtx)
set the vertex
math::XYZTLorentzVector XYZTLorentzVector