]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFCalibTask.h
Corrected a bug in kalman tracking (final parameters and covariances
[u/mrichter/AliRoot.git] / TOF / AliTOFCalibTask.h
index 7cf0786c6a488d5cdd935dc6ec94e64e24242416..b477264e1bc72a2851fcfc1aeeb8d8937d23e71e 100644 (file)
 
 /* $Id$ */
 
-#define TOFCHANNELS       160000   // number TOF channels 
+#define TOFCHANNELS       157248   // number TOF channels 
 #define CHENTRIES            500   // number of entries per TOF channel per run
                                    // (to be divided by 5 to get the 
                                    // real number of entries), bigarray 
 #define CHENTRIESSMALL       300   // number of entries per TOF channel per run
                                    // (to be divided by 3 to get the 
                                    // real number of entries), smallarray 
-#define MAXCHENTRIESSMALL  10000   // max number of entries per TOF channel 
-                                   // (to be divided by 3 to get the 
-                                   // real number of entries), smallarray 
-                                  
 #define LOWERMOMBOUND        1.0   // [GeV/c] default value Pb-Pb
 #define UPPERMOMBOUND        1.8   // [GeV/c] default value Pb-Pb
-#define MINTIME              5E3   // min time of flight value (ns)
+#define MINTIME                5   // min delta time of flight value (ns)
 #define NIDX                   5   // number of values stored 
                                    // in big/smallarray per ESD track
 #define NIDXSMALL              3   // number of values stored 
                                    // after Comb PID per ESD track
 #define DELTAIDXTOT            0   // index for ToT in bigarray
 #define DELTAIDXTIME           1   // index for TOF time in big/smallarray
-#define DELTAIDXEXTIMEPI       2   // index for Exp Time Pi in bigarray
+#define DELTAIDXEXTIMEPI       2   // index for Exp Time Pi in bigarray, will
+                                   // be the same element in the array where 
+                                   // the assigned time after Comb PID will
+                                   // be stored
 #define DELTAIDXEXTIMEKA       3   // index for Exp Time Ka in bigarray
 #define DELTAIDXEXTIMEPR       4   // index for Exp Time Pr in bigarray
-#define DELTAIDXPID            2   // index for Exp Time after Comb PID 
-                                   // in smallarray
 #define TRACKERROR       90*1E-3   // error on the tracks for 
                                    // Combinatorial PID (ns)
-#define MEANENTRIES           15   // Mean number of entries per channel 
-                                   // to perform calibration
 
 #include "AliAnalysisTask.h"  
 
@@ -64,72 +59,26 @@ public:
   virtual void CreateOutputObjects();
   virtual void Terminate(Option_t * opt = "") ;
   virtual Bool_t Notify();
-
- public: 
-  class AliTOFArrayTask : public TObject {
-  public:
-    AliTOFArrayTask(): TObject(),fSize(0),fArray(0x0){}
-    AliTOFArrayTask(Int_t size) :
-      TObject(),
-      fSize(size),
-      fArray(new TArrayF*[size]) {
-    } 
-    AliTOFArrayTask(const AliTOFArrayTask & source):
-      TObject(),fSize(0),fArray(0x0){ // copy constructor
-      this->fSize= source.fSize;
-      this->fArray= source.fArray;
-    };
-
-    AliTOFArrayTask& operator=(const AliTOFArrayTask & 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;}
-    TArrayF *  GetArray(Int_t pos) const {
-      TArrayF * parr = 0x0; 
-      if  (pos>-1 && pos < fSize)parr = fArray[pos];
-      return parr;
-    }
-    virtual ~AliTOFArrayTask() {
-      delete [] fArray;
-    }
-    
-  private:
-    
-    Int_t fSize;       // Size of the array of TArrayFs
-    TArrayF ** fArray; //[fSize]};
-    
-  };
+  void SetRun(Int_t irun){frun=irun;}
+  Int_t GetRun() const {return frun;}
 
 private:
   Bool_t Select(AliESDtrack *t);
+  Int_t SelectOnTime(Float_t *charray, Int_t ntracks, Int_t ich);
   Bool_t CombPID(Float_t *smallarray, Int_t size);
   void BookHistos();
   void DrawHistos();
-  Int_t Calibrate(Option_t *optionSave="", Option_t *optionFit="RQ");
-  Int_t Calibrate(Int_t nch,Int_t *ich, Option_t *optionSave="", Option_t *optionFit="RQ");
-  Int_t Calibrate(Int_t ichmin, Int_t ichmax, Option_t *optionSave="", Option_t *optionFit="RQ");
-  Int_t Calibrate(Int_t ich, Option_t *optionSave="", Option_t *optionFit="RQ");
-  Int_t CalibrateFromProfile(Int_t ich, Option_t *optionSave="", Option_t *optionFit="RQ");
-  TH1F* Profile(Int_t i);
-  Int_t FindBins (TH1F* h, Double_t *bins) const;
+  Float_t LoopCombPID(Int_t itrkinset, Int_t ntrkinset, Float_t **exptof, Float_t *texp, Float_t *timeofflight, Int_t *index, Float_t chisquarebest);
 
   const Char_t *fdir;              // initial directory
   TTree* fChain ;            //!pointer to the analyzed TTree or TChain
   //leaf types
   AliESDEvent* fESD ;              //! Declaration of leave types
-  Int_t fMinEntries;            // minimum number of entries to steer the task
-  Int_t fIch;                   // TOF channel number
   Float_t fToT;                 // Time over Threshold, ns
   Float_t fTime;                // TOF time, ns
   Float_t fExpTimePi;           // exp time, Pions, ns
   Float_t fExpTimeKa;           // exp time, Kaons, ns
   Float_t fExpTimePr;           // exp time, Protons, ns
-  TTree* ftree;                 // tree for calibration
   Float_t fMinTime;             // min TOF time for track selection; not used
   Float_t** fbigarray;          // big array for calibration
   Int_t* findexarray;           // array for entry index in each channel 
@@ -151,8 +100,10 @@ private:
   TH1D* fhch;                   // TOF channel histo               
 
   TObjArray * fOutputContainer ; //! output data container
+  Int_t frun;                   // number of current run
+  Int_t fassparticle[11];       // array for assigned identities
 
-  ClassDef(AliTOFCalibTask, 1); //  TOF Calib task 
+  ClassDef(AliTOFCalibTask, 2); //  TOF Calib task 
 };
 #endif // ALITOFCALIBTASK_H