Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

UtilIstHEP Namespace Reference


Enumerations

enum  ENeugenIstHEP {
  kNInitial = 0, kNFinal = 1, kNIntermediate = 2, kNDecayed = 3,
  kNTarget = 11, kNDIS = 12, kNRes = 13, kNRescatter = 14
}

Functions

const char * AsString (Int_t isthep)
const char * NeugenIstHEPAsString (ENeugenIstHEP isthep)
Int_t GetNeugenIstHEP (const char *isthepname)
 return enumerated type associated with character string or -1 if no match

Variables

const Int_t kProcessOffset = 400


Enumeration Type Documentation

enum ENeugenIstHEP
 

Enumeration values:
kNInitial 
kNFinal 
kNIntermediate 
kNDecayed 
kNTarget 
kNDIS 
kNRes 
kNRescatter 

Definition at line 17 of file UtilIstHEP.h.

Referenced by AsString().

00017                      {
00018     // Status codes are those defined by neugen in $NEUGEN3PATH/inc/fncodes.inc
00019     kNInitial=0,       // Initial (0)
00020     kNFinal=1,         // Final (1)
00021     kNIntermediate=2,  // Intermediate (2)
00022     kNDecayed=3,       // Decayed (3)
00023     kNTarget=11,       // Target (11) 
00024     kNDIS=12,          // DIS (12)
00025     kNRes=13,          // Res (13)
00026     kNRescatter=14     // Rescatter (14)
00027   };


Function Documentation

const char * UtilIstHEP::AsString Int_t  isthep  ) 
 

Definition at line 91 of file UtilIstHEP.cxx.

References ENeugenIstHEP, kProcessOffset, and NeugenIstHEPAsString().

Referenced by MCAppParticle::GetStatusCodeName(), PTSimValidate::TestParticle(), and MCAppValidate::TestParticle().

00091                                              {
00092   //  Purpose:  Convert isthep status code to a string.
00093   //
00094   //  Argument: isthep code.
00095   //
00096   //  Return:  isthep string. If unknown, returns "Unknown".
00097   //
00098   //  Notes: If isthep <  200 => Neugen IstHEP code
00099   //         If isthep >= kProcessOffset && isthep < 999 
00100   //                          => TMCProcess production mechanism code
00101   //         If isthep == 999 => "Info" 
00102   //         If isthep == TMCProcess::kPDecay + kProcessOffset + 1000
00103   //                          => "Decay Parent" 
00104   //         Otherwise return "Unknown"
00105 
00106 
00107   if ( isthep < 200 ) {
00108     ENeugenIstHEP neugenisthep = (ENeugenIstHEP)isthep;
00109     return NeugenIstHEPAsString(neugenisthep);
00110   }
00111   else if ( isthep >= kProcessOffset && isthep < 999 ) {
00112     TMCProcess processcode = (TMCProcess)(isthep - kProcessOffset);
00113     return TMCProcessName[processcode];
00114   }
00115   else if ( isthep == 999 ) {
00116     return "Info";
00117   }
00118   else if ( isthep == (kPDecay + kProcessOffset + 1000) ) {
00119     return "Decay Parent";
00120   }
00121   else {
00122     //MSG("Util",Msg::kWarning) 
00123     //  << "UtilIstHEP::AsString called with unknown isthep code " 
00124     //  << isthep << endl;
00125     return "Unknown";
00126   }
00127 
00128 }

Int_t UtilIstHEP::GetNeugenIstHEP const char *  isthepname  ) 
 

return enumerated type associated with character string or -1 if no match

Definition at line 64 of file UtilIstHEP.cxx.

00064                                                         {
00065   // Purpose: Convert text string isthepname to an enumerated code.
00066   // 
00067   // Argument: isthepname string
00068   //
00069   // Return: returns -1 if no match
00070   //
00071 
00072   TString tmpstr(isthepname);
00073   tmpstr.ToLower();
00074   if ( strcmp(tmpstr.Data(),"initial") == 0 ) return UtilIstHEP::kNInitial;
00075   else if ( strcmp(tmpstr.Data(),"final") == 0 ) return UtilIstHEP::kNFinal;
00076   else if ( strcmp(tmpstr.Data(),"intermediate") == 0 ) 
00077                                            return UtilIstHEP::kNIntermediate;
00078   else if ( strcmp(tmpstr.Data(),"decayed") == 0 ) 
00079                                            return UtilIstHEP::kNDecayed;
00080   else if ( strcmp(tmpstr.Data(),"target") == 0 ) return UtilIstHEP::kNTarget;
00081   else if ( strcmp(tmpstr.Data(),"dis") == 0 ) return UtilIstHEP::kNDIS;
00082   else if ( strcmp(tmpstr.Data(),"res") == 0 ) return UtilIstHEP::kNRes;
00083   else if ( strcmp(tmpstr.Data(),"rescatter") == 0 ) 
00084                                                return UtilIstHEP::kNRescatter;
00085 
00086   return -1;
00087 
00088 }

const char * UtilIstHEP::NeugenIstHEPAsString ENeugenIstHEP  isthep  ) 
 

Definition at line 25 of file UtilIstHEP.cxx.

References kNDecayed, kNDIS, kNFinal, kNInitial, kNIntermediate, kNRes, kNRescatter, kNTarget, and MSG.

Referenced by AsString().

00025                                                                        {
00026   //  Purpose:  Convert enumerated Neugen IstHEP code to a string.
00027   //
00028   //  Argument: enumerated ENeugenIstHEP described in UtilIstHEP.h.
00029   //
00030   //  Return:  isthep string. If unknown, returns "Unknown".
00031   //
00032   //  Contact:   S. Kasahara
00033   //
00034 
00035   switch ( neugenisthep ) {
00036 
00037     case kNInitial:
00038       return "Initial";
00039     case kNFinal:
00040       return "Final";
00041     case kNIntermediate:
00042       return "Intermediate";
00043     case kNDecayed:
00044       return "Decayed";
00045     case kNTarget:
00046       return "Target";
00047     case kNDIS:
00048       return "DIS";
00049     case kNRes:
00050       return "Res";
00051     case kNRescatter:
00052       return "Rescatter";
00053     default:
00054       MSG("Util",Msg::kWarning) 
00055       << "UtilIstHEP::AsString called with unknown ENeugenIstHEP " 
00056       << (Int_t)neugenisthep << endl;
00057       return "Unknown";
00058 
00059   }//end of switch
00060 
00061 }


Variable Documentation

const Int_t UtilIstHEP::kProcessOffset = 400
 

Definition at line 32 of file UtilIstHEP.h.

Referenced by AsString().


Generated on Fri Mar 28 16:16:34 2008 for loon by  doxygen 1.3.9.1