Import Geant4 3.0.0 source tree
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# $Id: GNUmakefile,v 1.1.1.1 2000/10/31 21:42:25 barrand Exp $
|
||||
|
||||
name := G4Lizard
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../..
|
||||
endif
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
include $(G4INSTALL)/config/analysis.gmk
|
||||
|
||||
CPPFLAGS += -I$(G4BASE)/global/management/include
|
||||
|
||||
ifdef G4ANALYSIS_BUILD_LIZARD
|
||||
# CPPFLAGS +=
|
||||
endif
|
||||
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
@@ -0,0 +1,45 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4LizardSystem.hh,v 1.5 2000/11/16 13:44:41 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// Guy Barrand 14 September 2000
|
||||
|
||||
#ifndef G4LIZARDSYSTEM_H
|
||||
#define G4LIZARDSYSTEM_H
|
||||
|
||||
#if defined(G4ANALYSIS_BUILD_LIZARD) || defined(G4ANALYSIS_USE_LIZARD)
|
||||
|
||||
#include "G4VAnalysisSystem.hh"
|
||||
|
||||
class IHistogramFactory;
|
||||
class IVectorFactory;
|
||||
class IPlotter;
|
||||
|
||||
class G4LizardSystem : public G4VAnalysisSystem {
|
||||
public: // I methods :
|
||||
virtual const G4String& GetName() const;
|
||||
virtual IHistogramFactory* GetHistogramFactory();
|
||||
//
|
||||
virtual void Store(IHistogram* = 0,const G4String& = "");
|
||||
virtual void Plot(IHistogram*);
|
||||
public:
|
||||
G4LizardSystem(const G4String& name = "Lizard");
|
||||
virtual ~G4LizardSystem();
|
||||
private:
|
||||
G4String fName;
|
||||
IHistogramFactory* fHistogramFactory;
|
||||
IVectorFactory* fVectorFactory;
|
||||
IPlotter* fPlotter;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4LizardSystem.cc,v 1.8 2000/11/17 08:16:45 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// Guy Barrand 14 September 2000
|
||||
|
||||
#ifdef G4ANALYSIS_BUILD_LIZARD
|
||||
|
||||
#include <IHistogram1D.h>
|
||||
#include <IHistogram2D.h>
|
||||
//#include <IHistogramFactory.h>
|
||||
|
||||
#ifdef AIDA_DONT_USE_STD
|
||||
#define AIDA_STD
|
||||
#else
|
||||
#define AIDA_STD std
|
||||
#endif
|
||||
|
||||
// Lizard :
|
||||
#include <AIDAHistogramFactory.h>
|
||||
#include "AIDA_Plotter/AIDAPlotter.h"
|
||||
#include "Interfaces/IVector.h"
|
||||
#include "Interfaces/IVectorFactory.h"
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4LizardSystem.hh"
|
||||
|
||||
G4LizardSystem::G4LizardSystem (
|
||||
const G4String& aName
|
||||
)
|
||||
:fName(aName)
|
||||
,fHistogramFactory(0)
|
||||
,fVectorFactory(0)
|
||||
,fPlotter(0)
|
||||
{
|
||||
fHistogramFactory = createIHistogramFactory();
|
||||
if (fHistogramFactory == 0) {
|
||||
G4cout << "Can't find the histogram factory." << G4std::endl;
|
||||
}
|
||||
|
||||
fVectorFactory = createIVectorFactory();
|
||||
if (fVectorFactory == 0) {
|
||||
G4cout << "Can't find the vector factory." << G4std::endl;
|
||||
}
|
||||
|
||||
fPlotter = createIPlotter(); // create plotter with 1 zone
|
||||
if (fPlotter == 0) {
|
||||
G4cout << "Can't create a plotter." << G4std::endl;
|
||||
}
|
||||
}
|
||||
G4LizardSystem::~G4LizardSystem (){
|
||||
delete fHistogramFactory;
|
||||
}
|
||||
const G4String& G4LizardSystem::GetName() const {
|
||||
return fName;
|
||||
}
|
||||
IHistogramFactory* G4LizardSystem::GetHistogramFactory() {
|
||||
return fHistogramFactory;
|
||||
}
|
||||
void G4LizardSystem::Store(IHistogram* aHistogram,const G4String& aStorageID){
|
||||
if (!aHistogram) return;
|
||||
if (aStorageID == "") return;
|
||||
|
||||
if (aHistogram->dimensions()==1) {
|
||||
IVector* v =
|
||||
fVectorFactory->from1D(dynamic_cast<IHistogram1D*>(aHistogram));
|
||||
if (v == 0) {
|
||||
G4cerr << "G4LizardSystem::Store> ERROR: could not create vector !" <<
|
||||
G4std::endl;
|
||||
return;
|
||||
}
|
||||
v->toAscii(aStorageID.c_str());
|
||||
delete v; // don't forget this !
|
||||
}
|
||||
|
||||
if(aHistogram->dimensions()==2) {
|
||||
IVector* v =
|
||||
fVectorFactory->from2D(dynamic_cast<IHistogram2D*>(aHistogram));
|
||||
if (v == 0) {
|
||||
G4cerr << "G4LizardSystem::Store> ERROR: could not create vector !" <<
|
||||
G4std::endl;
|
||||
return;
|
||||
}
|
||||
v->toAscii(aStorageID.c_str());
|
||||
delete v; // don't forget this !
|
||||
}
|
||||
}
|
||||
void G4LizardSystem::Plot(IHistogram* aHistogram){
|
||||
if(!fVectorFactory) return;
|
||||
if(!fPlotter) return;
|
||||
if(!aHistogram) return;
|
||||
|
||||
if(aHistogram->dimensions()==1) {
|
||||
IVector* v =
|
||||
fVectorFactory->from1D(dynamic_cast<IHistogram1D*>(aHistogram));
|
||||
if (v == 0) {
|
||||
G4cerr << "ERROR: could not create vector !" << G4std::endl;
|
||||
return;
|
||||
}
|
||||
fPlotter->plot(v);
|
||||
fPlotter->refresh();
|
||||
delete v; // don't forget this !
|
||||
}
|
||||
|
||||
if(aHistogram->dimensions()==2) {
|
||||
IVector* v =
|
||||
fVectorFactory->from2D(dynamic_cast<IHistogram2D*>(aHistogram));
|
||||
if (v == 0) {
|
||||
G4cerr << "ERROR: could not create vector !" << G4std::endl;
|
||||
return;
|
||||
}
|
||||
fPlotter->plot(v);
|
||||
fPlotter->refresh();
|
||||
delete v; // don't forget this !
|
||||
}
|
||||
|
||||
//fPlotter->psPrint("posplot.ps");
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user