Line data Source code
1 : #ifndef ALITOFFEEREADER_H
2 : #define ALITOFFEEREADER_H
3 :
4 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 : * See cxx source for full Copyright notice */
6 :
7 : ///////////////////////////////////////////////////////////////
8 : // //
9 : // This class provides the TOF FEE reader. //
10 : // //
11 : ///////////////////////////////////////////////////////////////
12 :
13 : /*
14 : * author: Roberto Preghenella (R+), Roberto.Preghenella@bo.infn.it
15 : */
16 :
17 : #include "TObject.h"
18 : //#include "AliTOFGeometry.h"
19 :
20 : class AliTOFFEEConfig;
21 : class AliTOFFEElightConfig;
22 :
23 : class AliTOFFEEReader :
24 : public TObject
25 : {
26 :
27 : public:
28 :
29 : AliTOFFEEReader(); // default constructor
30 : AliTOFFEEReader(const AliTOFFEEReader &source); // copy constructor
31 : AliTOFFEEReader &operator=(const AliTOFFEEReader &source); // operator =
32 : virtual ~AliTOFFEEReader(); // default destructor
33 :
34 : /* getters */
35 0 : static Int_t GetNumberOfDDLs() {return fgkNumberOfDDLs;}; // get number of DDLs
36 0 : static Int_t GetNumberOfTRMs() {return fgkNumberOfTRMs;}; // get number of TRMs
37 0 : static Int_t GetNumberOfChains() {return fgkNumberOfChains;}; // get number of chains
38 0 : static Int_t GetNumberOfTDCs() {return fgkNumberOfTDCs;}; // get number of TDCs
39 0 : static Int_t GetNumberOfChannels() {return fgkNumberOfChannels;}; // get number of channels
40 0 : static Int_t GetNumberOfIndexes() {return fgkNumberOfIndexes;}; // get number of indexes
41 0 : static Int_t GetNumberOfIndexesEO() {return fgkNumberOfIndexesEO;}; // get number of indexes EO
42 0 : AliTOFFEEConfig *GetFEEConfig() const {return fFEEConfig;}; // get FEE config
43 0 : AliTOFFEElightConfig *GetFEElightConfig() const {return fFEElightConfig;}; // get FEElight config
44 0 : Bool_t GetChannelEnabled(Int_t iIndex) const {return iIndex < GetNumberOfIndexes() ? fChannelEnabled[iIndex] : kFALSE;}; // get channel enabled
45 0 : Int_t GetMatchingWindow(Int_t iIndex) const {return iIndex < GetNumberOfIndexes() ? fMatchingWindow[iIndex] : 0;}; // get matching window
46 0 : Int_t GetLatencyWindow(Int_t iIndex) const {return iIndex < GetNumberOfIndexes() ? fLatencyWindow[iIndex] : 0;}; // get latency window
47 0 : UInt_t GetTriggerMask(Int_t iddl) const {return iddl < GetNumberOfDDLs() ? fTriggerMask[iddl] : 0;}; // get trigger mask
48 0 : UInt_t *GetTriggerMaskArray() {return fTriggerMask;}; // get trigger mask array
49 :
50 : /* setters */
51 :
52 : /* methods */
53 :
54 : /* TOFFEE methods */
55 : void LoadFEEConfig(const Char_t *FileName) const; // load FEE config
56 : void DumpFEEConfig(); // dump FEE config
57 : Int_t ParseFEEConfig(); // parse FEE config
58 :
59 : /* TOFFEElight methods */
60 : void LoadFEElightConfig(const Char_t *FileName) const; // load FEElight config
61 : void CreateFEElightConfig(const Char_t *filename); // create FEElight config
62 : Int_t ParseFEElightConfig(); // parse FEElight config
63 :
64 : void ResetChannelEnabledArray(); // reset channel enabled array
65 : void ResetTriggerMaskArray(); // reset trigger mask array
66 : void Reset(); // reset channel enabled array
67 0 : Bool_t IsChannelEnabled(Int_t iIndex) const {return GetChannelEnabled(iIndex);}; // is channel enabled
68 :
69 : private:
70 :
71 : /* TOFFEE */
72 : Bool_t IsChannelEnabled(Int_t iDDL, Int_t iTRM, Int_t iChain, Int_t iTDC, Int_t iChannel) const; // is channel enabled (from TOFFEE)
73 : Int_t GetMatchingWindow(Int_t iDDL, Int_t iTRM, Int_t iChain, Int_t iTDC, Int_t iChannel) const; // get matching window (from TOFFEE)
74 :
75 : static const Int_t fgkNumberOfDDLs = 72; // number of DDLs
76 : static const Int_t fgkNumberOfTRMs = 10; // number of TRMs
77 : static const Int_t fgkNumberOfChains = 2; // number of chains
78 : static const Int_t fgkNumberOfTDCs = 15; // number of TDCs
79 : static const Int_t fgkNumberOfChannels = 8; // number of channels
80 : static const Int_t fgkNumberOfIndexes = 157248; // number of indexes
81 : static const Int_t fgkNumberOfIndexesEO = 172800; // number of indexes EO
82 :
83 : AliTOFFEEConfig *fFEEConfig; // FEE config
84 : AliTOFFEElightConfig *fFEElightConfig; // FEElight config
85 : Bool_t fChannelEnabled[fgkNumberOfIndexes]; // channel enabled
86 : Int_t fMatchingWindow[fgkNumberOfIndexes]; // matching window
87 : Int_t fLatencyWindow[fgkNumberOfIndexes]; // matching window
88 :
89 : UInt_t fTriggerMask[fgkNumberOfDDLs]; // trigger mask
90 :
91 26 : ClassDef(AliTOFFEEReader, 2);
92 :
93 : };
94 :
95 : #endif /* ALITOFFEEREADER_H */
|