00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "Stl3Util/ftf/FtfMcTrack.h"
00014
00015 void FtfMcTrack::set ( int _id, float _r0, float _z0, float _phi0,
00016 float _pt, float _tanl, float _psi,
00017 int _q, int _nHits ) {
00018 id = _id ;
00019 r0 = _r0 ;
00020 z0 = _z0 ;
00021 phi0 = _phi0 ;
00022 pt = _pt ;
00023 tanl = _tanl ;
00024 psi = _psi ;
00025 q = _q ;
00026 nHits = _nHits ;
00027 }
00028
00029
00030
00031
00032 void FtfMcTrack::setPrimary ( short qIn, float ptIn, float eta, float psiIn ) {
00033 q = qIn ;
00034 float theta = 2 * atan(exp(-eta )) ;
00035 tanl = 1./ tan(theta);
00036 pt = ptIn ;
00037 psi = psiIn ;
00038 r0 = 0. ;
00039 phi0 = 0. ;
00040 z0 = 0. ;
00041 }
00042
00043
00044
00045 void FtfMcTrack::setRandomPrimary ( float ptMin, float ptMax,
00046 float etaMin, float etaMax, float psiMin, float psiMax,
00047 float zVert ) {
00048 pt = ptMin + (ptMax - ptMin ) * (float)rand() / (float)RAND_MAX ;
00049 double eta = etaMin + (etaMax - etaMin ) * (float)rand() / (float)RAND_MAX ;
00050 double theta = 2 * atan(exp(-eta )) ;
00051 tanl = 1./ tan(theta);
00052 psi = psiMin + (psiMax - psiMin ) * (float)rand() / (float)RAND_MAX ;
00053 q = 1 ;
00054 r0 = 0. ;
00055 phi0 = 0. ;
00056 z0 = zVert ;
00057 if ( (float)rand()/(float)RAND_MAX > 0.5 ) q = -1 ;
00058 }