X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TOF%2FAliTOFCalibTask.h;h=12a4db78df31ac376ae864998c6cd6af89420e77;hb=4b7b081bdcde23c1fbc17fd32a928e467e03fd7e;hp=bed29c88bf83f335aaa49830ff5d7d47640d02ca;hpb=1ed775806bc4a47bed79fa5522ee57d2bf4a2d57;p=u%2Fmrichter%2FAliRoot.git diff --git a/TOF/AliTOFCalibTask.h b/TOF/AliTOFCalibTask.h index bed29c88bf8..12a4db78df3 100644 --- a/TOF/AliTOFCalibTask.h +++ b/TOF/AliTOFCalibTask.h @@ -11,37 +11,29 @@ /* $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" +#include "AliAnalysisTaskSE.h" class TTree; class AliESDtrack ; @@ -50,88 +42,39 @@ class TH1F ; class TH1I ; class TH1D ; class TH2F ; -class AliESD ; +class AliESDEvent ; +class TList ; +class AliTOFArray; -class AliTOFCalibTask : public AliAnalysisTask { +class AliTOFCalibTask : public AliAnalysisTaskSE { public: - AliTOFCalibTask(const char *name) ; //ctor + // AliTOFCalibTask() ; //ctor + AliTOFCalibTask(const char *name = "TOFCalibTask") ; //ctor AliTOFCalibTask(const AliTOFCalibTask & calibtask); // copy constructor AliTOFCalibTask& operator=(const AliTOFCalibTask & calibtask); // assignment operator virtual ~AliTOFCalibTask(); //dtor - virtual void Exec(Option_t * opt="") ; - virtual void ConnectInputData(Option_t *) ; - virtual void CreateOutputObjects(); + virtual void UserExec(Option_t * opt="") ; + virtual void UserCreateOutputObjects(); virtual void Terminate(Option_t * opt = "") ; - 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]}; - - }; - private: - Bool_t Select(AliESDtrack *t); - 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; + 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(); + 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 - AliESD* fESD ; //! Declaration of leave types - Int_t fMinEntries; // minimum number of entries to steer the task - Int_t fIch; // TOF channel number + AliESDEvent* fESD ; //! Declaration of leave types 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 + AliTOFArray* fTOFArray; //! object for TOF signal, arranged per channel Int_t fnESD; // number of analyzed ESD tracks Int_t fnESDselected; // number of selected ESD tracks Int_t fnESDkTOFout; // number of ESD tracks with kTOFout @@ -148,10 +91,20 @@ private: TH1F* fhExpTimePr; // Exp Time Pr histo TH1I* fhPID; // PID histo TH1D* fhch; // TOF channel histo + TH1I* fhESD; // n. of analyzed histo + TH1I* fhESDselected; // n. of selected ESD tracks histo + TH1I* fhESDkTOFout; // n. of ESD tracks with kTOFout histo + TH1I* fhESDkTIME; // n. of ESD tracks with kTIME histo + TH1I* fhESDassTOFcl; // n. of ESD tracks with assTOFcl histo + TH1I* fhESDTIMEcut; // n. of ESD tracks with TIMEcut histo + TH1I* fhESDTRDcut; // n. of ESD tracks with TRDcut histo + + Int_t fassparticle[11]; // array for assigned identities - TObjArray * fOutputContainer ; //! output data container + TList *fListOfHistos; //! list of Histos to be stored in the output container 1 + TList *fListArray; //! list of Array for output container 2 - ClassDef(AliTOFCalibTask, 1); // TOF Calib task + ClassDef(AliTOFCalibTask, 2); // TOF Calib task }; #endif // ALITOFCALIBTASK_H