CMS 3D CMS Logo

Public Types | Public Member Functions | Public Attributes

SiStripRecHitMatcher Class Reference

#include <SiStripRecHitMatcher.h>

List of all members.

Public Types

typedef boost::function< void(SiStripMatchedRecHit2D
const &)> 
Collector
typedef
SiStripMatchedRecHit2DCollectionNew::FastFiller 
CollectorMatched
typedef
SiStripRecHit2DCollectionNew::DetSet::const_iterator 
RecHitIterator
typedef std::vector< const
SiStripRecHit2D * > 
SimpleHitCollection
typedef
SimpleHitCollection::const_iterator 
SimpleHitIterator
typedef std::pair< LocalPoint,
LocalPoint
StripPosition

Public Member Functions

template<typename MonoIterator , typename StereoIterator , typename CollectorHelper >
void doubleMatch (MonoIterator monoRHiter, MonoIterator monoRHend, StereoIterator seconditer, StereoIterator seconditerend, const GluedGeomDet *gluedDet, LocalVector trdir, CollectorHelper &collectorHelper) const
void match (const SiStripRecHit2D *monoRH, SimpleHitIterator begin, SimpleHitIterator end, Collector &collector, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
 the actual implementation
void match (const SiStripRecHit2D *monoRH, SimpleHitIterator begin, SimpleHitIterator end, std::vector< SiStripMatchedRecHit2D * > &collector, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
SiStripMatchedRecHit2D * match (const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
edm::OwnVector
< SiStripMatchedRecHit2D > 
match (const SiStripRecHit2D *monoRH, SimpleHitIterator begin, SimpleHitIterator end, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
void match (const SiStripRecHit2D *monoRH, SimpleHitIterator begin, SimpleHitIterator end, CollectorMatched &collector, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
void match (const SiStripRecHit2D *monoRH, RecHitIterator begin, RecHitIterator end, CollectorMatched &collector, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
SiStripMatchedRecHit2D * match (const SiStripMatchedRecHit2D *originalRH, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
edm::OwnVector
< SiStripMatchedRecHit2D > 
match (const SiStripRecHit2D *monoRH, RecHitIterator begin, RecHitIterator end, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
void match (const SiStripRecHit2D *monoRH, SimpleHitIterator begin, SimpleHitIterator end, edm::OwnVector< SiStripMatchedRecHit2D > &collector, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
edm::OwnVector
< SiStripMatchedRecHit2D > 
match (const SiStripRecHit2D *monoRH, RecHitIterator begin, RecHitIterator end, const GluedGeomDet *gluedDet) const
StripPosition project (const GeomDetUnit *det, const GluedGeomDet *glueddet, StripPosition strip, LocalVector trackdirection) const
 SiStripRecHitMatcher (const edm::ParameterSet &conf)
 SiStripRecHitMatcher (const double theScale)

Public Attributes

float scale_

Detailed Description

Definition at line 23 of file SiStripRecHitMatcher.h.


Member Typedef Documentation

typedef boost::function<void(SiStripMatchedRecHit2D const&)> SiStripRecHitMatcher::Collector

Definition at line 33 of file SiStripRecHitMatcher.h.

Definition at line 27 of file SiStripRecHitMatcher.h.

Definition at line 29 of file SiStripRecHitMatcher.h.

typedef std::vector<const SiStripRecHit2D *> SiStripRecHitMatcher::SimpleHitCollection

Definition at line 30 of file SiStripRecHitMatcher.h.

typedef SimpleHitCollection::const_iterator SiStripRecHitMatcher::SimpleHitIterator

Definition at line 31 of file SiStripRecHitMatcher.h.

Definition at line 36 of file SiStripRecHitMatcher.h.


Constructor & Destructor Documentation

SiStripRecHitMatcher::SiStripRecHitMatcher ( const edm::ParameterSet conf)

Definition at line 18 of file SiStripRecHitMatcher.cc.

References edm::ParameterSet::getParameter(), and scale_.

                                                                     {   
  scale_=conf.getParameter<double>("NSigmaInside");  
}
SiStripRecHitMatcher::SiStripRecHitMatcher ( const double  theScale)

Definition at line 22 of file SiStripRecHitMatcher.cc.

References scale_.

                                                               {   
  scale_=theScale;  
}

Member Function Documentation

template<typename MonoIterator , typename StereoIterator , typename CollectorHelper >
void SiStripRecHitMatcher::doubleMatch ( MonoIterator  monoRHiter,
MonoIterator  monoRHend,
StereoIterator  seconditer,
StereoIterator  seconditerend,
const GluedGeomDet gluedDet,
LocalVector  trdir,
CollectorHelper &  collectorHelper 
) const

Definition at line 16 of file SSEMatcher.h.

References PV3DBase< T, PVType, FrameType >::basicVector(), alignmentValidation::c1, diffTreeTool::diff, error, f, GeomDet::geographicalId(), i, info, StripTopology::localPitch(), StripTopology::localPosition(), PV3DBase< T, PVType, FrameType >::mag2(), Topology::measurementError(), Topology::measurementPosition(), GluedGeomDet::monoDet(), VarParsing::mult, evf::evtn::offset(), position, query::result, indexGen::s2, scale_, GluedGeomDet::stereoDet(), GeomDet::surface(), GeomDetUnit::topology(), HelpertRecHit2DLocalPos::updateWithAPE(), MeasurementError::uu(), and x.

                                                                               {
  
  using  matcherDetails::StereoInfo;  
  using  mathSSE::Vec3F;
  using  mathSSE::Vec2D;
  using  mathSSE::Vec3D;
  using  mathSSE::Rot3F;
  typedef  GloballyPositioned<float> ToGlobal;
  typedef  typename GloballyPositioned<float>::ToLocal ToLocal;
  
  // hits in both mono and stero
  // match
  bool notk = trdir.mag2()<FLT_MIN;
  // FIXME we shall find a faster approximation for trdir: not useful to compute it each time for each strip
  
  // stripdet = mono
  // partnerstripdet = stereo
  const GeomDetUnit* stripdet = gluedDet->monoDet();
  const GeomDetUnit* partnerstripdet = gluedDet->stereoDet();
  const StripTopology& topol=(const StripTopology&)stripdet->topology();
  const StripTopology& partnertopol=(const StripTopology&)partnerstripdet->topology();
  
  // toGlobal is fast,  toLocal is slow
  ToGlobal const & stripDetTrans =  stripdet->surface();
  ToGlobal const & partnerStripDetTrans = partnerstripdet->surface();
  ToLocal          gluedDetInvTrans(gluedDet->surface());
  
  
  
  StereoInfo cache[std::distance(seconditer,seconditerend)];
  //iterate on stereo rechits
  // fill cache with relevant info
  int  cacheSize=0;
  for (;seconditer!=seconditerend; ++seconditer){
    
    const SiStripRecHit2D & secondHit = CollectorHelper::stereoHit(seconditer);
    
    double sigmap22 =secondHit.sigmaPitch();
    if (sigmap22<0) {
      LocalError tmpError( secondHit.localPositionErrorFast());
      HelpertRecHit2DLocalPos::updateWithAPE(tmpError, *partnerstripdet);
      MeasurementError errorstereoRH=partnertopol.measurementError(secondHit.localPositionFast(),tmpError);
      
      double pitch=partnertopol.localPitch(secondHit.localPositionFast());
      secondHit.setSigmaPitch(sigmap22=errorstereoRH.uu()*pitch*pitch);
    }
    
    
    double STEREOpointX=partnertopol.measurementPosition( secondHit.localPositionFast()).x();
    MeasurementPoint STEREOpointini(STEREOpointX,-0.5);
    MeasurementPoint STEREOpointend(STEREOpointX,0.5);
    
    LocalPoint locp1 = partnertopol.localPosition(STEREOpointini);
    LocalPoint locp2 = partnertopol.localPosition(STEREOpointend);
    
    GlobalPoint globalpointini=partnerStripDetTrans.toGlobal(locp1);
    GlobalPoint globalpointend=partnerStripDetTrans.toGlobal(locp2);
    
    // position of the initial and final point of the strip in glued local coordinates
    LocalPoint positiononGluedini=gluedDetInvTrans.toLocal(globalpointini);
    LocalPoint positiononGluedend=gluedDetInvTrans.toLocal(globalpointend); 
    
   // in case of no track hypothesis assume a track from the origin through the center of the strip
    if(notk){
      LocalPoint lcenterofstrip=secondHit.localPositionFast();
      GlobalPoint gcenterofstrip= partnerStripDetTrans.toGlobal(lcenterofstrip);
      GlobalVector gtrackdirection=gcenterofstrip-GlobalPoint(0,0,0);
      trdir=gluedDetInvTrans.toLocal(gtrackdirection);
    }
  

    Vec3F offset = trdir.basicVector().v * positiononGluedini.basicVector().v.get1<2>()/trdir.basicVector().v.get1<2>();
    
    
    Vec3F ret1 = positiononGluedini.basicVector().v - offset;
    Vec3F ret2 = positiononGluedend.basicVector().v - offset;
    
    double m10=-(ret2.arr[1] - ret1.arr[1]); 
    double m11=  ret2.arr[0] - ret1.arr[0];
    
    Vec2D c1vec; c1vec.set1(m11*ret1.arr[1] + m10 * ret1.arr[0]);
    
    // store
    StereoInfo info = {c1vec,&secondHit,sigmap22,m10,m11};
    cache[cacheSize++] = info;
  }
  
  
  
  for (;monoRHiter != monoRHend; ++monoRHiter) {
    
    SiStripRecHit2D const & monoRH = CollectorHelper::monoHit(monoRHiter);
    
    // position of the initial and final point of the strip (RPHI cluster) in local strip coordinates
    double RPHIpointX = topol.measurementPosition(monoRH.localPositionFast()).x();
    MeasurementPoint RPHIpointini(RPHIpointX,-0.5);
    MeasurementPoint RPHIpointend(RPHIpointX,0.5);
    
    // position of the initial and final point of the strip in local coordinates (mono det)
    //StripPosition stripmono=StripPosition(topol.localPosition(RPHIpointini),topol.localPosition(RPHIpointend));
    LocalPoint locp1o = topol.localPosition(RPHIpointini);
    LocalPoint locp2o = topol.localPosition(RPHIpointend);
    
    
    // in case of no track hypothesis assume a track from the origin through the center of the strip
    if(notk){
      LocalPoint lcenterofstrip=monoRH.localPositionFast();
      GlobalPoint gcenterofstrip= stripDetTrans.toGlobal(lcenterofstrip);
      GlobalVector gtrackdirection=gcenterofstrip-GlobalPoint(0,0,0);
      trdir=gluedDetInvTrans.toLocal(gtrackdirection);
    }
    
    
    //project mono hit on glued det
    //StripPosition projectedstripmono=project(stripdet,gluedDet,stripmono,trackdirection);
    
    
    GlobalPoint globalpointini=stripDetTrans.toGlobal(locp1o);
    GlobalPoint globalpointend=stripDetTrans.toGlobal(locp2o);
    
    // position of the initial and final point of the strip in glued local coordinates
    LocalPoint positiononGluedini=gluedDetInvTrans.toLocal(globalpointini);
    LocalPoint positiononGluedend=gluedDetInvTrans.toLocal(globalpointend); 
    
    Vec3F offset = trdir.basicVector().v * positiononGluedini.basicVector().v.get1<2>()/trdir.basicVector().v.get1<2>();
    
    
    Vec3F projini= positiononGluedini.basicVector().v - offset;
    Vec3F projend = positiononGluedend.basicVector().v -offset;
    
    // ret1o = ret1o + (trdir * (ret1o.getSimd(2) / trdirz));
    // ret2o = ret2o + (trdir * (ret2o.getSimd(2) / trdirz));
    
    double m00 = -(projend.arr[1] - projini.arr[1]);//-(projectedstripmono.second.y()-projectedstripmono.first.y()); 
    double m01 =  (projend.arr[0] - projini.arr[0]); // (projectedstripmono.second.x()-projectedstripmono.first.x());
    double c0  =  m01*projini.arr[1] + m00*projini.arr[0];//m01*projectedstripmono.first.y()   + m00*projectedstripmono.first.x();
    
    Vec2D c0vec(c0,c0);
    Vec2D minv00(-m01, m00);
    
    //error calculation (the part that depends on mono RH only)
    double c1 = -m00;
    double s1 = -m01;
    double l1 = 1./(c1*c1+s1*s1);
    
    // FIXME: here for test...
    double sigmap12 = monoRH.sigmaPitch();
    if (sigmap12<0) {
      
      LocalError tmpError(monoRH.localPositionErrorFast());
      HelpertRecHit2DLocalPos::updateWithAPE(tmpError,*stripdet);
      MeasurementError errormonoRH=topol.measurementError(monoRH.localPositionFast(),tmpError);
      
      double pitch=topol.localPitch(monoRH.localPositionFast());
      monoRH.setSigmaPitch(sigmap12=errormonoRH.uu()*pitch*pitch);
    }

    //float code
    float fc1(c1), fs1(s1);
    Vec3F scc1(fs1, fc1, fc1, 0.f);
    Vec3F ssc1(fs1, fs1, fc1, 0.f);
    Vec3F l1vec; l1vec.set1(l1);
    const Vec3F cslsimd = scc1 * ssc1 * l1vec;
    Vec3F sigmap12simd; sigmap12simd.set1(sigmap12);
    
    for (int i=0; i!=cacheSize; ++i) {
      StereoInfo const si = cache[i];
      
      // match 
      Vec2D minv10(si.m11, -si.m10);
      Vec2D mult; mult.set1(1./(m00*si.m11 - m01*si.m10));
      Vec2D resultmatmul = mult * (minv10 * c0vec + minv00 * si.c1vec);
      
      Local2DPoint position(resultmatmul.arr[0], resultmatmul.arr[1]);
      
      // LocalError tempError (100,0,100);
      if (!((gluedDet->surface()).bounds().inside(position,10.f*scale_))) continue;                                                       
      
      double c2 = -si.m10;
      double s2 = -si.m11;
      double l2 = 1./(c2*c2+s2*s2);
      
      double diff=(c1*s2-c2*s1);
      double invdet2 = 1./(diff*diff*l1*l2);
      
      float fc2(c2), fs2(s2), fid2(invdet2);    
      Vec3F invdet2simd(fid2, -fid2, fid2, 0.f);
      Vec3F ccssimd(fs2, fc2, fc2, 0.f);
      Vec3F csssimd(fs2, fs2, fc2, 0.f);
      Vec3F l2simd; l2simd.set1(l2);
      Vec3F sigmap22simd; sigmap22simd.set1(si.sigmap22);
      Vec3F result = invdet2simd * (sigmap22simd * cslsimd + sigmap12simd * ccssimd * csssimd * l2simd);
      
      
      LocalError error(result.arr[0], result.arr[1], result.arr[2]);
      
      
      if((gluedDet->surface()).bounds().inside(position,error,scale_)){ //if it is inside the gluedet bonds
        
        //Change NSigmaInside in the configuration file to accept more hits
        //...and add it to the Rechit collection 
        
        collectorHelper.collector()(SiStripMatchedRecHit2D(LocalPoint(position), error,gluedDet->geographicalId() ,
                                                           &monoRH,si.secondHit));
      }
      
    } // loop on cache info
    
    collectorHelper.closure(monoRHiter);
  } // loop on mono hit
  
}
void SiStripRecHitMatcher::match ( const SiStripRecHit2D *  monoRH,
SimpleHitIterator  begin,
SimpleHitIterator  end,
Collector collector,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

the actual implementation

Definition at line 165 of file SiStripRecHitMatcher.cc.

References trackerHits::c, alignmentValidation::c1, diffTreeTool::diff, end, error, GeomDet::geographicalId(), StripTopology::localPitch(), StripTopology::localPosition(), m, PV3DBase< T, PVType, FrameType >::mag2(), Topology::measurementError(), Topology::measurementPosition(), GluedGeomDet::monoDet(), position, project(), indexGen::s2, scale_, GluedGeomDet::stereoDet(), GeomDet::surface(), toLocal(), GeomDetUnit::topology(), HelpertRecHit2DLocalPos::updateWithAPE(), MeasurementError::uu(), x, and create_public_lumi_plots::xy.

                                                               {
  // stripdet = mono
  // partnerstripdet = stereo
  const GeomDetUnit* stripdet = gluedDet->monoDet();
  const GeomDetUnit* partnerstripdet = gluedDet->stereoDet();
  const StripTopology& topol=(const StripTopology&)stripdet->topology();

  // position of the initial and final point of the strip (RPHI cluster) in local strip coordinates
  double RPHIpointX = topol.measurementPosition(monoRH->localPositionFast()).x();
  MeasurementPoint RPHIpointini(RPHIpointX,-0.5);
  MeasurementPoint RPHIpointend(RPHIpointX,0.5);

  // position of the initial and final point of the strip in local coordinates (mono det)
  StripPosition stripmono=StripPosition(topol.localPosition(RPHIpointini),topol.localPosition(RPHIpointend));

  if(trackdirection.mag2()<FLT_MIN){// in case of no track hypothesis assume a track from the origin through the center of the strip
    LocalPoint lcenterofstrip=monoRH->localPositionFast();
    GlobalPoint gcenterofstrip=(stripdet->surface()).toGlobal(lcenterofstrip);
    GlobalVector gtrackdirection=gcenterofstrip-GlobalPoint(0,0,0);
    trackdirection=(gluedDet->surface()).toLocal(gtrackdirection);
  }

  //project mono hit on glued det
  StripPosition projectedstripmono=project(stripdet,gluedDet,stripmono,trackdirection);
  const StripTopology& partnertopol=(const StripTopology&)partnerstripdet->topology();

  double m00 = -(projectedstripmono.second.y()-projectedstripmono.first.y()); 
  double m01 =  (projectedstripmono.second.x()-projectedstripmono.first.x());
  double c0  =  m01*projectedstripmono.first.y()   + m00*projectedstripmono.first.x();
 
  //error calculation (the part that depends on mono RH only)
  //  LocalVector  RPHIpositiononGluedendvector=projectedstripmono.second-projectedstripmono.first;
  /*
  double l1 = 1./RPHIpositiononGluedendvector.perp2();
  double c1 = RPHIpositiononGluedendvector.y();
  double s1 =-RPHIpositiononGluedendvector.x();
  */
  double c1 = -m00;
  double s1 = -m01;
  double l1 = 1./(c1*c1+s1*s1);

 
  // FIXME: here for test...
  double sigmap12 = monoRH->sigmaPitch();
  if (sigmap12<0) {
    //AlgebraicSymMatrix tmpMatrix = monoRH->parametersError();
    /*
    std::cout << "DEBUG START" << std::endl;
    std::cout << "APE mono,stereo,glued : " 
              << stripdet->alignmentPositionError()->globalError().cxx()  << " , "
              << partnerstripdet->alignmentPositionError()->globalError().cxx()  << " , "
              << gluedDet->alignmentPositionError()->globalError().cxx()  << std::endl;
    */
    LocalError tmpError(monoRH->localPositionErrorFast());
    HelpertRecHit2DLocalPos::updateWithAPE(tmpError,*stripdet);
    MeasurementError errormonoRH=topol.measurementError(monoRH->localPositionFast(),tmpError);
    /*
    std::cout << "localPosError.xx(), helper.xx(), param.xx(): "
         << monoRH->localPositionError().xx() << " , "
         << monoRH->parametersError()[0][0] << " , "
         << tmpMatrix[0][0] << std::endl;
    */
    //MeasurementError errormonoRH=topol.measurementError(monoRH->localPosition(),monoRH->localPositionError());
    double pitch=topol.localPitch(monoRH->localPositionFast());
    monoRH->setSigmaPitch(sigmap12=errormonoRH.uu()*pitch*pitch);
  }

  SimpleHitIterator seconditer;  

  for(seconditer=begin;seconditer!=end;++seconditer){//iterate on stereo rechits

    // position of the initial and final point of the strip (STEREO cluster)
    double STEREOpointX=partnertopol.measurementPosition((*seconditer)->localPositionFast()).x();
    MeasurementPoint STEREOpointini(STEREOpointX,-0.5);
    MeasurementPoint STEREOpointend(STEREOpointX,0.5);

    // position of the initial and final point of the strip in local coordinates (stereo det)
    StripPosition stripstereo(partnertopol.localPosition(STEREOpointini),partnertopol.localPosition(STEREOpointend));
 
    //project stereo hit on glued det
    StripPosition projectedstripstereo=project(partnerstripdet,gluedDet,stripstereo,trackdirection);

 
    double m10=-(projectedstripstereo.second.y()-projectedstripstereo.first.y()); 
    double m11=(projectedstripstereo.second.x()-projectedstripstereo.first.x());

   //perform the matching
   //(x2-x1)(y-y1)=(y2-y1)(x-x1)
    AlgebraicMatrix22 m; AlgebraicVector2 c; // FIXME understand why moving this initializer out of the loop changes the output!
    m(0,0)=m00; 
    m(0,1)=m01;
    m(1,0)=m10;
    m(1,1)=m11;
    c(0)=c0;
    c(1)=m11*projectedstripstereo.first.y()+m10*projectedstripstereo.first.x();
    m.Invert(); 
    AlgebraicVector2 solution = m * c;
    LocalPoint position(solution(0),solution(1));

    /*
    {
      double m00 = -(projectedstripmono.second.y()-projectedstripmono.first.y()); 
      double m01 =  (projectedstripmono.second.x()-projectedstripmono.first.x());
      double m10 = -(projectedstripstereo.second.y()-projectedstripstereo.first.y()); 
      double m11 =  (projectedstripstereo.second.x()-projectedstripstereo.first.x());
      double c0  =  m01*projectedstripmono.first.y()   + m00*projectedstripmono.first.x();
      double c1  =  m11*projectedstripstereo.first.y() + m10*projectedstripstereo.first.x();
      
      double invDet = 1./(m00*m11-m10*m01);
    }
    */

    //
    // temporary fix by tommaso
    //


    LocalError tempError (100,0,100);
    if (!((gluedDet->surface()).bounds().inside(position,tempError,scale_))) continue;                                                       

    // then calculate the error
    /*
    LocalVector  stereopositiononGluedendvector=projectedstripstereo.second-projectedstripstereo.first;
    double l2 = 1./stereopositiononGluedendvector.perp2();
    double c2 = stereopositiononGluedendvector.y(); 
    double s2 =-stereopositiononGluedendvector.x();
    */

    double c2 = -m10;
    double s2 = -m11;
    double l2 = 1./(c2*c2+s2*s2);


    // FIXME: here for test...
    double sigmap22 = (*seconditer)->sigmaPitch();
    if (sigmap22<0) {
      //AlgebraicSymMatrix tmpMatrix = (*seconditer)->parametersError();
      LocalError tmpError((*seconditer)->localPositionErrorFast());
      HelpertRecHit2DLocalPos::updateWithAPE(tmpError, *partnerstripdet);
      MeasurementError errorstereoRH=partnertopol.measurementError((*seconditer)->localPositionFast(),tmpError);
      //MeasurementError errorstereoRH=partnertopol.measurementError((*seconditer)->localPosition(),(*seconditer)->localPositionError());
      double pitch=partnertopol.localPitch((*seconditer)->localPositionFast());
      (*seconditer)->setSigmaPitch(sigmap22=errorstereoRH.uu()*pitch*pitch);
    }

    double diff=(c1*s2-c2*s1);
    double invdet2=1/(diff*diff*l1*l2);
    float xx= invdet2*(sigmap12*s2*s2*l2+sigmap22*s1*s1*l1);
    float xy=-invdet2*(sigmap12*c2*s2*l2+sigmap22*c1*s1*l1);
    float yy= invdet2*(sigmap12*c2*c2*l2+sigmap22*c1*c1*l1);
    LocalError error(xx,xy,yy);

    if((gluedDet->surface()).bounds().inside(position,error,scale_)){ //if it is inside the gluedet bonds
      //Change NSigmaInside in the configuration file to accept more hits
      //...and add it to the Rechit collection 

      const SiStripRecHit2D* secondHit = *seconditer;
      collector(SiStripMatchedRecHit2D(position, error,gluedDet->geographicalId() ,
                                       monoRH,secondHit));
    }
  }
}
void SiStripRecHitMatcher::match ( const SiStripRecHit2D *  monoRH,
SimpleHitIterator  begin,
SimpleHitIterator  end,
std::vector< SiStripMatchedRecHit2D * > &  collector,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

Definition at line 119 of file SiStripRecHitMatcher.cc.

References clone(), match(), and query::result.

                                                               {
  Collector result(boost::bind(&pb,boost::ref(collector),
                             boost::bind(&SiStripMatchedRecHit2D::clone,_1)));
  match(monoRH,begin,end,result,gluedDet,trackdirection);
}
void SiStripRecHitMatcher::match ( const SiStripRecHit2D *  monoRH,
SimpleHitIterator  begin,
SimpleHitIterator  end,
edm::OwnVector< SiStripMatchedRecHit2D > &  collector,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

Definition at line 98 of file SiStripRecHitMatcher.cc.

References match(), AlCaHLTBitMon_ParallelJobs::p, edm::OwnVector< T, P >::push_back(), and query::result.

                                                               {

  std::vector<SiStripMatchedRecHit2D*> result;
  result.reserve(end-begin);
  match(monoRH,begin,end,result,gluedDet,trackdirection);
  for (std::vector<SiStripMatchedRecHit2D*>::iterator p=result.begin(); p!=result.end();
       p++) collector.push_back(*p);
}
SiStripMatchedRecHit2D * SiStripRecHitMatcher::match ( const SiStripRecHit2D *  monoRH,
const SiStripRecHit2D *  stereoRH,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

Definition at line 28 of file SiStripRecHitMatcher.cc.

References runEdmFileComparison::collection.

Referenced by match().

                                                                                      {
  SimpleHitCollection stereoHits(1,stereoRH);
  std::vector<SiStripMatchedRecHit2D*>  collection;
  match( monoRH,
         stereoHits.begin(), stereoHits.end(),
         collection,
         gluedDet,trackdirection);
  
  return collection.empty() ? (SiStripMatchedRecHit2D*)(0) : collection.front();
}
edm::OwnVector<SiStripMatchedRecHit2D> SiStripRecHitMatcher::match ( const SiStripRecHit2D *  monoRH,
RecHitIterator  begin,
RecHitIterator  end,
const GluedGeomDet gluedDet 
) const [inline]

Definition at line 61 of file SiStripRecHitMatcher.h.

References match().

                                             {
    return match(monoRH,begin, end, gluedDet,LocalVector(0.,0.,0.));
  }
void SiStripRecHitMatcher::match ( const SiStripRecHit2D *  monoRH,
RecHitIterator  begin,
RecHitIterator  end,
CollectorMatched collector,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

Definition at line 132 of file SiStripRecHitMatcher.cc.

References end, i, and match().

                                                               {
  
  // is this really needed now????
  SimpleHitCollection stereoHits;
  stereoHits.reserve(end-begin);
  for (RecHitIterator i=begin; i != end; ++i) 
    stereoHits.push_back( &(*i)); // convert to simple pointer
  
  return match( monoRH,
                stereoHits.begin(), stereoHits.end(),
                collector,
                gluedDet,trackdirection);
}
edm::OwnVector< SiStripMatchedRecHit2D > SiStripRecHitMatcher::match ( const SiStripRecHit2D *  monoRH,
SimpleHitIterator  begin,
SimpleHitIterator  end,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

Definition at line 86 of file SiStripRecHitMatcher.cc.

References match(), and edm::OwnVector< T, P >::reserve().

                                                               {
  edm::OwnVector<SiStripMatchedRecHit2D> collector;
  collector.reserve(end-begin); // a resonable estimate of its size... 
  match(monoRH,begin,end,collector,gluedDet,trackdirection);
  return collector;
}
edm::OwnVector< SiStripMatchedRecHit2D > SiStripRecHitMatcher::match ( const SiStripRecHit2D *  monoRH,
RecHitIterator  begin,
RecHitIterator  end,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

Definition at line 69 of file SiStripRecHitMatcher.cc.

References end, i, and match().

{
  SimpleHitCollection stereoHits;
  stereoHits.reserve(end-begin);

  for (RecHitIterator i=begin; i != end; ++i) {
    stereoHits.push_back( &(*i)); // convert to simple pointer
  }
  return match( monoRH,
                stereoHits.begin(), stereoHits.end(), 
                gluedDet,trackdirection);
}
void SiStripRecHitMatcher::match ( const SiStripRecHit2D *  monoRH,
SimpleHitIterator  begin,
SimpleHitIterator  end,
CollectorMatched collector,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

Definition at line 151 of file SiStripRecHitMatcher.cc.

References match(), edmNew::DetSetVector< T >::FastFiller::push_back(), and query::result.

                                                               {

  Collector result(boost::bind(&CollectorMatched::push_back,boost::ref(collector),_1));
  match(monoRH,begin,end,result,gluedDet,trackdirection);
  
}
SiStripMatchedRecHit2D * SiStripRecHitMatcher::match ( const SiStripMatchedRecHit2D *  originalRH,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

Definition at line 43 of file SiStripRecHitMatcher.cc.

                                                                                     {
  
  throw "SiStripRecHitMatcher::match(const SiStripMatchedRecHit2D *,..) is obsoltete since 5.2.0"; 

  /*
  const SiStripRecHit2D* theMonoRH   = origRH->monoHit();
  // const SiStripRecHit2D* theStereoRH = origRH->stereoHit();
  SimpleHitCollection theStereoHits(1, origRH->stereoHit());
  // theStereoHits.push_back(theStereoRH);
  
  std::vector<SiStripMatchedRecHit2D*>  collection;
  match( theMonoRH,
         theStereoHits.begin(), theStereoHits.end(),
         collection,
         gluedDet,trackdirection);
  
  return collection.empty() ? (SiStripMatchedRecHit2D*)(0) : collection.front();
  */

  return nullptr;
}
SiStripRecHitMatcher::StripPosition SiStripRecHitMatcher::project ( const GeomDetUnit det,
const GluedGeomDet glueddet,
StripPosition  strip,
LocalVector  trackdirection 
) const

Definition at line 333 of file SiStripRecHitMatcher.cc.

References pileupReCalc_HLTpaths::scale, GeomDet::surface(), toLocal(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by match().

{

  GlobalPoint globalpointini=(det->surface()).toGlobal(strip.first);
  GlobalPoint globalpointend=(det->surface()).toGlobal(strip.second);

  // position of the initial and final point of the strip in glued local coordinates
  LocalPoint positiononGluedini=(glueddet->surface()).toLocal(globalpointini);
  LocalPoint positiononGluedend=(glueddet->surface()).toLocal(globalpointend);

  //correct the position with the track direction

  float scale=-positiononGluedini.z()/trackdirection.z();

  LocalPoint projpositiononGluedini= positiononGluedini + scale*trackdirection;
  LocalPoint projpositiononGluedend= positiononGluedend + scale*trackdirection;

  return StripPosition(projpositiononGluedini,projpositiononGluedend);
}

Member Data Documentation

Definition at line 130 of file SiStripRecHitMatcher.h.

Referenced by doubleMatch(), match(), and SiStripRecHitMatcher().