]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDCalibraVector.h
- fix
[u/mrichter/AliRoot.git] / TRD / AliTRDCalibraVector.h
index 7c360b36b307cb7f1a83953b11028a7bc5fb0a27..6ea9d185f7f724ac03d952c602429934f4f89015 100644 (file)
@@ -19,8 +19,9 @@ class TGraphErrors;
 class TH1F;
 class TObjArray;
 
-class TArrayF;
-class TArrayI;
+class AliTRDPhInfo;
+class AliTRDEntriesInfo;
+class AliTRDPrfInfo;
 
 class AliTRDCalibraVector : public TObject {
 
@@ -29,25 +30,42 @@ class AliTRDCalibraVector : public TObject {
   AliTRDCalibraVector();
   AliTRDCalibraVector(const AliTRDCalibraVector &c);
   virtual ~AliTRDCalibraVector();
+  virtual Long64_t Merge(const TCollection* list);
 
   AliTRDCalibraVector& operator = (const  AliTRDCalibraVector &source);
 
+  // Init
+  void           TestInit(Int_t i, Int_t detmax);
+
   // Fill
-  Int_t          SearchBin(Float_t value, Int_t i) const;  
   Bool_t         UpdateVectorCH(Int_t det, Int_t group, Float_t value);
   Bool_t         UpdateVectorPRF(Int_t det, Int_t group, Float_t x, Float_t y);
   Bool_t         UpdateVectorPH(Int_t det, Int_t group, Int_t time, Float_t value);
+
+
+  Bool_t         FillVectorCH(Int_t det, Int_t group, Int_t bin, Int_t entries);
+  Bool_t         FillVectorPRF(Int_t det, Int_t group, Int_t bin, Int_t entries, Float_t mean, Float_t square);
+  Bool_t         FillVectorPH(Int_t det, Int_t group, Int_t bin, Int_t entries, Float_t mean, Float_t square);
 
 
   // Add
   Bool_t         Add(AliTRDCalibraVector *calvector);
+
+  AliTRDCalibraVector *AddStatsPerDetectorCH();
+  AliTRDCalibraVector *AddStatsPerDetectorPH();
+  AliTRDCalibraVector *AddStatsPerDetectorPRF();
+
   
   // Fit
   TGraphErrors  *ConvertVectorPHTGraphErrors(Int_t det, Int_t group, const Char_t *name);
   TGraphErrors  *ConvertVectorPRFTGraphErrors(Int_t det, Int_t group, const Char_t *name);
+  TH1F          *CorrectTheError(const TGraphErrors *hist, Int_t &nbEntries);
   TH1F          *ConvertVectorCHHisto(Int_t det, Int_t group, const Char_t *name);
 
+  // Find
+  Int_t          SearchBin(Float_t value, Int_t i) const;  
+  Bool_t         FindTheMaxEntries(Int_t i, Int_t &detectormax, Int_t &groupmax);
+
   //
   // Set and Get methods
   //
@@ -58,9 +76,8 @@ class AliTRDCalibraVector : public TObject {
   void           SetPRFRange(Float_t prfrange)                 { fPRFRange        = prfrange;                   }  
   void           SetDetCha0(Int_t i, Short_t total)            { fDetCha0[i]      = total;                      } 
   void           SetDetCha2(Int_t i, Short_t total)            { fDetCha2[i]      = total;                      } 
-  void           SetNamePH(const char* name)                   { fNamePH = name;  } 
-  void           SetNamePRF(const char* name)                  { fNamePRF = name; } 
-  void           SetNameCH(const char* name)                   { fNameCH = name;  } 
+  void           SetNzNrphi(Int_t i, Int_t nz, Int_t nrphi);    
+  void           SetNbGroupPRF(Int_t nbGroup)                  { fNbGroupPRF = (UChar_t) nbGroup;               } 
 
   Short_t        GetNumberBinCharge()const                     { return fNumberBinCharge;                       }
   Short_t        GetNumberBinPRF()const                        { return fNumberBinPRF;                          }
@@ -68,71 +85,77 @@ class AliTRDCalibraVector : public TObject {
   Float_t        GetPRFRange()const                            { return fPRFRange;                              } 
   Short_t        GetDetCha0(Int_t i) const                     { return fDetCha0[i];                            }
   Short_t        GetDetCha2(Int_t i) const                     { return fDetCha2[i];                            }
-  const char*    GetNamePH()                                   { return fNamePH;             }
-  const char*    GetNamePRF()                                  { return fNamePRF;            }
-  const char*    GetNameCH()                                   { return fNameCH;             }
-
-
-  TArrayI  *GetPHEntries(Int_t det,Bool_t force = kFALSE);
-  TArrayF  *GetPHMean(Int_t det,Bool_t force = kFALSE);
-  TArrayF  *GetPHSquares(Int_t det,Bool_t force = kFALSE);
-
-  TArrayI  *GetPRFEntries(Int_t det,Bool_t force = kFALSE);
-  TArrayF  *GetPRFMean(Int_t det,Bool_t force = kFALSE);
-  TArrayF  *GetPRFSquares(Int_t det,Bool_t force = kFALSE);
-
-  TArrayI  *GetCHEntries(Int_t det,Bool_t force = kFALSE);
+  TString        GetNamePH() const;    
+  TString        GetNamePRF() const;   
+  TString        GetNameCH() const;  
+  Int_t          GetNz(Int_t i) const;
+  Int_t          GetNrphi(Int_t i) const;
+  Int_t          GetNbGroupPRF() const                         { return (Int_t)fNbGroupPRF;                     }
+
+  Int_t          GetTotalNumberOfBinsInDetector(Int_t det, Int_t i, Int_t nbBin) const;
+
+  TObject               *GetPHEntries(Int_t det,Bool_t force = kFALSE);
+  TObject               *GetPHMean(Int_t det,Bool_t force = kFALSE);
+  TObject               *GetPHSquares(Int_t det,Bool_t force = kFALSE);
+  
+  TObject               *GetPRFEntries(Int_t det,Bool_t force = kFALSE);
+  TObject               *GetPRFMean(Int_t det,Bool_t force = kFALSE);
+  TObject               *GetPRFSquares(Int_t det,Bool_t force = kFALSE);
+  
+  TObject               *GetCHEntries(Int_t det,Bool_t force = kFALSE);
 
+   
+  
  protected:
-
+  
   // Current data
-
-         TArrayI     *fPHEntries[540];                //  Current AliTRDArrayI PH entries
-         TArrayF     *fPHMean[540];                   //  Current AliTRDArrayF PH Mean
-         TArrayF     *fPHSquares[540];                //  Current AliTRDArrayF PH Squares
-
-        TArrayI     *fPRFEntries[540];               //  Current AliTRDArrayI PH entries
-         TArrayF     *fPRFMean[540];                  //  Current AliTRDArrayF PH Mean
-         TArrayF     *fPRFSquares[540];               //  Current AliTRDArrayF PH Squares
-
-        TArrayI     *fCHEntries[540];                //  Current AliTRDArrayI PH entries
-
-        const char *fNameCH;                         //  Name for calibration mode
-        const char *fNamePH;                         //  Name for calibration mode
-        const char *fNamePRF;                        //  Name for calibration mode
-
-        Int_t            fDetectorPH;                //  Current detector
-        Int_t            fDetectorCH;                //  Current detector
-        Int_t            fDetectorPRF;               //  Current detector
-                
+  
+  AliTRDEntriesInfo     *fPHEntries[540];                //  PH entries
+  AliTRDPhInfo          *fPHMean[540];                   //  PH Mean
+  AliTRDPhInfo          *fPHSquares[540];                //  PH Squares
+  
+  AliTRDEntriesInfo     *fPRFEntries[540];               //  PRF entries
+  AliTRDPrfInfo         *fPRFMean[540];                  //  PRF Mean
+  AliTRDPrfInfo         *fPRFSquares[540];               //  PRF Squares
+  
+  AliTRDEntriesInfo     *fCHEntries[540];                //  CH entries
+  
+  UChar_t      fModeCH;                         //  Calibration mode
+  UChar_t      fModePH;                         //  Calibration mode
+  UChar_t      fModePRF;                        //  Calibration mode
+  UChar_t      fNbGroupPRF;                     //  Nb of group PRD
+  
+  
+  Int_t            fDetectorPH;                //!  Current detector
+  Int_t            fDetectorCH;                //!  Current detector
+  Int_t            fDetectorPRF;               //!  Current detector
+  Bool_t           fStopFillCH;                //!  To know if we stop to fill
+  TH1F            *fHisto;                     //!  Histo to be fitted
+  TGraphErrors    *fGraph;                     //!  TGraphError
+  AliTRDCalibraVector *fCalVector;             //!  AliTRDCalibraVector
+  
   // Size of the infos
-
-         Short_t          fNumberBinCharge;          // Number of bins for the gain factor
-         Short_t          fNumberBinPRF;             // Number of bin for the PRF
-         Int_t            fTimeMax;                  // Number of time bins
-         Float_t          fPRFRange;                 // Range PRF
-         Short_t          fDetCha0[3];               // Number of XBins for chamber != 2
-          Short_t          fDetCha2[3];               // Number of Xbins for chamber 2
-
+  
+  Short_t          fNumberBinCharge;          // Number of bins for the gain factor
+  Short_t          fNumberBinPRF;             // Number of bin for the PRF
+  Int_t            fTimeMax;                  // Number of time bins
+  Float_t          fPRFRange;                 // Range PRF
+  Short_t          fDetCha0[3];               // Number of XBins for chamber != 2
+  Short_t          fDetCha2[3];               // Number of Xbins for chamber 2
+  
   // Some functions
-
-
-         TArrayI  *GetEntriesPH(Int_t det, TArrayI** array, Bool_t force);
-         TArrayF  *GetMeanSquaresPH(Int_t det, TArrayF** array, Bool_t force);
-
-         TArrayI  *GetEntriesPRF(Int_t det, TArrayI** array, Bool_t force);
-         TArrayF  *GetMeanSquaresPRF(Int_t det, TArrayF** array, Bool_t force);
-         
-         TArrayI  *GetEntriesCH(Int_t det, TArrayI** array, Bool_t force);
-
-  // Some basic geometry function
-          virtual Int_t    GetStack(Int_t d) const;
   
-  ClassDef(AliTRDCalibraVector,1)                   // TRD Calibration class
-
-};
+  AliTRDEntriesInfo  *GetEntriesPH(Int_t det, AliTRDEntriesInfo** array, Bool_t force);
+  AliTRDPhInfo       *GetMeanSquaresPH(Int_t det, AliTRDPhInfo** array, Bool_t force);
   
-#endif
+  AliTRDEntriesInfo  *GetEntriesPRF(Int_t det, AliTRDEntriesInfo** array, Bool_t force);
+  AliTRDPrfInfo      *GetMeanSquaresPRF(Int_t det, AliTRDPrfInfo** array, Bool_t force);
+  
+  AliTRDEntriesInfo  *GetEntriesCH(Int_t det, AliTRDEntriesInfo** array, Bool_t force);
 
+  ClassDef(AliTRDCalibraVector,1)                   // TRD Calibration class
+    
+    };
+    
+#endif