]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added daughters' p and pt to the type list of AliRsnMiniValue + modified macros for...
authorfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 2 Aug 2013 06:45:59 +0000 (06:45 +0000)
committerfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 2 Aug 2013 06:45:59 +0000 (06:45 +0000)
PWGLF/RESONANCES/AliRsnMiniPair.cxx
PWGLF/RESONANCES/AliRsnMiniPair.h
PWGLF/RESONANCES/AliRsnMiniValue.cxx
PWGLF/RESONANCES/AliRsnMiniValue.h
PWGLF/RESONANCES/macros/mini/AddAnalysisTaskTOFKStar.C
PWGLF/RESONANCES/macros/mini/AddMonitorOutput.C
PWGLF/RESONANCES/macros/mini/ConfigTOFanalysisKStar.C

index 31a2dfe3a757e011a9ba3717cae88eb01ec6e1a6..cef3a02e36a47051b634df863c827b9146bc16c6 100644 (file)
@@ -83,3 +83,98 @@ void AliRsnMiniPair::InvertP(Bool_t first)
       fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), fRef[i].M());
    }
 }
+
+//__________________________________________________________________________________________________
+void AliRsnMiniPair::FillRef(Double_t mass)
+{
+//
+// Fill ref 4-vectors using the passed mass and the values in 'sum'
+//
+
+   Int_t i;
+   for (i = 0; i < 2; i++) {
+      fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), mass);
+   }
+}
+
+//__________________________________________________________________________________________________
+Double_t AliRsnMiniPair::InvMassRes() const
+{
+//
+// Return invariant mass resolution
+//
+
+   if (fSum[1].M() <= 0.0) return 1E20;
+
+   return (fSum[0].M() - fSum[1].M()) / fSum[1].M();
+}
+
+//__________________________________________________________________________________________________
+Double_t AliRsnMiniPair::InvMassDiff() const
+{
+//
+// Return invariant mass resolution
+//
+
+   if (fSum[1].M() <= 0.0) return 1E20;
+
+   return (fSum[0].M() - fSum[1].M());
+}
+
+//__________________________________________________________________________________________________
+Double_t AliRsnMiniPair::PtRatio(Bool_t mc) const
+{
+//
+// Return ratio of transverse momenta of daughters
+//
+
+   Double_t num = TMath::Abs(fP1[ID(mc)].Perp() - fP2[ID(mc)].Perp());
+   Double_t den = TMath::Abs(fP1[ID(mc)].Perp() + fP2[ID(mc)].Perp());
+
+   if (den <= 0.0) return 1E20;
+
+   return num / den;
+}
+
+//__________________________________________________________________________________________________
+Double_t AliRsnMiniPair::DipAngle(Bool_t mc) const
+{
+//
+// Opening angle in a Z-T space
+//
+
+   const TLorentzVector &p1 = fP1[ID(mc)];
+   const TLorentzVector &p2 = fP2[ID(mc)];
+
+   return ((p1.Perp() * p2.Perp() + p1.Z() * p2.Z()) / p1.Mag() / p2.Mag());
+}
+
+//__________________________________________________________________________________________________
+Double_t AliRsnMiniPair::DaughterPt(Int_t daughterId, Bool_t mc)
+{
+  //returns pt of the <id> daughter 
+  // if MC returns generated momenta
+  if (daughterId==0)
+    return fP1[ID(mc)].Pt();
+  else 
+    return fP2[ID(mc)].Pt();
+}
+
+//__________________________________________________________________________________________________
+void AliRsnMiniPair::DaughterPxPyPz(Int_t daughterId, Bool_t mc, Double_t *pxpypz)
+{
+  //returns px,py,pz of the <id> daughter by saving them into pxpypz
+  // if MC returns generated momenta
+  if (!pxpypz)    return;
+  if (daughterId==0){
+    pxpypz[0]=fP1[ID(mc)].Px();
+    pxpypz[1]=fP1[ID(mc)].Py();
+    pxpypz[2]=fP1[ID(mc)].Pz();
+  } else {
+    pxpypz[0]=fP2[ID(mc)].Px();
+    pxpypz[1]=fP2[ID(mc)].Py();
+    pxpypz[2]=fP2[ID(mc)].Pz();
+  }
+  return;
+}
index 7b5317f5df635e4cb963cb1b383d433eec079f55..e64a94947785e7d3877c2230475a0c859953234d 100644 (file)
@@ -41,78 +41,20 @@ public:
    Double_t        PtRatio(Bool_t mc)        const;
    Double_t        DipAngle(Bool_t mc)       const;
    Double_t        CosThetaStar(Bool_t mc);
