CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
PixelHitMatcher Class Reference

#include <PixelHitMatcher.h>

Public Types

typedef
TransientTrackingRecHit::ConstRecHitPointer 
ConstRecHitPointer
 
typedef
TransientTrackingRecHit::RecHitContainer 
RecHitContainer
 
typedef
TransientTrackingRecHit::RecHitPointer 
RecHitPointer
 

Public Member Functions

std::vector< std::pair
< RecHitWithDist,
ConstRecHitPointer > > 
compatibleHits (const GlobalPoint &xmeas, const GlobalPoint &vprim, float energy, float charge)
 
std::vector< SeedWithInfocompatibleSeeds (TrajectorySeedCollection *seeds, const GlobalPoint &xmeas, const GlobalPoint &vprim, float energy, float charge)
 
float getVertex ()
 
 PixelHitMatcher (float phi1min, float phi1max, float phi2minB, float phi2maxB, float phi2minF, float phi2maxF, float z2minB, float z2maxB, float r2minF, float r2maxF, float rMinI, float rMaxI, bool searchInTIDTEC)
 
std::vector< CLHEP::Hep3Vector > predicted1Hits ()
 
std::vector< CLHEP::Hep3Vector > predicted2Hits ()
 
void set1stLayer (float dummyphi1min, float dummyphi1max)
 
void set1stLayerZRange (float zmin1, float zmax1)
 
void set2ndLayer (float dummyphi2minB, float dummyphi2maxB, float dummyphi2minF, float dummyphi2maxF)
 
void setES (const MagneticField *, const MeasurementTracker *theMeasurementTracker, const TrackerGeometry *trackerGeometry)
 
void setUseRecoVertex (bool val)
 
virtual ~PixelHitMatcher ()
 

Private Attributes

RecHitContainer hitsInTrack
 
std::vector< std::pair
< std::pair< const GeomDet
*, GlobalPoint >
, TrajectoryStateOnSurface > > 
mapTsos2_
 
std::vector< std::pair< const
GeomDet
*, TrajectoryStateOnSurface > > 
mapTsos_
 
BarrelMeasurementEstimator meas1stBLayer
 
ForwardMeasurementEstimator meas1stFLayer
 
BarrelMeasurementEstimator meas2ndBLayer
 
ForwardMeasurementEstimator meas2ndFLayer
 
FTSFromVertexToPointFactory myFTS
 
std::vector< CLHEP::Hep3Vector > pred1Meas
 
std::vector< CLHEP::Hep3Vector > pred2Meas
 
PropagatorWithMaterialprop1stLayer
 
PropagatorWithMaterialprop2ndLayer
 
bool searchInTIDTEC_
 
PixelMatchStartLayers startLayers
 
const GeometricSearchTrackertheGeometricSearchTracker
 
const LayerMeasurementstheLayerMeasurements
 
const MagneticFieldtheMagField
 
const TrackerGeometrytheTrackerGeometry
 
bool useRecoVertex_
 
float vertex_
 

Detailed Description

Description: Class to match an ECAL cluster to the pixel hits. Two compatible hits in the pixel layers are required.

Implementation: future redesign

Definition at line 140 of file PixelHitMatcher.h.

Member Typedef Documentation

Definition at line 144 of file PixelHitMatcher.h.

Definition at line 146 of file PixelHitMatcher.h.

Definition at line 145 of file PixelHitMatcher.h.

Constructor & Destructor Documentation

PixelHitMatcher::PixelHitMatcher ( float  phi1min,
float  phi1max,
float  phi2minB,
float  phi2maxB,
float  phi2minF,
float  phi2maxF,
float  z2minB,
float  z2maxB,
float  r2minF,
float  r2maxF,
float  rMinI,
float  rMaxI,
bool  searchInTIDTEC 
)

Definition at line 19 of file PixelHitMatcher.cc.

