#include <RecoHIMuon/HiMuTracking/interface/HICMuonUpdator.h>
Public Member Functions | |
HICMuonUpdator (double &la1, double &la2, const MagneticField *mf, const cms::HICConst *hh) | |
TrajectoryStateOnSurface | update (const Trajectory &mt, const TrajectoryStateOnSurface &, const TrajectoryMeasurement &, const DetLayer *, double &, double &) const |
TrajectoryStateOnSurface | updateBarrel (std::vector< double > &rhit, std::vector< double > &zhit, std::vector< double > &dphihit, std::vector< double > &drhit, std::vector< double > &ehitstrip, std::vector< double > &dehitphi, const TransientTrackingRecHit::ConstRecHitPointer &pRecHit, const TransientTrackingRecHit::ConstRecHitPointer &nRecHit, const TrajectoryStateOnSurface &nTsos, double &, double &, int &) const |
TrajectoryStateOnSurface | updateEndcap (std::vector< double > &rhit, std::vector< double > &zhit, std::vector< double > &dphihit, std::vector< double > &drhit, std::vector< double > &ehitstrip, std::vector< double > &dehitphi, const TransientTrackingRecHit::ConstRecHitPointer &pRecHit, const TransientTrackingRecHit::ConstRecHitPointer &nRecHit, const TrajectoryStateOnSurface &nTsos, double &, double &, int &) const |
virtual | ~HICMuonUpdator () |
Private Member Functions | |
double | findPhiInVertex (const FreeTrajectoryState &fts, const double &rc, const GeomDetEnumerators::Location) const |
bool | linefit1 (const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &err, double &a, double &chi) const |
bool | linefit2 (const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &err, double &a, double &b, double &chi) const |
Private Attributes | |
const MagneticField * | field |
const cms::HICConst * | theHICConst |
double | thePhiWin |
double | theZWin |
double | zvert |
Definition at line 13 of file HICMuonUpdator.h.
HICMuonUpdator::HICMuonUpdator | ( | double & | la1, | |
double & | la2, | |||
const MagneticField * | mf, | |||
const cms::HICConst * | hh | |||
) | [inline] |
Definition at line 16 of file HICMuonUpdator.h.
References field, theHICConst, thePhiWin, theZWin, cms::HICConst::zvert, and zvert.
virtual HICMuonUpdator::~HICMuonUpdator | ( | ) | [inline, virtual] |
double HICMuonUpdator::findPhiInVertex | ( | const FreeTrajectoryState & | fts, | |
const double & | rc, | |||
const GeomDetEnumerators::Location | location | |||
) | const [private] |
Definition at line 312 of file HICMuonUpdator.cc.
References GeomDetEnumerators::barrel, GlobalTrajectoryParameters::charge(), GenMuonPlsPt100GeV_cfg::cout, GlobalTrajectoryParameters::momentum(), FreeTrajectoryState::parameters(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), pi, pi2, GlobalTrajectoryParameters::position(), and PV3DBase< T, PVType, FrameType >::z().
00312 { 00313 double acharge=fts.parameters().charge(); 00314 double phiclus=fts.parameters().position().phi(); 00315 double psi; 00316 if(location==GeomDetEnumerators::barrel){ 00317 double xrclus=fts.parameters().position().perp(); 00318 double xdouble=xrclus/(2.*rc); 00319 psi= phiclus+acharge*asin(xdouble); 00320 } else { 00321 double zclus=fts.parameters().position().z(); 00322 double pl=fts.parameters().momentum().z(); 00323 psi=phiclus+acharge*0.006*fabs(zclus)/fabs(pl); 00324 } 00325 double phic = psi-acharge*pi/2.; 00326 #ifdef CORRECT_DEBUG 00327 cout<<"Momentum of track="<<fts.parameters().momentum().perp()<< 00328 " rad of previous cluster= "<<fts.parameters().position().perp()<< 00329 " phi of previous cluster="<<fts.parameters().position().phi()<<endl; 00330 cout<<" position of the previous cluster="<<fts.parameters().position()<<endl; 00331 cout<<"radius of track="<<rc<<endl; 00332 cout<<"acharge="<<acharge<<endl; 00333 cout<<"psi="<<psi<<endl; 00334 cout<<"phic="<<phic<<" pi="<<pi<<" pi2="<<pi2<<endl; 00335 #endif 00336 00337 return phic; 00338 }
bool HICMuonUpdator::linefit1 | ( | const std::vector< double > & | x, | |
const std::vector< double > & | y, | |||
const std::vector< double > & | err, | |||
double & | a, | |||
double & | chi | |||
) | const [private] |
bool HICMuonUpdator::linefit2 | ( | const std::vector< double > & | x, | |
const std::vector< double > & | y, | |||
const std::vector< double > & | err, | |||
double & | a, | |||
double & | b, | |||
double & | chi | |||
) | const [private] |
TrajectoryStateOnSurface HICMuonUpdator::update | ( | const Trajectory & | mt, | |
const TrajectoryStateOnSurface & | nTsos, | |||
const TrajectoryMeasurement & | ntm, | |||
const DetLayer * | layer, | |||
double & | chirz, | |||
double & | chirf | |||
) | const |
Definition at line 23 of file HICMuonUpdator.cc.
References GeomDetEnumerators::barrel, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), TrajectoryStateOnSurface::isValid(), TrajectoryMeasurement::layer(), DetLayer::location(), Trajectory::measurements(), pi, TrajectoryMeasurement::recHit(), funct::sqrt(), funct::tan(), theta, PV3DBase< T, PVType, FrameType >::theta(), updateBarrel(), updateEndcap(), and zvert.
Referenced by HICTrajectoryBuilder::updateTrajectory().
00027 { 00028 00029 TrajectoryStateOnSurface badtsos; 00030 if(!nTsos.isValid()) { 00031 std::cout<<" HICMuonUpdator::update:: can not start::initial tsos is not valid " <<std::endl; 00032 return badtsos; 00033 } 00034 // trajectory type 00035 00036 vector<TrajectoryMeasurement> MTM=mt.measurements(); 00037 #ifdef DEBUG 00038 std::cout<<" HICMuonUpdator::update::MTM size "<<MTM.size()<<" vertex "<<zvert<<std::endl; 00039 std::cout<<" HICMuonUpdator::update::charge "<<(MTM.back()).updatedState().freeTrajectoryState()->parameters().charge()<<std::endl; 00040 std::cout<<" HICMuonUpdator::update::momentum "<<(MTM.back()).updatedState().freeTrajectoryState()->parameters().momentum()<<std::endl; 00041 #endif 00042 vector<double> phihit,rhit,zhit,dphihit,drhit,dzhit,dzhitl,ehitphi,dehitphi,ehitstrip; 00043 00044 double rvert=0.; 00045 double ezvert=0.014; 00046 00047 const TransientTrackingRecHit::ConstRecHitPointer pRecHit=(MTM.back()).recHit(); 00048 const TransientTrackingRecHit::ConstRecHitPointer nRecHit=ntm.recHit(); 00049 00050 double acharge=(MTM.back()).updatedState().freeTrajectoryState()->parameters().charge(); 00051 GlobalVector pold=(MTM.back()).updatedState().freeTrajectoryState()->parameters().momentum(); 00052 double theta=pold.theta(); 00053 00054 for(vector<TrajectoryMeasurement>::const_iterator ihit=MTM.begin();ihit!=MTM.end();ihit++){ 00055 00056 FreeTrajectoryState* ftshit = (*ihit).updatedState().freeTrajectoryState(); 00057 phihit.push_back((*ihit).recHit()->globalPosition().phi()); 00058 rhit.push_back((*ihit).recHit()->globalPosition().perp()); 00059 zhit.push_back((*ihit).recHit()->globalPosition().z()); 00060 GlobalPoint realhit = (*ihit).recHit()->globalPosition(); 00061 00062 double phierror=sqrt((*ihit).recHit()->globalPositionError().phierr(realhit)); 00063 00064 if(fabs(phierror)<0.0000001) { 00065 phierror=0.00008; 00066 } 00067 ehitphi.push_back(phierror); 00068 00069 #ifdef UPDATOR_BARREL_DEBUG 00070 cout<<" Errors "<<phierror<<" "<<(*ihit).recHit()->globalPositionError().rerr(realhit)<<" "<<tan(theta)<<endl; 00071 #endif 00072 00073 00074 if((*ihit).layer()->location()==GeomDetEnumerators::barrel){ 00075 ehitstrip.push_back(sqrt((*ihit).recHit()->globalPositionError().czz())); 00076 } else{ 00077 ehitstrip.push_back(sqrt((*ihit).recHit()->globalPositionError().rerr(realhit)/fabs(tan(theta)))); 00078 } 00079 00080 } 00081 00082 phihit.push_back(nRecHit->globalPosition().phi()); 00083 rhit.push_back(nRecHit->globalPosition().perp()); 00084 zhit.push_back(nRecHit->globalPosition().z()); 00085 ehitphi.push_back(sqrt(nRecHit->globalPositionError().phierr(nRecHit->globalPosition()))); 00086 00087 00088 00089 00090 00091 if(ntm.layer()->location()==GeomDetEnumerators::barrel){ 00092 ehitstrip.push_back(sqrt(nRecHit->globalPositionError().czz())); 00093 } else { 00094 ehitstrip.push_back(sqrt(nRecHit->globalPositionError().rerr(nRecHit->globalPosition()))/fabs(tan(theta))); 00095 } 00096 00097 // add vertex 00098 00099 rhit.push_back(rvert); 00100 zhit.push_back(zvert); 00101 ehitstrip.push_back(ezvert); 00102 00103 for(vector<double>::const_iterator iphi=phihit.begin();iphi!=phihit.end()-1;iphi++){ 00104 double dpnew=fabs(*iphi-*(iphi+1)); 00105 if(dpnew>pi) dpnew=twopi-dpnew; 00106 00107 #ifdef UPDATOR_BARREL_DEBUG 00108 cout<<" dphi=dpnew="<<dpnew<<" "<<*iphi<<" "<<*(iphi+1)<<endl; 00109 #endif 00110 00111 dphihit.push_back(dpnew); 00112 } 00113 00114 for(vector<double>::const_iterator ir=rhit.begin();ir!=rhit.end()-2;ir++){ 00115 double dpnew=fabs(*ir-*(ir+1)); 00116 00117 #ifdef UPDATOR_BARREL_DEBUG 00118 cout<<" dr=dpnew="<<dpnew<<" "<<*ir<<" "<<*(ir+1)<<endl; 00119 #endif 00120 00121 drhit.push_back(dpnew); 00122 } 00123 for(vector<double>::const_iterator iz=zhit.begin();iz!=zhit.end()-2;iz++){ 00124 double dpnew=*iz-*(iz+1); 00125 00126 #ifdef UPDATOR_BARREL_DEBUG 00127 cout<<" dZ=dpnew="<<dpnew<<" "<<*iz<<" "<<*(iz+1)<<endl; 00128 #endif 00129 00130 dzhit.push_back(fabs(dpnew)); 00131 dzhitl.push_back(dpnew); 00132 } 00133 00134 dzhitl.push_back(*(zhit.end()-1)-zvert); 00135 00136 for(vector<double>::const_iterator ie=ehitphi.begin();ie!=ehitphi.end()-1;ie++){ 00137 double dpnew=(*ie)*1.14; 00138 dehitphi.push_back(dpnew); 00139 } 00140 // 00141 //=================fit in rf and rz planes separately 00142 // 00143 int tType = 1; 00144 if ( (*(MTM.begin())).layer()->location()==GeomDetEnumerators::barrel){ 00145 // std::cout<<" Update barrel "<<std::endl; 00146 TrajectoryStateOnSurface tsos=updateBarrel(rhit, zhit, dphihit, drhit, ehitstrip, dehitphi, pRecHit, nRecHit, 00147 nTsos, chirz, chirf, tType); 00148 00149 if(!tsos.isValid()) { 00150 #ifdef DEBUG 00151 std::cout<<" Trajectory is not valid "<<std::endl; 00152 #endif 00153 return badtsos; 00154 } 00155 00156 return tsos; 00157 00158 } else{ 00159 // std::cout<<" Update endcap "<<std::endl; 00160 TrajectoryStateOnSurface tsos=updateEndcap(rhit, zhit, dphihit, dzhit, ehitstrip, dehitphi, pRecHit, nRecHit, 00161 nTsos, chirz, chirf, tType); 00162 return tsos; 00163 00164 } 00165 }
TrajectoryStateOnSurface HICMuonUpdator::updateBarrel | ( | std::vector< double > & | rhit, | |
std::vector< double > & | zhit, | |||
std::vector< double > & | dphihit, | |||
std::vector< double > & | drhit, | |||
std::vector< double > & | ehitstrip, | |||
std::vector< double > & | dehitphi, | |||
const TransientTrackingRecHit::ConstRecHitPointer & | pRecHit, | |||
const TransientTrackingRecHit::ConstRecHitPointer & | nRecHit, | |||
const TrajectoryStateOnSurface & | nTsos, | |||
double & | , | |||
double & | , | |||
int & | ||||
) | const |
Referenced by update().
TrajectoryStateOnSurface HICMuonUpdator::updateEndcap | ( | std::vector< double > & | rhit, | |
std::vector< double > & | zhit, | |||
std::vector< double > & | dphihit, | |||
std::vector< double > & | drhit, | |||
std::vector< double > & | ehitstrip, | |||
std::vector< double > & | dehitphi, | |||
const TransientTrackingRecHit::ConstRecHitPointer & | pRecHit, | |||
const TransientTrackingRecHit::ConstRecHitPointer & | nRecHit, | |||
const TrajectoryStateOnSurface & | nTsos, | |||
double & | , | |||
double & | , | |||
int & | ||||
) | const |
Referenced by update().
const MagneticField* HICMuonUpdator::field [private] |
const cms::HICConst* HICMuonUpdator::theHICConst [private] |
double HICMuonUpdator::thePhiWin [private] |
double HICMuonUpdator::theZWin [private] |
double HICMuonUpdator::zvert [private] |