]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
changed binning: accepts events in z +- 30cm and eta +- 3
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 May 2008 15:05:20 +0000 (15:05 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 May 2008 15:05:20 +0000 (15:05 +0000)
new zero bin correction

PWG0/AliCorrection.cxx
PWG0/dNdEta/AlidNdEtaCorrectionTask.cxx
PWG0/dNdEta/AlidNdEtaTask.cxx
PWG0/dNdEta/AlidNdEtaTask.h
PWG0/dNdEta/dNdEtaAnalysis.cxx
PWG0/dNdEta/dNdEtaAnalysis.h
PWG0/dNdEta/drawPlots.C
PWG0/dNdEta/run.C

index 9b821edc69934c9c7cb692cb6526e16256b44533..f4f3422903621fc4f65298c694e7fffddbe37c1e 100644 (file)
@@ -62,14 +62,20 @@ AliCorrection::AliCorrection(const Char_t* name, const Char_t* title, AliPWG0Hel
   Float_t binLimitsN[]   = {-0.5, 0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 12.5, 14.5, 16.5, 18.5, 20.5, 25.5, 30.5, 40.5, 50.5, 100.5, 300.5};
   //Float_t binLimitsVtx[] = {-20,-15,-10,-6,-3,0,3,6,10,15,20};
   //Float_t binLimitsVtx[] = {-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
-  Float_t binLimitsVtx[] = {-20,-15,-10,-8,-6,-4,-2,0,2,4,6,8,10,15,20};
-  Float_t binLimitsEta[] = {-2,-1.8,-1.6,-1.4,-1.2,-1.0,-0.8,-0.6,-0.4,-0.2,0.0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,2.0};
+  Float_t binLimitsVtx[] = {-30,-25,-20,-15,-10,-8,-6,-4,-2,0,2,4,6,8,10,15,20,25,30};
+  Float_t binLimitsEta[] = {-3.0,-2.8,-2.6,-2.4,-2.2,
+                            -2.0,-1.8,-1.6,-1.4,-1.2,
+                            -1.0,-0.8,-0.6,-0.4,-0.2, 0.0,
+                             0.2, 0.4, 0.6, 0.8, 1.0,
+                             1.2, 1.4, 1.6, 1.8, 2.0,
+                             2.2, 2.4, 2.6, 2.8, 3.0};
+//  Float_t binLimitsEta[] = {-2,-1.8,-1.6,-1.4,-1.2,-1.0,-0.8,-0.6,-0.4,-0.2,0.0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,2.0};
 //  Float_t binLimitsEta[] = {-2,-1.9,-1.8,-1.7,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1,-1.0,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0};
 //  Float_t binLimitsEta[] = { -7.0, -6.9, -6.8, -6.7, -6.6, -6.5, -6.4, -6.3, -6.2, -6.1, -6.0, -5.9, -5.8, -5.7, -5.6, -5.5, -5.4, -5.3, -5.2, -5.1, -5.0, -4.9, -4.8, -4.7, -4.6, -4.5, -4.4, -4.3, -4.2, -4.1, -4.0, -3.9, -3.8, -3.7, -3.6, -3.5, -3.4, -3.3, -3.2, -3.1, -3.0, -2.9, -2.8, -2.7, -2.6, -2.5, -2.4, -2.3, -2.2, -2.1, -2.0, -1.9, -1.8, -1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, -0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0 };
 
-  TH3F* dummyBinning = new TH3F("dummyBinning","dummyBinning",14, binLimitsVtx, 20, binLimitsEta , nBinsPt, binLimitsPt);
+  TH3F* dummyBinning = new TH3F("dummyBinning","dummyBinning",18, binLimitsVtx, 30, binLimitsEta , nBinsPt, binLimitsPt);
 
-  fEventCorr = new AliCorrectionMatrix2D("EventCorrection", Form("%s EventCorrection", fTitle.Data()), 14, binLimitsVtx, 22, binLimitsN);
+  fEventCorr = new AliCorrectionMatrix2D("EventCorrection", Form("%s EventCorrection", fTitle.Data()), 18, binLimitsVtx, 22, binLimitsN);
   fTrackCorr = new AliCorrectionMatrix3D("TrackCorrection", Form("%s TrackCorrection", fTitle.Data()), dummyBinning);
 
   delete dummyBinning;
index 11b771769a85a1350bd5a6e631dfeb3202b6c574..1e45d55e8bddc8aff93407c61ded6c566dc04f12 100644 (file)
@@ -103,18 +103,17 @@ void AlidNdEtaCorrectionTask::ConnectInputData(Option_t *)
     Printf("ERROR: Could not read tree from input slot 0");
   } else {
     // Disable all branches and enable only the needed ones
-    //tree->SetBranchStatus("*", 0);
+    tree->SetBranchStatus("*", 0);
 
-    tree->SetBranchStatus("fTriggerMask", 1);
-    tree->SetBranchStatus("fSPDVertex*", 1);
-    // PrimaryVertex
+    tree->SetBranchStatus("AliESDHeader.*", 1);
+    tree->SetBranchStatus("*Vertex*", 1);
 
     if (fAnalysisMode == AliPWG0Helper::kSPD)
-      tree->SetBranchStatus("fSPDMult*", 1);
+      tree->SetBranchStatus("AliMultiplicity*", 1);
 
     if (fAnalysisMode == AliPWG0Helper::kTPC || fAnalysisMode == AliPWG0Helper::kTPCITS) {
-      AliESDtrackCuts::EnableNeededBranches(tree);
-      tree->SetBranchStatus("fTracks.fLabel", 1);
+      //AliESDtrackCuts::EnableNeededBranches(tree);
+      tree->SetBranchStatus("Tracks*", 1);
     }
 
     AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
@@ -292,7 +291,7 @@ void AlidNdEtaCorrectionTask::Exec(Option_t*)
     Double_t diff = vtxMC[2] - vtx[2];
     if (vtxESD->GetZRes() > 0) 
       fVertexShiftNorm->Fill(diff / vtxESD->GetZRes());
-  } 
+  }
   else
     Printf("No vertex found");
 
