]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDrawData.h
Coverity
[u/mrichter/AliRoot.git] / TRD / AliTRDrawData.h
1 #ifndef ALITRDRAWDATA_H
2 #define ALITRDRAWDATA_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 ///////////////////////////////////////////////////////////////////////////////
9 //                                                                           //
10 //  Converts TRD digits into a raw data stream                               //
11 //                                                                           //
12 ///////////////////////////////////////////////////////////////////////////////
13
14 #include "TObject.h"
15 #include "AliTRDgeometry.h"
16
17 class TTree;
18 class TClonesArray;
19
20 class AliRunLoader;
21
22 class AliRawReader;
23
24 class AliTRDdigitsManager;
25 class AliTRDfeeParam;
26 class AliTRDarrayADC;
27 class AliTRDdigitsParam;
28 class AliTRDmcmSim;
29
30 class AliTRDrawData : public TObject {
31
32  public:
33
34   AliTRDrawData();
35   AliTRDrawData(const AliTRDrawData &r);
36   virtual ~AliTRDrawData();
37
38   AliTRDrawData &operator=(const AliTRDrawData &/*r*/) { return *this; }
39
40   virtual Bool_t       Digits2Raw(TTree *digits, const TTree *tracks = NULL);
41
42   virtual AliTRDdigitsManager *Raw2Digits(AliRawReader *rawReader);
43
44   virtual TClonesArray    *TrackletsArray();
45   virtual TClonesArray    *TracksArray();
46   void                    SetTrackletsOwner(TClonesArray *trkl = 0x0) { fTracklets = trkl; } // set to own the given array
47   void                    SetTracksOwner(TClonesArray *trk = 0x0) { fTracks = trk; } // set to own the given array
48
49   UInt_t  GetTriggerFlags(const Int_t sector) const { return fTrgFlags[sector]; }
50
51  protected:
52
53   virtual Bool_t       Digits2Raw(AliTRDdigitsManager* digitsManager); // for fRawVersion > 0
54   virtual Int_t        ProduceHcData(AliTRDarrayADC *digits, Int_t side, Int_t det, UInt_t *buf, Int_t maxSize, Bool_t newEvent, Bool_t newSM);
55           void         ProduceSMIndexData(UInt_t *buf, Int_t& nw);                              // SM index words and header - real data format
56           void         WriteIntermediateWords(UInt_t *buf, Int_t& nw, Int_t& of, const Int_t& maxSize, const Int_t& det, const Int_t& side); // real data format
57           void         AssignStackMask(UInt_t *buf, Int_t nStack);  // re-assignment of stack mask in the SM index word
58           void         AssignLinkMask(UInt_t *buf, Int_t nLayer);   // re-assignment of link mask in the stack index word
59           Int_t        AddStackIndexWords(UInt_t *buf, Int_t nStack, Int_t nMax);   // add stack index words and stack header when there is no data for the stack 
60           Bool_t       ShiftWords(UInt_t *buf, Int_t nStart, Int_t nWords, Int_t nMax); // shifts n words
61   
62   AliRunLoader        *fRunLoader;      //! Run Loader
63   AliTRDgeometry      *fGeo;            //! Geometry
64   AliTRDfeeParam      *fFee;            //! Fee Parameters
65   Int_t                fNumberOfDDLs;   //  Number of DDLs
66   TTree               *fTrackletTree;   //! Tree for tracklets
67
68   TClonesArray        *fTracklets;      //! Array of online tracklets
69   TClonesArray        *fTracks;         //! Array of GTU tracks
70
71  private:
72
73   static       Int_t  fgDataSuppressionLevel;               // Data suppression level - 0:no su, 1: su, 2: deep suppression 
74   static const UInt_t fgkEndOfTrackletMarker  = 0x10001000; // This marks the end of tracklet data words
75   static const UInt_t fgkEndOfDataMarker      = 0x00000000; // This marks the end of HC data words
76
77   Int_t   fSMindexPos;                // Position of SM index word
78   Int_t   fStackindexPos;             // Position of SM index word
79   UInt_t  fEventCounter;              // Event counter(starting from 1)
80   UInt_t  fTrgFlags[AliTRDgeometry::kNsector]; // trigger flags
81   AliTRDmcmSim      *fMcmSim;         //! MCM simulation for raw data output
82   AliTRDdigitsParam *fDigitsParam;    // Digits parameter
83
84   ClassDef(AliTRDrawData,8)             //  TRD raw data class
85
86 };
87 #endif