]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONRawData.h
Add variable numbers of DSP's/buspatches and DDL (Christian)
[u/mrichter/AliRoot.git] / MUON / AliMUONRawData.h
1 #ifndef ALIMUONRAWDATA_H
2 #define ALIMUONRAWDATA_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /*$Id$*/
7
8 /// \ingroup rec
9 /// \class AliMUONRawData
10 /// \brief Raw data class for trigger and tracker chambers
11 ///
12 /// Raw data class for trigger and tracker chambers
13
14 #include <TObject.h>
15 #include <TExMap.h>
16 #include "AliMUONSubEventTracker.h"
17
18 class TClonesArray;
19 class TArrayI;
20 class AliLoader;
21 class AliMUONData;
22 class AliMUONDigit;
23 class AliMUONDDLTracker;
24 class AliMUONDDLTrigger;
25 class AliMUONGlobalTrigger;
26 class AliMUONSubEventTrigger;
27 class AliRawReader;
28 class AliMUONGlobalTrigger;
29
30 class AliMUONRawData : public TObject 
31 {
32  public:
33   AliMUONRawData(AliLoader* loader); // Constructor
34   virtual ~AliMUONRawData(void); // Destructor
35     
36   // write raw data
37   Int_t   Digits2Raw();
38   Int_t   Raw2Digits(AliRawReader* rawReader);
39
40   Int_t ReadTrackerDDL(AliRawReader* rawReader);
41   Int_t ReadTriggerDDL(AliRawReader* rawReader);
42
43   void GetDspInfo(Int_t iCh, Int_t& iDspMax, Int_t* iBusPerDSP);
44   Int_t  GetDDLfromBus(Int_t busPatchId);
45
46   AliMUONData*   GetMUONData() {return fMUONData;}
47
48   void AddData(const AliMUONSubEventTracker* event) {
49     TClonesArray &temp = *fSubEventArray;
50     new(temp[temp.GetEntriesFast()])AliMUONSubEventTracker(*event); 
51   }
52
53
54   // could be private function (public for debugging)
55   Int_t GetInvMapping(const AliMUONDigit* digit, Int_t &busPatchId,
56                        UShort_t &manuId, UChar_t &channelId);
57
58   Int_t GetMapping(Int_t buspatchId, UShort_t manuId, 
59                           UChar_t channelId, AliMUONDigit* digit );
60
61
62   Int_t GetGlobalTriggerPattern(const AliMUONGlobalTrigger* gloTrg) const;
63   AliMUONGlobalTrigger* GetGlobalTriggerPattern(Int_t gloTrg) const;
64
65   Int_t GetDEfromBus(Int_t busPatchId);
66   TArrayI* GetBusfromDE(Int_t idDE);
67
68  protected:
69   AliMUONRawData();                  // Default constructor
70   AliMUONRawData (const AliMUONRawData& rhs); // copy constructor
71   AliMUONRawData& operator=(const AliMUONRawData& rhs); // assignment operator
72
73  private:
74
75   AliMUONData*  fMUONData;           //! Data container for MUON subsystem 
76  
77   AliLoader*    fLoader;             //! alice loader
78  
79   FILE*         fFile[2];            //! DDL binary file pointer one per 1/2 chamber
80
81   TClonesArray* fSubEventArray;      //! array to sub event tracker
82    
83   AliMUONDDLTracker* fDDLTracker;    //! DDL tracker class pointers
84   AliMUONDDLTrigger* fDDLTrigger;    //! DDL trigger class pointers
85
86   TExMap fDetElemIdToBusPatch;       //! Map from idDE to BusPatch   
87   TExMap fBusPatchToDetElem;         //! Map from BusPatch to idDE
88   TExMap fBusPatchToDDL;             //! Map from BusPatch to iDDL
89
90   Int_t fMaxBusPerCh[10];            //! max buspatch number per chamber
91
92   // writing raw data
93   Int_t WriteTrackerDDL(Int_t iCh);
94   Int_t WriteTriggerDDL();
95
96   void  ReadBusPatchFile();
97
98   ClassDef(AliMUONRawData,1) // MUON cluster reconstructor in ALICE
99 };
100         
101 #endif