coverity fix (AliAnalysisTaskEventMixingBF)
authormiweber <miweber@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 24 Apr 2012 08:30:27 +0000 (08:30 +0000)
committermiweber <miweber@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 24 Apr 2012 08:30:27 +0000 (08:30 +0000)
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskBF.cxx
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskBFPsi.cxx
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskEventMixingBF.cxx

index fba192f..9e9b50c 100755 (executable)
@@ -733,7 +733,7 @@ void AliAnalysisTaskBF::UserExec(Option_t *) {
                    }\r
 \r
                    // Extra DCA cuts (for systematic studies [!= -1])\r
-                   if( fDCAxyCut != -1 && fDCAxyCut != -1){\r
+                   if( fDCAxyCut != -1 && fDCAzCut != -1){\r
                      if(TMath::Sqrt((DCAxy*DCAxy)/(fDCAxyCut*fDCAxyCut)+(DCAz*DCAz)/(fDCAzCut*fDCAzCut)) > 1 ){\r
                        continue;  // 2D cut\r
                      }\r
index 74ef471..256fed3 100755 (executable)
@@ -763,7 +763,7 @@ void AliAnalysisTaskBFPsi::UserExec(Option_t *) {
                    }\r
 \r
                    // Extra DCA cuts (for systematic studies [!= -1])\r
-                   if( fDCAxyCut != -1 && fDCAxyCut != -1){\r
+                   if( fDCAxyCut != -1 && fDCAzCut != -1){\r
                      if(TMath::Sqrt((DCAxy*DCAxy)/(fDCAxyCut*fDCAxyCut)+(DCAz*DCAz)/(fDCAzCut*fDCAzCut)) > 1 ){\r
                        continue;  // 2D cut\r
                      }\r
index 9b9aa62..ecfd846 100755 (executable)
@@ -119,7 +119,10 @@ AliAnalysisTaskEventMixingBF::AliAnalysisTaskEventMixingBF(const char *name)
   fUseFlowAfterBurner(kFALSE),\r
   fExcludeResonancesInMC(kFALSE),\r
   fUseMCPdgCode(kFALSE),\r
-  fPDGCodeToBeAnalyzed(-1) {\r
+  fPDGCodeToBeAnalyzed(-1),\r
+  fMainEvent(0x0),\r
+  fMixEvent(0x0)\r
+{\r
   // Constructor\r
   // Define input and output slots here\r
   // Input slot #0 works with a TChain\r
@@ -387,11 +390,8 @@ void AliAnalysisTaskEventMixingBF::UserExecMix(Option_t *)
 \r
   TString gAnalysisLevel = fBalance->GetAnalysisLevel();\r
 \r
-  TObjArray *array               = new TObjArray();\r
-\r
   AliMixInputEventHandler *mixIEH = SetupEventsForMixing();\r
 \r
-  Int_t gNumberOfAcceptedTracks = 0;\r
   Float_t fCentrality           = 0.;\r
   \r
   // vector holding the charges/kinematics of all tracks (charge,y,eta,phi,p0,p1,p2,pt,E)\r
@@ -427,8 +427,8 @@ void AliAnalysisTaskEventMixingBF::UserExecMix(Option_t *)
        return;\r
       }\r
       \r
-      AliAODHeader *aodHeaderMain = aodEventMain->GetHeader();\r
-      AliAODHeader *aodHeaderMix  = aodEventMix->GetHeader();    \r
+     //AliAODHeader *aodHeaderMain = aodEventMain->GetHeader();\r
+     //AliAODHeader *aodHeaderMix  = aodEventMix->GetHeader();    \r
   \r
 \r
       // event selection done in AliAnalysisTaskSE::Exec() --> this is not used\r
@@ -521,8 +521,8 @@ void AliAnalysisTaskEventMixingBF::UserExecMix(Option_t *)
                      v_pt     = aodTrackMain->Pt();\r
                      aodTrackMain->PxPyPz(v_p);\r
                      \r
-                     Float_t DCAxy = aodTrackMain->DCA();      // this is the DCA from global track (not exactly what is cut on)\r
-                     Float_t DCAz  = aodTrackMain->ZAtDCA();   // this is the DCA from global track (not exactly what is cut on)\r
+                     Float_t DCAxyMain = aodTrackMain->DCA();      // this is the DCA from global track (not exactly what is cut on)\r
+                     Float_t DCAzMain  = aodTrackMain->ZAtDCA();   // this is the DCA from global track (not exactly what is cut on)\r
                      \r
                      \r
                      // Kinematics cuts from ESD track cuts\r
@@ -530,8 +530,8 @@ void AliAnalysisTaskEventMixingBF::UserExecMix(Option_t *)
                      if( v_eta < fEtaMin || v_eta > fEtaMax)  continue;\r
                      \r
                      // Extra DCA cuts (for systematic studies [!= -1])\r
-                     if( fDCAxyCut != -1 && fDCAxyCut != -1){\r
-                       if(TMath::Sqrt((DCAxy*DCAxy)/(fDCAxyCut*fDCAxyCut)+(DCAz*DCAz)/(fDCAzCut*fDCAzCut)) > 1 ){\r
+                     if( fDCAxyCut != -1 && fDCAzCut != -1){\r
+                       if(TMath::Sqrt((DCAxyMain*DCAxyMain)/(fDCAxyCut*fDCAxyCut)+(DCAzMain*DCAzMain)/(fDCAzCut*fDCAzCut)) > 1 ){\r
                          continue;  // 2D cut\r
                        }\r
                      }\r
@@ -546,7 +546,7 @@ void AliAnalysisTaskEventMixingBF::UserExecMix(Option_t *)
                      \r
                      // fill QA histograms\r
                      fHistClus->Fill(aodTrackMain->GetITSNcls(),aodTrackMain->GetTPCNcls());\r
-                     fHistDCA->Fill(DCAz,DCAxy);\r
+                     fHistDCA->Fill(DCAzMain,DCAxyMain);\r
                      fHistChi2->Fill(aodTrackMain->Chi2perNDF());\r
                      fHistPt->Fill(v_pt);\r
                      fHistEta->Fill(v_eta);\r
@@ -588,8 +588,8 @@ void AliAnalysisTaskEventMixingBF::UserExecMix(Option_t *)
                        v_pt     = aodTrackMix->Pt();\r
                        aodTrackMix->PxPyPz(v_p);\r
                      \r
-                       Float_t DCAxy = aodTrackMix->DCA();      // this is the DCA from global track (not exactly what is cut on)\r
-                       Float_t DCAz  = aodTrackMix->ZAtDCA();   // this is the DCA from global track (not exactly what is cut on)\r
+                       Float_t DCAxyMix = aodTrackMix->DCA();      // this is the DCA from global track (not exactly what is cut on)\r
+                       Float_t DCAzMix  = aodTrackMix->ZAtDCA();   // this is the DCA from global track (not exactly what is cut on)\r
                        \r
                        \r
                        // Kinematics cuts from ESD track cuts\r
@@ -598,7 +598,7 @@ void AliAnalysisTaskEventMixingBF::UserExecMix(Option_t *)
                        \r
                        // Extra DCA cuts (for systematic studies [!= -1])\r
                        if( fDCAxyCut != -1 && fDCAxyCut != -1){\r
-                         if(TMath::Sqrt((DCAxy*DCAxy)/(fDCAxyCut*fDCAxyCut)+(DCAz*DCAz)/(fDCAzCut*fDCAzCut)) > 1 ){\r
+                         if(TMath::Sqrt((DCAxyMix*DCAxyMix)/(fDCAxyCut*fDCAxyCut)+(DCAzMix*DCAzMix)/(fDCAzCut*fDCAzCut)) > 1 ){\r
                            continue;  // 2D cut\r
                          }\r
                        }\r
@@ -613,7 +613,7 @@ void AliAnalysisTaskEventMixingBF::UserExecMix(Option_t *)
                        \r
                        // fill QA histograms\r
                        fHistClus->Fill(aodTrackMix->GetITSNcls(),aodTrackMix->GetTPCNcls());\r
-                       fHistDCA->Fill(DCAz,DCAxy);\r
+                       fHistDCA->Fill(DCAzMix,DCAxyMix);\r
                        fHistChi2->Fill(aodTrackMix->Chi2perNDF());\r
                        fHistPt->Fill(v_pt);\r
                        fHistEta->Fill(v_eta);\r
@@ -636,7 +636,7 @@ void AliAnalysisTaskEventMixingBF::UserExecMix(Option_t *)
 \r
                      // calculate balance function for each track in main event\r
                      iMainTrackUsed++; // is needed to do no double counting in Balance Function calculation   \r
-                     if(iMainTrackUsed >= chargeVector[0]->size()) break; //do not allow more tracks than in mixed event!\r
+                     if(iMainTrackUsed >= (Int_t)chargeVector[0]->size()) break; //do not allow more tracks than in mixed event!\r
                      fBalance->CalculateBalance(fCentrality,chargeVector,iMainTrackUsed);\r
                      // clean charge vector afterwards\r
                      for(Int_t i = 0; i < 9; i++){                    \r