]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/Correlations/JCORRAN/AliJMCTrack.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGCF / Correlations / JCORRAN / AliJMCTrack.cxx
CommitLineData
37dde34e 1/**************************************************************************
9dc4f671 2 * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
37dde34e 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 *
9dc4f671 10 * copies and that both the copyright notice and this permission notice *
37dde34e 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
9dc4f671 16// Comment describing what this class does needed!
17
37dde34e 18// $Id: AliJMCTrack.cxx,v 1.2 2008/05/08 13:44:45 djkim Exp $
19
20////////////////////////////////////////////////////
21//
22// \file AliJMCTrack.cxx
23// \brief
24// \author J. Rak, D.J.Kim, R.Diaz (University of Jyvaskyla)
25// \email: djkim@jyu.fi
26// \version $Revision: 1.2 $
27// \date $Date: 2008/05/08 13:44:45 $
28//
29// class which encapsulates track monte carlo information
30////////////////////////////////////////////////////
31
32#include "AliJMCTrack.h"
33#include <TMath.h>
34#include <TROOT.h>
35
36ClassImp(AliJMCTrack);
37
38//______________________________________________________________________________
39AliJMCTrack::AliJMCTrack() :
40 AliJBaseTrack(),
41 fPdgCode(0),
42 fVx(0),
43 fVy(0),
44 fVz(0)
45{
46 // default constructor
9dc4f671 47 fMother[0] = fMother[1] = -1;
48 fDaughter[0] = fDaughter[1] = -1;
37dde34e 49
50
51}
52
53//______________________________________________________________________________
54AliJMCTrack::AliJMCTrack(const AliJMCTrack& a):
55 AliJBaseTrack(a),
56 fPdgCode(a.fPdgCode),
57 fVx(a.fVx),
58 fVy(a.fVy),
59 fVz(a.fVz)
60{
61 //copy constructor
62 for(Int_t i=0;i<2;i++){
63 fMother[i] = a.fMother[i];
64 fDaughter[i] = a.fDaughter[i];
65 }
66}
67
68
69//______________________________________________________________________________
70void AliJMCTrack::SetPdgCode(Int_t icode) {
71 // Set PDG code, charge, recalculate E
72 if( TMath::Abs(icode) > 32767 ) icode = 0; // Short_t
73 fPdgCode=icode;
9dc4f671 74// SetVectM(Vect(), GetPDGData().Mass());
75// SetCharge( TMath::Nint(GetPDGData().Charge()) ); // is this right?
37dde34e 76}
77
78
79//______________________________________________________________________________
80Bool_t AliJMCTrack::IsHadron() const{
81 // Check is hadron
82 int absID = TMath::Abs(GetPdgCode());
83 if( absID >= 211 && absID<=533 ) return true; //meson
84 if( absID >1000 && absID<6000 ) return true; // barion
85 return false;
86}
87
88//______________________________________________________________________________
89AliJMCTrack& AliJMCTrack::operator=(const AliJMCTrack& trk){
90 //operator=
91 if(this != &trk){
92 AliJBaseTrack::operator=(trk);
93 fPdgCode = trk.fPdgCode;
94 fLabel = trk.fLabel;
95 for(Int_t i=0;i<2;i++){
96 fMother[i] = trk.fMother[i];
97 fDaughter[i] = trk.fDaughter[i];
98 }
99 fVx = trk.fVx;
100 fVy = trk.fVy;
101 fVz = trk.fVz;
102 }
103 return *this;
104}
105
106const TParticlePDG& AliJMCTrack::GetPDGData() const {
107 return *(TDatabasePDG::Instance()->GetParticle( fPdgCode ));
108}
109
110
111
112
113