| 1 |
nikolas |
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 |
|
|
TRandom3 rnd(0); |
| 27 |
|
|
for (Int_t i=0; i<n; i++){ |
| 28 |
|
|
r[i]=rnd.Uniform(); |
| 29 |
|
|
} |
| 30 |
|
|
} |
| 31 |
|
|
|
| 32 |
|
|
void gmtod_(Float_t* a, Float_t* b, Int_t& c){ |
| 33 |
|
|
Double_t master[3]; |
| 34 |
|
|
Double_t local[3]; |
| 35 |
|
|
|
| 36 |
|
|
for (Int_t i=0; i<3; ++i) master[i] = (Double_t) a[i]; |
| 37 |
|
|
|
| 38 |
|
|
Double_t * m = &master[0]; |
| 39 |
|
|
Double_t * l = &local[0]; |
| 40 |
|
|
|
| 41 |
|
|
gGeoManager->MasterToLocal(m,l); |
| 42 |
|
|
|
| 43 |
|
|
//cout<<"MasterToLocal"<<endl; |
| 44 |
|
|
for (Int_t i=0; i<3; ++i){ |
| 45 |
|
|
//cout<<master[i]<<" "<<local[i]<<endl; |
| 46 |
|
|
b[i] = (Float_t)local[i]; |
| 47 |
|
|
} |
| 48 |
|
|
c=c; |
| 49 |
|
|
} |
| 50 |
|
|
|
| 51 |
|
|
|
| 52 |
|
|
void gdtom_(Float_t* a, Float_t* b, Int_t& c){ |
| 53 |
|
|
Double_t master[3]; |
| 54 |
|
|
Double_t local[3]; |
| 55 |
|
|
|
| 56 |
|
|
for (Int_t i=0; i<3; ++i) local[i] = (Double_t)a[i]; |
| 57 |
|
|
|
| 58 |
|
|
Double_t * m = &master[0]; |
| 59 |
|
|
Double_t * l = &local[0]; |
| 60 |
|
|
|
| 61 |
|
|
gGeoManager->LocalToMaster(l,m); |
| 62 |
|
|
|
| 63 |
|
|
//cout<<"LocalToMaster"<<endl; |
| 64 |
|
|
for (Int_t i=0; i<3; ++i) { |
| 65 |
|
|
//cout<<" "<<local[i]<<" "<<master[i]<<endl; |
| 66 |
|
|
b[i] = (Float_t)master[i]; |
| 67 |
|
|
} |
| 68 |
|
|
c=c; |
| 69 |
|
|
} |
| 70 |
|
|
|
| 71 |
|
|
void gufield_(Float_t *x, Float_t *b){ |
| 72 |
|
|
PamVMCFieldMgr::Instance()->Field(x,b); |
| 73 |
|
|
} |
| 74 |
|
|
#endif //PamVMCTrkF77.h |