StdHepUtil Namespace Reference

Typedefs

typedef enum
StdHepUtil::EStatusCodes 
StatusCode_t
typedef enum
StdHepUtil::EParticleCodes 
ParticleCode_t

Enumerations

enum  EStatusCodes {
  kNullStatus = 0, kActiveStatus = 1, kIntermediateStatus = 2, kDocStatus = 3,
  kInitialStatus = 0, kFinalStatus = 1, kDecayedStatus = 3, kTargetStatus = 11,
  kDisStatus = 12, kResStatus = 13, kRescatterStatus = 14, kUnknown = -1
}
enum  EParticleCodes {
  kElectron = 11, kNuE = 12, kMuon = 13, kNuMu = 14,
  kTau = 15, kNuTau = 16, kGamma = 22, kPion = 211,
  kPi0 = 111, kProton = 2212, kNeutron = 2112, kNucleusBase = 1000000000
}

Functions

Bool_t isDocStatus (const TParticle *part)
Bool_t isActiveStatus (const TParticle *part)
Bool_t isLepton (const TParticle *part)
Bool_t isNeutrino (const TParticle *part)
Bool_t isMuon (const TParticle *part)
Bool_t isElectron (const TParticle *part)
Bool_t isTau (const TParticle *part)
Bool_t isProton (const TParticle *part)
Bool_t isNeutron (const TParticle *part)
Bool_t isNucleus (const TParticle *part)
Int_t makeIonPDG (int ia, int iz, int ij=0)
Int_t getIonA (int ion_pdg)
Int_t getIonZ (int ion_pdg)
void dumpStdHepList (TClonesArray *stdheplist, Int_t mode=0)
Int_t indexPrimaryNu (TClonesArray *stdheplist, Int_t indx)

Detailed Description

Id
StdHepUtil.h,v 1.3 2006/05/25 04:34:02 rhatcher Exp

Typedef Documentation


Enumeration Type Documentation

Enumerator:
kElectron 
kNuE 
kMuon 
kNuMu 
kTau 
kNuTau 
kGamma 
kPion 
kPi0 
kProton 
kNeutron 
kNucleusBase 

Definition at line 50 of file StdHepUtil.h.

00050                               {
00051     kElectron    =         11,
00052     kNuE         =         12,
00053     kMuon        =         13,
00054     kNuMu        =         14,
00055     kTau         =         15,
00056     kNuTau       =         16,
00057     kGamma       =         22,
00058     kPion        =        211,
00059     kPi0         =        111,
00060     kProton      =       2212,
00061     kNeutron     =       2112,
00062     kNucleusBase = 1000000000
00063   } ParticleCode_t;

Enumerator:
kNullStatus 
kActiveStatus 
kIntermediateStatus 
kDocStatus 
kInitialStatus 
kFinalStatus 
kDecayedStatus 
kTargetStatus 
kDisStatus 
kResStatus 
kRescatterStatus 
kUnknown 

Definition at line 25 of file StdHepUtil.h.

00025                             {
00026     // 
00027     // Official STDHEP codes
00028     //
00029     kNullStatus         =  0,
00030     kActiveStatus       =  1,
00031     kIntermediateStatus =  2,
00032     kDocStatus          =  3,
00033     //
00034     // Neugen's interpretation
00035     //
00036     kInitialStatus      =  0,
00037     kFinalStatus        =  1,
00038     //kIntermediateStatus = 2,
00039     kDecayedStatus      =  3,
00040     kTargetStatus       = 11,
00041     kDisStatus          = 12,
00042     kResStatus          = 13,
00043     kRescatterStatus    = 14,
00044     //
00045     // end-of-known codes
00046     //
00047     kUnknown            = -1
00048   } StatusCode_t;


Function Documentation

void StdHepUtil::dumpStdHepList ( TClonesArray *  stdheplist,
Int_t  mode = 0 
)

Definition at line 21 of file StdHepUtil.cxx.

References Msg::kInfo, MSG, and n.

Referenced by EvtKinNuModule::Get().