@@ -300,7 +299,7 @@ void AlidNdEtaCorrectionTask::Exec(Option_t*)
   Int_t biny = (Int_t) eventTriggered + 2 * (Int_t) eventVertex;
   // INEL
   fEventStats->Fill(0.0, biny);
-  // NDS
+  // NSD
   if (processType != 92 && processType != 93)
     fEventStats->Fill(1.0, biny);
   
index e6ae1748a17bd1800539e6b62177331c6de90ae1..609961af7fe708532217e80c3fc4f5385239894c 100644 (file)
@@ -69,6 +69,8 @@ AlidNdEtaTask::AlidNdEtaTask(const char* opt) :
   // Define input and output slots here
   DefineInput(0, TChain::Class());
   DefineOutput(0, TList::Class());
+
+  AliLog::SetClassDebugLevel("AlidNdEtaTask", AliLog::kWarning);
 }
 
 AlidNdEtaTask::~AlidNdEtaTask()
@@ -86,6 +88,14 @@ AlidNdEtaTask::~AlidNdEtaTask()
   }
 }
 
+Bool_t AlidNdEtaTask::Notify()
+{
+  static Int_t count = 0;
+  count++;
+  Printf("Processing %d. file", count);
+  return kTRUE;
+}
+
 //________________________________________________________________________
 void AlidNdEtaTask::ConnectInputData(Option_t *)
 {
@@ -94,33 +104,33 @@ void AlidNdEtaTask::ConnectInputData(Option_t *)
 
   Printf("AlidNdEtaTask::ConnectInputData called");
 
-  TTree* tree = dynamic_cast<TTree*> (GetInputData(0));
-  if (!tree) {
-    Printf("ERROR: Could not read tree from input slot 0");
+  AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+
+  if (!esdH) {
+    Printf("ERROR: Could not get ESDInputHandler");
   } else {
-    // Disable all branches and enable only the needed ones
-    //tree->SetBranchStatus("*", 0);
+    fESD = esdH->GetEvent();
 
-    tree->SetBranchStatus("TriggerMask", 1);
-    tree->SetBranchStatus("SPDVertex*", 1);
-    tree->SetBranchStatus("PrimaryVertex*", 1);
-    tree->SetBranchStatus("TPCVertex*", 1);
+    TTree* tree = esdH->GetTree();
+    if (!tree) {
+      Printf("ERROR: Could not read tree");
+    } else {
+      // Disable all branches and enable only the needed ones
+      tree->SetBranchStatus("*", 0);
 
-    if (fAnalysisMode == AliPWG0Helper::kSPD) {
-      tree->SetBranchStatus("AliMultiplicity*", 1);
-    }
+      tree->SetBranchStatus("AliESDHeader*", 1);
+      tree->SetBranchStatus("*Vertex*", 1);
 
-    if (fAnalysisMode == AliPWG0Helper::kTPC || fAnalysisMode == AliPWG0Helper::kTPCITS) {
-      //AliESDtrackCuts::EnableNeededBranches(tree);
-      tree->SetBranchStatus("Tracks*", 1);
-    }
+      if (fAnalysisMode == AliPWG0Helper::kSPD) {
+        tree->SetBranchStatus("AliMultiplicity*", 1);
+      }
 
-    AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+      if (fAnalysisMode == AliPWG0Helper::kTPC || fAnalysisMode == AliPWG0Helper::kTPCITS) {
+        //AliESDtrackCuts::EnableNeededBranches(tree);
+        tree->SetBranchStatus("Tracks*", 1);
+      }
 
-    if (!esdH) {
-      Printf("ERROR: Could not get ESDInputHandler");
-    } else
-      fESD = esdH->GetEvent();
+    }
   }
 
   // disable info messages of AliMCEvent (per event)
@@ -317,7 +327,7 @@ void AlidNdEtaTask::Exec(Option_t*)
       ++inputCount;
     }
 
-    Printf("Accepted %d tracklets", inputCount);
+    //Printf("Accepted %d tracklets", inputCount);
   }
   else if (fAnalysisMode == AliPWG0Helper::kTPC || fAnalysisMode == AliPWG0Helper::kTPCITS)
   {
@@ -426,6 +436,12 @@ void AlidNdEtaTask::Exec(Option_t*)
 
     // get the MC vertex
     AliGenEventHeader* genHeader = header->GenEventHeader();
+    if (!genHeader)
+    {
+      AliDebug(AliLog::kError, "Could not retrieve genHeader from Header");
+      return;
+    }
+
     TArrayF vtxMC(3);
     genHeader->PrimaryVertex(vtxMC);
 
index 8799a57f9f3698cb28ccf3d5a726ec82d92c3762..8c40dd006a843bb6e4fd65b9494fd546f1c08653 100644 (file)
@@ -22,6 +22,7 @@ class AlidNdEtaTask : public AliAnalysisTask {
     virtual void   CreateOutputObjects();
     virtual void   Exec(Option_t*);
     virtual void   Terminate(Option_t*);
+    virtual Bool_t   Notify();
 
     void SetTrackCuts(AliESDtrackCuts* cuts) { fEsdTrackCuts = cuts; }
     void SetAnalysisMode(AliPWG0Helper::AnalysisMode mode) { fAnalysisMode = mode; }
index 2c629b0c7d1e1beadd6dfd487ddeb4e5a4ec139d..63d084842ad68b927db8da08398596b4060cb450 100644 (file)
@@ -53,9 +53,6 @@ dNdEtaAnalysis::dNdEtaAnalysis(Char_t* name, Char_t* title, AliPWG0Helper::Analy
 {
   // constructor
 
-  // TODO this binning has to be the same than in AliCorrection, somehow passed?!
-  Float_t binLimitsPt[] = {0.0, 0.05, 0.1, 0.125, 0.15, 0.175, 0.2, 0.225, 0.25, 0.275, 0.3, 0.325, 0.35, 0.375, 0.4, 0.425, 0.45, 0.475, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.5, 2.0, 5.0, 10.0, 100.0};
-
   fData = new AliCorrection("Analysis", Form("%s Analysis", title), analysisMode);
 
   // do not add this hists to the directory
@@ -64,8 +61,8 @@ dNdEtaAnalysis::dNdEtaAnalysis(Char_t* name, Char_t* title, AliPWG0Helper::Analy
 
   fMult = new TH1F("TriggeredMultiplicity", "Triggered Events;raw multiplicity;entries", 1000, -0.5, 999.5);
 
-  // TODO get binning from AliCorrection
-  fdNdEta[0] = new TH1F("dNdEta", "dN_{ch}/d#eta;#eta;dN_{ch}/d#eta", 20, -2, 2);
+  TH1* histForBinning = fData->GetTrackCorrection()->GetGeneratedHistogram();
+  fdNdEta[0] = new TH1F("dNdEta", "dN_{ch}/d#eta;#eta;dN_{ch}/d#eta", histForBinning->GetNbinsY(), histForBinning->GetYaxis()->GetXbins()->GetArray());
 
   fdNdEtaPtCutOffCorrected[0] = dynamic_cast<TH1F*> (fdNdEta[0]->Clone(Form("%s_corrected", fdNdEta[0]->GetName())));
 
@@ -75,7 +72,7 @@ dNdEtaAnalysis::dNdEtaAnalysis(Char_t* name, Char_t* title, AliPWG0Helper::Analy
     fdNdEtaPtCutOffCorrected[i]    = dynamic_cast<TH1F*> (fdNdEtaPtCutOffCorrected[0]->Clone(Form("%s_%d", fdNdEtaPtCutOffCorrected[0]->GetName(), i)));
   }
 
-  fPtDist = new TH1F("Pt", "p_{T} distribution;p_{T} [GeV/c];#frac{dN}{d#eta dp_{T}} [c/GeV]", 28, binLimitsPt);
+  fPtDist = new TH1F("Pt", "p_{T} distribution;p_{T} [GeV/c];#frac{dN}{d#eta dp_{T}} [c/GeV]", histForBinning->GetNbinsZ(), histForBinning->GetZaxis()->GetXbins()->GetArray());
 
   TH1::AddDirectory(oldStatus);
 }
@@ -254,6 +251,8 @@ void dNdEtaAnalysis::Finish(AlidNdEtaCorrection* correction, Float_t ptCut, Alid
   else
     printf("INFO: No correction applied\n");
 
+  TH2F* rawMeasured = (TH2F*) fData->GetEventCorrection()->GetMeasuredHistogram()->Clone("rawMeasured");
+
   fData->Multiply();
 
   if (correctionType >= AlidNdEtaCorrection::kVertexReco)
@@ -264,13 +263,17 @@ void dNdEtaAnalysis::Finish(AlidNdEtaCorrection* correction, Float_t ptCut, Alid
     //     triggered events without vertex and 0 multiplicity at a given vertex position = alpha * all triggered events with 0 multiplicity
     //   afterwards we still correct for the trigger efficiency
 
-    TH2* measuredEvents = fData->GetEventCorrection()->GetMeasuredHistogram();
+    //TH2* measuredEvents = fData->GetEventCorrection()->GetMeasuredHistogram();
     TH2* correctedEvents = fData->GetEventCorrection()->GetGeneratedHistogram();
 
+    TH2* eTrig =    correction->GetVertexRecoCorrection()->GetEventCorrection()->GetGeneratedHistogram();
+    TH2* eTrigVtx = correction->GetVertexRecoCorrection()->GetEventCorrection()->GetMeasuredHistogram();
+    TH1* eTrigVtx_projx = eTrigVtx->ProjectionX("eTrigVtx_projx", 2, rawMeasured->GetNbinsY()+1);
+
     //new TCanvas; correctedEvents->DrawCopy("TEXT");
 
     // start above 0 mult. bin with integration
-    TH1* vertexDist = measuredEvents->ProjectionX("vertexdist_measured", 2, measuredEvents->GetNbinsY()+1);
+    TH1* vertexDist = rawMeasured->ProjectionX("vertexdist_measured", 2, rawMeasured->GetNbinsY()+1);
     //new TCanvas; vertexDist->DrawCopy();
 
     Int_t allEventsWithVertex = (Int_t) vertexDist->Integral(0, vertexDist->GetNbinsX()+1); // include under/overflow!
@@ -278,15 +281,23 @@ void dNdEtaAnalysis::Finish(AlidNdEtaCorrection* correction, Float_t ptCut, Alid
 
     Printf("%d triggered events with 0 mult. -- %d triggered events with vertex", triggeredEventsWith0Mult, allEventsWithVertex);
 
-    for (Int_t i = 1; i <= measuredEvents->GetNbinsX(); i++)
+    for (Int_t i = 1; i <= rawMeasured->GetNbinsX(); i++)
     {
       Double_t alpha = (Double_t) vertexDist->GetBinContent(i) / allEventsWithVertex;
       Double_t events = alpha * triggeredEventsWith0Mult;
 
+      if (eTrigVtx_projx->GetBinContent(i) == 0)
+        continue;
+
+      Double_t fZ = eTrigVtx_projx->Integral(0, eTrigVtx_projx->GetNbinsX()+1) / eTrigVtx_projx->GetBinContent(i) *
+        eTrig->GetBinContent(i, 1) / eTrig->Integral(0, eTrig->GetNbinsX()+1, 1, 1);
+
+      events *= fZ;
+
       // multiply with trigger correction if set above
       events *= fData->GetEventCorrection()->GetCorrectionHistogram()->GetBinContent(i, 1);
 
-      Printf("Bin %d, alpha is %.2f, number of events with 0 mult.: %.2f", i, alpha * 100., events);
+      Printf("Bin %d, alpha is %.2f, fZ is %.3f, number of events with 0 mult.: %.2f", i, alpha * 100., fZ, events);
 
       correctedEvents->SetBinContent(i, 1, events);
     }
@@ -361,11 +372,15 @@ void dNdEtaAnalysis::Finish(AlidNdEtaCorrection* correction, Float_t ptCut, Alid
     return;
   }
 
-  const Float_t vertexRangeBegin[kVertexBinning] = { -9.99, -9.99, 0 };
-  const Float_t vertexRangeEnd[kVertexBinning]   = { 9.99,  0,     9.99 };
+  // clear result histograms
+  for (Int_t vertexPos=0; vertexPos<kVertexBinning; ++vertexPos)
+  {
+    fdNdEta[vertexPos]->Reset();
+    fdNdEtaPtCutOffCorrected[vertexPos]->Reset();
+  }
 
-  // TODO acceptance range binning-independent; only for SPD
-  const Int_t binBegin[20] = { 11, 10, 9, 7, 5, 4, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1 };
+  const Float_t vertexRangeBegin[kVertexBinning] = { -9.99,  -9.99,  0.01 };
+  const Float_t vertexRangeEnd[kVertexBinning]   = {  9.99,  -0.01,  9.99 };
 
   for (Int_t iEta=1; iEta<=vtxVsEta->GetNbinsY(); iEta++)
   {
@@ -375,19 +390,31 @@ void dNdEtaAnalysis::Finish(AlidNdEtaCorrection* correction, Float_t ptCut, Alid
       Int_t vertexBinBegin = vertexHist->GetXaxis()->FindBin(vertexRangeBegin[vertexPos]);
       Int_t vertexBinEnd   = vertexHist->GetXaxis()->FindBin(vertexRangeEnd[vertexPos]);
 
-      // adjust acceptance range
-
+      // adjust acceptance range for SPD
       if (fAnalysisMode == AliPWG0Helper::kSPD)
       {
-        //printf("Eta bin: %d Vertex range: %d; before: %d %d ", iEta, vertexPos, vertexBinBegin, vertexBinEnd);
-        vertexBinBegin = TMath::Max(vertexBinBegin, binBegin[iEta - 1]);
-        vertexBinEnd =   TMath::Min(vertexBinEnd, 15 - binBegin[20 - iEta]);
+        //const Int_t binBegin[20] = { 11, 10, 9, 7, 5, 4, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1 };
+        const Int_t binBegin[30] = { 18, 16, 15, 14, 13, 13, 12, 11, 9, 7, 6, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 1 };
+
+        Int_t vtxBegin = binBegin[iEta - 1];
+        Int_t vtxEnd   = 18 + 1 - binBegin[30 - iEta];
+
+        //Float_t eta = vtxVsEta->GetYaxis()->GetBinCenter(iEta);
+        //Printf("%d %d | %d %d", vtxBegin, vertexHist->GetXaxis()->FindBin(GetVtxMin(eta)), vtxEnd, vertexHist->GetXaxis()->FindBin(-GetVtxMin(-eta)));
+        //vtxBegin = vertexHist->GetXaxis()->FindBin(GetVtxMin(eta));
+        //vtxEnd = vertexHist->GetXaxis()->FindBin(-GetVtxMin(-eta));
+        //printf("Eta bin: %d (%f) Vertex range: %d; before: %d %d ", iEta, eta, vertexPos, vertexBinBegin, vertexBinEnd);
+        vertexBinBegin = TMath::Max(vertexBinBegin, vtxBegin);
+        vertexBinEnd =   TMath::Min(vertexBinEnd, vtxEnd);
         //Printf("after:  %d %d", vertexBinBegin, vertexBinEnd);
       }
 
       // no data for this bin
       if (vertexBinBegin > vertexBinEnd)
+      {
+        //Printf("Bin empty. Skipped");
         continue;
+      }
 
       Float_t totalEvents = vertexHist->Integral(vertexBinBegin, vertexBinEnd);
       if (totalEvents == 0)
@@ -399,7 +426,7 @@ void dNdEtaAnalysis::Finish(AlidNdEtaCorrection* correction, Float_t ptCut, Alid
       Float_t sum = 0;
       Float_t sumError2 = 0;
       for (Int_t iVtx = vertexBinBegin; iVtx <= vertexBinEnd; iVtx++)
-      {      
+      {
         if (vtxVsEta->GetBinContent(iVtx, iEta) != 0)
         {
           sum = sum + vtxVsEta->GetBinContent(iVtx, iEta);
@@ -441,12 +468,43 @@ void dNdEtaAnalysis::Finish(AlidNdEtaCorrection* correction, Float_t ptCut, Alid
         fdNdEtaPtCutOffCorrected[vertexPos]->SetBinContent(bin, dndeta);
         fdNdEtaPtCutOffCorrected[vertexPos]->SetBinError(bin, error);
 
-        //Printf("Bin %d has dN/deta = %f", bin, dndeta);
+        //Printf("Bin %d has dN/deta = %f +- %f; %f +- %f", bin, dndeta, error, fdNdEta[vertexPos]->GetBinContent(bin), fdNdEta[vertexPos]->GetBinError(bin));
       }
     }
   }
 }
 
+//____________________________________________________________________
+Float_t dNdEtaAnalysis::GetVtxMin(Float_t eta)
+{
+  // helper function for the SPD acceptance
+  // the function returns the beginning of the acceptance window in z vertex position as function of eta
+  // to get the maximum: -GetVtxMin(-eta)
+
+  Float_t a[2] = { -15, 0 };
+  Float_t b[2] = { 0, -1.4 };
+  Float_t c[2] = { 15, -2.2 };
+
+  Float_t meanAB[2];
+  meanAB[0] = (b[0] + a[0]) / 2;
+  meanAB[1] = (b[1] + a[1]) / 2;
+
+  Float_t meanBC[2];
+  meanBC[0] = (c[0] + b[0]) / 2;
+  meanBC[1] = (c[1] + b[1]) / 2;
+
+  Float_t mAB = (b[1] - a[1]) / (b[0] - a[0]);
+  Float_t mBC = (c[1] - b[1]) / (c[0] - b[0]);
+
+  Float_t bAB = meanAB[1] - mAB * meanAB[0];
+  Float_t bBC = meanBC[1] - mBC * meanBC[0];
+
+  if (eta > b[1])
+    return 1.0 / mAB * eta - bAB / mAB;
+
+  return 1.0 / mBC * eta - bBC / mBC;
+}
+
 //____________________________________________________________________
 void dNdEtaAnalysis::SaveHistograms()
 {
@@ -678,3 +736,5 @@ Long64_t dNdEtaAnalysis::Merge(TCollection* list)
 
   return count+1;
 }
+
+
index 3beb01cbce69a646feca94ac37ea74a98cdc6501..bebc840d1d1c2a35a190e2dc795b2c29e90a6f01 100644 (file)
@@ -60,6 +60,8 @@ public:
   TH1F* GetdNdEtaPtCutOffCorrectedHistogram(Int_t i = 0) { return fdNdEtaPtCutOffCorrected[i]; }
 
 protected:
+  Float_t GetVtxMin(Float_t eta);
+
   AliCorrection* fData;     // we store the data in an AliCorrection
   TH1F* fMult;              // (raw) multiplicity distribution of triggered events
 
index b08607b9aa60bd6dd397094a051392ae8d6bc33b..516a30f533bb3b26187f825ab896d4e22c42202c 100644 (file)
@@ -518,7 +518,7 @@ void dNdEta(Bool_t onlyESD = kFALSE, Bool_t save = kTRUE)
   pad2->cd();
   pad2->SetBottomMargin(0.15);
 
-  Float_t minR = TMath::Min(0.961, ratio->GetMinimum() * 0.95);
+  Float_t minR = 0.9; //TMath::Min(0.961, ratio->GetMinimum() * 0.95);
   Float_t maxR = TMath::Max(1.049, ratio->GetMaximum() * 1.05);
 
   TH1F dummy3("dummy3", ";#eta;Ratio: MC / ESD", 100, -etaPlotLimit, etaPlotLimit);
@@ -1718,3 +1718,19 @@ void DrawTrackletOrigin()
     Printf("");
   }
 }
+
+void DetermineAcceptance(const char* fileName = "correction_map.root", const char* dirName = "dndeta_correction")
+{
+  loadlibs();
+
+  TFile::Open(fileName);
+
+  AlidNdEtaCorrection* dNdEtaCorrection = new AlidNdEtaCorrection(dirName, dirName);
+  if (!dNdEtaCorrection->LoadHistograms())
+    return;
+
+  hist = dNdEtaCorrection->GetTrack2ParticleCorrection()->GetTrackCorrection()->GetCorrectionHistogram();
+
+  proj = hist->Project3D("yx");
+
+}
index 22758e10ae06eb01ec76bb5c7d6412f55f1d7172..7676fe7c6b443d94da9e7db503ebe30849110dac 100644 (file)
@@ -38,17 +38,24 @@ void run(Int_t runWhat, const Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool
     //gProof->SetParallel(1);
 
     // Enable the needed package
-    /*gProof->UploadPackage("STEERBase");
-    gProof->EnablePackage("STEERBase");
-    gProof->UploadPackage("ESD");
-    gProof->EnablePackage("ESD");
-    gProof->UploadPackage("AOD");
-    gProof->EnablePackage("AOD");
-    gProof->UploadPackage("ANALYSIS");
-    gProof->EnablePackage("ANALYSIS");*/
-
-    gProof->UploadPackage("$ALICE_ROOT/AF-v4-12");
-    gProof->EnablePackage("$ALICE_ROOT/AF-v4-12");
+    if (1)
+    {
+      gProof->UploadPackage("$ALICE_ROOT/STEERBase");
+      gProof->EnablePackage("$ALICE_ROOT/STEERBase");
+      gProof->UploadPackage("$ALICE_ROOT/ESD");
+      gProof->EnablePackage("$ALICE_ROOT/ESD");
+      gProof->UploadPackage("$ALICE_ROOT/AOD");
+      gProof->EnablePackage("$ALICE_ROOT/AOD");
+      gProof->UploadPackage("$ALICE_ROOT/ANALYSIS");
+      gProof->EnablePackage("$ALICE_ROOT/ANALYSIS");
+      gProof->UploadPackage("$ALICE_ROOT/ANALYSISalice");
+      gProof->EnablePackage("$ALICE_ROOT/ANALYSISalice");
+    }
+    else
+    {
+      gProof->UploadPackage("$ALICE_ROOT/AF-v4-12");
+      gProof->EnablePackage("$ALICE_ROOT/AF-v4-12");
+    }
 
     gProof->UploadPackage("$ALICE_ROOT/PWG0base");
     gProof->EnablePackage("$ALICE_ROOT/PWG0base");
@@ -128,6 +135,7 @@ void run(Int_t runWhat, const Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool
 
   // Add ESD handler
   AliESDInputHandler* esdH = new AliESDInputHandler;
+  //esdH->SetInactiveBranches("*");
   mgr->SetInputEventHandler(esdH);
 
   // Attach input
@@ -193,6 +201,7 @@ void FinishAnalysisAll(const char* dataInput = "analysis_esd_raw.root", const ch
     return;
   }
 
+    // Note: the last parameter does not define which analysis is going to happen, the histograms will be overwritten when loading from the f
   dNdEtaAnalysis* fdNdEtaAnalysis = new dNdEtaAnalysis("dndetaNSD", "dndetaNSD");
   fdNdEtaAnalysis->LoadHistograms("fdNdEtaAnalysisESD");
   fdNdEtaAnalysis->Finish(dNdEtaCorrection, 0.3, AlidNdEtaCorrection::kNSD, "ESD -> NSD");