| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

SimProcess.h

Go to the documentation of this file.
00001 
00002 //   **************************************************************************
00003 //   *                                                                        *
00004 //   *                      ! ! ! A T T E N T I O N ! ! !                     *
00005 //   *                                                                        *
00006 //   *  This file was created automatically by GaudiObjDesc, please do not    *
00007 //   *  delete it or edit it by hand.                                         *
00008 //   *                                                                        *
00009 //   *  If you want to change this file, first change the corresponding       *
00010 //   *  xml-file and rerun the tools from GaudiObjDesc (or run make if you    *
00011 //   *  are using it from inside a Gaudi-package).                            *
00012 //   *                                                                        *
00013 //   **************************************************************************
00014 
00015 #ifndef SimEvent_SimProcess_H
00016 #define SimEvent_SimProcess_H 1
00017 
00018 // Include files
00019 #include "GaudiKernel/boost_allocator.h"
00020 #include "GaudiKernel/SerializeSTL.h"
00021 #include <string>
00022 #include <ostream>
00023 
00024 // Forward declarations
00025 
00026 namespace DayaBay 
00027 {
00028 
00029   // Forward declarations
00030   using GaudiUtils::operator<<;
00031   
00032 
00042   class SimProcess
00043   {
00044   public:
00045 
00047     enum Type{ kUnknown = 0,        // Unknown type, for error conditions
00048                kPrimaryVertex,      // Not really a process, but a seed
00049                kWorldBoundary,      // Not really a process, just hit the wall
00050                kGeomBoundary,       // Not really a process, just changed volumes
00051                kParticleStart,      // 
00052                kTransportation,     // As defined by G4ProcessType
00053                kElectromagnetic,    // As defined by G4ProcessType
00054                kOptical,            // As defined by G4ProcessType
00055                kHadronic,           // As defined by G4ProcessType
00056                kPhotolepton_hadron, // As defined by G4ProcessType
00057                kDecay,              // As defined by G4ProcessType
00058                kGeneral,            // As defined by G4ProcessType
00059                kParameterisation,   // As defined by G4ProcessType
00060                kUserDefined         // As defined by G4ProcessType
00061       };
00062   
00064   SimProcess(const Type& t,
00065                const std::string& name) : m_type(t),
00066                                           m_name(name) {}
00067   
00069   SimProcess() : m_type(kUnknown),
00070                    m_name("") {}
00071   
00073     virtual ~SimProcess() {}
00074   
00076    virtual std::ostream& fillStream(std::ostream& s) const;
00077   
00079     bool isValid() const;
00080   
00083   const Type& type() const;
00084   
00087   const std::string& name() const;
00088   
00089   
00090   #ifndef GOD_NOALLOC
00092     static void* operator new ( size_t size )
00093     {
00094       return ( sizeof(SimProcess) == size ? 
00095                boost::singleton_pool<SimProcess, sizeof(SimProcess)>::malloc() :
00096                ::operator new(size) );
00097     }
00098   
00102     static void* operator new ( size_t size, void* pObj )
00103     {
00104       return ::operator new (size,pObj);
00105     }
00106   
00108     static void operator delete ( void* p )
00109     {
00110       boost::singleton_pool<SimProcess, sizeof(SimProcess)>::is_from(p) ?
00111       boost::singleton_pool<SimProcess, sizeof(SimProcess)>::free(p) :
00112       ::operator delete(p);
00113     }
00114   
00117     static void operator delete ( void* p, void* pObj )
00118     {
00119       ::operator delete (p, pObj);
00120     }
00121   #endif
00122   protected:
00123 
00124   private:
00125 
00126     Type        m_type; 
00127     std::string m_name; 
00128   
00129   }; // class SimProcess
00130 
00131   inline std::ostream& operator<< (std::ostream& str, const SimProcess& obj)
00132   {
00133     return obj.fillStream(str);
00134   }
00135   
00136   inline std::ostream & operator << (std::ostream & s, DayaBay::SimProcess::Type e) {
00137     switch (e) {
00138       case DayaBay::SimProcess::kUnknown            : return s << "kUnknown";
00139       case DayaBay::SimProcess::kPrimaryVertex      : return s << "kPrimaryVertex";
00140       case DayaBay::SimProcess::kWorldBoundary      : return s << "kWorldBoundary";
00141       case DayaBay::SimProcess::kGeomBoundary       : return s << "kGeomBoundary";
00142       case DayaBay::SimProcess::kParticleStart      : return s << "kParticleStart";
00143       case DayaBay::SimProcess::kTransportation     : return s << "kTransportation";
00144       case DayaBay::SimProcess::kElectromagnetic    : return s << "kElectromagnetic";
00145       case DayaBay::SimProcess::kOptical            : return s << "kOptical";
00146       case DayaBay::SimProcess::kHadronic           : return s << "kHadronic";
00147       case DayaBay::SimProcess::kPhotolepton_hadron : return s << "kPhotolepton_hadron";
00148       case DayaBay::SimProcess::kDecay              : return s << "kDecay";
00149       case DayaBay::SimProcess::kGeneral            : return s << "kGeneral";
00150       case DayaBay::SimProcess::kParameterisation   : return s << "kParameterisation";
00151       case DayaBay::SimProcess::kUserDefined        : return s << "kUserDefined";
00152       default : return s << "ERROR wrong value for enum DayaBay::SimProcess::Type";
00153     }
00154   }
00155   
00156   
00157 } // namespace DayaBay;
00158 
00159 // -----------------------------------------------------------------------------
00160 // end of class
00161 // -----------------------------------------------------------------------------
00162 
00163 // Including forward declarations
00164 
00165 inline std::ostream& DayaBay::SimProcess::fillStream(std::ostream& s) const
00166 {
00167   s << "{ " << "type :  " << m_type << std::endl
00168             << "name :  " << m_name << std::endl << " }";
00169   return s;
00170 }
00171 
00172 
00173 inline const DayaBay::SimProcess::Type& DayaBay::SimProcess::type() const 
00174 {
00175   return m_type;
00176 }
00177 
00178 inline const std::string& DayaBay::SimProcess::name() const 
00179 {
00180   return m_name;
00181 }
00182 
00183 inline bool DayaBay::SimProcess::isValid() const 
00184 {
00185 return m_type != kUnknown;
00186 }
00187 
00188 
00189 #endif 
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:31:28 2011 for SimEvent by doxygen 1.4.7