Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DTOFGeometry.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DTOFGeometry.h
4 // Created: Mon Jul 18 11:43:31 EST 2005
5 // Creator: remitche (on Linux mantrid00 2.4.20-18.8 i686)
6 //
7 
8 #ifndef _DTOFGeometry_
9 #define _DTOFGeometry_
10 
11 #include <HDGEOMETRY/DGeometry.h>
12 #include <DANA/DApplication.h>
13 
14 #include <math.h>
15 
16 #include "JANA/JObject.h"
17 #include "JANA/JFactory.h"
18 using namespace jana;
19 
20 class DTOFGeometry : public JObject {
21 
22  public:
23  JOBJECT_PUBLIC(DTOFGeometry);
24 
25  DTOFGeometry(const DGeometry* locGeometry);
26 
27  // Get functions
28  int Get_NLayers() const { return NLAYERS; };
29  int Get_NPlanes() const { return NLAYERS; };
30  int Get_NEnds() const { return NENDS; };
31  // NOTE THAT Get_NBars() is the number of bars along one end!
32  // Therefore Get_NBars() != Get_NLongBars()+Get_NShortBars()
33  int Get_NBars() const { return NINSTALLBARS; }
34  int Get_NLongBars() const { return NLONGBARS; }
35  int Get_NShortBars() const { return NSHORTBARS; }
36 
37  int Get_FirstShortBar() const { return FirstShortBar; }
38  int Get_LastShortBar() const { return LastShortBar; }
39 
40  float Get_LongBarLength() const { return LONGBARLENGTH; }
41  float Get_HalfLongBarLength() const { return HALFLONGBARLENGTH; }
42  float Get_ShortBarLength() const { return SHORTBARLENGTH; }
43  float Get_HalfShortBarLength() const { return HALFSHORTBARLENGTH; }
44  float Get_BarWidth() const { return BARWIDTH; }
45 
46  float Get_CenterVertPlane() const { return CenterVPlane; };
47  float Get_CenterHorizPlane() const { return CenterHPlane; };
48  float Get_CenterMidPlane() const { return CenterMPlane; };
49 
50  float bar2y(int bar, int end=0) const;
51  int y2bar(double y) const;
52 
53  void toStrings(vector<pair<string,string> > &items) const {
54  AddString(items, "NBARS", "%d", Get_NBars() );
55  AddString(items, "NLONGBARS", "%d", Get_NLongBars() );
56  AddString(items, "NSHORTBARS", "%d", Get_NShortBars() );
57  AddString(items, "LONGBARLENGTH", "%6.3f", Get_LongBarLength() );
58  AddString(items, "SHORTBARLENGTH", "%6.3f", Get_ShortBarLength() );
59  AddString(items, "BARWIDTH", "%6.3f", Get_BarWidth() );
60  }
61 
62  private:
63  int NLAYERS; /// number of scintillator layers
64  int NENDS; /// maximum number of ends that are read out (should be 2!)
65 
66  int NLONGBARS; ///> number of long scintillator bars
67  //int NWIDEBARS; ///> number of wide long+short scintillator bars (deprecated)
68  int NSHORTBARS; ///> number of short scintillator bars
69  int NBARS; ///> number of long scintillator bars
70  int NINSTALLBARS; ///> number of bars vertically = NLONGBARS + NSHORTBARS/2
71 
72  int FirstShortBar; ///> bar number of first short bar
73  int LastShortBar; ///> bar number of last short bar of same type north
74 
75  float LONGBARLENGTH; ///> length of the long scintillators
76  float HALFLONGBARLENGTH; ///> middle of the long scintillators
77  float SHORTBARLENGTH; ///> length of the short scintillators
78  float HALFSHORTBARLENGTH; ///> middle of the short scintillators
79  float BARWIDTH; ///> width of the scintillator bars
80 
81  float CenterVPlane; /// center z position of Vertical Plane
82  float CenterHPlane; /// center z position of Horizontal Plane
83  float CenterMPlane; /// center z position between the two Plane
84 
85  vector<double> YPOS; ///> y (perpendicular) position for bar number
86 
87 };
88 
89 #endif // _DTOFGeometry_
90 
float Get_CenterVertPlane() const
Definition: DTOFGeometry.h:46
#define y
int NBARS
number of short scintillator bars
Definition: DTOFGeometry.h:69
float Get_HalfShortBarLength() const
Definition: DTOFGeometry.h:43
int Get_NLayers() const
Definition: DTOFGeometry.h:28
int Get_NLongBars() const
Definition: DTOFGeometry.h:34
float CenterHPlane
center z position of Vertical Plane
Definition: DTOFGeometry.h:82
float Get_ShortBarLength() const
Definition: DTOFGeometry.h:42
float LONGBARLENGTH
bar number of last short bar of same type north
Definition: DTOFGeometry.h:75
float CenterVPlane
width of the scintillator bars
Definition: DTOFGeometry.h:81
float BARWIDTH
middle of the short scintillators
Definition: DTOFGeometry.h:79
int FirstShortBar
number of bars vertically = NLONGBARS + NSHORTBARS/2
Definition: DTOFGeometry.h:72
int Get_NPlanes() const
Definition: DTOFGeometry.h:29
int Get_NBars() const
Definition: DTOFGeometry.h:33
int Get_FirstShortBar() const
Definition: DTOFGeometry.h:37
int NENDS
number of scintillator layers
Definition: DTOFGeometry.h:64
int NLONGBARS
maximum number of ends that are read out (should be 2!)
Definition: DTOFGeometry.h:66
int Get_NShortBars() const
Definition: DTOFGeometry.h:35
int Get_LastShortBar() const
Definition: DTOFGeometry.h:38
float Get_HalfLongBarLength() const
Definition: DTOFGeometry.h:41
float HALFLONGBARLENGTH
length of the long scintillators
Definition: DTOFGeometry.h:76
float Get_CenterMidPlane() const
Definition: DTOFGeometry.h:48
int NSHORTBARS
number of long scintillator bars
Definition: DTOFGeometry.h:68
void toStrings(vector< pair< string, string > > &items) const
Definition: DTOFGeometry.h:53
float Get_LongBarLength() const
Definition: DTOFGeometry.h:40
float Get_CenterHorizPlane() const
Definition: DTOFGeometry.h:47
float HALFSHORTBARLENGTH
length of the short scintillators
Definition: DTOFGeometry.h:78
int NINSTALLBARS
number of long scintillator bars
Definition: DTOFGeometry.h:70
float CenterMPlane
center z position of Horizontal Plane
Definition: DTOFGeometry.h:83
int Get_NEnds() const
Definition: DTOFGeometry.h:30
float Get_BarWidth() const
Definition: DTOFGeometry.h:44
float SHORTBARLENGTH
middle of the long scintillators
Definition: DTOFGeometry.h:77
vector< double > YPOS
center z position between the two Plane
Definition: DTOFGeometry.h:85
int LastShortBar
bar number of first short bar
Definition: DTOFGeometry.h:73