All FMD corrections are now divided into the analysis + adding new corrections
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 Sep 2009 08:37:37 +0000 (08:37 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 Sep 2009 08:37:37 +0000 (08:37 +0000)
FMD/Correction/Background/background_1_0_1_0_0_0.root
FMD/Correction/EnergyDistribution/energydistributions_1_0_1_0_0_0.root
FMD/Correction/EventSelectionEfficiency/eventselectionefficiency_1_0_1_0_0_0.root
FMD/analysis/AliFMDAnalysisTaskDensity.cxx
FMD/analysis/AliFMDAnalysisTaskDndeta.cxx
FMD/analysis/AliFMDAnalysisTaskGenerateCorrection.cxx

index 3293505..bc09847 100644 (file)
Binary files a/FMD/Correction/Background/background_1_0_1_0_0_0.root and b/FMD/Correction/Background/background_1_0_1_0_0_0.root differ
index f3e2f68..ad20ed3 100644 (file)
Binary files a/FMD/Correction/EnergyDistribution/energydistributions_1_0_1_0_0_0.root and b/FMD/Correction/EnergyDistribution/energydistributions_1_0_1_0_0_0.root differ
index 9b402d4..328d751 100644 (file)
Binary files a/FMD/Correction/EventSelectionEfficiency/eventselectionefficiency_1_0_1_0_0_0.root and b/FMD/Correction/EventSelectionEfficiency/eventselectionefficiency_1_0_1_0_0_0.root differ
index 290ca06..966f82e 100644 (file)
@@ -167,11 +167,11 @@ void AliFMDAnalysisTaskDensity::Exec(Option_t */*option*/)
                          
          Float_t phi = pars->GetPhiFromSector(det,ring,sec);
          Float_t eta = pars->GetEtaFromStrip(det,ring,sec,strip,vertex[2]);
-                 
-         Float_t mult_cut = 0.15;//m-2*s;//0.15;//0.2;//m-3*s;// 0.2;//0.01;//m-2*s;//0.2;
-         if(ring == 'I')
-           mult_cut = 0.10;
          
+         Float_t mult_cut = 0.15;//m-2*s;//0.15;//0.2;//m-3*s;// 0.2;//0.01;//m-2*s;//0.2;
+           if(ring == 'I')
+             mult_cut = 0.10;
+         //Float_t mult_cut = pars->GetMPV(det,ring,eta) - 5*pars->GetSigma(det,ring,eta);
          Float_t nParticles = 0;
          if(fESD->GetUniqueID() == kTRUE) {
            //proton + proton
@@ -217,7 +217,7 @@ void AliFMDAnalysisTaskDensity::Exec(Option_t */*option*/)
            TH1F* hDoubleHitCorrection = pars->GetDoubleHitCorrection(det,ring);
            
            if(hDoubleHitCorrection->GetBinContent(hDoubleHitCorrection->FindBin(eta)) != 0)
-             correction = correction / hDoubleHitCorrection->GetBinContent(hDoubleHitCorrection->FindBin(eta));
+             correction = correction*hDoubleHitCorrection->GetBinContent(hDoubleHitCorrection->FindBin(eta));
            
          }
          
index 38e5277..5c488de 100644 (file)
@@ -86,19 +86,20 @@ void AliFMDAnalysisTaskDndeta::CreateOutputObjects()
   hPrimary->Sumw2();
   fOutputList->Add(hPrimary);
   Int_t nVtxbins = pars->GetNvtxBins();
-  
-  
-  for(Int_t det =1; det<=3;det++)
-    {
-      Int_t nRings = (det==1 ? 1 : 2);
-      for(Int_t ring = 0;ring<nRings;ring++)
-       {
-         Char_t ringChar = (ring == 0 ? 'I' : 'O');
-         Int_t  nSec     = (ring == 0 ? 20 : 40);
-         
-         
-         for(Int_t i = 0; i< nVtxbins; i++) {
-           TH2F* hBg = pars->GetBackgroundCorrection(det, ringChar, i);
+  TH2F* hBg = 0;
+  for(Int_t i = 0; i< nVtxbins; i++) {
+     
+    for(Int_t det =1; det<=3;det++)
+      {
+       Int_t nRings = (det==1 ? 1 : 2);
+       for(Int_t ring = 0;ring<nRings;ring++)
+         {
+           Char_t ringChar = (ring == 0 ? 'I' : 'O');
+           Int_t  nSec     = (ring == 0 ? 20 : 40);
+           
+           
+           
+           hBg = pars->GetBackgroundCorrection(det, ringChar, i);
            hMult  = new TH2F(Form("dNdeta_FMD%d%c_vtxbin%d",det,ringChar,i),Form("dNdeta_FMD%d%c_vtxbin%d",det,ringChar,i),
                              hBg->GetNbinsX(),
                              hBg->GetXaxis()->GetXmin(),
@@ -109,17 +110,15 @@ void AliFMDAnalysisTaskDndeta::CreateOutputObjects()
                              hBg->GetNbinsX(),
                              hBg->GetXaxis()->GetXmin(),
                              hBg->GetXaxis()->GetXmax());
-                           
-           
+           hHits->Sumw2();
+           fOutputList->Add(hHits);
            
            hMult->Sumw2();
-           hHits->Sumw2();
            fOutputList->Add(hMult);
-           fOutputList->Add(hHits);
-                   
+           
          }
-       
-    }
+      } 
+  }
   
   for(Int_t i = 0; i< nVtxbins; i++) {
    
@@ -198,7 +197,8 @@ void AliFMDAnalysisTaskDndeta::Terminate(Option_t */*option*/) {
        TH2F* hMultTotal = (TH2F*)fOutputList->FindObject(Form("dNdeta_FMD%d%c_vtxbin%d",det,ringChar,i));
        TH2F* hMultTrVtx = (TH2F*)hMultTotal->Clone(Form("dNdeta_FMD%d%c_TrVtx_vtxbin%d",det,ringChar,i));
        
-       hMultTotal->Scale(pars->GetEventSelectionEfficiency(i));
+       hMultTotal->Scale(1/pars->GetEventSelectionEfficiency(i));
+               
        TH1D* hMultProj   = hMultTotal->ProjectionX(Form("dNdeta_FMD%d%c_vtxbin%d_proj",det,ringChar,i),1,hMultTotal->GetNbinsY());
        TH1D* hMultProjTrVtx   = hMultTrVtx->ProjectionX(Form("dNdeta_FMD%d%c_TrVtx_vtxbin%d_proj",det,ringChar,i),1,hMultTotal->GetNbinsY());
        fOutputList->Add(hMultTrVtx);
@@ -261,6 +261,7 @@ void AliFMDAnalysisTaskDndeta::ProcessPrimary() {
     
     }
     if(pars->GetProcessHits()) {
+           
       for(Int_t j=0; j<particle->GetNumberOfTrackReferences();j++) {
        
        AliTrackReference* ref = particle->GetTrackReference(j);
@@ -275,7 +276,10 @@ void AliFMDAnalysisTaskDndeta::ProcessPrimary() {
          
          Float_t   eta   = pars->GetEtaFromStrip(det,ring,sec,strip,vertex.At(2));//-1*TMath::Log(TMath::Tan(0.5*theta));
          TH1F* hHits = (TH1F*)fOutputList->FindObject(Form("hMCHits_FMD%d%c_vtxbin%d",det,ring,vertexBin));
+         
+       
          hHits->Fill(eta);
+         
          Float_t nstrips = (ring =='O' ? 256 : 512);
          
          fLastTrackByStrip(det,ring,sec,strip) = (Float_t)i;
@@ -286,8 +290,15 @@ void AliFMDAnalysisTaskDndeta::ProcessPrimary() {
            fLastTrackByStrip(det,ring,sec,strip+1) = (Float_t)i;
          
        }
+      
+       
       }
+      
+      
     }
+
+      
+      
   }
 }
 //_____________________________________________________________________
index 0b7cb36..437c8b4 100644 (file)
@@ -270,27 +270,28 @@ void AliFMDAnalysisTaskGenerateCorrection::GenerateCorrection() {
   TH1F* hEventsSelected    = (TH1F*)fListOfHits.FindObject("EventsSelected");
   TH1F* hEventsAll         = (TH1F*)fListOfPrimaries.FindObject("EventsAll");
   
-  //hEventsSelected->Divide(hEventsSelected,hEventsAll,1,1,"B");
+  //  hEventsAll->Divide(hEventsAll,hEventsSelected,1,1,"B");
   
   for(Int_t i = 1; i<=hEventsSelected->GetNbinsX(); i++) {
     if(hEventsSelected->GetBinContent(i) == 0 )
       continue;
-    Float_t a    = hEventsSelected->GetBinContent(i);
-    Float_t da   = hEventsSelected->GetBinError(i);
+    Float_t b    = hEventsSelected->GetBinContent(i);
+    Float_t db   = hEventsSelected->GetBinError(i);
     Float_t sum  = hEventsAll->GetBinContent(i);
     Float_t dsum = hEventsAll->GetBinError(i);
-    Float_t b    = sum-a;
-    Float_t db   = TMath::Sqrt(TMath::Power(da,2) + TMath::Power(dsum,2));
+    Float_t a    = sum-b;
+    Float_t da   = TMath::Sqrt(TMath::Power(db,2) + TMath::Power(dsum,2));
     
-    Float_t cor  = a / sum;
-    Float_t ecor = TMath::Sqrt(TMath::Power(b*da,2) + TMath::Power(a*db,2)) / TMath::Power(sum,2);
+    Float_t cor  = sum / b;
+    Float_t ecor = TMath::Sqrt(TMath::Power(da,2) + TMath::Power(a/(b*db),2)) / b;
     
-    hEventsSelected->SetBinContent(i,cor);
-    hEventsSelected->SetBinError(i,ecor);
+    hEventsAll->SetBinContent(i,cor);
+    hEventsAll->SetBinError(i,ecor);
     
   }
   
-  fEventSelectionEff->SetCorrection(hEventsSelected);
+  fEventSelectionEff->SetCorrection(hEventsAll);
   
   for(Int_t det= 1; det <=3; det++) {
     Int_t nRings = (det==1 ? 1 : 2);
@@ -299,8 +300,10 @@ void AliFMDAnalysisTaskGenerateCorrection::GenerateCorrection() {
       Char_t ring = (iring == 0 ? 'I' : 'O');
       TH1F* allHits = (TH1F*)fListOfHits.FindObject(Form("allHits_FMD%d%c",det,ring));
       TH1F* doubleHits = (TH1F*)fListOfHits.FindObject(Form("DoubleHits_FMD%d%c",det,ring));
-      fBackground->SetDoubleHitCorrection(det,ring,doubleHits);
-      doubleHits->Divide(allHits);
+      allHits->Divide(doubleHits);
+      
+      fBackground->SetDoubleHitCorrection(det,ring,allHits);
+      
       for(Int_t vertexBin=0;vertexBin<fNvtxBins  ;vertexBin++) {
        TH2F* hHits          = (TH2F*)fListOfHits.FindObject(Form("hHits_FMD%d%c_vtx%d", det,ring,vertexBin));
        TH2F* hPrimary  = (TH2F*)fListOfPrimaries.FindObject( Form("hPrimary_FMD_%c_vtx%d",ring,vertexBin));