CMS 3D CMS Logo

RPCSeedHits Class Reference

Author:
D.
More...

#include <RecoMuon/MuonSeedGenerator/src/RPCSeedHits.h>

List of all members.

Public Member Functions

void add (MuonTransientTrackingRecHit::MuonRecHitPointer hit)
MuonTransientTrackingRecHit::ConstMuonRecHitPointer firstRecHit () const
unsigned int nrhit () const
 RPCSeedHits ()
TrajectorySeed seed (const edm::EventSetup &eSetup) const

Private Types

typedef std::pair< const
GeomDet *,
TrajectoryStateOnSurface
DetWithState

Private Member Functions

MuonTransientTrackingRecHit::ConstMuonRecHitPointer best_cand () const
void computeBestPt (double *pt, double *spt, float &ptmean, float &sptmean) const
void computePtWithoutVtx (double *pt, double *spt) const
TrajectorySeed createSeed (float ptmean, float sptmean, MuonTransientTrackingRecHit::ConstMuonRecHitPointer last, const edm::EventSetup &eSetup) const

Private Attributes

MuonTransientTrackingRecHit::MuonRecHitContainer theRhits

Friends

class RPCSeedFinder


Detailed Description

Author:
D.

Pagano - University of Pavia & INFN Pavia

Definition at line 24 of file RPCSeedHits.h.


Member Typedef Documentation

typedef std::pair<const GeomDet*,TrajectoryStateOnSurface> RPCSeedHits::DetWithState [private]

Definition at line 25 of file RPCSeedHits.h.


Constructor & Destructor Documentation

RPCSeedHits::RPCSeedHits (  )  [inline]

Definition at line 28 of file RPCSeedHits.h.

00028 {}


Member Function Documentation

void RPCSeedHits::add ( MuonTransientTrackingRecHit::MuonRecHitPointer  hit  )  [inline]

Definition at line 30 of file RPCSeedHits.h.

References theRhits.

Referenced by RPCSeedFinder::seeds().

00030 { theRhits.push_back(hit); }

ConstMuonRecHitPointer RPCSeedHits::best_cand (  )  const [private]

Definition at line 63 of file RPCSeedHits.cc.

References iter, and theRhits.

Referenced by seed().

00063                                                     {
00064 
00065   MuonRecHitPointer best = 0;
00066 
00067   for (MuonRecHitContainer::const_iterator iter=theRhits.begin();
00068        iter!=theRhits.end(); iter++) {
00069        best = (*iter);
00070   } 
00071 
00072   return best;
00073 }

void RPCSeedHits::computeBestPt ( double *  pt,
double *  spt,
float &  ptmean,
float &  sptmean 
) const [private]

Definition at line 124 of file RPCSeedHits.cc.

References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().

Referenced by seed().

00127                                                       {
00128 
00129   cout << "[RPCSeedHits] --> computeBestPt class called." << endl;
00130 
00131   cout << "---< best pt computing >---" << endl;
00132   cout << "1-2-3 pt = " << pt[0] << endl;
00133   cout << "1-2-4 pt = " << pt[1] << endl;
00134   cout << "1-3-4 pt = " << pt[2] << endl;
00135   cout << "2-3-4 pt = " << pt[3] << endl;
00136   cout << "---------------------------" << endl;
00137 
00138   ptmean = (pt[0]+pt[1]+pt[2]+pt[3])/4;
00139 
00140   sptmean = spt[0];
00141   
00142 }

void RPCSeedHits::computePtWithoutVtx ( double *  pt,
double *  spt 
) const [private]

Definition at line 76 of file RPCSeedHits.cc.

References funct::A, bookConverter::comb, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), i, iter, funct::sqrt(), and theRhits.

Referenced by seed().

00076                                                                    {
00077 
00078   int i = 0;
00079   float y1,y2,y3,y4,ys,yt,yq,yd;
00080   float x1,x2,x3,x4,xs,xt,xq,xd;
00081   x1=x2=x3=x4=xs=xt=xq=xd=y1=y2=y3=y4=ys=yd=yt=yq=0;
00082   for (MuonRecHitContainer::const_iterator iter=theRhits.begin(); 
00083        iter!=theRhits.end(); iter++ ) {
00084     i++;
00085 
00086     cout << "X= " << (*iter)->globalPosition().x() << " Y= " << (*iter)->globalPosition().y() << endl;
00087 
00088     if (i == 1) {y1= (*iter)->globalPosition().y(); x1= (*iter)->globalPosition().x();}
00089     if (i == 2) {y2= (*iter)->globalPosition().y(); x2= (*iter)->globalPosition().x();}
00090     if (i == 3) {y3= (*iter)->globalPosition().y(); x3= (*iter)->globalPosition().x();}
00091     if (i == 4) {y4= (*iter)->globalPosition().y(); x4= (*iter)->globalPosition().x();}
00092   }
00093 
00094   string ord = "1-2-3";
00095   for (int comb = 1; comb < 5; comb++) {
00096     
00097     if (comb == 2) {
00098       ord = "1-2-4";
00099       yt=y3; y3=y4; y4=yq; xt=x3; x3=x4; x4=xq; 
00100     }
00101     
00102     if (comb == 3) {
00103       ord = "1-3-4";
00104       yd=y2; y2=yt; xd=x2; x2=xt;  
00105     }
00106     
00107     if (comb == 4) {
00108       ord = "2-3-4";
00109       ys=y1; y1=yd; xs=x1; x1=xd; 
00110     }
00111     
00112     float A = (y3-y2)/(x3-x2) - (y2-y1)/(x2-x1);
00113     float TYO = (x3-x1)/A + (y3*y3-y2*y2)/((x3-x2)*A) - (y2*y2-y1*y1)/((x2-x1)*A);
00114     float TXO = (x3+x2) + (y3*y3-y2*y2)/(x3-x2) - TYO*(y3-y2)/(x3-x2);
00115     float XO = 0.5 * TXO;
00116     float YO = 0.5 * TYO;
00117     float R2 = (x1-XO)*(x1-XO) + (y1-YO)*(y1-YO); 
00118     pt[comb-1] = 0.01 * sqrt(R2) * 2 * 0.3;
00119     }
00120      
00121 }

