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, const TrackerTopology *tTopo)
 
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 setEvent (const MeasurementTrackerEvent &event)
 
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
 
std::vector< CLHEP::Hep3Vector > pred1Meas
 
std::vector< CLHEP::Hep3Vector > pred2Meas
 
PropagatorWithMaterialprop1stLayer
 
PropagatorWithMaterialprop2ndLayer
 
bool searchInTIDTEC_
 
PixelMatchStartLayers startLayers
 
const GeometricSearchTrackertheGeometricSearchTracker
 
LayerMeasurements theLayerMeasurements
 
const MagneticFieldtheMagField
 
const MeasurementTrackertheTracker
 
const MeasurementTrackerEventtheTrackerEvent
 
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 141 of file PixelHitMatcher.h.

Member Typedef Documentation

Definition at line 145 of file PixelHitMatcher.h.

Definition at line 147 of file PixelHitMatcher.h.

Definition at line 146 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 20 of file PixelHitMatcher.cc.

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

Definition at line 35 of file PixelHitMatcher.cc.

36  {
37  delete prop1stLayer ;
38  delete prop2ndLayer ;
39  }
PropagatorWithMaterial * prop1stLayer
PropagatorWithMaterial * prop2ndLayer

Member Function Documentation

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

Definition at line 255 of file PixelHitMatcher.cc.

References funct::abs(), DeDxDiscriminatorTools::charge(), FTSFromVertexToPointFactory::get(), i, TrajectoryStateOnSurface::isValid(), LogDebug, m, PixelMatchNextLayers::measurementsInNextLayers(), FreeTrajectoryState::momentum(), normalized_phi(), phi, PV3DBase< T, PVType, FrameType >::phi(), FreeTrajectoryState::position(), PixelMatchNextLayers::predictionInNextLayers(), 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().

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

Definition at line 102 of file PixelHitMatcher.cc.

References funct::abs(), DeDxDiscriminatorTools::charge(), EleRelPointPair::dZ(), newFWLiteAna::found, FTSFromVertexToPointFactory::get(), 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().

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

Definition at line 94 of file PixelHitMatcher.cc.

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

Definition at line 88 of file PixelHitMatcher.cc.

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

Definition at line 91 of file PixelHitMatcher.cc.

92  { 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 68 of file PixelHitMatcher.cc.

References alongMomentum, and oppositeToMomentum.

Referenced by ElectronSeedGenerator::setupES().

71  {
72  if (theMeasurementTracker)
73  {
74  theTracker = theMeasurementTracker;
75  theGeometricSearchTracker=theMeasurementTracker->geometricSearchTracker() ;
77  }
78 
79  theMagField = magField ;
80  theTrackerGeometry = trackerGeometry ;
81  float mass=.000511 ; // electron propagation
82  if (prop1stLayer) delete prop1stLayer ;
84  if (prop2ndLayer) delete prop2ndLayer ;
86  }
PropagatorWithMaterial * prop1stLayer
void setup(const GeometricSearchTracker *)
const MagneticField * theMagField
PixelMatchStartLayers startLayers
const GeometricSearchTracker * theGeometricSearchTracker
PropagatorWithMaterial * prop2ndLayer
const TrackerGeometry * theTrackerGeometry
const MeasurementTracker * theTracker
void PixelHitMatcher::setEvent ( const MeasurementTrackerEvent event)

Definition at line 62 of file PixelHitMatcher.cc.

63  {
64  theTrackerEvent = & trackerData;
66  }
LayerMeasurements theLayerMeasurements
const MeasurementTrackerEvent * theTrackerEvent
const MeasurementTracker * theTracker
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 185 of file PixelHitMatcher.h.

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

Definition at line 208 of file PixelHitMatcher.h.

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

Definition at line 207 of file PixelHitMatcher.h.

BarrelMeasurementEstimator PixelHitMatcher::meas1stBLayer
private

Definition at line 189 of file PixelHitMatcher.h.

ForwardMeasurementEstimator PixelHitMatcher::meas1stFLayer
private

Definition at line 191 of file PixelHitMatcher.h.

BarrelMeasurementEstimator PixelHitMatcher::meas2ndBLayer
private

Definition at line 190 of file PixelHitMatcher.h.

ForwardMeasurementEstimator PixelHitMatcher::meas2ndFLayer
private

Definition at line 192 of file PixelHitMatcher.h.

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

Definition at line 187 of file PixelHitMatcher.h.

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

Definition at line 188 of file PixelHitMatcher.h.

PropagatorWithMaterial* PixelHitMatcher::prop1stLayer
private

Definition at line 194 of file PixelHitMatcher.h.

PropagatorWithMaterial* PixelHitMatcher::prop2ndLayer
private

Definition at line 195 of file PixelHitMatcher.h.

bool PixelHitMatcher::searchInTIDTEC_
private

Definition at line 205 of file PixelHitMatcher.h.

PixelMatchStartLayers PixelHitMatcher::startLayers
private

Definition at line 193 of file PixelHitMatcher.h.

const GeometricSearchTracker* PixelHitMatcher::theGeometricSearchTracker
private

Definition at line 196 of file PixelHitMatcher.h.

LayerMeasurements PixelHitMatcher::theLayerMeasurements
private

Definition at line 199 of file PixelHitMatcher.h.

const MagneticField* PixelHitMatcher::theMagField
private

Definition at line 200 of file PixelHitMatcher.h.

const MeasurementTracker* PixelHitMatcher::theTracker
private

Definition at line 198 of file PixelHitMatcher.h.

const MeasurementTrackerEvent* PixelHitMatcher::theTrackerEvent
private

Definition at line 197 of file PixelHitMatcher.h.

const TrackerGeometry* PixelHitMatcher::theTrackerGeometry
private

Definition at line 201 of file PixelHitMatcher.h.

bool PixelHitMatcher::useRecoVertex_
private

Definition at line 206 of file PixelHitMatcher.h.

float PixelHitMatcher::vertex_
private

Definition at line 203 of file PixelHitMatcher.h.