A few upgrades plus files missing from previous commit
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 30 Jul 2010 15:34:59 +0000 (15:34 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 30 Jul 2010 15:34:59 +0000 (15:34 +0000)
13 files changed:
PWG2/FORWARD/analysis/AliFMDAnaCalibEnergyDistribution.cxx
PWG2/FORWARD/analysis/AliFMDAnaCalibEnergyDistribution.h
PWG2/FORWARD/analysis/AliFMDAnaCalibEventSelectionEfficiency.cxx
PWG2/FORWARD/analysis/AliFMDAnaCalibEventSelectionEfficiency.h
PWG2/FORWARD/analysis/AliFMDAnaParameters.cxx
PWG2/FORWARD/analysis/AliFMDAnaParameters.h
PWG2/FORWARD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx
PWG2/FORWARD/analysis/AliFMDAnalysisTaskCollector.cxx
PWG2/FORWARD/analysis/AliFMDAnalysisTaskDndeta.cxx
PWG2/FORWARD/analysis/AliFMDAnalysisTaskDndeta.h
PWG2/FORWARD/analysis/AliFMDAnalysisTaskSE.cxx
PWG2/FORWARD/analysis/AliFMDAnalysisTaskSharing.cxx
PWG2/FORWARD/analysis/AliFMDAnalysisTaskSharing.h

index 80048a8..82529ba 100644 (file)
@@ -92,7 +92,7 @@ TH1F* AliFMDAnaCalibEnergyDistribution::GetRingEnergyDistribution(Int_t det, Cha
   return hEdist;
 }
 //____________________________________________________________________
-void  AliFMDAnaCalibEnergyDistribution::SetEnergyDistribution(Int_t det, Char_t ring, Float_t eta, TH1F* edist) {
+void  AliFMDAnaCalibEnergyDistribution::SetEnergyDistributionUser(Int_t det, Char_t ring, Float_t eta, TH1F* edist) {
   AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
   Int_t binnumber = pars->GetEtaBin(eta);
   //std::cout<<binnumber<<std::endl;
index f154527..f90e6f4 100644 (file)
@@ -20,7 +20,7 @@ class AliFMDAnaCalibEnergyDistribution : public TObject
   void  SetNetaBins(Int_t nbins) {fNetaBins = nbins;}
   Int_t GetNetaBins() { return fNetaBins;}
   void  SetEtaLimits(Float_t eta_min, Float_t eta_max) {fEtaMin = eta_min; fEtaMax = eta_max;}
-  void  SetEnergyDistribution(Int_t det, Char_t ring, Float_t eta, TH1F* edist);
+  void  SetEnergyDistributionUser(Int_t det, Char_t ring, Float_t eta, TH1F* edist);
   void  SetEnergyDistribution(Int_t det, Char_t ring, Int_t etabin, TH1F* edist);
   
   TH1F* GetEnergyDistribution(Int_t det, Char_t ring, Float_t eta);
index d7697de..c53974e 100644 (file)
@@ -11,8 +11,9 @@ ClassImp(AliFMDAnaCalibEventSelectionEfficiency)
 
 //____________________________________________________________________
 AliFMDAnaCalibEventSelectionEfficiency::AliFMDAnaCalibEventSelectionEfficiency() : TObject(),
-                                                                    fCorrection(),
-                                                                    fIsInit(kFALSE)
+                                                                                  fCorrection(),
+                                                                                  fIsInit(kFALSE),
+                                                                                  fVtxEff(1)
 {
   
   
index 2cfb2cf..195bdfa 100644 (file)
@@ -26,13 +26,15 @@ class AliFMDAnaCalibEventSelectionEfficiency : public TObject
   Float_t GetCorrection(Int_t vtxbin);
   void    SetCorrection(Int_t vtxbin, Char_t ring, TH2F* hCorrection);
   TH2F*   GetCorrection(Int_t vtxbin, Char_t ring);
-
+  Float_t GetVtxToTriggerRatio() {return fVtxEff; }
+  void    SetVtxToTriggerRatio(Float_t vtxEff) {fVtxEff = vtxEff;}
  protected:
   
   TH1F fCorrection;
   TList fCorrectionList;
   Bool_t fIsInit;
-  ClassDef(AliFMDAnaCalibEventSelectionEfficiency,2);
+  Float_t fVtxEff;
+  ClassDef(AliFMDAnaCalibEventSelectionEfficiency,3);
 };
 
 #endif
index 9a74d32..18f165e 100644 (file)
@@ -376,12 +376,13 @@ Float_t AliFMDAnaParameters::GetMPV(Int_t det, Char_t ring, Float_t eta) {
   //AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
   TH1F* hEnergyDist     = GetEnergyDistribution(det,ring,eta);
   TF1*  fitFunc         = hEnergyDist->GetFunction("FMDfitFunc");
+  
   if(!fitFunc) {
     AliWarning(Form("No function for FMD%d%c, eta %f",det,ring,eta));
     std::cout<<hEnergyDist->GetEntries()<<"    "<<GetEtaBin(eta)<<std::endl;
     return 1024;
   }
-    
+  
   Float_t mpv           = fitFunc->GetParameter(1);
   return mpv;
 }
@@ -448,22 +449,23 @@ Float_t AliFMDAnaParameters::Get3MIPWeight(Int_t det, Char_t ring, Float_t eta)
 }
 //____________________________________________________________________
 Int_t AliFMDAnaParameters::GetNetaBins() {
-  return GetBackgroundCorrection(1,'I',0)->GetNbinsX();
+  return GetBackgroundCorrection(1,'I',5)->GetNbinsX();
   
 }
 //____________________________________________________________________
 Float_t AliFMDAnaParameters::GetEtaMin() {
 
-  return GetBackgroundCorrection(1,'I',0)->GetXaxis()->GetXmin();
+  return GetBackgroundCorrection(1,'I',5)->GetXaxis()->GetXmin();
 } 
 //____________________________________________________________________
 Float_t AliFMDAnaParameters::GetEtaMax() {
 
-return GetBackgroundCorrection(1,'I',0)->GetXaxis()->GetXmax();
+return GetBackgroundCorrection(1,'I',5)->GetXaxis()->GetXmax();
 
 }
 //____________________________________________________________________
 Int_t AliFMDAnaParameters::GetEtaBin(Float_t eta) {
+  
   TAxis testaxis(GetNetaBins(),GetEtaMin(),GetEtaMax());
   Int_t binnumber = testaxis.FindBin(eta) ;
   
@@ -524,6 +526,17 @@ Float_t AliFMDAnaParameters::GetEventSelectionEfficiency(Int_t vtxbin) {
 
 }
 //_____________________________________________________________________
+Float_t AliFMDAnaParameters::GetVtxSelectionEffFromMC() {
+
+   if(!fIsInit) {
+    AliWarning("Not initialized yet. Call Init() to remedy");
+    return 0;
+   }
+   return fEventSelectionEfficiency->GetVtxToTriggerRatio();
+
+
+}
+//_____________________________________________________________________
 TH2F* AliFMDAnaParameters::GetEventSelectionEfficiency(Int_t vtxbin, Char_t ring) {
   //Get event selection efficiency object
   if(!fIsInit) {
index fc273e0..b302a50 100644 (file)
@@ -149,6 +149,7 @@ public:
 
   void     SetNumberOfEtaBinsToCut(Int_t nbins) {fNumberOfEtaBinsToCut = nbins;}
   Int_t    GetNumberOfEtaBinsToCut() const {return fNumberOfEtaBinsToCut;}
+  Float_t  GetVtxSelectionEffFromMC() ;
   
 protected:
   
index ba6794c..19e33b8 100644 (file)
@@ -303,8 +303,8 @@ void AliFMDAnalysisTaskBackgroundCorrection::Exec(Option_t */*option*/)
   hSPDMult->Divide(pars->GetEventSelectionEfficiency(vtxbin,'I'));
   
   //if(pars->GetEventSelectionEfficiency(vtxbin) > 0)
-  // hSPDMult->Scale(1/pars->GetEventSelectionEfficiency(vtxbin));
-    //else
+     // hSPDMult->Scale(1/pars->GetEventSelectionEfficiency(vtxbin));
+  //else
   //  hSPDMult->Scale(0);
   
   }
index d753cc6..abdf4e1 100644 (file)
@@ -176,7 +176,7 @@ void AliFMDAnalysisTaskCollector::UserExec(Option_t */*option*/)
     if(TMath::Abs(vertex[2]) > pars->GetVtxCutZ())
       physics = kFALSE;
   }
-  std::cout<<"Bananer "<<vtxStatus<<"    "<<physics<<std::endl;
+  //std::cout<<"Bananer "<<vtxStatus<<"    "<<physics<<std::endl;
   AliESDFMD* fmd = esd->GetFMDData();
   if (!fmd) return;
   if(physics)
@@ -209,7 +209,8 @@ void AliFMDAnalysisTaskCollector::UserExec(Option_t */*option*/)
          Float_t eta = pars->GetEtaFromStrip(det,ring,sec,strip,vertex[2]);
          
          Int_t nEta  = pars->GetEtaBin(eta);
-         //      std::cout<<det<<"  "<<ring<<"   "<<sec<<"    "<<strip<<"   "<<vertex[2]<<"   "<<eta<<"   "<<nEta<<std::endl;
+         
+         //      std::cout<<det<<"  "<<ring<<"   "<<sec<<"    "<<strip<<"   "<<vertex[2]<<"   "<<eta<<"   "<<nEta<<std::endl;
          if(physics) {
            Edist = (TH1F*)fOutputList->FindObject(Form("FMD%d%c_etabin%d",det,ring,nEta));       
            Edist->Fill(mult);
@@ -281,7 +282,7 @@ void AliFMDAnalysisTaskCollector::ReadFromFile(const Char_t* filename, Bool_t st
   
   EnergyDist->SetNetaBins(pars->GetNetaBins());
   EnergyDist->SetEtaLimits(pars->GetEtaMin(),pars->GetEtaMax());
-    
+  
   TF1* fitFunc = 0;
   
   for(Int_t det = 1; det<=3; det++) {
index 7cc5fab..56dde1b 100644 (file)
@@ -39,7 +39,8 @@ AliFMDAnalysisTaskDndeta::AliFMDAnalysisTaskDndeta()
   fNevents(),
   fNMCevents(),
   fStandalone(kTRUE),
-  fLastTrackByStrip(0)
+  fLastTrackByStrip(0),
+  fVtxEff(1)
 {
   // Default constructor
   DefineInput (0, TList::Class());
@@ -55,7 +56,8 @@ AliFMDAnalysisTaskDndeta::AliFMDAnalysisTaskDndeta(const char* name, Bool_t SE):
     fNevents(),
     fNMCevents(),
     fStandalone(kTRUE),
-    fLastTrackByStrip(0)
+    fLastTrackByStrip(0),
+    fVtxEff(1)
 {
   fStandalone = SE;
   if(fStandalone) {
@@ -156,6 +158,14 @@ void AliFMDAnalysisTaskDndeta::CreateOutputObjects()
     fOutputList->Add(hSPDMultTrVtx);
   }
   
+  //AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
+  
+  TH2F* dNdetadphiHistogramTotal = new TH2F("dNdetadphiHistogramTotal","dNdetadphiHistogram;#eta;#Phi",pars->GetNetaBins(),-6,6,20,0,2*TMath::Pi());
+  //dNdetadphiHistogramTotal->SetErrorOption("g");
+  fOutputList->Add(dNdetadphiHistogramTotal);
+  
+  
+  
   fNevents.SetBins(nVtxbins,0,nVtxbins);
   fNevents.SetName("nEvents");
   fNMCevents.SetBins(nVtxbins,0,nVtxbins);
@@ -210,6 +220,16 @@ void AliFMDAnalysisTaskDndeta::Exec(Option_t */*option*/)
   if(pars->GetProcessPrimary())
     ProcessPrimary();
   
+  TH2F* dNdetadphiHistogram = (TH2F*)fOutputList->FindObject("dNdetadphiHistogramSPDTrVtx");
+  
+  TH2F* dNdetadphiHistogramTotal = (TH2F*)fOutputList->FindObject("dNdetadphiHistogramTotal");
+  
+  if(vtxbin == 4)
+    dNdetadphiHistogramTotal->Add(dNdetadphiHistogram);
+  
+  
+  
+  
   if(fStandalone) {
     PostData(0, fOutputList); 
   }
@@ -229,6 +249,9 @@ void AliFMDAnalysisTaskDndeta::Terminate(Option_t */*option*/) {
       for(Int_t i =0; i<nVtxbins; i++) {
        
        TH2F* hMultTotal = (TH2F*)fOutputList->FindObject(Form("dNdeta_FMD%d%c_vtxbin%d",det,ringChar,i));
+       if(fVtxEff)
+         hMultTotal->Scale(fVtxEff);
+       
        //TH2F* hMultTrVtx = (TH2F*)hMultTotal->Clone(Form("dNdeta_FMD%d%c_TrVtx_vtxbin%d",det,ringChar,i));
        TH2F* hMultTrVtx = (TH2F*)fOutputList->FindObject(Form("dNdetaTrVtx_FMD%d%c_vtxbin%d",det,ringChar,i));
        
@@ -246,6 +269,10 @@ void AliFMDAnalysisTaskDndeta::Terminate(Option_t */*option*/) {
     TH2F* hSPDMult = (TH2F*)fOutputList->FindObject(Form("dNdeta_SPD_vtxbin%d",i));
     TH2F* hSPDMultTrVtx = (TH2F*)fOutputList->FindObject(Form("dNdetaTrVtx_SPD_vtxbin%d",i));
     
+    if(fVtxEff)
+      hSPDMult->Scale(fVtxEff);
+       
+    
     TH1D* hMultProj   = hSPDMult->ProjectionX(Form("dNdeta_SPD_vtxbin%d_proj",i),1,hSPDMult->GetNbinsY());
     TH1D* hMultProjTrVtx   = hSPDMultTrVtx->ProjectionX(Form("dNdetaTrVtx_SPD_vtxbin%d_proj",i),1,hSPDMultTrVtx->GetNbinsY());
    
index d97a4d7..e83a5be 100644 (file)
@@ -30,7 +30,8 @@ class AliFMDAnalysisTaskDndeta : public AliAnalysisTask
                                                               fNevents(o.fNevents),
                                                               fNMCevents(o.fNMCevents),
                                                               fStandalone(o.fStandalone),
-                                                              fLastTrackByStrip(o.fLastTrackByStrip)  {}
+                                                              fLastTrackByStrip(o.fLastTrackByStrip),
+                                                              fVtxEff(o.fVtxEff) {}
   AliFMDAnalysisTaskDndeta& operator=(const AliFMDAnalysisTaskDndeta&) { return *this; }
   // Implementation of interface methods
   virtual void ConnectInputData(Option_t *option = "");
@@ -45,7 +46,8 @@ class AliFMDAnalysisTaskDndeta : public AliAnalysisTask
   void SetOutputList(TList* outputList) {fOutputList = outputList;}
   void ProcessPrimary();
   TList* GetOutputList() {return fOutputList;}
-   
+  void SetVtxEfficiency(Float_t vtxeff) {fVtxEff = vtxeff;}
+  
  private:
   Int_t         fDebug;        //  Debug flag
   TList*        fOutputList;
@@ -55,6 +57,7 @@ class AliFMDAnalysisTaskDndeta : public AliAnalysisTask
   TH1I          fNMCevents;
   Bool_t        fStandalone;
   AliFMDFloatMap fLastTrackByStrip;
+  Float_t        fVtxEff;             //Efficiency of vertex sel.
   ClassDef(AliFMDAnalysisTaskDndeta, 0); // Analysis task for FMD analysis
 };
  
index 78ca938..dbcb80b 100644 (file)
@@ -124,16 +124,22 @@ void AliFMDAnalysisTaskSE::Terminate(Option_t */*option*/)
 {
   
   TList* outputList = (TList*)GetOutputData(1);
+  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
   
   if(outputList) {
     fSharing.SetOutputList(outputList);
     fBackground.SetHitList(outputList);
     fDndeta.SetOutputList(outputList); 
-    fBFCorrelation.SetOutputList(outputList); 
+    //fBFCorrelation.SetOutputList(outputList); 
     fSharing.Terminate("");
     fBackground.Terminate("");
+    if(fSharing.GetVtxEfficiencyFromData() > 0)
+      fDndeta.SetVtxEfficiency(fSharing.GetVtxEfficiencyFromData());
+    else
+      fDndeta.SetVtxEfficiency(pars->GetVtxSelectionEffFromMC());
+    
     fDndeta.Terminate("");
-    fBFCorrelation.Terminate("");
+    //fBFCorrelation.Terminate("");
     
     AliFMDDndeta t;
     t.SetNbinsToCut(2);
index db13264..70a5969 100644 (file)
@@ -87,6 +87,17 @@ AliFMDAnalysisTaskSharing::AliFMDAnalysisTaskSharing(const char* name, Bool_t SE
   }
 }
 //_____________________________________________________________________
+Float_t AliFMDAnalysisTaskSharing::GetVtxEfficiencyFromData(){
+  
+  TH1F* hEventsVtx = (TH1F*)fDiagList->FindObject("hEventsVtx");
+  TH1F* hEventsTr  = (TH1F*)fDiagList->FindObject("hEventsTr");
+  
+  if(hEventsTr->GetEntries() != 0 && hEventsVtx->GetEntries() !=0 && hEventsTr->GetEntries() != hEventsVtx->GetEntries())
+    return hEventsVtx->GetEntries() / hEventsTr->GetEntries();
+  else return -1;
+  
+}
+//_____________________________________________________________________
 void AliFMDAnalysisTaskSharing::CreateOutputObjects()
 {
   // Create the output objects
@@ -244,9 +255,13 @@ fDiagList->Add(hCorrelationFMDSPDhits);
   TH1F*  nMCevents = new TH1F("nMCEventsNoCuts","nMCEventsNoCuts",pars->GetNvtxBins(),0,pars->GetNvtxBins());
   
   fDiagList->Add(nMCevents);
-    
-    
+  
+  TH1F*  hEventsVtx = new TH1F("hEventsVtx","hEventsVtx",pars->GetNvtxBins(),0,pars->GetNvtxBins());
+  TH1F*  hEventsTr  = new TH1F("hEventsTr","hEventsTr",pars->GetNvtxBins(),0,pars->GetNvtxBins());
+  fDiagList->Add(hEventsVtx);
+  fDiagList->Add(hEventsTr);
+  
+  
 }
 //_____________________________________________________________________
 void AliFMDAnalysisTaskSharing::ConnectInputData(Option_t */*option*/)
@@ -286,6 +301,13 @@ void AliFMDAnalysisTaskSharing::Exec(Option_t */*option*/)
   
   
   Bool_t isTriggered = pars->IsEventTriggered(fESD);
+  Double_t delta2 = 2*pars->GetVtxCutZ()/pars->GetNvtxBins();
+  Double_t vertexBinDouble = (vertex[2] + pars->GetVtxCutZ()) / delta2;
+  Int_t vtxbin = (Int_t)vertexBinDouble;
+  TH1F* hEventsVtx = (TH1F*)fDiagList->FindObject("hEventsVtx");
+  TH1F* hEventsTr  = (TH1F*)fDiagList->FindObject("hEventsTr");
+  if(vtxStatus) hEventsVtx->Fill(vtxbin);
+  if(isTriggered) hEventsTr->Fill(vtxbin);
   
   if(!isTriggered || !vtxStatus ) {
     fStatus = kFALSE;
@@ -525,6 +547,7 @@ void AliFMDAnalysisTaskSharing::Exec(Option_t */*option*/)
     PostData(3, fDiagList); 
   }
 }
+
 //_____________________________________________________________________
 Float_t AliFMDAnalysisTaskSharing::GetMultiplicityOfStrip(Float_t mult,
                                                          Float_t eta,
@@ -674,7 +697,9 @@ void AliFMDAnalysisTaskSharing::Terminate(Option_t* /* option*/) {
     hTrEtaDistribution2->Scale(1./(Float_t)hZvtx->GetEntries());
   }
   
-
+  TH1F* hEventsVtx = (TH1F*)fDiagList->FindObject("hEventsVtx");
+  TH1F* hEventsTr  = (TH1F*)fDiagList->FindObject("hEventsTr");
+  //hEventsVtx->Divide(hEventsTr);
   
   
 }
@@ -733,7 +758,7 @@ void AliFMDAnalysisTaskSharing::ProcessPrimary() {
     return;
   }
   */
-  std::cout<<pythiaType<<"   "<<stack->GetNprimary()<<std::endl;
+  //std::cout<<pythiaType<<std::endl;
   
   
   TArrayF vertex;
index bc68e6c..4193f42 100644 (file)
@@ -57,6 +57,7 @@ class AliFMDAnalysisTaskSharing : public AliAnalysisTask
     void SetVertex(AliESDVertex* vertex) {fEsdVertex = vertex;}
     void SetInputESD(AliESDEvent* esd) {fESD = esd;}
     Bool_t GetEventStatus() const {return fStatus;}
+    Float_t GetVtxEfficiencyFromData() ;
  private:
     Float_t Eta2Theta(Float_t eta) const ;
     Double_t EtaFromStrip(UShort_t det, Char_t ring, UShort_t sector, UShort_t strip, Double_t zvtx);