V0 rescaling in MC and multiple bins in correct.C
authormfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Nov 2010 15:06:42 +0000 (15:06 +0000)
committermfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Nov 2010 15:06:42 +0000 (15:06 +0000)
PWG0/multPbPb/AliAnalysisMultPbCentralitySelector.cxx
PWG0/multPbPb/AliAnalysisMultPbTrackHistoManager.cxx
PWG0/multPbPb/AliAnalysisTaskMultPbTracks.cxx
PWG0/multPbPb/AliAnalysisTaskTriggerStudy.cxx
PWG0/multPbPb/correct.C
PWG0/multPbPb/run.C
PWG0/multPbPb/run.sh
PWG0/multPbPb/runTriggerStudy.C

index 3d3ab12..adb24e6 100644 (file)
@@ -45,7 +45,7 @@ Bool_t AliAnalysisMultPbCentralitySelector::IsCentralityBinSelected(AliESDEvent*
       Float_t multV0C=esdV0->GetMTotV0C();
       multV0 = multV0A+multV0C;
     }
-    
+    if (fIsMC) multV0 = 0.85871 * multV0;
     if (multV0 < fMultMin) return kFALSE;
     if (multV0 > fMultMax) return kFALSE;
     //    cout << "ok" << endl;
index 51f7a36..99aee26 100644 (file)
@@ -14,7 +14,7 @@ using namespace std;
 
 ClassImp(AliAnalysisMultPbTrackHistoManager)
 
-const char * AliAnalysisMultPbTrackHistoManager::kStatStepNames[]     = { "All Events", "After centrality selection",  "After physics Selection", "After ZDC cut", "With Vertex" };
+const char * AliAnalysisMultPbTrackHistoManager::kStatStepNames[]     = { "All Events", "After centrality selection",  "After physics Selection", "With Vertex", "After ZDC cut" };
 const char * AliAnalysisMultPbTrackHistoManager::kHistoPtEtaVzNames[] = { "hGenPtEtaVz", "hRecPtEtaVz", "hRecPtEtaVzPrim", 
                                                                          "hRecPtEtaVzSecWeak", "hRecPtEtaVzSecMaterial", "hRecPtEtaVzFake"};
 const char * AliAnalysisMultPbTrackHistoManager::kHistoDCANames[]     = { "hGenDCA", "hRecDCA", "hRecDCAPrim", "hRecDCASecWeak","hRecDCASecMaterial", "hRecDCAFake"};
@@ -84,7 +84,8 @@ TH2D * AliAnalysisMultPbTrackHistoManager::GetHistoV0vsNtracks(Histo_t id) {
     AliInfo(Form("Booking histo %s",name.Data()));
 
     h = new TH2D (name.Data(), Form("V0 vs Ntracks (%s)",kHistoPrefix[id]), 300,0,3000, 300, 0, 20000);                         
-
+    h->SetXTitle("N_{Tracks}");
+    h->SetYTitle("V0 Amplitude");
     TH1::AddDirectory(oldStatus);
     fList->Add(h);
 
index 25c5f35..3c2ae1b 100644 (file)
@@ -100,7 +100,7 @@ void AliAnalysisTaskMultPbTracks::UserCreateOutputObjects()
   fTrackCutsNoDCA->SetMaxDCAToVertexZPtDep();
 
   fTriggerAnalysis = new AliTriggerAnalysis();
-
+  fTriggerAnalysis->SetAnalyzeMC(fIsMC);
 }
 
 
@@ -245,10 +245,11 @@ void AliAnalysisTaskMultPbTracks::UserExec(Option_t *)
   fHistoManager->GetHistoStats()->Fill(AliAnalysisMultPbTrackHistoManager::kStatVtx);
   
   // ZDC cut, only ZNs
-   Bool_t zdcA   = fTriggerAnalysis->ZDCTDCTrigger(fESD, AliTriggerAnalysis::kASide, kTRUE, kFALSE) ; 
-   Bool_t zdcC   = fTriggerAnalysis->ZDCTDCTrigger(fESD, AliTriggerAnalysis::kCSide, kTRUE, kFALSE) ;                  
+  Bool_t zdcA   = fTriggerAnalysis->ZDCTDCTrigger(fESD, AliTriggerAnalysis::kASide, kTRUE, kFALSE) ; 
+  Bool_t zdcC   = fTriggerAnalysis->ZDCTDCTrigger(fESD, AliTriggerAnalysis::kCSide, kTRUE, kFALSE) ;                   
 
