]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCCalibRawBase.h
Script supersceeded by AliForwarddNdetaTask.C and
[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;
18class AliTPCRawStreamFast;
c3066940 19class AliTPCRawStreamV3;
880c3382 20class AliTPCRawStream;
21class AliTPCROC;
22class TTreeSRedirector;
7442bceb 23class TCollection;
880c3382 24struct eventHeaderStruct;
25
26class AliTPCCalibRawBase : public TNamed {
27
28
29public:
30 AliTPCCalibRawBase();
31 AliTPCCalibRawBase(const AliTPCCalibRawBase &calib);
32
33 AliTPCCalibRawBase& operator = (const AliTPCCalibRawBase &source);
34
35 virtual ~AliTPCCalibRawBase();
36
37
7442bceb 38 Bool_t ProcessEventFast(AliTPCRawStreamFast * const rawStreamFast);
39 Bool_t ProcessEventFast(AliRawReader * const rawReader);
c3066940 40
41 //uses the new decoder which is compatible with the new altro format
7442bceb 42 Bool_t ProcessEvent(AliTPCRawStreamV3 * const rawStreamV3);
43 Bool_t ProcessEvent(AliRawReader * const rawReader);
44 Bool_t ProcessEvent(eventHeaderStruct * const event);
c3066940 45
46 //For using the old decoder use the following functions
7442bceb 47 Bool_t ProcessEvent(AliTPCRawStream * const rawStream);
48 Bool_t ProcessEventOld(AliRawReader * const rawReader);
880c3382 49
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; }
5312f439 52 virtual void UpdateDDL() {return;}
96bf9029 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; }
880c3382 55 virtual void Analyse(){ return; }
56
7442bceb 57 virtual Long64_t Merge(TCollection * /*list*/) {return 0;}
78f17711 58 void MergeBase(const AliTPCCalibRawBase *calib);
7442bceb 59
60 //Setters
880c3382 61 void SetRangeTime (Int_t firstTimeBin, Int_t lastTimeBin) { fFirstTimeBin=firstTimeBin; fLastTimeBin=lastTimeBin; } //Set range in which the signal is expected
62 void SetAltroMapping(AliTPCAltroMapping **mapp) { fMapping = mapp; }
63 //
64 void SetUseL1Phase(Bool_t useL1Phase=kTRUE) {fUseL1Phase=useL1Phase;}
c3066940 65 //
66 void SetTimeStampEvent(UInt_t timestamp){ fTimeStamp = timestamp; }
67 void SetRunNumber(UInt_t eventnumber){ fRunNumber = eventnumber; }
68
880c3382 69 //
70 Int_t GetFirstTimeBin() const { return fFirstTimeBin; }
71 Int_t GetLastTimeBin() const { return fLastTimeBin; }
72 Int_t GetNevents() const { return fNevents; }
73 //
74 Double_t GetL1Phase() const {return fAltroL1Phase;}
75 Double_t GetL1PhaseTB() const {return fAltroL1PhaseTB;}
76 Bool_t GetUseL1Phase()const {return fUseL1Phase;}
77//
78f17711 78 UInt_t GetRunNumber() const {return fRunNumber;}
79 UInt_t GetFirstTimeStamp() const {return fFirstTimeStamp;}
80 UInt_t GetLastTimeStamp() const {return fLastTimeStamp;}
81 UInt_t GetTimeStamp() const {return fTimeStamp;}
82 UInt_t GetEventType() const {return fEventType;}
880c3382 83 //
84 AliTPCAltroMapping **GetAltroMapping() { return fMapping; }
7442bceb 85 const AliAltroRawStream *GetAltroRawStream() const {return fAltroRawStream;}
86 const AliTPCROC *GetTPCROC() const {return fROC;}
880c3382 87 //
88 void IncrementNevents(){++fNevents;}
89 //
78f17711 90 virtual void DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE);
880c3382 91 // debug and debug streamer support
92 TTreeSRedirector *GetDebugStreamer();
93 void SetStreamLevel(Int_t streamLevel){fStreamLevel=streamLevel;}
94 void SetDebugLevel(Int_t level) {fDebugLevel = level;}
95 Int_t GetStreamLevel() const {return fStreamLevel;}
96 Int_t GetDebugLevel() const {return fDebugLevel;}
7442bceb 97
880c3382 98protected:
99 Int_t fFirstTimeBin; // First Time bin used for analysis
100 Int_t fLastTimeBin; // Last Time bin used for analysis
101
102 Int_t fNevents; // Number of processed events
103
104 Int_t fDebugLevel; //! debug level
105 Int_t fStreamLevel; //! level of streamer output
106 //
c3066940 107 UInt_t fRunNumber; // current run number from event header
78f17711 108 UInt_t fFirstTimeStamp; // First event time stamp
109 UInt_t fLastTimeStamp; // Last event time stamp
880c3382 110 UInt_t fTimeStamp; //! time stamp from event header
880c3382 111 UInt_t fEventType; //! current event Type from event header
112 //
113 Double_t fAltroL1Phase; //! L1 Phase
114 Float_t fAltroL1PhaseTB; //! L1 Phase in time bins
c3066940 115 Int_t fCurrRCUId; //! Current RCU Id
116 Int_t fPrevRCUId; //! Previous RCU Id
117 Int_t fCurrDDLNum; //! Current DDL number
118 Int_t fPrevDDLNum; //! Current DDL number
880c3382 119 Bool_t fUseL1Phase; // use L1 Phase information?
120 //
121 TTreeSRedirector *fDebugStreamer; //! debug streamer
122 //
123 AliAltroRawStream *fAltroRawStream; //! pointer to the altro object
124 AliTPCAltroMapping **fMapping; //! Altro Mapping object
125
126 AliTPCROC *fROC; //! ROC information
127
128 virtual void EndEvent() {++fNevents; return; } //fNevents should be updated in the derived classes in a proper place
129 virtual void ResetEvent(){ return; } //Reset Event counters
130
131
78f17711 132 ClassDef(AliTPCCalibRawBase,3) // Calibration base class for raw data processing
880c3382 133
134};
135
78f17711 136
880c3382 137#endif
138