]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
updates by Simone Schuchmann
authorjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 Dec 2009 10:44:49 +0000 (10:44 +0000)
committerjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 Dec 2009 10:44:49 +0000 (10:44 +0000)
PWG1/TPC/AliPerfAnalyzeInvPt.cxx
PWG1/TPC/AliPerfAnalyzeInvPt.h
PWG1/TPC/AliPerformancePtCalib.cxx
PWG1/TPC/AliPerformancePtCalib.h

index 568dcd2e586b97fd3ffdbf4a5d2be7f1da4ce3ac..a217202cb2a8851d330967770234bdc49b424e95 100755 (executable)
@@ -56,29 +56,32 @@ ClassImp(AliPerfAnalyzeInvPt)
 {
    // fit function for fitting of 1/pt with a polynomial of 4th order, rejecting points between  +/-par[4]
 
-
+  
    if (x[0] > -par[4] && x[0] < par[4]) {
       TF1::RejectPoint();
       return 0;
    }
+   
    return  par[2]+par[0]*pow((x[0]-par[1]),2)+par[3]*pow((x[0]-par[1]),4);
-  
+
 }
 //____________________________________________________________________________________________________________________________________________
 Double_t AliPerfAnalyzeInvPt::PolynomialRejP(Double_t *x, const Double_t *par)
 {
    // fit function for fitting of 1/pt with a polynomial of 4th order to improve result (fit range and rejection zone is adjusted to first guess of minimum position)
+     
    Double_t pos  = par[5];
    Double_t neg = - par[5];
    pos += par[4];
    neg += par[4];
-  
+   
    if (x[0] > neg && x[0] < pos) {
       TF1::RejectPoint();
       return 0;
    }
+   
    return   par[2]+par[0]*pow((x[0]-par[1]),2)+par[3]*pow((x[0]-par[1]),4);
 }
 //____________________________________________________________________________________________________________________________________________
 Double_t AliPerfAnalyzeInvPt::InvGauss(Double_t *x, const Double_t *par)
@@ -118,6 +121,8 @@ AliPerfAnalyzeInvPt::AliPerfAnalyzeInvPt():
    fRange(0),
    fExclRange(0),
    fFitGaus(0) ,
+   fDoRebin(0),
+   fRebin(0),
    fHistH2InvPtTheta(0),
    fHistH2InvPtPhi(0), 
    fGrMinPosTheta(0),
@@ -135,6 +140,8 @@ AliPerfAnalyzeInvPt::AliPerfAnalyzeInvPt():
    fRange = 0;
    fExclRange = 0;
    fFitGaus = 0;
