Skip to content
Draft

Esgen #130

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions data/ES.ratdb

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions data/ESCrossSection.ratdb

Large diffs are not rendered by default.

156 changes: 156 additions & 0 deletions data/SOLAR.ratdb

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions mac/watchman_es.mac
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/glg4debug/glg4param omit_muon_processes 0.0
/glg4debug/glg4param omit_hadronic_processes 0.0

/rat/db/set DETECTOR experiment "Watchman"
/rat/db/set DETECTOR geo_file "Watchman/Watchman.geo"

/run/initialize

# BEGIN EVENT LOOP
/rat/proc lesssimpledaq
/rat/proc fitbonsai
/rat/proc count
/rat/procset update 1

# Use IO.default_output_filename
/rat/proclast outroot
/rat/procset file "watchman_es.root"
#END EVENT LOOP

/generator/add combo es:fill:poisson
/generator/vtx/set 0 0 -1 ES:closest_boulby:nuebar
/generator/pos/set 0 0 0
/generator/rate/set 1

/run/beamOn 100
2 changes: 1 addition & 1 deletion src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
add_library(cmd OBJECT
src/CoincidenceMessenger.cc
src/DBMessenger.cc
src/ESgenMessenger.cc
src/ESCrossSecMessenger.cc
src/FastNeutronMessenger.cc
src/GLG4DebugMessenger.cc
src/GLG4PrimaryGeneratorMessenger.cc
Expand Down
64 changes: 64 additions & 0 deletions src/cmd/include/RAT/ESCrossSecMessenger.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
////////////////////////////////////////////////////////////////////
/// Code contributed by the SNO+ collaboration
///
/// \class RAT::ESCrossSecMessenger
///
/// \brief Messenger class to control cross section options.
///
/// \author Nuno Barros <nfbarros@hep.upenn.edu> -- contact person
///
/// REVISION HISTORY:\n
/// 10-FEB-2006 - Bill Seligman
/// Provide user commands to allow the user to change the ESgen parameters via the command line.
///
/// 18-FEB-2010 - Nuno Barros
/// Updated to pass the options to the cross-section object directly to provide independence
/// to the cross section class.
///
/// 22-JUN-2012 - Nuno Barros
/// Cleaned up code, cleaned documentation and renamed conflicting variables.
///
///
/// \details Controls user customizable options for the cross section class.
/// At the moment the customizations are:
/// - Control over the weak mixing angle.
/// - Control over the cross section calculation strategy. \see RAT::ESCrossSec for more details.
///
///
////////////////////////////////////////////////////////////////////

#ifndef RAT_ESCrossSectionMessenger_hh
#define RAT_ESCrossSectionMessenger_hh

#include <G4UImessenger.hh>
#include <G4String.hh>

// Forward declarations
class G4UIcommand;
class G4UIcmdWithADouble;
class G4UIcmdWithAnInteger;

namespace RAT {

// Forward declarations in namespace
class ESCrossSec;

class ESCrossSecMessenger: public G4UImessenger
{
public:
ESCrossSecMessenger(ESCrossSec*);
~ESCrossSecMessenger();

void SetNewValue(G4UIcommand* command, G4String newValues);
G4String GetCurrentValue(G4UIcommand* command);

private:
ESCrossSec* fESXS;

G4UIcmdWithADouble* fWmaCmd;
G4UIcmdWithAnInteger* fStratCmd;
};

} // namespace RAT

#endif // RAT_ESCrossSecMessenger_hh
40 changes: 0 additions & 40 deletions src/cmd/include/RAT/ESgenMessenger.hh

This file was deleted.

72 changes: 72 additions & 0 deletions src/cmd/src/ESCrossSecMessenger.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#include <RAT/ESCrossSecMessenger.hh>
#include <RAT/ESCrossSec.hh>
#include <RAT/Log.hh>
#include <G4UIcommand.hh>
#include <G4UIdirectory.hh>
#include <G4UIcmdWithADouble.hh>
#include <G4UIcmdWithAnInteger.hh>
#include <G4String.hh>

namespace RAT {

ESCrossSecMessenger::ESCrossSecMessenger(ESCrossSec* e) :
fESXS(e)
{
// Commands will go in a /generator/es/ directory
G4UIdirectory* dir = new G4UIdirectory("/generator/es/xsection/");
dir->SetGuidance("Control the physics parameters of the elastic-scattering generator");

fWmaCmd = new G4UIcmdWithADouble("/generator/es/xsection/wma", this);
fWmaCmd->SetGuidance("Sets the value of sine-squared theta (the weak mixing angle)");
fWmaCmd->SetParameterName("sin2th",false);
fWmaCmd->SetDefaultValue( fESXS->GetSinThetaW() );


fStratCmd = new G4UIcmdWithAnInteger("/generator/es/xsection/strategy", this);
fStratCmd->SetGuidance("Sets the strategy for the ES cross section calculation.");
fStratCmd->SetGuidance("Usage: /generator/es/xsection/strategy strat");
fStratCmd->SetGuidance("Options:");
fStratCmd->SetGuidance(" 1 : Original routine from QSNO::PNuE (Bahcall).");
fStratCmd->SetGuidance(" 2 : Improved routine from QSNO::PNuE (without rad. corrections).");
fStratCmd->SetGuidance(" 3 : Improved routine from QSNO::PNuE (with rad. corrections - analytical).");
fStratCmd->SetGuidance(" 4 (default) : Improved routine from QSNO::PNuE (with rad. corrections - table).");
fStratCmd->SetParameter(new G4UIparameter("strat",'i',false));
fStratCmd->SetDefaultValue( fESXS->GetRadiativeCorrection() );


//

}

ESCrossSecMessenger::~ESCrossSecMessenger() {;}

void ESCrossSecMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
if ( command == fWmaCmd )
{
G4double wma = fWmaCmd->GetNewDoubleValue( newValue );
fESXS->SetSinThetaW( wma );
}
else if ( command == fStratCmd )
{
G4int strat = fStratCmd->GetNewIntValue( newValue );
fESXS->SetRadiativeCorrection( strat );
}
else
{
warn << "Error: Invalid ESCrossSecMessenger \"set\" command" << newline;
}
}

G4String ESCrossSecMessenger::GetCurrentValue(G4UIcommand* command)
{
if ( command == fWmaCmd )
return fWmaCmd->ConvertToString( fESXS->GetSinThetaW() );
else if ( command == fStratCmd )
return fStratCmd->ConvertToString( fESXS->GetRadiativeCorrection() );

// Error if we reach here.
return G4String("Error: Invalid ESCrossSecMessenger \"get\" command");
}

} // namespace RAT
66 changes: 0 additions & 66 deletions src/cmd/src/ESgenMessenger.cc

This file was deleted.

1 change: 1 addition & 0 deletions src/gen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ add_library(gen OBJECT
src/Coincidence_Gen.cc
src/DecayChain.cc
src/DecayChain_Gen.cc
src/ESCrossSec.cc
src/ESgen.cc
src/FermiFunction.cc
src/GLG4DeferTrackProc.cc
Expand Down
Loading