CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
ProcessTypeEnumerator Class Reference

#include <ProcessTypeEnumerator.h>

Public Types

typedef std::map< std::string,
unsigned int > 
MapType
 
typedef std::map< unsigned int,
std::string > 
ReverseMapType
 

Public Member Functions

unsigned int numberOfKnownProcesses ()
 
unsigned int processId (std::string)
 
std::string processName (unsigned int)
 
 ProcessTypeEnumerator ()
 

Private Member Functions

void buildReverseMap ()
 

Private Attributes

MapType mapProcesses
 
ReverseMapType reverseMapProcesses
 

Detailed Description

This is the Profound level of ProcessTypeEnumerator. It maps between int and our (CMS) convention of physical processes.

Definition at line 10 of file ProcessTypeEnumerator.h.

Member Typedef Documentation

typedef std::map<std::string,unsigned int> ProcessTypeEnumerator::MapType

Definition at line 12 of file ProcessTypeEnumerator.h.

typedef std::map<unsigned int,std::string> ProcessTypeEnumerator::ReverseMapType

Definition at line 13 of file ProcessTypeEnumerator.h.

Constructor & Destructor Documentation

ProcessTypeEnumerator::ProcessTypeEnumerator ( )

Definition at line 4 of file ProcessTypeEnumerator.cc.

References buildReverseMap(), and mapProcesses.

4  {
5  mapProcesses["Undefined"] = 0;
6  mapProcesses["Unknown"] = 1;
7  mapProcesses["Primary"] = 2;
8  mapProcesses["Hadronic"] = 3;
9  mapProcesses["Decay"] = 4;
10  mapProcesses["Compton"] = 5;
11  mapProcesses["Annihilation"] = 6;
12  mapProcesses["EIoni"] = 7;
13  mapProcesses["HIoni"] = 8;
14  mapProcesses["MuIoni"] = 9;
15  mapProcesses["Photon"] = 10;
16  mapProcesses["MuPairProd"] = 11;
17  mapProcesses["Conversions"] = 12;
18  mapProcesses["EBrem"] = 13;
19  mapProcesses["SynchrotronRadiation"] = 14;
20  mapProcesses["MuBrem"] = 15;
21  mapProcesses["MuNucl"] = 16;
22 
23  //
24  //
26 }

Member Function Documentation

void ProcessTypeEnumerator::buildReverseMap ( )
private

Definition at line 47 of file ProcessTypeEnumerator.cc.

References mapProcesses, and reverseMapProcesses.

Referenced by ProcessTypeEnumerator().

47  {
48  for (MapType::const_iterator it = mapProcesses.begin(); it != mapProcesses.end(); it++)
49  reverseMapProcesses[(*it).second] = (*it).first;
50 }
ReverseMapType reverseMapProcesses
unsigned int ProcessTypeEnumerator::numberOfKnownProcesses ( )

Definition at line 43 of file ProcessTypeEnumerator.cc.

References mapProcesses.

43  {
44  return mapProcesses.size();
45 }
unsigned int ProcessTypeEnumerator::processId ( std::string  in)

Definition at line 28 of file ProcessTypeEnumerator.cc.

References recoMuon::in, and mapProcesses.

Referenced by G4ProcessTypeEnumerator::processId().

28  {
29  if (in == "Undefined") return 0;
30  if (mapProcesses[in] == 0)
31  // throw Genexception("ProcessTypeEnumerator: unknown process "+in);
32  ;
33  return mapProcesses[in];
34 }
std::string ProcessTypeEnumerator::processName ( unsigned int  in)

Definition at line 36 of file ProcessTypeEnumerator.cc.

References recoMuon::in, and reverseMapProcesses.

36  {
37  if (reverseMapProcesses[in] == "")
38  // throw Genexception("ProcessTypeEnumerator: unknown process id "+in);
39  ;
40  return reverseMapProcesses[in];
41 }
ReverseMapType reverseMapProcesses

Member Data Documentation

MapType ProcessTypeEnumerator::mapProcesses
private
ReverseMapType ProcessTypeEnumerator::reverseMapProcesses
private

Definition at line 22 of file ProcessTypeEnumerator.h.

Referenced by buildReverseMap(), and processName().