23  : //zmin1 and zmax1 are dummy at this moment, set from beamspot later
24  meas1stBLayer(phi1min,phi1max,0.,0.), meas2ndBLayer(phi2minB,phi2maxB,z2minB,z2maxB),
25  meas1stFLayer(phi1min,phi1max,0.,0.), meas2ndFLayer(phi2minF,phi2maxF,r2minF,r2maxF),
26  startLayers(),
28  searchInTIDTEC_(searchInTIDTEC), useRecoVertex_(false)
29  {
30  meas1stFLayer.setRRangeI(rMinI,rMaxI) ;
31  meas2ndFLayer.setRRangeI(rMinI,rMaxI) ;
32  }
BarrelMeasurementEstimator meas2ndBLayer
BarrelMeasurementEstimator meas1stBLayer
PropagatorWithMaterial * prop1stLayer
PixelMatchStartLayers startLayers
const GeometricSearchTracker * theGeometricSearchTracker
ForwardMeasurementEstimator meas2ndFLayer
PropagatorWithMaterial * prop2ndLayer
ForwardMeasurementEstimator meas1stFLayer
const LayerMeasurements * theLayerMeasurements
void setRRangeI(float rmin, float rmax)
PixelHitMatcher::~PixelHitMatcher ( )
virtual

Definition at line 34 of file PixelHitMatcher.cc.

35  {
36  delete prop1stLayer ;
37  delete prop2ndLayer ;
38  delete theLayerMeasurements ;
39  }
PropagatorWithMaterial * prop1stLayer
PropagatorWithMaterial * prop2ndLayer
const LayerMeasurements * theLayerMeasurements

Member Function Documentation

vector< pair< RecHitWithDist, PixelHitMatcher::ConstRecHitPointer > > PixelHitMatcher::compatibleHits ( const GlobalPoint xmeas,
const GlobalPoint vprim,
float  energy,
float  charge 
)

Definition at line 251 of file PixelHitMatcher.cc.

References abs, DeDxDiscriminatorTools::charge(), i, TrajectoryStateOnSurface::isValid(), LogDebug, m, PixelMatchNextLayers::measurementsInNextLayers(), FreeTrajectoryState::momentum(), normalized_phi(), phi, PV3DBase< T, PVType, FrameType >::phi(), FreeTrajectoryState::position(), PixelMatchNextLayers::predictionInNextLayers(), Cylinder::radius(), query::result, BarrelDetLayer::specificSurface(), mathSSE::sqrt(), GeometricSearchDet::surface(), Surface::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

