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

Diff of /PamVMC/include/PamVMCFieldMgr.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by nikolas, Thu Feb 19 16:50:36 2009 UTC revision 1.5 by pam-rm2, Fri Jun 12 18:39:18 2009 UTC
# Line 1  Line 1 
1  #ifndef PAMVMCFIELDMGR_H  #ifndef PAMVMCFIELDMGR_H
2  #define PAMVMCFIELDMGR_H  #define PAMVMCFIELDMGR_H
3  #include <iostream>  #include <iostream>
4    #include <RVersion.h>
5    
6  #include "TString.h"  #include "TString.h"
7    
# Line 16  Line 17 
17  #include "TrkParams.h"  #include "TrkParams.h"
18  #endif  #endif
19    
 class PamVMCFieldMgr: public TObject {  
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:   private:
29    
30    static PamVMCFieldMgr * fm;    static PamVMCFieldMgr * fm;
# Line 44  class PamVMCFieldMgr: public TObject { Line 51  class PamVMCFieldMgr: public TObject {
51  #endif  #endif
52    }    }
53        
   void Field(const Double_t* x, Double_t* b) const {  
   
54    
55      void Field(const Double_t* x, Double_t* B) {
56    
57  #ifdef PAMFIELD  #ifdef PAMFIELD
58      float xm[3]={x[0],x[1],x[2]-ZCAL-CALS3-ZSPEBP-HORMG};      float xm[3]={x[0],x[1],x[2]-ZCAL-CALS3-ZSPEBP-HORMG};
59    
60      b[0] = TrkParams::GetBX((float *)xm)*10;      B[0] = TrkParams::GetBX((float *)xm)*10;
61      b[1] = TrkParams::GetBY((float *)xm)*10;      B[1] = TrkParams::GetBY((float *)xm)*10;
62      b[2] = TrkParams::GetBZ((float *)xm)*10;      B[2] = TrkParams::GetBZ((float *)xm)*10;
63            
64  #else  #else
65      if(x) {      if(x) {
66        for (Int_t i=0; i<3; i++) b[i] = 0.0;        for (Int_t i=0; i<3; i++) B[i] = 0.0;
67      } else {      } else {
68        b[0]=b[1]=b[2]=0.0;        B[0]=B[1]=B[2]=0.0;
69      }      }
70  #endif  #endif
71            
72    }    }
73    
74    void Field(const Float_t* x, Float_t* b) const {  
75      void Field(const Float_t* x, Float_t* b) {
76    
77    
78  #ifdef PAMFIELD  #ifdef PAMFIELD
# Line 74  class PamVMCFieldMgr: public TObject { Line 81  class PamVMCFieldMgr: public TObject {
81      b[0] = TrkParams::GetBX((float *)xm)*10;      b[0] = TrkParams::GetBX((float *)xm)*10;
82      b[1] = TrkParams::GetBY((float *)xm)*10;      b[1] = TrkParams::GetBY((float *)xm)*10;
83      b[2] = TrkParams::GetBZ((float *)xm)*10;      b[2] = TrkParams::GetBZ((float *)xm)*10;
84        
85  #else  #else
86      if(x) {      if(x) {
87        for (Int_t i=0; i<3; i++) b[i] = 0.0;        for (Int_t i=0; i<3; i++) b[i] = 0.0;
88      } else {      } else {
89        b[0]=b[1]=b[2]=0.0;        b[0]=b[1]=b[2]=0.0;
90      }      }
91  #endif  #endif
92        
93    }    }
94    
95  };  };
96    
97  #endif  #endif

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.23