Updates in Balance Function Tasks:
authormiweber <miweber@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Aug 2013 12:44:03 +0000 (12:44 +0000)
committermiweber <miweber@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Aug 2013 12:44:03 +0000 (12:44 +0000)
1) Coverity fix
2) Option to change the Two-Track-Efficiency cut value (called HBTcut here)
3) Option to change from reconstructed to MC information when filling kinematics information of particles (only in MCAODrec mode).

PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskBFPsi.cxx
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskBFPsi.h
PWGCF/EBYE/BalanceFunctions/AliBalancePsi.cxx
PWGCF/EBYE/BalanceFunctions/AliBalancePsi.h
PWGCF/EBYE/macros/AddTaskBalancePsiCentralityTrain.C
PWGCF/EBYE/macros/configBalanceFunctionPsiAnalysis.C

index 9022e55..907d81b 100755 (executable)
@@ -136,6 +136,7 @@ AliAnalysisTaskBFPsi::AliAnalysisTaskBFPsi(const char *name)
   fUseOfflineTrigger(kFALSE),\r
   fCheckFirstEventInChunk(kFALSE),\r
   fCheckPileUp(kFALSE),\r
+  fUseMCforKinematics(kFALSE),\r
   fVxMax(0.3),\r
   fVyMax(0.3),\r
   fVzMax(10.),\r
