]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCCalibRaw.h
Missing protection - check the presence of array
[u/mrichter/AliRoot.git] / TPC / AliTPCCalibRaw.h
CommitLineData
ddeb9c4f 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 */
5
6////////////////////////////////////////////////////////////////////////////////////////
7// //
8// TPC ALTRO Header analysis //
9// //
10////////////////////////////////////////////////////////////////////////////////////////
11
12#include <TVectorF.h>
13#include <TObjArray.h>
14#include <THnSparse.h>
15
16#include "AliTPCCalibRawBase.h"
17#include "AliTPCCalPad.h"
18#include "AliTPCROC.h"
19
20class TH2C;
be3dbaa0 21class TH1F;
f113dfeb 22class TMap;
ddeb9c4f 23
24class AliTPCCalibRaw : public AliTPCCalibRawBase {
25public:
26 AliTPCCalibRaw();
f113dfeb 27 AliTPCCalibRaw(const TMap *config);
ddeb9c4f 28
29 virtual ~AliTPCCalibRaw();
30
be3dbaa0 31 enum {kNRCU=216};
ddeb9c4f 32
33 virtual Int_t Update(const Int_t isector, const Int_t iRow, const Int_t iPad,
34 const Int_t iTimeBin, const Float_t signal);
5312f439 35 virtual void UpdateDDL();
ddeb9c4f 36 virtual void EndEvent();
37 virtual void ResetEvent();
38 virtual void Analyse();
39
40 UInt_t GetNFailL1Phase() const {return fNFailL1Phase;}
be3dbaa0 41 UInt_t GetNFailL1PhaseEvents() const {return fNFailL1PhaseEvent;}
ddeb9c4f 42 Int_t GetPeakDetectionMinus() const {return fPeakDetMinus;}
43 Int_t GetPeakDetectionPlus() const {return fPeakDetPlus;}
44
45 const TVectorF* GetALTROL1PhaseEvents() const {return &fArrALTROL1Phase;}
46
47 const TVectorF *GetALTROL1PhaseEventsRCU(Int_t rcu) const {return (TVectorF*)fArrALTROL1PhaseEvent.At(rcu);}
48 const TVectorF *GetALTROL1PhaseFailEventsRCU(Int_t rcu) const {return (TVectorF*)fArrALTROL1PhaseFailEvent.At(rcu);}
49
50 void SetRangePeakDetection(Int_t minus, Int_t plus) { fPeakDetMinus=minus; fPeakDetPlus=plus;}
51
52 TH2C *MakeHistL1RCUEvents(Int_t type=0);
53 TH2C *MakeHistL1RCUEventsIROC(Int_t type=0);
54 TH2C *MakeHistL1RCUEventsOROC(Int_t type=0);
be3dbaa0 55 TH1F *MakeHistL1PhaseDist();
56 TVectorF *MakeVectL1PhaseDist();
ddeb9c4f 57
58 const THnSparseI *GetHnDrift() const {return fHnDrift;}
59// AliTPCCalPad *CreateCalPadL1Mean();
60// AliTPCCalPad *CreateCalPadL1RMS();
61
62private:
63 Int_t fPeakDetMinus; // Consecutive timebins on rising edge to be regarded as a signal
64 Int_t fPeakDetPlus; // Consecutive timebins on falling edge to be regarded as a signal
65 UInt_t fNFailL1Phase; //Number of failures in L1 phase
be3dbaa0 66 UInt_t fNFailL1PhaseEvent; //Number of events with L1 phase failures
ddeb9c4f 67 UInt_t fFirstTimeStamp; //Time Stamp from first event
68 //binning dv hist
69 UInt_t fNSecTime; //Number of seconds per bin in time
70 UInt_t fNBinsTime; //Number of bin in time
71 //processing information
72 Bool_t fPadProcessed; //! if last pead has already been filled for the current pad
73 Int_t fCurrentChannel; //! current channel processed
74 Int_t fCurrentSector; //! current sector processed
75 Int_t fLastSector; //! current sector processed
76 Int_t fCurrentRow; //! current row processed
77 Int_t fCurrentPad; //! current pad processed
78 Int_t fLastTimeBinProc; //! last time bin processed
79 Int_t fPeakTimeBin; //! time bin with local maximum
80 Int_t fLastSignal; //! last signal processed
81 Int_t fNOkPlus; //! number of processed time bins fullfilling peak criteria
82 Int_t fNOkMinus; //! number of processed time bins fullfilling peak criteria
83//
84 //L1 phase stuff
85 TVectorF fArrCurrentPhaseDist; //!Phase distribution of the current event
be3dbaa0 86 TVectorF fArrCurrentPhase; //!Current phase of all RCUs
87 TVectorF fArrFailEventNumber; //event numbers of failed events;
ddeb9c4f 88 TVectorF fArrALTROL1Phase; //Array of L1 phases on an event bases;
89 TObjArray fArrALTROL1PhaseEvent; //L1 phase for each RCU and event
90 TObjArray fArrALTROL1PhaseFailEvent; //L1 failure for each RCU and event
91 //drift velocity stuff
92 enum {kHnBinsDV=3};
93 THnSparseI *fHnDrift; //Histogram last time bin vs. ROC, Time
94
95 TVectorF *MakeArrL1PhaseRCU(Int_t rcu, Bool_t force=kFALSE);
96 TVectorF *MakeArrL1PhaseFailRCU(Int_t rcu, Bool_t force=kFALSE);
97
98 Bool_t IsEdgePad(Int_t sector, Int_t row, Int_t pad) const;
99 void CreateDVhist();
100
101 AliTPCCalibRaw(AliTPCCalibRaw &calib);
102 AliTPCCalibRaw& operator = (const AliTPCCalibRaw &source);
103
be3dbaa0 104 ClassDef(AliTPCCalibRaw,2) // Analysis of the Altro header information
ddeb9c4f 105};
106
107//----------------------
108// Inline Functions
109//----------------------
110inline TVectorF *AliTPCCalibRaw::MakeArrL1PhaseRCU(Int_t rcu, Bool_t force)
111{
112 TVectorF *arr=(TVectorF*)fArrALTROL1PhaseEvent.UncheckedAt(rcu);
113 if (!arr && force) {
be3dbaa0 114 arr=new TVectorF(100);
ddeb9c4f 115 fArrALTROL1PhaseEvent.AddAt(arr,rcu);
116 }
117 return arr;
118}
119//
120inline TVectorF *AliTPCCalibRaw::MakeArrL1PhaseFailRCU(Int_t rcu, Bool_t force)
121{
122 TVectorF *arr=(TVectorF*)fArrALTROL1PhaseFailEvent.UncheckedAt(rcu);
123 if (!arr && force) {
124 arr=new TVectorF(1000);
125 fArrALTROL1PhaseFailEvent.AddAt(arr,rcu);
126 }
127 return arr;
128}
129//_____________________________________________________________________
130inline Bool_t AliTPCCalibRaw::IsEdgePad(Int_t sector, Int_t row, Int_t pad) const
131{
132 //
133 // return true if pad is on the edge of a row
134 //
135 Int_t edge1 = 0;
136 if ( pad == edge1 ) return kTRUE;
137 Int_t edge2 = fROC->GetNPads(sector,row)-1;
138 if ( pad == edge2 ) return kTRUE;
139
140 return kFALSE;
141}
142
143
144#endif