00022 {  
00023    // Dump the StdHepList in user friendly form
00024    // mode < 0 --> nothing
00025    // mode = 0 --> everything
00026    // mode = 1 --> suppress vtx info
00027 
00028    if (mode < 0 ) return;
00029 
00030    bool dovtx = (mode == 0);
00031 
00032    // Loop over new array ... print each element
00033    Bool_t doheader = kTRUE;
00034    int n = stdheplist->GetLast()+1;
00035    printf("StdHep:  %d entries\n",n);
00036    for (Int_t i=0; i<n; i++) {
00037       TParticle* apart = dynamic_cast<TParticle*>(stdheplist->At(i));
00038       if (apart) {
00039          //rwh: does a cruddy job: apart->Print();
00040          if (doheader) {
00041             doheader = kFALSE;
00042             //      12345678901234567890123456789012345678901234567890123456789012345678901234567890
00043             //                           1234123412341234 123456789A 123456789A 123456789A 12345678
00044             printf("ihep stat type   [parent][chldrn]         px          py          pz     energy\n");
00045             if (dovtx) printf("                                          vx          vy          vz      tprod\n");
00046          }
00047          static Char_t alt[64];
00048 
00049          Int_t status = apart->GetStatusCode();
00050          const Char_t* name = apart->GetName();
00051          if (name[0]=='X' && name[1]=='X' && name[2] == 'X') {
00052             sprintf(alt,"%d",apart->GetPdgCode());
00053             name = alt;
00054          }
00055          Int_t first_parent = apart->GetMother(0);
00056          //Int_t last_parent  = apart->GetMother(1);
00057          Int_t first_child  = apart->GetDaughter(0);
00058          Int_t last_child   = apart->GetDaughter(1);
00059          Double_t px = apart->Px();
00060          Double_t py = apart->Py();
00061          Double_t pz = apart->Pz();
00062          Double_t energy = apart->Energy();
00063          //Double_t calcmass = apart->GetCalcMass();
00064          //Double_t mass = (apart->GetPDG())?apart->GetMass():-99999.;
00065          Double_t vx = apart->Vx();
00066          Double_t vy = apart->Vy();
00067          Double_t vz = apart->Vz();
00068          Double_t tprod = apart->T();
00069 
00070          printf("%4d(%3d)%-10.10s %4d%4d%4d",
00071                 i,status,name,first_parent,first_child,last_child);
00072          printf(" %11.4e %11.4e %11.4e%11.4e\n",px,py,pz,energy);
00073          if (dovtx) {
00074              printf("                                ");
00075              printf(" %11.4e %11.4e %11.4e%11.4e\n",vx,vy,vz,tprod);
00076          }
00077 
00078 
00079       } else {
00080          MSG("StdHepUtil",Msg::kInfo) << "dumpStdHepList entry " << i << " is empty" << endl;
00081       }
00082    }
00083 }

Int_t StdHepUtil::getIonA ( int  ion_pdg  )  [inline]

Definition at line 148 of file StdHepUtil.h.

References kNeutron, kNucleusBase, and kProton.

Referenced by InterGen_Neugen::CalcXsec(), and InterGen_Neugen::Generate().

00149     {
00150       if ( ion_pdg > kNucleusBase ) return (ion_pdg/1000000)%1000;
00151       if ( ion_pdg == kNeutron || ion_pdg == kProton ) return 1;
00152       return 0;
00153     }

Int_t StdHepUtil::getIonZ ( int  ion_pdg  )  [inline]

Definition at line 155 of file StdHepUtil.h.

References kNucleusBase, and kProton.

Referenced by InterGen_Neugen::CalcXsec(), and InterGen_Neugen::Generate().

00156     {
00157       if ( ion_pdg > kNucleusBase ) return (ion_pdg/1000)%1000;
00158       if ( ion_pdg == kProton ) return 1;
00159       return 0;
00160     }

Int_t StdHepUtil::indexPrimaryNu ( TClonesArray *  stdheplist,
Int_t  indx 
)

Definition at line 87 of file StdHepUtil.cxx.

References isDocStatus(), isNeutrino(), Msg::kInfo, Msg::kWarning, MSG, and n.

00088 {
00089     std::vector<int> indxTrace;
00090     indxTrace.push_back(indx);
00091 
00092     int n = stdheplist->GetLast()+1;
00093     while ( indx >= 0 && indx < n ) {
00094         TParticle* apart = dynamic_cast<TParticle*>(stdheplist->At(indx));
00095         if ( isDocStatus(apart) ) {
00096             while ( ! isNeutrino(apart) ) {
00097                 // not a neutrino ... move forward by one looking for it
00098                 indx--;
00099                 indxTrace.push_back(indx);
00100                 if ( indx < 0 || indx >= n ) goto badtrace;
00101                 apart = dynamic_cast<TParticle*>(stdheplist->At(indx));
00102             }
00103             return indx;  // found it
00104         } // isDocStatus
00105         indx = apart->GetMother(0);
00106         indxTrace.push_back(indx);
00107     }
00108 
00109   badtrace:
00110     MSG("StdHepUtil",Msg::kWarning)
00111         << "indexPrimaryNu indx=" << indx 
00112         << " out-of-range n=" << n << endl
00113         << "    Followed the trace: ";
00114     for (unsigned int i=0; i<indxTrace.size(); ++i ) 
00115         MSG("StdHepUtil",Msg::kInfo) << " " << indxTrace[i];
00116     MSG("StdHepUtil",Msg::kInfo) << endl;
00117     return -1;
00118 
00119     
00120 
00121 }

Bool_t StdHepUtil::isActiveStatus ( const TParticle *  part  )  [inline]

Definition at line 75 of file StdHepUtil.h.

References kActiveStatus.

Referenced by NuEvtKin::LinkStdHepIndexToEvent().

