1 |
pamelats |
1.1 |
#ifndef PAMVMCTRKF77_H |
2 |
|
|
#define PAMVMCTRKF77_H |
3 |
|
|
|
4 |
|
|
#define gmtod GMTOD |
5 |
|
|
#define gdtom GDTOM |
6 |
|
|
#define gufield GUFIELD |
7 |
|
|
|
8 |
|
|
|
9 |
|
|
#include <iostream> |
10 |
|
|
|
11 |
|
|
using std::cout; |
12 |
|
|
using std::endl; |
13 |
|
|
#include <TGeoManager.h> |
14 |
|
|
#include <TGeoMatrix.h> |
15 |
|
|
#include <TVirtualMC.h> |
16 |
|
|
#include <TRandom.h> |
17 |
|
|
#include "PamVMCFieldMgr.h" |
18 |
|
|
extern "C"{ |
19 |
|
|
void grndm_(Float_t*, Int_t& ); |
20 |
|
|
void gmtod_(Float_t* , Float_t* , Int_t& ); |
21 |
|
|
void gdtom_(Float_t* , Float_t* , Int_t& ); |
22 |
|
|
void gufield_(Float_t*, Float_t*); |
23 |
|
|
} |
24 |
|
|
|
25 |
|
|
void grndm_(Float_t* r, Int_t& n){ |
26 |
pizzolot |
1.2 |
// printf("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n"); |
27 |
pamelats |
1.1 |
TRandom3 rnd(0); |
28 |
|
|
for (Int_t i=0; i<n; i++){ |
29 |
|
|
r[i]=rnd.Uniform(); |
30 |
|
|
} |
31 |
|
|
} |
32 |
|
|
|
33 |
|
|
void gmtod_(Float_t* a, Float_t* b, Int_t& c){ |
34 |
|
|
Double_t master[3]; |
35 |
|
|
Double_t local[3]; |
36 |
|
|
|
37 |
|
|
for (Int_t i=0; i<3; ++i) master[i] = (Double_t) a[i]; |
38 |
|
|
|
39 |
|
|
Double_t * m = &master[0]; |
40 |
|
|
Double_t * l = &local[0]; |
41 |
|
|
|
42 |
|
|
gGeoManager->MasterToLocal(m,l); |
43 |
|
|
|
44 |
|
|
//cout<<"MasterToLocal"<<endl; |
45 |
|
|
for (Int_t i=0; i<3; ++i){ |
46 |
|
|
//cout<<master[i]<<" "<<local[i]<<endl; |
47 |
|
|
b[i] = (Float_t)local[i]; |
48 |
|
|
} |
49 |
|
|
c=c; |
50 |
|
|
} |
51 |
|
|
|
52 |
|
|
|
53 |
|
|
void gdtom_(Float_t* a, Float_t* b, Int_t& c){ |
54 |
|
|
Double_t master[3]; |
55 |
|
|
Double_t local[3]; |
56 |
|
|
|
57 |
|
|
for (Int_t i=0; i<3; ++i) local[i] = (Double_t)a[i]; |
58 |
|
|
|
59 |
|
|
Double_t * m = &master[0]; |
60 |
|
|
Double_t * l = &local[0]; |
61 |
|
|
|
62 |
|
|
gGeoManager->LocalToMaster(l,m); |
63 |
|
|
|
64 |
|
|
//cout<<"LocalToMaster"<<endl; |
65 |
|
|
for (Int_t i=0; i<3; ++i) { |
66 |
|
|
//cout<<" "<<local[i]<<" "<<master[i]<<endl; |
67 |
|
|
b[i] = (Float_t)master[i]; |
68 |
|
|
} |
69 |
|
|
c=c; |
70 |
|
|
} |
71 |
|
|
|
72 |
|
|
void gufield_(Float_t *x, Float_t *b){ |
73 |
|
|
PamVMCFieldMgr::Instance()->Field(x,b); |
74 |
|
|
} |
75 |
|
|
#endif //PamVMCTrkF77.h |