EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EicBeamLineElementMap.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EicBeamLineElementMap.h
1 // AYK (ayk@bnl.gov), 2014/09/03
2 //
3 // EIC IR Beam line element magnetic field map handler;
4 //
5 
6 #include <EicMagneticFieldMap.h>
7 
8 #ifndef _EIC_BEAM_LINE_ELEMENT_MAP_
9 #define _EIC_BEAM_LINE_ELEMENT_MAP_
10 
11 #define _CSV_EXTENSION_ (".csv")
12 
13 class Mgrid;
14 
16 {
17  public:
18  // NB: box shape parameters and 3D transformation will be known only after the
19  // file is read in -> just give the file name to EicMagneticFieldMap constructor;
20  EicBeamLineElementMap(const char *fileName = 0): EicMagneticFieldMap(fileName), mGrid(0),
21  mLength(0.0), mAngle(0.0), mBore(0.0), mYoke(0), mScale(1.) {
22  // Just for debuggning purposes;
23  //Initialize(); exit(0);
24  };
26 
27  // Ok, provide Initialize() ASCII file parser; Contains() call is the
28  // "standard" one since both box shape and 3D transformation are provided;
29  int Initialize();
30 
31  int GetFieldValue(const double xx[], double B[]) const;
32  void SetFieldScale(const double fieldScaler);
33 
34  // Assume, that Stephen's files contain all the required information;
35  bool CapableToBuildYoke() const { return true; };
36  TString GetDetectorName() const {
37  return TString(BasenameWrapper(GetFileName().Data())).ReplaceAll(_CSV_EXTENSION_, "");
38  };
39  int ConstructGeometry();
40 
41  TGeoVolume *GetYokeVolume() const { return mYoke; };
42 
43  private:
44  // Fo rnow assume this map can be transient (build it on-the-fly);
45  Mgrid *mGrid;
46 
47  // Parameters encoded in th elast few lines of Stephens' .csv files;
48  Double_t mLength; // the length of the bore
49  Double_t mAngle; // zero to the moment
50  Double_t mBore; // bore radius
51  Double_t mScale; // scaling for magnetic fields for different energy running
52 
53  TGeoVolume *mYoke;
54 
56 };
57 
58 #endif