/[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.6 by pizzolot, Wed Sep 15 07:05:42 2010 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 12  Line 13 
13  #define ZSPEBP 2.97   //cm  #define ZSPEBP 2.97   //cm
14  #define HORMG  22.57  //cm  #define HORMG  22.57  //cm
15    
16  #ifdef PAMFIELD  //#ifdef PAMFIELD
17  #include "TrkParams.h"  #include "TrkParams.h"
18  #endif  //#endif
   
 class PamVMCFieldMgr: public TObject {  
19    
20    #if ROOT_VERSION_CODE >= 333572
21       #include <TVirtualMagField.h>
22       class PamVMCFieldMgr: public TVirtualMagField
23    #else
24       class PamVMCFieldMgr: public TObject
25    #endif
26    {
27   private:   private:
28    
29    static PamVMCFieldMgr * fm;    static PamVMCFieldMgr * fm;
# Line 44  class PamVMCFieldMgr: public TObject { Line 50  class PamVMCFieldMgr: public TObject {
50  #endif  #endif
51    }    }
52        
   void Field(const Double_t* x, Double_t* b) const {  
   
53    
54      void Field(const Double_t* x, Double_t* B) {
55    
56  #ifdef PAMFIELD  #ifdef PAMFIELD
57      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};
58    
59      b[0] = TrkParams::GetBX((float *)xm)*10;      B[0] = TrkParams::GetBX((float *)xm)*10;
60      b[1] = TrkParams::GetBY((float *)xm)*10;      B[1] = TrkParams::GetBY((float *)xm)*10;
61      b[2] = TrkParams::GetBZ((float *)xm)*10;      B[2] = TrkParams::GetBZ((float *)xm)*10;
62            
63  #else  #else
64      if(x) {      if(x) {
65        for (Int_t i=0; i<3; i++) b[i] = 0.0;        for (Int_t i=0; i<3; i++) B[i] = 0.0;
66      } else {      } else {
67        b[0]=b[1]=b[2]=0.0;        B[0]=B[1]=B[2]=0.0;
68      }      }
69  #endif  #endif
70            
71    }    }
72    
   void Field(const Float_t* x, Float_t* b) const {  
73    
74      void Field(const Float_t* x, Float_t* b) {
75    
 #ifdef PAMFIELD  
     float xm[3]={x[0],x[1],x[2]-ZCAL-CALS3-ZSPEBP-HORMG};  
76    
77      b[0] = TrkParams::GetBX((float *)xm)*10;  #ifdef PAMFIELD
78      b[1] = TrkParams::GetBY((float *)xm)*10;        float xm[3]={x[0],x[1],x[2]-ZCAL-CALS3-ZSPEBP-HORMG};
79      b[2] = TrkParams::GetBZ((float *)xm)*10;            
80              b[0] = TrkParams::GetBX((float *)xm)*10;
81  #else        b[1] = TrkParams::GetBY((float *)xm)*10;
82      if(x) {        b[2] = TrkParams::GetBZ((float *)xm)*10;
83        for (Int_t i=0; i<3; i++) b[i] = 0.0;                        
84      } else {  #else
85        b[0]=b[1]=b[2]=0.0;   if(x) {
86      }      for (Int_t i=0; i<3; i++) b[i] = 0.0;
87  #endif    } else {
88            b[0]=b[1]=b[2]=0.0;
89      }
90    #endif
91    
92    }    }
93    
94  };  };
95    
96  #endif  #endif

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

  ViewVC Help
Powered by ViewVC 1.1.23