#include <RecoHIMuon/HiMuPropagator/interface/FastMuPropagator.h>
Definition at line 18 of file FastMuPropagator.h.
cms::FastMuPropagator::FastMuPropagator | ( | const MagneticField * | mf, | |
PropagationDirection | dir = alongMomentum | |||
) | [inline] |
Definition at line 20 of file FastMuPropagator.h.
References field, and theFmpConst.
Referenced by clone().
00021 {theFmpConst=new FmpConst(); field = mf;}
cms::FastMuPropagator::FastMuPropagator | ( | const MagneticField * | mf, | |
FmpConst * | fmp, | |||
PropagationDirection | dir = alongMomentum | |||
) | [inline] |
Definition at line 23 of file FastMuPropagator.h.
References field, and theFmpConst.
00024 {theFmpConst=fmp; field = mf;}
virtual cms::FastMuPropagator::~FastMuPropagator | ( | ) | [inline, virtual] |
Definition at line 28 of file FastMuPropagator.h.
References theFmpConst.
00028 {delete theFmpConst;}
bool cms::FastMuPropagator::checkfts | ( | const FreeTrajectoryState & | fts | ) | const [private] |
Definition at line 282 of file FastMuPropagator.cc.
References funct::abs(), HcalDataFrameFilter_impl::check(), GenMuonPlsPt100GeV_cfg::cout, lat::endl(), cms::FmpConst::mubarrelrad, cms::FmpConst::muforwardrad, cms::FmpConst::muoffset, FreeTrajectoryState::parameters(), PV3DBase< T, PVType, FrameType >::perp(), GlobalTrajectoryParameters::position(), r, theFmpConst, PV3DBase< T, PVType, FrameType >::z(), and z.
Referenced by propagate().
00282 { 00283 bool check=true; 00284 double z=fts.parameters().position().z(); 00285 double r=fts.parameters().position().perp(); 00286 float mubarrelrad=theFmpConst->mubarrelrad; 00287 float muforwardrad=theFmpConst->muforwardrad; 00288 float muoffset=theFmpConst->muoffset; 00289 mubarrelrad=350.; muforwardrad=400.; 00290 #ifdef PROPAGATOR_DB 00291 cout<<"checkfts::r,z="<<r<<" "<<z<<" "<<check<<endl; 00292 #endif 00293 if(r<mubarrelrad-muoffset&&abs(z)<muforwardrad-muoffset){ 00294 check=false; 00295 #ifdef PROPAGATOR_DB 00296 cout<<"checkfts::false="<<check<<endl; 00297 #endif 00298 } 00299 return check; 00300 }
virtual FastMuPropagator* cms::FastMuPropagator::clone | ( | void | ) | const [inline, virtual] |
Implements Propagator.
Definition at line 36 of file FastMuPropagator.h.
References alongMomentum, dir, FastMuPropagator(), and field.
00037 { 00038 PropagationDirection dir = alongMomentum; 00039 return new FastMuPropagator(field,dir); 00040 }
virtual const MagneticField* cms::FastMuPropagator::magneticField | ( | ) | const [inline, virtual] |
Implements Propagator.
Definition at line 58 of file FastMuPropagator.h.
References field.
00058 {return field;}
TrajectoryStateOnSurface cms::FastMuPropagator::propagate | ( | const FreeTrajectoryState & | state, | |
const Surface & | sur | |||
) | const [inline, virtual] |
Propagate from a free state (e.g.
position and momentum in in global cartesian coordinates) to a surface. Only use the generic method if the surface type (plane or cylinder) is not known at the calling point.
Reimplemented from Propagator.
Definition at line 42 of file FastMuPropagator.h.
References Propagator::propagate().
00043 { 00044 return Propagator::propagate( fts, surface); 00045 }
TrajectoryStateOnSurface cms::FastMuPropagator::propagate | ( | const FreeTrajectoryState & | fts, | |
const Plane & | boundplane | |||
) | const [virtual] |
Implements Propagator.
Definition at line 172 of file FastMuPropagator.cc.
References funct::abs(), GlobalTrajectoryParameters::charge(), checkfts(), funct::cos(), GenMuonPlsPt100GeV_cfg::cout, FreeTrajectoryState::curvilinearError(), lat::endl(), field, cms::FmpConst::forwparam, int, m, CurvilinearTrajectoryError::matrix(), GlobalTrajectoryParameters::momentum(), FreeTrajectoryState::parameters(), cms::FmpConst::partrack, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), phi, cms::FmpConst::phiwinf, GloballyPositioned< T >::position(), GlobalTrajectoryParameters::position(), cms::FmpConst::ptboun, ptmin, cms::FmpConst::ptstep, cms::FmpConst::ptwmax, cms::FmpConst::ptwmin, r, cms::FmpConst::sigf, cms::FmpConst::sigz, funct::sin(), cms::FmpConst::step, cmsRelvalreportInput::step, funct::tan(), theFmpConst, theta, PV3DBase< T, PVType, FrameType >::theta(), PV3DBase< T, PVType, FrameType >::z(), z, cms::FmpConst::zvert, and cms::FmpConst::zwin.
00175 { 00176 TrajectoryStateOnSurface badtsos; 00177 00178 #ifdef PROPAGATOR_DB 00179 cout<<"FastMuPropagator::propagate::Start propagation in forward::zvert "<<theFmpConst->zvert<<endl; 00180 #endif 00181 if(!checkfts(fts)) return badtsos; 00182 00183 // Extract information from muchambers 00184 00185 int imin0,imax0; 00186 double ptmax,ptmin,pt,phi,theta,theta0,z,r,pl,plmin,plmax; 00187 double dfcalc,phnext; 00188 TrackCharge charge; 00189 float ptboun=theFmpConst->ptboun; 00190 float step=theFmpConst->step; 00191 00192 00193 GlobalVector moment=fts.parameters().momentum(); 00194 GlobalPoint posit=fts.parameters().position(); 00195 pt=moment.perp(); 00196 theta0=moment.theta(); 00197 // Correct theta 00198 double zfts=fts.parameters().position().z()-theFmpConst->zvert; 00199 double rfts=fts.parameters().position().perp(); 00200 theta = atan2(rfts,zfts); 00201 00202 #ifdef PROPAGATOR_DB 00203 cout<<"FastMuPropagator::propagate::Start propagation in forward::theta old, new "<<theta0<<" "<<theta<<endl; 00204 #endif 00205 00206 phi=posit.phi(); 00207 ptmax=pt+fts.curvilinearError().matrix()(1,1); 00208 ptmin=pt-fts.curvilinearError().matrix()(1,1); 00209 pl=pt/tan(theta); 00210 plmin=ptmin/tan(theta); 00211 plmax=ptmax/tan(theta); 00212 imax0=(int)((ptmax-ptboun)/step)+1; 00213 imin0=(int)((ptmin-ptboun)/step)+1; 00214 #ifdef PROPAGATOR_DB 00215 cout<<"FastMuPropagator::Look ptboun,step,imin0,imax0="<<ptboun<<" "<<step<< 00216 " "<<imin0<<" "<<imax0<<endl; 00217 cout<<"FastMuPropagator::Parameters (pt,theta,phi,ptmax,ptmin)="<<pt<<" " 00218 <<theta<<" "<<phi<<" "<<ptmax<<" "<<ptmin<<endl; 00219 #endif 00220 if(imax0 > 1){ 00221 if(imin0<1) imin0=1; 00222 00223 z=boundplane.position().z(); 00224 r=(z-theFmpConst->zvert)*tan(theta); 00225 charge=fts.parameters().charge(); 00226 00227 // pl evaluation 00228 00229 dfcalc=theFmpConst->forwparam[0]+ 00230 charge*theFmpConst->forwparam[1]/abs(pl); 00231 phnext=dfcalc+phi; 00232 if(phnext>=twopi) phnext=phnext-twopi; 00233 if(phnext <0.) phnext=twopi+phnext; 00234 #ifdef PROPAGATOR_DB 00235 cout<<"FastMuPropagator::Phi in Muon Chamb="<<phi<<endl; 00236 cout<<"FastMuPropagator::Phnext determined="<<phnext<<" dfcalc="<<dfcalc<<endl; 00237 #endif 00238 00239 int iwin; 00240 float awin,bwin,phbound; 00241 AlgebraicSymMatrix m(5,0); 00242 00243 if(pt>40.) { 00244 phbound=theFmpConst->phiwinf[8]; 00245 }else{ // r < bound 00246 iwin=(int)(pt/theFmpConst->ptstep); 00247 awin=(theFmpConst->phiwinf[iwin+1]-theFmpConst->phiwinf[iwin]) 00248 /(theFmpConst->ptwmax[iwin]-theFmpConst->ptwmin[iwin]); 00249 bwin=theFmpConst->phiwinf[iwin]-awin*theFmpConst->ptwmin[iwin]; 00250 phbound=awin*pt+bwin; 00251 } 00252 #ifdef PROPAGATOR_DB 00253 cout<<"Forward::Size of window in phi="<<phbound<<endl; 00254 #endif 00255 m(1,1)=abs(plmax-plmin)/6.; m(2,2)=phbound/theFmpConst->sigf; 00256 m(3,3)=theFmpConst->zwin/theFmpConst->sigz; 00257 m(4,4)=phbound/(2.*theFmpConst->sigf);m(5,5)=theFmpConst->zwin/(2.*theFmpConst->sigz); 00258 00259 GlobalPoint aX(r*cos(phnext),r*sin(phnext),z); 00260 00261 // Recalculate momentum with some trick... 00262 double dfcalcmom=charge*theFmpConst->partrack*abs(z)/abs(pl); 00263 GlobalVector aP(pt*cos(phnext-dfcalcmom),pt*sin(phnext-dfcalcmom),pl); 00264 #ifdef PROPAGATOR_DB 00265 cout<<"dfcalcmom="<<charge<<" "<<theFmpConst->partrack<<" "<<z<<" "<<pl<<" "<<phnext<<endl; 00266 cout<<"phnextmom="<<phnext-dfcalcmom<<endl; 00267 00268 cout<<"Plane aP="<<aP<<endl; 00269 cout<<"Before propagation="<<pt*cos(phi)<< " "<<pt*sin(phi)<<" "<<pl<<endl; 00270 #endif 00271 00272 GlobalTrajectoryParameters gtp(aX,aP,charge,field); 00273 CurvilinearTrajectoryError cte(m); 00274 00275 TrajectoryStateOnSurface tsos(gtp, CurvilinearTrajectoryError(m), boundplane); 00276 return tsos; 00277 } 00278 00279 return badtsos; 00280 }
TrajectoryStateOnSurface cms::FastMuPropagator::propagate | ( | const FreeTrajectoryState & | fts, | |
const Cylinder & | bound | |||
) | const [virtual] |
Implements Propagator.
Definition at line 22 of file FastMuPropagator.cc.
References funct::abs(), GlobalTrajectoryParameters::charge(), checkfts(), funct::cos(), GenMuonPlsPt100GeV_cfg::cout, FreeTrajectoryState::curvilinearError(), lat::endl(), field, int, m, CurvilinearTrajectoryError::matrix(), GlobalTrajectoryParameters::momentum(), cms::FmpConst::newparam, cms::FmpConst::newparamgt40, FreeTrajectoryState::parameters(), cms::FmpConst::partrack, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), phi, cms::FmpConst::phiwinb, pi, GlobalTrajectoryParameters::position(), cms::FmpConst::ptboun, ptmin, cms::FmpConst::ptstep, cms::FmpConst::ptwmax, cms::FmpConst::ptwmin, Cylinder::radius(), cms::FmpConst::sigf, cms::FmpConst::sigz, funct::sin(), cms::FmpConst::step, cmsRelvalreportInput::step, funct::tan(), theFmpConst, theta, PV3DBase< T, PVType, FrameType >::theta(), PV3DBase< T, PVType, FrameType >::z(), z, cms::FmpConst::zvert, and cms::FmpConst::zwin.
00024 { 00025 TrajectoryStateOnSurface badtsos; 00026 00027 if(!checkfts(fts)) return badtsos; 00028 00029 #ifdef PROPAGATOR_DB 00030 cout<<"FastMuPropagator::propagate::Start propagation in barrel::zvert "<<theFmpConst->zvert<<endl; 00031 #endif 00032 00033 // Extract information from muchambers 00034 00035 int charge; 00036 int imin0,imax0; 00037 double ptmax,ptmin,pt,phi,theta,theta0,z,pl; 00038 double dfcalc,phnext,bound; 00039 float ptboun=theFmpConst->ptboun; 00040 float step=theFmpConst->step; 00041 00042 GlobalVector moment=fts.parameters().momentum(); 00043 GlobalPoint posit=fts.parameters().position(); 00044 pt=moment.perp(); 00045 theta0=moment.theta(); 00046 // Correct theta 00047 double zfts=fts.parameters().position().z()-theFmpConst->zvert; 00048 double rfts=fts.parameters().position().perp(); 00049 theta = atan2(rfts,zfts); 00050 00051 #ifdef PROPAGATOR_DB 00052 cout<<"FastMuPropagator::propagate::Start propagation in barrel::theta old, new "<<theta0<<" "<<theta<<endl; 00053 #endif 00054 00055 phi=posit.phi(); 00056 ptmax=pt+fts.curvilinearError().matrix()(1,1); 00057 ptmin=pt-fts.curvilinearError().matrix()(1,1); 00058 bound=boundcyl.radius(); 00059 charge=fts.parameters().charge(); 00060 00061 imax0=(int)((ptmax-ptboun)/step)+1; 00062 imin0=(int)((ptmin-ptboun)/step)+1; 00063 #ifdef PROPAGATOR_DB 00064 cout<<"FastMuPropagator::Look ptboun,step,imin0,imax0="<<ptboun<<" "<<step<< 00065 " "<<imin0<<" "<<imax0<<endl; 00066 cout<<"FastMuPropagator::Parameters (pt,theta,phi,ptmax,ptmin,bound)="<<pt<<" " 00067 <<theta<<" "<<phi<<" "<<ptmax<<" "<<ptmin<<" "<<bound<<endl; 00068 #endif 00069 if(imax0 > 1){ 00070 if(imin0<1) imin0=1; 00071 // ========================== phi ======================================== 00072 // new parametrisation (because of second mu-station) 00073 // 00074 00075 #ifdef PROPAGATOR_DB 00076 cout<<"FastMuPropagator::New parameters="<<theFmpConst->newparam[0]<<endl; 00077 cout<<"FastMuPropagator::New parameters for pt>40="<< 00078 theFmpConst->newparamgt40[0]<<endl; 00079 #endif 00080 00081 if(pt<40.) { 00082 dfcalc=charge/(theFmpConst->newparam[0]+theFmpConst->newparam[1]*pt 00083 +theFmpConst->newparam[2]*pt*pt); 00084 }else{ 00085 dfcalc=charge/(theFmpConst->newparamgt40[0]+ 00086 theFmpConst->newparamgt40[1]*pt+theFmpConst->newparamgt40[2]*pt*pt); 00087 } 00088 // 00089 // !!!! temporarily decision till new parametrization appears. 00090 // 00091 if (abs(dfcalc) > 0.6 ) dfcalc = charge*0.6; 00092 00093 phnext=dfcalc+phi; 00094 if(phnext>=twopi) phnext=phnext-twopi; 00095 if(phnext <0.) phnext=twopi+phnext; 00096 #ifdef PROPAGATOR_DB 00097 cout<<"FastMuPropagator::Phi in Muon Chamb="<<phi<<endl; 00098 cout<<"FastMuPropagator::Phnext determined="<<phnext<<" dfcalc="<<dfcalc<<endl; 00099 #endif 00100 // ========================== Z ======================================== 00101 if(abs(theta-pi/2.)>0.00001){ 00102 z=bound/tan(theta)+theFmpConst->zvert; 00103 if(fabs(z)>140) { 00104 // Temporary implementation ===== 00105 // if(z>0.) z = z-45.; 00106 // if(z<0.) z = z+45.; 00107 // ============================== 00108 } 00109 }else{ 00110 z=0.; 00111 } 00112 #ifdef PROPAGATOR_DB 00113 cout<<"FastMuPropgator::Z coordinate="<<z<<"bound="<<bound<<"theta="<<theta<<" "<< 00114 abs(theta-pi/2.)<<endl; 00115 #endif 00116 // ====================== fill global point/vector ======================= 00117 GlobalPoint aX(bound*cos(phnext),bound*sin(phnext),z); 00118 if(abs(theta-pi/2.)<0.00001){ 00119 pl=0.; 00120 }else{ 00121 pl=pt/tan(theta); 00122 } 00123 // Recalculate momentum with some trick... 00124 double dfcalcmom=charge*theFmpConst->partrack*bound/pt; 00125 GlobalVector aP(pt*cos(phnext-dfcalcmom),pt*sin(phnext-dfcalcmom),pl); 00126 00127 #ifdef PROPAGATOR_DB 00128 cout<<"phnextmom="<<phnext-dfcalcmom<<endl; 00129 cout<<"Cylinder aP="<<aP<<endl; 00130 cout<<"Before propagation="<<pt*cos(phi)<< " "<<pt*sin(phi)<<" "<<pl<<endl; 00131 #endif 00132 // ======================================================================= 00133 00134 GlobalTrajectoryParameters gtp(aX,aP,charge,field); 00135 AlgebraicSymMatrix m(5,0); 00136 int iwin; 00137 float awin,bwin,phbound; 00138 00139 if(pt>40.) { 00140 iwin=8; 00141 phbound=theFmpConst->phiwinb[8]; 00142 }else{ 00143 iwin=(int)(pt/theFmpConst->ptstep); 00144 awin=(theFmpConst->phiwinb[iwin+1]-theFmpConst->phiwinb[iwin]) 00145 /(theFmpConst->ptwmax[iwin]-theFmpConst->ptwmin[iwin]); 00146 bwin=theFmpConst->phiwinb[iwin]-awin*theFmpConst->ptwmin[iwin]; 00147 phbound=awin*pt+bwin; 00148 00149 } 00150 #ifdef PROPAGATOR_DB 00151 cout<<"Size of window in phi="<<phbound<<" "<<iwin<<endl; 00152 cout<<theFmpConst->phiwinb[iwin+1]<<" "<<theFmpConst->phiwinb[iwin] 00153 <<" "<<theFmpConst->ptwmin[iwin]<< 00154 " "<<theFmpConst->ptwmax[iwin]<<" awin="<<awin<<" bwin="<<bwin<<endl; 00155 #endif 00156 m(1,1)=(ptmax-ptmin)/6.; m(2,2)=phbound/theFmpConst->sigf; 00157 m(3,3)=theFmpConst->zwin/theFmpConst->sigz; 00158 m(4,4)=phbound/(2.*theFmpConst->sigf);m(5,5)=theFmpConst->zwin/(2.*theFmpConst->sigz); 00159 00160 CurvilinearTrajectoryError cte(m); 00161 00162 FreeTrajectoryState fts(gtp,cte); 00163 TrajectoryStateOnSurface tsos(gtp, CurvilinearTrajectoryError(m), boundcyl); 00164 return tsos; 00165 00166 } 00167 return badtsos; 00168 }
virtual std::pair< TrajectoryStateOnSurface, double> cms::FastMuPropagator::propagateWithPath | ( | const FreeTrajectoryState & | state, | |
const Cylinder & | bc | |||
) | const [inline, virtual] |
Implements Propagator.
Definition at line 53 of file FastMuPropagator.h.
References tp.
00053 { 00054 std::pair<TrajectoryStateOnSurface,double> tp; 00055 return tp; 00056 }
virtual std::pair< TrajectoryStateOnSurface, double> cms::FastMuPropagator::propagateWithPath | ( | const FreeTrajectoryState & | state, | |
const Plane & | bc | |||
) | const [inline, virtual] |
Implements Propagator.
Definition at line 48 of file FastMuPropagator.h.
References tp.
00048 { 00049 std::pair<TrajectoryStateOnSurface,double> tp; 00050 return tp; 00051 }
const MagneticField* cms::FastMuPropagator::field [private] |
Definition at line 63 of file FastMuPropagator.h.
Referenced by clone(), FastMuPropagator(), magneticField(), and propagate().
FmpConst* cms::FastMuPropagator::theFmpConst [private] |
Definition at line 62 of file FastMuPropagator.h.
Referenced by checkfts(), FastMuPropagator(), propagate(), and ~FastMuPropagator().