TVirtualMCApplication.h

Go to the documentation of this file.
00001 // @(#)root/vmc:$Id: TVirtualMCApplication.h 30651 2009-10-09 13:17:17Z brun $
00002 // Author: Ivana Hrivnacova, 23/03/2002
00003 
00004 /*************************************************************************
00005  * Copyright (C) 2006, Rene Brun and Fons Rademakers.                    *
00006  * Copyright (C) 2002, ALICE Experiment at CERN.                         *
00007  * All rights reserved.                                                  *
00008  *                                                                       *
00009  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00010  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00011  *************************************************************************/
00012 
00013 #ifndef ROOT_TVirtualMCApplication
00014 #define ROOT_TVirtualMCApplication
00015 //
00016 // Class TVirtualMCApplication
00017 // ---------------------------
00018 // Interface to a user Monte Carlo application.
00019 //
00020 
00021 #ifndef ROOT_TNamed
00022 #include "TNamed.h"
00023 #endif
00024 #ifndef ROOT_TMath
00025 #include "TMath.h"
00026 #endif
00027 
00028 class TVirtualMCApplication : public TNamed {
00029 
00030 public:
00031    // Standard constructor
00032    TVirtualMCApplication(const char *name, const char *title);
00033 
00034    // Default constructor
00035    TVirtualMCApplication();
00036 
00037    // Destructor
00038    virtual ~TVirtualMCApplication();
00039 
00040    // Static access method
00041    static TVirtualMCApplication* Instance();
00042 
00043    //
00044    // methods
00045    //
00046 
00047    // Construct user geometry
00048    virtual void ConstructGeometry() = 0;
00049 
00050    // Misalign user geometry (optional)
00051    virtual Bool_t MisalignGeometry() {return kFALSE;}
00052 
00053    // Define parameters for optical processes (optional)
00054    virtual void ConstructOpGeometry() {}
00055 
00056    // Initialize geometry
00057    // (Usually used to define sensitive volumes IDs)
00058    virtual void InitGeometry() = 0;
00059 
00060    // Add user defined particles (optional)
00061    virtual void AddParticles() {}
00062 
00063    // Add user defined ions (optional)
00064    virtual void AddIons() {}
00065 
00066    // Generate primary particles
00067    virtual void GeneratePrimaries() = 0;
00068 
00069    // Define actions at the beginning of the event
00070    virtual void BeginEvent() = 0;
00071 
00072    // Define actions at the beginning of the primary track
00073    virtual void BeginPrimary() = 0;
00074 
00075    // Define actions at the beginning of each track
00076    virtual void PreTrack() = 0;
00077 
00078    // Define action at each step
00079    virtual void Stepping() = 0;
00080 
00081    // Define actions at the end of each track
00082    virtual void PostTrack() = 0;
00083 
00084    // Define actions at the end of the primary track
00085    virtual void FinishPrimary() = 0;
00086 
00087    // Define actions at the end of the event
00088    virtual void FinishEvent() = 0;
00089 
00090    // Define maximum radius for tracking (optional)
00091    virtual Double_t TrackingRmax() const { return DBL_MAX; }
00092 
00093    // Define maximum z for tracking (optional)
00094    virtual Double_t TrackingZmax() const { return DBL_MAX; }
00095 
00096    // Calculate user field \a b at point \a x
00097    virtual void     Field(const Double_t* x, Double_t* b) const;
00098 
00099    // Define action at each step for Geane
00100    virtual void GeaneStepping() {;}
00101 
00102 private:
00103    // static data members
00104    static TVirtualMCApplication* fgInstance; // singleton instance
00105 
00106    ClassDef(TVirtualMCApplication,1)  //Interface to MonteCarlo application
00107 };
00108 
00109 inline void TVirtualMCApplication::Field(const Double_t* /*x*/, Double_t* b) const {
00110    // No magnetic field
00111    b[0] = 0; b[1] = 0; b[2] = 0;
00112 }   
00113 
00114 #endif //ROOT_TVirtualMCApplication
00115 

Generated on Tue Jul 5 14:28:28 2011 for ROOT_528-00b_version by  doxygen 1.5.1