Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DCCALGeometry.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DCCALGeometry.h
4 // Created: Tue Nov 30 15:42:41 EST 2010
5 // Creator: davidl (on Linux ifarml6 2.6.18-128.el5 x86_64)
6 //
7 
8 #ifndef _DCCALGeometry_
9 #define _DCCALGeometry_
10 
11 #include <JANA/JObject.h>
12 #include <JANA/JFactory.h>
13 
14 #include "DVector2.h"
15 #include "units.h"
16 
17 class DCCALGeometry:public jana::JObject{
18 
19  public:
21 
22  DCCALGeometry();
24 
25  static const int kCCALBlocksWide = 12;
26  static const int kCCALBlocksTall = 12;
28  static const int kCCALMidBlock = (kCCALBlocksWide)/2;
29  static const int kCCALBeamHoleSize = 2;
30 
31  static double blockSize() { return 2.05 * k_cm; }
32  static double blockLength(){ return 20.0 * k_cm; }
33  static double ccalFaceZ() { return 1215 * k_cm; }
34 
35  static double ccalMidplane() { return ccalFaceZ() + 0.5 * blockLength() ; }
36 
37  bool isBlockActive( int row, int column ) const;
38  int numActiveBlocks() const { return m_numActiveBlocks; }
39 
40 
41  DVector2 positionOnFace( int row, int column ) const;
42  DVector2 positionOnFace( int channel ) const;
43 
44  int channel( int row, int column ) const;
45 
46  int row ( int channel ) const { return m_row[channel]; }
47  int column( int channel ) const { return m_column[channel]; }
48 
49  // get row and column from x and y positions
50  int row ( float y ) const;
51  int column( float x ) const;
52 
53  void toStrings(vector<pair<string,string> > &items)const{
54  AddString(items, "kCCALBlocksWide", "%d", (int) kCCALBlocksWide);
55  AddString(items, "kCCALBlocksTall", "%d", (int) kCCALBlocksTall);
56  AddString(items, "kCCALMaxChannels", "%d",(int) kCCALMaxChannels);
57  AddString(items, "kCCALBeamHoleSize", "%2.3f",(int) kCCALBeamHoleSize);
58  }
59 
60  private:
61 
64 
68 
70 };
71 
72 #endif // _DCCALGeometry_
73 
DVector2 positionOnFace(int row, int column) const
static double ccalFaceZ()
Definition: DCCALGeometry.h:33
int channel(int row, int column) const
static double blockLength()
Definition: DCCALGeometry.h:32
TVector2 DVector2
Definition: DVector2.h:9
Double_t x[NCHANNELS]
Definition: st_tw_resols.C:39
#define y
static const int kCCALBlocksWide
Definition: DCCALGeometry.h:25
bool m_activeBlock[kCCALBlocksTall][kCCALBlocksWide]
Definition: DCCALGeometry.h:62
static double ccalMidplane()
Definition: DCCALGeometry.h:35
int m_column[kCCALMaxChannels]
Definition: DCCALGeometry.h:67
static double blockSize()
Definition: DCCALGeometry.h:31
static const int kCCALBeamHoleSize
Definition: DCCALGeometry.h:29
static const int kCCALMidBlock
Definition: DCCALGeometry.h:28
int column(int channel) const
Definition: DCCALGeometry.h:47
const double k_cm
Definition: units.h:14
DVector2 m_positionOnFace[kCCALBlocksTall][kCCALBlocksWide]
Definition: DCCALGeometry.h:63
static const int kCCALMaxChannels
Definition: DCCALGeometry.h:27
static const int kCCALBlocksTall
Definition: DCCALGeometry.h:26
int row(int channel) const
Definition: DCCALGeometry.h:46
void toStrings(vector< pair< string, string > > &items) const
Definition: DCCALGeometry.h:53
int m_channelNumber[kCCALBlocksTall][kCCALBlocksWide]
Definition: DCCALGeometry.h:65
JOBJECT_PUBLIC(DCCALGeometry)
bool isBlockActive(int row, int column) const
int m_row[kCCALMaxChannels]
Definition: DCCALGeometry.h:66
int numActiveBlocks() const
Definition: DCCALGeometry.h:38