-   if (!(zdcA && zdcC)) return;
+  fIsMC = kTRUE;// FIXME
+  if (!(zdcA && zdcC) && (!fIsMC)) return;
   fHistoManager->GetHistoStats()->Fill(AliAnalysisMultPbTrackHistoManager::kStatZDCCut);
 
   
index 91c436d..2b4dd48 100644 (file)
@@ -241,6 +241,11 @@ void AliAnalysisTaskTriggerStudy::UserExec(Option_t *)
     GetHistoTracks("V0AND", "V0A & V0C")->Fill(ntracks);
     GetHistoV0M   ("V0AND", "V0A & V0C")->Fill(multV0);
   }
+  if((c0v0A && !c0v0C) || (!c0v0A && c0v0C)) {
+    GetHistoSPD1  ("V0ONLYONE", "(V0A & !V0C) || (!V0A & V0C)")->Fill(outerLayerSPD);
+    GetHistoTracks("V0ONLYONE", "(V0A & !V0C) || (!V0A & V0C)")->Fill(ntracks);
+    GetHistoV0M   ("V0ONLYONE", "(V0A & !V0C) || (!V0A & V0C)")->Fill(multV0);
+  }
   if(zdcA && zdcC) {
     GetHistoSPD1  ("ZDCAND", "ZDCA & ZDCC")->Fill(outerLayerSPD);
     GetHistoTracks("ZDCAND", "ZDCA & ZDCC")->Fill(ntracks);
index 7a24c13..54ae4c6 100644 (file)
@@ -45,17 +45,19 @@ Float_t zmin = -10;
 Float_t zmax = 10;
 Float_t etaMin = -0.5;
 Float_t etaMax = 0.5;
+Int_t gCentralityBin = -1;
 
 #define CORRECT_2D
 
 void correct(TString dataFolder = "./output/LHC10g2d_130844_V0M_bin_10/", TString correctionFolder = "./output/LHC10g2a_130844_V0M_bin_10/", 
-            Float_t zminl=-10, Float_t zmaxl=10, Float_t etaMinl = -0.5, Float_t etaMaxl=0.5, Float_t npart=381.3, Float_t scaleWeakByHand = -1) {
+            Float_t zminl=-10, Float_t zmaxl=10, Float_t etaMinl = -0.5, Float_t etaMaxl=0.5, Float_t npart=381.3, Float_t scaleWeakByHand = -1, Int_t centrBin = -1) {
 
-  // Set vertex 
+  // Set globals 
   zmin = zminl;
   zmax = zmaxl;
   etaMin = etaMinl;
   etaMax = etaMaxl;
+  gCentralityBin = centrBin;
 
   // Load stuff and set some styles
   LoadLibs();
@@ -261,7 +263,7 @@ void CheckSecondaries(Double_t &fracWeak, Double_t &fracMaterial) {
 
 
   TCanvas * c1 = new TCanvas("cDCAFit", "Fit to the DCA distributions");  
-  c1->Divide(4,2);
+  //  c1->Divide(4,2);
   c1->SetLogy();
   // Draw all
   //  hDataDCA->Draw();
@@ -280,7 +282,8 @@ void CheckSecondaries(Double_t &fracWeak, Double_t &fracMaterial) {
   // Set the components which are used in HistoSum, the static
   // function for GetFunctionHistoSum
   // Project onti DCA axis
-  const Int_t ptBinsFit[] = {3,5,7,9,11,15,19,23,31,-1};
+  //  const Int_t ptBinsFit[] = {3,5,7,9,11,15,19,23,31,-1};
+  const Int_t ptBinsFit[] = {3,20,-1};
   Int_t ibinPt = -1;
   while(ptBinsFit[(++ibinPt)+1]!=-1){
     c1->cd(ibinPt+1);
@@ -525,9 +528,11 @@ void SetStyle() {
 
 void LoadData(TString dataFolder, TString correctionFolder){
 
+  TString file = "/multPbPbtracks.root";
+  if (gCentralityBin != -1 ) file.ReplaceAll(".root", Form("_%2.2d.root", gCentralityBin));
   // Get histo manager for data and MC + stat histos
-  TFile * fData = new TFile(dataFolder+"/multPbPbtracks.root");
-  TFile * fCorr = new TFile(correctionFolder+"/multPbPbtracks.root");
+  TFile * fData = new TFile(dataFolder+file);
+  TFile * fCorr = new TFile(correctionFolder+file);
   TFile * fStatData = new TFile(dataFolder+"/event_stat.root");
   TFile * fStatCorr = new TFile(correctionFolder+"/event_stat.root");
 
index 173e61f..e38a17e 100644 (file)
@@ -74,6 +74,7 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
 
   // Create my own centrality selector
   AliAnalysisMultPbCentralitySelector * centrSelector = new AliAnalysisMultPbCentralitySelector();
+  centrSelector->SetIsMC(isMC);
   centrSelector->SetCentrTaskFiles(file1,file2); // for bookkeping only
   centrSelector->SetCentralityBin(centrBin);
   if (!useSingleBin) centrSelector->SetCentralityBin(0); // FIXME: ok?
@@ -165,20 +166,14 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
     const Float_t maxCentr[] = {79,247,577,1185,2155,3565,5527,8203,12167,15073,21000};
     AliAnalysisTaskMultPbTracks ** tasks = AddTaskMultPbPbTracksAllCentrality("multPbPbtracks.root", cuts, centrSelector, ncentr,minCentr,maxCentr); 
     for(Int_t icentr = 0; icentr < ncentr; icentr++){
-      cout << "1 " << tasks[icentr] << endl;
       tasks[icentr]->Print();
       tasks[icentr]->SetIsMC(useMCKinematics);
-      cout << "2" << endl;
       tasks[icentr]->SetOfflineTrigger(AliVEvent::kMB);
-      cout << "3" << endl;
       if(optionStr.Contains("TPC")) tasks[icentr]->SetTPCOnly();
-      cout << "4" << endl;
       if(useMCKinematics) tasks[icentr]->GetHistoManager()->SetSuffix("MC");
-      cout << "5" << endl;
       if(customSuffix!=""){
        cout << "Setting custom suffix: " << customSuffix+long(icentr) << tasks[icentr] << endl;    
        tasks[icentr]->GetHistoManager()->SetSuffix(customSuffix+long(icentr));
-       cout << "ok" << endl;
       }        
     }    
   }
index 8f22b10..fc99090 100755 (executable)
@@ -13,7 +13,7 @@ ropt="-l"
 option="SAVE"
 workers=26
 analysismode=9; #SPD + field on
-centrBin=0
+centrBin=-1
 centrEstimator="V0M"
 runTriggerStudy=no
 customSuffix=""
@@ -99,6 +99,10 @@ Available options:
   -a <etamin,etamax>           Change eta range [default = $etaMin,$etaMax]
   -p <npart>                   Number of participants, used only for dNdeta/npart [default=$npart]
   -k <weakFrac>                Scale ration secondaries from strangeness/all rec by this factor [default=$weakFactor]
+  -b <bin>                     Set centrality bin to be corrected. Only valid if you processed multiple 
+                               bins at one (it changes the suffix of the multPbPbtracks.root file). It it's -1,
+                               a file without suffix is searched for. This options applyies both to the data and to the 
+                               MC file. [default=$centrBin]
 ENDOFGUIDE
 
 }
@@ -220,5 +224,5 @@ fi
 
 if [ "$correct" = "yes" ]
     then
-    root $ropt correct.C+\(\"$dataDir\",\"$mcDir\",$vzMin,$vzMax,$etaMin,$etaMax,$npart,$weakFactor\);
+    root $ropt correct.C+\(\"$dataDir\",\"$mcDir\",$vzMin,$vzMax,$etaMin,$etaMax,$npart,$weakFactor,$centrBin\);
 fi
index 605e96b..e04e83e 100644 (file)
@@ -156,8 +156,9 @@ void InitAndLoadLibs(Int_t runMode=kMyRunModeLocal, Int_t workers=0,Bool_t debug
     cout << "Init in CAF mode" << endl;
     
     gEnv->SetValue("XSec.GSI.DelegProxy", "2");
-    TProof::Open("alice-caf.cern.ch", workers>0 ? Form("workers=%d",workers) : "");
-    //    TProof::Open("skaf.saske.sk", workers>0 ? Form("workers=%d",workers) : "");
+    TProof * p = TProof::Open("alice-caf.cern.ch", workers>0 ? Form("workers=%d",workers) : "");
+    p->Exec("TObject *o = gEnv->GetTable()->FindObject(\"Proof.UseMergers\"); gEnv->GetTable()->Remove(o);", kTRUE);
+    //TProof::Open("skaf.saske.sk", workers>0 ? Form("workers=%d",workers) : "");
     
     // Enable the needed package
     gProof->UploadPackage("$ALICE_ROOT/STEERBase");