@@ -1383,6 +1384,7 @@ TObjArray* AliAnalysisTaskBFPsi::GetAcceptedTracks(AliVEvent *event, Double_t gC
     AliMCEvent* mcEvent = MCEvent();\r
     if (!mcEvent) {\r
        AliError("ERROR: Could not retrieve MC event");\r
+       return tracksAccepted;\r
     }\r
      \r
     for (Int_t iTracks = 0; iTracks < event->GetNumberOfTracks(); iTracks++) {\r
@@ -1402,6 +1404,27 @@ TObjArray* AliAnalysisTaskBFPsi::GetAcceptedTracks(AliVEvent *event, Double_t gC
       vY      = aodTrack->Y();\r
       vPhi    = aodTrack->Phi();// * TMath::RadToDeg();\r
       vPt     = aodTrack->Pt();\r
+      \r
+      //===========================use MC information for Kinematics===============================//              \r
+      if(fUseMCforKinematics){\r
+\r
+       Int_t label = TMath::Abs(aodTrack->GetLabel());\r
+       AliAODMCParticle *AODmcTrack = (AliAODMCParticle*) fArrayMC->At(label);\r
+\r
+       if(AODmcTrack){\r
+         vCharge = AODmcTrack->Charge();\r
+         vEta    = AODmcTrack->Eta();\r
+         vY      = AODmcTrack->Y();\r
+         vPhi    = AODmcTrack->Phi();// * TMath::RadToDeg();\r
+         vPt     = AODmcTrack->Pt();\r
+       }\r
+       else{\r
+         AliDebug(1, "no MC particle for this track"); \r
+         continue;\r
+       }\r
+      }\r
+      //===========================end of use MC information for Kinematics========================//              \r
+\r
 \r
       //===========================PID (so far only for electron rejection)===============================//               \r
       if(fElectronRejection) {\r
index a6fbe54..a95939f 100755 (executable)
@@ -128,6 +128,7 @@ class AliAnalysisTaskBFPsi : public AliAnalysisTaskSE {
   void UseOfflineTrigger() {fUseOfflineTrigger = kTRUE;}\r
   void CheckFirstEventInChunk() {fCheckFirstEventInChunk = kTRUE;}\r
   void CheckPileUp() {fCheckPileUp = kTRUE;}\r
+  void UseMCforKinematics() {fUseMCforKinematics = kTRUE;}\r
   \r
   //Acceptance filter\r
   void SetAcceptanceParameterization(TF1 *parameterization) {\r
@@ -286,6 +287,7 @@ class AliAnalysisTaskBFPsi : public AliAnalysisTaskSE {
   Bool_t fUseOfflineTrigger;//Usage of the offline trigger selection\r
   Bool_t fCheckFirstEventInChunk;//Usage of the "First Event in Chunk" check (not needed for new productions)\r
   Bool_t fCheckPileUp;//Usage of the "Pile-Up" event check\r
+  Bool_t fUseMCforKinematics;//Usage of MC information for filling the kinematics information of particles (only in MCAODrec mode)\r
 \r
   Double_t fVxMax;//vxmax\r
   Double_t fVyMax;//vymax\r
index 755cc61..1695d85 100644 (file)
@@ -76,6 +76,7 @@ AliBalancePsi::AliBalancePsi() :
   fDeltaEtaMax(2.0),
   fResonancesCut(kFALSE),
   fHBTCut(kFALSE),
+  fHBTCutValue(0.02),
   fConversionCut(kFALSE),
   fInvMassCutConversion(0.04),
   fQCut(kFALSE),
@@ -114,6 +115,7 @@ AliBalancePsi::AliBalancePsi(const AliBalancePsi& balance):
   fDeltaEtaMax(balance.fDeltaEtaMax),
   fResonancesCut(balance.fResonancesCut),
   fHBTCut(balance.fHBTCut),
+  fHBTCutValue(balance.fHBTCutValue),
   fConversionCut(balance.fConversionCut),
   fInvMassCutConversion(balance.fInvMassCutConversion),
   fQCut(balance.fQCut),
@@ -596,7 +598,7 @@ void AliBalancePsi::CalculateBalance(Double_t gReactionPlane,
        fHistHBTbefore->Fill(deta,dphi);
        
        // optimization
-       if (TMath::Abs(deta) < 0.02 * 2.5 * 3) //twoTrackEfficiencyCutValue = 0.02 [default for dphicorrelations]
+       if (TMath::Abs(deta) < fHBTCutValue * 2.5 * 3) //fHBTCutValue = 0.02 [default for dphicorrelations]
          {
            // phi in rad
            //Float_t phi1rad = firstPhi*TMath::DegToRad();
index 8a3304e..79883cc 100644 (file)
@@ -204,7 +204,8 @@ class AliBalancePsi : public TObject {
   TH3D *GetQAHistQafter() {return fHistQafter;}
 
   void UseResonancesCut() {fResonancesCut = kTRUE;}
-  void UseHBTCut() {fHBTCut = kTRUE;}
+  void UseHBTCut(Double_t setHBTCutValue = 0.02) {
+    fHBTCut = kTRUE; fHBTCutValue = setHBTCutValue;}
   void UseConversionCut(Double_t setInvMassCutConversion = 0.04) {
     fConversionCut = kTRUE; fInvMassCutConversion = setInvMassCutConversion; }
   void UseMomentumDifferenceCut(Double_t gDeltaPtCutMin) {
@@ -247,6 +248,7 @@ class AliBalancePsi : public TObject {
 
   Bool_t fResonancesCut;//resonances cut
   Bool_t fHBTCut;//cut for two-track efficiency (like HBT group)
+  Double_t fHBTCutValue;// value for two-track efficiency cut (default = 0.02 from dphicorrelations)
   Bool_t fConversionCut;//conversion cut
   Double_t fInvMassCutConversion;//invariant mass for conversion cut
   Bool_t fQCut;//cut on momentum difference to suppress femtoscopic effect correlations
index 3a2caf2..eea05a6 100644 (file)
@@ -33,6 +33,7 @@ AliAnalysisTaskBFPsi *AddTaskBalancePsiCentralityTrain(Double_t centrMin=0.,
                                                       Bool_t kUsePID = kFALSE,\r
                                                       Bool_t bResonancesCut = kTRUE,\r
                                                       Bool_t bHBTcut = kTRUE,\r
+                                                      Double_t HBTCutValue = 0.02,\r
                                                       Bool_t bConversionCut = kTRUE,\r
                                                       Double_t invMassForConversionCut = 0.04,\r
                                                       Bool_t bMomentumDifferenceCut = kTRUE,\r
@@ -87,29 +88,29 @@ AliAnalysisTaskBFPsi *AddTaskBalancePsiCentralityTrain(Double_t centrMin=0.,
   Double_t deltaEtaMax=TMath::Abs(etaMax-etaMin);\r
 \r
   if (analysisType=="ESD"){\r
-    bf  = GetBalanceFunctionObject("ESD",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
-    if(gRunShuffling) bfs = GetBalanceFunctionObject("ESD",centralityEstimator,centrMin,centrMax,kTRUE,bResonancesCut,bHBTcut,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
-    if(gRunMixing)    bfm = GetBalanceFunctionObject("ESD",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
+    bf  = GetBalanceFunctionObject("ESD",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,HBTCutValue,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
+    if(gRunShuffling) bfs = GetBalanceFunctionObject("ESD",centralityEstimator,centrMin,centrMax,kTRUE,bResonancesCut,bHBTcut,HBTCutValue,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
+    if(gRunMixing)    bfm = GetBalanceFunctionObject("ESD",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,HBTCutValue,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
   }\r
   else if (analysisType=="AOD"){\r
-    bf  = GetBalanceFunctionObject("AOD",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
-    if(gRunShuffling) bfs = GetBalanceFunctionObject("AOD",centralityEstimator,centrMin,centrMax,kTRUE,bResonancesCut,bHBTcut,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
-    if(gRunMixing)    bfm = GetBalanceFunctionObject("AOD",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
+    bf  = GetBalanceFunctionObject("AOD",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,HBTCutValue,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
+    if(gRunShuffling) bfs = GetBalanceFunctionObject("AOD",centralityEstimator,centrMin,centrMax,kTRUE,bResonancesCut,bHBTcut,HBTCutValue,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
+    if(gRunMixing)    bfm = GetBalanceFunctionObject("AOD",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,HBTCutValue,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
   }\r
   else if (analysisType=="MC"){\r
-    bf  = GetBalanceFunctionObject("MC",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
-    if(gRunShuffling) bfs = GetBalanceFunctionObject("MC",centralityEstimator,centrMin,centrMax,kTRUE,bResonancesCut,bHBTcut,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
-    if(gRunMixing)    bfm = GetBalanceFunctionObject("MC",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
+    bf  = GetBalanceFunctionObject("MC",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,HBTCutValue,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
+    if(gRunShuffling) bfs = GetBalanceFunctionObject("MC",centralityEstimator,centrMin,centrMax,kTRUE,bResonancesCut,bHBTcut,HBTCutValue,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
+    if(gRunMixing)    bfm = GetBalanceFunctionObject("MC",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,HBTCutValue,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
   }\r
   else if (analysisType=="MCAOD"){\r
-    bf  = GetBalanceFunctionObject("MCAOD",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
-    if(gRunShuffling) bfs = GetBalanceFunctionObject("MCAOD",centralityEstimator,centrMin,centrMax,kTRUE,bResonancesCut,bHBTcut,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
-    if(gRunMixing)    bfm = GetBalanceFunctionObject("MCAOD",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
+    bf  = GetBalanceFunctionObject("MCAOD",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,HBTCutValue,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
+    if(gRunShuffling) bfs = GetBalanceFunctionObject("MCAOD",centralityEstimator,centrMin,centrMax,kTRUE,bResonancesCut,bHBTcut,HBTCutValue,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
+    if(gRunMixing)    bfm = GetBalanceFunctionObject("MCAOD",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,HBTCutValue,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
   }\r
   else if (analysisType=="MCAODrec"){\r
-    bf  = GetBalanceFunctionObject("MCAODrec",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
-    if(gRunShuffling) bfs = GetBalanceFunctionObject("MCAODrec",centralityEstimator,centrMin,centrMax,kTRUE,bResonancesCut,bHBTcut,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
-    if(gRunMixing)    bfm = GetBalanceFunctionObject("MCAODrec",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
+    bf  = GetBalanceFunctionObject("MCAODrec",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,HBTCutValue,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
+    if(gRunShuffling) bfs = GetBalanceFunctionObject("MCAODrec",centralityEstimator,centrMin,centrMax,kTRUE,bResonancesCut,bHBTcut,HBTCutValue,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
+    if(gRunMixing)    bfm = GetBalanceFunctionObject("MCAODrec",centralityEstimator,centrMin,centrMax,kFALSE,bResonancesCut,bHBTcut,HBTCutValue,bConversionCut,invMassForConversionCut,bMomentumDifferenceCut,fQCutMin,fArgEventClass,deltaEtaMax,bVertexBinning);\r
   }\r
   else{\r
     ::Error("AddTaskBF", "analysis type NOT known.");\r
index 41bd8c8..8106170 100644 (file)
@@ -6,6 +6,7 @@ AliBalancePsi *GetBalanceFunctionObject(const char* analysisLevel = "MCAOD",   /
                                        Bool_t bShuffle = kFALSE,\r
                                        Bool_t bResonancesCut = kFALSE,\r
                                        Bool_t bHBTCut = kFALSE,\r
+                                       Double_t HBTCutValue = 0.02,\r
                                        Bool_t bConversionCut = kFALSE,\r
                                        Double_t invMassForConversionCut = 0.04,\r
                                        Bool_t bMomentumDifferenceCut = kFALSE,\r
@@ -18,7 +19,7 @@ AliBalancePsi *GetBalanceFunctionObject(const char* analysisLevel = "MCAOD",   /
   gBalance->SetAnalysisLevel(analysisLevel);\r
   gBalance->SetShuffle(bShuffle);\r
   if(bResonancesCut) gBalance->UseResonancesCut();\r
-  if(bHBTCut) gBalance->UseHBTCut();\r
+  if(bHBTCut) gBalance->UseHBTCut(HBTCutValue);\r
   if(bConversionCut) gBalance->UseConversionCut(invMassForConversionCut);\r
   if(bMomentumDifferenceCut) gBalance->UseMomentumDifferenceCut(fQCutMin);\r
   if(centralityName) gBalance->SetCentralityIdentifier(centralityName);\r