]>
Commit | Line | Data |
---|---|---|
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 | ||
16 | class TTree; | |
17 | ||
18 | class AliRunLoader; | |
19 | ||
20 | class AliRawReader; | |
21 | ||
22 | class AliTRDdigitsManager; | |
23 | class AliTRDgeometry; | |
24 | class AliTRDfeeParam; | |
25 | class AliTRDarrayADC; | |
26 | ||
27 | class AliTRDrawData : public TObject { | |
28 | ||
29 | public: | |
30 | ||
31 | AliTRDrawData(); | |
32 | AliTRDrawData(const AliTRDrawData &r); | |
33 | virtual ~AliTRDrawData(); | |
34 | ||
35 | AliTRDrawData &operator=(const AliTRDrawData &/*r*/) { return *this; } | |
36 | ||
37 | virtual Bool_t Digits2Raw(TTree *digits, const TTree *tracks = NULL); | |
38 | ||
39 | virtual AliTRDdigitsManager *Raw2Digits(AliRawReader *rawReader); | |
40 | virtual AliTRDdigitsManager *Raw2DigitsOLD(AliRawReader *rawReader); | |
41 | static void SetRawFormatVersion(Int_t iver){ fgRawFormatVersion=iver; }; | |
42 | static void SetSuppressionLevel(Int_t ilevel){ fgDataSuppressionLevel=ilevel; }; | |
43 | Bool_t WriteTracklets(Int_t det); | |
44 | Bool_t OpenOutput(); | |
45 | ||
46 | enum FORMATTYPE | |
47 | { | |
48 | kRawOldFormat = 0, | |
49 | kRawNewFormat = 1 | |
50 | }; | |
51 | ||
52 | protected: | |
53 | ||
54 | virtual Bool_t Digits2Raw(AliTRDdigitsManager* digitsManager); // for fRawVersion > 0 | |
55 | virtual Int_t ProduceHcData(AliTRDarrayADC *digits, Int_t side, Int_t det, UInt_t *buf, Int_t maxSize, Bool_t newEvent, Bool_t newSM); | |
56 | virtual Int_t ProduceHcDataNoSuppression(Int_t side, Int_t det, UInt_t *buf, Int_t maxSize); | |
57 | virtual Int_t ProduceHcDataV1andV2(AliTRDarrayADC *digits, Int_t side, Int_t det, UInt_t *buf, Int_t maxSize); | |
58 | virtual Int_t ProduceHcDataV3(AliTRDarrayADC *digits, Int_t side, Int_t det, UInt_t *buf, Int_t maxSize, Bool_t newEvent); | |
59 | //virtual Int_t ProduceHcDataV3(AliTRDarrayADC *digits, Int_t side, Int_t det, UInt_t *buf, Int_t maxSize); | |
60 | void ProduceSMIndexData(UInt_t *buf, Int_t& nw); // SM index words and header - real data format | |
61 | void WriteIntermediateWords(UInt_t *buf, Int_t& nw, Int_t& of, const Int_t& maxSize, const Int_t& det, const Int_t& side); // writes tracklet-endmarker and additional words between tracklet and raw-data | |
62 | void WriteIntermediateWordsV2(UInt_t *buf, Int_t& nw, Int_t& of, const Int_t& maxSize, const Int_t& det, const Int_t& side); // real data format | |
63 | void AssignStackMask(UInt_t *buf, Int_t nStack); // re-assignment of stack mask in the SM index word | |
64 | void AssignLinkMask(UInt_t *buf, Int_t nLayer); // re-assignment of link mask in the stack index word | |
65 | 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 | |
66 | Bool_t ShiftWords(UInt_t *buf, Int_t nStart, Int_t nWords, Int_t nMax); // shifts n words | |
67 | ||
68 | AliRunLoader *fRunLoader; //! Run Loader | |
69 | AliTRDgeometry *fGeo; //! Geometry | |
70 | AliTRDfeeParam *fFee; //! Fee Parameters | |
71 | Int_t fNumberOfDDLs; // Number of DDLs | |
72 | TTree *fTrackletTree; //! Tree for tracklets | |
73 | UInt_t **fTrackletContainer; //! tracklet container | |
74 | ||
75 | ClassDef(AliTRDrawData,5) // TRD raw data class | |
76 | ||
77 | private: | |
78 | ||
79 | static Int_t fgRawFormatVersion; // simulation raw data version - 0:old , 1:new(real data format) | |
80 | static Int_t fgDataSuppressionLevel; // Data suppression level - 0:no su, 1: su, 2: deep suppression | |
81 | static const UInt_t fgkEndOfTrackletMarker = 0x10001000; // This marks the end of tracklet data words | |
82 | static const UInt_t fgkEndOfDataMarker = 0x00000000; // This marks the end of HC data words | |
83 | ||
84 | Int_t fSMindexPos; // Position of SM index word | |
85 | Int_t fStackindexPos; // Position of SM index word | |
86 | UInt_t fEventCounter; // Event counter(starting from 1) | |
87 | ||
88 | ||
89 | ||
90 | ||
91 | }; | |
92 | #endif | |
93 | ||
94 | ||
95 | ||
96 | ||
97 | ||
98 |