changing correlation loop over tracks in mixing mode (not breaking if N2 gt N1) ...
authormiweber <miweber@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 Jan 2013 10:45:30 +0000 (10:45 +0000)
committermiweber <miweber@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 Jan 2013 10:45:30 +0000 (10:45 +0000)
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskBFPsi.cxx
PWGCF/EBYE/BalanceFunctions/AliBalancePsi.cxx

index 0f2b671..5a2b626 100755 (executable)
@@ -256,10 +256,10 @@ void AliAnalysisTaskBFPsi::UserCreateOutputObjects() {
     fHistCentStats->GetXaxis()->SetBinLabel(i,gCentName[i-1].Data());\r
   fList->Add(fHistCentStats);\r
 \r
-  fHistTriggerStats = new TH1F("fHistTriggerStats","Trigger statistics;TriggerBit;N_{events}",130,0,130);\r
+  fHistTriggerStats = new TH1F("fHistTriggerStats","Trigger statistics;TriggerBit;N_{events}",1025,0,1025);\r
   fList->Add(fHistTriggerStats);\r
 \r
-  fHistTrackStats = new TH1F("fHistTrackStats","Event statistics;TrackFilterBit;N_{events}",130,0,130);\r
+  fHistTrackStats = new TH1F("fHistTrackStats","Event statistics;TrackFilterBit;N_{events}",16,0,16);\r
   fList->Add(fHistTrackStats);\r
 \r
   fHistNumberOfAcceptedTracks = new TH2F("fHistNumberOfAcceptedTracks",";N_{acc.};Centrality percentile;Entries",4001,-0.5,4000.5,220,-5,105);\r
@@ -737,7 +737,6 @@ Double_t AliAnalysisTaskBFPsi::GetRefMultiOrCentrality(AliVEvent *event){
   Double_t fMultiplicity = -100.;\r
   TString gAnalysisLevel = fBalance->GetAnalysisLevel();\r
   if(fEventClass == "Centrality"){\r
-    Bool_t isSelectedMain = kTRUE;\r
     \r
 \r
     if(gAnalysisLevel == "AOD") { //centrality in AOD header\r
@@ -847,7 +846,10 @@ TObjArray* AliAnalysisTaskBFPsi::GetAcceptedTracks(AliVEvent *event, Double_t fC
       \r
       // For ESD Filter Information: ANALYSIS/macros/AddTaskESDfilter.C\r
       // take only TPC only tracks \r
-      fHistTrackStats->Fill(aodTrack->GetFilterMap());\r
+      //fHistTrackStats->Fill(aodTrack->GetFilterMap());\r
+      for(Int_t iTrackBit = 0; iTrackBit < 16; iTrackBit++){\r
+       fHistTrackStats->Fill(iTrackBit,aodTrack->TestFilterBit(1<<iTrackBit));\r
+      }\r
       if(!aodTrack->TestFilterBit(nAODtrackCutBit)) continue;\r
       \r
       vCharge = aodTrack->Charge();\r
index 38db407..8b274fc 100644 (file)
@@ -339,11 +339,13 @@ void AliBalancePsi::CalculateBalance(Double_t gReactionPlane,
   TArrayF secondEta(jMax);
   TArrayF secondPhi(jMax);
   TArrayF secondPt(jMax);
+  TArrayS secondCharge(jMax);
 
   for (Int_t i=0; i<jMax; i++){
     secondEta[i] = ((AliVParticle*) particlesSecond->At(i))->Eta();
     secondPhi[i] = ((AliVParticle*) particlesSecond->At(i))->Phi();
     secondPt[i]  = ((AliVParticle*) particlesSecond->At(i))->Pt();
+    secondCharge[i]  = (Short_t)((AliVParticle*) particlesSecond->At(i))->Charge();
   }
   
   // 1st particle loop
@@ -389,18 +391,12 @@ void AliBalancePsi::CalculateBalance(Double_t gReactionPlane,
     if(charge1 > 0)      fHistP->Fill(trackVariablesSingle,0,1.); 
     else if(charge1 < 0) fHistN->Fill(trackVariablesSingle,0,1.);  
     
-    // 2nd particle loop (only for j < i for non double counting in the same pT region)
-    // --> SAME pT region for trigger and assoc: NO double counting with this
-    // --> DIFF pT region for trigger and assoc: Missing assoc. particles with j > i to a trigger i 
-    //                          --> can be handled afterwards by using assoc. as trigger as well ?!     
-    for(Int_t j = 0; j < iMax; j++) {  
-      if (particlesMixed && j == jMax-1 )  // if the mixed track number is smaller than the main event one 
-       break;
-
-      if(j == i) continue; // no auto correlations
-      
-      AliVParticle* secondParticle = (AliVParticle*) particlesSecond->At(j);
-      Short_t charge2 = (Short_t) secondParticle->Charge();
+    // 2nd particle loop
+    for(Int_t j = 0; j < jMax; j++) {   
+
+      if(!particlesMixed && j == i) continue; // no auto correlations (only for non mixing)
+
+      Short_t charge2 = secondCharge[j];
       
       trackVariablesPair[0]    =  trackVariablesSingle[0];
       trackVariablesPair[1]    =  firstEta - secondEta[j];  // delta eta