60 |
|
<<" isInside: "<< globalGeometry->idToDet(det)->surface().bounds().inside( trackAtRPC.localPosition()) |
61 |
|
<< std::endl; |
62 |
|
*/ |
63 |
< |
float scale = 0.; |
63 |
> |
float propQuality = 0.; |
64 |
|
if ( trackAtRPC.localError().positionError().xx() > 2500 || trackAtRPC.localError().positionError().yy() > 2500) return false; |
65 |
< |
else if (trackAtRPC.localError().positionError().xx() > 1000 || trackAtRPC.localError().positionError().yy() > 1000) scale = 0; |
66 |
< |
else if (trackAtRPC.localError().positionError().xx() > 500 || trackAtRPC.localError().positionError().yy() > 500) scale = 1; |
67 |
< |
else if (trackAtRPC.localError().positionError().xx() > 100 || trackAtRPC.localError().positionError().yy() > 100) scale = 2; |
68 |
< |
else scale = 3.; |
65 |
> |
else if (trackAtRPC.localError().positionError().xx() > 1000 || trackAtRPC.localError().positionError().yy() > 1000) propQuality = 0; |
66 |
> |
else if (trackAtRPC.localError().positionError().xx() > 500 || trackAtRPC.localError().positionError().yy() > 500) propQuality = 1; |
67 |
> |
else if (trackAtRPC.localError().positionError().xx() > 100 || trackAtRPC.localError().positionError().yy() > 100) propQuality = 2; |
68 |
> |
else propQuality = 3.; |
69 |
> |
|
70 |
> |
if (propQuality < theConfig.getParameter<int>("checkRpcDetMatching_minPropagationQuality") ) return false; |
71 |
> |
double scale = theConfig.getParameter<bool>("checkRpcDetMatching_matchingScaleAuto") ? propQuality : theConfig.getParameter<double>("checkRpcDetMatching_matchingScaleValue") ; |
72 |
|
|
73 |
|
bool inside = globalGeometry->idToDet(det)->surface().bounds().inside( trackAtRPC.localPosition(), trackAtRPC.localError().positionError(), scale); |
74 |
|
//std::cout<<"In:"<<inside <<" detector r:" << detPos.perp()<<" phi:"<<detPos.phi()<<" z:"<<detPos.z() |
90 |
|
LocalError trackAtRPCError = trackAtRPC.localError().positionError(); |
91 |
|
|
92 |
|
edm::Handle<RPCRecHitCollection> rpcHits; |
93 |
< |
ev.getByType(rpcHits); |
93 |
> |
std::vector<edm::Handle<RPCRecHitCollection> > handle_vec; |
94 |
> |
ev.getManyByType(handle_vec); |
95 |
> |
if(handle_vec.size()) rpcHits = handle_vec[0]; |
96 |
|
bool matched = false; |
97 |
|
bool unique = true; |
98 |
|
pair<RPCRecHitCollection::const_iterator, RPCRecHitCollection::const_iterator> recHitsInDet = rpcHits->get(det); |
102 |
|
float distX = hitPoint.x()-trackAtRPCPoint.x(); |
103 |
|
float pullX = distX/ sqrt( trackAtRPCError.xx()+hitError.xx()); |
104 |
|
|
105 |
< |
if (fabs(pullX) < 2. && fabs(distX) < 5.) { |
105 |
> |
if ( fabs(pullX) < theConfig.getParameter<double>("checkUniqueRecHitMatching_maxPull") |
106 |
> |
&& fabs(distX) < theConfig.getParameter<double>("checkUniqueRecHitMatching_maxDist") ) { |
107 |
|
matched = true; |
108 |
|
} else { |
109 |
|
unique = false; |