254  {
255  float SCl_phi = xmeas.phi();
256 
257  int charge = int(fcharge);
258  // return all compatible RecHit pairs (vector< TSiPixelRecHit>)
259  vector<pair<RecHitWithDist, ConstRecHitPointer> > result;
260  LogDebug("") << "[PixelHitMatcher::compatibleHits] entering .. ";
261 
262  vector<TrajectoryMeasurement> validMeasurements;
263  vector<TrajectoryMeasurement> invalidMeasurements;
264 
265  typedef vector<TrajectoryMeasurement>::const_iterator aMeas;
266 
267  pred1Meas.clear();
268  pred2Meas.clear();
269 
270  typedef vector<BarrelDetLayer*>::const_iterator BarrelLayerIterator;
271  BarrelLayerIterator firstLayer = startLayers.firstBLayer();
272 
273  FreeTrajectoryState fts =myFTS(theMagField,xmeas, vprim,
274  energy, charge);
275 
277  TrajectoryStateOnSurface tsos(fts, *bpb(fts.position(), fts.momentum()));
278 
279  if (tsos.isValid()) {
280  vector<TrajectoryMeasurement> pixelMeasurements =
281  theLayerMeasurements->measurements(**firstLayer,tsos,
283 
284  LogDebug("") <<"[PixelHitMatcher::compatibleHits] nbr of hits compatible with extrapolation to first layer: " << pixelMeasurements.size();
285  for (aMeas m=pixelMeasurements.begin(); m!=pixelMeasurements.end(); m++){
286  if (m->recHit()->isValid()) {
287  float localDphi = normalized_phi(SCl_phi-m->forwardPredictedState().globalPosition().phi()) ;
288  if(std::abs(localDphi)>2.5)continue;
289  CLHEP::Hep3Vector prediction(m->forwardPredictedState().globalPosition().x(),
290  m->forwardPredictedState().globalPosition().y(),
291  m->forwardPredictedState().globalPosition().z());
292  LogDebug("") << "[PixelHitMatcher::compatibleHits] compatible hit position " << m->recHit()->globalPosition();
293  LogDebug("") << "[PixelHitMatcher::compatibleHits] predicted position " << m->forwardPredictedState().globalPosition();
294  pred1Meas.push_back( prediction);
295 
296  validMeasurements.push_back(*m);
297 
298  LogDebug("") <<"[PixelHitMatcher::compatibleHits] Found a rechit in layer ";
299  const BarrelDetLayer *bdetl = dynamic_cast<const BarrelDetLayer *>(*firstLayer);
300  if (bdetl) {
301  LogDebug("") <<" with radius "<<bdetl->specificSurface().radius();
302  }
303  else LogDebug("") <<"Could not downcast!!";
304  }
305  }
306 
307 
308  // check if there are compatible 1st hits in the second layer
309  firstLayer++;
310 
311  vector<TrajectoryMeasurement> pixel2Measurements =
312  theLayerMeasurements->measurements(**firstLayer,tsos,
314 
315  for (aMeas m=pixel2Measurements.begin(); m!=pixel2Measurements.end(); m++){
316  if (m->recHit()->isValid()) {
317  float localDphi = normalized_phi(SCl_phi-m->forwardPredictedState().globalPosition().phi()) ;
318  if(std::abs(localDphi)>2.5)continue;
319  CLHEP::Hep3Vector prediction(m->forwardPredictedState().globalPosition().x(),
320  m->forwardPredictedState().globalPosition().y(),
321  m->forwardPredictedState().globalPosition().z());
322  pred1Meas.push_back( prediction);
323  LogDebug("") << "[PixelHitMatcher::compatibleHits] compatible hit position " << m->recHit()->globalPosition() << endl;
324  LogDebug("") << "[PixelHitMatcher::compatibleHits] predicted position " << m->forwardPredictedState().globalPosition() << endl;
325 
326  validMeasurements.push_back(*m);
327  LogDebug("") <<"[PixelHitMatcher::compatibleHits] Found a rechit in layer ";
328  const BarrelDetLayer *bdetl = dynamic_cast<const BarrelDetLayer *>(*firstLayer);
329  if (bdetl) {
330  LogDebug("") <<" with radius "<<bdetl->specificSurface().radius();
331  }
332  else LogDebug("") <<"Could not downcast!!";
333  }
334 
335  }
336  }
337 
338 
339  // check if there are compatible 1st hits the forward disks
340  typedef vector<ForwardDetLayer*>::const_iterator ForwardLayerIterator;
341  ForwardLayerIterator flayer;
342 
343  TrajectoryStateOnSurface tsosfwd(fts, *bpb(fts.position(), fts.momentum()));
344  if (tsosfwd.isValid()) {
345 
346  for (int i=0; i<2; i++) {
347  i == 0 ? flayer = startLayers.pos1stFLayer() : flayer = startLayers.neg1stFLayer();
348 
349  if (i==0 && xmeas.z() < -100. ) continue;
350  if (i==1 && xmeas.z() > 100. ) continue;
351 
352  vector<TrajectoryMeasurement> pixelMeasurements =
353  theLayerMeasurements->measurements(**flayer, tsosfwd,
355 
356  for (aMeas m=pixelMeasurements.begin(); m!=pixelMeasurements.end(); m++){
357  if (m->recHit()->isValid()) {
358  float localDphi = normalized_phi(SCl_phi-m->forwardPredictedState().globalPosition().phi());
359  if(std::abs(localDphi)>2.5)continue;
360  CLHEP::Hep3Vector prediction(m->forwardPredictedState().globalPosition().x(),
361  m->forwardPredictedState().globalPosition().y(),
362  m->forwardPredictedState().globalPosition().z());
363  pred1Meas.push_back( prediction);
364 
365  validMeasurements.push_back(*m);
366  }
367  }
368 
369  //check if there are compatible 1st hits the outer forward disks
370  if (searchInTIDTEC_) {
371  flayer++;
372 
373  vector<TrajectoryMeasurement> pixel2Measurements =
374  theLayerMeasurements->measurements(**flayer, tsosfwd,
376 
377  for (aMeas m=pixel2Measurements.begin(); m!=pixel2Measurements.end(); m++){
378  if (m->recHit()->isValid()) {
379  float localDphi = normalized_phi(SCl_phi-m->forwardPredictedState().globalPosition().phi()) ;
380  if(std::abs(localDphi)>2.5)continue;
381  CLHEP::Hep3Vector prediction(m->forwardPredictedState().globalPosition().x(),
382  m->forwardPredictedState().globalPosition().y(),
383  m->forwardPredictedState().globalPosition().z());
384  pred1Meas.push_back( prediction);
385 
386  validMeasurements.push_back(*m);
387  }
388  // else{std::cout<<" hit non valid "<<std::endl; }
389  } //end 1st hit in outer f disk
390  }
391  }
392  }
393 
394  // now we have the vector of all valid measurements of the first point
395  for (unsigned i=0; i<validMeasurements.size(); i++){
396 
397  const DetLayer * newLayer = theGeometricSearchTracker->detLayer(validMeasurements[i].recHit()->det()->geographicalId());
398 
399  double zVertex ;
400  if (!useRecoVertex_)
401  {
402  // we don't know the z vertex position, get it from linear extrapolation
403  // compute the z vertex from the cluster point and the found pixel hit
404  double pxHit1z = validMeasurements[i].recHit()->det()->surface().toGlobal(
405  validMeasurements[i].recHit()->localPosition()).z();
406  double pxHit1x = validMeasurements[i].recHit()->det()->surface().toGlobal(
407  validMeasurements[i].recHit()->localPosition()).x();
408  double pxHit1y = validMeasurements[i].recHit()->det()->surface().toGlobal(
409  validMeasurements[i].recHit()->localPosition()).y();
410  double r1diff = (pxHit1x-vprim.x())*(pxHit1x-vprim.x()) + (pxHit1y-vprim.y())*(pxHit1y-vprim.y());
411  r1diff=sqrt(r1diff);
412  double r2diff = (xmeas.x()-pxHit1x)*(xmeas.x()-pxHit1x) + (xmeas.y()-pxHit1y)*(xmeas.y()-pxHit1y);
413  r2diff=sqrt(r2diff);
414  zVertex = pxHit1z - r1diff*(xmeas.z()-pxHit1z)/r2diff;
415  }
416  else
417  {
418  // here we use the reco vertex z position
419  zVertex = vprim.z();
420  }
421 
422  if (i==0)
423  { vertex_ = zVertex; }
424 
425  GlobalPoint vertexPred(vprim.x(),vprim.y(),zVertex) ;
426  GlobalPoint hitPos( validMeasurements[i].recHit()->det()->surface().toGlobal( validMeasurements[i].recHit()->localPosition() ) ) ;
427 
428  FreeTrajectoryState secondFTS=myFTS(theMagField,hitPos,vertexPred,energy, charge);
429 
430  PixelMatchNextLayers secondHit(theLayerMeasurements, newLayer, secondFTS,
432  vector<CLHEP::Hep3Vector> predictions = secondHit.predictionInNextLayers();
433 
434  for (unsigned it = 0; it < predictions.size(); it++) pred2Meas.push_back(predictions[it]);
435 
436  // we may get more than one valid second measurements here even for single electrons:
437  // two hits from the same layer/disk (detector overlap) or from the loop over the
438  // next layers in EPMatchLoopNextLayers. Take only the 1st hit.
439 
440  if(!secondHit.measurementsInNextLayers().empty()){
441  for(unsigned int shit=0; shit<secondHit.measurementsInNextLayers().size(); shit++)
442  {
443  float dphi = normalized_phi(pred1Meas[i].phi()-validMeasurements[i].recHit()->globalPosition().phi()) ;
444  if (std::abs(dphi)<2.5)
445  {
446  ConstRecHitPointer pxrh = validMeasurements[i].recHit();
447  RecHitWithDist rh(pxrh,dphi);
448 
449  // pxrh = secondHit.measurementsInNextLayers()[0].recHit();
450  pxrh = secondHit.measurementsInNextLayers()[shit].recHit();
451 
452  pair<RecHitWithDist,ConstRecHitPointer> compatiblePair = pair<RecHitWithDist,ConstRecHitPointer>(rh,pxrh) ;
453  result.push_back(compatiblePair);
454  break;
455  }
456  }
457  }
458  }
459  return result;
460 }
#define LogDebug(id)
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
std::vector< TrajectoryMeasurement > measurements(const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
int i
Definition: DBlmapReader.cc:9
BarrelMeasurementEstimator meas2ndBLayer
BarrelMeasurementEstimator meas1stBLayer
PropagatorWithMaterial * prop1stLayer
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
std::vector< CLHEP::Hep3Vector > pred1Meas
T y() const
Definition: PV3DBase.h:62
#define abs(x)
Definition: mlp_lapack.h:159
ForwardLayerIterator neg1stFLayer()
double charge(const std::vector< uint8_t > &Ampls)
FTSFromVertexToPointFactory myFTS
BarrelLayerIterator firstBLayer()
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:55
RealType normalized_phi(RealType phi)
T sqrt(T t)
Definition: SSEVec.h:46
T z() const
Definition: PV3DBase.h:63
tuple result
Definition: query.py:137
const MagneticField * theMagField
const DetLayer * detLayer(const DetId &id) const
obsolete method. Use idToLayer() instead.
ForwardLayerIterator pos1stFLayer()
GlobalVector momentum() const
GlobalPoint position() const
PixelMatchStartLayers startLayers
virtual const BoundCylinder & specificSurface() const
Extension of the interface.
const GeometricSearchTracker * theGeometricSearchTracker
std::vector< CLHEP::Hep3Vector > pred2Meas
ForwardMeasurementEstimator meas2ndFLayer
PropagatorWithMaterial * prop2ndLayer
ForwardMeasurementEstimator meas1stFLayer
const LayerMeasurements * theLayerMeasurements
T x() const
Definition: PV3DBase.h:61
Definition: DDAxes.h:10
std::vector< SeedWithInfo > PixelHitMatcher::compatibleSeeds ( TrajectorySeedCollection seeds,
const GlobalPoint xmeas,
const GlobalPoint vprim,
float  energy,
float  charge 
)

Definition at line 98 of file PixelHitMatcher.cc.

References abs, DeDxDiscriminatorTools::charge(), EleRelPointPair::dZ(), newFWLiteAna::found, TrajectoryStateOnSurface::globalParameters(), i, TrajectoryStateOnSurface::isValid(), FreeTrajectoryState::momentum(), normalized_phi(), PV3DBase< T, PVType, FrameType >::phi(), GlobalTrajectoryParameters::position(), FreeTrajectoryState::position(), query::result, edm::second(), mathSSE::sqrt(), DetId::subdetId(), GeomDet::surface(), Surface::toGlobal(), funct::true, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

100  {
101  int charge = int(fcharge) ;
102 
103  FreeTrajectoryState fts = myFTS(theMagField,xmeas, vprim, energy, charge);
105  TrajectoryStateOnSurface tsos(fts, *bpb(fts.position(), fts.momentum()));
106 
107  std::vector<SeedWithInfo> result ;
108  mapTsos_.clear() ;
109  mapTsos2_.clear() ;
110  mapTsos_.reserve(seeds->size()) ;
111  mapTsos2_.reserve(seeds->size()) ;
112 
113  for (unsigned int i=0;i<seeds->size();++i)
114  {
115  if ((*seeds)[i].nHits()>9)
116  {
117  edm::LogWarning("GsfElectronAlgo|UnexpectedSeed") <<"We cannot deal with seeds having more than 9 hits." ;
118  continue ;
119  }
120  TrajectorySeed::range rhits=(*seeds)[i].recHits() ;
121 
122  // build all possible pairs
123  unsigned char rank1, rank2, hitsMask ;
125  for ( rank1=0, it1=rhits.first ; it1!=rhits.second ; rank1++, it1++ )
126  {
127  for ( rank2=rank1+1, it2=it1+1 ; it2!=rhits.second ; rank2++, it2++ )
128  {
129  //TrajectorySeed::range r(it1,it2) ;
130 
131  // first Hit
133  if (!(*it).isValid()) continue;
134  DetId id=(*it).geographicalId();
135  const GeomDet *geomdet=theTrackerGeometry->idToDet((*it).geographicalId());
136  LocalPoint lp=(*it).localPosition() ;
137  GlobalPoint hitPos=geomdet->surface().toGlobal(lp) ;
138 
140  bool found = false;
141  std::vector<std::pair<const GeomDet *, TrajectoryStateOnSurface> >::iterator itTsos ;
142  for (itTsos=mapTsos_.begin();itTsos!=mapTsos_.end();++itTsos)
143  {
144  if ((*itTsos).first==geomdet)
145  { found=true ; break ; }
146  }
147  if (!found)
148  {
149  tsos1 = prop1stLayer->propagate(tsos,geomdet->surface()) ;
150  mapTsos_.push_back(std::pair<const GeomDet *, TrajectoryStateOnSurface>(geomdet,tsos1));
151  }
152  else
153  { tsos1=(*itTsos).second ; }
154 
155  if (tsos1.isValid())
156  {
157  std::pair<bool,double> est;
158  if (id.subdetId()%2==1) est=meas1stBLayer.estimate(vprim, tsos1,hitPos);
159  else est=meas1stFLayer.estimate(vprim, tsos1,hitPos);
160  if (!est.first) continue ;
161 
162  if (std::abs(normalized_phi(hitPos.phi()-xmeas.phi()))>2.5) continue ;
163  EleRelPointPair pp1(hitPos,tsos1.globalParameters().position(),vprim) ;
164  int subDet1 = id.subdetId() ;
165  float dRz1 = (subDet1%2==1)?pp1.dZ():pp1.dPerp() ;
166  float dPhi1 = pp1.dPhi() ;
167 
168  // now second Hit
169  //CC@@
170  //it++;
171  it=it2 ;
172  if (!(*it).isValid()) continue ;
173 
174  DetId id2=(*it).geographicalId();
175  const GeomDet *geomdet2=theTrackerGeometry->idToDet((*it).geographicalId());
177 
178  double zVertex;
179  if (!useRecoVertex_) // we don't know the z vertex position, get it from linear extrapolation
180  {
181  // compute the z vertex from the cluster point and the found pixel hit
182  double pxHit1z = hitPos.z();
183  double pxHit1x = hitPos.x();
184  double pxHit1y = hitPos.y();
185  double r1diff = (pxHit1x-vprim.x())*(pxHit1x-vprim.x()) + (pxHit1y-vprim.y())*(pxHit1y-vprim.y()) ;
186  r1diff=sqrt(r1diff) ;
187  double r2diff = (xmeas.x()-pxHit1x)*(xmeas.x()-pxHit1x) + (xmeas.y()-pxHit1y)*(xmeas.y()-pxHit1y) ;
188  r2diff=sqrt(r2diff);
189  zVertex = pxHit1z - r1diff*(xmeas.z()-pxHit1z)/r2diff;
190  }
191  else // here use rather the reco vertex z position
192  { zVertex = vprim.z() ; }
193 
194  GlobalPoint vertex(vprim.x(),vprim.y(),zVertex) ;
195  FreeTrajectoryState fts2 = myFTS(theMagField,hitPos,vertex,energy, charge) ;
196 
197  found = false;
198  std::vector<std::pair< std::pair<const GeomDet *,GlobalPoint>, TrajectoryStateOnSurface> >::iterator itTsos2 ;
199  for (itTsos2=mapTsos2_.begin();itTsos2!=mapTsos2_.end();++itTsos2)
200  {
201  if (((*itTsos2).first).first==geomdet2 &&
202  (((*itTsos2).first).second).x()==hitPos.x() &&
203  (((*itTsos2).first).second).y()==hitPos.y() &&
204  (((*itTsos2).first).second).z()==hitPos.z() )
205  {
206  found=true;
207  break;
208  }
209  }
210  if (!found)
211  {
212  tsos2 = prop2ndLayer->propagate(fts2,geomdet2->surface()) ;
213  std::pair<const GeomDet *,GlobalPoint> pair(geomdet2,hitPos);
214  mapTsos2_.push_back(std::pair<std::pair<const GeomDet *,GlobalPoint>, TrajectoryStateOnSurface> (pair,tsos2));
215  }
216  else
217  { tsos2=(*itTsos2).second ; }
218 
219  if (tsos2.isValid())
220  {
221  LocalPoint lp2=(*it).localPosition() ;
222  GlobalPoint hitPos2=geomdet2->surface().toGlobal(lp2) ;
223  std::pair<bool,double> est2 ;
224  if (id2.subdetId()%2==1) est2=meas2ndBLayer.estimate(vertex, tsos2,hitPos2) ;
225  else est2=meas2ndFLayer.estimate(vertex, tsos2,hitPos2) ;
226  if (est2.first)
227  {
228  EleRelPointPair pp2(hitPos2,tsos2.globalParameters().position(),vertex) ;
229  int subDet2 = id2.subdetId() ;
230  float dRz2 = (subDet2%2==1)?pp2.dZ():pp2.dPerp() ;
231  float dPhi2 = pp2.dPhi() ;
232  hitsMask = (1<<rank1)|(1<<rank2) ;
233  result.push_back(SeedWithInfo((*seeds)[i],hitsMask,subDet2,dRz2,dPhi2,subDet1,dRz1,dPhi1)) ;
234  }
235  }
236  } // end tsos1 is valid
237  } // end loop on second seed hit
238  } // end loop on first seed hit
239  } // end loop on seeds
240 
241  mapTsos_.clear() ;
242  mapTsos2_.clear() ;
243 
244  return result ;
245  }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
int i
Definition: DBlmapReader.cc:9
BarrelMeasurementEstimator meas2ndBLayer
BarrelMeasurementEstimator meas1stBLayer
virtual std::pair< bool, double > estimate(const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const
PropagatorWithMaterial * prop1stLayer
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
T y() const
Definition: PV3DBase.h:62
#define abs(x)
Definition: mlp_lapack.h:159
double charge(const std::vector< uint8_t > &Ampls)
FTSFromVertexToPointFactory myFTS
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::pair< const GeomDet *, GlobalPoint >, TrajectoryStateOnSurface > > mapTsos2_
recHitContainer::const_iterator const_iterator
RealType normalized_phi(RealType phi)
T sqrt(T t)
Definition: SSEVec.h:46
T z() const
Definition: PV3DBase.h:63
tuple result
Definition: query.py:137
const MagneticField * theMagField
std::pair< const_iterator, const_iterator > range
virtual std::pair< bool, double > estimate(const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
virtual const GeomDet * idToDet(DetId) const
GlobalVector momentum() const
virtual TrajectoryStateOnSurface propagate(const TrajectoryStateOnSurface &tsos, const Plane &plane) const
Definition: DetId.h:20
GlobalPoint position() const
const GlobalTrajectoryParameters & globalParameters() const
std::vector< std::pair< const GeomDet *, TrajectoryStateOnSurface > > mapTsos_
ForwardMeasurementEstimator meas2ndFLayer
PropagatorWithMaterial * prop2ndLayer
const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
ForwardMeasurementEstimator meas1stFLayer
T x() const
Definition: PV3DBase.h:61
const TrackerGeometry * theTrackerGeometry
float PixelHitMatcher::getVertex ( )

Definition at line 90 of file PixelHitMatcher.cc.

91  { return vertex_ ; }
vector< CLHEP::Hep3Vector > PixelHitMatcher::predicted1Hits ( )

Definition at line 84 of file PixelHitMatcher.cc.

85  { return pred1Meas ; }
std::vector< CLHEP::Hep3Vector > pred1Meas
vector< CLHEP::Hep3Vector > PixelHitMatcher::predicted2Hits ( )

Definition at line 87 of file PixelHitMatcher.cc.

88  { return pred2Meas ; }
std::vector< CLHEP::Hep3Vector > pred2Meas
void PixelHitMatcher::set1stLayer ( float  dummyphi1min,
float  dummyphi1max 
)

Definition at line 41 of file PixelHitMatcher.cc.

42  {
43  meas1stBLayer.setPhiRange(dummyphi1min,dummyphi1max) ;
44  meas1stFLayer.setPhiRange(dummyphi1min,dummyphi1max) ;
45  }
BarrelMeasurementEstimator meas1stBLayer
void setPhiRange(float dummyphiMin, float dummyphiMax)
void setPhiRange(float dummyphiMin, float dummyphiMax)
ForwardMeasurementEstimator meas1stFLayer
void PixelHitMatcher::set1stLayerZRange ( float  zmin1,
float  zmax1 
)

Definition at line 47 of file PixelHitMatcher.cc.

48  {
49  meas1stBLayer.setZRange(zmin1,zmax1) ;
50  meas1stFLayer.setRRange(zmin1,zmax1) ;
51  }
BarrelMeasurementEstimator meas1stBLayer
void setZRange(float zmin, float zmax)
ForwardMeasurementEstimator meas1stFLayer
void setRRange(float rmin, float rmax)
void PixelHitMatcher::set2ndLayer ( float  dummyphi2minB,
float  dummyphi2maxB,
float  dummyphi2minF,
float  dummyphi2maxF 
)

Definition at line 53 of file PixelHitMatcher.cc.

54  {
55  meas2ndBLayer.setPhiRange(dummyphi2minB,dummyphi2maxB) ;
56  meas2ndFLayer.setPhiRange(dummyphi2minF,dummyphi2maxF) ;
57  }
BarrelMeasurementEstimator meas2ndBLayer
void setPhiRange(float dummyphiMin, float dummyphiMax)
ForwardMeasurementEstimator meas2ndFLayer
void setPhiRange(float dummyphiMin, float dummyphiMax)
void PixelHitMatcher::setES ( const MagneticField magField,
const MeasurementTracker theMeasurementTracker,
const TrackerGeometry trackerGeometry 
)

Definition at line 63 of file PixelHitMatcher.cc.

References alongMomentum, scaleCards::mass, and oppositeToMomentum.

Referenced by ElectronSeedGenerator::setupES().

66  {
67  if (theMeasurementTracker)
68  {
69  theGeometricSearchTracker=theMeasurementTracker->geometricSearchTracker() ;
72  theLayerMeasurements = new LayerMeasurements(theMeasurementTracker) ;
73  }
74 
75  theMagField = magField ;
76  theTrackerGeometry = trackerGeometry ;
77  float mass=.000511 ; // electron propagation
78  if (prop1stLayer) delete prop1stLayer ;
80  if (prop2ndLayer) delete prop2ndLayer ;
82  }
PropagatorWithMaterial * prop1stLayer
void setup(const GeometricSearchTracker *)
const MagneticField * theMagField
PixelMatchStartLayers startLayers
const GeometricSearchTracker * theGeometricSearchTracker
PropagatorWithMaterial * prop2ndLayer
tuple mass
Definition: scaleCards.py:27
const LayerMeasurements * theLayerMeasurements
const TrackerGeometry * theTrackerGeometry
void PixelHitMatcher::setUseRecoVertex ( bool  val)

Definition at line 59 of file PixelHitMatcher.cc.

60  { useRecoVertex_ = val ; }

Member Data Documentation

RecHitContainer PixelHitMatcher::hitsInTrack
private

Definition at line 180 of file PixelHitMatcher.h.

std::vector<std::pair<std::pair<const GeomDet*,GlobalPoint>, TrajectoryStateOnSurface> > PixelHitMatcher::mapTsos2_
private

Definition at line 202 of file PixelHitMatcher.h.

std::vector<std::pair<const GeomDet*, TrajectoryStateOnSurface> > PixelHitMatcher::mapTsos_
private

Definition at line 201 of file PixelHitMatcher.h.

BarrelMeasurementEstimator PixelHitMatcher::meas1stBLayer
private

Definition at line 185 of file PixelHitMatcher.h.

ForwardMeasurementEstimator PixelHitMatcher::meas1stFLayer
private

Definition at line 187 of file PixelHitMatcher.h.

BarrelMeasurementEstimator PixelHitMatcher::meas2ndBLayer
private

Definition at line 186 of file PixelHitMatcher.h.

ForwardMeasurementEstimator PixelHitMatcher::meas2ndFLayer
private

Definition at line 188 of file PixelHitMatcher.h.

FTSFromVertexToPointFactory PixelHitMatcher::myFTS
private

Definition at line 184 of file PixelHitMatcher.h.

std::vector<CLHEP::Hep3Vector> PixelHitMatcher::pred1Meas
private

Definition at line 182 of file PixelHitMatcher.h.

std::vector<CLHEP::Hep3Vector> PixelHitMatcher::pred2Meas
private

Definition at line 183 of file PixelHitMatcher.h.

PropagatorWithMaterial* PixelHitMatcher::prop1stLayer
private

Definition at line 190 of file PixelHitMatcher.h.

PropagatorWithMaterial* PixelHitMatcher::prop2ndLayer
private

Definition at line 191 of file PixelHitMatcher.h.

bool PixelHitMatcher::searchInTIDTEC_
private

Definition at line 199 of file PixelHitMatcher.h.

PixelMatchStartLayers PixelHitMatcher::startLayers
private

Definition at line 189 of file PixelHitMatcher.h.

const GeometricSearchTracker* PixelHitMatcher::theGeometricSearchTracker
private

Definition at line 192 of file PixelHitMatcher.h.

const LayerMeasurements* PixelHitMatcher::theLayerMeasurements
private

Definition at line 193 of file PixelHitMatcher.h.

const MagneticField* PixelHitMatcher::theMagField
private

Definition at line 194 of file PixelHitMatcher.h.

const TrackerGeometry* PixelHitMatcher::theTrackerGeometry
private

Definition at line 195 of file PixelHitMatcher.h.

bool PixelHitMatcher::useRecoVertex_
private

Definition at line 200 of file PixelHitMatcher.h.

float PixelHitMatcher::vertex_
private

Definition at line 197 of file PixelHitMatcher.h.