Line data Source code
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 */
5 :
6 : /// \class AliTPCCalibRaw
7 : /// \brief TPC ALTRO Header analysis
8 :
9 : #include <TVectorF.h>
10 : #include <TObjArray.h>
11 : #include <THnSparse.h>
12 :
13 : #include "AliTPCCalibRawBase.h"
14 : #include "AliTPCCalPad.h"
15 : #include "AliTPCROC.h"
16 :
17 : class TH2C;
18 : class TH1F;
19 : class TMap;
20 : class TGraph;
21 : class TCanvas;
22 :
23 : class AliTPCCalibRaw : public AliTPCCalibRawBase {
24 : public:
25 : AliTPCCalibRaw();
26 : AliTPCCalibRaw(const TMap *config);
27 :
28 : virtual ~AliTPCCalibRaw();
29 :
30 : enum {kNRCU=216};
31 :
32 : virtual Int_t Update(const Int_t isector, const Int_t iRow, const Int_t iPad,
33 : const Int_t iTimeBin, const Float_t signal);
34 : virtual void UpdateDDL();
35 : virtual void EndEvent();
36 : virtual void ResetEvent();
37 : virtual void Analyse();
38 :
39 0 : UInt_t GetNFailL1Phase() const {return fNFailL1Phase;}
40 0 : UInt_t GetNFailL1PhaseEvents() const {return fNFailL1PhaseEvent;}
41 0 : Int_t GetPeakDetectionMinus() const {return fPeakDetMinus;}
42 0 : Int_t GetPeakDetectionPlus() const {return fPeakDetPlus;}
43 :
44 0 : const TVectorF* GetALTROL1PhaseEvents() const {return &fArrALTROL1Phase;}
45 :
46 0 : const TVectorF *GetALTROL1PhaseEventsRCU(Int_t rcu) const {return (TVectorF*)fArrALTROL1PhaseEvent.At(rcu);}
47 0 : const TVectorF *GetALTROL1PhaseFailEventsRCU(Int_t rcu) const {return (TVectorF*)fArrALTROL1PhaseFailEvent.At(rcu);}
48 :
49 0 : const TVectorF *GetOccupancyEvent() const {return &fVOccupancyEvent;}
50 0 : const TVectorF *GetOccupancyEventSensitive() const {return &fVOccupancySenEvent;}
51 0 : const TVectorF *GetSignalSumEvent() const {return &fVSignalSumEvent;}
52 0 : const TVectorF *GetSignalSumEventSensitive() const {return &fVSignalSumSenEvent;}
53 0 : const TVectorF *GetFiredPadsSensitive() const {return &fVNfiredPadsSenEvent;}
54 0 : const TVectorF *GetEventTimeStamps() const {return &fVTimeStampEvent;}
55 0 : UInt_t GetFirstTimeStamp() const {return fFirstTimeStamp;}
56 :
57 0 : void SetRangePeakDetection(Int_t minus, Int_t plus) { fPeakDetMinus=minus; fPeakDetPlus=plus;}
58 : //Phase info
59 : TH2C *MakeHistL1RCUEvents(Int_t type=0);
60 : TH2C *MakeHistL1RCUEventsIROC(Int_t type=0);
61 : TH2C *MakeHistL1RCUEventsOROC(Int_t type=0);
62 : TH1F *MakeHistL1PhaseDist();
63 : TVectorF *MakeVectL1PhaseDist();
64 : //Occupancy info
65 : TGraph* MakeGraphOccupancy(const Int_t type=0, const Int_t xType=0);
66 : // TGraph* MakeGraphNoiseEvents();
67 : TCanvas* MakeCanvasOccupancy(const Int_t xType=1, Bool_t sen=kFALSE);
68 :
69 0 : const THnSparseI *GetHnDrift() const {return fHnDrift;}
70 : // AliTPCCalPad *CreateCalPadL1Mean();
71 : // AliTPCCalPad *CreateCalPadL1RMS();
72 :
73 : void Merge(AliTPCCalibRaw * const sig);
74 : virtual Long64_t Merge(TCollection * const list);
75 :
76 : private:
77 : Int_t fPeakDetMinus; ///< Consecutive timebins on rising edge to be regarded as a signal
78 : Int_t fPeakDetPlus; ///< Consecutive timebins on falling edge to be regarded as a signal
79 : UInt_t fNFailL1Phase; ///< Number of failures in L1 phase
80 : UInt_t fNFailL1PhaseEvent; ///< Number of events with L1 phase failures
81 : //binning dv hist
82 : UInt_t fNSecTime; ///< Number of seconds per bin in time
83 : UInt_t fNBinsTime; ///< Number of bin in time
84 : //processing information
85 : Bool_t fPadProcessed; //!<! if last pead has already been filled for the current pad
86 : Int_t fCurrentChannel; //!<! current channel processed
87 : Int_t fCurrentSector; //!<! current sector processed
88 : Int_t fLastSector; //!<! current sector processed
89 : Int_t fCurrentRow; //!<! current row processed
90 : Int_t fCurrentPad; //!<! current pad processed
91 : Int_t fLastTimeBinProc; //!<! last time bin processed
92 : Int_t fPeakTimeBin; //!<! time bin with local maximum
93 : Int_t fLastSignal; //!<! last signal processed
94 : Int_t fNOkPlus; //!<! number of processed time bins fullfilling peak criteria
95 : Int_t fNOkMinus; //!<! number of processed time bins fullfilling peak criteria
96 : Int_t fNanoSec; //!<! current nano seconds stamp
97 : //
98 : //L1 phase stuff
99 : TVectorF fArrCurrentPhaseDist; //!<! Phase distribution of the current event
100 : TVectorF fArrCurrentPhase; //!<! Current phase of all RCUs
101 : TVectorF fArrFailEventNumber; ///< event numbers of failed events;
102 : TVectorF fArrALTROL1Phase; ///< Array of L1 phases on an event bases;
103 : TObjArray fArrALTROL1PhaseEvent; ///< L1 phase for each RCU and event
104 : TObjArray fArrALTROL1PhaseFailEvent; ///< L1 failure for each RCU and event
105 : //drift velocity stuff
106 : enum {kHnBinsDV=3};
107 : THnSparseI *fHnDrift; ///< Histogram last time bin vs. ROC, Time
108 : //occupancy
109 : TVectorF fVOccupancyEvent; ///< occupancy per event (number of samples above threshold)
110 : TVectorF fVSignalSumEvent; ///< occupancy per event (sum of all adc values)
111 : TVectorF fVOccupancySenEvent; ///< occupancy per event (number of samples abouve threshold) in sensitive regions
112 : TVectorF fVSignalSumSenEvent; ///< occupancy per event (sum of all adc values) in sensitive regions
113 : TVectorF fVNfiredPadsSenEvent; ///< number of pads with a signal above threshold in sensitive regions
114 : TVectorF fVTimeStampEvent; ///< timestamp for all events
115 :
116 : TVectorF *MakeArrL1PhaseRCU(Int_t rcu, Bool_t force=kFALSE);
117 : TVectorF *MakeArrL1PhaseFailRCU(Int_t rcu, Bool_t force=kFALSE);
118 :
119 : Bool_t IsEdgePad(Int_t sector, Int_t row, Int_t pad) const;
120 : void CreateDVhist();
121 :
122 : AliTPCCalibRaw(const AliTPCCalibRaw &calib);
123 : AliTPCCalibRaw& operator = (const AliTPCCalibRaw &source);
124 :
125 : /// \cond CLASSIMP
126 44 : ClassDef(AliTPCCalibRaw,4) // Analysis of the Altro header information
127 : /// \endcond
128 : };
129 :
130 : //----------------------
131 : // Inline Functions
132 : //----------------------
133 : inline TVectorF *AliTPCCalibRaw::MakeArrL1PhaseRCU(Int_t rcu, Bool_t force)
134 : {
135 0 : TVectorF *arr=(TVectorF*)fArrALTROL1PhaseEvent.UncheckedAt(rcu);
136 0 : if (!arr && force) {
137 0 : arr=new TVectorF(100);
138 0 : fArrALTROL1PhaseEvent.AddAt(arr,rcu);
139 0 : }
140 0 : return arr;
141 0 : }
142 : //
143 : inline TVectorF *AliTPCCalibRaw::MakeArrL1PhaseFailRCU(Int_t rcu, Bool_t force)
144 : {
145 : TVectorF *arr=(TVectorF*)fArrALTROL1PhaseFailEvent.UncheckedAt(rcu);
146 : if (!arr && force) {
147 : arr=new TVectorF(100);
148 : fArrALTROL1PhaseFailEvent.AddAt(arr,rcu);
149 : }
150 : return arr;
151 : }
152 : //_____________________________________________________________________
153 : inline Bool_t AliTPCCalibRaw::IsEdgePad(Int_t sector, Int_t row, Int_t pad) const
154 : {
155 : /// return true if pad is on the edge of a row
156 :
157 : Int_t edge1 = 0;
158 0 : if ( pad == edge1 ) return kTRUE;
159 0 : Int_t edge2 = fROC->GetNPads(sector,row)-1;
160 0 : if ( pad == edge2 ) return kTRUE;
161 :
162 0 : return kFALSE;
163 0 : }
164 :
165 :
166 : #endif
|