+   fDoRebin = kFALSE;
+   fRebin = 0;
    
    for(Int_t i=0;i<100;i++){
       
@@ -152,6 +159,8 @@ AliPerfAnalyzeInvPt::AliPerfAnalyzeInvPt(Char_t* name="AliAnalyzeInvPt",Char_t*
    fRange(0),
    fExclRange(0),
    fFitGaus(0) ,
+   fDoRebin(0),
+   fRebin(0),
    fHistH2InvPtTheta(0),
    fHistH2InvPtPhi(0), 
    fGrMinPosTheta(0),
@@ -168,7 +177,9 @@ AliPerfAnalyzeInvPt::AliPerfAnalyzeInvPt(Char_t* name="AliAnalyzeInvPt",Char_t*
    fRange = 0;
    fExclRange = 0;
    fFitGaus = 0;
-
+   fDoRebin = kFALSE;
+   fRebin = 0;
+    
    for(Int_t i=0;i<100;i++){
     
       fHistFitTheta[i] = NULL;
@@ -322,7 +333,7 @@ void AliPerfAnalyzeInvPt::StartAnalysis(const TH2F *histThetaInvPt, const TH2F *
       Double_t invPtMinPosImpr  = 0;
       Double_t invPtMinPosErrImpr = 0;
    
-
+      if(fDoRebin) fHistFitTheta[i]->Rebin(fRebin);
       //start fitting
       if(!fFitGaus){
         Printf("making polynomial fit in 1/pt in theta bins");
@@ -385,7 +396,7 @@ void AliPerfAnalyzeInvPt::StartAnalysis(const TH2F *histThetaInvPt, const TH2F *
       Double_t invPtMinPosErr = 0;
       Double_t invPtMinPosImpr  = 0;
       Double_t invPtMinPosErrImpr = 0;
-    
+     if(fDoRebin) fHistFitPhi[i]->Rebin(fRebin);
       if(!fFitGaus){
         Printf("making polynomial fit in 1/pt in phi bins");
         phiCan->cd(countPad);
@@ -424,9 +435,9 @@ void AliPerfAnalyzeInvPt::StartAnalysis(const TH2F *histThetaInvPt, const TH2F *
    canFitVal->Divide(2,1);
 
    canFitVal->cd(1);
-   fGrMinPosTheta->Draw("ALP");
+   fGrMinPosTheta->Draw("AP");
    canFitVal->cd(2);
-   fGrMinPosPhi->Draw("ALP");
+   fGrMinPosPhi->Draw("AP");
 
    Printf("AliPerfAnalyzeInvPt: NOTE: last bin is always fit result  of integral over all angle ranges which have been set by user!");
 
index 26be0a5647284158378ee3e06d0a894212d488cb..6aa4bdf10fc04bcbce27e4d4977b67594e5d8f23 100755 (executable)
@@ -1,3 +1,4 @@
+
 #ifndef ALIPERFANALYZEINVPT_H
 #define ALIPERFANALYZEINVPT_H
 
@@ -39,7 +40,7 @@ public:
    void SetProjBinsPhi(const Double_t *pBins,const Int_t sizep);
    void SetProjBinsTheta(const Double_t *tBins, const Int_t sizet);
    void SetMakeFitOption(const Bool_t setGausFit, const Double_t exclusionR,const Double_t fitR );
+   void SetDoRebin(const Int_t rebin){if(rebin) {fDoRebin = kTRUE; fRebin = rebin;}}
   
 protected:
    Double_t fThetaBins[100];// array of theta bins for projection and fit
@@ -50,7 +51,8 @@ protected:
    Double_t fRange;// fit range of 1/pt spectrum
    Double_t fExclRange ;// range of exlusion of points around 0 when fitting 1/pt
    Bool_t fFitGaus;// set this flag for usage of gaussian fit function instead of polynomial (default)
-   
+   Bool_t  fDoRebin;
+   Int_t  fRebin;
    // projection histos
    TH1F *fHistFitTheta[100];// projection histos for analysis in theta bins
    TH1F *fHistFitPhi[100];// projection histos for analysis in phi bins
index 5b193cdb8021f4e91f89fa5f8f3e01b264937e6c..ea7dd59945cbf3a08dc5727a6e28b0c5324251e0 100755 (executable)
@@ -11,6 +11,7 @@
 // a data member of AliPerformancePtCalib*.
 //
 // Author: S.Schuchmann 11/13/2009 
+//         sschuchm@ikf.uni-frankfurt.de
 //------------------------------------------------------------------------------
 
 /*
@@ -63,6 +64,8 @@ ClassImp(AliPerformancePtCalib)
       fRange(0),
       fExclRange(0),
       fFitGaus(0) ,
+      fDoRebin(0),
+      fRebin(0),
       // option for user defined charge/pt shift
       fShift(0),
       fDeltaInvP(0),
@@ -146,7 +149,9 @@ ClassImp(AliPerformancePtCalib)
    fNPhiBins = 0; //number of phi bins
    fRange = 0; //fit range around 0
    fExclRange =0; //range of rejection of points around 0
-    
+   fDoRebin = kFALSE;
+   fRebin = 0;
+   
    Init();
 }
 
@@ -160,10 +165,11 @@ AliPerformancePtCalib::AliPerformancePtCalib(Char_t * name="AliPerformancePtCali
    fRange(0),
    fExclRange(0),
    fFitGaus(0) ,
+   fDoRebin(0),
+   fRebin(0),
    fShift(0),
    fDeltaInvP(0),
-   
-   //options for cuts
+     //options for cuts
    fOptTPC(0),
    fESDcuts(0),
    fRefitTPC(0),
@@ -241,7 +247,8 @@ AliPerformancePtCalib::AliPerformancePtCalib(Char_t * name="AliPerformancePtCali
    fNPhiBins = 0; //number of phi bins
    fRange = 0; //fit range around 0
    fExclRange =0; //range of rejection of points around 0
-  
+   fDoRebin = kFALSE;
+   fRebin = 0;
   
    Init();
 }
@@ -342,6 +349,10 @@ void AliPerformancePtCalib::Exec(AliMCEvent*, AliESDEvent* const esdEvent, AliES
       return;
    }
 
+    Bool_t isEventTriggered = esdEvent->IsTriggerClassFired(GetTriggerClass());
+    if(!isEventTriggered) return;
+
+   
    if(fShift) fHistUserPtShift->Fill(fDeltaInvP);
   
    fHistTrackMultiplicity->Fill(esdEvent->GetNumberOfTracks());
@@ -502,7 +513,7 @@ void AliPerformancePtCalib::Analyse()
    ana->SetProjBinsTheta(fThetaBins,fNThetaBins);
    ana->SetProjBinsPhi(fPhiBins,fNPhiBins);
    ana->SetMakeFitOption(fFitGaus,fExclRange,fRange);
-  
+   ana->SetDoRebin(fRebin);               
    TObjArray *aFolderObj = new TObjArray;
    ana->StartAnalysis(fHistInvPtTheta,fHistInvPtPhi, aFolderObj);
   
index d7d9502fcbdb989966415613554ea1cdd96fcada..24a08b5c757a5967b15056e7cbbd51aa6c1b4e00 100755 (executable)
@@ -90,6 +90,7 @@ public:
    void SetProjBinsPhi(const Double_t *pBins,const Int_t sizep);// set phi bins for projection
    void SetProjBinsTheta(const Double_t *tBins, const Int_t sizet);// set theta bins for projection
    void SetMakeFitOption(const Bool_t setGausFit, const Double_t exclusionR,const Double_t fitR );//set fit options
+   void SetDoRebin(const Int_t rebin){if(rebin) {fDoRebin = kTRUE; fRebin = rebin;}}
    const TList *GetHistoList() {return fList;}// get list of histograms for analysis
    
    // Create folder for analysed histograms
@@ -114,7 +115,9 @@ protected:
    Double_t fRange;// sets fit range
    Double_t fExclRange ;// sets range of rejection of points around 0
    Bool_t fFitGaus ;// flag for usage of gaussian fit function
-
+   Bool_t fDoRebin;
+   Int_t fRebin;
+   
 private:
 
    Bool_t fShift;//flag for shift in charge/pt