HepPDT Reference Documentation

HepPDT

translateGeanttoPDT.cc

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------
00002 //
00003 // translateGeanttoPDT.cc
00004 // Author: Lynn Garren
00005 //
00006 // translate a Geant ID number to the standard numbering scheme
00007 //
00008 // ----------------------------------------------------------------------
00009 
00010 #include <iostream>
00011 
00012 #include "HepPID/Version.hh"
00013 #include "HepPID/ParticleIDTranslations.hh"
00014 #include "HepPID/ParticleIDMethods.hh"
00015 
00016 #define IDMAX 49
00017 
00018 namespace HepPID {
00019 
00020 int translateGeanttoPDT( const int id )
00021 {
00022     static int IDG2H[IDMAX] = {
00023           22,  // gamma
00024          -11,  // e
00025           11,  // e-
00026           12,  // nu (nu_e)
00027          -13,  // mu
00028           13,  // mu-
00029          111,  // pi0
00030          211,  // pi
00031         -211,  // pi-
00032          130,  // K0L
00033          321,  // K
00034         -321,  // K-
00035         2112,  // n
00036         2212,  // p
00037        -2212,  // p~
00038          310,  // K0s
00039          221,  // eta
00040         3122,  // Lambda
00041         3222,  // Sigma
00042         3212,  // Sigma0
00043         3112,  // Sigma-
00044         3322,  // Xi0
00045         3312,  // Xi-
00046         3334,  // Omega-
00047        -2112,  // n~
00048        -3122,  // Lambda~
00049        -3112,  // Sigma~
00050        -3212,  // Sigma0~
00051        -3222,  // sigma-~
00052        -3322,  // Xi0~
00053        -3312,  // Xi-~
00054        -3334,  // Omega-~
00055          -15,  // tau
00056           15,  // tau-
00057          411,  // D
00058         -411,  // D-
00059          421,  // D0
00060         -421,  // D0~
00061          431,  // Ds
00062         -431,  // Ds-
00063         4122,  // Lambda_
00064           24,  // W
00065          -24,  // W-
00066           23,  // Z
00067       1000010020,    // deuteron
00068       1000010030,    // tritium
00069       1000020040,    // alpha
00070            0,   // geantino
00071       1000020030 };   // He3
00072     static int nwhine_max = 10;
00073     int nwhine = 0;
00074     int gtran = 0;
00075 
00076 //..............geantino
00077     if( id == 48 ) {
00078       nwhine = nwhine + 1;
00079       if( nwhine <= nwhine_max ) {
00080         std::cout << "GTRAN: geantino " << id
00081                   << " not known to HEP (set to 0)" << std::endl;
00082       }
00083 //...............normal translation
00084     } else if( id <= IDMAX ) {
00085       gtran = IDG2H[id-1];
00086 //............anything } else {
00087     } else {
00088       nwhine = nwhine + 1;
00089       if( nwhine <= nwhine_max ) {
00090         std::cout << "GTRAN: GEANT particle " << id 
00091                   << " not known to HEP (set to 0)" << std::endl;
00092       }
00093     }
00094     return gtran;
00095 }
00096 
00097 }       // HepPID

Generated on Fri Dec 4 14:05:24 2009 for HepPDT by  doxygen 1.4.7