Add Shuffled Event Analysis to Triggered BF analysis
authormiweber <miweber@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 May 2012 14:54:56 +0000 (14:54 +0000)
committermiweber <miweber@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 May 2012 14:54:56 +0000 (14:54 +0000)
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskTriggeredBF.cxx

index e781e7c..1ddedf3 100755 (executable)
@@ -253,8 +253,11 @@ void AliAnalysisTaskTriggeredBF::UserExec(Option_t *) {
   \r
   // vector holding the charges/kinematics of all tracks (charge,y,eta,phi,p0,p1,p2,pt,E)\r
   vector<Double_t> *chargeVector[9];          // original charge\r
+  vector<Double_t> *chargeVectorShuffled[9];  // shuffled charge\r
+\r
   for(Int_t i = 0; i < 9; i++){\r
-    chargeVector[i]        = new vector<Double_t>;\r
+    chargeVector[i]         = new vector<Double_t>;\r
+    chargeVectorShuffled[i] = new vector<Double_t>;\r
   }\r
   \r
   Double_t v_charge;\r
@@ -403,14 +406,34 @@ void AliAnalysisTaskTriggeredBF::UserExec(Option_t *) {
                    chargeVector[6]->push_back(v_p[2]);\r
                    chargeVector[7]->push_back(v_pt);\r
                    chargeVector[8]->push_back(v_E);\r
+\r
+                   if(fRunShuffling) {\r
+                     chargeVectorShuffled[0]->push_back(v_charge);\r
+                     chargeVectorShuffled[1]->push_back(v_y);\r
+                     chargeVectorShuffled[2]->push_back(v_eta);\r
+                     chargeVectorShuffled[3]->push_back(v_phi);\r
+                     chargeVectorShuffled[4]->push_back(v_p[0]);\r
+                     chargeVectorShuffled[5]->push_back(v_p[1]);\r
+                     chargeVectorShuffled[6]->push_back(v_p[2]);\r
+                     chargeVectorShuffled[7]->push_back(v_pt);\r
+                     chargeVectorShuffled[8]->push_back(v_E);\r
+                   }\r
                    \r
                  } //track loop\r
                  \r
-                   // calculate balance function\r
+                 // calculate balance function\r
                  fBalance->FillBalance(fCentrality,chargeVector);\r
+                 \r
+                 // calculate shuffled balance function\r
+                 if(fRunShuffling) {\r
+                   random_shuffle(chargeVectorShuffled[0]->begin(), chargeVectorShuffled[0]->end());\r
+                   fShuffledBalance->FillBalance(fCentrality,chargeVectorShuffled);\r
+                 }\r
+\r
                  // clean charge vector afterwards\r
                  for(Int_t i = 0; i < 9; i++){                \r
                    chargeVector[i]->clear();\r
+                   chargeVectorShuffled[i]->clear();\r
                  }\r
 \r
                }//Vz cut\r