source: JEM-EUSO/esaf_lal/tags/v1_r0/esaf/packages/simulation/detector/electronics/include/ElementaryCell.hh @ 117

Last change on this file since 117 was 117, checked in by moretto, 11 years ago

ESAF version compilable on mac OS

File size: 2.5 KB
Line 
1// class Elementary Cell
2// $Id: ElementaryCell.hh 1588 2005-02-24 11:00:28Z pesce $
3// M. Pallavicini - created 10-10-03
4//
5
6#ifndef _ELEMENTARYCELL__H
7#define _ELEMENTARYCELL__H
8
9#include "EVector.hh"
10#include "Photomultiplier.hh"
11#include "FrontEndChip.hh"
12
13class ElementaryCell {
14public:
15    // ctor
16    ElementaryCell();
17
18    // dtor
19    virtual ~ElementaryCell();
20
21    // reset static counter
22    static void ResetClass() {gElemCellCounter=1;}
23   
24    // get id
25    inline int Id() { return fId;}
26   
27    // get normal
28    inline const EVector& GetNormal() const { return fNormal;} 
29   
30    // get up-left corner
31    inline const EVector& GetUpLeft() const { return fUpLeft;} 
32   
33    // get up-right corner
34    inline const EVector& GetUpRight() const { return fUpRight;} 
35   
36    // get down-left corner
37    inline const EVector& GetDownLeft() const { return fDownLeft;} 
38   
39    // get down-right corner
40    inline const EVector& GetDownRight() const { return fDownRight;}
41   
42    // GetXAxis
43    inline const EVector& GetXAxis() const { return fXAxis;}
44   
45    // GetYAxis
46    inline const EVector& GetYAxis() const { return fYAxis;}
47
48    // get center
49    EVector GetCenter() const;
50
51    // pointer to front end chip (the chip must be unique!!)
52    inline FrontEndChip* FrontEnd()  const { return pPmts[0]->FrontEnd();}
53
54    // associate for PMTs and compute internal infos
55    void AssociatePmts(Photomultiplier *p1, Photomultiplier *p2=NULL, 
56                       Photomultiplier *p3=NULL, Photomultiplier *p4=NULL);
57
58    // get row and column offset in MacroCell trigger from the chip
59    inline int GetRowOffset() const {return FrontEnd()->GetCellRowOffset();}
60    inline int GetColOffset() const {return FrontEnd()->GetCellColOffset();}
61
62    // infos about PMTs
63    inline int GetNumPmts() const { return fNumPmts; }
64    inline Photomultiplier *GetPmt(Int_t i); 
65
66private:
67    // elementary cell info
68    Int_t fId;
69    static Int_t gElemCellCounter;
70
71    Int_t fNumPmts;
72    Photomultiplier *pPmts[4];
73
74    // geometry of the Elementary Cell
75    EVector fNormal;
76    EVector fUpLeft;
77    EVector fUpRight;
78    EVector fDownLeft;
79    EVector fDownRight;
80    EVector fXAxis;
81    EVector fYAxis;
82   
83
84    // row and column position of this elementaty cell in MacroCell trigger
85    // logic
86    ClassDef(ElementaryCell,0)
87};
88 
89// inline
90Photomultiplier *ElementaryCell::GetPmt(Int_t i) { 
91    if ( i>0 && i<=GetNumPmts() ) {
92        return pPmts[i-1]; 
93    } 
94    else {
95        return (Photomultiplier*)NULL;
96    }
97}
98
99#endif
Note: See TracBrowser for help on using the repository browser.