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