ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
F04ElementField.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file F04ElementField.hh
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
29 //
30 
31 #ifndef F04ElementField_h
32 #define F04ElementField_h 1
33 
34 #include "globals.hh"
35 
36 #include "G4Navigator.hh"
38 
39 #include "G4UserLimits.hh"
40 #include "G4VisAttributes.hh"
41 
42 // class F04ElementField - interface for the EM field of one element
43 
44 // This is the interface class used by GlobalField to compute the field
45 // value at a given point[].
46 
47 // An element that represents an element with an EM field will
48 // derive a class from this one and implement the computation for the
49 // element. The Construct() function will add the derived object into
50 // GlobalField.
51 
53 {
54 
55  private:
56 
58 
59  public:
60 
63 
65  void Construct();
66 
68  virtual ~F04ElementField() {}
69 
71  void SetMaxStep(G4double stp)
72  {
73  fMaxStep = stp;
76  }
77 
80 
83  {
84  fColor = c;
86  }
87 
89  G4String GetColor() { return fColor; }
90 
93 
101  {
102  if(fMinX == -DBL_MAX || fMinX > point[0]) fMinX = point[0];
103  if(fMinY == -DBL_MAX || fMinY > point[1]) fMinY = point[1];
104  if(fMinZ == -DBL_MAX || fMinZ > point[2]) fMinZ = point[2];
105  if(fMaxX == DBL_MAX || fMaxX < point[0]) fMaxX = point[0];
106  if(fMaxY == DBL_MAX || fMaxY < point[1]) fMaxY = point[1];
107  if(fMaxZ == DBL_MAX || fMaxZ < point[2]) fMaxZ = point[2];
108  }
109 
112  bool IsInBoundingBox(const G4double point[4]) const
113  {
114  if(point[2] < fMinZ || point[2] > fMaxZ) return false;
115  if(point[0] < fMinX || point[0] > fMaxX) return false;
116  if(point[1] < fMinY || point[1] > fMaxY) return false;
117  return true;
118  }
119 
128  virtual void
129  AddFieldValue(const G4double point[4], G4double field[6]) const = 0;
130 
131  virtual G4double GetLength() = 0;
132  virtual G4double GetWidth() = 0;
133  virtual G4double GetHeight() = 0;
134 
135  protected:
136 
138 
140 
141 // F04ElementField(const F04ElementField&);
142 
143  private:
144 
146 
148 
151 
154 
155 };
156 
157 #endif