Upgrades and fixes of warnings from FC
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Mar 2010 13:14:25 +0000 (13:14 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Mar 2010 13:14:25 +0000 (13:14 +0000)
PWG2/FORWARD/analysis/AliFMDAnaParameters.cxx
PWG2/FORWARD/analysis/AliFMDAnaParameters.h
PWG2/FORWARD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx
PWG2/FORWARD/analysis/AliFMDAnalysisTaskCollector.cxx
PWG2/FORWARD/analysis/AliFMDAnalysisTaskGenerateCorrection.cxx
PWG2/FORWARD/analysis/AliFMDAnalysisTaskSE.cxx
PWG2/FORWARD/analysis/AliFMDAnalysisTaskSharing.cxx
PWG2/FORWARD/analysis/AliFMDDndeta.cxx
PWG2/FORWARD/analysis/AliFMDDndeta.h

index 786c372..c5ac7d7 100644 (file)
@@ -87,7 +87,8 @@ AliFMDAnaParameters::AliFMDAnaParameters() :
   fRealData(kFALSE),
   fSPDlowLimit(0),
   fSPDhighLimit(999999999),
-  fCentralSelection(kFALSE)
+  fCentralSelection(kFALSE),
+  fSharingObjectPresent(kTRUE)
 {
   // Default constructor 
   fPhysicsSelection = new AliPhysicsSelection;
@@ -209,12 +210,19 @@ void AliFMDAnaParameters::InitEventSelectionEff() {
 
 void AliFMDAnaParameters::InitSharingEff() {
   
+  fSharingObjectPresent = kTRUE;
   TFile* fin = TFile::Open(GetPath(fgkSharingEffID));
                            
-  if (!fin) return;
+  if (!fin) {
+    fSharingObjectPresent = kFALSE;
+    return; 
+  }
   
   fSharingEfficiency = dynamic_cast<AliFMDAnaCalibSharingEfficiency*>(fin->Get(fgkSharingEffID));
-  if (!fSharingEfficiency) AliFatal("Invalid background object from CDB");
+  if (!fSharingEfficiency) {
+    fSharingObjectPresent = kFALSE;
+    return; 
+  }
   
 }
 //____________________________________________________________________
@@ -620,7 +628,7 @@ Bool_t AliFMDAnaParameters::GetVertex(const AliESDEvent* esd, Double_t* vertexXY
     
   //if(vertexXYZ[0] == 0 || vertexXYZ[1] == 0 )
   //  return kFALSE;
-  
   if(vertex->GetNContributors() <= 0)
     return kFALSE;
   
@@ -664,19 +672,20 @@ Bool_t AliFMDAnaParameters::IsEventTriggered(const AliESDEvent *esd) const {
   
   //REMOVE WHEN FINISHED PLAYING WITH TRIGGERS!
   //fPhysicsSelection->IsCollisionCandidate(esd);
-  
-  
+  if(!fRealData) {
+    fPhysicsSelection->SetAnalyzeMC(kTRUE);
+  }
   switch (fTrigger) {
   case kMB1: {
-    if(fRealData) {
+    // if(fRealData) {
       if( fPhysicsSelection->IsCollisionCandidate(esd))
        return kTRUE;
-    }
-    else {
-      if (triggerMask & spdFO || ((triggerMask & v0left) || (triggerMask & v0right)))
-       return kTRUE;
+      //}
+      //else {
+      // if (triggerMask & spdFO || ((triggerMask & v0left) || (triggerMask & v0right)))
+      //       return kTRUE;
       break;
-    }
+      //}
   }
   case kMB2: { 
     if (triggerMask & spdFO && ((triggerMask & v0left) || (triggerMask & v0right)))
index 7f4cdf6..b932da3 100644 (file)
@@ -63,7 +63,7 @@ public:
   
   enum Trigger { kMB1 = 0, kMB2, kSPDFASTOR, kNOCTP, kEMPTY };
   
-  enum Energy { k900 , k10000, k14000 , k7000, k2400};
+  enum Energy { k900 , k10000, k14000 , k7000, k2400, k5500};
   
   enum MagField {k0G, k5G};
   
@@ -123,6 +123,7 @@ public:
   void     SetMagField(MagField magfield) {fMagField = magfield;}
   char*    GetPath(const char* species);
   void     SetCollisionSystem(Species collsystem) {fSpecies = collsystem;}
+  Species  GetCollisionSystem() const {return fSpecies;}
   void     PrintStatus() const;
   void     Print(Option_t* /* option */) const { PrintStatus(); }
   char*    GetDndetaAnalysisName() const {return "PWG2forwardDnDeta";}
@@ -137,6 +138,7 @@ public:
   void     SetLowSPDLimit(Float_t cut) {fSPDlowLimit = cut;}
   void     SetHighSPDLimit(Float_t cut) {fSPDhighLimit = cut;}
   void     SetCentralTriggerSelection(Bool_t selection) {fCentralSelection = selection;}
+  Bool_t   SharingEffPresent() {return fSharingObjectPresent;}
 protected:
   
   AliFMDAnaParameters(const AliFMDAnaParameters& o) 
@@ -162,7 +164,8 @@ protected:
       fRealData(o.fRealData),
       fSPDlowLimit(o.fSPDlowLimit),
       fSPDhighLimit(o.fSPDhighLimit),   
-      fCentralSelection(o.fCentralSelection)
+      fCentralSelection(o.fCentralSelection),
+      fSharingObjectPresent(o.fSharingObjectPresent)
   {}
   AliFMDAnaParameters& operator=(const AliFMDAnaParameters&) { return *this; }
   virtual ~AliFMDAnaParameters() {}
@@ -212,7 +215,7 @@ protected:
   Float_t  fSPDlowLimit ;             // low limit of SPD tracklets
   Float_t  fSPDhighLimit ;             // high limit of SPD tracklets
   Bool_t   fCentralSelection;         //if event selection is done centrally
-  
+  Bool_t   fSharingObjectPresent ;    //Do we have a sharing object ? 
   ClassDef(AliFMDAnaParameters,1) // Manager of parameters
 };
 
index a6c15b3..48d7659 100644 (file)
@@ -187,34 +187,38 @@ void AliFMDAnalysisTaskBackgroundCorrection::Exec(Option_t */*option*/)
       hMultTrVtx->Divide(hBg);//,"B");
 
       //sharing efficiency correction ?
+      if(pars->SharingEffPresent()) {
+       TH1F* hSharingEff = pars->GetSharingEfficiency(det,ringChar,vtxbin);
+       TH1F* hSharingEffTrVtx = pars->GetSharingEfficiencyTrVtx(det,ringChar,vtxbin);  
       
-      TH1F* hSharingEff = pars->GetSharingEfficiency(det,ringChar,vtxbin);
-      TH1F* hSharingEffTrVtx = pars->GetSharingEfficiencyTrVtx(det,ringChar,vtxbin);   
-      
-      for(Int_t nx=1; nx<hMult->GetNbinsX(); nx++) {
-       Float_t correction = hSharingEff->GetBinContent(nx);
-       Float_t correctionTrVtx = hSharingEffTrVtx->GetBinContent(nx);
-       for(Int_t ny=1; ny<hMult->GetNbinsY(); ny++) {
-         
-         if(correction != 0){
-           hMult->SetBinContent(nx,ny,hMult->GetBinContent(nx,ny)/correction);
-           Float_t error = TMath::Sqrt(TMath::Power(hMult->GetBinError(nx,ny),2) + TMath::Power(hMult->GetBinContent(nx,ny)*hSharingEff->GetBinError(nx),2)) / correction;
-           hMult->SetBinError(nx,ny,error);
-         }
-         if(correctionTrVtx != 0){
-           hMultTrVtx->SetBinContent(nx,ny,hMultTrVtx->GetBinContent(nx,ny)/correctionTrVtx);
-           Float_t error = TMath::Sqrt(TMath::Power(hMultTrVtx->GetBinError(nx,ny),2) + TMath::Power(hMultTrVtx->GetBinContent(nx,ny)*hSharingEffTrVtx->GetBinError(nx),2)) / correctionTrVtx;
-           hMultTrVtx->SetBinError(nx,ny,error);
+       for(Int_t nx=1; nx<hMult->GetNbinsX(); nx++) {
+         Float_t correction = hSharingEff->GetBinContent(nx);
+         Float_t correctionTrVtx = hSharingEffTrVtx->GetBinContent(nx);
+         for(Int_t ny=1; ny<hMult->GetNbinsY(); ny++) {
+           
+           if(correction != 0){
+             hMult->SetBinContent(nx,ny,hMult->GetBinContent(nx,ny)/correction);
+             Float_t error = TMath::Sqrt(TMath::Power(hMult->GetBinError(nx,ny),2) + TMath::Power(hMult->GetBinContent(nx,ny)*hSharingEff->GetBinError(nx),2)) / correction;
+             hMult->SetBinError(nx,ny,error);
+           }
+           if(correctionTrVtx != 0){
+             hMultTrVtx->SetBinContent(nx,ny,hMultTrVtx->GetBinContent(nx,ny)/correctionTrVtx);
+             Float_t error = TMath::Sqrt(TMath::Power(hMultTrVtx->GetBinError(nx,ny),2) + TMath::Power(hMultTrVtx->GetBinContent(nx,ny)*hSharingEffTrVtx->GetBinError(nx),2)) / correctionTrVtx;
+             hMultTrVtx->SetBinError(nx,ny,error);
+           }
          }
+         
        }
-       
       }
+      if(pars->GetEventSelectionEfficiency(vtxbin) > 0)
+       hMult->Scale(1/pars->GetEventSelectionEfficiency(vtxbin));
+      else
+       hMult->Scale(0);
       
-      hMult->Scale(1/pars->GetEventSelectionEfficiency(vtxbin));
-      
-      
+      }
     }
-  }
+    
+    
   if(fStandalone) {
     PostData(0, fOutputList); 
   }
@@ -234,8 +238,10 @@ void AliFMDAnalysisTaskBackgroundCorrection::Terminate(Option_t */*option*/) {
        TH2F* hHits      = (TH2F*)fHitList->FindObject(Form("hits_FMD%d%c_vtxbin%d",det,ringChar,i));
        TH1D* hHitsproj  = hHits->ProjectionX(Form("hits_FMD%d%c_vtxbin%d_proj",det,ringChar,i),1,hHits->GetNbinsY());
        TH1D* hHitsNoCuts = (TH1D*)hHitsproj->Clone(Form("hits_NoCuts_FMD%d%c_vtxbin%d_proj",det,ringChar,i));
-       
-       hHitsNoCuts->Scale(1/pars->GetEventSelectionEfficiency(i));
+       if(pars->GetEventSelectionEfficiency(i) > 0)
+         hHitsNoCuts->Scale(1/pars->GetEventSelectionEfficiency(i));
+       else
+         hHitsNoCuts->Scale(0);
        fHitList->Add(hHitsproj);
        fHitList->Add(hHitsNoCuts);
        
index 43dddb4..6bd7ef8 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;
   AliESDFMD* fmd = esd->GetFMDData();
   if (!fmd) return;
   if(physics)
@@ -271,7 +271,7 @@ void AliFMDAnalysisTaskCollector::ReadFromFile(const Char_t* filename, Bool_t st
   //1: Pb+Pb triple landau convolution fit
   
   AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  pars->Init(kTRUE,AliFMDAnaParameters::kBackgroundCorrection);
+  //pars->Init(kTRUE,AliFMDAnaParameters::kBackgroundCorrection);
   
   TFile fin(filename,"UPDATE");
   
@@ -328,15 +328,15 @@ void AliFMDAnalysisTaskCollector::ReadFromFile(const Char_t* filename, Bool_t st
 }
 //____________________________________________________________________
 TF1* AliFMDAnalysisTaskCollector::FitEnergyDistribution(TH1F* hEnergy, Int_t speciesOption) {
-  
+  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
   TF1* fitFunc = 0;
   if(hEnergy->GetEntries() != 0) {
          
     hEnergy->GetXaxis()->SetRangeUser(0.2,hEnergy->GetXaxis()->GetXmax());
     
-    if(speciesOption == 0)
+    if(pars->GetCollisionSystem() == 0)
       fitFunc =  new TF1("FMDfitFunc","landau",hEnergy->GetBinCenter(hEnergy->GetMaximumBin())-0.2,3);
-    if(speciesOption == 1) {
+    if(pars->GetCollisionSystem() == 1) {
       fitFunc = new TF1("FMDfitFunc",TripleLandau,hEnergy->GetBinCenter(hEnergy->GetMaximumBin())-0.2,5,5);
       fitFunc->SetParNames("constant","MPV","sigma","2-Mip weight","3-Mip weight");
       fitFunc->SetParameters(10,0.8,0.1,0.05,0.01);
index ef678e1..bd093f4 100644 (file)
@@ -196,7 +196,9 @@ void AliFMDAnalysisTaskGenerateCorrection::UserExec(Option_t */*option*/)
   if(isTriggered) hEventsSelectedTrigger->Fill(vertexBin);
     
   hEventsAll->Fill(vertexBin);
-    
+  
+  //  if(!vtxFound || !isTriggered) return;
+  
   for(Int_t i = 0 ;i<nTracks;i++) {
     particle = (AliMCParticle*) mcevent->GetTrack(i);
     
index 707ddd4..9cdae7e 100644 (file)
@@ -6,7 +6,8 @@
 #include "AliAnalysisManager.h"
 #include "AliFMDAnaParameters.h"
 #include "AliLog.h"
-
+#include "AliFMDDndeta.h"
+#include "TDirectory.h"
 ClassImp(AliFMDAnalysisTaskSE)
 
 //_____________________________________________________________________
@@ -128,6 +129,32 @@ void AliFMDAnalysisTaskSE::Terminate(Option_t */*option*/)
   fDndeta.Terminate("");
   fBFCorrelation.Terminate("");
   
+  AliFMDDndeta t;
+  t.SetNbinsToCut(2);
+  t.Init(outputList);
+  t.GenerateMult(AliFMDDndeta::kMult);
+  
+  TList* dNdetalist = t.GetMultList(AliFMDDndeta::kMult);
+  TList* cloneList = (TList*)dNdetalist->Clone("dNdeta");
+  cloneList->SetName("dNdeta");
+  outputList->Add(cloneList);
+  
+  t.GenerateMult(AliFMDDndeta::kMultTrVtx);
+  TList* dNdetalist2 = t.GetMultList(AliFMDDndeta::kMultTrVtx);
+  TList* cloneList2 = (TList*)dNdetalist2->Clone("dNdetaTrVtx");
+  cloneList2->SetName("dNdetaTrVtx");
+  outputList->Add(cloneList2);
+  
+  t.GenerateMult(AliFMDDndeta::kHits);
+  TList* dNdetalist3 = t.GetMultList(AliFMDDndeta::kHits);
+  TList* cloneList3 = (TList*)dNdetalist3->Clone("Hits");
+  cloneList3->SetName("Hits");
+  outputList->Add(cloneList3);
+  t.GenerateMult(AliFMDDndeta::kHitsTrVtx);
+  TList* dNdetalist4 = t.GetMultList(AliFMDDndeta::kHits);
+  TList* cloneList4 = (TList*)dNdetalist3->Clone("HitsTrVtx");
+  cloneList4->SetName("HitsTrVtx");
+  outputList->Add(cloneList4);
   // TFile file("fmd_ana_histos_tmp.root","RECREATE");
   //  fListOfHistos->Write();
   // file.Close();
index 6898a73..b47729e 100644 (file)
@@ -716,10 +716,10 @@ void AliFMDAnalysisTaskSharing::ProcessPrimary() {
   
   AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader);
   
-  if (!pythiaGenHeader) {
-    std::cout<<" no pythia header!"<<std::endl;
-    return; 
-  }
+  // if (!pythiaGenHeader) {
+    //  std::cout<<" no pythia header!"<<std::endl;
+  //   return; 
+  // }
 
        
   //Int_t pythiaType = pythiaGenHeader->ProcessType();
index 03fc189..7991936 100644 (file)
@@ -34,7 +34,13 @@ AliFMDDndeta::AliFMDDndeta()
   fEvents(),
   fPrimdNdeta()
 {
+  fAnalysisNames[0] = "Hits";
+  fAnalysisNames[1] = "HitsTrVtx";
+  fAnalysisNames[2] = "dNdeta";
+  fAnalysisNames[3] = "dNdetaTrVtx";
   
+  for(Int_t i=0; i<4;i++) 
+    fMultList[i] = new TList();
 }
 //_____________________________________________________________________
 void AliFMDDndeta::SetNames(Analysis what) {
@@ -123,9 +129,9 @@ void AliFMDDndeta::GenerateHits(Analysis what) {
   Float_t etaMax     =  hTmp->GetXaxis()->GetXmax();
 
   for(Int_t i = 0; i<nVertexBins;i++) {
-    TH1F* hHits = new TH1F(Form("hMCHits_vtxbin%d",i),Form("hHits_vtxbin%d",i),nEtaBins,etaMin,etaMax);
+    TH1F* hHits = new TH1F(Form("hMCHits_vtxbin%d_%s",i,fAnalysisNames[what]),Form("hHits_vtxbin%d_%s",i,fAnalysisNames[what]),nEtaBins,etaMin,etaMax);
     hHits->Sumw2();
-    fMultList.Add(hHits);
+    fMultList[what]->Add(hHits);
   }
   
   for(Int_t det = 1; det<=3; det++) {
@@ -144,7 +150,7 @@ void AliFMDDndeta::GenerateHits(Analysis what) {
            nNonZero++;
        }
 
-       TH1F* sumMultHist = (TH1F*)fMultList.FindObject(Form("hMCHits_vtxbin%d",v));
+       TH1F* sumMultHist = (TH1F*)fMultList[what]->FindObject(Form("hMCHits_vtxbin%d_%s",v,fAnalysisNames[what]));
        for(Int_t i =1;i<=sumMultHist->GetNbinsX();i++) {
          if(hits->GetBinContent(i) == 0 ) continue;
          
@@ -188,7 +194,9 @@ void AliFMDDndeta::Init(const Char_t* filename) {
   
   if(!list) //an old file ? Perhaps...
     list = (TList*)fin->Get("BackgroundCorrected");
-    
+  
+  
   Init(list);
   
 }
@@ -200,7 +208,8 @@ void AliFMDDndeta::Init(TList* list) {
     AliWarning("No list - exiting !");
     return;
   }
-  fList = list;
+  
+  fList = (TList*)list->Clone("inputList");
     
   fIsGenerated[kHits]      = kFALSE;
   fIsGenerated[kMult]      = kFALSE;  
@@ -240,17 +249,17 @@ void AliFMDDndeta::GenerateMult(Analysis what) {
   Float_t etaMax     =  hTmp->GetXaxis()->GetXmax();
   
   for(Int_t i = 0; i<nVertexBins;i++) {
-    TH1F* hMult = new TH1F(Form("hMult_vtxbin%d",i),Form("hMult_vtxbin%d",i),nEtaBins,etaMin,etaMax);
+    TH1F* hMult = new TH1F(Form("hMult_vtxbin%d_%s",i,fAnalysisNames[what]),Form("hMult_vtxbin%d_%s",i,fAnalysisNames[what]),nEtaBins,etaMin,etaMax);
     hMult->Sumw2();
-    fMultList.Add(hMult);
+    fMultList[what]->Add(hMult);
   }
   
   for(Int_t det = 1; det<=3;det++) {
     Int_t maxRing = (det == 1 ? 0 : 1);
     for(Int_t iring = 0; iring<=maxRing; iring++) {
       Char_t ringChar = (iring == 0 ? 'I' : 'O');
-      TH1F* hRingMult= new TH1F(Form("hRingMult_FMD%d%c",det,ringChar),Form("hRingMult_FMD%d%c",det,ringChar),nEtaBins,etaMin,etaMax);
-      fMultList.Add(hRingMult);
+      TH1F* hRingMult= new TH1F(Form("hRingMult_FMD%d%c_%s",det,ringChar,fAnalysisNames[what]),Form("hRingMult_FMD%d%c_%s",det,ringChar,fAnalysisNames[what]),nEtaBins,etaMin,etaMax);
+      fMultList[what]->Add(hRingMult);
     }
   }
   TH1I* hEvents = (TH1I*)fList->FindObject(fEvents.Data());
@@ -266,7 +275,7 @@ void AliFMDDndeta::GenerateMult(Analysis what) {
       for(Int_t v=0; v< nVertexBins; v++) {
        if(det == 1) {
          if(what == kHits || what == kHitsTrVtx)
-           hPrimVtx = (TH1F*)fMultList.FindObject(Form("hMCHits_vtxbin%d",v));
+           hPrimVtx = (TH1F*)fMultList[what]->FindObject(Form("hMCHits_vtxbin%d_%s",v,fAnalysisNames[what]));
          else
            hPrimVtx = (TH1F*)fList->FindObject(GetPrimName(what,det,ringChar,v));
          
@@ -310,7 +319,7 @@ void AliFMDDndeta::GenerateMult(Analysis what) {
        //      if(det == 2 && ringChar =='I') {
        //  fNbinsToCut = 1;
        //      }
-       TH1F* hRingMult = (TH1F*)fMultList.FindObject(Form("hRingMult_FMD%d%c",det,ringChar));
+       TH1F* hRingMult = (TH1F*)fMultList[what]->FindObject(Form("hRingMult_FMD%d%c_%s",det,ringChar,fAnalysisNames[what]));
        
        for(Int_t i=1; i<=hRingMult->GetNbinsX(); i++) {
          if(multhistproj->GetBinContent(i)!=0) {
@@ -338,7 +347,7 @@ void AliFMDDndeta::GenerateMult(Analysis what) {
        }
        nNonZeroInData = 0;
        
-       TH1F* sumMultHist = (TH1F*)fMultList.FindObject(Form("hMult_vtxbin%d",v));
+       TH1F* sumMultHist = (TH1F*)fMultList[what]->FindObject(Form("hMult_vtxbin%d_%s",v,fAnalysisNames[what]));
        
        for(Int_t i =1;i<=sumMultHist->GetNbinsX();i++) {
          if(multhistproj->GetBinContent(i) != 0 ) {      
@@ -370,22 +379,22 @@ void AliFMDDndeta::GenerateMult(Analysis what) {
     }
   }
   
-  TH1F* sumMult  = new TH1F("hSumMult","hSumMult",nEtaBins,etaMin,etaMax);
+  TH1F* sumMult  = new TH1F(Form("dNdeta_%s",fAnalysisNames[what]),Form("dNdeta_%s",fAnalysisNames[what]),nEtaBins,etaMin,etaMax);
   sumMult->Sumw2();
-  fMultList.Add(sumMult);
-  TH1F* primMult  = new TH1F("hPrimMult","hPrimMult",nEtaBins,etaMin,etaMax);
+  fMultList[what]->Add(sumMult);
+  TH1F* primMult  = new TH1F(Form("primary_%s",fAnalysisNames[what]),Form("primary_%s",fAnalysisNames[what]),nEtaBins,etaMin,etaMax);
   primMult->Sumw2();
-  fMultList.Add(primMult);
+  fMultList[what]->Add(primMult);
 
   Float_t wav  = 0, sumofw=0, weight = 0, primwav  = 0, primsumofw=0, primweight = 0;//, etaofbin = 0;
   for(Int_t i =1; i<=sumMult->GetNbinsX();i++) {
     
     for(Int_t v = 0; v<nVertexBins;v++) {
       if(what == kHits || what == kHitsTrVtx)
-       hPrimVtx = (TH1F*)fMultList.FindObject(Form("hMCHits_vtxbin%d",v));
+       hPrimVtx = (TH1F*)fMultList[what]->FindObject(Form("hMCHits_vtxbin%d_%s",v,fAnalysisNames[what]));
       else
        hPrimVtx = (TH1F*)fList->FindObject(GetPrimName(what,0,0,v));
-      TH1F* sumMultHist = (TH1F*)fMultList.FindObject(Form("hMult_vtxbin%d",v));
+      TH1F* sumMultHist = (TH1F*)fMultList[what]->FindObject(Form("hMult_vtxbin%d_%s",v,fAnalysisNames[what]));
       //etaofbin += sumMultHist->GetBinCenter(i);
       // if( hPrimVtx->GetBinContent(i)!=0 && hPrimVtx->GetBinError(i)>0.001 && sumMultHist->GetBinContent(i)!=0) {
       if( TMath::Abs(hPrimVtx->GetBinContent(i)) > 0) {
@@ -497,7 +506,7 @@ void AliFMDDndeta::DrawDndeta(Analysis what, Int_t rebin, Bool_t realdata) {
        
        if(det == 1) {
          if(what == kHits || what == kHitsTrVtx)
-           hPrimVtx = (TH1F*)fMultList.FindObject(Form("hMCHits_vtxbin%d",v));
+           hPrimVtx = (TH1F*)fMultList[what]->FindObject(Form("hMCHits_vtxbin%d_%s",v,Form("primary_%s",fAnalysisNames[what])));
          else
            hPrimVtx = (TH1F*)fList->FindObject(GetPrimName(what,det,ringChar,v));
          
@@ -523,21 +532,21 @@ void AliFMDDndeta::DrawDndeta(Analysis what, Int_t rebin, Bool_t realdata) {
   }
   
   for(Int_t v=0; v< nVertexBins; v++) {
-    TH1F* sumMultHist = (TH1F*)fMultList.FindObject(Form("hMult_vtxbin%d",v));
+    TH1F* sumMultHist = (TH1F*)fMultList[what]->FindObject(Form("hMult_vtxbin%d_%s",v,fAnalysisNames[what]));
     c1->cd(v+1);
     sumMultHist->SetMarkerStyle(25);
     sumMultHist->DrawCopy("same");
     
   }
-  TH1F* primMult = (TH1F*)fMultList.FindObject("hPrimMult");
-  TH1F* sumMult  = (TH1F*)fMultList.FindObject("hSumMult");
+  TH1F* primMult = (TH1F*)fMultList[what]->FindObject(Form("primary_%s",fAnalysisNames[what]));
+  TH1F* sumMult  = (TH1F*)fMultList[what]->FindObject(Form("dNdeta_%s",fAnalysisNames[what]));
   sumMult->SetMarkerStyle(23);
   sumMult->SetMarkerColor(kRed);
   for(Int_t det = 1; det<=3;det++) {
     Int_t maxRing = (det == 1 ? 0 : 1);
     for(Int_t iring = 0; iring<=maxRing; iring++) {
       Char_t ringChar = (iring == 0 ? 'I' : 'O');
-      TH1F* hRingMult= (TH1F*)fMultList.FindObject(Form("hRingMult_FMD%d%c",det,ringChar));
+      TH1F* hRingMult= (TH1F*)fMultList[what]->FindObject(Form("hRingMult_FMD%d%c_%s",det,ringChar,fAnalysisNames[what]));
       hRingMult->Add(primMult,-1);
       hRingMult->Divide(primMult);
     }
@@ -580,12 +589,21 @@ void AliFMDDndeta::DrawDndeta(Analysis what, Int_t rebin, Bool_t realdata) {
   // hPrim->Scale(1/rebin);
   if(what != kHits && what != kHitsTrVtx)
     primMult = hPrim;
-  TH1F* hReldif = (TH1F*)sumMult->Clone("hReldif");
-  hReldif->Add(primMult,-1);
-  hReldif->Divide(primMult);
+  
   //  hReldif->Add(hPrim,-1);
   // hReldif->Divide(hPrim);
   
+ (0,7);
+  //sumMult->Rebin(rebin);
+  TH1F* hReldif = (TH1F*)sumMult->Clone("hReldif");
+  if(rebin != 1) {
+    RebinHistogram(sumMult,rebin);
+    RebinHistogram(primMult,rebin);
+    RebinHistogram(hReldif,rebin);
+  }
+  hReldif->Add(primMult,-1);
+  hReldif->Divide(primMult);
   TCanvas* c2 = new TCanvas("dN/deta","dN/deta",640,960);
   c2->Divide(1,2);//,0,0);
   c2->cd(2);
@@ -607,6 +625,8 @@ void AliFMDDndeta::DrawDndeta(Analysis what, Int_t rebin, Bool_t realdata) {
   hPrim->SetLabelFont(132,"xyz");
   hPrim->SetFillColor(kGray);
   primMult->SetFillColor(kBlue);
+  
+  
   c2->cd(1);
   gPad->SetGridy();
   gPad->SetGridx();
@@ -616,10 +636,7 @@ void AliFMDDndeta::DrawDndeta(Analysis what, Int_t rebin, Bool_t realdata) {
   hPrim->GetXaxis()->SetTitle("#eta");
   sumMult->SetTitle("");
   sumMult->SetStats(kFALSE);
-  // sumMult->GetYaxis()->SetRangeUser(0,7);
-  //sumMult->Rebin(rebin);
-  if(rebin != 1)
-    RebinHistogram(sumMult,rebin);
+  // sumMult->GetYaxis()->SetRangeUser
   //sumMult->Scale(1/(Float_t)rebin);
   sumMult->DrawCopy("PE");
   if(what != kHits && what != kHitsTrVtx && hPrim->GetEntries())
@@ -784,27 +801,27 @@ void AliFMDDndeta::DrawDndeta(Analysis what, Int_t rebin, Bool_t realdata) {
       
       
       if(hRatioMultUA5->GetBinCenter(j) > 0) {
-       Double_t* x  = graphinel->GetX();
-       Double_t* y  = graphinel->GetY();
-       Double_t* ey = graphinel->GetEY();
+       Double_t* xv  = graphinel->GetX();
+       Double_t* yv  = graphinel->GetY();
+       Double_t* eyv = graphinel->GetEY();
 
        for(Int_t kk =0; kk<graphinel->GetN();kk++) {
-         if(x[kk] < hRatioMultUA5->GetBinCenter(j) &&  x[kk+1] > hRatioMultUA5->GetBinCenter(j)) {
-           ua5 = y[kk];
-           ua5error = ey[kk];
+         if(xv[kk] < hRatioMultUA5->GetBinCenter(j) &&  xv[kk+1] > hRatioMultUA5->GetBinCenter(j)) {
+           ua5 = yv[kk];
+           ua5error = eyv[kk];
            }
        }
          
          }
       else {
-       Double_t* x = graphinel2->GetX();
-       Double_t* y = graphinel2->GetY();
-       Double_t* ey = graphinel->GetEY();
+       Double_t* xv = graphinel2->GetX();
+       Double_t* yv = graphinel2->GetY();
+       Double_t* eyv = graphinel->GetEY();
        
        for(Int_t kk =0; kk<graphinel2->GetN();kk++) {
-         if(x[kk+1] < hRatioMultUA5->GetBinCenter(j) &&  x[kk] > hRatioMultUA5->GetBinCenter(j)) {
-           ua5 = y[kk];
-           ua5error = ey[kk];
+         if(xv[kk+1] < hRatioMultUA5->GetBinCenter(j) &&  xv[kk] > hRatioMultUA5->GetBinCenter(j)) {
+           ua5 = yv[kk];
+           ua5error = eyv[kk];
          }
        }
        
@@ -858,7 +875,7 @@ void AliFMDDndeta::DrawDndeta(Analysis what, Int_t rebin, Bool_t realdata) {
   hPrim->Write();
   sumMult->Write();
   hReldif->Write();
-  fMultList.Write();
+  fMultList[what]->Write();
   c2->Write();
   fout.Close();
     
index 03f5dfa..313a323 100644 (file)
@@ -39,6 +39,8 @@ class AliFMDDndeta : public TObject
   
   enum Analysis {kHits, kHitsTrVtx, kMult, kMultTrVtx};
   
+  
+  
   void Init(const Char_t* filename);
   void Init(TList* list);
   void GenerateMult(Analysis what);
@@ -47,24 +49,24 @@ class AliFMDDndeta : public TObject
   void SetVtxCut1(Int_t vtxcut) {fVtxCut1 = vtxcut;}
   void SetVtxCut2(Int_t vtxcut) {fVtxCut2 = vtxcut;}
   void CreateSharingEfficiency(const Char_t* filename, Bool_t store = kFALSE);
-  TList* GetMultList() {return &fMultList;}
+  TList* GetMultList(Analysis what) {return fMultList[what];}
  private:
   void GenerateHits(Analysis what);
   void SetNames(Analysis what);
   const char* GetAnalysisName(Analysis what, UShort_t det, Char_t ring, Int_t vtxbin);
   const char* GetPrimName(Analysis what, UShort_t det, Char_t ring, Int_t vtxbin);
   void   RebinHistogram(TH1F* hist, Int_t rebin);
-  TList* fList;                          // A list of input histograms
-  TList  fMultList;                      // A list of mult histograms 
-  Int_t  fNbinsToCut;                    // The number of bins to cut
-  Int_t  fVtxCut1;                       // Vtx low
-  Int_t  fVtxCut2;                       // Vtx high
-  Bool_t fIsInit;                        // Are we init ? 
-  Bool_t fIsGenerated[4];                // Have we generated ?
+  TList*  fList;                         // A list of input histograms
+  TList*  fMultList[4];                  // A list of mult histograms 
+  Int_t   fNbinsToCut;                   // The number of bins to cut
+  Int_t   fVtxCut1;                      // Vtx low
+  Int_t   fVtxCut2;                      // Vtx high
+  Bool_t  fIsInit;                       // Are we init ? 
+  Bool_t  fIsGenerated[4];               // Have we generated ?
   TString fPrimEvents;                   // Number of prim events
   TString fEvents;                       // Number of events
   TString fPrimdNdeta;                   // the primary dNdeta from MC
-  
+  Char_t* fAnalysisNames[4];             // Names of analysis
   ClassDef(AliFMDDndeta,2);
 };