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