PIDDef Namespace Reference

Namespace PIDDef holds all constants necessary for Particle ID. More...


Enumerations

enum  PID_t {
  kElectron, kMuon, kPion, kKaon,
  kProton, kDeuteron, kTriton, kNPID,
  kUndef
}
enum  Detector_t {
  kTPC, kTOF, kCkov, kRICH,
  kBCkov, kEMCal, kHCal, kNDet
}

Functions

const char * DetName (int det)
 Returns PID detector name.
const char * PartName (int part)
int AsPDG (int part)
double PartMass (int part)
 Return particle mass in GeV/c^2.
bool IsValid (int const RBPid)
 Check if a given integer is a valid PID_t.

Variables

static int const kRBtoPDG [kNPID] = {11,13,211,321,2212,95,96}
static double const kRBmass [kNPID]


Detailed Description

Namespace PIDDef holds all constants necessary for Particle ID.

In particular, we define particles that we can assign ID's to and detectors that are capable of doing particle ID. This info is to be stored in RBPID class and classes that inherit from it. Notice that detector enum also exists in DetDef namespace. Here the namespace is extended by some useful functions that are implemented in the .cxx and require linking against this lib.


Enumeration Type Documentation

enum PIDDef::PID_t

Enumerator:
kElectron 
kMuon 
kPion 
kKaon 
kProton 
kDeuteron 
kTriton 
kNPID 
kUndef 

Definition at line 23 of file RBDefsNoDep.h.

00023              {
00024     kElectron,
00025     kMuon,
00026     kPion,
00027     kKaon,
00028     kProton,
00029     kDeuteron,
00030     kTriton,
00031     kNPID,
00032     kUndef
00033   };

enum PIDDef::Detector_t

Enumerator:
kTPC 
kTOF 
kCkov 
kRICH 
kBCkov 
kEMCal 
kHCal 
kNDet 

Definition at line 35 of file RBDefsNoDep.h.

00035                   {
00036     kTPC,
00037     kTOF,
00038     kCkov,
00039     kRICH,
00040     kBCkov,
00041     kEMCal,
00042     kHCal,
00043     kNDet
00044   };


Function Documentation

const char * PIDDef::DetName ( int  det  ) 

Returns PID detector name.

Definition at line 17 of file RBDefs.cxx.

References Case.

Referenced by MCTrack::GetCkovHitIndices(), MCTrack::GetTofHitIndices(), GlobalPid::GlobalPid(), main(), MCMatch::ScoreByHits(), ValiMC::SetupDataHists(), and GlobalPid::SetupDataHists().

00018 {
00019   switch (det) {
00020     Case(TPC);
00021     Case(TOF);
00022     Case(Ckov);
00023     Case(RICH);
00024     Case(BCkov);
00025   default: return "?Undef?";
00026   }
00027 }

const char * PIDDef::PartName ( int  part  ) 

Definition at line 31 of file RBDefs.cxx.

References kDeuteron, kElectron, kKaon, kMuon, kPion, kProton, and kTriton.

Referenced by AnalyzeLike(), Book(), Priors::DecodePriors(), TPCRPid::DetermineLLPIDFromdEdx(), TPCPid::DiffNllk(), DrawNllkHists(), GlobalPid::GlobalLikelihoods(), GlobalPid::GlobalPid(), BCkovReco::InitAnglesAndCombos(), TPCPid::Likelihoods(), RICHPid::Likelihoods(), main(), BCkovReco::MakeHistos(), TPCPid::MakeWeightedHists(), RICHPid::MakeWeightedHists(), GlobalPid::MakeWeightedHists(), NegLogPriorLikelihood(), Priors::NegLogPriorLikelihood(), NuMITgtAna::NuMITgtAna(), plotHyp(), plotProbHyp(), GlobalPid::PrintGlobal(), TPCPid::Printnll(), RICHPid::Printnll(), TPCPid::SetupDataHists(), RICHPid::SetupDataHists(), GlobalPid::SetupDataHists(), Priors::SetupPriorHists(), and Priors::WritePriors().

00032 {
00033   switch (part) {
00034   case PIDDef::kElectron: return "Electron";
00035   case PIDDef::kMuon:     return "Muon";
00036   case PIDDef::kPion:     return "Pion";
00037   case PIDDef::kKaon:     return "Kaon";
00038   case PIDDef::kProton:   return "Proton";
00039   case PIDDef::kDeuteron: return "Deuteron";
00040   case PIDDef::kTriton:   return "Triton";
00041   default:                return "Undefined";
00042   }
00043 }

int PIDDef::AsPDG ( int  part  ) 

Definition at line 47 of file RBDefs.cxx.

References kNPID, and kRBtoPDG.

00048 {
00049   if ( part > 0 && part < kNPID ) return kRBtoPDG[part];
00050   return 0;
00051 }

double PIDDef::PartMass ( int  part  ) 

Return particle mass in GeV/c^2.

Definition at line 56 of file RBDefs.cxx.

References kNPID, and kRBmass.

Referenced by TPCRUtils::BetheBlochdEdx(), TOFTReco::DeltaT01(), RICHReco::GetRad(), BCkovReco::InitAnglesAndCombos(), RICHReco::Likelihood(), RICHPid::Likelihoods(), Lorentz::Lorentz(), main(), TPCdEdxResolRR::MeanOff(), TPCdEdxResol::MeanOff(), Lorentz::NewBeam(), CkovMatchTrk::NewRun(), ProcEvent(), TOFTReco::Reco(), CkovMatchTrk::Reco(), and TPCdEdxResol::Resol().

00057 {
00058   if ( part > 0 && part < kNPID ) return kRBmass[part];
00059   return 0.; 
00060 }

bool PIDDef::IsValid ( int const   RBPid  ) 

Check if a given integer is a valid PID_t.

Definition at line 65 of file RBDefs.cxx.

References kNPID, and kUndef.

00066 {
00067   if ( (RBPid > 0 && RBPid < kNPID) || RBPid == kUndef ) return true;
00068   return false;
00069 }


Variable Documentation

int const PIDDef::kRBtoPDG[kNPID] = {11,13,211,321,2212,95,96} [static]

Definition at line 61 of file RBDefsNoDep.h.

Referenced by AsPDG(), and MCCParticle::RBCode().

double const PIDDef::kRBmass[kNPID] [static]

Initial value:

    {  0.5109989180e-3,  105.6583692e-3,  139.57018e-3,  493.677e-3,
       938.272029e-3,   1875.61282e-3,   2808.920906e-3}

Definition at line 66 of file RBDefsNoDep.h.

Referenced by PartMass(), and DSTUtil::RICH::SimpleRadPID().


Generated on Mon Nov 23 08:05:25 2009 for MIPP(E907) by  doxygen 1.4.7