-
-private:
-
+   Double_t        DaughterPt(Int_t daughterId, Bool_t mc); 
+   void            DaughterPxPyPz(Int_t daughterId, Bool_t mc, Double_t *pxpypz); 
+      
+ private:
+   
    TLorentzVector fP1 [2];    // 1st daughter momentum
    TLorentzVector fP2 [2];    // 2nd daughter momentum
    TLorentzVector fSum[2];    // sum of momenta
    TLorentzVector fRef[2];    // same as 'fSum' but with nominal resonance mass
-
+   
    Int_t          fMother;    // label of mothers (when common)
    Int_t          fMotherPDG; // PDG code of mother (when common)
-
+   
    ClassDef(AliRsnMiniPair,1)
-};
-
-inline void AliRsnMiniPair::FillRef(Double_t mass)
-{
-//
-// Fill ref 4-vectors using the passed mass and the values in 'sum'
-//
-
-   Int_t i;
-   for (i = 0; i < 2; i++) {
-      fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), mass);
-   }
-}
-
-inline Double_t AliRsnMiniPair::InvMassRes() const
-{
-//
-// Return invariant mass resolution
-//
-
-   if (fSum[1].M() <= 0.0) return 1E20;
-
-   return (fSum[0].M() - fSum[1].M()) / fSum[1].M();
-}
-
-inline Double_t AliRsnMiniPair::InvMassDiff() const
-{
-//
-// Return invariant mass resolution
-//
-
-   if (fSum[1].M() <= 0.0) return 1E20;
-
-   return (fSum[0].M() - fSum[1].M());
-}
-
-inline Double_t AliRsnMiniPair::PtRatio(Bool_t mc) const
-{
-//
-// Return ratio of transverse momenta of daughters
-//
-
-   Double_t num = TMath::Abs(fP1[ID(mc)].Perp() - fP2[ID(mc)].Perp());
-   Double_t den = TMath::Abs(fP1[ID(mc)].Perp() + fP2[ID(mc)].Perp());
-
-   if (den <= 0.0) return 1E20;
-
-   return num / den;
-}
-
-inline Double_t AliRsnMiniPair::DipAngle(Bool_t mc) const
-{
-//
-// Opening angle in a Z-T space
-//
-
-   const TLorentzVector &p1 = fP1[ID(mc)];
-   const TLorentzVector &p2 = fP2[ID(mc)];
-
-   return ((p1.Perp() * p2.Perp() + p1.Z() * p2.Z()) / p1.Mag() / p2.Mag());
-}
+     };
 
 #endif
index 617b09c8962d9aa4e30ab6fd0dfa4b2d98fc3486..0b176e7d195965e2e999a4871e4848ee9fcfac6a 100644 (file)
@@ -111,6 +111,10 @@ const char *AliRsnMiniValue::TypeName(EType type)
       case kDipAngle:     return "DipAngle";
       case kCosThetaStar: return "CosThetaStar";
       case kAngleLeading: return "AngleToLeading";
+      case kFirstDaughterPt: return "FirstDaughterPt";  
+      case kSecondDaughterPt: return "SecondDaughterPt";  
+      case kFirstDaughterP: return "FirstDaughterP";  
+      case kSecondDaughterP: return "SecondDaughterP";  
       default:            return "Undefined";
    }
 }
