source: JEM-EUSO/esaf_cc_at_lal/packages/simulation/detector/electronics/include/FocalSurfaceFileParser.hh @ 114

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

actual version of ESAF at CCin2p3

File size: 4.0 KB
Line 
1// ESAF : Euso Simulation and Analysis Framework
2// $Id: FocalSurfaceFileParser.hh 2522 2006-03-01 20:54:01Z thea $
3// M. Pallavicini - created
4
5/*****************************************************************************
6 * ESAF: Euso Simulation and Analysis Framework                              *
7 *                                                                           *
8 *  Id: FocalSurfaceFileParser                                               *
9 *  Package: FocalSurfaceFileParser                                          *
10 *  Coordinator: Marco.Pallavicini                                           *
11 *                                                                           *
12 *****************************************************************************/
13
14#ifndef __FOCALSURFACEFILEPARSER_HH__
15#define __FOCALSURFACEFILEPARSER_HH__
16
17#include "euso.hh"
18#include "EVector.hh"
19#include "NumbersFileParser.hh"
20
21////////////////////////////////////////////////////////////////////////////////
22//                                                                            //
23// FocalSurfaceFileParser                                                     //
24//                                                                            //
25// This class inherits from NumberFileParser (config package)                 //
26// It is basically an helper class to build the Focal Surface. It is used     //
27// by EusoElectronics                                                         //
28//                                                                            //
29////////////////////////////////////////////////////////////////////////////////
30
31class FocalSurfaceFileParser : public NumbersFileParser {
32public:
33    // ctor
34    FocalSurfaceFileParser( string& fname );
35
36    // dtor
37    virtual ~FocalSurfaceFileParser();
38
39    // returns PMT number of the current line
40    // at each call move one line down
41    // returns 0 when number table is over
42    Int_t NewPmtId();
43
44    // return macrocell id if we have a new one, otherwise 0
45    Int_t NewMacroCell();
46
47    // return elementary cell id if we have a new one, otherwise 0
48    Int_t NewElementaryCell();
49   
50    // return front end chip id if we have a new one, otherwise 0
51    Int_t NewFrontEndChip();
52
53    // row and column position in macrocell
54    inline Int_t GetRowOffset() { return (Int_t) GetNum( fCurrent, CellRowCol ); }
55    inline Int_t GetColOffset() { return (Int_t) GetNum( fCurrent, CellColCol ); }
56
57    // geometry parameters
58    const EVector& Pos(); 
59    const EVector& Norm(); 
60    const EVector& Dir();
61
62private:
63    // current line
64    Int_t fCurrent;
65
66    // keep old values
67    Int_t fOldPmt;
68    Int_t fOldMC; 
69    Int_t fOldChip;
70    Int_t fOldEC;
71
72    // geometry vectors
73    EVector fPos; 
74    EVector fNorm; 
75    EVector fDir;
76   
77    // file format table
78    enum FileFormatTable { PmtIdCol=0,       // pmt identifier
79                           MCIdCol,          // macrocell identifier
80                           PDMIdCol,         // pdm identifier
81                           ECIdCol,          // elementary cell identifier
82                           ChipIdCol,        // front end chip identifier
83                           CellRowCol,       // offset row in macrocell
84                           CellColCol,       // offset column in macrocell,
85                           PmtTypeCol,       // type pf PMT
86                           PosXCol,          // position X
87                           PosYCol,          // position Y,
88                           PosZCol,          // position Z,
89                           NormXCol,         // normal X
90                           NormYCol,         // normal Y
91                           NormZCol,         // normal Z
92                           DirXCol,          // direction X
93                           DirYCol,          // direction Y
94                           DirZCol           // direction Z
95                         };
96
97    ClassDef(FocalSurfaceFileParser,0)
98};
99
100#endif  /* __FOCALSURFACEFILEPARSER_HH__ */
Note: See TracBrowser for help on using the repository browser.