Detector.h 2.38 KB
Newer Older
clantz's avatar
clantz committed
1
2
3
/** @file Detector
 *  @brief Function prototypes for Detector
 *
4
 *  This contains the prototypes and members
clantz's avatar
clantz committed
5
6
7
8
9
10
11
12
13
14
 *  for Detector
 *
 *  @author Chad Lantz
 *  @bug No known bugs.
 */

#ifndef DETECTOR_H
#define DETECTOR_H

#include <vector>
15
#include <string>
16

clantz's avatar
clantz committed
17
#include "Containers.h"
18
#include "TTree.h"
clantz's avatar
clantz committed
19
20
21
22

class Detector{

 public:
23
  Detector( );
24
  Detector( std::vector< Channel* > _element ){ m_Element = _element;}
25
  virtual ~Detector( );
26

27

28
  virtual Channel* GetElement  (int row, int column);
clantz's avatar
clantz committed
29
  virtual Channel* GetElement  (std::string _name);
30
  virtual std::vector < Channel* > GetChannelsVector () { return m_Element; }
31
32
33
  virtual double*    GetPosition ( ) { return m_Position; }
  virtual double*    GetAngle    ( ) { return m_Angle; }
  virtual Alignment* GetAlignment( ) { return m_Alignment; }
34
  virtual Alignment2021* GetAlignment2021( ) { return m_Alignment2021; }
35

36
  virtual void     SetNSamples ( int _nSamples )  { m_nSamp = _nSamples; }
37
38
39
  virtual void     SetElement  ( Channel* _entry) { m_Element.push_back(_entry); }
  virtual void     SetPosition (double x, double y, double z) { m_Position[0] = x; m_Position[1] = y; m_Position[2] = z; }
  virtual void     SetAngle    (double _cosx = 0, double _cosy = 0, double _cosz = 0) { m_Angle[0] = _cosx; m_Angle[1] = _cosy; m_Angle[2] = _cosz; }
40
  virtual void     SetBranches ( TTree* _dataTree );
41
  virtual void     SetAlignment( Alignment* _alignment ){ m_Alignment = _alignment; }
42
  virtual void     SetAlignment2021( Alignment2021* _alignment ){ m_Alignment2021 = _alignment; }
43
44
  virtual void     DeclareHistograms ( );
  virtual void     FillHistograms ( );
45

46
  virtual void     PrintMap    ( ) = 0;
47
48
49
50

          void     SetName ( std::string _name ) { m_name = _name; }
   std::string     GetName ( ) { return m_name; }

clantz's avatar
clantz committed
51
  private:
52
53
  /** Name of the detector **/
  std::string m_name;
54
55
  /** Vector of channels associated to the dector **/
  std::vector< Channel* > m_Element;
56
  /** Three element array with x, y, and z of some pre-defined point on the detector **/
57
  double m_Position[3];
58
  /** Three element array of angle about the x, y, and z axis **/
59
  double m_Angle[3];
60
61
  /** Number of samples per channel **/
  int m_nSamp = 1024;
62
  /** Alignment of the 2018 Testbeam */
63
  Alignment* m_Alignment = 0;
64
65
  /** Alignment of the 2021 Testbeam */
  Alignment2021* m_Alignment2021 = 0;
clantz's avatar
clantz committed
66
67
68
  };

#endif