1 #ifndef ALITPCCALIBRAW_H
2 #define ALITPCCALIBRAW_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"
26 class AliTPCCalibRaw : public AliTPCCalibRawBase {
29 AliTPCCalibRaw(const TMap *config);
31 virtual ~AliTPCCalibRaw();
35 virtual Int_t Update(const Int_t isector, const Int_t iRow, const Int_t iPad,
36 const Int_t iTimeBin, const Float_t signal);
37 virtual void UpdateDDL();
38 virtual void EndEvent();
39 virtual void ResetEvent();
40 virtual void Analyse();
42 UInt_t GetNFailL1Phase() const {return fNFailL1Phase;}
43 UInt_t GetNFailL1PhaseEvents() const {return fNFailL1PhaseEvent;}
44 Int_t GetPeakDetectionMinus() const {return fPeakDetMinus;}
45 Int_t GetPeakDetectionPlus() const {return fPeakDetPlus;}
47 const TVectorF* GetALTROL1PhaseEvents() const {return &fArrALTROL1Phase;}
49 const TVectorF *GetALTROL1PhaseEventsRCU(Int_t rcu) const {return (TVectorF*)fArrALTROL1PhaseEvent.At(rcu);}
50 const TVectorF *GetALTROL1PhaseFailEventsRCU(Int_t rcu) const {return (TVectorF*)fArrALTROL1PhaseFailEvent.At(rcu);}
52 const TVectorF *GetOccupancyEvent() const {return &fVOccupancyEvent;}
53 const TVectorF *GetOccupancyEventSensitive() const {return &fVOccupancySenEvent;}
54 const TVectorF *GetSignalSumEvent() const {return &fVSignalSumEvent;}
55 const TVectorF *GetSignalSumEventSensitive() const {return &fVSignalSumSenEvent;}
56 const TVectorF *GetFiredPadsSensitive() const {return &fVNfiredPadsSenEvent;}
57 const TVectorF *GetEventTimeStamps() const {return &fVTimeStampEvent;}
58 UInt_t GetFirstTimeStamp() const {return fFirstTimeStamp;}
60 void SetRangePeakDetection(Int_t minus, Int_t plus) { fPeakDetMinus=minus; fPeakDetPlus=plus;}
62 TH2C *MakeHistL1RCUEvents(Int_t type=0);
63 TH2C *MakeHistL1RCUEventsIROC(Int_t type=0);
64 TH2C *MakeHistL1RCUEventsOROC(Int_t type=0);
65 TH1F *MakeHistL1PhaseDist();
66 TVectorF *MakeVectL1PhaseDist();
68 TGraph* MakeGraphOccupancy(const Int_t type=0, const Int_t xType=0);
69 // TGraph* MakeGraphNoiseEvents();
70 TCanvas* MakeCanvasOccupancy(const Int_t xType=1, Bool_t sen=kFALSE);
72 const THnSparseI *GetHnDrift() const {return fHnDrift;}
73 // AliTPCCalPad *CreateCalPadL1Mean();
74 // AliTPCCalPad *CreateCalPadL1RMS();
76 void Merge(AliTPCCalibRaw * const sig);
77 virtual Long64_t Merge(TCollection * const list);
80 Int_t fPeakDetMinus; // Consecutive timebins on rising edge to be regarded as a signal
81 Int_t fPeakDetPlus; // Consecutive timebins on falling edge to be regarded as a signal
82 UInt_t fNFailL1Phase; //Number of failures in L1 phase
83 UInt_t fNFailL1PhaseEvent; //Number of events with L1 phase failures
85 UInt_t fNSecTime; //Number of seconds per bin in time
86 UInt_t fNBinsTime; //Number of bin in time
87 //processing information
88 Bool_t fPadProcessed; //! if last pead has already been filled for the current pad
89 Int_t fCurrentChannel; //! current channel processed
90 Int_t fCurrentSector; //! current sector processed
91 Int_t fLastSector; //! current sector processed
92 Int_t fCurrentRow; //! current row processed
93 Int_t fCurrentPad; //! current pad processed
94 Int_t fLastTimeBinProc; //! last time bin processed
95 Int_t fPeakTimeBin; //! time bin with local maximum
96 Int_t fLastSignal; //! last signal processed
97 Int_t fNOkPlus; //! number of processed time bins fullfilling peak criteria
98 Int_t fNOkMinus; //! number of processed time bins fullfilling peak criteria
99 Int_t fNanoSec; //! current nano seconds stamp
102 TVectorF fArrCurrentPhaseDist; //!Phase distribution of the current event
103 TVectorF fArrCurrentPhase; //!Current phase of all RCUs
104 TVectorF fArrFailEventNumber; //event numbers of failed events;
105 TVectorF fArrALTROL1Phase; //Array of L1 phases on an event bases;
106 TObjArray fArrALTROL1PhaseEvent; //L1 phase for each RCU and event
107 TObjArray fArrALTROL1PhaseFailEvent; //L1 failure for each RCU and event
108 //drift velocity stuff
110 THnSparseI *fHnDrift; //Histogram last time bin vs. ROC, Time
112 TVectorF fVOccupancyEvent; //occupancy per event (number of samples above threshold)
113 TVectorF fVSignalSumEvent; //occupancy per event (sum of all adc values)
114 TVectorF fVOccupancySenEvent; //occupancy per event (number of samples abouve threshold) in sensitive regions
115 TVectorF fVSignalSumSenEvent; //occupancy per event (sum of all adc values) in sensitive regions
116 TVectorF fVNfiredPadsSenEvent; //number of pads with a signal above threshold in sensitive regions
117 TVectorF fVTimeStampEvent; //timestamp for all events
119 TVectorF *MakeArrL1PhaseRCU(Int_t rcu, Bool_t force=kFALSE);
120 TVectorF *MakeArrL1PhaseFailRCU(Int_t rcu, Bool_t force=kFALSE);
122 Bool_t IsEdgePad(Int_t sector, Int_t row, Int_t pad) const;
125 AliTPCCalibRaw(const AliTPCCalibRaw &calib);
126 AliTPCCalibRaw& operator = (const AliTPCCalibRaw &source);
128 ClassDef(AliTPCCalibRaw,4) // Analysis of the Altro header information
131 //----------------------
133 //----------------------
134 inline TVectorF *AliTPCCalibRaw::MakeArrL1PhaseRCU(Int_t rcu, Bool_t force)
136 TVectorF *arr=(TVectorF*)fArrALTROL1PhaseEvent.UncheckedAt(rcu);
138 arr=new TVectorF(100);
139 fArrALTROL1PhaseEvent.AddAt(arr,rcu);
144 inline TVectorF *AliTPCCalibRaw::MakeArrL1PhaseFailRCU(Int_t rcu, Bool_t force)
146 TVectorF *arr=(TVectorF*)fArrALTROL1PhaseFailEvent.UncheckedAt(rcu);
148 arr=new TVectorF(100);
149 fArrALTROL1PhaseFailEvent.AddAt(arr,rcu);
153 //_____________________________________________________________________
154 inline Bool_t AliTPCCalibRaw::IsEdgePad(Int_t sector, Int_t row, Int_t pad) const
157 // return true if pad is on the edge of a row
160 if ( pad == edge1 ) return kTRUE;
161 Int_t edge2 = fROC->GetNPads(sector,row)-1;
162 if ( pad == edge2 ) return kTRUE;