1 #ifndef ALITPCCALIBALTROHEADERS_H
2 #define ALITPCCALIBALTROHEADERS_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
6 ////////////////////////////////////////////////////////////////////////////////////////
8 // TPC ALTRO Header analysis //
10 ////////////////////////////////////////////////////////////////////////////////////////
13 #include <TObjArray.h>
14 #include <THnSparse.h>
16 #include "AliTPCCalibRawBase.h"
17 #include "AliTPCCalPad.h"
18 #include "AliTPCROC.h"
22 class AliTPCCalibRaw : public AliTPCCalibRawBase {
26 virtual ~AliTPCCalibRaw();
29 virtual Int_t Update(const Int_t isector, const Int_t iRow, const Int_t iPad,
30 const Int_t iTimeBin, const Float_t signal);
31 virtual void EndEvent();
32 virtual void ResetEvent();
33 virtual void Analyse();
35 UInt_t GetNFailL1Phase() const {return fNFailL1Phase;}
36 Int_t GetPeakDetectionMinus() const {return fPeakDetMinus;}
37 Int_t GetPeakDetectionPlus() const {return fPeakDetPlus;}
39 const TVectorF* GetALTROL1PhaseEvents() const {return &fArrALTROL1Phase;}
41 const TVectorF *GetALTROL1PhaseEventsRCU(Int_t rcu) const {return (TVectorF*)fArrALTROL1PhaseEvent.At(rcu);}
42 const TVectorF *GetALTROL1PhaseFailEventsRCU(Int_t rcu) const {return (TVectorF*)fArrALTROL1PhaseFailEvent.At(rcu);}
44 void SetRangePeakDetection(Int_t minus, Int_t plus) { fPeakDetMinus=minus; fPeakDetPlus=plus;}
46 TH2C *MakeHistL1RCUEvents(Int_t type=0);
47 TH2C *MakeHistL1RCUEventsIROC(Int_t type=0);
48 TH2C *MakeHistL1RCUEventsOROC(Int_t type=0);
50 const THnSparseI *GetHnDrift() const {return fHnDrift;}
51 // AliTPCCalPad *CreateCalPadL1Mean();
52 // AliTPCCalPad *CreateCalPadL1RMS();
55 Int_t fPeakDetMinus; // Consecutive timebins on rising edge to be regarded as a signal
56 Int_t fPeakDetPlus; // Consecutive timebins on falling edge to be regarded as a signal
57 UInt_t fNFailL1Phase; //Number of failures in L1 phase
58 UInt_t fFirstTimeStamp; //Time Stamp from first event
60 UInt_t fNSecTime; //Number of seconds per bin in time
61 UInt_t fNBinsTime; //Number of bin in time
62 //processing information
63 Bool_t fPadProcessed; //! if last pead has already been filled for the current pad
64 Int_t fCurrentChannel; //! current channel processed
65 Int_t fCurrentSector; //! current sector processed
66 Int_t fLastSector; //! current sector processed
67 Int_t fCurrentRow; //! current row processed
68 Int_t fCurrentPad; //! current pad processed
69 Int_t fLastTimeBinProc; //! last time bin processed
70 Int_t fPeakTimeBin; //! time bin with local maximum
71 Int_t fLastSignal; //! last signal processed
72 Int_t fNOkPlus; //! number of processed time bins fullfilling peak criteria
73 Int_t fNOkMinus; //! number of processed time bins fullfilling peak criteria
76 TVectorF fArrCurrentPhaseDist; //!Phase distribution of the current event
77 TVectorF fArrALTROL1Phase; //Array of L1 phases on an event bases;
78 TObjArray fArrALTROL1PhaseEvent; //L1 phase for each RCU and event
79 TObjArray fArrALTROL1PhaseFailEvent; //L1 failure for each RCU and event
80 //drift velocity stuff
82 THnSparseI *fHnDrift; //Histogram last time bin vs. ROC, Time
84 TVectorF *MakeArrL1PhaseRCU(Int_t rcu, Bool_t force=kFALSE);
85 TVectorF *MakeArrL1PhaseFailRCU(Int_t rcu, Bool_t force=kFALSE);
87 Bool_t IsEdgePad(Int_t sector, Int_t row, Int_t pad) const;
90 AliTPCCalibRaw(AliTPCCalibRaw &calib);
91 AliTPCCalibRaw& operator = (const AliTPCCalibRaw &source);
93 ClassDef(AliTPCCalibRaw,1) // Analysis of the Altro header information
96 //----------------------
98 //----------------------
99 inline TVectorF *AliTPCCalibRaw::MakeArrL1PhaseRCU(Int_t rcu, Bool_t force)
101 TVectorF *arr=(TVectorF*)fArrALTROL1PhaseEvent.UncheckedAt(rcu);
103 arr=new TVectorF(1000);
104 fArrALTROL1PhaseEvent.AddAt(arr,rcu);
109 inline TVectorF *AliTPCCalibRaw::MakeArrL1PhaseFailRCU(Int_t rcu, Bool_t force)
111 TVectorF *arr=(TVectorF*)fArrALTROL1PhaseFailEvent.UncheckedAt(rcu);
113 arr=new TVectorF(1000);
114 fArrALTROL1PhaseFailEvent.AddAt(arr,rcu);
118 //_____________________________________________________________________
119 inline Bool_t AliTPCCalibRaw::IsEdgePad(Int_t sector, Int_t row, Int_t pad) const
122 // return true if pad is on the edge of a row
125 if ( pad == edge1 ) return kTRUE;
126 Int_t edge2 = fROC->GetNPads(sector,row)-1;
127 if ( pad == edge2 ) return kTRUE;