]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TMEVSIM/TMevSimConverter.cxx
Updated Linkdef and libTOF.pkg
[u/mrichter/AliRoot.git] / TMEVSIM / TMevSimConverter.cxx
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 $Log$
18 */
19
20 #include "TMevSimConverter.h"
21
22 ClassImp(TMevSimConverter)
23
24
25 ///////////////////////////////////////////////////////////////////////////////////
26
27 Int_t TMevSimConverter::PDGFromId(Int_t id)  {
28
29   //
30   // Return PDG code and pseudo ENDF code from Geant3 code
31   //
32   if (id>0 && id<fNPDGCodes) return fPDGCode[id];
33   else return -1;
34 }
35
36 ///////////////////////////////////////////////////////////////////////////////////
37
38 Int_t TMevSimConverter::IdFromPDG(Int_t pdg) {
39
40
41   for (Int_t i=0; i<fNPDGCodes; i++) {
42     if (fPDGCode[i] == pdg) return i;
43   }
44   return -1;
45
46 }
47
48 ///////////////////////////////////////////////////////////////////////////////////
49
50 void TMevSimConverter::DefineParticles()  {
51
52   //
53   // Load standard numbers for GEANT particles and PDG conversion
54   fNPDGCodes = 0;
55
56   fPDGCode[fNPDGCodes++]=-99;   //  0 = unused location
57   fPDGCode[fNPDGCodes++]=22;    //  1 = photon
58   fPDGCode[fNPDGCodes++]=-11;   //  2 = positron
59   fPDGCode[fNPDGCodes++]=11;    //  3 = electron
60   fPDGCode[fNPDGCodes++]=12;    //  4 = neutrino e
61   fPDGCode[fNPDGCodes++]=-13;   //  5 = muon +
62   fPDGCode[fNPDGCodes++]=13;    //  6 = muon -
63   fPDGCode[fNPDGCodes++]=111;   //  7 = pi0
64   fPDGCode[fNPDGCodes++]=211;   //  8 = pi+
65   fPDGCode[fNPDGCodes++]=-211;  //  9 = pi-
66   fPDGCode[fNPDGCodes++]=130;   // 10 = Kaon Long
67   fPDGCode[fNPDGCodes++]=321;   // 11 = Kaon +
68   fPDGCode[fNPDGCodes++]=-321;  // 12 = Kaon -
69   fPDGCode[fNPDGCodes++]=2112;  // 13 = Neutron
70   fPDGCode[fNPDGCodes++]=2212;  // 14 = Proton
71   fPDGCode[fNPDGCodes++]=-2212; // 15 = Anti Proton
72   fPDGCode[fNPDGCodes++]=310;   // 16 = Kaon Short
73   fPDGCode[fNPDGCodes++]=221;   // 17 = Eta
74   fPDGCode[fNPDGCodes++]=3122;  // 18 = Lambda
75   fPDGCode[fNPDGCodes++]=3222;  // 19 = Sigma +
76   fPDGCode[fNPDGCodes++]=3212;  // 20 = Sigma 0
77   fPDGCode[fNPDGCodes++]=3112;  // 21 = Sigma -
78   fPDGCode[fNPDGCodes++]=3322;  // 22 = Xi0
79   fPDGCode[fNPDGCodes++]=3312;  // 23 = Xi-
80   fPDGCode[fNPDGCodes++]=3334;  // 24 = Omega-
81   fPDGCode[fNPDGCodes++]=-2112; // 25 = Anti Proton
82   fPDGCode[fNPDGCodes++]=-3122; // 26 = Anti Proton
83   fPDGCode[fNPDGCodes++]=-3222; // 27 = Anti Sigma -
84   fPDGCode[fNPDGCodes++]=-3212; // 28 = Anti Sigma 0
85   fPDGCode[fNPDGCodes++]=-3112; // 29 = Anti Sigma 0
86   fPDGCode[fNPDGCodes++]=-3322; // 30 = Anti Xi 0
87   fPDGCode[fNPDGCodes++]=-3312; // 31 = Anti Xi +
88   fPDGCode[fNPDGCodes++]=-3334; // 32 = Anti Omega +
89 }
90