Import Geant4 11.2.0.beta source tree
This commit is contained in:
+94
-128
@@ -34,36 +34,34 @@
|
||||
|
||||
// User Classes
|
||||
#include "ExGflash2DetectorConstruction.hh"
|
||||
|
||||
#include "ExGflash2SensitiveDetector.hh"
|
||||
|
||||
// G4 Classes
|
||||
#include "G4NistManager.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4AutoDelete.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4NistManager.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExGflash2DetectorConstruction::ExGflash2DetectorConstruction()
|
||||
:G4VUserDetectorConstruction(), fCrystalLog(nullptr), fCrystalPhys{}
|
||||
{
|
||||
G4cout<<"ExGflash2DetectorConstruction::Detector constructor"<<G4endl;
|
||||
G4cout << "ExGflash2DetectorConstruction::Detector constructor" << G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExGflash2DetectorConstruction::~ExGflash2DetectorConstruction() {}
|
||||
ExGflash2DetectorConstruction::~ExGflash2DetectorConstruction() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -74,132 +72,101 @@ G4VPhysicalVolume* ExGflash2DetectorConstruction::Construct()
|
||||
// Get nist material manager
|
||||
G4NistManager* nistManager = G4NistManager::Instance();
|
||||
// Build materials
|
||||
G4Material* air = nistManager->FindOrBuildMaterial("G4_AIR");
|
||||
G4Material* air = nistManager->FindOrBuildMaterial("G4_AIR");
|
||||
G4Material* pbWO4 = nistManager->FindOrBuildMaterial("G4_PbWO4");
|
||||
|
||||
|
||||
/*******************************
|
||||
* The Experimental Hall *
|
||||
*******************************/
|
||||
G4double experimentalHall_x=1000.*cm;
|
||||
G4double experimentalHall_y=1000.*cm;
|
||||
G4double experimentalHall_z=1000.*cm;
|
||||
|
||||
G4VSolid* experimentalHall_box
|
||||
= new G4Box("expHall_box", // World Volume
|
||||
experimentalHall_x, // x size
|
||||
experimentalHall_y, // y size
|
||||
experimentalHall_z); // z size
|
||||
|
||||
G4LogicalVolume* experimentalHallLog
|
||||
= new G4LogicalVolume(experimentalHall_box,
|
||||
air,
|
||||
"expHallLog",
|
||||
0, //opt: fieldManager
|
||||
0, //opt: SensitiveDetector
|
||||
0); //opt: UserLimits
|
||||
G4VPhysicalVolume* experimentalHallPhys
|
||||
= new G4PVPlacement(0,
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
"expHall",
|
||||
experimentalHallLog,
|
||||
0,
|
||||
false,
|
||||
0);
|
||||
|
||||
|
||||
//------------------------------
|
||||
G4double experimentalHall_x = 1000. * cm;
|
||||
G4double experimentalHall_y = 1000. * cm;
|
||||
G4double experimentalHall_z = 1000. * cm;
|
||||
|
||||
G4VSolid* experimentalHall_box = new G4Box("expHall_box", // World Volume
|
||||
experimentalHall_x, // x size
|
||||
experimentalHall_y, // y size
|
||||
experimentalHall_z); // z size
|
||||
|
||||
auto experimentalHallLog = new G4LogicalVolume(experimentalHall_box, air, "expHallLog",
|
||||
nullptr, // opt: fieldManager
|
||||
nullptr, // opt: SensitiveDetector
|
||||
nullptr); // opt: UserLimits
|
||||
G4VPhysicalVolume* experimentalHallPhys =
|
||||
new G4PVPlacement(nullptr,
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
"expHall", experimentalHallLog, nullptr, false, 0);
|
||||
|
||||
//------------------------------
|
||||
// Calorimeter segments
|
||||
//------------------------------
|
||||
// Simplified `CMS-like` PbWO4 crystal calorimeter
|
||||
|
||||
G4int nbOfCrystals = 10; // this are the crystals PER ROW in this example
|
||||
// cube of 10 x 10 crystals
|
||||
// don't change it @the moment, since
|
||||
// the readout in event action assumes this
|
||||
// dimensions and is not automatically adapted
|
||||
// in this version of the example :-(
|
||||
// Simplified `CMS-like` PbWO4 crystal calorimeter
|
||||
G4double calo_xside = 31*cm;
|
||||
G4double calo_yside = 31*cm;
|
||||
G4double calo_zside = 24*cm;
|
||||
// Simplified `CMS-like` PbWO4 crystal calorimeter
|
||||
|
||||
G4double crystalWidth = 3*cm;
|
||||
G4double crystalLength = 24*cm;
|
||||
G4int nbOfCrystals = 10; // this are the crystals PER ROW in this example
|
||||
// cube of 10 x 10 crystals
|
||||
// don't change it @the moment, since
|
||||
// the readout in event action assumes this
|
||||
// dimensions and is not automatically adapted
|
||||
// in this version of the example :-(
|
||||
// Simplified `CMS-like` PbWO4 crystal calorimeter
|
||||
G4double calo_xside = 31 * cm;
|
||||
G4double calo_yside = 31 * cm;
|
||||
G4double calo_zside = 24 * cm;
|
||||
|
||||
calo_xside = (crystalWidth*nbOfCrystals)+1*cm;
|
||||
calo_yside = (crystalWidth*nbOfCrystals)+1*cm;
|
||||
G4double crystalWidth = 3 * cm;
|
||||
G4double crystalLength = 24 * cm;
|
||||
|
||||
calo_xside = (crystalWidth * nbOfCrystals) + 1 * cm;
|
||||
calo_yside = (crystalWidth * nbOfCrystals) + 1 * cm;
|
||||
calo_zside = crystalLength;
|
||||
|
||||
G4Box* calo_box= new G4Box("CMS calorimeter", // its name
|
||||
calo_xside/2., // size
|
||||
calo_yside/2.,
|
||||
calo_zside/2.);
|
||||
G4LogicalVolume* caloLog
|
||||
= new G4LogicalVolume(calo_box, // its solid
|
||||
air, // its material
|
||||
"calo log", // its name
|
||||
0, // opt: fieldManager
|
||||
0, // opt: SensitiveDetector
|
||||
0); // opt: UserLimit
|
||||
|
||||
|
||||
auto calo_box = new G4Box("CMS calorimeter", // its name
|
||||
calo_xside / 2., // size
|
||||
calo_yside / 2., calo_zside / 2.);
|
||||
auto caloLog = new G4LogicalVolume(calo_box, // its solid
|
||||
air, // its material
|
||||
"calo log", // its name
|
||||
nullptr, // opt: fieldManager
|
||||
nullptr, // opt: SensitiveDetector
|
||||
nullptr); // opt: UserLimit
|
||||
|
||||
G4double xpos = 0.0;
|
||||
G4double ypos = 0.0;
|
||||
G4double zpos = 100.0*cm;
|
||||
new G4PVPlacement(0,
|
||||
G4ThreeVector(xpos, ypos, zpos),
|
||||
caloLog,
|
||||
"calorimeter",
|
||||
experimentalHallLog,
|
||||
false,
|
||||
1);
|
||||
|
||||
G4double zpos = 100.0 * cm;
|
||||
new G4PVPlacement(nullptr, G4ThreeVector(xpos, ypos, zpos), caloLog, "calorimeter",
|
||||
experimentalHallLog, false, 1);
|
||||
|
||||
// Crystals
|
||||
G4VSolid* crystal_box
|
||||
= new G4Box("Crystal", // its name
|
||||
crystalWidth/2,
|
||||
crystalWidth/2,
|
||||
crystalLength/2);
|
||||
// size
|
||||
fCrystalLog
|
||||
= new G4LogicalVolume(crystal_box, // its solid
|
||||
pbWO4, // its material
|
||||
"CrystalLog"); // its name
|
||||
|
||||
for (G4int i=0; i<nbOfCrystals; i++)
|
||||
{
|
||||
|
||||
for (G4int j=0; j<nbOfCrystals; j++)
|
||||
{
|
||||
G4int n = i*10+j;
|
||||
G4ThreeVector crystalPos((i*crystalWidth)-135,
|
||||
(j*crystalWidth)-135,0 );
|
||||
fCrystalPhys[n]
|
||||
= new G4PVPlacement(0, // no rotation
|
||||
crystalPos, // translation
|
||||
fCrystalLog,
|
||||
"crystal", // its name
|
||||
caloLog,
|
||||
false,
|
||||
i);
|
||||
}
|
||||
}
|
||||
G4cout << "There are " << nbOfCrystals <<
|
||||
" crystals per row in the calorimeter, so in total "<<
|
||||
nbOfCrystals*nbOfCrystals << " crystals" << G4endl;
|
||||
G4cout << "They have width of " << crystalWidth /cm <<
|
||||
" cm and a length of " << crystalLength /cm
|
||||
<<" cm. The Material is "<< pbWO4 << G4endl;
|
||||
|
||||
|
||||
G4VSolid* crystal_box = new G4Box("Crystal", // its name
|
||||
crystalWidth / 2, crystalWidth / 2, crystalLength / 2);
|
||||
// size
|
||||
fCrystalLog = new G4LogicalVolume(crystal_box, // its solid
|
||||
pbWO4, // its material
|
||||
"CrystalLog"); // its name
|
||||
|
||||
for (G4int i = 0; i < nbOfCrystals; i++) {
|
||||
for (G4int j = 0; j < nbOfCrystals; j++) {
|
||||
G4int n = i * 10 + j;
|
||||
G4ThreeVector crystalPos((i * crystalWidth) - 135, (j * crystalWidth) - 135, 0);
|
||||
fCrystalPhys[n] = new G4PVPlacement(nullptr, // no rotation
|
||||
crystalPos, // translation
|
||||
fCrystalLog,
|
||||
"crystal", // its name
|
||||
caloLog, false, i);
|
||||
}
|
||||
}
|
||||
G4cout << "There are " << nbOfCrystals << " crystals per row in the calorimeter, so in total "
|
||||
<< nbOfCrystals * nbOfCrystals << " crystals" << G4endl;
|
||||
G4cout << "They have width of " << crystalWidth / cm << " cm and a length of "
|
||||
<< crystalLength / cm << " cm. The Material is " << pbWO4 << G4endl;
|
||||
|
||||
experimentalHallLog->SetVisAttributes(G4VisAttributes::GetInvisible());
|
||||
G4VisAttributes* caloVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,1.0));
|
||||
G4VisAttributes* crystalVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,0.0));
|
||||
auto caloVisAtt = new G4VisAttributes(G4Colour(1.0, 1.0, 1.0));
|
||||
auto crystalVisAtt = new G4VisAttributes(G4Colour(1.0, 1.0, 0.0));
|
||||
caloLog->SetVisAttributes(caloVisAtt);
|
||||
fCrystalLog->SetVisAttributes(crystalVisAtt);
|
||||
|
||||
|
||||
// Parametrisation region defined in ExGflash2ParallelWorld
|
||||
|
||||
|
||||
return experimentalHallPhys;
|
||||
}
|
||||
|
||||
@@ -209,11 +176,10 @@ void ExGflash2DetectorConstruction::ConstructSDandField()
|
||||
{
|
||||
// -- sensitive detectors:
|
||||
G4SDManager* SDman = G4SDManager::GetSDMpointer();
|
||||
ExGflash2SensitiveDetector* CaloSD
|
||||
= new ExGflash2SensitiveDetector("Calorimeter",this);
|
||||
auto CaloSD = new ExGflash2SensitiveDetector("Calorimeter", this);
|
||||
SDman->AddNewDetector(CaloSD);
|
||||
fCrystalLog->SetSensitiveDetector(CaloSD);
|
||||
|
||||
|
||||
// Fast simulation implemented in ExGflash2ParallelWorld
|
||||
}
|
||||
|
||||
|
||||
@@ -34,47 +34,40 @@
|
||||
#include "ExGflash2ParallelWorld.hh"
|
||||
|
||||
// G4 Classes
|
||||
#include "G4NistManager.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4AutoDelete.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4NistManager.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//fast simulation
|
||||
#include "GFlashHomoShowerParameterisation.hh"
|
||||
#include "G4FastSimulationManager.hh"
|
||||
#include "GFlashShowerModel.hh"
|
||||
// fast simulation
|
||||
#include "GFlashHitMaker.hh"
|
||||
#include "GFlashHomoShowerParameterisation.hh"
|
||||
#include "GFlashParticleBounds.hh"
|
||||
#include "GFlashShowerModel.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4ThreadLocal GFlashShowerModel* ExGflash2ParallelWorld::fFastShowerModel = 0;
|
||||
G4ThreadLocal
|
||||
GFlashHomoShowerParameterisation* ExGflash2ParallelWorld::fParameterisation = 0;
|
||||
G4ThreadLocal GFlashParticleBounds* ExGflash2ParallelWorld::fParticleBounds = 0;
|
||||
G4ThreadLocal GFlashHitMaker* ExGflash2ParallelWorld::fHitMaker = 0;
|
||||
#include "G4FastSimulationManager.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExGflash2ParallelWorld::ExGflash2ParallelWorld(G4String aWorldName)
|
||||
:G4VUserParallelWorld(aWorldName), fRegion(nullptr)
|
||||
: G4VUserParallelWorld(aWorldName)
|
||||
{
|
||||
G4cout<<"ExGflash2ParallelWorld::Parralel world constructor"<<G4endl;
|
||||
G4cout << "ExGflash2ParallelWorld::Parralel world constructor" << G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExGflash2ParallelWorld::~ExGflash2ParallelWorld()
|
||||
{
|
||||
delete fFastShowerModel;
|
||||
delete fFastShowerModel;
|
||||
delete fParameterisation;
|
||||
delete fParticleBounds;
|
||||
delete fHitMaker;
|
||||
@@ -85,55 +78,48 @@ ExGflash2ParallelWorld::~ExGflash2ParallelWorld()
|
||||
void ExGflash2ParallelWorld::Construct()
|
||||
{
|
||||
// In parallel world material does not matter
|
||||
G4Material* dummy = nullptr;
|
||||
G4Material* dummy = nullptr;
|
||||
|
||||
// Build parallel/ghost geometry:
|
||||
auto ghostLogicalVolume = GetWorld()->GetLogicalVolume();
|
||||
|
||||
|
||||
// Use part of the Ex1GflashDetectorConstruction (without individual crystals)
|
||||
|
||||
G4int nbOfCrystals = 10; // this are the crystals PER ROW in this example
|
||||
// cube of 10 x 10 crystals
|
||||
// don't change it @the moment, since
|
||||
// the readout in event action assumes this
|
||||
// dimensions and is not automatically adapted
|
||||
// in this version of the example :-(
|
||||
// Simplified `CMS-like` PbWO4 crystal calorimeter
|
||||
G4double calo_xside = 31*cm;
|
||||
G4double calo_yside = 31*cm;
|
||||
G4double calo_zside = 24*cm;
|
||||
|
||||
G4double crystalWidth = 3*cm;
|
||||
G4double crystalLength = 24*cm;
|
||||
G4int nbOfCrystals = 10; // this are the crystals PER ROW in this example
|
||||
// cube of 10 x 10 crystals
|
||||
// don't change it @the moment, since
|
||||
// the readout in event action assumes this
|
||||
// dimensions and is not automatically adapted
|
||||
// in this version of the example :-(
|
||||
// Simplified `CMS-like` PbWO4 crystal calorimeter
|
||||
G4double calo_xside = 31 * cm;
|
||||
G4double calo_yside = 31 * cm;
|
||||
G4double calo_zside = 24 * cm;
|
||||
|
||||
calo_xside = (crystalWidth*nbOfCrystals)+1*cm;
|
||||
calo_yside = (crystalWidth*nbOfCrystals)+1*cm;
|
||||
G4double crystalWidth = 3 * cm;
|
||||
G4double crystalLength = 24 * cm;
|
||||
|
||||
calo_xside = (crystalWidth * nbOfCrystals) + 1 * cm;
|
||||
calo_yside = (crystalWidth * nbOfCrystals) + 1 * cm;
|
||||
calo_zside = crystalLength;
|
||||
|
||||
G4Box* calo_box= new G4Box("CMS calorimeter", // its name
|
||||
calo_xside/2., // size
|
||||
calo_yside/2.,
|
||||
calo_zside/2.);
|
||||
G4LogicalVolume* calo_log
|
||||
= new G4LogicalVolume(calo_box, // its solid
|
||||
dummy, // its material
|
||||
"calo log", // its name
|
||||
0, // opt: fieldManager
|
||||
0, // opt: SensitiveDetector
|
||||
0); // opt: UserLimit
|
||||
|
||||
auto calo_box = new G4Box("CMS calorimeter", // its name
|
||||
calo_xside / 2., // size
|
||||
calo_yside / 2., calo_zside / 2.);
|
||||
auto calo_log = new G4LogicalVolume(calo_box, // its solid
|
||||
dummy, // its material
|
||||
"calo log", // its name
|
||||
nullptr, // opt: fieldManager
|
||||
nullptr, // opt: SensitiveDetector
|
||||
nullptr); // opt: UserLimit
|
||||
|
||||
G4double xpos = 0.0;
|
||||
G4double ypos = 0.0;
|
||||
G4double zpos = 100.0*cm;
|
||||
new G4PVPlacement(0,
|
||||
G4ThreeVector(xpos, ypos, zpos),
|
||||
calo_log,
|
||||
"calorimeter",
|
||||
ghostLogicalVolume,
|
||||
false,
|
||||
1);
|
||||
G4double zpos = 100.0 * cm;
|
||||
new G4PVPlacement(nullptr, G4ThreeVector(xpos, ypos, zpos), calo_log, "calorimeter",
|
||||
ghostLogicalVolume, false, 1);
|
||||
|
||||
G4VisAttributes* caloVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,1.0));
|
||||
auto caloVisAtt = new G4VisAttributes(G4Colour(1.0, 1.0, 1.0));
|
||||
calo_log->SetVisAttributes(caloVisAtt);
|
||||
|
||||
// define the fParameterisation region
|
||||
@@ -148,7 +134,7 @@ void ExGflash2ParallelWorld::ConstructSD()
|
||||
{
|
||||
// Get nist material manager
|
||||
G4NistManager* nistManager = G4NistManager::Instance();
|
||||
G4Material* pbWO4 = nistManager->FindOrBuildMaterial("G4_PbWO4");
|
||||
G4Material* pbWO4 = nistManager->FindOrBuildMaterial("G4_PbWO4");
|
||||
// -- fast simulation models:
|
||||
// **********************************************
|
||||
// * Initializing shower modell
|
||||
@@ -163,7 +149,7 @@ void ExGflash2ParallelWorld::ConstructSD()
|
||||
// Makes the EnergieSpots
|
||||
fHitMaker = new GFlashHitMaker();
|
||||
fFastShowerModel->SetHitMaker(*fHitMaker);
|
||||
G4cout<<"end shower parameterization."<<G4endl;
|
||||
G4cout << "end shower parameterization." << G4endl;
|
||||
// **********************************************
|
||||
}
|
||||
|
||||
|
||||
+56
-52
@@ -29,101 +29,105 @@
|
||||
//
|
||||
// Created by Joanna Weng 26.11.2004
|
||||
#include "ExGflash2SensitiveDetector.hh"
|
||||
#include "ExGflashHit.hh"
|
||||
#include "G4GFlashSpot.hh"
|
||||
#include "ExGflash2DetectorConstruction.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4VTouchable.hh"
|
||||
#include "G4TouchableHistory.hh"
|
||||
|
||||
//WARNING : You have to use also G4VGFlashSensitiveDetector() as base class
|
||||
#include "ExGflash2DetectorConstruction.hh"
|
||||
#include "ExGflashHit.hh"
|
||||
|
||||
#include "G4GFlashSpot.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4TouchableHistory.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4VTouchable.hh"
|
||||
|
||||
// WARNING : You have to use also G4VGFlashSensitiveDetector() as base class
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExGflash2SensitiveDetector::ExGflash2SensitiveDetector(G4String name,
|
||||
ExGflash2DetectorConstruction* det)
|
||||
: G4VSensitiveDetector(name), G4VGFlashSensitiveDetector(), fDetector(det), fHCID(-1)
|
||||
ExGflash2DetectorConstruction* det)
|
||||
: G4VSensitiveDetector(name), fDetector(det)
|
||||
{
|
||||
G4String caloname="ExGflashCollection";
|
||||
G4String caloname = "ExGflashCollection";
|
||||
collectionName.insert(caloname);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExGflash2SensitiveDetector::~ExGflash2SensitiveDetector()
|
||||
{}
|
||||
ExGflash2SensitiveDetector::~ExGflash2SensitiveDetector() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExGflash2SensitiveDetector::Initialize(G4HCofThisEvent* HCE)
|
||||
{
|
||||
if(fHCID<0){ fHCID = GetCollectionID(0); }
|
||||
fCaloHitsCollection=new
|
||||
ExGflashHitsCollection(SensitiveDetectorName,collectionName[0]); // first collection
|
||||
HCE->AddHitsCollection( fHCID, fCaloHitsCollection );
|
||||
if (fHCID < 0) {
|
||||
fHCID = GetCollectionID(0);
|
||||
}
|
||||
fCaloHitsCollection =
|
||||
new ExGflashHitsCollection(SensitiveDetectorName, collectionName[0]); // first collection
|
||||
HCE->AddHitsCollection(fHCID, fCaloHitsCollection);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExGflash2SensitiveDetector::EndOfEvent(G4HCofThisEvent*)
|
||||
{}
|
||||
void ExGflash2SensitiveDetector::EndOfEvent(G4HCofThisEvent*) {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool ExGflash2SensitiveDetector::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist)
|
||||
G4bool ExGflash2SensitiveDetector::ProcessHits(G4Step* aStep, G4TouchableHistory* ROhist)
|
||||
{
|
||||
G4double e=aStep->GetTotalEnergyDeposit();
|
||||
if(e<=0.)return false;
|
||||
|
||||
G4TouchableHistory* theTouchable
|
||||
= (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
|
||||
|
||||
G4double e = aStep->GetTotalEnergyDeposit();
|
||||
if (e <= 0.) return false;
|
||||
|
||||
auto theTouchable = (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
|
||||
|
||||
// enrgy deposited -> make Hit
|
||||
//const G4VPhysicalVolume* physVol= aStep->GetPreStepPoint()->GetPhysicalVolume();
|
||||
//G4TouchableHistory* theTouchable =
|
||||
// const G4VPhysicalVolume* physVol= aStep->GetPreStepPoint()->GetPhysicalVolume();
|
||||
// G4TouchableHistory* theTouchable =
|
||||
// (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
|
||||
ExGflashHit* caloHit=new ExGflashHit();
|
||||
auto caloHit = new ExGflashHit();
|
||||
caloHit->SetEdep(e);
|
||||
caloHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
|
||||
fCaloHitsCollection->insert(caloHit);
|
||||
if (ROhist){;}
|
||||
if (ROhist) {
|
||||
;
|
||||
}
|
||||
G4VPhysicalVolume* physVol = theTouchable->GetVolume();
|
||||
G4int crystalnum=0;
|
||||
for(int i=0;i<100;i++) //@@@@@@@ ExGflash2SensitiveDetector:vorsichty
|
||||
{
|
||||
if(physVol == fDetector->GetCristal(i)) crystalnum= i;
|
||||
}
|
||||
G4int crystalnum = 0;
|
||||
for (int i = 0; i < 100; i++) //@@@@@@@ ExGflash2SensitiveDetector:vorsichty
|
||||
{
|
||||
if (physVol == fDetector->GetCristal(i)) crystalnum = i;
|
||||
}
|
||||
caloHit->SetCrystalNum(crystalnum);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// Separate GFLASH interface
|
||||
G4bool ExGflash2SensitiveDetector::ProcessHits(G4GFlashSpot*aSpot ,G4TouchableHistory* ROhist)
|
||||
{ //cout<<"This is ProcessHits GFLASH"<<endl;
|
||||
G4double e=aSpot->GetEnergySpot()->GetEnergy();
|
||||
if(e<=0.)return false;
|
||||
|
||||
G4bool ExGflash2SensitiveDetector::ProcessHits(G4GFlashSpot* aSpot, G4TouchableHistory* ROhist)
|
||||
{ // cout<<"This is ProcessHits GFLASH"<<endl;
|
||||
G4double e = aSpot->GetEnergySpot()->GetEnergy();
|
||||
if (e <= 0.) return false;
|
||||
|
||||
G4VPhysicalVolume* pCurrentVolume = aSpot->GetTouchableHandle()->GetVolume();
|
||||
|
||||
ExGflashHit* caloHit=new ExGflashHit();
|
||||
|
||||
auto caloHit = new ExGflashHit();
|
||||
caloHit->SetEdep(e);
|
||||
caloHit->SetPos(aSpot->GetEnergySpot()->GetPosition());
|
||||
fCaloHitsCollection->insert(caloHit);
|
||||
if (ROhist){;}
|
||||
//cout <<pCurrentVolume->GetName() << endl;
|
||||
G4int crystalnum=0;
|
||||
for(int i=0;i<100;i++) //@@@@@@@ ExGflash2SensitiveDetector:vorsichty
|
||||
{
|
||||
if(pCurrentVolume == fDetector->GetCristal(i)) crystalnum= i;
|
||||
}
|
||||
if (ROhist) {
|
||||
;
|
||||
}
|
||||
// cout <<pCurrentVolume->GetName() << endl;
|
||||
G4int crystalnum = 0;
|
||||
for (int i = 0; i < 100; i++) //@@@@@@@ ExGflash2SensitiveDetector:vorsichty
|
||||
{
|
||||
if (pCurrentVolume == fDetector->GetCristal(i)) crystalnum = i;
|
||||
}
|
||||
caloHit->SetCrystalNum(crystalnum);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
+5
-9
@@ -28,22 +28,18 @@
|
||||
/// \brief Implementation of the ExGflashActionInitialization class
|
||||
|
||||
#include "ExGflashActionInitialization.hh"
|
||||
|
||||
#include "ExGflashEventAction.hh"
|
||||
#include "ExGflashPrimaryGeneratorAction.hh"
|
||||
#include "ExGflashRunAction.hh"
|
||||
#include "ExGflashEventAction.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExGflashActionInitialization::ExGflashActionInitialization()
|
||||
: G4VUserActionInitialization()
|
||||
{
|
||||
}
|
||||
ExGflashActionInitialization::ExGflashActionInitialization() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExGflashActionInitialization::~ExGflashActionInitialization()
|
||||
{
|
||||
}
|
||||
ExGflashActionInitialization::~ExGflashActionInitialization() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -59,6 +55,6 @@ void ExGflashActionInitialization::Build() const
|
||||
SetUserAction(new ExGflashPrimaryGeneratorAction);
|
||||
SetUserAction(new ExGflashRunAction);
|
||||
SetUserAction(new ExGflashEventAction);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -29,191 +29,170 @@
|
||||
//
|
||||
// Created by Joanna Weng 26.11.2004
|
||||
|
||||
|
||||
#include "ExGflashEventAction.hh"
|
||||
|
||||
#include "ExGflashHit.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4TrajectoryContainer.hh"
|
||||
#include "G4Event.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
//std
|
||||
#include <iostream>
|
||||
#include "G4TrajectoryContainer.hh"
|
||||
#include "G4UImanager.hh"
|
||||
// std
|
||||
#include <algorithm>
|
||||
//Gflash
|
||||
#include <iostream>
|
||||
// Gflash
|
||||
using namespace std;
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExGflashEventAction::ExGflashEventAction()
|
||||
: G4UserEventAction(),
|
||||
fNevent(0),fDtime(0.0),fCalorimeterCollectionId(-1)
|
||||
{
|
||||
}
|
||||
ExGflashEventAction::ExGflashEventAction() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExGflashEventAction::~ExGflashEventAction()
|
||||
{
|
||||
if ( fNevent > 0 ) {
|
||||
G4cout << "Internal Real Elapsed Time /event is: "<< fDtime /fNevent<< G4endl;
|
||||
if (fNevent > 0) {
|
||||
G4cout << "Internal Real Elapsed Time /event is: " << fDtime / fNevent << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExGflashEventAction::BeginOfEventAction(const G4Event *evt)
|
||||
void ExGflashEventAction::BeginOfEventAction(const G4Event* evt)
|
||||
{
|
||||
fTimerIntern.Start();
|
||||
G4cout<<" ------ Start ExGflashEventAction ----- "<<G4endl;
|
||||
fNevent=evt->GetEventID();
|
||||
G4cout<<" Start generating event Nr "<<fNevent<<G4endl<<G4endl;
|
||||
G4cout << " ------ Start ExGflashEventAction ----- " << G4endl;
|
||||
fNevent = evt->GetEventID();
|
||||
G4cout << " Start generating event Nr " << fNevent << G4endl << G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExGflashEventAction::EndOfEventAction(const G4Event *evt)
|
||||
{
|
||||
void ExGflashEventAction::EndOfEventAction(const G4Event* evt)
|
||||
{
|
||||
fTimerIntern.Stop();
|
||||
G4cout << G4endl;
|
||||
G4cout << "******************************************";
|
||||
G4cout << G4endl;
|
||||
G4cout << "Internal Real Elapsed Time is: "<< fTimerIntern.GetRealElapsed();
|
||||
G4cout << "Internal Real Elapsed Time is: " << fTimerIntern.GetRealElapsed();
|
||||
G4cout << G4endl;
|
||||
G4cout << "Internal System Elapsed Time: " << fTimerIntern.GetSystemElapsed();
|
||||
G4cout << G4endl;
|
||||
G4cout << "Internal GetUserElapsed Time: " << fTimerIntern.GetUserElapsed();
|
||||
G4cout << G4endl;
|
||||
G4cout << "******************************************"<< G4endl;
|
||||
fDtime+=fTimerIntern.GetRealElapsed();
|
||||
G4cout<<" ------ ExGflashEventAction::End of event nr. "<<fNevent<<" -----"<< G4endl;
|
||||
|
||||
G4SDManager * SDman = G4SDManager::GetSDMpointer();
|
||||
G4cout << "******************************************" << G4endl;
|
||||
fDtime += fTimerIntern.GetRealElapsed();
|
||||
G4cout << " ------ ExGflashEventAction::End of event nr. " << fNevent << " -----" << G4endl;
|
||||
|
||||
G4SDManager* SDman = G4SDManager::GetSDMpointer();
|
||||
G4String colNam;
|
||||
fCalorimeterCollectionId=SDman->GetCollectionID(colNam="ExGflashCollection");
|
||||
if (fCalorimeterCollectionId<0) return;
|
||||
G4HCofThisEvent * HCE = evt->GetHCofThisEvent();
|
||||
ExGflashHitsCollection* THC = 0;
|
||||
fCalorimeterCollectionId = SDman->GetCollectionID(colNam = "ExGflashCollection");
|
||||
if (fCalorimeterCollectionId < 0) return;
|
||||
G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
|
||||
ExGflashHitsCollection* THC = nullptr;
|
||||
G4double totE = 0;
|
||||
// Read out of the crysta ECAL
|
||||
THC=(ExGflashHitsCollection *)(HCE->GetHC(fCalorimeterCollectionId));
|
||||
if (THC)
|
||||
{
|
||||
/// Hits in sensitive Detector
|
||||
int n_hit = THC->entries();
|
||||
G4cout<<" " << n_hit<< " hits are stored in ExGflashHitsCollection "<<G4endl;
|
||||
G4PrimaryVertex* pvertex=evt->GetPrimaryVertex();
|
||||
///Computing (x,y,z) of vertex of initial particles
|
||||
G4ThreeVector vtx=pvertex->GetPosition();
|
||||
G4PrimaryParticle* pparticle=pvertex->GetPrimary();
|
||||
THC = (ExGflashHitsCollection*)(HCE->GetHC(fCalorimeterCollectionId));
|
||||
if (THC) {
|
||||
/// Hits in sensitive Detector
|
||||
int n_hit = THC->entries();
|
||||
G4cout << " " << n_hit << " hits are stored in ExGflashHitsCollection " << G4endl;
|
||||
G4PrimaryVertex* pvertex = evt->GetPrimaryVertex();
|
||||
/// Computing (x,y,z) of vertex of initial particles
|
||||
G4ThreeVector vtx = pvertex->GetPosition();
|
||||
G4PrimaryParticle* pparticle = pvertex->GetPrimary();
|
||||
// direction of the Shower
|
||||
G4ThreeVector mom=pparticle->GetMomentum()/pparticle->GetMomentum().mag();
|
||||
|
||||
G4ThreeVector mom = pparticle->GetMomentum() / pparticle->GetMomentum().mag();
|
||||
|
||||
//@@@ ExGflashEventAction: Magicnumber
|
||||
G4double energyincrystal[100];
|
||||
G4int hitsincrystal[100];
|
||||
for (int i=0;i<100;i++) energyincrystal[i]=0.;
|
||||
for (int i=0;i<100;i++) hitsincrystal[i]=0.;
|
||||
|
||||
for (int i = 0; i < 100; i++)
|
||||
energyincrystal[i] = 0.;
|
||||
for (int i = 0; i < 100; i++)
|
||||
hitsincrystal[i] = 0.;
|
||||
|
||||
//@@@ ExGflashEventAction: Magicnumber
|
||||
/// For all Hits in sensitive detector
|
||||
for (int i=0;i<n_hit;i++)
|
||||
{
|
||||
G4double estep = (*THC)[i]->GetEdep()/GeV;
|
||||
if (estep >0.0)
|
||||
{
|
||||
totE += (*THC)[i]->GetEdep()/GeV;
|
||||
G4int num=(*THC)[i]->GetCrystalNum();
|
||||
|
||||
energyincrystal[num]+=(*THC)[i]->GetEdep()/GeV;
|
||||
hitsincrystal[num]++;
|
||||
//G4cout << num << G4endl;
|
||||
// G4cout << " Crystal Nummer " << (*THC)[i]->GetCrystalNum() << G4endl;
|
||||
// G4cout << (*THC)[i]->GetCrystalNum() /10 <<
|
||||
// " "<<(*THC)[i]->GetCrystalNum()%10 << G4endl;
|
||||
|
||||
G4ThreeVector hitpos=(*THC)[i]->GetPos();
|
||||
G4ThreeVector l (hitpos.x(), hitpos.y(), hitpos.z());
|
||||
// distance from shower start
|
||||
l = l - vtx;
|
||||
// projection on shower axis = longitudinal profile
|
||||
G4ThreeVector longitudinal = l;
|
||||
// shower profiles (Radial)
|
||||
G4ThreeVector radial = vtx.cross(l);
|
||||
}
|
||||
for (int i = 0; i < n_hit; i++) {
|
||||
G4double estep = (*THC)[i]->GetEdep() / GeV;
|
||||
if (estep > 0.0) {
|
||||
totE += (*THC)[i]->GetEdep() / GeV;
|
||||
G4int num = (*THC)[i]->GetCrystalNum();
|
||||
|
||||
energyincrystal[num] += (*THC)[i]->GetEdep() / GeV;
|
||||
hitsincrystal[num]++;
|
||||
// G4cout << num << G4endl;
|
||||
// G4cout << " Crystal Nummer " << (*THC)[i]->GetCrystalNum() << G4endl;
|
||||
// G4cout << (*THC)[i]->GetCrystalNum() /10 <<
|
||||
// " "<<(*THC)[i]->GetCrystalNum()%10 << G4endl;
|
||||
|
||||
G4ThreeVector hitpos = (*THC)[i]->GetPos();
|
||||
G4ThreeVector l(hitpos.x(), hitpos.y(), hitpos.z());
|
||||
// distance from shower start
|
||||
l = l - vtx;
|
||||
// projection on shower axis = longitudinal profile
|
||||
G4ThreeVector longitudinal = l;
|
||||
// shower profiles (Radial)
|
||||
G4ThreeVector radial = vtx.cross(l);
|
||||
}
|
||||
G4double max = 0;
|
||||
G4int index = 0;
|
||||
//Find crystal with maximum energy
|
||||
for (int i=0;i<100;i++)
|
||||
{
|
||||
//G4cout << i <<" " << energyincrystal[i] << G4endl;
|
||||
if (max <energyincrystal[i])
|
||||
{
|
||||
max=energyincrystal[i];
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
//G4cout << index <<" NMAX " << index << G4endl;
|
||||
|
||||
// 3x3 matrix of crystals around the crystal with the maximum energy deposit
|
||||
G4double e3x3 =
|
||||
energyincrystal[index]+energyincrystal[index+1]+energyincrystal[index-1]+
|
||||
energyincrystal[index-10]+energyincrystal[index-9]+energyincrystal[index-11]+
|
||||
energyincrystal[index+10]+energyincrystal[index+11]+energyincrystal[index+9];
|
||||
|
||||
// 5x5 matrix of crystals around the crystal with the maximum energy deposit
|
||||
G4double e5x5 =
|
||||
energyincrystal[index]+energyincrystal[index+1]+energyincrystal[index-1]+
|
||||
energyincrystal[index+2]+energyincrystal[index-2]+
|
||||
energyincrystal[index-10]+energyincrystal[index-9]+energyincrystal[index-11]+
|
||||
energyincrystal[index-8]+energyincrystal[index-12]+
|
||||
energyincrystal[index+10]+energyincrystal[index+11]+energyincrystal[index+9]+
|
||||
energyincrystal[index+12]+energyincrystal[index+8];
|
||||
}
|
||||
G4double max = 0;
|
||||
G4int index = 0;
|
||||
// Find crystal with maximum energy
|
||||
for (int i = 0; i < 100; i++) {
|
||||
// G4cout << i <<" " << energyincrystal[i] << G4endl;
|
||||
if (max < energyincrystal[i]) {
|
||||
max = energyincrystal[i];
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
// G4cout << index <<" NMAX " << index << G4endl;
|
||||
|
||||
// 3x3 matrix of crystals around the crystal with the maximum energy deposit
|
||||
G4int num3x3 =
|
||||
hitsincrystal[index]+hitsincrystal[index+1]+hitsincrystal[index-1]+
|
||||
hitsincrystal[index-10]+hitsincrystal[index-9]+hitsincrystal[index-11]+
|
||||
hitsincrystal[index+10]+hitsincrystal[index+11]+hitsincrystal[index+9];
|
||||
|
||||
// 5x5 matrix of crystals around the crystal with the maximum energy deposit
|
||||
G4int num5x5 =
|
||||
hitsincrystal[index]+hitsincrystal[index+1]+hitsincrystal[index-1]+
|
||||
hitsincrystal[index+2]+hitsincrystal[index-2]+
|
||||
hitsincrystal[index-10]+hitsincrystal[index-9]+hitsincrystal[index-11]+
|
||||
hitsincrystal[index-8]+hitsincrystal[index-12]+
|
||||
hitsincrystal[index+10]+hitsincrystal[index+11]+hitsincrystal[index+9]+
|
||||
hitsincrystal[index+12]+hitsincrystal[index+8];
|
||||
|
||||
G4cout << " e1 " << energyincrystal[index]
|
||||
<< " e3x3 " << e3x3<< " GeV e5x5 " <<e5x5 <<G4endl;
|
||||
|
||||
G4cout << " num1 " << hitsincrystal[index]
|
||||
<< " num3x3 " << num3x3<< " num5x5 " <<num5x5 <<G4endl;
|
||||
G4double e3x3 = energyincrystal[index] + energyincrystal[index + 1] + energyincrystal[index - 1]
|
||||
+ energyincrystal[index - 10] + energyincrystal[index - 9]
|
||||
+ energyincrystal[index - 11] + energyincrystal[index + 10]
|
||||
+ energyincrystal[index + 11] + energyincrystal[index + 9];
|
||||
|
||||
// 5x5 matrix of crystals around the crystal with the maximum energy deposit
|
||||
G4double e5x5 =
|
||||
energyincrystal[index] + energyincrystal[index + 1] + energyincrystal[index - 1]
|
||||
+ energyincrystal[index + 2] + energyincrystal[index - 2] + energyincrystal[index - 10]
|
||||
+ energyincrystal[index - 9] + energyincrystal[index - 11] + energyincrystal[index - 8]
|
||||
+ energyincrystal[index - 12] + energyincrystal[index + 10] + energyincrystal[index + 11]
|
||||
+ energyincrystal[index + 9] + energyincrystal[index + 12] + energyincrystal[index + 8];
|
||||
|
||||
// 3x3 matrix of crystals around the crystal with the maximum energy deposit
|
||||
G4int num3x3 = hitsincrystal[index] + hitsincrystal[index + 1] + hitsincrystal[index - 1]
|
||||
+ hitsincrystal[index - 10] + hitsincrystal[index - 9]
|
||||
+ hitsincrystal[index - 11] + hitsincrystal[index + 10]
|
||||
+ hitsincrystal[index + 11] + hitsincrystal[index + 9];
|
||||
|
||||
// 5x5 matrix of crystals around the crystal with the maximum energy deposit
|
||||
G4int num5x5 = hitsincrystal[index] + hitsincrystal[index + 1] + hitsincrystal[index - 1]
|
||||
+ hitsincrystal[index + 2] + hitsincrystal[index - 2] + hitsincrystal[index - 10]
|
||||
+ hitsincrystal[index - 9] + hitsincrystal[index - 11] + hitsincrystal[index - 8]
|
||||
+ hitsincrystal[index - 12] + hitsincrystal[index + 10]
|
||||
+ hitsincrystal[index + 11] + hitsincrystal[index + 9]
|
||||
+ hitsincrystal[index + 12] + hitsincrystal[index + 8];
|
||||
|
||||
G4cout << " e1 " << energyincrystal[index] << " e3x3 " << e3x3 << " GeV e5x5 " << e5x5
|
||||
<< G4endl;
|
||||
|
||||
G4cout << " num1 " << hitsincrystal[index] << " num3x3 " << num3x3 << " num5x5 "
|
||||
<< num5x5 << G4endl;
|
||||
}
|
||||
|
||||
|
||||
G4cout << " Total energy deposited in the calorimeter: " << totE << " (GeV)" << G4endl;
|
||||
G4TrajectoryContainer * trajectoryContainer = evt->GetTrajectoryContainer();
|
||||
G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
|
||||
G4int n_trajectories = 0;
|
||||
if(trajectoryContainer){ n_trajectories = trajectoryContainer->entries(); }
|
||||
G4cout << " " << n_trajectories << " trajectories stored in this event." << G4endl;
|
||||
|
||||
if (trajectoryContainer) {
|
||||
n_trajectories = trajectoryContainer->entries();
|
||||
}
|
||||
G4cout << " " << n_trajectories << " trajectories stored in this event." << G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -30,42 +30,36 @@
|
||||
|
||||
#include "ExGflashHit.hh"
|
||||
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Transform3D.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4ThreadLocal G4Allocator<ExGflashHit>* ExGflashHitAllocator=0;
|
||||
G4ThreadLocal G4Allocator<ExGflashHit>* ExGflashHitAllocator = nullptr;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExGflashHit::ExGflashHit()
|
||||
: G4VHit(), fLogV(0)
|
||||
{}
|
||||
ExGflashHit::ExGflashHit() : fLogV(nullptr) {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExGflashHit::ExGflashHit(G4LogicalVolume* logVol)
|
||||
: G4VHit(), fLogV(logVol)
|
||||
{}
|
||||
ExGflashHit::ExGflashHit(G4LogicalVolume* logVol) : fLogV(logVol) {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExGflashHit::~ExGflashHit()
|
||||
{}
|
||||
ExGflashHit::~ExGflashHit() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExGflashHit::ExGflashHit(const ExGflashHit &right)
|
||||
: G4VHit(right)
|
||||
ExGflashHit::ExGflashHit(const ExGflashHit& right) : G4VHit(right)
|
||||
//@@@ ExGflashHit:Is it right with the init?
|
||||
{
|
||||
fEdep = right.fEdep;
|
||||
fPos = right.fPos;
|
||||
fStart =right.fStart;
|
||||
fPos = right.fPos;
|
||||
fStart = right.fStart;
|
||||
fRot = right.fRot;
|
||||
fLogV = right.fLogV;
|
||||
fCrystalNumber = right.fCrystalNumber;
|
||||
@@ -73,11 +67,11 @@ ExGflashHit::ExGflashHit(const ExGflashHit &right)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
const ExGflashHit & ExGflashHit::operator=(const ExGflashHit &right)
|
||||
const ExGflashHit& ExGflashHit::operator=(const ExGflashHit& right)
|
||||
{
|
||||
G4VHit::operator=(right);
|
||||
fEdep = right.fEdep;
|
||||
fStart =right.fStart;
|
||||
fStart = right.fStart;
|
||||
fPos = right.fPos;
|
||||
fRot = right.fRot;
|
||||
fLogV = right.fLogV;
|
||||
@@ -88,12 +82,13 @@ const ExGflashHit & ExGflashHit::operator=(const ExGflashHit &right)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool ExGflashHit::operator==(const ExGflashHit &right) const
|
||||
G4bool ExGflashHit::operator==(const ExGflashHit& right) const
|
||||
{
|
||||
// @@@@ return false;
|
||||
if ((fPos==right.fPos) && (fEdep == right.fEdep)) return true;
|
||||
else return false;
|
||||
|
||||
// @@@@ return false;
|
||||
if ((fPos == right.fPos) && (fEdep == right.fEdep))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -101,31 +96,21 @@ G4bool ExGflashHit::operator==(const ExGflashHit &right) const
|
||||
void ExGflashHit::Draw()
|
||||
{
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
if(pVVisManager)
|
||||
{
|
||||
G4Transform3D trans(fRot,fPos);
|
||||
if (pVVisManager) {
|
||||
G4Transform3D trans(fRot, fPos);
|
||||
G4VisAttributes attribs;
|
||||
const G4VisAttributes* pVA = fLogV->GetVisAttributes();
|
||||
if(pVA) attribs = *pVA;
|
||||
G4Colour colour(1.,0.,0.);
|
||||
if (pVA) attribs = *pVA;
|
||||
G4Colour colour(1., 0., 0.);
|
||||
attribs.SetColour(colour);
|
||||
attribs.SetForceWireframe(false);
|
||||
attribs.SetForceSolid(true);
|
||||
pVVisManager->Draw(*fLogV,attribs,trans);
|
||||
pVVisManager->Draw(*fLogV, attribs, trans);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExGflashHit::Print()
|
||||
{}
|
||||
void ExGflashHit::Print() {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+3
-4
@@ -29,15 +29,14 @@
|
||||
//
|
||||
#include "ExGflashPrimaryGeneratorAction.hh"
|
||||
|
||||
#include "G4GeneralParticleSource.hh"
|
||||
#include "G4Event.hh"
|
||||
#include "G4GeneralParticleSource.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExGflashPrimaryGeneratorAction::ExGflashPrimaryGeneratorAction()
|
||||
: G4VUserPrimaryGeneratorAction(), fParticleGun(0)
|
||||
{
|
||||
fParticleGun=new G4GeneralParticleSource;
|
||||
fParticleGun = new G4GeneralParticleSource;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -50,7 +49,7 @@ ExGflashPrimaryGeneratorAction::~ExGflashPrimaryGeneratorAction()
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExGflashPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
{
|
||||
fParticleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,46 +28,32 @@
|
||||
/// \brief Implementation of the ExGflashRunAction class
|
||||
//
|
||||
#include "ExGflashRunAction.hh"
|
||||
|
||||
#include "G4Run.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExGflashRunAction::ExGflashRunAction()
|
||||
: G4UserRunAction(), fRunID(0)
|
||||
{}
|
||||
ExGflashRunAction::ExGflashRunAction() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExGflashRunAction::~ExGflashRunAction()
|
||||
{}
|
||||
ExGflashRunAction::~ExGflashRunAction() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExGflashRunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
{
|
||||
((G4Run *)(aRun))->SetRunID(fRunID++);
|
||||
|
||||
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
|
||||
{
|
||||
((G4Run*)(aRun))->SetRunID(fRunID++);
|
||||
|
||||
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExGflashRunAction::EndOfRunAction(const G4Run* aRun)
|
||||
{
|
||||
{
|
||||
G4cout << "number of event = " << aRun->GetNumberOfEvent() << G4endl;
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user