DistanceMap.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file DistanceMap.h
3 /// \brief Calculate and cache electrostatic potential between cells
4 /// \author Christopher Backhouse - bckhouse@caltech.edu
5 ////////////////////////////////////////////////////////////////////////
6 
7 #ifndef LEM_DISTANCEMAP_H
8 #define LEM_DISTANCEMAP_H
9 
10 #include "LEM/func/LiteHit.h"
11 
12 class TH2;
13 
14 namespace lem
15 {
16  const int kNumPlanes = 256;
17  const int kNumCells = 256;
18 
19  /// Calculate and cache electrostatic potential between cells
21  {
22  public:
23  /// Singleton
24  const static DistanceMap& Instance();
25 
26  double InvDist(int aplane, int bplane, int acell, int bcell) const;
27  double InvDist(const LiteHit& a, const LiteHit& b) const;
28 
29  TH2* MakeHist() const;
30 
31  /// Must call before first call to Instance()
32  static void SetPlaneScale(double ps){fgPlaneScale = ps;}
33  static void SetCellScale(double cs){fgCellScale = cs;}
34  static void SetDecayPower(double dp){fgDecayPower = dp;}
35  static void SetExpMode(bool em = true){fgExpMode = em;}
36 
37  protected:
38  static double DistFunc(double dp, double dc);
39 
40  static double fgPlaneScale;
41  static double fgCellScale;
42  static double fgDecayPower;
43  static bool fgExpMode;
44 
46 
47  private:
48  DistanceMap();
49  };
50 } //namespace
51 
52 #endif
static double DistFunc(double dp, double dc)
Definition: DistanceMap.cxx:86
double fInvDistMap[kNumPlanes][kNumCells]
Definition: DistanceMap.h:45
static double fgDecayPower
Definition: DistanceMap.h:42
PID
Definition: FillPIDs.h:14
static void SetPlaneScale(double ps)
Must call before first call to Instance()
Definition: DistanceMap.h:32
static const DistanceMap & Instance()
Singleton.
Definition: DistanceMap.cxx:26
const double a
TH2 * MakeHist() const
Definition: DistanceMap.cxx:72
static void SetDecayPower(double dp)
Definition: DistanceMap.h:34
static double fgCellScale
Definition: DistanceMap.h:41
static bool fgExpMode
Definition: DistanceMap.h:43
static void SetExpMode(bool em=true)
Definition: DistanceMap.h:35
Compressed hit info, basic component of LEM events.
const hit & b
Definition: hits.cxx:21
static void SetCellScale(double cs)
Definition: DistanceMap.h:33
Compressed hit info, basic component of LEM events.
Definition: LiteHit.h:18
const int kNumCells
Definition: DistanceMap.h:17
double InvDist(int aplane, int bplane, int acell, int bcell) const
Definition: DistanceMap.cxx:99
const int kNumPlanes
Definition: DistanceMap.h:16
static double fgPlaneScale
Definition: DistanceMap.h:40
Calculate and cache electrostatic potential between cells.
Definition: DistanceMap.h:20