ATLAS Offline Software
VDetectorParameters.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // VDetectorParameters
6 // 30-Jun-2003 Bill Seligman
7 
8 // Interface class that defines how the different detector-parameter
9 // methods return values to the simulation.
10 
11 // Purpose: This class isolates the method of storing detector
12 // parameters from the simulation itself. Detector parameters might
13 // be stored as constants, as entries in a MySQL database, or in some
14 // other form; they might be stored in AGE structures or in some other
15 // form. This interface separates the details of how the parameters
16 // are stored from the simulation's geometry and hit-calculation
17 // routines.
18 
19 #ifndef LARGEOCODE_VDETECTORPARAMETERS_H
20 #define LARGEOCODE_VDETECTORPARAMETERS_H
21 
24 #include <string>
25 #include <limits.h>
26 
27 namespace LArGeo {
28 
30 
31  public:
32 
33  virtual ~VDetectorParameters() {};
34 
35  // This class uses a modified version of the singleton pattern.
36  // It has to be explicitly initialized with a "SetInstance" call,
37  // whose parameter is some class that inherits from
38  // VDetectorParameters and implements the GetValue method.
39  // Thereafter, any routine in the simulation can use the result of
40  // "GetInstance" to find out how to get its parameters.
41 
42  static void SetInstance(std::unique_ptr<VDetectorParameters>);
43  static const VDetectorParameters* GetInstance();
44 
45  // This is the general access method for obtaining valued from
46  // some source of detector parameters. THe paramter is identified
47  // by some string. Optionally, up to five integers can be used
48  // (typically to index an array of some sort). The default value
49  // of these integers, INT_MIN, comes from limits.h; it's the
50  // minimum possible integer value that can be represented on the
51  // computer.
52 
53  virtual double GetValue(const std::string&,
54  const int i0 = INT_MIN,
55  const int i1 = INT_MIN,
56  const int i2 = INT_MIN,
57  const int i3 = INT_MIN,
58  const int i4 = INT_MIN ) const = 0;
59 
60  protected:
62 
63  private:
65 
66  };
67 
68 } // namespace LArGeo
69 
70 #endif // LARGEOCODE_VDETECTORPARAMETERS_H
LArGeo::VDetectorParameters::SetInstance
static void SetInstance(std::unique_ptr< VDetectorParameters >)
Definition: VDetectorParameters.cxx:24
LArGeo::VDetectorParameters
Definition: VDetectorParameters.h:29
LArGeo
Definition: LArDetectorFactory.h:26
CxxUtils::CachedUniquePtrT
Cached pointer with atomic update.
Definition: CachedUniquePtr.h:54
LArGeo::VDetectorParameters::ATLAS_THREAD_SAFE
static CxxUtils::CachedUniquePtr< VDetectorParameters > s_instance ATLAS_THREAD_SAFE
Definition: VDetectorParameters.h:61
LArGeo::VDetectorParameters::~VDetectorParameters
virtual ~VDetectorParameters()
Definition: VDetectorParameters.h:33
LArGeo::VDetectorParameters::VDetectorParameters
VDetectorParameters()
Definition: VDetectorParameters.h:61
CachedUniquePtr.h
Cached unique_ptr with atomic update.
LArGeo::VDetectorParameters::GetValue
virtual double GetValue(const std::string &, const int i0=INT_MIN, const int i1=INT_MIN, const int i2=INT_MIN, const int i3=INT_MIN, const int i4=INT_MIN) const =0
checker_macros.h
Define macros for attributes used to control the static checker.
LArGeo::VDetectorParameters::GetInstance
static const VDetectorParameters * GetInstance()
Definition: VDetectorParameters.cxx:29