HepPDT Reference Documentation

HepPDT

translatePDTtoGeant.cc

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

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