@@ -134,6 +138,8 @@ Float_t AliRsnMiniValue::Eval(AliRsnMiniPair *pair, AliRsnMiniEvent *event)
    // the computation is not doable due to any problem
    // (not initialized support object, wrong values, risk of floating point errors)
    // the method returng kFALSE and sets the computed value to a meaningless number
+   Double_t p3[3]={0.,0.,0.};
    switch (fType) {
          // ---- event values -------------------------------------------------------------------------
       case kVz:
@@ -166,7 +172,17 @@ Float_t AliRsnMiniValue::Eval(AliRsnMiniPair *pair, AliRsnMiniEvent *event)
          return pair->CosThetaStar(fUseMCInfo);
       case kAngleLeading:
          AliWarning("This method is not yet implemented");
-         return 1E20;
+        return 1E20;
+      case kFirstDaughterPt:
+         return pair->DaughterPt(0,fUseMCInfo);
+      case kSecondDaughterPt:
+         return pair->DaughterPt(1,fUseMCInfo);
+      case kFirstDaughterP:
+        pair->DaughterPxPyPz(0,fUseMCInfo, p3);
+         return TMath::Sqrt(p3[0]*p3[0]+p3[1]*p3[1]+p3[2]*p3[2]);
+      case kSecondDaughterP:
+        pair->DaughterPxPyPz(1,fUseMCInfo, p3);
+         return TMath::Sqrt(p3[0]*p3[0]+p3[1]*p3[1]+p3[2]*p3[2]);
       default:
          AliError("Invalid value type");
          return 1E20;
index e938d0f22db619dada6348675cd0483ba999ca09..eea1160c2bc9a78d2c4d957610be20d5db29d7a9 100644 (file)
@@ -34,6 +34,10 @@ public:
       kDipAngle,      // inverse cosine of the angle between daughter vector momenta
       kCosThetaStar,  // polarization angle
       kAngleLeading,  // angle to leading particle
+      kFirstDaughterPt,  //pt of the first daughter of the pair
+      kSecondDaughterPt, //pt of the second daughter of the pair
+      kFirstDaughterP,   //p of the first daughter of the pair
+      kSecondDaughterP,  //p of the second daughter of the pair
       kTypes          // -- general limit ----------------------------------------------------------
    };
 
index 900e484179921c1c6909809bae713e259896d13a..6cde88f044a9394bd131027047d77bd16e5e5199 100644 (file)
@@ -36,14 +36,14 @@ AliRsnMiniAnalysisTask * AddAnalysisTaskTOFKStar
    Int_t       signedPdg = 313,
    TString     monitorOpt = "",
    Double_t    minYlab =  -0.5,