TrajectorySeed RPCSeedHits::createSeed ( float  ptmean,
float  sptmean,
MuonTransientTrackingRecHit::ConstMuonRecHitPointer  last,
const edm::EventSetup eSetup 
) const [private]

Definition at line 145 of file RPCSeedHits.cc.

References GenMuonPlsPt100GeV_cfg::cout, debug, MuonPatternRecoDumper::dumpMuonId(), MuonPatternRecoDumper::dumpTSOS(), lat::endl(), error, edm::EventSetup::get(), int, oppositeToMomentum, TrajectoryStateTransform::persistentState(), sqr(), t, and PV3DBase< T, PVType, FrameType >::theta().

Referenced by seed().

00148                                                                          {
00149   
00150   MuonPatternRecoDumper debug;
00151   
00152   edm::ESHandle<MagneticField> field;
00153   eSetup.get<IdealMagneticFieldRecord>().get(field);
00154 
00155   double theMinMomentum = 3.0;
00156  
00157   if ( fabs(ptmean) < theMinMomentum ) ptmean = theMinMomentum * ptmean/fabs(ptmean) ;
00158 
00159   AlgebraicVector t(4);
00160   AlgebraicSymMatrix mat(5,0) ;
00161 
00162   LocalPoint segPos=last->localPosition();
00163   GlobalVector mom=last->globalPosition()-GlobalPoint();
00164   GlobalVector polar(GlobalVector::Spherical(mom.theta(), last->globalDirection().phi(), 1.));
00165   polar *= fabs(ptmean)/polar.perp();
00166   LocalVector segDirFromPos=last->det()->toLocal(polar);
00167   int charge=(int)(ptmean/fabs(ptmean));
00168 
00169   LocalTrajectoryParameters param(segPos,segDirFromPos, charge);
00170 
00171   mat = last->parametersError().similarityT( last->projectionMatrix() );
00172   
00173   float p_err = sqr(sptmean/(ptmean*ptmean));
00174   mat[0][0]= p_err;
00175  
00176   LocalTrajectoryError error(mat);
00177   
00178   TrajectoryStateOnSurface tsos(param, error, last->det()->surface(),&*field);
00179 
00180   cout << "Trajectory State on Surface before the extrapolation"<<endl;
00181   cout << debug.dumpTSOS(tsos);
00182   
00183   DetId id = last->geographicalId();
00184 
00185   cout << "The RecSegment relies on: "<<endl;
00186   cout << debug.dumpMuonId(id);
00187   cout << debug.dumpTSOS(tsos);
00188 
00189   TrajectoryStateTransform tsTransform;
00190   
00191   PTrajectoryStateOnDet *seedTSOS = tsTransform.persistentState( tsos ,id.rawId());
00192   
00193   edm::OwnVector<TrackingRecHit> container;
00194   TrajectorySeed theSeed(*seedTSOS,container,oppositeToMomentum);
00195     
00196   return theSeed;
00197 }

MuonTransientTrackingRecHit::ConstMuonRecHitPointer RPCSeedHits::firstRecHit (  )  const [inline]

Definition at line 32 of file RPCSeedHits.h.

References theRhits.

00032 { return theRhits.front(); }

unsigned int RPCSeedHits::nrhit (  )  const [inline]

Definition at line 33 of file RPCSeedHits.h.

References theRhits.

00033 { return  theRhits.size(); }

TrajectorySeed RPCSeedHits::seed ( const edm::EventSetup eSetup  )  const

Definition at line 45 of file RPCSeedHits.cc.

References best_cand(), computeBestPt(), computePtWithoutVtx(), GenMuonPlsPt100GeV_cfg::cout, createSeed(), lat::endl(), and prof2calltree::last.

Referenced by RPCSeedFinder::seeds().

00045                                                                   {
00046 
00047   double pt[4] = {0,0,0,0};
00048   double spt[4] = {0,0,0,0}; 
00049   
00050   computePtWithoutVtx(pt, spt);
00051   
00052   float ptmean=0.;
00053   float sptmean=0.;
00054 
00055   computeBestPt(pt, spt, ptmean, sptmean);
00056   
00057   cout << "III--> Seed Pt : " << ptmean << endl;
00058   ConstMuonRecHitPointer last = best_cand();
00059   return createSeed(ptmean, sptmean,last,eSetup);
00060 }


Friends And Related Function Documentation

friend class RPCSeedFinder [friend]

Definition at line 36 of file RPCSeedHits.h.


Member Data Documentation

MuonTransientTrackingRecHit::MuonRecHitContainer RPCSeedHits::theRhits [private]

Definition at line 49 of file RPCSeedHits.h.

Referenced by add(), best_cand(), computePtWithoutVtx(), firstRecHit(), and nrhit().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:31:08 2009 for CMSSW by  doxygen 1.5.4