ROOT logo
// @(#)root/vmc:$Id: TVirtualMCApplication.h 27106 2009-01-09 07:55:28Z brun $
// Author: Ivana Hrivnacova, 23/03/2002

/*************************************************************************
 * Copyright (C) 2006, Rene Brun and Fons Rademakers.                    *
 * Copyright (C) 2002, ALICE Experiment at CERN.                         *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TVirtualMCApplication
#define ROOT_TVirtualMCApplication
//
// Class TVirtualMCApplication
// ---------------------------
// Interface to a user Monte Carlo application.
//

#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
#ifndef ROOT_TMath
#include "TMath.h"
#endif

class TVirtualMCApplication : public TNamed {

public:
   // Standard constructor
   TVirtualMCApplication(const char *name, const char *title);

   // Default constructor
   TVirtualMCApplication();

   // Destructor
   virtual ~TVirtualMCApplication();

   // Static access method
   static TVirtualMCApplication* Instance();

   //
   // methods
   //

   // Construct user geometry
   virtual void ConstructGeometry() = 0;

   // Misalign user geometry (optional)
   virtual Bool_t MisalignGeometry() {return kFALSE;}

   // Define parameters for optical processes (optional)
   virtual void ConstructOpGeometry() {}

   // Initialize geometry
   // (Usually used to define sensitive volumes IDs)
   virtual void InitGeometry() = 0;

   // Add user defined particles (optional)
   virtual void AddParticles() {}

   // Add user defined ions (optional)
   virtual void AddIons() {}

   // Generate primary particles
   virtual void GeneratePrimaries() = 0;

   // Define actions at the beginning of the event
   virtual void BeginEvent() = 0;

   // Define actions at the beginning of the primary track
   virtual void BeginPrimary() = 0;

   // Define actions at the beginning of each track
   virtual void PreTrack() = 0;

   // Define action at each step
   virtual void Stepping() = 0;

   // Define actions at the end of each track
   virtual void PostTrack() = 0;

   // Define actions at the end of the primary track
   virtual void FinishPrimary() = 0;

   // Define actions at the end of the event
   virtual void FinishEvent() = 0;

   // Define maximum radius for tracking (optional)
   virtual Double_t TrackingRmax() const { return DBL_MAX; }

   // Define maximum z for tracking (optional)
   virtual Double_t TrackingZmax() const { return DBL_MAX; }

   // Calculate user field \a b at point \a x
   virtual void     Field(const Double_t* x, Double_t* b) const;

private:
   // static data members
   static TVirtualMCApplication* fgInstance; // singleton instance

   ClassDef(TVirtualMCApplication,1)  //Interface to MonteCarlo application
};

inline void TVirtualMCApplication::Field(const Double_t* /*x*/, Double_t* b) const {
   // No magnetic field
   b[0] = 0; b[1] = 0; b[2] = 0;
}   

#endif //ROOT_TVirtualMCApplication

 TVirtualMCApplication.h:1
 TVirtualMCApplication.h:2
 TVirtualMCApplication.h:3
 TVirtualMCApplication.h:4
 TVirtualMCApplication.h:5
 TVirtualMCApplication.h:6
 TVirtualMCApplication.h:7
 TVirtualMCApplication.h:8
 TVirtualMCApplication.h:9
 TVirtualMCApplication.h:10
 TVirtualMCApplication.h:11
 TVirtualMCApplication.h:12
 TVirtualMCApplication.h:13
 TVirtualMCApplication.h:14
 TVirtualMCApplication.h:15
 TVirtualMCApplication.h:16
 TVirtualMCApplication.h:17
 TVirtualMCApplication.h:18
 TVirtualMCApplication.h:19
 TVirtualMCApplication.h:20
 TVirtualMCApplication.h:21
 TVirtualMCApplication.h:22
 TVirtualMCApplication.h:23
 TVirtualMCApplication.h:24
 TVirtualMCApplication.h:25
 TVirtualMCApplication.h:26
 TVirtualMCApplication.h:27
 TVirtualMCApplication.h:28
 TVirtualMCApplication.h:29
 TVirtualMCApplication.h:30
 TVirtualMCApplication.h:31
 TVirtualMCApplication.h:32
 TVirtualMCApplication.h:33
 TVirtualMCApplication.h:34
 TVirtualMCApplication.h:35
 TVirtualMCApplication.h:36
 TVirtualMCApplication.h:37
 TVirtualMCApplication.h:38
 TVirtualMCApplication.h:39
 TVirtualMCApplication.h:40
 TVirtualMCApplication.h:41
 TVirtualMCApplication.h:42
 TVirtualMCApplication.h:43
 TVirtualMCApplication.h:44
 TVirtualMCApplication.h:45
 TVirtualMCApplication.h:46
 TVirtualMCApplication.h:47
 TVirtualMCApplication.h:48
 TVirtualMCApplication.h:49
 TVirtualMCApplication.h:50
 TVirtualMCApplication.h:51
 TVirtualMCApplication.h:52
 TVirtualMCApplication.h:53
 TVirtualMCApplication.h:54
 TVirtualMCApplication.h:55
 TVirtualMCApplication.h:56
 TVirtualMCApplication.h:57
 TVirtualMCApplication.h:58
 TVirtualMCApplication.h:59
 TVirtualMCApplication.h:60
 TVirtualMCApplication.h:61
 TVirtualMCApplication.h:62
 TVirtualMCApplication.h:63
 TVirtualMCApplication.h:64
 TVirtualMCApplication.h:65
 TVirtualMCApplication.h:66
 TVirtualMCApplication.h:67
 TVirtualMCApplication.h:68
 TVirtualMCApplication.h:69
 TVirtualMCApplication.h:70
 TVirtualMCApplication.h:71
 TVirtualMCApplication.h:72
 TVirtualMCApplication.h:73
 TVirtualMCApplication.h:74
 TVirtualMCApplication.h:75
 TVirtualMCApplication.h:76
 TVirtualMCApplication.h:77
 TVirtualMCApplication.h:78
 TVirtualMCApplication.h:79
 TVirtualMCApplication.h:80
 TVirtualMCApplication.h:81
 TVirtualMCApplication.h:82
 TVirtualMCApplication.h:83
 TVirtualMCApplication.h:84
 TVirtualMCApplication.h:85
 TVirtualMCApplication.h:86
 TVirtualMCApplication.h:87
 TVirtualMCApplication.h:88
 TVirtualMCApplication.h:89
 TVirtualMCApplication.h:90
 TVirtualMCApplication.h:91
 TVirtualMCApplication.h:92
 TVirtualMCApplication.h:93
 TVirtualMCApplication.h:94
 TVirtualMCApplication.h:95
 TVirtualMCApplication.h:96
 TVirtualMCApplication.h:97
 TVirtualMCApplication.h:98
 TVirtualMCApplication.h:99
 TVirtualMCApplication.h:100
 TVirtualMCApplication.h:101
 TVirtualMCApplication.h:102
 TVirtualMCApplication.h:103
 TVirtualMCApplication.h:104
 TVirtualMCApplication.h:105
 TVirtualMCApplication.h:106
 TVirtualMCApplication.h:107
 TVirtualMCApplication.h:108
 TVirtualMCApplication.h:109
 TVirtualMCApplication.h:110
 TVirtualMCApplication.h:111
 TVirtualMCApplication.h:112