diff --git a/macros/g4simulations/Fun4All_G4_EICDetector.C b/macros/g4simulations/Fun4All_G4_EICDetector.C index d19078c75..5549e152f 100644 --- a/macros/g4simulations/Fun4All_G4_EICDetector.C +++ b/macros/g4simulations/Fun4All_G4_EICDetector.C @@ -37,8 +37,6 @@ int Fun4All_G4_EICDetector( bool do_svtx_track = do_svtx_cell && true; bool do_svtx_eval = do_svtx_track && true; - bool do_preshower = false; - bool do_cemc = true; bool do_cemc_cell = do_cemc && true; bool do_cemc_twr = do_cemc_cell && true; @@ -119,7 +117,7 @@ int Fun4All_G4_EICDetector( // establish the geometry and reconstruction setup gROOT->LoadMacro("G4Setup_EICDetector.C"); - G4Init(do_svtx,do_preshower,do_cemc,do_hcalin,do_magnet,do_hcalout,do_pipe,do_FGEM,do_EGEM,do_FEMC,do_FHCAL,do_EEMC,do_DIRC,do_RICH,do_Aerogel,n_TPC_layers); + G4Init(do_svtx,do_cemc,do_hcalin,do_magnet,do_hcalout,do_pipe,do_FGEM,do_EGEM,do_FEMC,do_FHCAL,do_EEMC,do_DIRC,do_RICH,do_Aerogel,n_TPC_layers); int absorberactive = 0; // set to 1 to make all absorbers active volumes // const string magfield = "1.5"; // if like float -> solenoidal field in T, if string use as fieldmap name (including path) @@ -219,7 +217,7 @@ int Fun4All_G4_EICDetector( // Detector description //--------------------- - G4Setup(absorberactive, magfield, TPythia6Decayer::kAll,do_svtx,do_preshower,do_cemc,do_hcalin,do_magnet,do_hcalout,do_pipe,do_FGEM,do_EGEM,do_FEMC,do_FHCAL,do_EEMC,do_DIRC,do_RICH,do_Aerogel,magfield_rescale); + G4Setup(absorberactive, magfield, TPythia6Decayer::kAll,do_svtx,do_cemc,do_hcalin,do_magnet,do_hcalout,do_pipe,do_FGEM,do_EGEM,do_FEMC,do_FHCAL,do_EEMC,do_DIRC,do_RICH,do_Aerogel,magfield_rescale); } @@ -369,7 +367,6 @@ int Fun4All_G4_EICDetector( G4DSTreader_EICDetector( outputFile, // /*int*/ absorberactive , /*bool*/ do_svtx , - /*bool*/ do_preshower , /*bool*/ do_cemc , /*bool*/ do_hcalin , /*bool*/ do_magnet , diff --git a/macros/g4simulations/Fun4All_G4_fsPHENIX.C b/macros/g4simulations/Fun4All_G4_fsPHENIX.C index 699f68f15..3d21e0d72 100644 --- a/macros/g4simulations/Fun4All_G4_fsPHENIX.C +++ b/macros/g4simulations/Fun4All_G4_fsPHENIX.C @@ -44,8 +44,6 @@ int Fun4All_G4_fsPHENIX( bool do_svtx_track = do_svtx_cell && true; bool do_svtx_eval = do_svtx_track && false; - bool do_preshower = false; - bool do_cemc = true; bool do_cemc_cell = do_cemc && true; bool do_cemc_twr = do_cemc_cell && true; @@ -108,7 +106,7 @@ int Fun4All_G4_fsPHENIX( // establish the geometry and reconstruction setup gROOT->LoadMacro("G4Setup_fsPHENIX.C"); - G4Init(do_svtx,do_preshower,do_cemc,do_hcalin,do_magnet,do_hcalout,do_pipe,do_FGEM,do_FEMC,do_FHCAL,n_TPC_layers); + G4Init(do_svtx,do_cemc,do_hcalin,do_magnet,do_hcalout,do_pipe,do_FGEM,do_FEMC,do_FHCAL,n_TPC_layers); int absorberactive = 0; // set to 1 to make all absorbers active volumes // const string magfield = "1.5"; // if like float -> solenoidal field in T, if string use as fieldmap name (including path) @@ -214,7 +212,7 @@ int Fun4All_G4_fsPHENIX( //--------------------- G4Setup(absorberactive, magfield, TPythia6Decayer::kAll, - do_svtx, do_preshower, do_cemc, do_hcalin, do_magnet, do_hcalout, do_pipe, + do_svtx, do_cemc, do_hcalin, do_magnet, do_hcalout, do_pipe, do_FGEM, do_FEMC, do_FHCAL, magfield_rescale); @@ -376,7 +374,6 @@ int Fun4All_G4_fsPHENIX( G4DSTreader_fsPHENIX( outputFile, // /*int*/ absorberactive , /*bool*/ do_svtx , - /*bool*/ do_preshower , /*bool*/ do_cemc , /*bool*/ do_hcalin , /*bool*/ do_magnet , diff --git a/macros/g4simulations/Fun4All_G4_sPHENIX.C b/macros/g4simulations/Fun4All_G4_sPHENIX.C index 59d37e9af..e26e87342 100644 --- a/macros/g4simulations/Fun4All_G4_sPHENIX.C +++ b/macros/g4simulations/Fun4All_G4_sPHENIX.C @@ -55,8 +55,7 @@ int Fun4All_G4_sPHENIX( bool do_svtx_track = do_svtx_cell && true; bool do_svtx_eval = do_svtx_track && true; - bool do_preshower = false; - + bool do_pstof = true; bool do_cemc = true; bool do_cemc_cell = do_cemc && true; @@ -110,7 +109,7 @@ int Fun4All_G4_sPHENIX( // establish the geometry and reconstruction setup gROOT->LoadMacro("G4Setup_sPHENIX.C"); - G4Init(do_svtx,do_preshower,do_cemc,do_hcalin,do_magnet,do_hcalout,do_pipe,n_TPC_layers); + G4Init(do_svtx,do_pstof,do_cemc,do_hcalin,do_magnet,do_hcalout,do_pipe,n_TPC_layers); int absorberactive = 1; // set to 1 to make all absorbers active volumes // const string magfield = "1.5"; // if like float -> solenoidal field in T, if string use as fieldmap name (including path) @@ -290,7 +289,7 @@ int Fun4All_G4_sPHENIX( //--------------------- G4Setup(absorberactive, magfield, TPythia6Decayer::kAll, - do_svtx, do_preshower, do_cemc, do_hcalin, do_magnet, do_hcalout, do_pipe, magfield_rescale); + do_svtx, do_pstof, do_cemc, do_hcalin, do_magnet, do_hcalout, do_pipe, magfield_rescale); } //--------- @@ -441,7 +440,7 @@ int Fun4All_G4_sPHENIX( G4DSTreader( outputFile, // /*int*/ absorberactive , /*bool*/ do_svtx , - /*bool*/ do_preshower , + /*bool*/ do_pstof , /*bool*/ do_cemc , /*bool*/ do_hcalin , /*bool*/ do_magnet , diff --git a/macros/g4simulations/G4Setup_EICDetector.C b/macros/g4simulations/G4Setup_EICDetector.C index 19c07c220..e6453f717 100644 --- a/macros/g4simulations/G4Setup_EICDetector.C +++ b/macros/g4simulations/G4Setup_EICDetector.C @@ -3,7 +3,6 @@ double no_overlapp = 0.0001; // added to radii to avoid overlapping volumes bool overlapcheck = false; // set to true if you want to check for overlaps void G4Init(bool do_svtx = true, - bool do_preshower = false, bool do_cemc = true, bool do_hcalin = true, bool do_magnet = true, @@ -33,12 +32,6 @@ void G4Init(bool do_svtx = true, SvtxInit(n_TPC_layers); } - if (do_preshower) - { - gROOT->LoadMacro("G4_PreShower.C"); - PreShowerInit(); - } - if (do_cemc) { gROOT->LoadMacro("G4_CEmc_Spacal.C"); @@ -118,7 +111,6 @@ int G4Setup(const int absorberactive = 0, const string &field ="1.5", const EDecayType decayType = TPythia6Decayer::kAll, const bool do_svtx = true, - const bool do_preshower = false, const bool do_cemc = true, const bool do_hcalin = true, const bool do_magnet = true, @@ -182,11 +174,6 @@ int G4Setup(const int absorberactive = 0, // SVTX if (do_svtx) radius = Svtx(g4Reco, radius, absorberactive); - //---------------------------------------- - // PRESHOWER - - if (do_preshower) radius = PreShower(g4Reco, radius, absorberactive); - //---------------------------------------- // CEMC // diff --git a/macros/g4simulations/G4Setup_fsPHENIX.C b/macros/g4simulations/G4Setup_fsPHENIX.C index b1bee4a6b..751d7286c 100644 --- a/macros/g4simulations/G4Setup_fsPHENIX.C +++ b/macros/g4simulations/G4Setup_fsPHENIX.C @@ -3,7 +3,6 @@ double no_overlapp = 0.0001; // added to radii to avoid overlapping volumes bool overlapcheck = false; // set to true if you want to check for overlaps void G4Init(bool do_svtx = true, - bool do_preshower = false, bool do_cemc = true, bool do_hcalin = true, bool do_magnet = true, @@ -27,12 +26,6 @@ void G4Init(bool do_svtx = true, SvtxInit(n_TPC_layers); } - if (do_preshower) - { - gROOT->LoadMacro("G4_PreShower.C"); - PreShowerInit(); - } - if (do_cemc) { gROOT->LoadMacro("G4_CEmc_Spacal.C"); @@ -80,7 +73,6 @@ int G4Setup(const int absorberactive = 0, const string &field ="1.5", const EDecayType decayType = TPythia6Decayer::kAll, const bool do_svtx = true, - const bool do_preshower = false, const bool do_cemc = true, const bool do_hcalin = true, const bool do_magnet = true, @@ -140,11 +132,6 @@ int G4Setup(const int absorberactive = 0, // SVTX if (do_svtx) radius = Svtx(g4Reco, radius, absorberactive); - //---------------------------------------- - // PRESHOWER - - if (do_preshower) radius = PreShower(g4Reco, radius, absorberactive); - //---------------------------------------- // CEMC // diff --git a/macros/g4simulations/G4Setup_sPHENIX.C b/macros/g4simulations/G4Setup_sPHENIX.C index c2af2b0ac..2bd56db20 100644 --- a/macros/g4simulations/G4Setup_sPHENIX.C +++ b/macros/g4simulations/G4Setup_sPHENIX.C @@ -3,7 +3,7 @@ double no_overlapp = 0.0001; // added to radii to avoid overlapping volumes bool overlapcheck = false; // set to true if you want to check for overlaps void G4Init(bool do_svtx = true, - bool do_preshower = false, + bool do_pstof = true, bool do_cemc = true, bool do_hcalin = true, bool do_magnet = true, @@ -25,10 +25,10 @@ void G4Init(bool do_svtx = true, SvtxInit(n_TPC_layers); } - if (do_preshower) + if (do_pstof) { - gROOT->LoadMacro("G4_PreShower.C"); - PreShowerInit(); + gROOT->LoadMacro("G4_PSTOF.C"); + PSTOFInit(); } if (do_cemc) @@ -61,7 +61,7 @@ int G4Setup(const int absorberactive = 0, const string &field ="1.5", const EDecayType decayType = TPythia6Decayer::kAll, const bool do_svtx = true, - const bool do_preshower = false, + const bool do_pstof = true, const bool do_cemc = true, const bool do_hcalin = true, const bool do_magnet = true, @@ -117,9 +117,9 @@ int G4Setup(const int absorberactive = 0, if (do_svtx) radius = Svtx(g4Reco, radius, absorberactive); //---------------------------------------- - // PRESHOWER + // PSTOF - if (do_preshower) radius = PreShower(g4Reco, radius, absorberactive); + if (do_pstof) radius = PSTOF(g4Reco, radius, absorberactive); //---------------------------------------- // CEMC diff --git a/macros/g4simulations/G4_CEmc_Spacal.C b/macros/g4simulations/G4_CEmc_Spacal.C index 8945321e1..d01e3231b 100644 --- a/macros/g4simulations/G4_CEmc_Spacal.C +++ b/macros/g4simulations/G4_CEmc_Spacal.C @@ -52,7 +52,7 @@ CEmc_1DProjectiveSpacal(PHG4Reco *g4Reco, double radius, const int crossings, co if (radius > emc_inner_radius) { - cout << "inconsistency: preshower radius+thickness: " << radius + cout << "inconsistency: pstof outer radius: " << radius << " larger than emc inner radius: " << emc_inner_radius << endl; gSystem->Exit(-1); diff --git a/macros/g4simulations/G4_DSTReader.C b/macros/g4simulations/G4_DSTReader.C index c7bc5500d..79624588c 100644 --- a/macros/g4simulations/G4_DSTReader.C +++ b/macros/g4simulations/G4_DSTReader.C @@ -14,7 +14,7 @@ void G4DSTreader( const char * outputFile = "G4sPHENIXCells.root",// int absorberactive = 1, // bool do_svtx = true, // - bool do_preshower = false, // + bool do_pstof = true, // bool do_cemc = true, // bool do_hcalin = true, // bool do_magnet = true, // @@ -52,6 +52,11 @@ G4DSTreader( const char * outputFile = "G4sPHENIXCells.root",// ana->AddNode("SVTX"); } + if (do_pstof) + { + ana->AddNode("PSTOF_0"); + } + if (do_cemc) { ana->AddNode("CEMC"); diff --git a/macros/g4simulations/G4_DSTReader_EICDetector.C b/macros/g4simulations/G4_DSTReader_EICDetector.C index 7ac2df43c..e8e83f3ae 100644 --- a/macros/g4simulations/G4_DSTReader_EICDetector.C +++ b/macros/g4simulations/G4_DSTReader_EICDetector.C @@ -14,7 +14,6 @@ void G4DSTreader_EICDetector( const char * outputFile = "G4sPHENIXCells.root",// int absorberactive = 1, // bool do_svtx = true, // - bool do_preshower = false, // bool do_cemc = true, // bool do_hcalin = true, // bool do_magnet = true, // diff --git a/macros/g4simulations/G4_DSTReader_fsPHENIX.C b/macros/g4simulations/G4_DSTReader_fsPHENIX.C index 9e5b0cb25..5edfc6282 100644 --- a/macros/g4simulations/G4_DSTReader_fsPHENIX.C +++ b/macros/g4simulations/G4_DSTReader_fsPHENIX.C @@ -14,7 +14,6 @@ void G4DSTreader_fsPHENIX( const char * outputFile = "G4sPHENIXCells.root",// int absorberactive = 1, // bool do_svtx = true, // - bool do_preshower = false, // bool do_cemc = true, // bool do_hcalin = true, // bool do_magnet = true, // diff --git a/macros/g4simulations/G4_PSTOF.C b/macros/g4simulations/G4_PSTOF.C new file mode 100644 index 000000000..d7f9acd06 --- /dev/null +++ b/macros/g4simulations/G4_PSTOF.C @@ -0,0 +1,27 @@ +// $Id$ + +/*! + * \file ${file_name} + * \brief Macro setting up the barrel mRPC psTOF + * \author Mickey Chiu + * \version $Revision$ + * \date $Date$ + */ + +void PSTOFInit() +{} + +double PSTOF(PHG4Reco* g4Reco, double radius, const int absorberactive = 0) +{ + gSystem->Load("libg4detectors.so"); + gSystem->Load("libg4testbench.so"); + + + PHG4PSTOFSubsystem *pstof = new PHG4PSTOFSubsystem( "PSTOF" ); + pstof->SuperDetector("PSTOF"); +// pstof->SetActive(-1,1); // set all modules active + g4Reco->registerSubsystem( pstof ); + +// returns the outer radius to check for overlaps with next detector + return 90.; +} diff --git a/macros/g4simulations/G4_PreShower.C b/macros/g4simulations/G4_PreShower.C deleted file mode 100644 index 413e1dfc0..000000000 --- a/macros/g4simulations/G4_PreShower.C +++ /dev/null @@ -1,57 +0,0 @@ - -int Min_preshower_layer = 1; -int Max_preshower_layer = 1; - -void PreShowerInit() -{ - Min_preshower_layer = 1; - Max_preshower_layer = 1; -} - -double -PreShower(PHG4Reco* g4Reco, double radius, const int absorberactive = 0) -{ - double preshower_inner_radius = 90.; - double radlen_w = 0.3504; // radiation length of w in cm - double tungstenwidth = 2.4*radlen_w; - - if (radius > preshower_inner_radius) { - cout << "inconsistency: svx radius+thickness: " << radius - << " larger than preshower inner radius: " << preshower_inner_radius - << endl; - gSystem->Exit(-1); - } - - radius = preshower_inner_radius; - - //--------------- - // Load libraries - //--------------- - - gSystem->Load("libg4detectors.so"); - gSystem->Load("libg4testbench.so"); - - PHG4CylinderSubsystem *cyl; - - cyl = new PHG4CylinderSubsystem("ABSORBER_PRESHOWER", 1); - cyl->SetRadius(radius); - cyl->SetMaterial("G4_W"); - cyl->SetThickness(tungstenwidth); - cyl->SuperDetector("ABSORBER_PRESHOWER"); - if (absorberactive) cyl->SetActive(); - g4Reco->registerSubsystem( cyl ); - radius += tungstenwidth; - radius += no_overlapp; - - cyl = new PHG4CylinderSubsystem("PRESHOWER", 1); - cyl->SetRadius(radius); - cyl->SetMaterial("G4_Si"); - cyl->SetThickness(0.0625); - cyl->SetActive(); - cyl->SuperDetector("PRESHOWER"); - g4Reco->registerSubsystem( cyl ); - radius += 0.0625; - radius += no_overlapp; - - return radius; -}