/[PAMELA software]/PamVMC/include/PamVMCFieldMgr.h
ViewVC logotype

Contents of /PamVMC/include/PamVMCFieldMgr.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Fri Jun 12 18:39:18 2009 UTC (15 years, 6 months ago) by pam-rm2
Branch: MAIN
CVS Tags: v1r0
Changes since 1.1: +23 -15 lines
File MIME type: text/plain
- Introduced user-defined names of output files and random seeds number.
Users can do it use options of PamVMCApplication constructor:
PamVMCApplication(const char* name,  const char *title, const char*
filename="pamtest", Int_t seed=0).
The Random object that I use is TRandom3 object which has astronomical
large period (in case of default initialization 0). All random generators
in the code use this object by calling of gRandom singleton which keeps
it.

- Corrected TOF digitization routine. No problems with TDC hits due to
hadronic interactions anymore.

- Some small changes was done to compile code under Root 5.23. +
geant4_vmc v. 2.6 without any warnings

- Some classes of PamG4RunConfiguartion was changed for geant4_vmc v.
2.6.Some obsolete classes was deleted as soon as developers implemented
regions.

- Navigation was changed from "geomRootToGeant4" to "geomRoot", because on
VMC web page written that as soon as Geant4 has no option ONLY/MANY
translation of overlapped geometry to Geant4 through VGM could be wrong.
I'd like to stay with Root navigation:
http://root.cern.ch/root/vmc/Geant4VMC.html. This should be default
option.

- New Tracker digitization routine written by Sergio was implemented

- PamVMC again became compatible with geant4_vmc v.2.5 and ROOT 5.20.
 The problem was that ROOT developers introduced in TVirtualMC class a new
method SetMagField and new base class:TVirtualMagField from which
user-defined classes shoukd be derived

1 #ifndef PAMVMCFIELDMGR_H
2 #define PAMVMCFIELDMGR_H
3 #include <iostream>
4 #include <RVersion.h>
5
6 #include "TString.h"
7
8 #define PAMFIELD 1
9
10
11 #define ZCAL 13.05 //cm
12 #define CALS3 10.639 //cm
13 #define ZSPEBP 2.97 //cm
14 #define HORMG 22.57 //cm
15
16 #ifdef PAMFIELD
17 #include "TrkParams.h"
18 #endif
19
20
21 #if ROOT_VERSION_CODE >= 333572
22 #include <TVirtualMagField.h>
23 class PamVMCFieldMgr: public TVirtualMagField
24 #else
25 class PamVMCFieldMgr: public TObject
26 #endif
27 {
28 private:
29
30 static PamVMCFieldMgr * fm;
31
32 protected:
33 PamVMCFieldMgr() {};
34
35 public:
36
37 static PamVMCFieldMgr * Instance();
38
39
40 void LoadField(){
41 #ifdef PAMFIELD
42 // Load the PAMELA magnetic field
43
44 std::string pamcal=getenv("PAM_CALIB"); pamcal+="/trk-param/field_param-0/";
45 std::cout << "PAMELA env: " << pamcal << std::endl;
46 TrkParams::SetTrackingMode();
47 TrkParams::SetPrecisionFactor();
48 TrkParams::SetStepMin();
49 TrkParams::Set(pamcal.c_str(),1);
50 TrkParams::Load(1);
51 #endif
52 }
53
54
55 void Field(const Double_t* x, Double_t* B) {
56
57 #ifdef PAMFIELD
58 float xm[3]={x[0],x[1],x[2]-ZCAL-CALS3-ZSPEBP-HORMG};
59
60 B[0] = TrkParams::GetBX((float *)xm)*10;
61 B[1] = TrkParams::GetBY((float *)xm)*10;
62 B[2] = TrkParams::GetBZ((float *)xm)*10;
63
64 #else
65 if(x) {
66 for (Int_t i=0; i<3; i++) B[i] = 0.0;
67 } else {
68 B[0]=B[1]=B[2]=0.0;
69 }
70 #endif
71
72 }
73
74
75 void Field(const Float_t* x, Float_t* b) {
76
77
78 #ifdef PAMFIELD
79 float xm[3]={x[0],x[1],x[2]-ZCAL-CALS3-ZSPEBP-HORMG};
80
81 b[0] = TrkParams::GetBX((float *)xm)*10;
82 b[1] = TrkParams::GetBY((float *)xm)*10;
83 b[2] = TrkParams::GetBZ((float *)xm)*10;
84
85 #else
86 if(x) {
87 for (Int_t i=0; i<3; i++) b[i] = 0.0;
88 } else {
89 b[0]=b[1]=b[2]=0.0;
90 }
91 #endif
92
93 }
94
95 };
96
97 #endif

  ViewVC Help
Powered by ViewVC 1.1.23