]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/TPCbase/AliTPCCalibRaw.h
doxy: TPC/TPCbase converted
[u/mrichter/AliRoot.git] / TPC / TPCbase / AliTPCCalibRaw.h
CommitLineData
7442bceb 1#ifndef ALITPCCALIBRAW_H
2#define ALITPCCALIBRAW_H
ddeb9c4f 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
7d855b04 6/// \class AliTPCCalibRaw
7/// \brief TPC ALTRO Header analysis
ddeb9c4f 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
17class TH2C;
be3dbaa0 18class TH1F;
f113dfeb 19class TMap;
1d32f273 20class TGraph;
21class TCanvas;
ddeb9c4f 22
23class AliTPCCalibRaw : public AliTPCCalibRawBase {
24public:
25 AliTPCCalibRaw();
f113dfeb 26 AliTPCCalibRaw(const TMap *config);
ddeb9c4f 27
28 virtual ~AliTPCCalibRaw();
29
be3dbaa0 30 enum {kNRCU=216};
ddeb9c4f 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);
5312f439 34 virtual void UpdateDDL();
ddeb9c4f 35 virtual void EndEvent();
36 virtual void ResetEvent();
37 virtual void Analyse();
38
39 UInt_t GetNFailL1Phase() const {return fNFailL1Phase;}
be3dbaa0 40 UInt_t GetNFailL1PhaseEvents() const {return fNFailL1PhaseEvent;}
ddeb9c4f 41 Int_t GetPeakDetectionMinus() const {return fPeakDetMinus;}
42 Int_t GetPeakDetectionPlus() const {return fPeakDetPlus;}
43
44 const TVectorF* GetALTROL1PhaseEvents() const {return &fArrALTROL1Phase;}
45
46 const TVectorF *GetALTROL1PhaseEventsRCU(Int_t rcu) const {return (TVectorF*)fArrALTROL1PhaseEvent.At(rcu);}
47 const TVectorF *GetALTROL1PhaseFailEventsRCU(Int_t rcu) const {return (TVectorF*)fArrALTROL1PhaseFailEvent.At(rcu);}
48
1d32f273 49 const TVectorF *GetOccupancyEvent() const {return &fVOccupancyEvent;}
50 const TVectorF *GetOccupancyEventSensitive() const {return &fVOccupancySenEvent;}
51 const TVectorF *GetSignalSumEvent() const {return &fVSignalSumEvent;}
52 const TVectorF *GetSignalSumEventSensitive() const {return &fVSignalSumSenEvent;}
53 const TVectorF *GetFiredPadsSensitive() const {return &fVNfiredPadsSenEvent;}
54 const TVectorF *GetEventTimeStamps() const {return &fVTimeStampEvent;}
55 UInt_t GetFirstTimeStamp() const {return fFirstTimeStamp;}
ddeb9c4f 56
1d32f273 57 void SetRangePeakDetection(Int_t minus, Int_t plus) { fPeakDetMinus=minus; fPeakDetPlus=plus;}
58 //Phase info
ddeb9c4f 59 TH2C *MakeHistL1RCUEvents(Int_t type=0);
60 TH2C *MakeHistL1RCUEventsIROC(Int_t type=0);
61 TH2C *MakeHistL1RCUEventsOROC(Int_t type=0);
be3dbaa0 62 TH1F *MakeHistL1PhaseDist();
63 TVectorF *MakeVectL1PhaseDist();
1d32f273 64 //Occupancy info
65 TGraph* MakeGraphOccupancy(const Int_t type=0, const Int_t xType=0);
7442bceb 66// TGraph* MakeGraphNoiseEvents();
1d32f273 67 TCanvas* MakeCanvasOccupancy(const Int_t xType=1, Bool_t sen=kFALSE);
ddeb9c4f 68
69 const THnSparseI *GetHnDrift() const {return fHnDrift;}
70// AliTPCCalPad *CreateCalPadL1Mean();
71// AliTPCCalPad *CreateCalPadL1RMS();
72
7442bceb 73 void Merge(AliTPCCalibRaw * const sig);
74 virtual Long64_t Merge(TCollection * const list);
75
ddeb9c4f 76private:
7d855b04 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
ddeb9c4f 81 //binning dv hist
7d855b04 82 UInt_t fNSecTime; ///< Number of seconds per bin in time
83 UInt_t fNBinsTime; ///< Number of bin in time
ddeb9c4f 84 //processing information
7d855b04 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
ddeb9c4f 97//
98 //L1 phase stuff
7d855b04 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
ddeb9c4f 105 //drift velocity stuff
106 enum {kHnBinsDV=3};
7d855b04 107 THnSparseI *fHnDrift; ///< Histogram last time bin vs. ROC, Time
1d32f273 108 //occupancy
7d855b04 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
ddeb9c4f 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
7442bceb 122 AliTPCCalibRaw(const AliTPCCalibRaw &calib);
ddeb9c4f 123 AliTPCCalibRaw& operator = (const AliTPCCalibRaw &source);
124
7d855b04 125 /// \cond CLASSIMP
78f17711 126 ClassDef(AliTPCCalibRaw,4) // Analysis of the Altro header information
7d855b04 127 /// \endcond
ddeb9c4f 128};
129
130//----------------------
131// Inline Functions
132//----------------------
133inline TVectorF *AliTPCCalibRaw::MakeArrL1PhaseRCU(Int_t rcu, Bool_t force)
134{
135 TVectorF *arr=(TVectorF*)fArrALTROL1PhaseEvent.UncheckedAt(rcu);
136 if (!arr && force) {
be3dbaa0 137 arr=new TVectorF(100);
ddeb9c4f 138 fArrALTROL1PhaseEvent.AddAt(arr,rcu);
139 }
140 return arr;
141}
142//
143inline TVectorF *AliTPCCalibRaw::MakeArrL1PhaseFailRCU(Int_t rcu, Bool_t force)
144{
145 TVectorF *arr=(TVectorF*)fArrALTROL1PhaseFailEvent.UncheckedAt(rcu);
146 if (!arr && force) {
1d32f273 147 arr=new TVectorF(100);
ddeb9c4f 148 fArrALTROL1PhaseFailEvent.AddAt(arr,rcu);
149 }
150 return arr;
151}
152//_____________________________________________________________________
153inline Bool_t AliTPCCalibRaw::IsEdgePad(Int_t sector, Int_t row, Int_t pad) const
154{
7d855b04 155 /// return true if pad is on the edge of a row
156
ddeb9c4f 157 Int_t edge1 = 0;
158 if ( pad == edge1 ) return kTRUE;
159 Int_t edge2 = fROC->GetNPads(sector,row)-1;
160 if ( pad == edge2 ) return kTRUE;
161
162 return kFALSE;
163}
164
165
166#endif