33 float pphi1min,
float pphi1max,
34 float phi2min,
float phi2max,
35 float z2minB,
float z2maxB,
36 float r2minF,
float r2maxF,
37 float rMinI,
float rMaxI,
38 bool searchInTIDTEC) :
39 ephi1min(ephi1min), ephi1max(ephi1max),
40 pphi1min(pphi1min), pphi1max(pphi1max),
41 phi2min(phi2min), phi2max(phi2max),
42 z2minB(z2minB), z2maxB(z2maxB),
43 r2minF(r2minF), r2maxF(r2maxF),
44 rMinI(rMinI), rMaxI(rMaxI),
45 searchInTIDTEC(searchInTIDTEC),
46 theTrackerGeometry(0),
48 theGeomSearchTracker(0),
75 if ( layer != cyliter->layerNumber() )
continue;
86 std::vector<TrackerRecHit>& theHits) {
89 FastPixelHitMatcher::ConstRecHitPointer> >
result;
91 std::cout <<
"[FastPixelHitMatcher::compatibleHits] entering .. " << std::endl;
94 double zCluster = thePos.
z();
95 double rCluster = thePos.
perp();
98 double theLength = thePos.
mag();
100 theMom *= energy / theLength;
108 std::cout <<
"elec/posi before propagation " << std::endl << myElec << std::endl << myPosi << std::endl;
116 std::cout <<
"elec/posi after propagation " << std::endl << myElec << std::endl << myPosi << std::endl;
120 bool thereIsASeed =
false;
121 unsigned nHits = theHits.size();
123 for (
unsigned firstHit=0; firstHit<nHits-1; ++firstHit ) {
124 for (
unsigned secondHit=firstHit+1; secondHit<nHits; ++secondHit ) {
127 thereIsASeed =
isASeed(myElec,myPosi,theVertex,
133 std::cout <<
"Is there a seed with hits " << firstHit <<
" & "<< secondHit <<
"? " << thereIsASeed << std::endl;
135 if ( !thereIsASeed )
continue;
139 theHits[firstHit].
hit());
142 theHits[secondHit].
hit());
143 result.push_back(std::pair<
144 FastPixelHitMatcher::ConstRecHitPointer,
145 FastPixelHitMatcher::ConstRecHitPointer>(theFirstHit,theSecondHit));
164 std::cout <<
"isASeed: The two hits are not on the same layer - OK " << std::endl;
168 if ( hit1.
subDetId() > 2 )
return false;
170 std::cout <<
"isASeed: The first hits is on the pixel detector " << std::endl;
178 std::cout <<
"isASeed: rzok (1) = " << rzok << std::endl;
180 if ( !rzok )
return false;
193 }
else if ( hit2.
subDetId() == 2 ) {
199 std::cout <<
"isASeed: rzok (2) = " << rzok << std::endl;
201 if ( !rzok )
return false;
209 std::cout <<
"isASeed: elec1 to be propagated to first layer" << std::endl;
214 std::cout <<
"isASeed: posi1 to be propagated to first layer" << std::endl;
220 std::cout <<
"isASeed: elec1 / posi1 " << elec1 <<
" " << posi1 << std::endl;
223 if ( !elec1 && !posi1 )
return false;
229 std::cout <<
"isASeed: elec2 to be propagated to second layer" << std::endl;
235 std::cout <<
"isASeed: posi2 to be propagated to second layer" << std::endl;
241 std::cout <<
"isASeed: elec2 / posi2 " << elec2 <<
" " << posi2 << std::endl;
243 if ( !elec2 && !posi2 )
return false;
260 std::cout <<
"propagateToLayer: propagateToLayer: Before propagation (0) " << myPart << std::endl;
267 double zCyl =
thePixelLayers[layer]->forward() ? fabs(theHit.
z()) : 999.;
275 std::cout <<
"propagateToLayer: Success ? " << success << std::endl;
276 std::cout <<
"propagateToLayer: After propagation (1) " << myPart << std::endl;
277 std::cout <<
"propagateToLayer: The hit " << theHit << std::endl;
282 double dphi = myPart.
vertex().phi() - theHit.
phi();
284 dphi = dphi + 2.*
M_PI;
285 else if ( dphi >
M_PI )
286 dphi = dphi - 2.*
M_PI;
288 std::cout <<
"propagateToLayer: Phi range ? " << phimin <<
" < " << dphi <<
" < " << phimax << std::endl;
290 if ( dphi < phimin || dphi > phimax ) success =
false;
299 std::cout <<
"propagateToLayer: After propagation (2) " << myPart << std::endl;
315 double pxHitz = theHit.
z();
316 double pxHitr = theHit.
perp();
317 return pxHitz - pxHitr*(zCluster-pxHitz)/(rCluster-pxHitr);
325 float rzMin,
float rzMax,
331 double zHit = theHit.
z();
332 double rHit = theHit.
perp();
337 double checkRZ = forward ?
338 (zHit-
zVertex)/(zCluster-zVertex) * rCluster
340 zVertex + rHit * (zCluster-
zVertex)/rCluster;
346 checkRZ+rzMin < rHit && rHit < checkRZ+rzMax
348 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