-   Double_t    maxYlab =  0.5
-)
+   Double_t    maxYlab =  0.5,
+   AliRsnMiniValue::EType yaxisvar = AliRsnMiniValue::kPt                
+ )
 {  
   //
   // -- INITIALIZATION ----------------------------------------------------------------------------
   // retrieve analysis manager
   //
-
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
    if (!mgr) {
       ::Error("AddAnalysisTaskTOFKStar", "No analysis manager to connect to.");
@@ -143,7 +143,7 @@ AliRsnMiniAnalysisTask * AddAnalysisTaskTOFKStar
        Printf("========================== MC analysis - PID cuts used");
    } else 
      Printf("========================== DATA analysis - PID cuts used");
-   if (!ConfigTOFanalysisKStar(task, isMC, isPP, "", cutsPair, aodFilterBit, cutPiCandidate, cutKaCandidate, nsigmaPi, nsigmaKa, enableMonitor, isMC&IsMcTrueOnly, useMixLS, signedPdg, monitorOpt.Data())) return 0x0;
+   if (!ConfigTOFanalysisKStar(task, isMC, isPP, "", cutsPair, aodFilterBit, cutPiCandidate, cutKaCandidate, nsigmaPi, nsigmaKa, enableMonitor, isMC&IsMcTrueOnly, useMixLS, signedPdg, monitorOpt.Data(), yaxisvar)) return 0x0;
    
    //
    // -- CONTAINERS --------------------------------------------------------------------------------
index 6a03d05d17047b4f7dd6e40cd6e6d30aad56d3b0..b5cf6b0caaa4cb305a30a295d6829946005d6941 100644 (file)
@@ -245,6 +245,14 @@ void AddMonitorOutput(Bool_t useMCMon = 0, TObjArray *mon=0,TString opt="",AliRs
   /****************************************************************/
   /***************       MONITOR TOF           ********************/
   /****************************************************************/
+  // output:3D histogram of TOF Nsigma pi vs. TPC Nsigma pi vs momentum
+  AliRsnListOutput *outMonitorTOFvsTPCnsigmaPi = new AliRsnListOutput("TOFnsigmaPi_TPCnsigmaPi", AliRsnListOutput::kHistoDefault);
+  outMonitorTOFvsTPCnsigmaPi->AddValue(axisTOFnsigmaPi);
+  outMonitorTOFvsTPCnsigmaPi->AddValue(axisTPCnsigmaPi);
+  outMonitorTOFvsTPCnsigmaPi->AddValue(axisMomP);
+  if (mon) mon->Add(outMonitorTOFvsTPCnsigmaPi);
+  if (lm) lm->AddOutput(outMonitorTOFvsTPCnsigmaPi);
+  
   // // output: 2D histogram of TOF signal vs. momentum
   // AliRsnListOutput *outMonitorTimeTOF = new AliRsnListOutput("time_VsP", AliRsnListOutput::kHistoDefault);
   // outMonitorTimeTOF->AddValue(axisMomP);
index b39fcd1bcdbf71cb5e7c356bea7611d3a9ebc5f5..657cc21a6ca63e5093b68d037a5a21e3ee017acd 100644 (file)
@@ -27,7 +27,8 @@ Bool_t ConfigTOFanalysisKStar
     Bool_t                 IsMcTrueOnly = kFALSE,
     Bool_t                 useMixLS = 0,
     Int_t                  signedPdg = 313,
-    TString                monitorOpt = ""
+    TString                monitorOpt = "",
+    AliRsnMiniValue::EType yaxisVar = AliRsnMiniValue::kPt                
 )
 {
   // manage suffix
@@ -61,6 +62,10 @@ Bool_t ConfigTOFanalysisKStar
   /* centrality       */ Int_t centID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE);
   /* pseudorapidity   */ Int_t etaID  = task->CreateValue(AliRsnMiniValue::kEta, kFALSE);
   /* rapidity         */ Int_t yID    = task->CreateValue(AliRsnMiniValue::kY, kFALSE);
+  /* 1st daughter pt  */ Int_t fdpt   = task->CreateValue(AliRsnMiniValue::kFirstDaughterPt, kFALSE);
+  /* 2nd daughter pt  */ Int_t sdpt   = task->CreateValue(AliRsnMiniValue::kSecondDaughterPt, kFALSE);
+  /* 1st daughter p   */ Int_t fdp    = task->CreateValue(AliRsnMiniValue::kFirstDaughterP, kFALSE);
+  /* 2nd daughter p   */ Int_t sdp    = task->CreateValue(AliRsnMiniValue::kSecondDaughterP, kFALSE);
 
   // -- Create all needed outputs -----------------------------------------------------------------
   // use an array for more compact writing, which are different on mixing and charges
@@ -68,6 +73,7 @@ Bool_t ConfigTOFanalysisKStar
   // [1] = mixing
   // [2] = like ++
   // [3] = like --
+
   Bool_t  use     [12] = { !IsMcTrueOnly,  !IsMcTrueOnly,  !IsMcTrueOnly,  !IsMcTrueOnly ,  !IsMcTrueOnly, !IsMcTrueOnly,  isMC   ,   isMC   ,  isMC   ,   isMC , useMixLS, useMixLS  };
   Bool_t  useIM   [12] = { 1       ,  1       ,  1       ,  1       ,  1      ,  1      ,  1      ,   1      ,  0      ,   0 , 1    , 1     };
   TString name    [12] = {"UnlikePM", "UnlikeMP", "MixingPM", "MixingMP", "LikePP", "LikeMM", "TruesPM",  "TruesMP", "ResPM"  ,  "ResMP",  "MixingPP",  "MixingMM"  };
@@ -98,39 +104,51 @@ Bool_t ConfigTOFanalysisKStar
     else
       out->AddAxis(resID, 200, -0.02, 0.02);
     
-    // axis Y: transverse momentum
-    out->AddAxis(ptID, 100, 0.0, 10.0);
-    
+    // axis Y: transverse momentum of pair as default - else chosen value
+    if (yaxisVar==AliRsnMiniValue::kFirstDaughterPt)
+      out->AddAxis(fdpt, 100, 0.0, 10.0);
+    else
+      if (yaxisVar==AliRsnMiniValue::kSecondDaughterPt)
+       out->AddAxis(sdpt, 100, 0.0, 10.0);
+      else
+       if (yaxisVar==AliRsnMiniValue::kFirstDaughterP)
+         out->AddAxis(fdp, 100, 0.0, 10.0);
+       else
+         if (yaxisVar==AliRsnMiniValue::kSecondDaughterP)
+           out->AddAxis(sdp, 100, 0.0, 10.0);
+         else 
+           out->AddAxis(ptID, 100, 0.0, 10.0); //default use mother pt
+
     // axis Z: centrality-multiplicity
     if (!isPP)
       out->AddAxis(centID, 100, 0.0, 100.0);
     else 
       out->AddAxis(centID, 400, 0.0, 400.0);
-      
+    
     // axis W: pseudorapidity
-    //    out->AddAxis(etaID, 20, -1.0, 1.0);
+    // out->AddAxis(etaID, 20, -1.0, 1.0);
     // axis J: rapidity
     // out->AddAxis(yID, 10, -0.5, 0.5);
     
   }   
   
   if (isMC){   
-   // create output
+    // create output
     AliRsnMiniOutput *outm = task->CreateOutput(Form("kstar_Mother%s", suffix), "SPARSE", "MOTHER");
-   outm->SetDaughter(0, AliRsnDaughter::kKaon);
-   outm->SetDaughter(1, AliRsnDaughter::kPion);
-   outm->SetMotherPDG(signedPdg);
-   outm->SetMotherMass(0.89594);
-   // pair cuts
-   outm->SetPairCuts(cutsPair);
-   // binnings
-   outm->AddAxis(imID, 90, 0.6, 1.5);
-   outm->AddAxis(ptID, 100, 0.0, 10.0);
-   if (!isPP){
-     outm->AddAxis(centID, 100, 0.0, 100.0);
-   }   else    { 
-     outm->AddAxis(centID, 400, 0.0, 400.0);
-   }
+    outm->SetDaughter(0, AliRsnDaughter::kKaon);
+    outm->SetDaughter(1, AliRsnDaughter::kPion);
+    outm->SetMotherPDG(signedPdg);
+    outm->SetMotherMass(0.89594);
+    // pair cuts
+    outm->SetPairCuts(cutsPair);
+    // binnings
+    outm->AddAxis(imID, 90, 0.6, 1.5);
+    outm->AddAxis(ptID, 100, 0.0, 10.0);
+    if (!isPP){
+      outm->AddAxis(centID, 100, 0.0, 100.0);
+    }   else    { 
+      outm->AddAxis(centID, 400, 0.0, 400.0);
+    }
   }
   return kTRUE;
 }