]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDrawData.h
Printout fixed.
[u/mrichter/AliRoot.git] / TRD / AliTRDrawData.h
CommitLineData
5990c064 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
b864d801 16class TTree;
2cb20be6 17
92c7f341 18class AliRunLoader;
19
b864d801 20class AliRawReader;
5990c064 21
2cb20be6 22class AliTRDdigitsManager;
8c703901 23class AliTRDgeometry;
dfd03fc3 24class AliTRDfeeParam;
b65e5048 25class AliTRDarrayADC;
2cb20be6 26
45e64f3b 27// Some constants:
28const UInt_t kEndoftrackletmarker = 0xAAAAAAAA; /*This marks the end of tracklet data words*/
29const UInt_t kEndofrawdatamarker = 0x00000000; /*This marks the end of half-chamber-data*/
30const UInt_t kSizeWord = sizeof(UInt_t);
31
5990c064 32class AliTRDrawData : public TObject {
33
34 public:
35
36 AliTRDrawData();
8c703901 37 AliTRDrawData(const AliTRDrawData &r);
5990c064 38 virtual ~AliTRDrawData();
5990c064 39
7925de54 40 AliTRDrawData &operator=(const AliTRDrawData &/*r*/) { return *this; }
8c703901 41
037c5823 42 virtual Bool_t Digits2Raw(TTree *digits, const TTree *tracks = NULL);
8c703901 43
625f5260 44 virtual AliTRDdigitsManager *Raw2Digits(AliRawReader *rawReader);
45e64f3b 45 //virtual AliTRDdigitsManager *Raw2DigitsOLD(AliRawReader *rawReader);
987ba9a3 46 static void SetRawFormatVersion(Int_t iver){ fgRawFormatVersion=iver; };
6a04e92b 47 static void SetSuppressionLevel(Int_t ilevel){ fgDataSuppressionLevel=ilevel; };
92c7f341 48 Bool_t WriteTracklets(Int_t det);
49 Bool_t OpenOutput();
987ba9a3 50
51 enum FORMATTYPE
52 {
53 kRawOldFormat = 0,
54 kRawNewFormat = 1
55 };
5990c064 56
57 protected:
58
50378239 59 virtual Bool_t Digits2Raw(AliTRDdigitsManager* digitsManager); // for fRawVersion > 0
6a04e92b 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);
037c5823 61 virtual Int_t ProduceHcDataNoSuppression(Int_t side, Int_t det, UInt_t *buf, Int_t maxSize);
b65e5048 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);
987ba9a3 65 void ProduceSMIndexData(UInt_t *buf, Int_t& nw); // SM index words and header - real data format
1d93b218 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
987ba9a3 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
6a04e92b 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
50378239 72
92c7f341 73 AliRunLoader *fRunLoader; //! Run Loader
8c703901 74 AliTRDgeometry *fGeo; //! Geometry
dfd03fc3 75 AliTRDfeeParam *fFee; //! Fee Parameters
8c703901 76 Int_t fNumberOfDDLs; // Number of DDLs
92c7f341 77 TTree *fTrackletTree; //! Tree for tracklets
78 UInt_t **fTrackletContainer; //! tracklet container
8c703901 79
dfd03fc3 80 ClassDef(AliTRDrawData,5) // TRD raw data class
5990c064 81
987ba9a3 82 private:
83
b65e5048 84 static Int_t fgRawFormatVersion; // simulation raw data version - 0:old , 1:new(real data format)
6a04e92b 85 static Int_t fgDataSuppressionLevel; // Data suppression level - 0:no su, 1: su, 2: deep suppression
b65e5048 86 static const UInt_t fgkEndOfTrackletMarker = 0x10001000; // This marks the end of tracklet data words
037c5823 87 static const UInt_t fgkEndOfDataMarker = 0x00000000; // This marks the end of HC data words
987ba9a3 88
6a04e92b 89 Int_t fSMindexPos; // Position of SM index word
90 Int_t fStackindexPos; // Position of SM index word
91 UInt_t fEventCounter; // Event counter(starting from 1)
92
93
987ba9a3 94
95
5990c064 96};
97#endif
96e6312d 98
99
100
101
102
103