Commit 6b740228 authored by Frank Gaede's avatar Frank Gaede
Browse files

add GFlashSamplingShowerParameterisation

 - fix bug w/ absorber placements
parent 6fe0c726
// draw sim hits
#include <string>
/** Helper function for radius
*/
float r(float x,float y) { return sqrt(x*x+y*y) ; }
......@@ -52,4 +54,8 @@ void draw_simhits( const char* FILEN ) {
events->Draw("sqrt(x*x+y*y)","(sqrt(x*x+y*y)<50)*e") ;
std::string pdfFile( FILEN ) ;
pdfFile += ".pdf" ;
c1->Print( pdfFile.c_str() ) ;
}
......@@ -38,6 +38,7 @@ class G4VPhysicalVolume;
class G4Region;
class GFlashHomoShowerParameterisation;
class GVFlashShowerParameterisation;
class GFlashShowerModel;
class GFlashHitMaker;
class GFlashParticleBounds;
......@@ -64,7 +65,9 @@ private:
G4Region* fRegion;
static G4ThreadLocal GFlashShowerModel* fFastShowerModel;
static G4ThreadLocal GFlashHomoShowerParameterisation* fParameterisation;
// static G4ThreadLocal GFlashHomoShowerParameterisation* fParameterisation;
static G4ThreadLocal GVFlashShowerParameterisation* fParameterisation;
static G4ThreadLocal GFlashParticleBounds* fParticleBounds;
static G4ThreadLocal GFlashHitMaker* fHitMaker;
};
......
......@@ -53,6 +53,7 @@
//fast simulation
#include "GFlashHomoShowerParameterisation.hh"
#include "GFlashSamplingShowerParameterisation.hh"
#include "G4FastSimulationManager.hh"
#include "GFlashShowerModel.hh"
#include "GFlashHitMaker.hh"
......@@ -61,8 +62,9 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4ThreadLocal GFlashShowerModel* SimpleCaloDetectorConstruction::fFastShowerModel = 0;
G4ThreadLocal
GFlashHomoShowerParameterisation* SimpleCaloDetectorConstruction::fParameterisation = 0;
//G4ThreadLocal GFlashHomoShowerParameterisation* SimpleCaloDetectorConstruction::fParameterisation = 0;
G4ThreadLocal GVFlashShowerParameterisation* SimpleCaloDetectorConstruction::fParameterisation = 0 ;
G4ThreadLocal GFlashParticleBounds* SimpleCaloDetectorConstruction::fParticleBounds = 0;
G4ThreadLocal GFlashHitMaker* SimpleCaloDetectorConstruction::fHitMaker = 0;
......@@ -95,6 +97,9 @@ G4VPhysicalVolume* SimpleCaloDetectorConstruction::Construct()
// Build materials
G4Material* air = nistManager->FindOrBuildMaterial("G4_AIR");
G4Material* pbWO4 = nistManager->FindOrBuildMaterial("G4_PbWO4");
G4Material* tungsten = nistManager->FindOrBuildMaterial("G4_W");
G4Material* silicon = nistManager->FindOrBuildMaterial("G4_Si");
/*******************************
* The Experimental Hall *
......@@ -179,7 +184,8 @@ G4VPhysicalVolume* SimpleCaloDetectorConstruction::Construct()
fLayerLogA
= new G4LogicalVolume(layer_boxA, // its solid
pbWO4, // its material
// pbWO4, // its material
tungsten, // its material
"LayerLogA"); // its name
// sensitive
G4VSolid* layer_boxS
......@@ -190,7 +196,8 @@ G4VPhysicalVolume* SimpleCaloDetectorConstruction::Construct()
fLayerLogS
= new G4LogicalVolume(layer_boxS, // its solid
pbWO4, // its material
// pbWO4, // its material
silicon, // its material
"LayerLogS"); // its name
for (G4int j=0; j<nbOfLayers; j++)
......@@ -200,24 +207,24 @@ G4VPhysicalVolume* SimpleCaloDetectorConstruction::Construct()
G4ThreeVector layerPosA( 0,0, ( j - nbOfLayers / 2 ) * (calo_zAbs + calo_zSens ) + calo_zAbs/2 ) ;
G4ThreeVector layerPosS( 0,0, ( j - nbOfLayers / 2 ) * (calo_zAbs + calo_zSens ) + calo_zAbs + calo_zSens/2 ) ;
auto* g4p = new G4PVPlacement(0, // no rotation
layerPosA, // translation
fLayerLogA,
"layerA", // its name
caloLog,
false,
j);
new G4PVPlacement(0, // no rotation
layerPosA, // translation
fLayerLogA,
"layerA", // its name
caloLog,
false,
j*1000);
fLayerPhys[n]
= new G4PVPlacement(0, // no rotation
layerPosS, // translation
fLayerLogS,
"layerS", // its name
caloLog,
false,
j);
fLayerPhys[n]
= new G4PVPlacement(0, // no rotation
layerPosS, // translation
fLayerLogS,
"layerS", // its name
caloLog,
false,
j);
delete g4p ;
}
G4cout << "There are " << nbOfLayers <<
......@@ -225,8 +232,8 @@ G4VPhysicalVolume* SimpleCaloDetectorConstruction::Construct()
G4cout << "They have absorber thickness of " << calo_zAbs /cm <<
" cm and a sensitive thickness " << calo_zSens /cm
<<" cm. The absorber material is "<< pbWO4
<<" The sensitive material is "<< pbWO4
<<" cm. The absorber material is "<< fLayerLogA->GetMaterial()
<<" The sensitive material is "<< fLayerLogS->GetMaterial()
<< G4endl;
......@@ -259,13 +266,21 @@ void SimpleCaloDetectorConstruction::ConstructSDandField()
// Get nist material manager
G4NistManager* nistManager = G4NistManager::Instance();
G4Material* pbWO4 = nistManager->FindOrBuildMaterial("G4_PbWO4");
G4Material* tungsten = nistManager->FindOrBuildMaterial("G4_W");
G4Material* silicon = nistManager->FindOrBuildMaterial("G4_Si");
// -- fast simulation models:
// **********************************************
// * Initializing shower modell
// ***********************************************
G4cout << "Creating shower parameterization models" << G4endl;
fFastShowerModel = new GFlashShowerModel("fFastShowerModel", fRegion);
#if 0
fParameterisation = new GFlashHomoShowerParameterisation(pbWO4);
#else
fParameterisation = new GFlashSamplingShowerParameterisation( tungsten, silicon, 2*mm, 0.5*mm );
#endif
fFastShowerModel->SetParameterisation(*fParameterisation);
// Energy Cuts to kill particles:
fParticleBounds = new GFlashParticleBounds();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment