LCOV - code coverage report
Current view: top level - STEER/AOD - AliAODcascade.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 14 150 9.3 %
Date: 2016-06-14 17:26:59 Functions: 6 23 26.1 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : 
      16             : //-------------------------------------------------------------------------
      17             : //     Implementation of the Analysis Oriented Data (AOD) Xi vertex class
      18             : //     Origin: A.Maire, IReS, antonin.maire@ires.in2p3.fr 
      19             : //             G.Van Buren, BNL,  gene@bnl.gov      (original STAR MuDsts)
      20             : //
      21             : //     Purpose: Having physics observables available for Xis
      22             : //-------------------------------------------------------------------------
      23             : 
      24             : #include <TVector3.h>
      25             : #include <TMath.h>
      26             : #include <TDatabasePDG.h>
      27             : 
      28             : #include "AliAODcascade.h"
      29             : #include "AliAODTrack.h"
      30             : 
      31         170 : ClassImp(AliAODcascade)
      32             : 
      33             : 
      34             : AliAODcascade::AliAODcascade() : 
      35           2 :   AliAODv0(),
      36             :      
      37           2 :   fDecayVertexXi(0x0),
      38           2 :   fChargeXi(0),
      39             : 
      40           2 :   fDcaXiDaughters(999),
      41           2 :   fDcaXiToPrimVertex(999),
      42           2 :   fDcaBachToPrimVertex(999),
      43             :   
      44           2 :   fMomBachX(999),
      45           2 :   fMomBachY(999),
      46           2 :   fMomBachZ(999)
      47             :    
      48          10 : {
      49             :   //--------------------------------------------------------------------
      50             :   // Default constructor
      51             :   //--------------------------------------------------------------------
      52             :  
      53           4 : }
      54             : 
      55             : 
      56             : 
      57             : AliAODcascade::AliAODcascade(const AliAODcascade& rSource) : 
      58           0 :    AliAODv0( rSource ),
      59             :   
      60           0 :   fDecayVertexXi( rSource.fDecayVertexXi ),
      61           0 :   fChargeXi(      rSource.fChargeXi ),
      62             :   
      63           0 :   fDcaXiDaughters(      rSource.fDcaXiDaughters ),
      64           0 :   fDcaXiToPrimVertex(   rSource.fDcaXiToPrimVertex ),
      65           0 :   fDcaBachToPrimVertex( rSource.fDcaBachToPrimVertex ),
      66             :   
      67           0 :   fMomBachX( rSource.fMomBachX ),
      68           0 :   fMomBachY( rSource.fMomBachY ),
      69           0 :   fMomBachZ( rSource.fMomBachZ )
      70             :   
      71           0 : {
      72             :   //--------------------------------------------------------------------
      73             :   // Copy constructor
      74             :   //--------------------------------------------------------------------
      75             :   
      76           0 : }
      77             : 
      78             : 
      79             : 
      80             : AliAODcascade::AliAODcascade( AliAODVertex* rAODVertexXi, 
      81             :                       Int_t         rChargeXi,
      82             :                       Double_t      rDcaXiDaughters,
      83             :                       Double_t      rDcaXiToPrimVertex,
      84             :                       Double_t      rDcaBachToPrimVertex,
      85             :                 const Double_t*     rMomBach,
      86             :                 
      87             :                               AliAODVertex* rAODVertexV0,
      88             :                       Double_t rDcaV0Daughters,
      89             :                       Double_t rDcaV0ToPrimVertex,
      90             :                 const Double_t *rMomPos,
      91             :                 const Double_t *rMomNeg,
      92             :                       Double_t *rDcaDaughterToPrimVertex
      93             :                 ) :
      94           0 :   AliAODv0(rAODVertexV0, rDcaV0Daughters, rDcaV0ToPrimVertex, rMomPos, rMomNeg, rDcaDaughterToPrimVertex),
      95           0 :   fDecayVertexXi( rAODVertexXi ),
      96           0 :   fChargeXi( rChargeXi ),    
      97           0 :   fDcaXiDaughters( rDcaXiDaughters ),     
      98           0 :   fDcaXiToPrimVertex( rDcaXiToPrimVertex ),
      99           0 :   fDcaBachToPrimVertex( rDcaBachToPrimVertex ),
     100           0 :   fMomBachX( rMomBach[0] ),          
     101           0 :   fMomBachY( rMomBach[1] ),      
     102           0 :   fMomBachZ( rMomBach[2] )  
     103           0 : {
     104             :   //--------------------------------------------------------------------
     105             :   // Constructor via setting each data member
     106             :   //--------------------------------------------------------------------
     107             :  
     108           0 : }
     109             : 
     110             : 
     111             : 
     112             : 
     113             : AliAODcascade::AliAODcascade( AliAODVertex* rAODVertexXi,  
     114             :                       Int_t         rChargeXi,
     115             :                       Double_t      rDcaXiDaughters,
     116             :                       Double_t      rDcaXiToPrimVertex,
     117             :                       Double_t      rDcaBachToPrimVertex,
     118             :                 const Double_t*     rMomBach,
     119             :                 const AliAODv0&     rAODv0 ) :
     120           0 :   AliAODv0(rAODv0),
     121           0 :   fDecayVertexXi(rAODVertexXi),
     122           0 :   fChargeXi( rChargeXi ),    
     123           0 :   fDcaXiDaughters( rDcaXiDaughters ),     
     124           0 :   fDcaXiToPrimVertex( rDcaXiToPrimVertex ),
     125           0 :   fDcaBachToPrimVertex( rDcaBachToPrimVertex ),
     126           0 :   fMomBachX( rMomBach[0] ),          
     127           0 :   fMomBachY( rMomBach[1] ),      
     128           0 :   fMomBachZ( rMomBach[2] )
     129           0 : {
     130             :   //--------------------------------------------------------------------
     131             :   // Constructor via setting each Xi data member + setting AODv0 
     132             :   //--------------------------------------------------------------------
     133             :  
     134           0 : }
     135             : 
     136             : 
     137             : 
     138             : 
     139             : 
     140             : AliAODcascade& AliAODcascade::operator=(const AliAODcascade& rSource){
     141             :   //--------------------------------------------------------------------
     142             :   // Assignment overload
     143             :   //--------------------------------------------------------------------
     144             :   
     145           0 :   if (this == &rSource) return *this;
     146             :      
     147           0 :   AliAODv0::operator=(rSource);
     148             :   
     149           0 :   this->fDecayVertexXi       = rSource.fDecayVertexXi;
     150           0 :   this->fChargeXi            = rSource.fChargeXi;
     151             : 
     152           0 :   this->fDcaXiDaughters      = rSource.fDcaXiDaughters;
     153           0 :   this->fDcaXiToPrimVertex   = rSource.fDcaXiToPrimVertex;
     154           0 :   this->fDcaBachToPrimVertex = rSource.fDcaBachToPrimVertex;
     155             : 
     156           0 :   this->fMomBachX            = rSource.fMomBachX;
     157           0 :   this->fMomBachY            = rSource.fMomBachY;
     158           0 :   this->fMomBachZ            = rSource.fMomBachZ;
     159             :   
     160           0 :   return *this;
     161           0 : }
     162             : 
     163             : 
     164             : 
     165          12 : AliAODcascade::~AliAODcascade(){
     166             :   //--------------------------------------------------------------------
     167             :   // Empty destructor
     168             :   //--------------------------------------------------------------------
     169           6 : }
     170             : 
     171             : void  AliAODcascade::Fill(AliAODVertex* rAODVertexXi, 
     172             :                       Int_t         rChargeXi,
     173             :                       Double_t      rDcaXiDaughters,
     174             :                       Double_t      rDcaXiToPrimVertex,
     175             :                       Double_t      rDcaBachToPrimVertex,
     176             :                 const Double_t*     rMomBach,
     177             :                 
     178             :                       AliAODVertex* rAODVertexV0,
     179             :                       Double_t      rDcaV0Daughters,
     180             :                       Double_t      rDcaV0ToPrimVertex,
     181             :                 const Double_t*     rMomPos,
     182             :                 const Double_t*     rMomNeg,
     183             :                       Double_t*     rDcaDaughterToPrimVertex )
     184             : {
     185             :   //--------------------------------------------------------------------
     186             :   //  Fill the AODcascade
     187             :   //--------------------------------------------------------------------
     188             : 
     189           0 :   AliAODv0::Fill(rAODVertexV0,rDcaV0Daughters,rDcaV0ToPrimVertex,rMomPos,rMomNeg,rDcaDaughterToPrimVertex);
     190           0 :       fDecayVertexXi =  rAODVertexXi;
     191           0 :       fChargeXi      =  rChargeXi;
     192             : 
     193           0 :       fDcaXiDaughters       = rDcaXiDaughters;   
     194           0 :       fDcaXiToPrimVertex    = rDcaXiToPrimVertex;   
     195           0 :       fDcaBachToPrimVertex  = rDcaBachToPrimVertex;
     196             : 
     197           0 :       fMomBachX = rMomBach[0];   
     198           0 :       fMomBachY = rMomBach[1];          
     199           0 :       fMomBachZ = rMomBach[2];        
     200           0 : }                
     201             : 
     202             : 
     203             : 
     204             : void AliAODcascade::ResetXi(){
     205             :   //--------------------------------------------------------------------
     206             :   // Reset the values of the AOD data members to the default ones
     207             :   //--------------------------------------------------------------------
     208             :   
     209           0 :   ResetV0();
     210             :       
     211           0 :   GetDecayVertexXi()->SetChi2perNDF(-999);
     212           0 :   GetDecayVertexXi()->RemoveCovMatrix();              
     213           0 :   GetDecayVertexXi()->RemoveDaughters();               
     214           0 :   GetDecayVertexXi()->SetID(-1);                      
     215           0 :   GetDecayVertexXi()->SetParent((TObject*) 0x0);      
     216           0 :   GetDecayVertexXi()->SetPosition(-999, -999, -999);
     217           0 :   GetDecayVertexXi()->SetType( AliAODVertex::kUndef );
     218             : 
     219           0 :   fChargeXi = 0;
     220             :   
     221           0 :   fDcaXiDaughters = 999;
     222           0 :   fDcaXiToPrimVertex = 999;
     223           0 :   fDcaBachToPrimVertex = 999;
     224             :   
     225           0 :   fMomBachX = 999;
     226           0 :   fMomBachY = 999;
     227           0 :   fMomBachZ = 999;
     228             :   
     229             :   
     230           0 : }
     231             : 
     232             : void AliAODcascade::PrintXi(const Double_t& rPrimVtxX, 
     233             :                             const Double_t& rPrimVtxY, 
     234             :                             const Double_t& rPrimVtxZ) const
     235             : {
     236             :   //--------------------------------------------------------------------
     237             :   // Print the AOD data members
     238             :   //--------------------------------------------------------------------
     239           0 :    AliAODv0::Print();  
     240           0 :    printf("- \n");
     241           0 :    printf("AliAODcascade : posXiVtx (%.6f, %.6f, %.6f) \n", DecayVertexXiX(), DecayVertexXiY(), DecayVertexXiZ() );
     242           0 :    printf("AliAODcascade : chargeXi =   %d \n", ChargeXi() );   
     243           0 :    printf("AliAODcascade : dca (bachtpv %.6f, xid %.6f, xitpv-calc %.6f, xitpv-mb %.6f) \n",
     244           0 :                      DcaBachToPrimVertex(), 
     245           0 :                      DcaXiDaughters(), 
     246           0 :                      DcaXiToPrimVertex( rPrimVtxX, rPrimVtxY, rPrimVtxZ),
     247           0 :                      DcaXiToPrimVertex()  );
     248           0 :    printf("AliAODcascade : cos(PtgAngle Xi) =     %.6f \n", CosPointingAngleXi(rPrimVtxX, rPrimVtxY, rPrimVtxZ) );
     249             :    
     250             :      
     251           0 :    printf("AliAODcascade : posVtxXI  (x  %.6f, y  %.6f, z  %.6f) \n", DecayVertexXiX(),DecayVertexXiY(),DecayVertexXiZ() );
     252           0 :    printf("AliAODcascade : decaylgth (V0 %.6f, Xi %.6f) \n", DecayLengthV0(),DecayLengthXi(rPrimVtxX, rPrimVtxY, rPrimVtxZ) );
     253           0 :    printf("AliAODcascade : momBach   (px %.6f, py %.6f, pz %.6f, ptot2 %.6f) \n",  
     254           0 :                       MomBachX(), 
     255           0 :                       MomBachY(), 
     256           0 :                       MomBachZ(),
     257           0 :                       Ptot2Bach() );
     258           0 :    printf("AliAODcascade : momXi     (px %.6f, py %.6f, pz %.6f, ptot2 %.6f, pt2 %.6f) \n", 
     259           0 :                       MomXiX(), 
     260           0 :                       MomXiY(),
     261           0 :                       MomXiZ(),
     262           0 :                       Ptot2Xi(),
     263           0 :                       Pt2Xi()   );
     264           0 :    printf("AliAODcascade :  momAlongXi  (Bach     %.6f, V0 %.6f) \n", MomBachAlongXi(), MomV0AlongXi() );
     265           0 :    printf("AliAODcascade :  cin (alphaXi %.6f, PtArmXi     %.6f) \n", AlphaXi(), PtArmXi() );
     266           0 :    printf("AliAODcascade :  rap (Xi      %.6f, Omega       %.6f) \n", RapXi(),RapOmega() );
     267           0 :    printf("AliAODcascade :  nrg (BachPi  %.6f, BachK-      %.6f, Omega %.6f, Xi  %.6f ) \n", 
     268           0 :                       EBachPion(), 
     269           0 :                       EBachKaon(), 
     270           0 :                       EOmega(),
     271           0 :                       EXi() );
     272           0 :    printf("AliAODcascade : inv mass (Xi  %.6f, Omega       %.6f) \n",  MassXi(), MassOmega()  );
     273           0 :    printf("- \n");
     274             :    // Methods Not printed =  GetBachID(),  Chi2Xi()
     275             :  
     276             :  
     277           0 : }
     278             : 
     279             : Double_t AliAODcascade::CosPointingAngleXi(const Double_t& rPrimVtxX, 
     280             :                                            const Double_t& rPrimVtxY, 
     281             :                                            const Double_t& rPrimVtxZ) const { 
     282             :  
     283             :   // Cosine of Xi pointing angle in 3D space, with respect to a point 
     284             :   // (primary vtx ...)
     285             :   
     286           0 :   TVector3 lMomXi( MomXiX(),MomXiY(),MomXiZ() );
     287           0 :   TVector3 lVectPrimVtxToXi(DecayVertexXiX() - rPrimVtxX,
     288           0 :                             DecayVertexXiY() - rPrimVtxY,
     289           0 :                             DecayVertexXiZ() - rPrimVtxZ);
     290             :                 
     291           0 :   Double_t lPtgAngle = lMomXi.Angle(lVectPrimVtxToXi);
     292             : 
     293           0 :   return TMath::Cos(lPtgAngle); 
     294             : 
     295           0 : }
     296             : 
     297             : Double_t AliAODcascade::DcaXiToPrimVertex(const Double_t& rPrimVtxX, 
     298             :                                           const Double_t& rPrimVtxY, 
     299             :                                           const Double_t& rPrimVtxZ) const {
     300             :   //
     301             :   // Compute the DCA between this Xi and the primary vertex
     302             :   //
     303           0 :     Double_t rMomXiX = MomXiX();
     304           0 :     Double_t rMomXiY = MomXiY();
     305           0 :     Double_t rMomXiZ = MomXiZ();
     306           0 :     Double_t dx = (rPrimVtxY- DecayVertexXiY() )*rMomXiZ - (rPrimVtxZ- DecayVertexXiZ() )*rMomXiY; 
     307           0 :     Double_t dy = (rPrimVtxZ- DecayVertexXiZ() )*rMomXiX - (rPrimVtxX- DecayVertexXiX() )*rMomXiZ;
     308           0 :     Double_t dz = (rPrimVtxX- DecayVertexXiX() )*rMomXiY - (rPrimVtxY- DecayVertexXiY() )*rMomXiX;
     309           0 :   return TMath::Sqrt((dx*dx+dy*dy+dz*dz)/ Ptot2Xi() );
     310             : }
     311             : 
     312             : Int_t   AliAODcascade::GetBachID()  const     {
     313             :   //
     314             :   // Return the ID of the bachelor
     315             :   //
     316             : 
     317           0 :         if( GetDecayVertexXi() == 0) return -1;
     318             : 
     319           0 :         AliAODTrack *rBachTrack = (AliAODTrack *) ( GetDecayVertexXi()->GetDaughter(0) );
     320             :         // The fDecayVertexXi should just have one stored daughter. To be managed within the AliAnalysisTaskESDFilter
     321           0 :         Short_t rBachId = rBachTrack->GetID();
     322           0 :         return rBachId;
     323           0 : }
     324             : 
     325             : Double_t AliAODcascade::EBachPion() const {
     326           0 :   static Double_t lMassPi = TDatabasePDG::Instance()->GetParticle("pi-")->Mass();
     327           0 :   return ::sqrt(Ptot2Bach() + lMassPi*lMassPi);
     328           0 : }
     329             : 
     330             : Double_t AliAODcascade::EBachKaon() const {
     331           0 :   static Double_t lMassKaon = TDatabasePDG::Instance()->GetParticle("K-")->Mass();
     332           0 :   return ::sqrt(Ptot2Bach() + lMassKaon*lMassKaon);
     333           0 : }
     334             : 
     335             : Double_t AliAODcascade::EXi() const {
     336           0 :   static Double_t lMassXi = TDatabasePDG::Instance()->GetParticle("Xi-")->Mass();
     337           0 :   return ::sqrt(Ptot2Xi() + lMassXi*lMassXi);
     338           0 : }
     339             : 
     340             : Double_t AliAODcascade::EOmega() const {
     341           0 :   static Double_t lMassOmega = TDatabasePDG::Instance()->GetParticle("Omega-")->Mass();
     342           0 :   return ::sqrt(Ptot2Xi() + lMassOmega*lMassOmega);
     343           0 : }

Generated by: LCOV version 1.11