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 */
8 ///////////////////////////////////////////////////////////////////////////////
10 // Converts TRD digits into a raw data stream //
12 ///////////////////////////////////////////////////////////////////////////////
22 class AliTRDdigitsManager;
26 class AliTRDdigitsParam;
29 const UInt_t kEndoftrackletmarker = 0xAAAAAAAA; /*This marks the end of tracklet data words*/
30 const UInt_t kEndofrawdatamarker = 0x00000000; /*This marks the end of half-chamber-data*/
31 const UInt_t kSizeWord = sizeof(UInt_t);
33 class AliTRDrawData : public TObject {
38 AliTRDrawData(const AliTRDrawData &r);
39 virtual ~AliTRDrawData();
41 AliTRDrawData &operator=(const AliTRDrawData &/*r*/) { return *this; }
43 virtual Bool_t Digits2Raw(TTree *digits, const TTree *tracks = NULL);
45 virtual AliTRDdigitsManager *Raw2Digits(AliRawReader *rawReader);
46 //virtual AliTRDdigitsManager *Raw2DigitsOLD(AliRawReader *rawReader);
47 static void SetRawFormatVersion(Int_t iver){ fgRawFormatVersion=iver; };
48 static void SetSuppressionLevel(Int_t ilevel){ fgDataSuppressionLevel=ilevel; };
49 Bool_t WriteTracklets(Int_t det);
59 virtual Bool_t Digits2Raw(AliTRDdigitsManager* digitsManager); // for fRawVersion > 0
60 virtual Int_t ProduceHcData(AliTRDarrayADC *digits, Int_t side, Int_t det, UInt_t *buf, Int_t maxSize, Bool_t newEvent, Bool_t newSM);
61 virtual Int_t ProduceHcDataNoSuppression(Int_t side, Int_t det, UInt_t *buf, Int_t maxSize);
62 virtual Int_t ProduceHcDataV1andV2(AliTRDarrayADC *digits, Int_t side, Int_t det, UInt_t *buf, Int_t maxSize);
63 virtual Int_t ProduceHcDataV3(AliTRDarrayADC *digits, Int_t side, Int_t det, UInt_t *buf, Int_t maxSize, Bool_t newEvent);
64 //virtual Int_t ProduceHcDataV3(AliTRDarrayADC *digits, Int_t side, Int_t det, UInt_t *buf, Int_t maxSize);
65 void ProduceSMIndexData(UInt_t *buf, Int_t& nw); // SM index words and header - real data format
66 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
67 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
68 void AssignStackMask(UInt_t *buf, Int_t nStack); // re-assignment of stack mask in the SM index word
69 void AssignLinkMask(UInt_t *buf, Int_t nLayer); // re-assignment of link mask in the stack index word
70 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
71 Bool_t ShiftWords(UInt_t *buf, Int_t nStart, Int_t nWords, Int_t nMax); // shifts n words
73 AliRunLoader *fRunLoader; //! Run Loader
74 AliTRDgeometry *fGeo; //! Geometry
75 AliTRDfeeParam *fFee; //! Fee Parameters
76 Int_t fNumberOfDDLs; // Number of DDLs
77 TTree *fTrackletTree; //! Tree for tracklets
78 UInt_t **fTrackletContainer; //! tracklet container
82 static Int_t fgRawFormatVersion; // simulation raw data version - 0:old , 1:new(real data format)
83 static Int_t fgDataSuppressionLevel; // Data suppression level - 0:no su, 1: su, 2: deep suppression
84 static const UInt_t fgkEndOfTrackletMarker = 0x10001000; // This marks the end of tracklet data words
85 static const UInt_t fgkEndOfDataMarker = 0x00000000; // This marks the end of HC data words
87 Int_t fSMindexPos; // Position of SM index word
88 Int_t fStackindexPos; // Position of SM index word
89 UInt_t fEventCounter; // Event counter(starting from 1)
90 AliTRDdigitsParam *fDigitsParam; // Digits parameter
92 ClassDef(AliTRDrawData,6) // TRD raw data class