Compatibility with the Root trunk
[u/mrichter/AliRoot.git] / TPC / AliTPCCalibRawBase.h
CommitLineData
880c3382 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 */
5
6/////////////////////////////////////////////////////////////////////////////////////////
7// //
8// Raw data processing base class //
9// //
10/////////////////////////////////////////////////////////////////////////////////////////
11
12#include <TNamed.h>
13
14class AliAltroMapping;
15class AliAltroRawStream;
16class AliRawReader;
17class AliTPCAltroMapping;
c3066940 18class AliTPCRawStreamV3;
880c3382 19class AliTPCRawStream;
20class AliTPCROC;
21class TTreeSRedirector;
7442bceb 22class TCollection;
880c3382 23struct eventHeaderStruct;
24
25class AliTPCCalibRawBase : public TNamed {
26
27
28public:
29 AliTPCCalibRawBase();
30 AliTPCCalibRawBase(const AliTPCCalibRawBase &calib);
31
32 AliTPCCalibRawBase& operator = (const AliTPCCalibRawBase &source);
33
34 virtual ~AliTPCCalibRawBase();
35
c3066940 36 //uses the new decoder which is compatible with the new altro format
7442bceb 37 Bool_t ProcessEvent(AliTPCRawStreamV3 * const rawStreamV3);
38 Bool_t ProcessEvent(AliRawReader * const rawReader);
39 Bool_t ProcessEvent(eventHeaderStruct * const event);
c3066940 40
41 //For using the old decoder use the following functions
7442bceb 42 Bool_t ProcessEvent(AliTPCRawStream * const rawStream);
43 Bool_t ProcessEventOld(AliRawReader * const rawReader);
880c3382 44
45 virtual Int_t Update(const Int_t /*isector*/, const Int_t /*iRow*/, const Int_t /*iPad*/,
46 const Int_t /*iTimeBin*/, const Float_t /*signal*/) { return 0; }
5312f439 47 virtual void UpdateDDL() {return;}
96bf9029 48 virtual void ProcessBunch(const Int_t /*sector*/, const Int_t /*row*/, const Int_t /*pad*/,
49 const Int_t /*length*/, const UInt_t /*startTimeBin*/, const UShort_t* /*signal*/) {return; }
880c3382 50 virtual void Analyse(){ return; }
51
7442bceb 52 virtual Long64_t Merge(TCollection * /*list*/) {return 0;}
78f17711 53 void MergeBase(const AliTPCCalibRawBase *calib);
7442bceb 54
55 //Setters
880c3382 56 void SetRangeTime (Int_t firstTimeBin, Int_t lastTimeBin) { fFirstTimeBin=firstTimeBin; fLastTimeBin=lastTimeBin; } //Set range in which the signal is expected
57 void SetAltroMapping(AliTPCAltroMapping **mapp) { fMapping = mapp; }
58 //
59 void SetUseL1Phase(Bool_t useL1Phase=kTRUE) {fUseL1Phase=useL1Phase;}
60 //
c3066940 61 void SetTimeStampEvent(UInt_t timestamp){ fTimeStamp = timestamp; }
62 void SetRunNumber(UInt_t eventnumber){ fRunNumber = eventnumber; }
63
64 //
880c3382 65 Int_t GetFirstTimeBin() const { return fFirstTimeBin; }
66 Int_t GetLastTimeBin() const { return fLastTimeBin; }
67 Int_t GetNevents() const { return fNevents; }
68 //
69 Double_t GetL1Phase() const {return fAltroL1Phase;}
70 Double_t GetL1PhaseTB() const {return fAltroL1PhaseTB;}
71 Bool_t GetUseL1Phase()const {return fUseL1Phase;}
72//
78f17711 73 UInt_t GetRunNumber() const {return fRunNumber;}
74 UInt_t GetFirstTimeStamp() const {return fFirstTimeStamp;}
75 UInt_t GetLastTimeStamp() const {return fLastTimeStamp;}
76 UInt_t GetTimeStamp() const {return fTimeStamp;}
77 UInt_t GetEventType() const {return fEventType;}
880c3382 78 //
79 AliTPCAltroMapping **GetAltroMapping() { return fMapping; }
7442bceb 80 const AliAltroRawStream *GetAltroRawStream() const {return fAltroRawStream;}
81 const AliTPCROC *GetTPCROC() const {return fROC;}
880c3382 82 //
83 void IncrementNevents(){++fNevents;}
84 //
78f17711 85 virtual void DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE);
880c3382 86 // debug and debug streamer support
87 TTreeSRedirector *GetDebugStreamer();
88 void SetStreamLevel(Int_t streamLevel){fStreamLevel=streamLevel;}
89 void SetDebugLevel(Int_t level) {fDebugLevel = level;}
90 Int_t GetStreamLevel() const {return fStreamLevel;}
91 Int_t GetDebugLevel() const {return fDebugLevel;}
7442bceb 92
880c3382 93protected:
94 Int_t fFirstTimeBin; // First Time bin used for analysis
95 Int_t fLastTimeBin; // Last Time bin used for analysis
96
97 Int_t fNevents; // Number of processed events
98
99 Int_t fDebugLevel; //! debug level
100 Int_t fStreamLevel; //! level of streamer output
101 //
c3066940 102 UInt_t fRunNumber; // current run number from event header
78f17711 103 UInt_t fFirstTimeStamp; // First event time stamp
104 UInt_t fLastTimeStamp; // Last event time stamp
880c3382 105 UInt_t fTimeStamp; //! time stamp from event header
880c3382 106 UInt_t fEventType; //! current event Type from event header
107 //
108 Double_t fAltroL1Phase; //! L1 Phase
109 Float_t fAltroL1PhaseTB; //! L1 Phase in time bins
c3066940 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
880c3382 114 Bool_t fUseL1Phase; // use L1 Phase information?
115 //
116 TTreeSRedirector *fDebugStreamer; //! debug streamer
117 //
118 AliAltroRawStream *fAltroRawStream; //! pointer to the altro object
119 AliTPCAltroMapping **fMapping; //! Altro Mapping object
120
121 AliTPCROC *fROC; //! ROC information
122
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
125
126
78f17711 127 ClassDef(AliTPCCalibRawBase,3) // Calibration base class for raw data processing
880c3382 128
129};
130
78f17711 131
880c3382 132#endif
133