CalDetParticleType Namespace Reference

Typedefs

typedef enum
CalDetParticleType::ECalDetParticleType 
CalDetParticleType_t

Enumerations

enum  ECalDetParticleType {
  kUnknown = 0x00, kElectron = 0x01, kMuon = 0x02, kPion = 0x04,
  kKaon = 0x08, kProton = 0x10
}

Functions

const Char_t * AsString (CalDetParticleType_t type)
std::string AsString (Int_t)

Typedef Documentation


Enumeration Type Documentation

Enumerator:
kUnknown 
kElectron 
kMuon 
kPion 
kKaon 
kProton 

Definition at line 27 of file CalDetParticleType.h.

00027                                    {
00028     kUnknown   = 0x00,
00029     kElectron  = 0x01,
00030     kMuon      = 0x02,
00031     kPion      = 0x04,
00032     kKaon      = 0x08,
00033     kProton    = 0x10
00034   } CalDetParticleType_t;


Function Documentation

std::string CalDetParticleType::AsString ( Int_t  t  ) 

Definition at line 19 of file CalDetParticleType.cxx.

References AsString(), kElectron, kKaon, kMuon, kPion, kProton, and kUnknown.

00020 {
00021      bool found_one=false;
00022      std::string s;
00023      if(t&CalDetParticleType::kElectron){
00024           s+=CalDetParticleType::AsString(CalDetParticleType::kElectron);
00025           found_one=true;
00026      }
00027      if(t&CalDetParticleType::kMuon){
00028           if(found_one) s+=" or ";
00029           s+=CalDetParticleType::AsString(CalDetParticleType::kMuon);
00030           found_one=true;
00031      }
00032      if(t&CalDetParticleType::kPion){
00033           if(found_one) s+=" or ";
00034           s+=CalDetParticleType::AsString(CalDetParticleType::kPion);
00035           found_one=true;
00036      }
00037      if(t&CalDetParticleType::kKaon){
00038           if(found_one) s+=" or ";
00039           s+=CalDetParticleType::AsString(CalDetParticleType::kKaon);
00040           found_one=true;
00041      }
00042      if(t&CalDetParticleType::kProton){
00043           if(found_one) s+=" or ";
00044           s+=CalDetParticleType::AsString(CalDetParticleType::kProton);
00045           found_one=true;
00046      }
00047 
00048      if(!found_one){
00049           s+=CalDetParticleType::AsString(CalDetParticleType::kUnknown);
00050      }
00051 
00052      return s;
00053 
00054 }

const Char_t * CalDetParticleType::AsString ( CalDetParticleType_t  type  ) 

Definition at line 6 of file CalDetParticleType.cxx.

References kElectron, kKaon, kMuon, kPion, kProton, and kUnknown.

Referenced by AsString().

00006                                                                      {
00007   switch (type) {
00008   case kUnknown:    return "Unknown";      break;
00009   case kElectron:   return "Electron";     break;
00010   case kMuon:       return "Muon";         break;
00011   case kPion:       return "Pion";         break;
00012   case kKaon:       return "Kaon";         break;
00013   case kProton:     return "Proton";       break;
00014   default:          return "?Unknown?";    break;
00015   }
00016   return "?Unknown?";
00017 }


Generated on 3 Oct 2018 for loon by  doxygen 1.6.1