Import Geant4 4.1.0 source tree
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef ExN04CalorimeterHit_h
|
||||
#define ExN04CalorimeterHit_h 1
|
||||
|
||||
#include "G4VHit.hh"
|
||||
#include "G4THitsCollection.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Transform3D.hh"
|
||||
#include "G4RotationMatrix.hh"
|
||||
|
||||
class ExN04CalorimeterHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
|
||||
ExN04CalorimeterHit();
|
||||
ExN04CalorimeterHit(G4LogicalVolume* logVol,G4int z,G4int phi);
|
||||
~ExN04CalorimeterHit();
|
||||
ExN04CalorimeterHit(const ExN04CalorimeterHit &right);
|
||||
const ExN04CalorimeterHit& operator=(const ExN04CalorimeterHit &right);
|
||||
int operator==(const ExN04CalorimeterHit &right) const;
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void *aHit);
|
||||
|
||||
void Draw();
|
||||
void Print();
|
||||
|
||||
private:
|
||||
G4int ZCellID;
|
||||
G4int PhiCellID;
|
||||
G4double edep;
|
||||
G4ThreeVector pos;
|
||||
G4RotationMatrix rot;
|
||||
const G4LogicalVolume* pLogV;
|
||||
|
||||
public:
|
||||
inline void SetCellID(G4int z,G4int phi)
|
||||
{
|
||||
ZCellID = z;
|
||||
PhiCellID = phi;
|
||||
}
|
||||
inline G4int GetZ() { return ZCellID; }
|
||||
inline G4int GetPhi() { return PhiCellID; }
|
||||
inline void SetEdep(G4double de)
|
||||
{ edep = de; }
|
||||
inline void AddEdep(G4double de)
|
||||
{ edep += de; }
|
||||
inline G4double GetEdep()
|
||||
{ return edep; }
|
||||
inline void SetPos(G4ThreeVector xyz)
|
||||
{ pos = xyz; }
|
||||
inline G4ThreeVector GetPos()
|
||||
{ return pos; }
|
||||
inline void SetRot(G4RotationMatrix rmat)
|
||||
{ rot = rmat; }
|
||||
inline G4RotationMatrix GetRot()
|
||||
{ return rot; }
|
||||
inline const G4LogicalVolume * GetLogV()
|
||||
{ return pLogV; }
|
||||
|
||||
};
|
||||
|
||||
typedef G4THitsCollection<ExN04CalorimeterHit> ExN04CalorimeterHitsCollection;
|
||||
|
||||
extern G4Allocator<ExN04CalorimeterHit> ExN04CalorimeterHitAllocator;
|
||||
|
||||
inline void* ExN04CalorimeterHit::operator new(size_t)
|
||||
{
|
||||
void *aHit;
|
||||
aHit = (void *) ExN04CalorimeterHitAllocator.MallocSingle();
|
||||
return aHit;
|
||||
}
|
||||
|
||||
inline void ExN04CalorimeterHit::operator delete(void *aHit)
|
||||
{
|
||||
ExN04CalorimeterHitAllocator.FreeSingle((ExN04CalorimeterHit*) aHit);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef ExN04CalorimeterParametrisation_H
|
||||
#define ExN04CalorimeterParametrisation_H 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VPVParameterisation.hh"
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
class G4Tubs;
|
||||
|
||||
class ExN04CalorimeterParametrisation : public G4VPVParameterisation
|
||||
{
|
||||
public:
|
||||
|
||||
ExN04CalorimeterParametrisation();
|
||||
virtual ~ExN04CalorimeterParametrisation();
|
||||
void ComputeTransformation(const G4int copyNo,
|
||||
G4VPhysicalVolume *physVol) const;
|
||||
void ComputeDimensions( G4Tubs & calorimeterLayer,
|
||||
const G4int copyNo,
|
||||
const G4VPhysicalVolume * physVol) const;
|
||||
|
||||
private:
|
||||
|
||||
#include "ExN04DetectorParameterDef.hh"
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef ExN04CalorimeterROGeometry_h
|
||||
#define ExN04CalorimeterROGeometry_h 1
|
||||
|
||||
#include "G4VReadOutGeometry.hh"
|
||||
|
||||
class ExN04CalorimeterROGeometry : public G4VReadOutGeometry
|
||||
{
|
||||
public:
|
||||
ExN04CalorimeterROGeometry();
|
||||
ExN04CalorimeterROGeometry(G4String);
|
||||
~ExN04CalorimeterROGeometry();
|
||||
|
||||
private:
|
||||
G4VPhysicalVolume* Build();
|
||||
|
||||
#include "ExN04DetectorParameterDef.hh"
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,58 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef ExN04CalorimeterSD_h
|
||||
#define ExN04CalorimeterSD_h 1
|
||||
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "ExN04CalorimeterHit.hh"
|
||||
class G4Step;
|
||||
class G4HCofThisEvent;
|
||||
class G4TouchableHistory;
|
||||
|
||||
class ExN04CalorimeterSD : public G4VSensitiveDetector
|
||||
{
|
||||
|
||||
public:
|
||||
ExN04CalorimeterSD(G4String name);
|
||||
~ExN04CalorimeterSD();
|
||||
|
||||
void Initialize(G4HCofThisEvent*HCE);
|
||||
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist);
|
||||
void EndOfEvent(G4HCofThisEvent*HCE);
|
||||
void clear();
|
||||
void DrawAll();
|
||||
void PrintAll();
|
||||
|
||||
private:
|
||||
ExN04CalorimeterHitsCollection *CalCollection;
|
||||
int CellID[20][48];
|
||||
const int numberOfCellsInZ;
|
||||
const int numberOfCellsInPhi;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef ExN04DetectorConstruction_h
|
||||
#define ExN04DetectorConstruction_h 1
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
|
||||
class ExN04DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
ExN04DetectorConstruction();
|
||||
~ExN04DetectorConstruction();
|
||||
|
||||
public:
|
||||
G4VPhysicalVolume* Construct();
|
||||
|
||||
private:
|
||||
|
||||
#include "ExN04DetectorParameterDef.hh"
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
G4double expHall_x;
|
||||
G4double expHall_y;
|
||||
G4double expHall_z;
|
||||
|
||||
G4double trkTubs_rmax;
|
||||
G4double trkTubs_rmin;
|
||||
G4double trkTubs_dz;
|
||||
G4double trkTubs_sphi;
|
||||
G4double trkTubs_dphi;
|
||||
|
||||
G4int notrkLayers;
|
||||
G4double tracker_radius[5];
|
||||
G4double tracker_thick;
|
||||
G4double tracker_length[5];
|
||||
|
||||
G4double caloTubs_rmax;
|
||||
G4double caloTubs_rmin;
|
||||
G4double caloTubs_dz;
|
||||
G4double caloTubs_sphi;
|
||||
G4double caloTubs_dphi;
|
||||
|
||||
G4int nocaloLayers;
|
||||
G4double absorber_thick;
|
||||
G4double scinti_thick;
|
||||
|
||||
G4int segmentsinZ;
|
||||
G4double caloRing_rmax;
|
||||
G4double caloRing_rmin;
|
||||
G4double caloRing_dz;
|
||||
G4double caloRing_sphi;
|
||||
G4double caloRing_dphi;
|
||||
|
||||
G4int segmentsinPhi;
|
||||
G4double caloCell_rmax;
|
||||
G4double caloCell_rmin;
|
||||
G4double caloCell_dz;
|
||||
G4double caloCell_sphi;
|
||||
G4double caloCell_dphi;
|
||||
|
||||
G4int nomucounter;
|
||||
G4double muBox_radius;
|
||||
G4double muBox_width;
|
||||
G4double muBox_thick;
|
||||
G4double muBox_length;
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// Dummy sensitive used only to flag sensitivity
|
||||
// in cells of RO geometry.
|
||||
//
|
||||
|
||||
#ifndef ExN04DummySD_h
|
||||
#define ExN04DummySD_h 1
|
||||
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
class G4Step;
|
||||
|
||||
class ExN04DummySD : public G4VSensitiveDetector
|
||||
{
|
||||
public:
|
||||
ExN04DummySD();
|
||||
~ExN04DummySD() {};
|
||||
|
||||
void Initialize(G4HCofThisEvent*HCE) {};
|
||||
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist) {return false;}
|
||||
void EndOfEvent(G4HCofThisEvent*HCE) {};
|
||||
void clear() {};
|
||||
void DrawAll() {};
|
||||
void PrintAll() {};
|
||||
};
|
||||
ExN04DummySD::ExN04DummySD()
|
||||
: G4VSensitiveDetector("dummySD")
|
||||
{}
|
||||
#endif
|
||||
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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: ExN04EMPhysics.hh,v 1.1 2002/03/05 15:22:09 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
// Class Description:
|
||||
// This class is an derived class of G4VPhysicsConstructor
|
||||
//
|
||||
// -------------------------------------------
|
||||
// History
|
||||
// first version 12 Nov. 2000 by H.Kurashige
|
||||
// ------------------------------------------------------------
|
||||
#ifndef ExN04EMPhysics_h
|
||||
#define ExN04EMPhysics_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VPhysicsConstructor.hh"
|
||||
|
||||
#include "G4PhotoElectricEffect.hh"
|
||||
#include "G4ComptonScattering.hh"
|
||||
#include "G4GammaConversion.hh"
|
||||
#include "G4MultipleScattering.hh"
|
||||
#include "G4eIonisation.hh"
|
||||
#include "G4eBremsstrahlung.hh"
|
||||
#include "G4eplusAnnihilation.hh"
|
||||
|
||||
class ExN04EMPhysics : public G4VPhysicsConstructor
|
||||
{
|
||||
public:
|
||||
ExN04EMPhysics(const G4String& name ="EM");
|
||||
virtual ~ExN04EMPhysics();
|
||||
|
||||
public:
|
||||
// This method will be invoked in the Construct() method.
|
||||
// each particle type will be instantiated
|
||||
virtual void ConstructParticle();
|
||||
|
||||
// This method will be invoked in the Construct() method.
|
||||
// each physics process will be instantiated and
|
||||
// registered to the process manager of each particle type
|
||||
virtual void ConstructProcess();
|
||||
|
||||
protected:
|
||||
// Gamma physics
|
||||
G4PhotoElectricEffect thePhotoEffect;
|
||||
G4ComptonScattering theComptonEffect;
|
||||
G4GammaConversion thePairProduction;
|
||||
|
||||
// Electron physics
|
||||
G4MultipleScattering theElectronMultipleScattering;
|
||||
G4eIonisation theElectronIonisation;
|
||||
G4eBremsstrahlung theElectronBremsStrahlung;
|
||||
|
||||
//Positron physics
|
||||
G4MultipleScattering thePositronMultipleScattering;
|
||||
G4eIonisation thePositronIonisation;
|
||||
G4eBremsstrahlung thePositronBremsStrahlung;
|
||||
G4eplusAnnihilation theAnnihilation;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef ExN04EventAction_h
|
||||
#define ExN04EventAction_h 1
|
||||
|
||||
#include "G4UserEventAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class ExN04EventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
ExN04EventAction();
|
||||
~ExN04EventAction();
|
||||
|
||||
public:
|
||||
void BeginOfEventAction(const G4Event*);
|
||||
void EndOfEventAction(const G4Event*);
|
||||
|
||||
private:
|
||||
G4int trackerCollID;
|
||||
G4int calorimeterCollID;
|
||||
G4int muonCollID;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef ExN04Field_H
|
||||
#define ExN04Field_H 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4MagneticField.hh"
|
||||
|
||||
class ExN04Field : public G4MagneticField
|
||||
{
|
||||
public:
|
||||
ExN04Field();
|
||||
~ExN04Field();
|
||||
|
||||
void GetFieldValue( const double Point[3],
|
||||
double *Bfield ) const;
|
||||
|
||||
private:
|
||||
G4double Bz;
|
||||
G4double rmax_sq;
|
||||
G4double zmax;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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: ExN04GeneralPhysics.hh,v 1.1 2002/03/05 15:22:10 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
// Class Description:
|
||||
// This class is an derived class of G4VPhysicsConstructor
|
||||
//
|
||||
// -------------------------------------------
|
||||
// History
|
||||
// first version 12 Nov. 2000 by H.Kurashige
|
||||
// ------------------------------------------------------------
|
||||
#ifndef ExN04GeneralPhysics_h
|
||||
#define ExN04GeneralPhysics_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VPhysicsConstructor.hh"
|
||||
|
||||
|
||||
#include "G4Decay.hh"
|
||||
|
||||
class ExN04GeneralPhysics : public G4VPhysicsConstructor
|
||||
{
|
||||
public:
|
||||
ExN04GeneralPhysics(const G4String& name = "general");
|
||||
virtual ~ExN04GeneralPhysics();
|
||||
|
||||
public:
|
||||
// This method will be invoked in the Construct() method.
|
||||
// each particle type will be instantiated
|
||||
virtual void ConstructParticle();
|
||||
|
||||
// This method will be invoked in the Construct() method.
|
||||
// each physics process will be instantiated and
|
||||
// registered to the process manager of each particle type
|
||||
virtual void ConstructProcess();
|
||||
|
||||
protected:
|
||||
G4Decay fDecayProcess;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,331 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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: ExN04HadronPhysics.hh,v 1.1 2002/03/05 15:22:10 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
// Class Description:
|
||||
// This class is an derived class of G4VPhysicsConstructor
|
||||
//
|
||||
// -------------------------------------------
|
||||
// History
|
||||
// first version 12 Nov. 2000 by H.Kurashige
|
||||
// ------------------------------------------------------------
|
||||
#ifndef ExN04HadronPhysics_h
|
||||
#define ExN04HadronPhysics_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "g4std/vector"
|
||||
|
||||
#include "G4VPhysicsConstructor.hh"
|
||||
|
||||
#include "G4MultipleScattering.hh"
|
||||
#include "G4hIonisation.hh"
|
||||
|
||||
#include "G4HadronElasticProcess.hh"
|
||||
#include "G4HadronFissionProcess.hh"
|
||||
#include "G4HadronCaptureProcess.hh"
|
||||
|
||||
#include "G4PionPlusInelasticProcess.hh"
|
||||
#include "G4PionMinusInelasticProcess.hh"
|
||||
#include "G4KaonPlusInelasticProcess.hh"
|
||||
#include "G4KaonZeroSInelasticProcess.hh"
|
||||
#include "G4KaonZeroLInelasticProcess.hh"
|
||||
#include "G4KaonMinusInelasticProcess.hh"
|
||||
#include "G4ProtonInelasticProcess.hh"
|
||||
#include "G4AntiProtonInelasticProcess.hh"
|
||||
#include "G4NeutronInelasticProcess.hh"
|
||||
#include "G4AntiNeutronInelasticProcess.hh"
|
||||
#include "G4LambdaInelasticProcess.hh"
|
||||
#include "G4AntiLambdaInelasticProcess.hh"
|
||||
#include "G4SigmaPlusInelasticProcess.hh"
|
||||
#include "G4SigmaMinusInelasticProcess.hh"
|
||||
#include "G4AntiSigmaPlusInelasticProcess.hh"
|
||||
#include "G4AntiSigmaMinusInelasticProcess.hh"
|
||||
#include "G4XiZeroInelasticProcess.hh"
|
||||
#include "G4XiMinusInelasticProcess.hh"
|
||||
#include "G4AntiXiZeroInelasticProcess.hh"
|
||||
#include "G4AntiXiMinusInelasticProcess.hh"
|
||||
#include "G4DeuteronInelasticProcess.hh"
|
||||
#include "G4TritonInelasticProcess.hh"
|
||||
#include "G4AlphaInelasticProcess.hh"
|
||||
#include "G4OmegaMinusInelasticProcess.hh"
|
||||
#include "G4AntiOmegaMinusInelasticProcess.hh"
|
||||
|
||||
// Low-energy Models
|
||||
#include "G4LElastic.hh"
|
||||
#include "G4LFission.hh"
|
||||
#include "G4LCapture.hh"
|
||||
|
||||
#include "G4LEPionPlusInelastic.hh"
|
||||
#include "G4LEPionMinusInelastic.hh"
|
||||
#include "G4LEKaonPlusInelastic.hh"
|
||||
#include "G4LEKaonZeroSInelastic.hh"
|
||||
#include "G4LEKaonZeroLInelastic.hh"
|
||||
#include "G4LEKaonMinusInelastic.hh"
|
||||
#include "G4LEProtonInelastic.hh"
|
||||
#include "G4LEAntiProtonInelastic.hh"
|
||||
#include "G4LENeutronInelastic.hh"
|
||||
#include "G4LEAntiNeutronInelastic.hh"
|
||||
#include "G4LELambdaInelastic.hh"
|
||||
#include "G4LEAntiLambdaInelastic.hh"
|
||||
#include "G4LESigmaPlusInelastic.hh"
|
||||
#include "G4LESigmaMinusInelastic.hh"
|
||||
#include "G4LEAntiSigmaPlusInelastic.hh"
|
||||
#include "G4LEAntiSigmaMinusInelastic.hh"
|
||||
#include "G4LEXiZeroInelastic.hh"
|
||||
#include "G4LEXiMinusInelastic.hh"
|
||||
#include "G4LEAntiXiZeroInelastic.hh"
|
||||
#include "G4LEAntiXiMinusInelastic.hh"
|
||||
#include "G4LEDeuteronInelastic.hh"
|
||||
#include "G4LETritonInelastic.hh"
|
||||
#include "G4LEAlphaInelastic.hh"
|
||||
#include "G4LEOmegaMinusInelastic.hh"
|
||||
#include "G4LEAntiOmegaMinusInelastic.hh"
|
||||
|
||||
// High-energy Models
|
||||
|
||||
#include "G4HEPionPlusInelastic.hh"
|
||||
#include "G4HEPionMinusInelastic.hh"
|
||||
#include "G4HEKaonPlusInelastic.hh"
|
||||
#include "G4HEKaonZeroInelastic.hh"
|
||||
#include "G4HEKaonZeroInelastic.hh"
|
||||
#include "G4HEKaonMinusInelastic.hh"
|
||||
#include "G4HEProtonInelastic.hh"
|
||||
#include "G4HEAntiProtonInelastic.hh"
|
||||
#include "G4HENeutronInelastic.hh"
|
||||
#include "G4HEAntiNeutronInelastic.hh"
|
||||
#include "G4HELambdaInelastic.hh"
|
||||
#include "G4HEAntiLambdaInelastic.hh"
|
||||
#include "G4HESigmaPlusInelastic.hh"
|
||||
#include "G4HESigmaMinusInelastic.hh"
|
||||
#include "G4HEAntiSigmaPlusInelastic.hh"
|
||||
#include "G4HEAntiSigmaMinusInelastic.hh"
|
||||
#include "G4HEXiZeroInelastic.hh"
|
||||
#include "G4HEXiMinusInelastic.hh"
|
||||
#include "G4HEAntiXiZeroInelastic.hh"
|
||||
#include "G4HEAntiXiMinusInelastic.hh"
|
||||
#include "G4HEOmegaMinusInelastic.hh"
|
||||
#include "G4HEAntiOmegaMinusInelastic.hh"
|
||||
|
||||
// Stopping processes
|
||||
#include "G4AntiProtonAnnihilationAtRest.hh"
|
||||
#include "G4AntiNeutronAnnihilationAtRest.hh"
|
||||
|
||||
#ifdef TRIUMF_STOP_PIMINUS
|
||||
#include "G4PionMinusAbsorptionAtRest.hh"
|
||||
#else
|
||||
#include "G4PiMinusAbsorptionAtRest.hh"
|
||||
#endif
|
||||
#ifdef TRIUMF_STOP_KMINUS
|
||||
#include "G4KaonMinusAbsorption.hh"
|
||||
#else
|
||||
#include "G4KaonMinusAbsorptionAtRest.hh"
|
||||
#endif
|
||||
|
||||
class ExN04HadronPhysics : public G4VPhysicsConstructor
|
||||
{
|
||||
public:
|
||||
ExN04HadronPhysics(const G4String& name ="hadron");
|
||||
virtual ~ExN04HadronPhysics();
|
||||
|
||||
public:
|
||||
// This method will be invoked in the Construct() method.
|
||||
// each particle type will be instantiated
|
||||
virtual void ConstructParticle();
|
||||
|
||||
// This method will be invoked in the Construct() method.
|
||||
// each physics process will be instantiated and
|
||||
// registered to the process manager of each particle type
|
||||
virtual void ConstructProcess();
|
||||
|
||||
protected:
|
||||
// Elastic Process
|
||||
G4HadronElasticProcess theElasticProcess;
|
||||
G4LElastic* theElasticModel;
|
||||
|
||||
// Pi +
|
||||
G4PionPlusInelasticProcess thePionPlusInelastic;
|
||||
G4LEPionPlusInelastic* theLEPionPlusModel;
|
||||
G4HEPionPlusInelastic* theHEPionPlusModel;
|
||||
G4MultipleScattering thePionPlusMult;
|
||||
G4hIonisation thePionPlusIonisation;
|
||||
|
||||
// Pi -
|
||||
G4PionMinusInelasticProcess thePionMinusInelastic;
|
||||
G4LEPionMinusInelastic* theLEPionMinusModel;
|
||||
G4HEPionMinusInelastic* theHEPionMinusModel;
|
||||
G4MultipleScattering thePionMinusMult;
|
||||
G4hIonisation thePionMinusIonisation;
|
||||
#ifdef TRIUMF_STOP_PIMINUS
|
||||
G4PionMinusAbsorptionAtRest thePionMinusAbsorption;
|
||||
#else
|
||||
G4PiMinusAbsorptionAtRest thePionMinusAbsorption;
|
||||
#endif
|
||||
|
||||
// K +
|
||||
G4KaonPlusInelasticProcess theKaonPlusInelastic;
|
||||
G4LEKaonPlusInelastic* theLEKaonPlusModel;
|
||||
G4HEKaonPlusInelastic* theHEKaonPlusModel;
|
||||
G4MultipleScattering theKaonPlusMult;
|
||||
G4hIonisation theKaonPlusIonisation;
|
||||
|
||||
// K -
|
||||
G4KaonMinusInelasticProcess theKaonMinusInelastic;
|
||||
G4LEKaonMinusInelastic* theLEKaonMinusModel;
|
||||
G4HEKaonMinusInelastic* theHEKaonMinusModel;
|
||||
G4MultipleScattering theKaonMinusMult;
|
||||
G4hIonisation theKaonMinusIonisation;
|
||||
#ifdef TRIUMF_STOP_KMINUS
|
||||
G4KaonMinusAbsorption theKaonMinusAbsorption;
|
||||
#else
|
||||
G4PiMinusAbsorptionAtRest theKaonMinusAbsorption;
|
||||
#endif
|
||||
|
||||
// K0L
|
||||
G4KaonZeroLInelasticProcess theKaonZeroLInelastic;
|
||||
G4LEKaonZeroLInelastic* theLEKaonZeroLModel;
|
||||
G4HEKaonZeroInelastic* theHEKaonZeroLModel;
|
||||
|
||||
// K0S
|
||||
G4KaonZeroSInelasticProcess theKaonZeroSInelastic;
|
||||
G4LEKaonZeroSInelastic* theLEKaonZeroSModel;
|
||||
G4HEKaonZeroInelastic* theHEKaonZeroSModel;
|
||||
|
||||
// Proton
|
||||
G4ProtonInelasticProcess theProtonInelastic;
|
||||
G4LEProtonInelastic* theLEProtonModel;
|
||||
G4HEProtonInelastic* theHEProtonModel;
|
||||
G4MultipleScattering theProtonMult;
|
||||
G4hIonisation theProtonIonisation;
|
||||
|
||||
// anti-proton
|
||||
G4AntiProtonInelasticProcess theAntiProtonInelastic;
|
||||
G4LEAntiProtonInelastic* theLEAntiProtonModel;
|
||||
G4HEAntiProtonInelastic* theHEAntiProtonModel;
|
||||
G4MultipleScattering theAntiProtonMult;
|
||||
G4hIonisation theAntiProtonIonisation;
|
||||
G4AntiProtonAnnihilationAtRest theAntiProtonAnnihilation;
|
||||
|
||||
// neutron
|
||||
G4NeutronInelasticProcess theNeutronInelastic;
|
||||
G4LENeutronInelastic* theLENeutronModel;
|
||||
G4HENeutronInelastic* theHENeutronModel;
|
||||
G4HadronFissionProcess theNeutronFission;
|
||||
G4LFission* theNeutronFissionModel;
|
||||
G4HadronCaptureProcess theNeutronCapture;
|
||||
G4LCapture* theNeutronCaptureModel;
|
||||
|
||||
|
||||
// anti-neutron
|
||||
G4AntiNeutronInelasticProcess theAntiNeutronInelastic;
|
||||
G4LEAntiNeutronInelastic* theLEAntiNeutronModel;
|
||||
G4HEAntiNeutronInelastic* theHEAntiNeutronModel;
|
||||
G4AntiNeutronAnnihilationAtRest theAntiNeutronAnnihilation;
|
||||
|
||||
// Lambda
|
||||
G4LambdaInelasticProcess theLambdaInelastic;
|
||||
G4LELambdaInelastic* theLELambdaModel;
|
||||
G4HELambdaInelastic* theHELambdaModel;
|
||||
|
||||
// AntiLambda
|
||||
G4AntiLambdaInelasticProcess theAntiLambdaInelastic;
|
||||
G4LEAntiLambdaInelastic* theLEAntiLambdaModel;
|
||||
G4HEAntiLambdaInelastic* theHEAntiLambdaModel;
|
||||
|
||||
// SigmaMinus
|
||||
G4SigmaMinusInelasticProcess theSigmaMinusInelastic;
|
||||
G4LESigmaMinusInelastic* theLESigmaMinusModel;
|
||||
G4HESigmaMinusInelastic* theHESigmaMinusModel;
|
||||
G4MultipleScattering theSigmaMinusMult;
|
||||
G4hIonisation theSigmaMinusIonisation;
|
||||
|
||||
// AntiSigmaMinus
|
||||
G4AntiSigmaMinusInelasticProcess theAntiSigmaMinusInelastic;
|
||||
G4LEAntiSigmaMinusInelastic* theLEAntiSigmaMinusModel;
|
||||
G4HEAntiSigmaMinusInelastic* theHEAntiSigmaMinusModel;
|
||||
G4MultipleScattering theAntiSigmaMinusMult;
|
||||
G4hIonisation theAntiSigmaMinusIonisation;
|
||||
|
||||
// SigmaPlus
|
||||
G4SigmaPlusInelasticProcess theSigmaPlusInelastic;
|
||||
G4LESigmaPlusInelastic* theLESigmaPlusModel;
|
||||
G4HESigmaPlusInelastic* theHESigmaPlusModel;
|
||||
G4MultipleScattering theSigmaPlusMult;
|
||||
G4hIonisation theSigmaPlusIonisation;
|
||||
|
||||
// AntiSigmaPlus
|
||||
G4AntiSigmaPlusInelasticProcess theAntiSigmaPlusInelastic;
|
||||
G4LEAntiSigmaPlusInelastic* theLEAntiSigmaPlusModel;
|
||||
G4HEAntiSigmaPlusInelastic* theHEAntiSigmaPlusModel;
|
||||
G4MultipleScattering theAntiSigmaPlusMult;
|
||||
G4hIonisation theAntiSigmaPlusIonisation;
|
||||
|
||||
// XiZero
|
||||
G4XiZeroInelasticProcess theXiZeroInelastic;
|
||||
G4LEXiZeroInelastic* theLEXiZeroModel;
|
||||
G4HEXiZeroInelastic* theHEXiZeroModel;
|
||||
|
||||
// AntiXiZero
|
||||
G4AntiXiZeroInelasticProcess theAntiXiZeroInelastic;
|
||||
G4LEAntiXiZeroInelastic* theLEAntiXiZeroModel;
|
||||
G4HEAntiXiZeroInelastic* theHEAntiXiZeroModel;
|
||||
|
||||
// XiMinus
|
||||
G4XiMinusInelasticProcess theXiMinusInelastic;
|
||||
G4LEXiMinusInelastic* theLEXiMinusModel;
|
||||
G4HEXiMinusInelastic* theHEXiMinusModel;
|
||||
G4MultipleScattering theXiMinusMult;
|
||||
G4hIonisation theXiMinusIonisation;
|
||||
|
||||
// AntiXiMinus
|
||||
G4AntiXiMinusInelasticProcess theAntiXiMinusInelastic;
|
||||
G4LEAntiXiMinusInelastic* theLEAntiXiMinusModel;
|
||||
G4HEAntiXiMinusInelastic* theHEAntiXiMinusModel;
|
||||
G4MultipleScattering theAntiXiMinusMult;
|
||||
G4hIonisation theAntiXiMinusIonisation;
|
||||
|
||||
// OmegaMinus
|
||||
G4OmegaMinusInelasticProcess theOmegaMinusInelastic;
|
||||
G4LEOmegaMinusInelastic* theLEOmegaMinusModel;
|
||||
G4HEOmegaMinusInelastic* theHEOmegaMinusModel;
|
||||
G4MultipleScattering theOmegaMinusMult;
|
||||
G4hIonisation theOmegaMinusIonisation;
|
||||
|
||||
// AntiOmegaMinus
|
||||
G4AntiOmegaMinusInelasticProcess theAntiOmegaMinusInelastic;
|
||||
G4LEAntiOmegaMinusInelastic* theLEAntiOmegaMinusModel;
|
||||
G4HEAntiOmegaMinusInelastic* theHEAntiOmegaMinusModel;
|
||||
G4MultipleScattering theAntiOmegaMinusMult;
|
||||
G4hIonisation theAntiOmegaMinusIonisation;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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: ExN04IonPhysics.hh,v 1.1 2002/03/05 15:22:11 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
// Class Description:
|
||||
// This class is an derived class of G4VPhysicsConstructor
|
||||
//
|
||||
// -------------------------------------------
|
||||
// History
|
||||
// first version 12 Nov. 2000 by H.Kurashige
|
||||
// ------------------------------------------------------------
|
||||
#ifndef ExN04IonPhysics_h
|
||||
#define ExN04IonPhysics_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VPhysicsConstructor.hh"
|
||||
|
||||
#include "G4HadronElasticProcess.hh"
|
||||
#include "G4LElastic.hh"
|
||||
|
||||
#include "G4DeuteronInelasticProcess.hh"
|
||||
#include "G4LEDeuteronInelastic.hh"
|
||||
|
||||
#include "G4TritonInelasticProcess.hh"
|
||||
#include "G4LETritonInelastic.hh"
|
||||
|
||||
#include "G4AlphaInelasticProcess.hh"
|
||||
#include "G4LEAlphaInelastic.hh"
|
||||
|
||||
#include "G4hIonisation.hh"
|
||||
#include "G4MultipleScattering.hh"
|
||||
|
||||
class ExN04IonPhysics : public G4VPhysicsConstructor
|
||||
{
|
||||
public:
|
||||
ExN04IonPhysics(const G4String& name="ion");
|
||||
virtual ~ExN04IonPhysics();
|
||||
|
||||
public:
|
||||
// This method will be invoked in the Construct() method.
|
||||
// each particle type will be instantiated
|
||||
virtual void ConstructParticle();
|
||||
|
||||
// This method will be invoked in the Construct() method.
|
||||
// each physics process will be instantiated and
|
||||
// registered to the process manager of each particle type
|
||||
virtual void ConstructProcess();
|
||||
|
||||
protected:
|
||||
// Elastic Process
|
||||
G4HadronElasticProcess theElasticProcess;
|
||||
G4LElastic* theElasticModel;
|
||||
|
||||
// Generic Ion physics
|
||||
G4MultipleScattering fIonMultipleScattering;
|
||||
G4hIonisation fIonIonisation;
|
||||
|
||||
// Deuteron physics
|
||||
G4MultipleScattering fDeuteronMultipleScattering;
|
||||
G4hIonisation fDeuteronIonisation;
|
||||
G4DeuteronInelasticProcess fDeuteronProcess;
|
||||
G4LEDeuteronInelastic* fDeuteronModel;
|
||||
|
||||
// Triton physics
|
||||
G4MultipleScattering fTritonMultipleScattering;
|
||||
G4hIonisation fTritonIonisation;
|
||||
G4TritonInelasticProcess fTritonProcess;
|
||||
G4LETritonInelastic* fTritonModel;
|
||||
|
||||
// Alpha physics
|
||||
G4MultipleScattering fAlphaMultipleScattering;
|
||||
G4hIonisation fAlphaIonisation;
|
||||
G4AlphaInelasticProcess fAlphaProcess;
|
||||
G4LEAlphaInelastic* fAlphaModel;
|
||||
|
||||
// He3 physics
|
||||
G4MultipleScattering fHe3MultipleScattering;
|
||||
G4hIonisation fHe3Ionisation;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef ExN04MuonHit_h
|
||||
#define ExN04MuonHit_h 1
|
||||
|
||||
#include "G4VHit.hh"
|
||||
#include "G4THitsCollection.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
class ExN04MuonHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
|
||||
ExN04MuonHit();
|
||||
~ExN04MuonHit();
|
||||
ExN04MuonHit(const ExN04MuonHit &right);
|
||||
const ExN04MuonHit& operator=(const ExN04MuonHit &right);
|
||||
int operator==(const ExN04MuonHit &right) const;
|
||||
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void *aHit);
|
||||
|
||||
void Draw();
|
||||
void Print();
|
||||
|
||||
private:
|
||||
G4double edep;
|
||||
G4ThreeVector pos;
|
||||
|
||||
public:
|
||||
inline void SetEdep(G4double de)
|
||||
{ edep = de; }
|
||||
inline void AddEdep(G4double de)
|
||||
{ edep += de; }
|
||||
inline G4double GetEdep()
|
||||
{ return edep; }
|
||||
inline void SetPos(G4ThreeVector xyz)
|
||||
{ pos = xyz; }
|
||||
inline G4ThreeVector GetPos()
|
||||
{ return pos; }
|
||||
|
||||
};
|
||||
|
||||
typedef G4THitsCollection<ExN04MuonHit> ExN04MuonHitsCollection;
|
||||
|
||||
extern G4Allocator<ExN04MuonHit> ExN04MuonHitAllocator;
|
||||
|
||||
inline void* ExN04MuonHit::operator new(size_t)
|
||||
{
|
||||
void *aHit;
|
||||
aHit = (void *) ExN04MuonHitAllocator.MallocSingle();
|
||||
return aHit;
|
||||
}
|
||||
|
||||
inline void ExN04MuonHit::operator delete(void *aHit)
|
||||
{
|
||||
ExN04MuonHitAllocator.FreeSingle((ExN04MuonHit*) aHit);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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: ExN04MuonPhysics.hh,v 1.1 2002/03/05 15:22:11 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
// Class Description:
|
||||
// This class is an derived class of G4VPhysicsConstructor
|
||||
//
|
||||
// -------------------------------------------
|
||||
// History
|
||||
// first version 12 Nov. 2000 by H.Kurashige
|
||||
// ------------------------------------------------------------
|
||||
#ifndef ExN04MuonPhysics_h
|
||||
#define ExN04MuonPhysics_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VPhysicsConstructor.hh"
|
||||
#include "G4MultipleScattering.hh"
|
||||
#include "G4MuBremsstrahlung.hh"
|
||||
#include "G4MuPairProduction.hh"
|
||||
#include "G4MuIonisation.hh"
|
||||
#include "G4hIonisation.hh"
|
||||
|
||||
#include "G4MuonMinusCaptureAtRest.hh"
|
||||
|
||||
class ExN04MuonPhysics : public G4VPhysicsConstructor
|
||||
{
|
||||
public:
|
||||
ExN04MuonPhysics(const G4String& name="muon");
|
||||
virtual ~ExN04MuonPhysics();
|
||||
|
||||
public:
|
||||
// This method will be invoked in the Construct() method.
|
||||
// each particle type will be instantiated
|
||||
virtual void ConstructParticle();
|
||||
|
||||
// This method will be invoked in the Construct() method.
|
||||
// each physics process will be instantiated and
|
||||
// registered to the process manager of each particle type
|
||||
virtual void ConstructProcess();
|
||||
|
||||
protected:
|
||||
// Muon physics
|
||||
G4MultipleScattering fMuPlusMultipleScattering;
|
||||
G4MuBremsstrahlung fMuPlusBremsstrahlung ;
|
||||
G4MuPairProduction fMuPlusPairProduction;
|
||||
G4MuIonisation fMuPlusIonisation;
|
||||
|
||||
G4MultipleScattering fMuMinusMultipleScattering;
|
||||
G4MuBremsstrahlung fMuMinusBremsstrahlung ;
|
||||
G4MuPairProduction fMuMinusPairProduction;
|
||||
G4MuIonisation fMuMinusIonisation;
|
||||
|
||||
G4MuonMinusCaptureAtRest fMuMinusCaptureAtRest;
|
||||
|
||||
// Tau physics
|
||||
G4MultipleScattering fTauPlusMultipleScattering;
|
||||
G4hIonisation fTauPlusIonisation;
|
||||
|
||||
G4MultipleScattering fTauMinusMultipleScattering;
|
||||
G4hIonisation fTauMinusIonisation;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef ExN04MuonSD_h
|
||||
#define ExN04MuonSD_h 1
|
||||
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "ExN04MuonHit.hh"
|
||||
class G4Step;
|
||||
class G4HCofThisEvent;
|
||||
class G4TouchableHistory;
|
||||
|
||||
class ExN04MuonSD : public G4VSensitiveDetector
|
||||
{
|
||||
|
||||
public:
|
||||
ExN04MuonSD(G4String name);
|
||||
~ExN04MuonSD();
|
||||
|
||||
void Initialize(G4HCofThisEvent*HCE);
|
||||
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist);
|
||||
void EndOfEvent(G4HCofThisEvent*HCE);
|
||||
void clear();
|
||||
void DrawAll();
|
||||
void PrintAll();
|
||||
|
||||
private:
|
||||
ExN04MuonHitsCollection * muonCollection;
|
||||
G4double positionResolution;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef ExN04PhysicsList_h
|
||||
#define ExN04PhysicsList_h 1
|
||||
|
||||
#include "G4VModularPhysicsList.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class ExN04PhysicsList: public G4VModularPhysicsList
|
||||
{
|
||||
public:
|
||||
ExN04PhysicsList();
|
||||
virtual ~ExN04PhysicsList();
|
||||
|
||||
public:
|
||||
// SetCuts()
|
||||
virtual void SetCuts();
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef ExN04PrimaryGeneratorAction_h
|
||||
#define ExN04PrimaryGeneratorAction_h 1
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4VPrimaryGenerator;
|
||||
class G4Event;
|
||||
class ExN04PrimaryGeneratorMessenger;
|
||||
|
||||
class ExN04PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
ExN04PrimaryGeneratorAction();
|
||||
~ExN04PrimaryGeneratorAction();
|
||||
|
||||
public:
|
||||
void GeneratePrimaries(G4Event* anEvent);
|
||||
|
||||
private:
|
||||
G4VPrimaryGenerator* HEPEvt;
|
||||
G4VPrimaryGenerator* particleGun;
|
||||
ExN04PrimaryGeneratorMessenger* messenger;
|
||||
G4bool useHEPEvt;
|
||||
|
||||
public:
|
||||
inline void SetHEPEvtGenerator(G4bool f)
|
||||
{ useHEPEvt = f; }
|
||||
inline G4bool GetHEPEvtGenerator()
|
||||
{ return useHEPEvt; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef ExN04PrimaryGeneratorMessenger_h
|
||||
#define ExN04PrimaryGeneratorMessenger_h 1
|
||||
|
||||
class ExN04PrimaryGeneratorAction;
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithAString;
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class ExN04PrimaryGeneratorMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
ExN04PrimaryGeneratorMessenger(ExN04PrimaryGeneratorAction* mpga);
|
||||
~ExN04PrimaryGeneratorMessenger();
|
||||
|
||||
public:
|
||||
void SetNewValue(G4UIcommand * command,G4String newValues);
|
||||
G4String GetCurrentValue(G4UIcommand * command);
|
||||
|
||||
private:
|
||||
ExN04PrimaryGeneratorAction * myAction;
|
||||
|
||||
private: //commands
|
||||
G4UIdirectory * mydetDirectory;
|
||||
G4UIcmdWithAString * genCmd;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef ExN04StackingAction_H
|
||||
#define ExN04StackingAction_H 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UserStackingAction.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
class G4Track;
|
||||
|
||||
#include "ExN04TrackerHit.hh"
|
||||
#include "ExN04MuonHit.hh"
|
||||
class ExN04StackingActionMessenger;
|
||||
|
||||
class ExN04StackingAction : public G4UserStackingAction
|
||||
{
|
||||
public:
|
||||
ExN04StackingAction();
|
||||
virtual ~ExN04StackingAction();
|
||||
|
||||
public:
|
||||
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track* aTrack);
|
||||
virtual void NewStage();
|
||||
virtual void PrepareNewEvent();
|
||||
|
||||
private:
|
||||
G4bool InsideRoI(const G4Track * aTrack,G4double ang);
|
||||
G4VHitsCollection* GetCollection(G4String colName);
|
||||
|
||||
ExN04TrackerHitsCollection* trkHits;
|
||||
ExN04MuonHitsCollection* muonHits;
|
||||
ExN04StackingActionMessenger* theMessenger;
|
||||
|
||||
G4int stage;
|
||||
G4int reqMuon;
|
||||
G4int reqIsoMuon;
|
||||
G4int reqIso;
|
||||
G4double angRoI;
|
||||
|
||||
public:
|
||||
inline void SetNRequestMuon(G4int val) { reqMuon = val; }
|
||||
inline G4int GetNRequestMuon() const { return reqMuon; }
|
||||
inline void SetNRequestIsoMuon(G4int val) { reqIsoMuon = val; }
|
||||
inline G4int GetNRequestIsoMuon() const { return reqIsoMuon; }
|
||||
inline void SetNIsolation(G4int val) { reqIso = val; }
|
||||
inline G4int GetNIsolation() const { return reqIso; }
|
||||
inline void SetRoIAngle(G4double val) { angRoI = val; }
|
||||
inline G4double GetRoIAngle() const { return angRoI; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef ExN04StackingActionMessenger_h
|
||||
#define ExN04StackingActionMessenger_h 1
|
||||
|
||||
class ExN04StackingAction;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class ExN04StackingActionMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
ExN04StackingActionMessenger(ExN04StackingAction* msa);
|
||||
~ExN04StackingActionMessenger();
|
||||
|
||||
public:
|
||||
void SetNewValue(G4UIcommand * command,G4String newValues);
|
||||
G4String GetCurrentValue(G4UIcommand * command);
|
||||
|
||||
private:
|
||||
ExN04StackingAction * myAction;
|
||||
|
||||
private: //commands
|
||||
G4UIcmdWithAnInteger * muonCmd;
|
||||
G4UIcmdWithAnInteger * isomuonCmd;
|
||||
G4UIcmdWithAnInteger * isoCmd;
|
||||
G4UIcmdWithADoubleAndUnit * roiCmd;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef ExN04SteppingAction_H
|
||||
#define ExN04SteppingAction_H 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UserSteppingAction.hh"
|
||||
|
||||
class ExN04SteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
ExN04SteppingAction();
|
||||
virtual ~ExN04SteppingAction();
|
||||
|
||||
virtual void UserSteppingAction(const G4Step*);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef ExN04TrackerHit_h
|
||||
#define ExN04TrackerHit_h 1
|
||||
|
||||
#include "G4VHit.hh"
|
||||
#include "G4THitsCollection.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
class ExN04TrackerHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
|
||||
ExN04TrackerHit();
|
||||
~ExN04TrackerHit();
|
||||
ExN04TrackerHit(const ExN04TrackerHit &right);
|
||||
const ExN04TrackerHit& operator=(const ExN04TrackerHit &right);
|
||||
int operator==(const ExN04TrackerHit &right) const;
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void *aHit);
|
||||
|
||||
void Draw();
|
||||
void Print();
|
||||
|
||||
private:
|
||||
G4double edep;
|
||||
G4ThreeVector pos;
|
||||
|
||||
public:
|
||||
inline void SetEdep(G4double de)
|
||||
{ edep = de; }
|
||||
inline G4double GetEdep()
|
||||
{ return edep; }
|
||||
inline void SetPos(G4ThreeVector xyz)
|
||||
{ pos = xyz; }
|
||||
inline G4ThreeVector GetPos()
|
||||
{ return pos; }
|
||||
|
||||
};
|
||||
|
||||
typedef G4THitsCollection<ExN04TrackerHit> ExN04TrackerHitsCollection;
|
||||
|
||||
extern G4Allocator<ExN04TrackerHit> ExN04TrackerHitAllocator;
|
||||
|
||||
inline void* ExN04TrackerHit::operator new(size_t)
|
||||
{
|
||||
void *aHit;
|
||||
aHit = (void *) ExN04TrackerHitAllocator.MallocSingle();
|
||||
return aHit;
|
||||
}
|
||||
|
||||
inline void ExN04TrackerHit::operator delete(void *aHit)
|
||||
{
|
||||
ExN04TrackerHitAllocator.FreeSingle((ExN04TrackerHit*) aHit);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef ExN04TrackerParametrisation_H
|
||||
#define ExN04TrackerParametrisation_H 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VPVParameterisation.hh"
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
class G4Tubs;
|
||||
|
||||
class ExN04TrackerParametrisation : public G4VPVParameterisation
|
||||
{
|
||||
public:
|
||||
|
||||
ExN04TrackerParametrisation();
|
||||
virtual ~ExN04TrackerParametrisation();
|
||||
void ComputeTransformation(const G4int copyNo,
|
||||
G4VPhysicalVolume *physVol) const;
|
||||
void ComputeDimensions( G4Tubs & trackerLayer,
|
||||
const G4int copyNo,
|
||||
const G4VPhysicalVolume * physVol) const;
|
||||
|
||||
private:
|
||||
|
||||
#include "ExN04DetectorParameterDef.hh"
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef ExN04TrackerSD_h
|
||||
#define ExN04TrackerSD_h 1
|
||||
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "ExN04TrackerHit.hh"
|
||||
class G4Step;
|
||||
class G4HCofThisEvent;
|
||||
class G4TouchableHistory;
|
||||
|
||||
class ExN04TrackerSD : public G4VSensitiveDetector
|
||||
{
|
||||
|
||||
public:
|
||||
ExN04TrackerSD(G4String name);
|
||||
~ExN04TrackerSD();
|
||||
|
||||
void Initialize(G4HCofThisEvent*HCE);
|
||||
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist);
|
||||
void EndOfEvent(G4HCofThisEvent*HCE);
|
||||
void clear();
|
||||
void DrawAll();
|
||||
void PrintAll();
|
||||
|
||||
private:
|
||||
ExN04TrackerHitsCollection *trackerCollection;
|
||||
|
||||
public:
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef ExN04TrackingAction_h
|
||||
#define ExN04TrackingAction_h 1
|
||||
|
||||
#include "G4UserTrackingAction.hh"
|
||||
|
||||
|
||||
class ExN04TrackingAction : public G4UserTrackingAction {
|
||||
|
||||
public:
|
||||
ExN04TrackingAction(){};
|
||||
virtual ~ExN04TrackingAction(){};
|
||||
|
||||
virtual void PreUserTrackingAction(const G4Track*);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,148 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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: ParExMarshaledHits.hh,v 1.1 2002/03/05 15:22:13 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// Parallel Library for Geant4
|
||||
//
|
||||
// Gene Cooperman <gene@ccs.neu.edu>, 2001
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#ifndef ParExMarshaledHits_h
|
||||
#define ParExMarshaledHits_h 1
|
||||
|
||||
#include "G4THitsCollection.hh"
|
||||
#include "ParMarshaledObj.hh"
|
||||
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4RunManager.hh"
|
||||
|
||||
// Calling sequence:
|
||||
// MarshaledHCofThisEvent::MarshaledHCofThisEvent()
|
||||
// -> MarshaledHCofThisEvent::MarshalHitsCollection
|
||||
// (G4VHitsCollection * aBaseHC, G4String HCname)
|
||||
// -> TMarshaledHitsCollection<T>::Marshal(G4VHitsCollection * aBaseHC)
|
||||
// -> TMarshaledHitsCollection<T>::MarshalHit(T *aHit)
|
||||
// MarshaledHCofThisEvent::UnmarshalSlaveHCofThisEvent()
|
||||
// -> TMarshaledHitsCollection<T>::UnmarshalSlaveHitsCollection
|
||||
// (G4String HCname, G4String SDname)
|
||||
// -> TMarshaledHitsCollection<T>::Unmarshal(G4THitsCollection<T> * aHC)
|
||||
// -> TMarshaledHitsCollection<T>::UnmarshalHit(T * aHit)
|
||||
|
||||
// class T derived from G4VHit
|
||||
template <class T> class TMarshaledHitsCollection
|
||||
: public MarshaledObj
|
||||
{
|
||||
public:
|
||||
inline void Marshal(G4VHitsCollection * aBaseHC); // Marshal hits of aBaseHC
|
||||
|
||||
inline void UnmarshalSlaveHitsCollection(G4String & HCname, G4String & SDname);
|
||||
inline void Unmarshal(G4THitsCollection<T> * aHC);
|
||||
|
||||
// By default, we a hit of type T as a void pointer
|
||||
inline void MarshalHit( T *aHit )
|
||||
{ MarshaledObj::Marshal((void *)aHit, sizeof(*aHit)); }
|
||||
|
||||
// Unmarshal hits into HC for T. By default assume it was marshaled
|
||||
// as a void pointer (ObjPtr)
|
||||
inline void UnmarshalHit(T * aHit)
|
||||
{
|
||||
if (isNewHitsCollection)
|
||||
*aHit = *(T *)MarshaledObj::UnmarshalAsSharedObjPtr();
|
||||
else
|
||||
G4Exception(
|
||||
"Event Level Parallelism: Every hit collection sent to master"
|
||||
" should be new.\n Current hit collection, "
|
||||
+ collectionName + ", is not new.\n"
|
||||
);
|
||||
}
|
||||
|
||||
protected:
|
||||
static G4bool isNewHitsCollection;
|
||||
static G4String collectionName;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
G4bool TMarshaledHitsCollection<T>::isNewHitsCollection = true;
|
||||
|
||||
template <class T>
|
||||
G4String TMarshaledHitsCollection<T>::collectionName = "<not initialized>";
|
||||
|
||||
template <class T>
|
||||
inline void TMarshaledHitsCollection<T>::Marshal(G4VHitsCollection * aBaseHC)
|
||||
{ G4THitsCollection<T> *aHC = (G4THitsCollection<T> *)aBaseHC;
|
||||
G4int numHits = aHC->entries();
|
||||
MarshaledObj::Marshal( numHits );
|
||||
#ifdef TOPC_DEBUG
|
||||
G4cout << "Marshaled numHits: " << numHits << G4endl;
|
||||
#endif
|
||||
for (int j = 0; j < numHits; j++) {
|
||||
T *aHit = (*aHC)[j];
|
||||
MarshalHit( aHit );
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline void TMarshaledHitsCollection<T>::Unmarshal
|
||||
(G4THitsCollection<T> * aHC)
|
||||
{
|
||||
G4int numHits;
|
||||
MarshaledObj::Unmarshal( numHits );
|
||||
#ifdef TOPC_DEBUG
|
||||
G4cout << "numHits: " << numHits << G4endl;
|
||||
#endif
|
||||
for (int j = 0; j < numHits; j++) {
|
||||
T *aHit = new T;
|
||||
UnmarshalHit( aHit );
|
||||
aHC->insert( aHit );
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline void TMarshaledHitsCollection<T>::UnmarshalSlaveHitsCollection
|
||||
(G4String & HCname, G4String & SDname)
|
||||
{
|
||||
G4HCofThisEvent *HCE = G4RunManager::GetRunManager()->
|
||||
GetCurrentEvent()->
|
||||
GetHCofThisEvent();
|
||||
// Find or create HitsCollection, aHC, with name HCname
|
||||
G4THitsCollection<T> *aHC;
|
||||
// HCname is unique.
|
||||
collectionName = HCname;
|
||||
G4int HCID = G4SDManager::GetSDMpointer()->GetCollectionID(HCname);
|
||||
if (HCID < 0)
|
||||
{ aHC = new G4THitsCollection<T>(SDname, HCname);
|
||||
HCID = G4SDManager::GetSDMpointer()->GetCollectionID(HCname);
|
||||
HCE->AddHitsCollection( HCID, aHC );
|
||||
isNewHitsCollection = true;
|
||||
}
|
||||
else {
|
||||
aHC = (G4THitsCollection<T> *)HCE->GetHC(HCID);
|
||||
isNewHitsCollection = ( aHC->entries() == 0 ? true : false );
|
||||
}
|
||||
|
||||
Unmarshal(aHC);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,275 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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: ParMarshaledObj.hh,v 1.1 2002/03/05 15:22:13 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// Parallel Library for Geant4
|
||||
//
|
||||
// Gene Cooperman <gene@ccs.neu.edu>, 2001
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#ifndef ParMarshaledObj_h
|
||||
#define ParMarshaledObj_h
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "g4std/iostream"
|
||||
|
||||
// Geant4 types
|
||||
#include "globals.hh"
|
||||
#include "G4Event.hh"
|
||||
|
||||
// A MarshaledObj is conceptually a
|
||||
// dynamically resizable buffer, size, and cursor.
|
||||
// Data structure of buffer: <field1, field2, ...>
|
||||
// Note that buffer has no internal construct to determine size of buffer
|
||||
// It is the responsibility of the user to know types of field1, ...
|
||||
// There are two types of MarshaledObj, depending on whether
|
||||
// IsUnmarshaling() is true or false.
|
||||
// I use malloc/free because I can also use realloc to extend the buffer.
|
||||
|
||||
class MarshaledObj {
|
||||
private:
|
||||
// Make sure all marshaled objects are word aligned.
|
||||
static const int WORD_SIZE = sizeof(long);
|
||||
static inline int ROUND_UP( int x )
|
||||
{ return (((x)+(WORD_SIZE-1)) / WORD_SIZE) * WORD_SIZE; }
|
||||
|
||||
public:
|
||||
inline MarshaledObj(int total_size)
|
||||
:extent(ROUND_UP(total_size)),size(0)
|
||||
{ if (extent > 0)
|
||||
buffer = (char *)malloc(extent);
|
||||
else
|
||||
buffer = NULL;
|
||||
cursor = buffer + size;
|
||||
}
|
||||
inline MarshaledObj()
|
||||
:extent(128),size(0)
|
||||
{ buffer = (char *)malloc(extent);
|
||||
cursor = buffer + size;
|
||||
}
|
||||
// this is for an arbitrary buffer; we specify the size explicitly
|
||||
// if buf_len == 0, then we'll be unmarshaling
|
||||
inline MarshaledObj(void *buf, int buf_len = 0)
|
||||
:extent(ROUND_UP(buf_len+sizeof(int))),
|
||||
size(ROUND_UP(buf_len+sizeof(buf_len)))
|
||||
{ if ( buf_len <= 0 ) {
|
||||
extent = size = 0; // IMPLIES: IsUnmarshaling() => true
|
||||
buffer = (char *)buf;
|
||||
cursor = buffer;
|
||||
} else {
|
||||
buffer = (char *)malloc(extent);
|
||||
*(int *)buffer = buf_len;
|
||||
memcpy( buffer+sizeof(int), (char *)buf, extent );
|
||||
cursor = buffer + size;
|
||||
}
|
||||
}
|
||||
inline ~MarshaledObj()
|
||||
{ if ( ! IsUnmarshaling() )
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
inline bool IsUnmarshaling() { return (extent <= 0); }
|
||||
|
||||
private:
|
||||
// Don't use copy constructor
|
||||
const MarshaledObj& operator=(const MarshaledObj& right);
|
||||
|
||||
protected:
|
||||
char *buffer; /* First entry is size of buffer */
|
||||
private:
|
||||
int extent; /* extent is number of bytes allocated, extent >= size */
|
||||
int size; /* Initially, buffer has entry for size */
|
||||
char *cursor;
|
||||
|
||||
inline void ResizeBuffer( size_t new_size )
|
||||
{ int displacement = cursor - buffer;
|
||||
extent = new_size;
|
||||
buffer = (char *)realloc( buffer, extent );
|
||||
cursor = buffer + displacement;
|
||||
}
|
||||
|
||||
public:
|
||||
inline int BufferSize()
|
||||
{ return cursor - buffer; }
|
||||
inline void *GetBuffer() {
|
||||
return buffer;
|
||||
}
|
||||
// inline void SetNewBuffer(void *buf) {
|
||||
// free(buffer);
|
||||
// buffer = (char *)buf;
|
||||
// size = 0; /* unknown size */
|
||||
// cursor = buffer;
|
||||
// }
|
||||
|
||||
#define MarshalDefinition(TYPE) \
|
||||
inline void Marshal(TYPE a##TYPE) { \
|
||||
if (IsUnmarshaling()) \
|
||||
throw "Tried to marshal in object marked isUnmarshaling = true"; \
|
||||
size += ROUND_UP(sizeof(a##TYPE)); \
|
||||
while ( size > extent ) \
|
||||
ResizeBuffer( 2 * extent ); \
|
||||
*(TYPE *)cursor = a##TYPE; \
|
||||
cursor = buffer + size; \
|
||||
} \
|
||||
inline void Unmarshal(TYPE & a##TYPE) { \
|
||||
a##TYPE = *(TYPE *)cursor; \
|
||||
cursor += ROUND_UP(sizeof(a##TYPE)); \
|
||||
} \
|
||||
inline TYPE UnmarshalAs##TYPE() { \
|
||||
TYPE a##TYPE = *(TYPE *)cursor; \
|
||||
cursor += ROUND_UP(sizeof(a##TYPE)); \
|
||||
return a##TYPE; \
|
||||
}
|
||||
|
||||
// This works for any inline objects (no embedded pointers)
|
||||
MarshalDefinition(G4int)
|
||||
MarshalDefinition(G4double)
|
||||
MarshalDefinition(G4ThreeVector)
|
||||
// MarshalDefinition(int)
|
||||
// MarshalDefinition(double)
|
||||
|
||||
|
||||
// These cannot follow the pattern, since the data is not inline.
|
||||
inline void MarshalG4String(G4String& aG4String) {
|
||||
if (IsUnmarshaling())
|
||||
throw "Tried to marshal in object marked isUnmarshaling = true";
|
||||
size += ROUND_UP( aG4String.length() + 1 ); // 1 for final NULL char
|
||||
while ( size > extent )
|
||||
ResizeBuffer( 2 * extent );
|
||||
strcpy( (char *)cursor, aG4String );
|
||||
cursor = buffer + size;
|
||||
}
|
||||
inline void Marshal(G4String& aG4String)
|
||||
{ MarshalG4String( aG4String ); }
|
||||
inline void Unmarshal(G4String& aG4String) {
|
||||
aG4String = (char *)cursor;
|
||||
cursor += ROUND_UP( aG4String.length() + 1 ); // 1 for final NULL char
|
||||
}
|
||||
// INEFFICIENT? (copies return value)
|
||||
inline G4String UnmarshalAsG4String() {
|
||||
G4String aG4String = (char *)cursor;
|
||||
cursor += ROUND_UP( aG4String.length() + 1 ); // 1 for final NULL char
|
||||
return aG4String;
|
||||
}
|
||||
|
||||
// USAGE: MarshalObjPtr( &aG4obj, sizeof(aG4obj) );
|
||||
// USAGE: MarshaledObj tmp;
|
||||
// G4Obj *aObjPtr = tmp.UnmarshalObjPtr();
|
||||
// ...
|
||||
// delete aObjPtr;
|
||||
inline void MarshalObjPtr(const void * aObjPtr, int obj_size)
|
||||
{
|
||||
if (IsUnmarshaling())
|
||||
throw "Tried to marshal in object marked isUnmarshaling = true";
|
||||
size += ROUND_UP( obj_size + sizeof(int) );
|
||||
while ( size > extent )
|
||||
ResizeBuffer( 2 * extent );
|
||||
*(int *)cursor = obj_size;
|
||||
memcpy( cursor+sizeof(int), aObjPtr, obj_size );
|
||||
cursor = buffer + size;
|
||||
}
|
||||
inline void Marshal(const void * aObjPtr, int obj_size)
|
||||
{ MarshalObjPtr(aObjPtr,obj_size); }
|
||||
inline void Unmarshal(void * & aObjPtr)
|
||||
{
|
||||
int obj_size = *(int *)cursor;
|
||||
aObjPtr = malloc( obj_size );
|
||||
memcpy( aObjPtr, cursor+sizeof(int), obj_size );
|
||||
cursor += ROUND_UP( obj_size + sizeof(int) );
|
||||
}
|
||||
inline void * UnmarshalAsObjPtr()
|
||||
{
|
||||
void *aObjPtr;
|
||||
Unmarshal(aObjPtr);
|
||||
return aObjPtr;
|
||||
}
|
||||
inline void * UnmarshalAsSharedObjPtr()
|
||||
{
|
||||
int obj_size = *(int *)cursor;
|
||||
void *aObjPtr;
|
||||
aObjPtr = cursor+sizeof(int);
|
||||
cursor += ROUND_UP( obj_size + sizeof(int) );
|
||||
return aObjPtr;
|
||||
}
|
||||
// UnmarshalAsSharedObjPtr: return value points into buffer of curr. obj.
|
||||
|
||||
inline void MarshalMarshaledObj(MarshaledObj& aMarshaledObj) {
|
||||
if (IsUnmarshaling())
|
||||
throw "Tried to marshal in object marked isUnmarshaling = true";
|
||||
MarshalObjPtr( aMarshaledObj.GetBuffer(), aMarshaledObj.BufferSize() );
|
||||
}
|
||||
// INEFFICIENT? (copies return value)
|
||||
inline MarshaledObj UnmarshalAsMarshaledObj() {
|
||||
MarshaledObj aMarshaledObj( ((char *)cursor)+sizeof(int), *(int *)cursor );
|
||||
cursor += ROUND_UP( aMarshaledObj.BufferSize()+sizeof(int) );
|
||||
return aMarshaledObj;
|
||||
}
|
||||
};
|
||||
|
||||
class MarshaledHCofThisEvent : public MarshaledObj
|
||||
{
|
||||
public:
|
||||
inline MarshaledHCofThisEvent(int size) : MarshaledObj(size) { }
|
||||
// Trivial constructor. MarshaledHCofThisEvent(0) creates nothing.
|
||||
MarshaledHCofThisEvent();
|
||||
// Constructor copies hits from HCE of master in this marshaled object
|
||||
MarshaledHCofThisEvent(G4Event *anEvent);
|
||||
// Constructor copies hits from HCE of anEvent in this marshaled object
|
||||
inline MarshaledHCofThisEvent(void *buf)
|
||||
: MarshaledObj(buf) // Object will be set for IsUnmarshaling
|
||||
{ }
|
||||
|
||||
void UnmarshalSlaveHCofThisEvent();
|
||||
// Unmarshal copies hits from slave in HCE of master
|
||||
// We inherit destructor of ParMarshaledObj
|
||||
// It does so by calling UnmarshalSlaveHitsCollection for dispatching
|
||||
void UnmarshalSlaveHitsCollection(G4String & HCname, G4String & SDname);
|
||||
|
||||
void MarshalHitsCollection(G4VHitsCollection * aBaseHC, G4String HCname);
|
||||
// To be defined in ParExN02MarshaledHits.cc or other
|
||||
// application-specific file.
|
||||
|
||||
private:
|
||||
// Don't use copy constructor
|
||||
const MarshaledHCofThisEvent& operator=(const MarshaledHCofThisEvent& right);
|
||||
void MarshalHitsCollection(const G4Event *anEvent);
|
||||
};
|
||||
|
||||
/*
|
||||
main() {
|
||||
MarshaledObj tmp = MarshaledObj();
|
||||
tmp.Marshal(5);
|
||||
tmp.Marshal(5.3);
|
||||
tmp.Marshal(7);
|
||||
|
||||
MarshaledObj tmp2;
|
||||
tmp2.MarshalMarshaledObj(tmp);
|
||||
cout << tmp2.UnmarshalAsG4int() << "\n";
|
||||
cout << tmp2.UnmarshalAsG4double() << "\n";
|
||||
cout << tmp2.UnmarshalAsG4int() << "\n";
|
||||
}
|
||||
*/
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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: ParRandomState.hh,v 1.1 2002/03/05 15:22:13 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// Parallel Library for Geant4
|
||||
//
|
||||
// Gene Cooperman <gene@ccs.neu.edu>, 2001
|
||||
// --------------------------------------------------------------------
|
||||
// Each of the three members below must be modified for the application.
|
||||
// This default version simply sets the random seed on the slave using
|
||||
// the eventID.
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#ifndef ParRandomState_h
|
||||
#define ParRandomState_h 1
|
||||
|
||||
#include "ParMarshaledObj.hh"
|
||||
|
||||
class ParMarshaledRandomState : public MarshaledObj
|
||||
{
|
||||
public:
|
||||
// If 0, GetNextRandomStateForSlave not called.
|
||||
static const int RANDOM_STATE_SIZE = sizeof(long);
|
||||
|
||||
// Called on master
|
||||
inline void *GetNextRandomStateForSlave()
|
||||
{ static long * nextSeed = new long;
|
||||
*nextSeed = (long) (100000000L * HepRandom::getTheGenerator()->flat());
|
||||
#ifdef TOPC_DEBUG
|
||||
G4cout << "GET SEED: " << *nextSeed << G4endl;
|
||||
#endif
|
||||
return nextSeed;
|
||||
}
|
||||
|
||||
// Called on slave at beginning of new event.
|
||||
inline void SetNextRandomStateForSlave( G4int eventID, void *randomState )
|
||||
{ HepRandom::setTheSeed( *(long *)randomState );
|
||||
#ifdef TOPC_DEBUG
|
||||
G4cout << "SET SEED: " << *(long *)randomState << G4endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
public:
|
||||
// The constructors do not need to be modified.
|
||||
inline ParMarshaledRandomState( G4int eventID )
|
||||
: MarshaledObj(RANDOM_STATE_SIZE+sizeof(int)+sizeof(G4int))
|
||||
{ Marshal(eventID);
|
||||
Marshal( GetNextRandomStateForSlave(), RANDOM_STATE_SIZE );
|
||||
}
|
||||
inline ParMarshaledRandomState( void *buf )
|
||||
: MarshaledObj(buf)
|
||||
// MarshaledObj() called with buf and 0 size, creates object for unmarshaling
|
||||
{ }
|
||||
|
||||
inline void unmarshalEventIDandSetState( G4int & eventID )
|
||||
{ Unmarshal(eventID);
|
||||
// SharedObjPtr is pointer to random state.
|
||||
SetNextRandomStateForSlave( eventID, UnmarshalAsSharedObjPtr() );
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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: ParRunManager.hh,v 1.2 2002/06/06 17:05:05 cooperma Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// Parallel Library for Geant4
|
||||
//
|
||||
// Gene Cooperman <gene@ccs.neu.edu>, 2001
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#ifndef ParRunManager_h
|
||||
#define ParRunManager_h 1
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4UserEventAction.hh"
|
||||
#include "topc.h"
|
||||
|
||||
class ParRunManager : public G4RunManager
|
||||
{
|
||||
|
||||
protected: // with description
|
||||
virtual void DoEventLoop(G4int n_event,
|
||||
const char* macroFile=0,
|
||||
G4int n_select=-1);
|
||||
|
||||
private: // TOP-C callbacks
|
||||
TOPC_BUF GenerateEventInput();
|
||||
TOPC_BUF DoEvent( void * input_buf );
|
||||
TOPC_ACTION CheckEventResult( void * input_buf, void * ignore );
|
||||
|
||||
static ParRunManager* myRunManager;
|
||||
static TOPC_BUF MyGenerateEventInput();
|
||||
static TOPC_BUF MyDoEvent( void * input_buf );
|
||||
static TOPC_ACTION MyCheckEventResult( void * input_buf, void * ignore );
|
||||
|
||||
// Copies of local variables of G4RunManager::DoEventLoop()
|
||||
static G4StateManager* stateManager;
|
||||
static G4int n_event;
|
||||
static G4int n_select;
|
||||
static G4String msg;
|
||||
|
||||
G4int i_event; // Used in lieu of i_event in RunManager::DoEventLoop()
|
||||
|
||||
inline void ImportDoEventLoopLocals(
|
||||
G4StateManager* stateManager, G4int n_event,
|
||||
G4int n_select, G4String msg )
|
||||
{
|
||||
ParRunManager::stateManager = stateManager;
|
||||
ParRunManager::n_event = n_event;
|
||||
ParRunManager::n_select = n_select;
|
||||
ParRunManager::msg = msg;
|
||||
ParRunManager::myRunManager = this;
|
||||
}
|
||||
|
||||
// Copy of userEventAction: see ParRunManager.cc for further comments
|
||||
G4UserEventAction * origUserEventAction;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user