1 /**************************************************************************
2 * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 // Comment describing what this class does needed!
18 // $Id: AliJMCTrack.cxx,v 1.2 2008/05/08 13:44:45 djkim Exp $
20 ////////////////////////////////////////////////////
22 // \file AliJMCTrack.cxx
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 $
29 // class which encapsulates track monte carlo information
30 ////////////////////////////////////////////////////
32 #include "AliJMCTrack.h"
36 ClassImp(AliJMCTrack);
38 //______________________________________________________________________________
39 AliJMCTrack::AliJMCTrack() :
46 // default constructor
47 fMother[0] = fMother[1] = -1;
48 fDaughter[0] = fDaughter[1] = -1;
53 //______________________________________________________________________________
54 AliJMCTrack::AliJMCTrack(const AliJMCTrack& a):
62 for(Int_t i=0;i<2;i++){
63 fMother[i] = a.fMother[i];
64 fDaughter[i] = a.fDaughter[i];
69 //______________________________________________________________________________
70 void AliJMCTrack::SetPdgCode(Int_t icode) {
71 // Set PDG code, charge, recalculate E
72 if( TMath::Abs(icode) > 32767 ) icode = 0; // Short_t
74 // SetVectM(Vect(), GetPDGData().Mass());
75 // SetCharge( TMath::Nint(GetPDGData().Charge()) ); // is this right?
79 //______________________________________________________________________________
80 Bool_t AliJMCTrack::IsHadron() const{
82 int absID = TMath::Abs(GetPdgCode());
83 if( absID >= 211 && absID<=533 ) return true; //meson
84 if( absID >1000 && absID<6000 ) return true; // barion
88 //______________________________________________________________________________
89 AliJMCTrack& AliJMCTrack::operator=(const AliJMCTrack& trk){
92 AliJBaseTrack::operator=(trk);
93 fPdgCode = trk.fPdgCode;
95 for(Int_t i=0;i<2;i++){
96 fMother[i] = trk.fMother[i];
97 fDaughter[i] = trk.fDaughter[i];
106 const TParticlePDG& AliJMCTrack::GetPDGData() const {
107 return *(TDatabasePDG::Instance()->GetParticle( fPdgCode ));