Fixing the angles for the phi-dphi analysis
authorpchrist <pchrist@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 4 Apr 2012 14:09:52 +0000 (14:09 +0000)
committerpchrist <pchrist@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 4 Apr 2012 14:09:52 +0000 (14:09 +0000)
PWGCF/EBYE/BalanceFunctions/AliBalancePsi.cxx
PWGCF/EBYE/macros/AddTaskBalancePsiCentralityTrain.C
PWGCF/EBYE/macros/runBalanceFunctionPsi.C

index 5fd693e..3fc8aa1 100644 (file)
@@ -344,7 +344,7 @@ void AliBalancePsi::CalculateBalance(Float_t fCentrality,
       pt1     = chargeVector[7]->at(i);
       energy1 = chargeVector[8]->at(i);
       gPsiMinusPhi   = phi1 - gReactionPlane;
-      if(phi1 > 180.) phi1 -= 360.;
+      //if(phi1 > 180.) phi1 -= 360.;
       if(gPsiMinusPhi < -fPsiInterval/2) gPsiMinusPhi = 360. + gPsiMinusPhi;
       gPsiBin = (Int_t)((gPsiMinusPhi + 360./fPsiNumberOfBins/2.)/(360./fPsiNumberOfBins));
 
@@ -358,7 +358,7 @@ void AliBalancePsi::CalculateBalance(Float_t fCentrality,
        pz2     = chargeVector[6]->at(j);
        pt2     = chargeVector[7]->at(i);
        energy2 = chargeVector[8]->at(j);
-       if(phi2 > 180.) phi2 -= 360.;
+       //if(phi2 > 180.) phi2 -= 360.;
        
        // filling the arrays
        // RAPIDITY 
@@ -401,7 +401,8 @@ void AliBalancePsi::CalculateBalance(Float_t fCentrality,
        
        //phi
        dphi = phi1 - phi2;
-       if(dphi < -180) dphi = 360 - dphi;  //dphi should be between -180 and 180!
+       if(dphi < -180.) dphi = 360. + dphi;  //dphi should be between -180 and 180!
+       else if(dphi > 180.) dphi = -360. + dphi;  //dphi should be between -180 and 180!
 
        //0:y - 1:eta - 2:Qlong - 3:Qout - 4:Qside - 5:Qinv - 6:phi
        if((rap1 >= fP1Start[kRapidity]) && (rap1 <= fP1Stop[kRapidity]) && (rap2 >= fP1Start[kRapidity]) && (rap2 <= fP1Stop[kRapidity])) {
index 8efa3cf..1d1bc29 100644 (file)
@@ -15,23 +15,23 @@ Bool_t kUseBayesianPID = kTRUE;
 Double_t gMinAcceptedProbability = 0.7;\r
 \r
 //_________________________________________________________//\r
-AliAnalysisTaskBF *AddTaskBalancePsiCentralityTrain(Double_t centrMin=0.,\r
-                                                   Double_t centrMax=100.,\r
-                                                   Bool_t gRunShuffling=kFALSE,\r
-                                                   TString centralityEstimator="V0M",\r
-                                                   Double_t vertexZ=10.,\r
-                                                   Double_t DCAxy=-1,\r
-                                                   Double_t DCAz=-1,\r
-                                                   Double_t ptMin=0.3,\r
-                                                   Double_t ptMax=1.5,\r
-                                                   Double_t etaMin=-0.8,\r
-                                                   Double_t etaMax=0.8,\r
-                                                   Double_t maxTPCchi2 = -1, \r
-                                                   Int_t minNClustersTPC = -1,\r
-                                                   Bool_t kUsePID = kFALSE,\r
-                                                   Int_t AODfilterBit = 128,\r
-                                                   Bool_t bCentralTrigger = kFALSE,\r
-                                                   TString fileNameBase="AnalysisResults") {\r
+AliAnalysisTaskBFPsi *AddTaskBalancePsiCentralityTrain(Double_t centrMin=0.,\r
+                                                      Double_t centrMax=100.,\r
+                                                      Bool_t gRunShuffling=kFALSE,\r
+                                                      TString centralityEstimator="V0M",\r
+                                                      Double_t vertexZ=10.,\r
+                                                      Double_t DCAxy=-1,\r
+                                                      Double_t DCAz=-1,\r
+                                                      Double_t ptMin=0.3,\r
+                                                      Double_t ptMax=1.5,\r
+                                                      Double_t etaMin=-0.8,\r
+                                                      Double_t etaMax=0.8,\r
+                                                      Double_t maxTPCchi2 = -1, \r
+                                                      Int_t minNClustersTPC = -1,\r
+                                                      Bool_t kUsePID = kFALSE,\r
+                                                      Int_t AODfilterBit = 128,\r
+                                                      Bool_t bCentralTrigger = kFALSE,\r
+                                                      TString fileNameBase="AnalysisResults") {\r
   // Creates a balance function analysis task and adds it to the analysis manager.\r
   // Get the pointer to the existing analysis manager via the static access method.\r
   TString centralityName("");\r
@@ -86,8 +86,8 @@ AliAnalysisTaskBF *AddTaskBalancePsiCentralityTrain(Double_t centrMin=0.,
   if(dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())) analysisType = "MC";\r
 \r
   // for local changed BF configuration\r
-  //gROOT->LoadMacro("./configBalanceFunctionAnalysis.C");\r
-  gROOT->LoadMacro("$ALICE_ROOT/PWGCF/EBYE/macros/configBalanceFunctionAnalysis.C");\r
+  gROOT->LoadMacro("./configBalanceFunctionPsiAnalysis.C");\r
+  //gROOT->LoadMacro("$ALICE_ROOT/PWGCF/EBYE/macros/configBalanceFunctionPsiAnalysis.C");\r
   AliBalancePsi *bf  = 0;  // Balance Function object\r
   AliBalancePsi *bfs = 0;  // shuffled Balance function object\r
 \r
index 4d927ff..fe41c09 100755 (executable)
@@ -21,7 +21,7 @@ Float_t vZ[numberOfSyst]     = {10.,12.,6.,8.,10.,10.,10.,10.,10.,10.,10.,10.,10
 Float_t DCAxy[numberOfSyst]  = {-1.,2.4,2.4,2.4,2.2,2.0,1.8,2.4,2.4,2.4,2.4,2.4,2.4};   // DCA xy cut (afterburner, -1 = w/o additional cut)\r
 Float_t DCAz[numberOfSyst]   = {-1.,3.2,3.2,3.2,3.0,2.8,2.6,3.2,3.2,3.2,3.2,3.2,3.2};   // DCA z cut (afterburner, -1 = w/o additional cut)\r
 Float_t ptMin[numberOfSyst]  = {0.3,0.3,0.3,0.3,0.3,0.3,0.3,1.5,5.0,0.3,0.3,0.3,0.3};   // pt cuts\r
-Float_t ptMax[numberOfSyst]  = {1.5,1.5,1.5,1.5,1.5,1.5,1.5,5.0,10.0,10.0,1.5,1.5,1.5}; // pt cuts\r
+Float_t ptMax[numberOfSyst]  = {5.,1.5,1.5,1.5,1.5,1.5,1.5,5.0,10.0,10.0,1.5,1.5,1.5}; // pt cuts\r
 Float_t etaMin[numberOfSyst] = {-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-1.0,-0.6,-0.4}; // eta cuts\r
 Float_t etaMax[numberOfSyst] = {0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,1.0,0.6,0.4};   // eta cuts\r
 \r
@@ -43,7 +43,7 @@ void runBalanceFunctionPsi(
          )\r
 {\r
     // check run type\r
-    if(runtype != "local" && runtype != "proof" && runtype != "grid"){\r
+    if(runtype != "local" && runtype != "proof" && runtype != "grid") {\r
         Printf("\n\tIncorrect run option, check first argument of run macro");\r
         Printf("\tint runtype = local, proof or grid\n");\r
         return;\r
@@ -79,9 +79,35 @@ void runBalanceFunctionPsi(
     AliAnalysisManager* mgr = new AliAnalysisManager(Form("%s%i",taskname,bunchN));\r
     \r
     // create the alien handler and attach it to the manager\r
-    AliAnalysisGrid *plugin = CreateAlienHandler(bAOD,bunchN,Form("%s%i",taskname,bunchN), gridmode, proofcluster, Form("%s_%d.txt",proofdataset.Data(),bunchN)); \r
-    mgr->SetGridHandler(plugin);\r
-    \r
+    if(runtype == "grid") {\r
+      AliAnalysisGrid *plugin = CreateAlienHandler(bAOD,bunchN,Form("%s%i",taskname,bunchN), gridmode, proofcluster, Form("%s_%d.txt",proofdataset.Data(),bunchN)); \r
+      mgr->SetGridHandler(plugin);\r
+    }\r
+    else if(runtype == "local") {\r
+      TString filename;\r
+      TChain* chain = 0x0;\r
+      if((!bAOD)&&(!bMCtruth)) {\r
+       chain = new TChain("esdTree");\r
+       for(Int_t i = 0; i < 8; i++) {\r
+         filename = "/data/alice2/pchrist/HeavyIons/Data/2011/Set";\r
+         filename += i; filename += "/AliESDs.root";\r
+         chain->Add(filename.Data());\r
+       }\r
+      }\r
+      else if((bAOD)&&(!bMCtruth)) {\r
+       chain = new TChain("aodTree");\r
+       for(Int_t i = 0; i < 8; i++) {\r
+         filename = "/data/alice2/pchrist/HeavyIons/Data/2011/Set";\r
+         filename += i; filename += "/AliAOD.root";\r
+         chain->Add(filename.Data());\r
+       }\r
+      }\r
+      else if(bMCtruth) {\r
+       chain = new TChain("TE");\r
+       filename = "galice.root";\r
+       chain->Add(filename.Data());\r
+      }\r
+    }//local mode\r
 \r
     // input handler (ESD or AOD)\r
     AliVEventHandler* inputH = NULL;\r
@@ -95,12 +121,12 @@ void runBalanceFunctionPsi(
     \r
     // mc event handler\r
     if(bMCtruth) {\r
-        AliMCEventHandler* mchandler = new AliMCEventHandler();\r
-        // Not reading track references\r
-        mchandler->SetReadTR(kFALSE);\r
-        mgr->SetMCtruthEventHandler(mchandler);\r
+      AliMCEventHandler* mchandler = new AliMCEventHandler();\r
+      // Not reading track references\r
+      mchandler->SetReadTR(kFALSE);\r
+      mgr->SetMCtruthEventHandler(mchandler);\r
     }   \r
-\r
+    \r
     // AOD output handler\r
     //AliAODHandler* aodoutHandler = new AliAODHandler();\r
     //aodoutHandler->SetOutputFileName("aod.root");\r
@@ -177,7 +203,10 @@ void runBalanceFunctionPsi(
   \r
     // start analysis\r
     Printf("Starting Analysis....");\r
-    mgr->StartAnalysis(runtype,nentries,firstentry);\r
+    if(runtype == "local") \r
+      mgr->StartAnalysis("local",chain);\r
+    else\r
+      mgr->StartAnalysis(runtype,nentries,firstentry);\r
 }\r
 \r
 //______________________________________________________________________________\r