]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONRawWriter.h
426e90b88dd2a0621e99a5ae3567439c2c3e92cc
[u/mrichter/AliRoot.git] / MUON / AliMUONRawWriter.h
1 #ifndef ALIMUONRAWWRITER_H
2 #define ALIMUONRAWWRITER_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 AliMUONRawWriter
10 /// \brief Raw data class for trigger and tracker chambers
11 ///
12 /// Writring Raw data class for trigger and tracker chambers
13
14 #include <TObject.h>
15 #include <TClonesArray.h>
16 #include "AliMUONBusStruct.h"
17 #include "AliRawDataHeader.h"
18 #include "TStopwatch.h"
19
20 class AliMUONData;
21 class AliMUONDigit;
22 class AliMUONDspHeader;
23 class AliMUONBlockHeader;
24 class AliMUONDarcHeader;
25 class AliMUONRegHeader;
26 class AliMUONLocalStruct;
27 class AliMUONGlobalTrigger;
28 class AliMpBusPatch;
29 class AliMpSegFactory;
30
31 class AliMUONRawWriter : public TObject 
32 {
33  public:
34   AliMUONRawWriter(AliMUONData* data); // Constructor
35   virtual ~AliMUONRawWriter(); // Destructor
36     
37   // write raw data
38   Int_t Digits2Raw();
39
40   void  SetScalerEvent() {fScalerEvent = kTRUE;}
41   
42 protected:
43   AliMUONRawWriter();                  // Default constructor
44   AliMUONRawWriter (const AliMUONRawWriter& rhs); // copy constructor
45   AliMUONRawWriter& operator=(const AliMUONRawWriter& rhs); // assignment operator
46
47   // writing raw data
48   Int_t WriteTrackerDDL(Int_t iCh);
49   Int_t WriteTriggerDDL();
50   
51 private:
52
53   void AddData(const AliMUONBusStruct& event)
54   {
55     TClonesArray &temp = *fBusArray;
56     new(temp[temp.GetEntriesFast()]) AliMUONBusStruct(event); 
57   }
58
59   Int_t GetBusPatch(const AliMUONDigit& digit);
60   
61   Int_t GetGlobalTriggerPattern(const AliMUONGlobalTrigger* gloTrg) const;
62
63 private:
64
65   AliMUONData*  fMUONData;           //!< Data container for MUON subsystem 
66  
67   FILE*         fFile[2];            //!< DDL binary file pointer one per 1/2 chamber
68
69   TClonesArray* fBusArray;           //!< array to sub event tracker
70    
71   AliMUONBlockHeader* fBlockHeader;  //!< DDL block header class pointers
72   AliMUONDspHeader*   fDspHeader;    //!< DDL Dsp header class pointers
73   AliMUONBusStruct*   fBusStruct;    //!< DDL bus patch structure class pointers
74   AliMUONDarcHeader*  fDarcHeader;   //!< DDL darc header class pointers
75   AliMUONRegHeader*   fRegHeader;    //!< DDL regional header class pointers
76   AliMUONLocalStruct* fLocalStruct;  //!< DDL local structure class pointers
77
78   AliMpBusPatch* fBusPatchManager;   //!< buspatch versus DE's & DDL
79
80   Bool_t fScalerEvent;               ///< flag to generates scaler event
81
82   AliRawDataHeader    fHeader;           ///< header of DDL
83
84   static Int_t fgManuPerBusSwp1B[12];   //!< array containing the first manuId for each buspatch st1, Bending
85   static Int_t fgManuPerBusSwp1NB[12];  //!< array containing the first manuId for each buspatch st1, NBending
86
87   static Int_t fgManuPerBusSwp2B[12];   //!< array containing the first manuId for each buspatch st2, Bending
88   static Int_t fgManuPerBusSwp2NB[12];  //!< array containing the first manuId for each buspatch st2, NBending
89   
90   TStopwatch fTrackerTimer;             //!< 
91   TStopwatch fTriggerTimer;             //!< 
92   TStopwatch fMappingTimer;             //!< 
93   
94   AliMpSegFactory* fSegFactory;         //!< mapping segmentation factory
95   
96   ClassDef(AliMUONRawWriter,1) // MUON cluster reconstructor in ALICE
97 };
98         
99 #endif