Commit 2fff9125 authored by Chad Lantz's avatar Chad Lantz
Browse files

Made more constructors. Added pan flute RPD. Got it to compile with minimal errors

parent f6cd5047
......@@ -35,8 +35,6 @@
#include "G4UImessenger.hh"
class DetectorConstruction;
class ModTypeRPD;
class ModTypeZDC;
class G4UIdirectory;
class G4UIcommand;
class G4UIcmdWithAString;
......
......@@ -49,23 +49,27 @@ class ModTypeRPD
public:
ModTypeRPD();
ModTypeRPD(const int, ModTypeRPD*);
ModTypeRPD(const int, const G4ThreeVector*, G4LogicalVolume*);
ModTypeRPD(const int, G4LogicalVolume*, G4ThreeVector*);
~ModTypeRPD();
virtual void Construct();
virtual void ConstructCMSDetector();
virtual void ConstructPrototypeDetector();
virtual void DefineMaterials();
// virtual void DefineBorderProperties();
virtual void ConstructDetector();
inline void SetPosition ( G4ThreeVector* vec ){ m_pos = vec; }
inline void SetFiberDiameters ( G4ThreeVector* vec ){ m_fiberDiam = vec; }
inline void SetHousingThickness ( G4double arg ){ m_HousingThickness = arg; }
inline void SetFiberPitch ( G4double arg ){ m_fiberPitch = arg; }
inline void SetTileSize ( G4double arg ){ m_tileSize = arg; }
inline void SetMinWallThickness ( G4double arg ){ m_minWallThickness = arg; }
inline void SetDetectorType ( G4String arg ){ m_detType = arg; }
inline void SetOpticalFlag ( G4bool arg ){ OPTICAL = arg; }
inline void SetOverlapsFlag ( G4bool arg ){ CHECK_OVERLAPS = arg; }
inline G4ThreeVector* GetPosition ( ){ return m_pos; }
......@@ -78,9 +82,14 @@ protected:
G4double m_HousingThickness;
G4double m_fiberPitch;
G4double m_tileSize;
G4double m_minWallThickness;
G4String m_detType;
G4bool OPTICAL;
G4bool CHECK_OVERLAPS;
Materials* materials;
G4LogicalVolume* m_logicMother;
Materials* materials;
protected:
G4Material* m_matQuartz;
......@@ -172,17 +181,19 @@ protected:
G4VPhysicalVolume* m_test_blockPhysical[2];
//pan flute rpd
G4VSolid* m_PFrpd[4];
G4LogicalVolume* m_PFrpdLogical[64];
G4VPhysicalVolume* m_PFrpdPhysical[64];
G4VSolid* m_PFrpd[4];
G4LogicalVolume* m_PFrpdLogical[512];
G4VPhysicalVolume* m_PFrpdPhysical[512];
G4VSolid* m_test_foil[4];
G4LogicalVolume* m_test_foilLogical[64];
G4VPhysicalVolume* m_test_foilPhysical[64];
G4VSolid* m_PFrpd_foil[4];
G4LogicalVolume* m_PFrpd_foilLogical[512];
G4VPhysicalVolume* m_PFrpd_foilPhysical[512];
G4VSolid* m_PFdetec;
G4LogicalVolume* m_PFdetecLogical[64];
G4VPhysicalVolume* m_PFdetecPhysical[64];
G4LogicalVolume* m_PFdetecLogical[512];
G4VPhysicalVolume* m_PFdetecPhysical[512];
G4int m_PFrpd_cnt;
//rpd booleans
bool rpd_comp[8];
......
......@@ -48,14 +48,11 @@ public:
ModTypeZDC();
ModTypeZDC(const int, ModTypeZDC*);
ModTypeZDC(const int, G4LogicalVolume*);
ModTypeZDC(const int, const G4ThreeVector*, G4LogicalVolume*);
ModTypeZDC(const int, G4LogicalVolume*, G4ThreeVector* );
~ModTypeZDC();
virtual void Construct();
virtual void DefineMaterials();
virtual void DefineBorderProperties();
virtual void ConstructDetector();
......@@ -65,9 +62,12 @@ public:
inline void SetnAbsorbers ( G4int arg ){ m_nAbsorbers = arg; }
inline void SetHousingThickness ( G4double arg ){ m_HousingThickness = arg; }
inline void SetGapThickness ( G4double arg ){ m_GapThickness = arg; }
inline void SetOpticalFlag ( G4bool arg ){ OPTICAL = arg; }
inline void SetOverlapsFlag ( G4bool arg ){ CHECK_OVERLAPS = arg; }
virtual void SetHousingMaterial ( G4String material );
virtual void SetAbsorberMaterial ( G4String material );
inline G4ThreeVector* GetPosition ( ){ return m_pos; }
inline G4int GetModNum ( ){ return m_modNum; }
......@@ -79,6 +79,11 @@ protected:
G4ThreeVector* m_absDim;
G4double m_HousingThickness;
G4double m_GapThickness;
G4bool OPTICAL;
G4bool CHECK_OVERLAPS;
Materials* m_materials;
G4Material* m_matAbsorber;
G4Material* m_matHousing;
G4LogicalVolume* m_logicMother;
protected:
......@@ -108,9 +113,7 @@ protected:
G4LogicalVolume* m_CladdingLogical;
std::vector< std::vector < G4VPhysicalVolume* > > m_FiberCladdingPhysical;
Materials* m_materials;
G4Material* m_matAbsorber;
G4Material* m_matHousing;
};
......
#ifndef PhysicsList_HH_
#define PhysicsList_HH_
#include "PhysicsMessenger.hh"
#include "G4VUserPhysicsList.hh"
#include "G4VProcess.hh"
#include "G4ProcessManager.hh"
......@@ -75,9 +77,12 @@ class PhysicsList : public G4VUserPhysicsList
void SetCuts(void);
void SetList( G4String arg ){ Hadronic_PL = arg; }
G4ParticleDefinition* getParticleByID(G4int id);
private:
PhysicsMessenger *m_messenger;
G4String Hadronic_PL;
int verboseLevel;
......
......@@ -49,7 +49,7 @@ class G4UIcmdWith3VectorAndUnit;
class PhysicsMessenger: public G4UImessenger{
public:
PhysicsMessenger(DetectorConstruction* );
PhysicsMessenger(PhysicsList* );
~PhysicsMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
......@@ -62,7 +62,6 @@ class PhysicsMessenger: public G4UImessenger{
G4UIdirectory* fPhysicsDir;
//Commands
G4UIcmdWithABool* fSimCherenkovsCmd;
G4UIcmdWithAString* fSelectListCmd;
......
......@@ -58,8 +58,7 @@ class RunAction : public G4UserRunAction
private:
G4String m_fileName;
};
......
......@@ -25,6 +25,7 @@
// Author: Michael Phipps
#include "DetectorConstruction.hh"
#include "DetectorMessenger.hh"
#include "G4GeometryManager.hh"
#include "G4SolidStore.hh"
......@@ -68,9 +69,9 @@
DetectorConstruction::DetectorConstruction()
: G4VUserDetectorConstruction(), m_solidWorld(NULL), m_logicWorld(NULL),
m_physWorld(NULL)
m_physWorld(NULL),CLUSTER(false),OPTICAL(false)
{
CLUSTER = false;
new DetectorMessenger(this);
currentRPD = -1;
currentZDC = -1;
m_materials = Materials::getInstance();
......@@ -454,7 +455,7 @@ Survey* DetectorConstruction::GetSurvey(G4String name){
*/
void DetectorConstruction::AddZDC(G4ThreeVector* position){
int newModNum = m_ZDCvec.size();
m_ZDCvec.push_back(new ModTypeZDC(newModNum, position, m_logicWorld));
m_ZDCvec.push_back(new ModTypeZDC(newModNum, m_logicWorld, position ));
}
/*
......@@ -462,7 +463,7 @@ void DetectorConstruction::AddZDC(G4ThreeVector* position){
*/
void DetectorConstruction::AddRPD(G4ThreeVector* position){
int newModNum = m_ZDCvec.size();
m_RPDvec.push_back(new ModTypeRPD(newModNum, position, m_logicWorld));
m_RPDvec.push_back(new ModTypeRPD(newModNum, m_logicWorld, position ));
}
/*
......
......@@ -116,9 +116,7 @@ void EventAction::BeginOfEventAction(const G4Event* evt)
void EventAction::EndOfEventAction(const G4Event* evt){
G4PrimaryVertex* pVert = evt->GetPrimaryVertex();
gunPosX = pVert->GetX0();
gunPosY = pVert->GetY0();
gunPosZ = pVert->GetZ0();
// Last step in volume?
G4double LastStepInVolume = pVert->GetPosition().z();
......@@ -127,7 +125,6 @@ void EventAction::EndOfEventAction(const G4Event* evt){
G4HCofThisEvent * HCE = evt->GetHCofThisEvent();
FiberHitsCollection* HC = 0;
G4int nCollections = HCE->GetNumberOfCollections();
int IDholder = 0;
if(HCE) {
while (hitsCollID < nCollections) {
HC = (FiberHitsCollection*)(HCE->GetHC(hitsCollID));
......@@ -245,6 +242,9 @@ void EventAction::EndOfEventAction(const G4Event* evt){
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
for(int i = 0; i < analysisManager->GetNofNtuples(); i++){
analysisManager->FillNtupleDColumn(i,1,LastStepInVolume);
analysisManager->FillNtupleDColumn(i,2, pVert->GetX0() );
analysisManager->FillNtupleDColumn(i,3, pVert->GetY0() );
analysisManager->FillNtupleDColumn(i,4, pVert->GetZ0() );
analysisManager->AddNtupleRow(i);
}
......
This diff is collapsed.
......@@ -27,6 +27,7 @@
// For an explanation of the hierarchy scheme see: https://twiki.cern.ch/twiki/bin/view/Atlas/ZdcSimulation#Geometry_Implementation_Develope
#include "ModTypeZDC.hh"
#include "FiberSD.hh"
#include "G4GeometryManager.hh"
#include "G4SolidStore.hh"
......@@ -49,9 +50,9 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ModTypeZDC::ModTypeZDC(const int cn, G4ThreeVector& pos,
G4LogicalVolume* mother)
: m_modNum( cn ), m_pos( pos ), m_logicMother( mother )
ModTypeZDC::ModTypeZDC(const int cn,
G4LogicalVolume* mother, G4ThreeVector* pos)
: m_modNum( cn ), m_pos( pos ), m_logicMother( mother )
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......@@ -60,11 +61,15 @@ ModTypeZDC::ModTypeZDC(const int cn, G4ThreeVector& pos,
: m_modNum( cn )
{
m_nAbsorbers = right->m_nAbsorbers;
m_pos = new G4ThreeVector(right->m_pos);
m_fiberDim = new G4ThreeVector(right->m_fiberDim);
m_absDim = new G4ThreeVector(right->m_absDim);
m_pos = new G4ThreeVector(*right->m_pos);
m_fiberDiam = new G4ThreeVector(*right->m_fiberDiam);
m_absDim = new G4ThreeVector(*right->m_absDim);
m_HousingThickness = right->m_HousingThickness;
m_GapThickness = right->m_GapThickness;
OPTICAL = right->OPTICAL;
CHECK_OVERLAPS = right->CHECK_OVERLAPS;
m_matAbsorber = right->m_matAbsorber;
m_matHousing = right->m_matHousing;
m_logicMother = right->m_logicMother;
}
......@@ -77,7 +82,7 @@ ModTypeZDC::ModTypeZDC(const int cn, G4LogicalVolume* mother)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ModTypeZDC::ModTypeZDC()
: m_modNum( 0 ), m_pos(G4ThreeVector()), m_logicMother(NULL),
: m_modNum( 0 ), m_pos(new G4ThreeVector(0.,0.,0.)), m_logicMother(NULL)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......@@ -88,7 +93,6 @@ ModTypeZDC::~ModTypeZDC()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ModTypeZDC::Construct(){
DefineMaterials();
ConstructDetector();
}
......@@ -107,6 +111,7 @@ void ModTypeZDC::ConstructDetector()
else fiberMaxDia = m_fiberDiam->x();
// geometric constants
float zPitch;
float xStartStrip; // middle of left most strip -- note this strip doesn't actually exist since the sets on the edge have 5 strips instead of 6
float stripPitch; // distance between center of each rod ie) the diameter of one strip
float zStartW; // position where first tungsten plate gets placed
......@@ -117,8 +122,8 @@ void ModTypeZDC::ConstructDetector()
zStartW = -1*modLengthZ/2 + m_GapThickness + m_absDim->z()/2;
zStartRad = -1*modLengthZ/2 + m_GapThickness/2;
stripPitch = fiberMaxDia;
xStartStrip = -1*(m_absDim->x()%fiberMaxDia)*stripPitch/2 + stripPitch/2;
float modWidthX = (m_absDim->x()%fiberMaxDia)*stripPitch;
xStartStrip = -1*fmod(m_absDim->x(),fiberMaxDia)*stripPitch/2 + stripPitch/2;
float modWidthX = fmod(m_absDim->x(),fiberMaxDia)*stripPitch;
if (modWidthX == 0) modWidthX = m_absDim->x(); // the case where you are defining a solid absorber block with no active channels
float modHeightY = m_absDim->y();
float boxLengthZ = modLengthZ + m_HousingThickness*2;
......@@ -133,10 +138,10 @@ void ModTypeZDC::ConstructDetector()
// Housing
//----------------------------------------------
m_HousingBox = new G4Box("SteelCasing", boxWidthX*mm/2.0 ,boxHeightY*mm/2.0 , boxLengthZ*mm/2.0);
m_HousingBox = new G4Box("SteelCasing", boxWidthX*mm/2.0 ,boxHeightY*mm/2.0 , boxLengthZ*mm/2.0);
m_ModuleBox = new G4Box("ModuleCasing", modWidthX*mm/2.0 ,modHeightY*mm/2.0 , modLengthZ*mm/2.0);
m_HousingLogical = new G4LogicalVolume(m_SteelBox ,m_matHousing, "Steel_Logical");
m_ModuleLogical = new G4LogicalVolume(m_ModuleBox ,m_materials->Air, "Module_Logical");
m_HousingLogical = new G4LogicalVolume(m_HousingBox ,m_matHousing, "Housing_Logical");
m_ModuleLogical = new G4LogicalVolume(m_ModuleBox ,m_materials->Air, "Module_Logical");
char name[256];
int cn = m_modNum;
......@@ -144,10 +149,10 @@ void ModTypeZDC::ConstructDetector()
G4RotationMatrix* nullRotation = new G4RotationMatrix();
G4ThreeVector pos;
pos = G4ThreeVector(0,0,0);
m_HousingPhysical = new G4PVPlacement(nullRotation,m_pos,m_HousingLogical,name,m_logicMother,false,cn,checkOverlaps);
m_HousingPhysical = new G4PVPlacement(nullRotation,*m_pos,m_HousingLogical,name,m_logicMother,false,cn,CHECK_OVERLAPS);
sprintf(name,"ZDC%d_Air_Physical", cn);
m_ModulePhysical = new G4PVPlacement(nullRotation,pos,m_ModuleLogical,name,m_HousingLogical,false,cn,checkOverlaps);
m_ModulePhysical = new G4PVPlacement(nullRotation,pos,m_ModuleLogical,name,m_HousingLogical,false,cn,CHECK_OVERLAPS);
G4VisAttributes* moduleColor = new G4VisAttributes( G4Colour::Gray() );
m_ModuleLogical->SetVisAttributes( moduleColor );
......@@ -157,21 +162,21 @@ void ModTypeZDC::ConstructDetector()
// Quartz
//----------------------------------------------
m_StripTube =
m_FiberCoreTube =
new G4Tubs( "Fiber_Core_Tube",
0.0*mm,
(m_fiberDiam->x()/2.0-0.005)*mm,
modHeightY*mm/2.0 ,
0.0*deg,
360.0*deg);
m_StripLogical =
new G4LogicalVolume(m_StripTube,
m_FiberCoreLogical =
new G4LogicalVolume(m_FiberCoreTube,
m_materials->pQuartz,
"FiberCore_Logical");
G4VisAttributes* quartzColor = new G4VisAttributes( G4Colour::Cyan() );
quartzColor->SetForceSolid(true);
m_StripLogical->SetVisAttributes( quartzColor );
m_FiberCoreLogical->SetVisAttributes( quartzColor );
if ( CLADDING ) {
......@@ -210,8 +215,6 @@ void ModTypeZDC::ConstructDetector()
absorberColor->SetForceSolid(true);
m_WLogical->SetVisAttributes( absorberColor );
int modOffset = 100000; // just a convention to organize copy numbers for different modules
// Quartz strip dimensions: radiator gap, group, strip
// populate all 8 modules with quartz strips
G4RotationMatrix* stripRotation = new G4RotationMatrix();
......@@ -220,29 +223,30 @@ void ModTypeZDC::ConstructDetector()
m_FiberCorePhysical.resize(m_nAbsorbers + 1);
m_FiberCladdingPhysical.resize(m_nAbsorbers + 1);
for(int K = 0; K < m_nAbsorbers + 1; K++ ){
for(int M = 0; M < (m_absDim->x()%fiberMaxDia); M++ ){
for(int M = 0; M < fmod(m_absDim->x(),fiberMaxDia); M++ ){
sprintf(name,"ZDC%d_Core%d", m_modNum, cn);
m_CorePhysical.push_back( new G4PVPlacement(
m_FiberCorePhysical.at(K).push_back( new G4PVPlacement(
stripRotation,
G4ThreeVector((xStartStrip+(M*stripPitch))*mm,0,(zStartRad+K*zPitch)*mm),
m_StripLogical,
m_FiberCoreLogical,
name,
m_ModuleLogical,
false,
cn,
checkOverlaps) );
CHECK_OVERLAPS) );
if ( CLADDING ) {
sprintf(name,"ZDC%d_Cladding%d", m_modNum, cn);
m_FiberCladdingPhysical.push_back(new G4PVPlacement(
m_FiberCladdingPhysical.at(K).push_back(new G4PVPlacement(
stripRotation,
G4ThreeVector((xStartStrip+(M*stripPitch))*mm,0,(zStartRad+K*zPitch)*mm),m_CladdingLogical,
G4ThreeVector((xStartStrip+(M*stripPitch))*mm,0,(zStartRad+K*zPitch)*mm),
m_CladdingLogical,
name,
m_ModuleLogical,
false,
cn,
checkOverlaps) );
CHECK_OVERLAPS) );
}
++cn;
}
......@@ -258,14 +262,10 @@ void ModTypeZDC::ConstructDetector()
m_ModuleLogical,
false,
cn,
checkOverlaps) );
CHECK_OVERLAPS) );
++cn;
}
//----------------------------------------------
// Define Surface/Border Properties
//----------------------------------------------
DefineBorderProperties();
//----------------------------------------------
// SD and Scoring Volumes
......@@ -275,10 +275,10 @@ void ModTypeZDC::ConstructDetector()
//Note one SD object for each module
char fiberSDname[256];
sprintf( fiberSDname, "ZDC%d_SD", m_modNum+1);
FiberSD* aFiberSD = new FiberSD( fiberSDname, m_modNum );
FiberSD* aFiberSD = new FiberSD( fiberSDname, m_modNum, OPTICAL );
aFiberSD->HistInitialize();
SDman->AddNewDetector( aFiberSD );
m_StripLogical->SetSensitiveDetector( aFiberSD );
m_FiberCoreLogical->SetSensitiveDetector( aFiberSD );
std::cout << "ModTypeZDC construction finished: SD name " << fiberSDname << std::endl;
......@@ -288,16 +288,15 @@ void ModTypeZDC::ConstructDetector()
void ModTypeZDC::SetHousingMaterial(G4String material)
{
material.toLower();
if( material == "steel") ) m_matHousing = m_materials->Steel;
if( material == "steel" ) m_matHousing = m_materials->Steel;
else if( material == "aluminum") m_matHousing = m_materials->Al;
else G4cout << "Invalid housing material selection, defaulting to steel" << G4endl;
}
}
void ModTypeZDC::SetAbsorberMaterial(G4String material)
{
material.toLower();
if( material == "pure") ) m_matHousing = m_materials->pureW;
if( material == "pure" ) m_matHousing = m_materials->pureW;
else if( material == "composite" ) m_matHousing = m_materials->NiW;
else G4cout << "Invalid absorber material selection, defaulting to composite" << G4endl;
}
#include "PhysicsList.hh"
#include "PhysicsMessenger.hh"
PhysicsList::PhysicsList( )
{
m_messenger = new PhysicsMessenger( this );
//Set Physics list via messenger
//Hadronic_PL = _physicsList;
......
......@@ -29,6 +29,7 @@
//
#include "PhysicsMessenger.hh"
#include "PhysicsList.hh"
#include "G4OpticalSurface.hh"
......@@ -51,24 +52,24 @@ PhysicsMessenger::PhysicsMessenger(PhysicsList * pList)
fPhysicsDir = new G4UIdirectory("/Physics/");
fPhysicsDir->SetGuidance("PhysicsList options");
fSimCherenkovsCmd = new G4UIcmdWithABool("/Physics/Cherenkovs", this);
fSimCherenkovsCmd->SetGuidance("Propogate Cherenkov photons");
fSimCherenkovsCmd->SetParameterName("flag",false);
fSimCherenkovsCmd->SetDefaultValue(false);
fSelectListCmd = new G4UIcmdWithAString("/Physics/SelectList", this);
fSelectListCmd->SetGuidance("Choose a physics list to use");
fSelectListCmd->SetParameterName("List Name",false);
fSelectListCmd->SetDefaultValue("FTFP_BERT");
}
/*
*
*/
PhysicsMessenger::~PhysicsMessenger(){
delete fSimCherenkovsCmd;
delete fSelectListCmd;
}
/*
*
*/
void PhysicsMessenger::SetNewValue(G4UIcommand* command,G4String newValue){
if (command == fSimCherenkovsCmd) {
fPhysicsList->SimCherenkovs( fSimCherenkovsCmd->GetNewBoolValue(newValue) );
if (command == fSelectListCmd) {
fPhysicsList->SetList(newValue);
}
}
......@@ -32,6 +32,7 @@
#include "EventAction.hh"
#include "PrimaryGeneratorAction.hh"
#include "DetectorConstruction.hh"
#include "Analysis.hh"
#include "G4RunManager.hh"
#include "G4Run.hh"
......@@ -83,14 +84,18 @@ RunAction::RunAction()
//Create the analysis manager
auto analysisManager = G4AnalysisManager::Instance();
G4cout << "Using " << analysisManager->GetType() << G4endl;
char name[20];
//Create ZDC trees and branches
for(int zdcNo = 0; zdcNo < nZDCs->size(); zdcNo++){
analysisManager->CreateNtuple( Form("ZDC%dtree",zdcNo), "ZDC data");
for(int zdcNo = 0; zdcNo < nZDCs; zdcNo++){
sprintf(name,"ZDC%dtree",zdcNo);
analysisManager->CreateNtuple( name, "ZDC data");
if(!CLUSTER){
//Make double branches
analysisManager->CreateNtupleDColumn( zdcNo, "lastStep" );
analysisManager->CreateNtupleDColumn( zdcNo, "lastSteptest" );
analysisManager->CreateNtupleDColumn( zdcNo, "gunPosX" );
analysisManager->CreateNtupleDColumn( zdcNo, "gunPosY" );
analysisManager->CreateNtupleDColumn( zdcNo, "gunPosZ" );
analysisManager->CreateNtupleDColumn( zdcNo, "x", *ZDCdblVec->at(zdcNo).at(0) );
analysisManager->CreateNtupleDColumn( zdcNo, "y", *ZDCdblVec->at(zdcNo).at(1) );
analysisManager->CreateNtupleDColumn( zdcNo, "z", *ZDCdblVec->at(zdcNo).at(2) );
......@@ -114,6 +119,9 @@ RunAction::RunAction()
} else { // There's only two branches to save space on cluster jobs
analysisManager->CreateNtupleDColumn( zdcNo, "lastStep" );
analysisManager->CreateNtupleDColumn( zdcNo, "gunPosX" );
analysisManager->CreateNtupleDColumn( zdcNo, "gunPosY" );
analysisManager->CreateNtupleDColumn( zdcNo, "gunPosZ" );
analysisManager->CreateNtupleIColumn( zdcNo, "radNo", *ZDCintVec->at(zdcNo).at(0) );
analysisManager->CreateNtupleIColumn( zdcNo, "nCherenkovs", *ZDCintVec->at(zdcNo).at(1) );
}//end if !CLUSTER
......@@ -121,12 +129,16 @@ RunAction::RunAction()
//Create RPD trees and branches
for(int rpdNo = 0; rpdNo < nRPDs; rpdNo++){
analysisManager->CreateNtuple( Form("RPD%dtree",rpdNo), "RPD data");
sprintf(name,"RPD%dtree",rpdNo);
analysisManager->CreateNtuple( name, "RPD data");
int nTuple = nZDCs + rpdNo;
if(!CLUSTER){
//Make double branches
analysisManager->CreateNtupleDColumn( nTuple, "lastStep" );
analysisManager->CreateNtupleDColumn( nTuple, "lastSteptest" );
analysisManager->CreateNtupleDColumn( nTuple, "gunPosX" );
analysisManager->CreateNtupleDColumn( nTuple, "gunPosY" );
analysisManager->CreateNtupleDColumn( nTuple, "gunPosZ" );
analysisManager->CreateNtupleDColumn( nTuple, "x", *RPDdblVec->at(rpdNo).at(0) );
analysisManager->CreateNtupleDColumn( nTuple, "y", *RPDdblVec->at(rpdNo).at(1) );
analysisManager->CreateNtupleDColumn( nTuple, "z", *RPDdblVec->at(rpdNo).at(2) );
......@@ -151,6 +163,9 @@ RunAction::RunAction()
} else { // There's only two branches to save space on cluster jobs
//Make double branches
analysisManager->CreateNtupleDColumn( nTuple, "lastStep" );
analysisManager->CreateNtupleDColumn( nTuple, "gunPosX" );
analysisManager->CreateNtupleDColumn( nTuple, "gunPosY" );
analysisManager->CreateNtupleDColumn( nTuple, "gunPosZ" );
analysisManager->CreateNtupleDColumn( nTuple, "x", *RPDdblVec->at(rpdNo).at(0) );
analysisManager->CreateNtupleDColumn( nTuple, "y", *RPDdblVec->at(rpdNo).at(1) );
analysisManager->CreateNtupleDColumn( nTuple, "z", *RPDdblVec->at(rpdNo).at(2) );
......@@ -171,23 +186,12 @@ RunAction::~RunAction()
void RunAction::BeginOfRunAction(__attribute__((unused)) const G4Run* run)
{
long seeds[2];
long systime = time(NULL);
seeds[0] = (long) systime;
seeds[1] = (long) (systime*G4UniformRand());
G4Random::setTheSeeds(seeds);
G4RunManager::GetRunManager()->SetRandomNumberStore(false);
// Get analysis manager
auto analysisManager = G4AnalysisManager::Instance();
// Open an output file