]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCCalibRaw.h
Adapting to CORRFW changes (Chiara)
[u/mrichter/AliRoot.git] / TPC / AliTPCCalibRaw.h
index 9b4cdeaa190c2836f822ecdfce9dc507657c609a..f45a6b25271a9ee1ae6756943d102cc4d1fffb4e 100644 (file)
 #include "AliTPCROC.h"
 
 class TH2C;
+class TH1F;
+class TMap;
+class TGraph;
+class TCanvas;
 
 class AliTPCCalibRaw : public AliTPCCalibRawBase {
 public:
   AliTPCCalibRaw();
+  AliTPCCalibRaw(const TMap *config);
   
   virtual ~AliTPCCalibRaw();
 
+  enum {kNRCU=216};
   
   virtual Int_t Update(const Int_t isector, const Int_t iRow, const Int_t iPad,
                        const Int_t iTimeBin, const Float_t signal);
+  virtual void UpdateDDL();
   virtual void EndEvent();
   virtual void ResetEvent();
   virtual void Analyse();
 
   UInt_t GetNFailL1Phase()                const  {return fNFailL1Phase;}
+  UInt_t GetNFailL1PhaseEvents()          const  {return fNFailL1PhaseEvent;}
   Int_t   GetPeakDetectionMinus() const {return fPeakDetMinus;}
   Int_t   GetPeakDetectionPlus()  const {return fPeakDetPlus;}
   
@@ -41,11 +49,25 @@ public:
   const TVectorF *GetALTROL1PhaseEventsRCU(Int_t rcu) const {return (TVectorF*)fArrALTROL1PhaseEvent.At(rcu);}
   const TVectorF *GetALTROL1PhaseFailEventsRCU(Int_t rcu) const {return (TVectorF*)fArrALTROL1PhaseFailEvent.At(rcu);}
 
-  void  SetRangePeakDetection(Int_t minus, Int_t plus) { fPeakDetMinus=minus; fPeakDetPlus=plus;}
+  const TVectorF *GetOccupancyEvent()          const {return &fVOccupancyEvent;}
+  const TVectorF *GetOccupancyEventSensitive() const {return &fVOccupancySenEvent;}
+  const TVectorF *GetSignalSumEvent()          const {return &fVSignalSumEvent;}
+  const TVectorF *GetSignalSumEventSensitive() const {return &fVSignalSumSenEvent;}
+  const TVectorF *GetFiredPadsSensitive()      const {return &fVNfiredPadsSenEvent;}
+  const TVectorF *GetEventTimeStamps()         const {return &fVTimeStampEvent;}
+  UInt_t GetFirstTimeStamp() const {return fFirstTimeStamp;}
   
+  void  SetRangePeakDetection(Int_t minus, Int_t plus) { fPeakDetMinus=minus; fPeakDetPlus=plus;}
+  //Phase info
   TH2C *MakeHistL1RCUEvents(Int_t type=0);
   TH2C *MakeHistL1RCUEventsIROC(Int_t type=0);
   TH2C *MakeHistL1RCUEventsOROC(Int_t type=0);
+  TH1F *MakeHistL1PhaseDist();
+  TVectorF *MakeVectL1PhaseDist();
+  //Occupancy info
+  TGraph*  MakeGraphOccupancy(const Int_t type=0, const Int_t xType=0);
+  TGraph*  MakeGraphNoiseEvents();
+  TCanvas* MakeCanvasOccupancy(const Int_t xType=1, Bool_t sen=kFALSE);
 
   const THnSparseI *GetHnDrift() const {return fHnDrift;}
 //   AliTPCCalPad *CreateCalPadL1Mean();
@@ -55,6 +77,7 @@ private:
   Int_t   fPeakDetMinus;             //  Consecutive timebins on rising edge to be regarded as a signal
   Int_t   fPeakDetPlus;              //  Consecutive timebins on falling edge to be regarded as a signal
   UInt_t  fNFailL1Phase;             //Number of failures in L1 phase
+  UInt_t  fNFailL1PhaseEvent;        //Number of events with L1 phase failures
   UInt_t  fFirstTimeStamp;           //Time Stamp from first event
   //binning dv hist
   UInt_t  fNSecTime;                 //Number of seconds per bin in time
@@ -71,15 +94,25 @@ private:
   Int_t     fLastSignal;             //! last signal processed
   Int_t     fNOkPlus;                //! number of processed time bins fullfilling peak criteria
   Int_t     fNOkMinus;               //! number of processed time bins fullfilling peak criteria
+  Int_t     fNanoSec;                //! current nano seconds stamp
 //
   //L1 phase stuff
   TVectorF fArrCurrentPhaseDist;       //!Phase distribution of the current event
+  TVectorF fArrCurrentPhase;           //!Current phase of all RCUs
+  TVectorF fArrFailEventNumber;        //event numbers of failed events;
   TVectorF fArrALTROL1Phase;           //Array of L1 phases on an event bases;
   TObjArray fArrALTROL1PhaseEvent;     //L1 phase for each RCU and event
   TObjArray fArrALTROL1PhaseFailEvent; //L1 failure for each RCU and event
   //drift velocity stuff
   enum {kHnBinsDV=3};
   THnSparseI *fHnDrift;                //Histogram last time bin vs. ROC, Time
+  //occupancy
+  TVectorF fVOccupancyEvent;           //occupancy per event (number of samples above threshold)
+  TVectorF fVSignalSumEvent;           //occupancy per event (sum of all adc values)
+  TVectorF fVOccupancySenEvent;        //occupancy per event (number of samples abouve threshold) in sensitive regions
+  TVectorF fVSignalSumSenEvent;        //occupancy per event (sum of all adc values) in sensitive regions
+  TVectorF fVNfiredPadsSenEvent;       //number of pads with a signal above threshold in sensitive regions
+  TVectorF fVTimeStampEvent;           //timestamp for all events
   
   TVectorF *MakeArrL1PhaseRCU(Int_t rcu, Bool_t force=kFALSE);
   TVectorF *MakeArrL1PhaseFailRCU(Int_t rcu, Bool_t force=kFALSE);
@@ -90,7 +123,7 @@ private:
   AliTPCCalibRaw(AliTPCCalibRaw &calib);
   AliTPCCalibRaw& operator = (const  AliTPCCalibRaw &source);
 
-  ClassDef(AliTPCCalibRaw,1) //  Analysis of the Altro header information
+  ClassDef(AliTPCCalibRaw,3) //  Analysis of the Altro header information
 };
 
 //----------------------
@@ -100,7 +133,7 @@ inline TVectorF *AliTPCCalibRaw::MakeArrL1PhaseRCU(Int_t rcu, Bool_t force)
 {
   TVectorF *arr=(TVectorF*)fArrALTROL1PhaseEvent.UncheckedAt(rcu);
   if (!arr && force) {
-    arr=new TVectorF(1000);
+    arr=new TVectorF(100);
     fArrALTROL1PhaseEvent.AddAt(arr,rcu);
   }
   return arr;
@@ -110,7 +143,7 @@ inline TVectorF *AliTPCCalibRaw::MakeArrL1PhaseFailRCU(Int_t rcu, Bool_t force)
 {
   TVectorF *arr=(TVectorF*)fArrALTROL1PhaseFailEvent.UncheckedAt(rcu);
   if (!arr && force) {
-    arr=new TVectorF(1000);
+    arr=new TVectorF(100);
     fArrALTROL1PhaseFailEvent.AddAt(arr,rcu);
   }
   return arr;