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 UpdateDDL();
32 virtual void EndEvent();
33 virtual void ResetEvent();
34 virtual void Analyse();
36 UInt_t GetNFailL1Phase() const {return fNFailL1Phase;}
37 Int_t GetPeakDetectionMinus() const {return fPeakDetMinus;}
38 Int_t GetPeakDetectionPlus() const {return fPeakDetPlus;}
40 const TVectorF* GetALTROL1PhaseEvents() const {return &fArrALTROL1Phase;}
42 const TVectorF *GetALTROL1PhaseEventsRCU(Int_t rcu) const {return (TVectorF*)fArrALTROL1PhaseEvent.At(rcu);}
43 const TVectorF *GetALTROL1PhaseFailEventsRCU(Int_t rcu) const {return (TVectorF*)fArrALTROL1PhaseFailEvent.At(rcu);}
45 void SetRangePeakDetection(Int_t minus, Int_t plus) { fPeakDetMinus=minus; fPeakDetPlus=plus;}
47 TH2C *MakeHistL1RCUEvents(Int_t type=0);
48 TH2C *MakeHistL1RCUEventsIROC(Int_t type=0);
49 TH2C *MakeHistL1RCUEventsOROC(Int_t type=0);
51 const THnSparseI *GetHnDrift() const {return fHnDrift;}
52 // AliTPCCalPad *CreateCalPadL1Mean();
53 // AliTPCCalPad *CreateCalPadL1RMS();
56 Int_t fPeakDetMinus; // Consecutive timebins on rising edge to be regarded as a signal
57 Int_t fPeakDetPlus; // Consecutive timebins on falling edge to be regarded as a signal
58 UInt_t fNFailL1Phase; //Number of failures in L1 phase
59 UInt_t fFirstTimeStamp; //Time Stamp from first event
61 UInt_t fNSecTime; //Number of seconds per bin in time
62 UInt_t fNBinsTime; //Number of bin in time
63 //processing information
64 Bool_t fPadProcessed; //! if last pead has already been filled for the current pad
65 Int_t fCurrentChannel; //! current channel processed
66 Int_t fCurrentSector; //! current sector processed
67 Int_t fLastSector; //! current sector processed
68 Int_t fCurrentRow; //! current row processed
69 Int_t fCurrentPad; //! current pad processed
70 Int_t fLastTimeBinProc; //! last time bin processed
71 Int_t fPeakTimeBin; //! time bin with local maximum
72 Int_t fLastSignal; //! last signal processed
73 Int_t fNOkPlus; //! number of processed time bins fullfilling peak criteria
74 Int_t fNOkMinus; //! number of processed time bins fullfilling peak criteria
77 TVectorF fArrCurrentPhaseDist; //!Phase distribution of the current event
78 TVectorF fArrALTROL1Phase; //Array of L1 phases on an event bases;
79 TObjArray fArrALTROL1PhaseEvent; //L1 phase for each RCU and event
80 TObjArray fArrALTROL1PhaseFailEvent; //L1 failure for each RCU and event
81 //drift velocity stuff
83 THnSparseI *fHnDrift; //Histogram last time bin vs. ROC, Time
85 TVectorF *MakeArrL1PhaseRCU(Int_t rcu, Bool_t force=kFALSE);
86 TVectorF *MakeArrL1PhaseFailRCU(Int_t rcu, Bool_t force=kFALSE);
88 Bool_t IsEdgePad(Int_t sector, Int_t row, Int_t pad) const;
91 AliTPCCalibRaw(AliTPCCalibRaw &calib);
92 AliTPCCalibRaw& operator = (const AliTPCCalibRaw &source);
94 ClassDef(AliTPCCalibRaw,1) // Analysis of the Altro header information
97 //----------------------
99 //----------------------
100 inline TVectorF *AliTPCCalibRaw::MakeArrL1PhaseRCU(Int_t rcu, Bool_t force)
102 TVectorF *arr=(TVectorF*)fArrALTROL1PhaseEvent.UncheckedAt(rcu);
104 arr=new TVectorF(1000);
105 fArrALTROL1PhaseEvent.AddAt(arr,rcu);
110 inline TVectorF *AliTPCCalibRaw::MakeArrL1PhaseFailRCU(Int_t rcu, Bool_t force)
112 TVectorF *arr=(TVectorF*)fArrALTROL1PhaseFailEvent.UncheckedAt(rcu);
114 arr=new TVectorF(1000);
115 fArrALTROL1PhaseFailEvent.AddAt(arr,rcu);
119 //_____________________________________________________________________
120 inline Bool_t AliTPCCalibRaw::IsEdgePad(Int_t sector, Int_t row, Int_t pad) const
123 // return true if pad is on the edge of a row
126 if ( pad == edge1 ) return kTRUE;
127 Int_t edge2 = fROC->GetNPads(sector,row)-1;
128 if ( pad == edge2 ) return kTRUE;