Public Member Functions | |
TimeImpl (int n, G4double t[], G4double b[], G4double e[]=0) | |
Constructor. n is # points in the arrays, t[] is the list of time values (ns), b[] and e[] are the factors for B field and E field. t[], b[], and e[] are copied so the caller can delete them after calling this routine. | |
void | setPeriod (G4double v) |
G4double | factorB (G4double t) |
G4double | factorE (G4double t) |
Static Public Member Functions | |
static TimeImpl * | readTime (InputFile &in, BLArgumentVector argv, BLArgumentMap namedArgs) |
Private Attributes | |
BTSpline1D | B |
BTSpline1D | E |
G4double | tMin |
G4double | tMax |
G4double | period |
TimeImpl::TimeImpl | ( | int | n, | |
G4double | t[], | |||
G4double | b[], | |||
G4double | e[] = 0 | |||
) | [inline] |
Constructor. n is # points in the arrays, t[] is the list of time values (ns), b[] and e[] are the factors for B field and E field. t[], b[], and e[] are copied so the caller can delete them after calling this routine.
References period, tMax, and tMin.
Referenced by readTime().
00186 : 00187 B(n,t,b), E(n,t,(e?e:b)) { 00188 tMin = t[0]; 00189 tMax = t[n-1]; 00190 period = -1.0; 00191 } void setPeriod(G4double v) { period = v; }
void TimeImpl::setPeriod | ( | G4double | v | ) | [inline] |
References period.
Referenced by BLFieldMap::createTimeDependence(), and readTime().
00192 { period = v; }
G4double TimeImpl::factorB | ( | G4double | t | ) | [inline] |
G4double TimeImpl::factorE | ( | G4double | t | ) | [inline] |
TimeImpl * TimeImpl::readTime | ( | InputFile & | in, | |
BLArgumentVector | argv, | |||
BLArgumentMap | namedArgs | |||
) | [static] |
References argDouble(), B, E, InputFile::getline(), period, InputFile::repeatLine(), setPeriod(), and TimeImpl().
Referenced by BLFieldMap::readFile().
00383 { 00384 G4double period=-1.0; 00385 argDouble(period,"period",namedArgs); 00386 00387 std::vector<G4double> T; 00388 std::vector<G4double> B; 00389 std::vector<G4double> E; 00390 00391 char *line; 00392 while((line=in.getline()) != 0) { 00393 if(isalpha(line[0])) { 00394 in.repeatLine(); 00395 break; 00396 } 00397 G4double t,b,e; 00398 int j = sscanf(line,"%lf%lf%lf",&t,&b,&e); 00399 if(j < 2 || j > 3) return 0; 00400 if(j == 2) e = b; 00401 T.push_back(t); 00402 B.push_back(b); 00403 E.push_back(e); 00404 } 00405 00406 if(T.size() > 0) { 00407 TimeImpl *impl = 00408 new TimeImpl(T.size(),&T[0],&B[0],&E[0]); 00409 impl->setPeriod(period); 00410 return impl; 00411 } 00412 00413 return 0; 00414 }
BTSpline1D TimeImpl::B [private] |
Referenced by factorB(), and readTime().
BTSpline1D TimeImpl::E [private] |
Referenced by factorE(), and readTime().
G4double TimeImpl::tMin [private] |
Referenced by factorB(), factorE(), and TimeImpl().
G4double TimeImpl::tMax [private] |
Referenced by factorB(), factorE(), and TimeImpl().
G4double TimeImpl::period [private] |
Referenced by factorB(), factorE(), readTime(), setPeriod(), and TimeImpl().