/*
$Log$
+Revision 1.2 1999/09/29 09:24:29 fca
+Introduction of the Copyright and cvs Log
+
*/
+#include <stdlib.h>
#include "AliMC.h"
AliMC* gMC;
-AliMC::AliMC()
-{
-}
-
AliMC::AliMC(const char *name, const char *title) : TNamed(name,title)
{
if(fgMC) {
printf("Cannot initialise twice MonteCarlo class\n");
+ exit(1);
} else {
fgMC=this;
gMC=this;
#include <TNamed.h>
#include <TLorentzVector.h>
+class AliMC;
+
+R__EXTERN AliMC *gMC;
+
class AliMC : public TNamed
{
public:
AliMC(const char *name, const char *title);
- AliMC();
- virtual ~AliMC() {}
+ AliMC() {}
+ virtual ~AliMC() {fgMC=gMC=0;}
// static access method
- static inline AliMC* GetMC();
+ static AliMC* GetMC() { return fgMC; }
//
// methods for building/management of geometry
ClassDef(AliMC,1) //Geometry Interface Class
};
-// inline methods
-inline AliMC* AliMC::GetMC() { return fgMC; }
-
-R__EXTERN AliMC *gMC;
-
#endif // ALI_MC_H
/*
$Log$
+Revision 1.26 2000/03/22 13:42:26 fca
+SetGenerator does not replace an existing generator, ResetGenerator does
+
Revision 1.25 2000/02/23 16:25:22 fca
AliVMC and AliGeant3 classes introduced
ReadEuclid moved from AliRun to AliModule
fGeometry = 0;
fDisplay = 0;
fField = 0;
- fMC = 0;
+ fVMC = 0;
fNdets = 0;
fImedia = 0;
fTrRmax = 1.e10;
// Create default mag field
SetField();
//
- fMC = gMC;
+ fVMC = gVMC;
//
// Prepare the tracking medium lists
fImedia = new TArrayI(1000);
//
delete fImedia;
delete fField;
- delete fMC;
+ delete fVMC;
delete fGeometry;
delete fDisplay;
delete fGenerator;
// static Int_t count=0;
// const Int_t times=10;
// This primary is finished, purify stack
- gAlice->PurifyKine();
+ PurifyKine();
// Write out hits if any
if (gAlice->TreeH()) {
if (!fInitDone) Init(setup);
// Create the Root Tree with one branch per detector
- gAlice->MakeTree("KHDER");
+ MakeTree("KHDER");
todo = TMath::Abs(nevent);
for (i=0; i<todo; i++) {
// Process one run (one run = one event)
- gAlice->Reset(fRun, fEvent);
+ Reset(fRun, fEvent);
gVMC->ProcessEvent();
- gAlice->FinishEvent();
+ FinishEvent();
fEvent++;
}
// End of this run, close files
- if(nevent>0) gAlice->FinishRun();
+ if(nevent>0) FinishRun();
}
//_____________________________________________________________________________
fLego->Run();
// Create only the Root event Tree
- gAlice->MakeTree("E");
+ MakeTree("E");
// End of this run, close files
- gAlice->FinishRun();
+ FinishRun();
}
//_____________________________________________________________________________
R__b >> fModules;
R__b >> fParticles;
R__b >> fField;
- // R__b >> fMC;
+ // R__b >> fVMC;
R__b >> fNdets;
R__b >> fTrRmax;
R__b >> fTrZmax;
R__b << fModules;
R__b << fParticles;
R__b << fField;
- // R__b << fMC;
+ // R__b << fVMC;
R__b << fNdets;
R__b << fTrRmax;
R__b << fTrZmax;
#include "AliDetector.h"
#include "AliHeader.h"
#include "AliMagF.h"
-#include "AliMC.h"
+#include "AliVMC.h"
#include "AliGenerator.h"
#include "AliLego.h"
AliDisplay *fDisplay; //Pointer to event display
TStopwatch fTimer; //Timer object
AliMagF *fField; //Magnetic Field Map
- AliMC *fMC; //pointer to MonteCarlo object
+ AliVMC *fVMC; //pointer to MonteCarlo object
TArrayI *fImedia; //Array of correspondence between media and detectors
Int_t fNdets; //Number of detectors
Float_t fTrRmax; //Maximum radius for tracking
/*
$Log$
+Revision 1.1 2000/02/23 16:25:22 fca
+AliVMC and AliGeant3 classes introduced
+ReadEuclid moved from AliRun to AliModule
+
*/
+#include <stdlib.h>
+
#include "AliVMC.h"
ClassImp(AliVMC)
AliVMC* gVMC;
-AliVMC::AliVMC()
-{
-}
-
AliVMC::AliVMC(const char *name, const char *title) : TNamed(name,title)
{
if(fgVMC) {
printf("Cannot initialise twice Alice MonteCarlo class\n");
+ exit(1);
} else {
fgVMC=this;
gVMC=this;
#include <TNamed.h>
+#include "AliMC.h"
+
+class AliVMC;
+
+R__EXTERN AliVMC *gVMC;
+
class AliVMC : public TNamed
{
public:
AliVMC(const char *name, const char *title);
- AliVMC();
- virtual ~AliVMC() {}
+ AliVMC() {}
+ ~AliVMC() {if(gMC) delete gMC; fgVMC=gVMC=0;}
//Generic access functions
- static inline AliVMC* GetVMC() {return fgVMC;}
+ static AliVMC* GetVMC() {return fgVMC;}
//Generic Alice MonteCarlo Functions
virtual void FinishGeometry() = 0;
virtual void BuildPhysics() = 0;
virtual void ProcessEvent() = 0;
-
+
//
ClassDef(AliVMC,1) //Generic MonteCarlo Class
};
-R__EXTERN AliVMC *gVMC;
-
#endif