]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/RESONANCES/AliRsnMiniValue.cxx
Merge branch 'flatdev' of https://git.cern.ch/reps/AliRoot into flatdev
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnMiniValue.cxx
index 0b176e7d195965e2e999a4871e4848ee9fcfac6a..74f4985f84c830ba501712f74b802c3062913bfa 100644 (file)
@@ -43,6 +43,7 @@
 
 #include "AliRsnMiniPair.h"
 #include "AliRsnMiniEvent.h"
+#include "AliRsnMiniParticle.h"
 
 #include "AliRsnMiniValue.h"
 
@@ -111,10 +112,14 @@ 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";  
+      case kFirstDaughterPt: return "FirstDaughterPt";
+      case kSecondDaughterPt: return "SecondDaughterPt";
+      case kFirstDaughterP: return "FirstDaughterP";
+      case kSecondDaughterP: return "SecondDaughterP";
+      case kDCAproduct:   return "DaughterDCAproduct";
+      case kFirstDaughterDCA: return "FirstDaughterDCA";
+      case kSecondDaughterDCA: return "SecondDaughterDCA";
+      case kNSisters:     return "NumberOfSisters";
       default:            return "Undefined";
    }
 }
@@ -138,8 +143,9 @@ 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.};
+   Double_t p3[3]= {0.,0.,0.};
+   AliRsnMiniParticle *l;
+   TLorentzVector v;
    switch (fType) {
          // ---- event values -------------------------------------------------------------------------
       case kVz:
@@ -149,6 +155,11 @@ Float_t AliRsnMiniValue::Eval(AliRsnMiniPair *pair, AliRsnMiniEvent *event)
       case kPlaneAngle:
          return event->Angle();
       case kLeadingPt:
+         l = event->LeadingParticle();
+         if (l) {
+            l->Set4Vector(v,-1.0,fUseMCInfo);
+            return v.Pt();
+         }
          return 0.0;
       case kPt:
          return pair->Pt(fUseMCInfo);
@@ -171,18 +182,36 @@ Float_t AliRsnMiniValue::Eval(AliRsnMiniPair *pair, AliRsnMiniEvent *event)
       case kCosThetaStar:
          return pair->CosThetaStar(fUseMCInfo);
       case kAngleLeading:
-         AliWarning("This method is not yet implemented");
-        return 1E20;
+         l = event->LeadingParticle();
+         if (l) {
+            l->Set4Vector(v,-1.0,fUseMCInfo);
+            Double_t angle = v.Phi() - pair->Sum(fUseMCInfo).Phi();
+
+            //return angle w.r.t. leading particle in the range -pi/2, 3/2pi
+            while (angle >= 1.5 * TMath::Pi()) angle -= 2 * TMath::Pi();
+            while (angle < -0.5 * TMath::Pi()) angle += 2 * TMath::Pi();
+            return angle;
+         }
+//         AliWarning("This method is not yet implemented");
+         return 1E20;
       case kFirstDaughterPt:
          return pair->DaughterPt(0,fUseMCInfo);
       case kSecondDaughterPt:
          return pair->DaughterPt(1,fUseMCInfo);
       case kFirstDaughterP:
-        pair->DaughterPxPyPz(0,fUseMCInfo, p3);
+         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);
+         pair->DaughterPxPyPz(1,fUseMCInfo, p3);
          return TMath::Sqrt(p3[0]*p3[0]+p3[1]*p3[1]+p3[2]*p3[2]);
+      case kDCAproduct:
+         return pair->DCAProduct();
+      case kFirstDaughterDCA:
+         return pair->DaughterDCA(0);
+      case kSecondDaughterDCA:
+         return pair->DaughterDCA(1);
+      case kNSisters:
+         return pair->NSisters();
       default:
          AliError("Invalid value type");
          return 1E20;