swh:1:snp:af87cd67498ef4fe47c76ed3e7caffe5b61facaf
Raw File
Tip revision: 9a9e5b4cf3f43c391212ffc2c292ca1ffdba8767 authored by Unknown Author on 08 May 2006, 14:01:31 UTC
This commit was manufactured by cvs2svn to create tag 'v5-11-02'.
Tip revision: 9a9e5b4
TVirtualMC.cxx
// @(#)root/mc:$Name: v4-02-00 $:$Id: TVirtualMC.cxx,v 1.4 2004/06/08 10:26:42 brun Exp $
// Authors: Ivana Hrivnacova, Rene Brun , Federico Carminati 13/04/2002
   
/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 **************************************************************************/

#include "TVirtualMC.h"

//______________________________________________________________________________
//   Virtual MC provides a virtual interface to Monte Carlo. 
//   It enables the user to build a virtual Monte Carlo application
//   independent of any actual underlying Monte Carlo implementation itself.
//
//   A user will have to implement a class derived from the abstract 
//   Monte Carlo application class, and provide functions like
//   ConstructGeometry(), BeginEvent(), FinishEvent(), ... . 
//   The concrete Monte Carlo (Geant3, Geant4) is selected at run time -
//   when processing a ROOT macro where the concrete Monte Carlo is instantiated.
//______________________________________________________________________________

ClassImp(TVirtualMC)

TVirtualMC* TVirtualMC::fgMC=0;
TVirtualMC* gMC;

//_____________________________________________________________________________
TVirtualMC::TVirtualMC(const char *name, const char *title,
                       Bool_t /*isRootGeometrySupported*/) 
  : TNamed(name,title),
    fStack(0),
    fDecayer(0),
    fRandom(0)
{
  //
  // Standard constructor
  //
  if(fgMC) {
    Warning("TVirtualMC","Cannot initialise twice MonteCarlo class");
  } else {
    fgMC=this;
    gMC=this;
 
    fApplication = TVirtualMCApplication::Instance();  
  
    if (!fApplication) {
      Error("TVirtualMC", "No user MC application is defined.");
    }
    
    fRandom = gRandom;
  }
}

//_____________________________________________________________________________
TVirtualMC::TVirtualMC()
  : TNamed(),
    fApplication(0),
    fStack(0),
    fDecayer(0),
    fRandom(0)
{    
  //
  // Default constructor
  //
}

//_____________________________________________________________________________
TVirtualMC::~TVirtualMC() 
{
  //
  // Destructor
  //
  fgMC=0;
  gMC=0;
}

//
// methods
//

//_____________________________________________________________________________
void TVirtualMC::SetStack(TVirtualMCStack* stack) 
{ 
// 
// Set particles stack.
//

  fStack = stack; 
}

//_____________________________________________________________________________
void TVirtualMC::SetExternalDecayer(TVirtualMCDecayer* decayer) 
{ 
// 
// Set external decayer.
//

  fDecayer = decayer;
}

//_____________________________________________________________________________
void TVirtualMC::SetRandom(TRandom* random) 
{ 
// 
// Set random number generator.
//
   gRandom = random;
   fRandom = random; 
}
back to top