]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFcalib.h
Replace AliTriggerPHOS by AliAnaCaloTrigger
[u/mrichter/AliRoot.git] / TOF / AliTOFcalib.h
index 4b99162fd922811898419a518a2b7702702de5c3..a2ab38e46db530dd18f00a117c89f215a9ef8d3c 100644 (file)
@@ -9,21 +9,23 @@
 //////////////////////////////////////////////////////////////////
 
 #include "TTask.h"
-#include "TH1F.h"
-#include "AliTOFChannel.h"
-#include "TClonesArray.h"
-#include "TList.h"
-#include "AliTOFCal.h"
-#include "AliTOFGeometry.h"
-#include "AliESD.h"
-#include "AliRunLoader.h"
+
+class TArrayF;
+class TF1;
+class TH1F;
+class TObjArray;
+
+class AliESD;
+
+class AliTOFCal;
+class AliTOFGeometry;
 
 class AliTOFcalib:public TTask{
 public:
   AliTOFcalib();          // ctor
-  AliTOFcalib(char* headerFile, Int_t nEvents=0) ; 
-  AliTOFcalib(const AliTOFcalib & calib);
-  void Init();
+  AliTOFcalib(AliTOFGeometry *geom);
+  AliTOFcalib(const AliTOFcalib & calib); // copy constructor
+  AliTOFcalib& operator=(const AliTOFcalib & calib); // assignment operator
   virtual ~AliTOFcalib() ; // dtor
   Int_t NSector()const {return fNSector;}
   Int_t NPlate()const {return fNPlate;}
@@ -32,45 +34,53 @@ public:
   Int_t NStripC()const {return fNStripC;}
   Int_t NpadZ()const {return fNpadZ;}
   Int_t NpadX()const {return fNpadX;}
-  TClonesArray * DecalibrateDigits(TClonesArray *digits);
-  void SelectESD(AliESD *event, AliRunLoader * rl); 
+  AliTOFCal * GetTOFCalArray() const {return fTOFCal;}
+  AliTOFCal * GetTOFCalSimArray() const {return fTOFSimCal;}
+  TH1F * GetTOFSimToT() const {return fTOFSimToT;}
+  void SelectESD(AliESD *event);   
   void CombESDId();
   void CalibrateESD();
   TH1F* Profile(Int_t i); 
-  Int_t Size()const{return fsize;}
-  void SetFitFunctions();
+  Int_t NChannels()const{return fNChannels;}
   TF1* SetFitFunctions(TH1F* histo);
-  TList* GetFitFunctions() {return flistFunc;}
-  TH1F** GetHistosToT() {return fhToT;}
-  void SetHistos();
-  void CorrectESDTime();
-  void CorrectESDTime(AliESD *event, AliRunLoader *rl);
-  void WriteOnCDB();
-  void ReadFromCDB(Char_t *sel, Int_t nrun);
-  Int_t GetIndex(Int_t *detId);
+  void CorrectESDTime();// useless method, kept to make Chiara happy
+  void CorrectESDTime(AliESD *event);
+  // Methods to retrieve/write parameters from/on CDB
+  void WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun);
+  void WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFCal *cal, TH1F *histo);
+  void ReadSimParFromCDB(Char_t *sel, Int_t nrun);
+  void WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFCal *cal);
+  void WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun);
+  Bool_t ReadParFromCDB(Char_t *sel, Int_t nrun);
+  Int_t GetIndex(Int_t *detId); // Get channel index for Calibration 
 
  public: 
   class AliTOFArray : public TObject {
   public:
     AliTOFArray(): TObject(),fSize(0),fArray(0x0){}
-    AliTOFArray(Int_t size) :
+    AliTOFArray(Int_t size):
       TObject(),
       fSize(size),
       fArray(new TArrayF*[size]) {
     } 
+    AliTOFArray(const AliTOFArray & source):
+      TObject(),fSize(0),fArray(0x0){ // copy constructor
+      this->fSize= source.fSize;
+      this->fArray= source.fArray;
+    };
+
+    AliTOFArray& operator=(const AliTOFArray & source) { // assignment operator
+      this->fSize= source.fSize;
+      this->fArray= source.fArray;
+      return *this;
+    }
+
     Int_t GetSize() const {return fSize;}
     void AddArray(Int_t pos, TArrayF * parr) {
-      if (pos>-1 && pos < fSize)
-       fArray[pos] = parr;
-      //else
-      //AliError("Index  out of range");  
-    }
-    TArrayF * GetArray(Int_t pos) {
-      TArrayF * parr = 0x0;
-      if  (pos>-1 && pos < fSize)
-       parr = fArray[pos];
-      //else
-        //AliError("Index out of range");  
+      if (pos>-1 && pos < fSize)fArray[pos] = parr;}
+    TArrayF *  GetArray(Int_t pos) const {
+      TArrayF * parr = 0x0; 
+      if  (pos>-1 && pos < fSize)parr = fArray[pos];
       return parr;
     }
     virtual ~AliTOFArray() {
@@ -87,8 +97,7 @@ public:
 
 private:
   static const Int_t fgkchannel;  // max number of entries per channel 
-  static const Char_t * ffile[6]; // spectra
-  Int_t fsize;     // number of channels
+  Int_t fNChannels; // number of TOF channels
   Int_t fNSector;  // number of TOF sectors
   Int_t fNPlate;   // number of TOF plates
   Int_t fNStripA;  // number of TOF strips A
@@ -96,19 +105,13 @@ private:
   Int_t fNStripC;  // number of TOF strips C
   Int_t fNpadZ;    // number of TOF pads Z
   Int_t fNpadX;    // number of TOF pads X
+  Int_t fNevents;           // number of events
   TObjArray * fESDsel;   // selected ESD tracks for calibration
-  TList *flistFunc;      // functions for simulated Time Slewing spectra
-  TH1F* fhToT[6];           // simulated ToT distributions
-  Float_t fMaxToT[6];       // max simulated ToT
-  Float_t fMinToT[6];       // min simulated ToT
-  Float_t fMaxToTDistr[6];  // max value in the ToT distributions
   AliTOFArray *fArrayToT;   // array for ToT values
   AliTOFArray *fArrayTime;  // array for Time values
-  Int_t fNevents;           // number of events
   AliTOFCal *fTOFCal;       // array of AliTOFChannels storing calib parameters
-  TString fT0File ;         // output file;
-  TString fHeadersFile;     // input file
-  AliTOFGeometry *fGeom;    // AliTOFgeometry pointer
+  AliTOFCal *fTOFSimCal;       // array of AliTOFChannels storing calib parameters
+  TH1F *fTOFSimToT;        // histo with realistic ToT signal from TB Data
   ClassDef(AliTOFcalib,1);
 };