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