1 #ifndef ALITPCCALIBRAWBASE_H
2 #define ALITPCCALIBRAWBASE_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
6 /////////////////////////////////////////////////////////////////////////////////////////
8 // Raw data processing base class //
10 /////////////////////////////////////////////////////////////////////////////////////////
14 class AliAltroMapping;
15 class AliAltroRawStream;
17 class AliTPCAltroMapping;
18 class AliTPCRawStreamFast;
19 class AliTPCRawStreamV3;
20 class AliTPCRawStream;
22 class TTreeSRedirector;
24 struct eventHeaderStruct;
26 class AliTPCCalibRawBase : public TNamed {
31 AliTPCCalibRawBase(const AliTPCCalibRawBase &calib);
33 AliTPCCalibRawBase& operator = (const AliTPCCalibRawBase &source);
35 virtual ~AliTPCCalibRawBase();
38 Bool_t ProcessEventFast(AliTPCRawStreamFast * const rawStreamFast);
39 Bool_t ProcessEventFast(AliRawReader * const rawReader);
41 //uses the new decoder which is compatible with the new altro format
42 Bool_t ProcessEvent(AliTPCRawStreamV3 * const rawStreamV3);
43 Bool_t ProcessEvent(AliRawReader * const rawReader);
44 Bool_t ProcessEvent(eventHeaderStruct * const event);
46 //For using the old decoder use the following functions
47 Bool_t ProcessEvent(AliTPCRawStream * const rawStream);
48 Bool_t ProcessEventOld(AliRawReader * const rawReader);
50 virtual Int_t Update(const Int_t /*isector*/, const Int_t /*iRow*/, const Int_t /*iPad*/,
51 const Int_t /*iTimeBin*/, const Float_t /*signal*/) { return 0; }
52 virtual void UpdateDDL() {return;}
53 virtual void ProcessBunch(const Int_t /*sector*/, const Int_t /*row*/, const Int_t /*pad*/,
54 const Int_t /*length*/, const UInt_t /*startTimeBin*/, const UShort_t* /*signal*/) {return; }
55 virtual void Analyse(){ return; }
57 virtual Long64_t Merge(TCollection * /*list*/) {return 0;}
60 void SetRangeTime (Int_t firstTimeBin, Int_t lastTimeBin) { fFirstTimeBin=firstTimeBin; fLastTimeBin=lastTimeBin; } //Set range in which the signal is expected
61 void SetAltroMapping(AliTPCAltroMapping **mapp) { fMapping = mapp; }
63 void SetUseL1Phase(Bool_t useL1Phase=kTRUE) {fUseL1Phase=useL1Phase;}
65 void SetTimeStampEvent(UInt_t timestamp){ fTimeStamp = timestamp; }
66 void SetRunNumber(UInt_t eventnumber){ fRunNumber = eventnumber; }
69 Int_t GetFirstTimeBin() const { return fFirstTimeBin; }
70 Int_t GetLastTimeBin() const { return fLastTimeBin; }
71 Int_t GetNevents() const { return fNevents; }
73 Double_t GetL1Phase() const {return fAltroL1Phase;}
74 Double_t GetL1PhaseTB() const {return fAltroL1PhaseTB;}
75 Bool_t GetUseL1Phase()const {return fUseL1Phase;}
77 UInt_t GetRunNumber() const {return fRunNumber;}
78 UInt_t GetTimeStamp() const {return fTimeStamp;}
79 UInt_t GetEventType() const {return fEventType;}
81 AliTPCAltroMapping **GetAltroMapping() { return fMapping; }
82 const AliAltroRawStream *GetAltroRawStream() const {return fAltroRawStream;}
83 const AliTPCROC *GetTPCROC() const {return fROC;}
85 void IncrementNevents(){++fNevents;}
87 void DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE);
88 // debug and debug streamer support
89 TTreeSRedirector *GetDebugStreamer();
90 void SetStreamLevel(Int_t streamLevel){fStreamLevel=streamLevel;}
91 void SetDebugLevel(Int_t level) {fDebugLevel = level;}
92 Int_t GetStreamLevel() const {return fStreamLevel;}
93 Int_t GetDebugLevel() const {return fDebugLevel;}
96 Int_t fFirstTimeBin; // First Time bin used for analysis
97 Int_t fLastTimeBin; // Last Time bin used for analysis
99 Int_t fNevents; // Number of processed events
101 Int_t fDebugLevel; //! debug level
102 Int_t fStreamLevel; //! level of streamer output
104 UInt_t fRunNumber; // current run number from event header
105 UInt_t fTimeStamp; //! time stamp from event header
106 UInt_t fEventType; //! current event Type from event header
108 Double_t fAltroL1Phase; //! L1 Phase
109 Float_t fAltroL1PhaseTB; //! L1 Phase in time bins
110 Int_t fCurrRCUId; //! Current RCU Id
111 Int_t fPrevRCUId; //! Previous RCU Id
112 Int_t fCurrDDLNum; //! Current DDL number
113 Int_t fPrevDDLNum; //! Current DDL number
114 Bool_t fUseL1Phase; // use L1 Phase information?
116 TTreeSRedirector *fDebugStreamer; //! debug streamer
118 AliAltroRawStream *fAltroRawStream; //! pointer to the altro object
119 AliTPCAltroMapping **fMapping; //! Altro Mapping object
121 AliTPCROC *fROC; //! ROC information
123 virtual void EndEvent() {++fNevents; return; } //fNevents should be updated in the derived classes in a proper place
124 virtual void ResetEvent(){ return; } //Reset Event counters
127 ClassDef(AliTPCCalibRawBase,2) // Calibration base class for raw data processing