00076     {
00077       // Is the status code "Active"?
00078       // This should indicate a particle from the event generator
00079       // that is in the final state
00080       Int_t status = part->GetStatusCode();
00081       if ( status == kActiveStatus ) return true;
00082       return false;
00083     }

Bool_t StdHepUtil::isDocStatus ( const TParticle *  part  )  [inline]

Definition at line 65 of file StdHepUtil.h.

References kInitialStatus.

Referenced by indexPrimaryNu(), and NuEvtKin::LinkStdHepIndexToEvent().

00066     {
00067       // Is the status code "Documentation" or "null"?
00068       // This should indicate an initial particle in the event generator
00069       Int_t status = part->GetStatusCode();
00070       // if ( status == kDocStatus || status == kNullStatus ) return true;
00071       if ( status == kInitialStatus ) return true;
00072       return false;
00073     }

Bool_t StdHepUtil::isElectron ( const TParticle *  part  )  [inline]

Definition at line 108 of file StdHepUtil.h.

References kElectron.

Referenced by HepevtModule::FillNeuKinStructFromStdHepRange().

00109     {
00110       Int_t pdg = part->GetPdgCode();
00111       if ( pdg == kElectron || pdg == -kElectron ) return true;
00112       return false;
00113     }

Bool_t StdHepUtil::isLepton ( const TParticle *  part  )  [inline]

Definition at line 85 of file StdHepUtil.h.

Referenced by NuEvtKin::LinkStdHepIndexToEvent().

00086     {
00087       UInt_t abspdg = TMath::Abs(part->GetPdgCode());
00088       if ( abspdg >=  11 && abspdg <= 16 ) return true;
00089       return false;
00090     }

Bool_t StdHepUtil::isMuon ( const TParticle *  part  )  [inline]

Definition at line 101 of file StdHepUtil.h.

References kMuon.

Referenced by HepevtModule::FillNeuKinStructFromStdHepRange().

00102     {
00103       Int_t pdg = part->GetPdgCode();
00104       if ( pdg == kMuon || pdg == -kMuon ) return true;
00105       return false;
00106     }

Bool_t StdHepUtil::isNeutrino ( const TParticle *  part  )  [inline]

Definition at line 92 of file StdHepUtil.h.

References kNuE, kNuMu, and kNuTau.

Referenced by HepevtModule::FillNeuKinStructFromStdHepRange(), indexPrimaryNu(), and NuEvtKin::LinkStdHepIndexToEvent().

00093     {
00094       Int_t pdg = part->GetPdgCode();
00095       if ( pdg ==  kNuE   || pdg == -kNuE   ||
00096            pdg ==  kNuMu  || pdg == -kNuMu  ||
00097            pdg ==  kNuTau || pdg == -kNuTau    ) return true;
00098       return false;
00099     }

Bool_t StdHepUtil::isNeutron ( const TParticle *  part  )  [inline]

Definition at line 129 of file StdHepUtil.h.

References kNeutron.

Referenced by NuEvtKin::LinkStdHepIndexToEvent().

00130     {
00131       Int_t pdg = part->GetPdgCode();
00132       if ( pdg == kNeutron || pdg == -kNeutron ) return true;
00133       return false;
00134     }

Bool_t StdHepUtil::isNucleus ( const TParticle *  part  )  [inline]

Definition at line 136 of file StdHepUtil.h.

References kNucleusBase.

Referenced by NuEvtKin::LinkStdHepIndexToEvent().

00137     {
00138       Int_t pdg = part->GetPdgCode();
00139       if ( pdg > kNucleusBase ) return true;
00140       return false;
00141     }

Bool_t StdHepUtil::isProton ( const TParticle *  part  )  [inline]

Definition at line 122 of file StdHepUtil.h.

References kProton.

Referenced by NuEvtKin::LinkStdHepIndexToEvent().

00123     {
00124       Int_t pdg = part->GetPdgCode();
00125       if ( pdg == kProton || pdg == -kProton ) return true;
00126       return false;
00127     }

Bool_t StdHepUtil::isTau ( const TParticle *  part  )  [inline]

Definition at line 115 of file StdHepUtil.h.

References kTau.

Referenced by HepevtModule::FillNeuKinStructFromStdHepRange(), and NuEvtKin::LinkStdHepIndexToEvent().

00116     {
00117       Int_t pdg = part->GetPdgCode();
00118       if ( pdg == kTau || pdg == -kTau ) return true;
00119       return false;
00120     }

Int_t StdHepUtil::makeIonPDG ( int  ia,
int  iz,
int  ij = 0 
) [inline]

Definition at line 143 of file StdHepUtil.h.

Referenced by MCApplication::AddIons(), and NuTransport::GenerateEvent().

00144     {
00145       return  ij + 1000*(iz + 1000*(ia + 1000));
00146     } 


Generated on 19 Jan 2018 for loon by  doxygen 1.6.1