forked from WCSim/WCSim
-
Notifications
You must be signed in to change notification settings - Fork 49
Nickel source implementation, including bug fix and example mac file #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pabloferm
wants to merge
11
commits into
nuPRISM:nuPRISM/develop
Choose a base branch
from
pabloferm:niball
base: nuPRISM/develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9d37518
Nickel source implementation, including bug fix and example mac file
6b3d2cf
Back to original getenv("WCSIMDIR"), inhereted from other WCSim versions
a150398
Missing niball command
d444473
Using GEANT's random numbers instead of ROOT's TRandom
b332821
Using GEANT's random numbers instead of ROOT's TRandom
f0918fc
Undo some modifications to defaults
98fbc28
Ni gamma spectrum to private
301ace2
Requested changes from PR: read Ni source spectrum from file
14ec6b5
undo some minor changes
de8618b
Merge branch 'nuPRISM/develop' into niball
pabloferm eb309dc
bug fixes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| #ifndef WCSimGenerator_NiBall_hh | ||
| #define WCSimGenerator_NiBall_hh 1 | ||
|
|
||
| #include "G4ReactionProductVector.hh" | ||
| #include "G4ThreeVector.hh" | ||
| #include <vector> | ||
| #include "WCSimDetectorConstruction.hh" | ||
| #include "TF2.h" | ||
| #include "TGraph.h" | ||
| #include "TMath.h" | ||
|
|
||
|
|
||
| using namespace std; | ||
|
|
||
| class WCSimDetectorConstruction; | ||
|
|
||
| class WCSimGenerator_NiBall | ||
| { | ||
| public: | ||
| WCSimGenerator_NiBall(WCSimDetectorConstruction* myDC); | ||
| ~WCSimGenerator_NiBall(); | ||
| void Initialize(); | ||
|
|
||
| G4ThreeVector GetRandomVertex(G4int tSymNumber); | ||
| int GetNiGammaMode() { return fNiGammaMode; } | ||
| int GetNiGammaMultiplicity() { return fNiGammaMultiplicity; } | ||
| double * GetNiGammaEnergy() { return fNiGammaEnergy; } | ||
| double * GetNiGammaPosition() { return fNiGammaPosition;} | ||
|
|
||
| void SettingNiBall(double fNiBallPosition[3], double rn[6]); | ||
|
|
||
| private: | ||
|
|
||
| int fNiGammaMode; | ||
| int fNiGammaMultiplicity; | ||
| double fNiGammaEnergy[4]; | ||
| double fNiGammaPosition[3]; | ||
| WCSimDetectorConstruction* myDetector; | ||
|
|
||
| // Constants of gamma production as taken from SK | ||
| static G4double NiBallBR[37]; | ||
| static G4int NiBallMulti[37]; | ||
| static G4double NiBallEnergy[4][37]; | ||
| }; | ||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,251 @@ | ||
| # Sample setup macro with no visualization | ||
|
|
||
| /run/verbose 1 | ||
| /tracking/verbose 0 | ||
| /hits/verbose 0 | ||
|
|
||
| ## select the geometry | ||
| # Default config if you do nothing is currently SuperK | ||
| # | ||
|
|
||
| #/WCSim/WCgeom nuPRISM | ||
|
|
||
| #Select which PMT to use | ||
| #/WCSim/nuPRISM/SetPMTType PMT8inch | ||
| #/WCSim/nuPRISM/SetPMTPercentCoverage 40 | ||
| #Set height of nuPRISM inner detector | ||
| #/WCSim/nuPRISM/SetDetectorHeight 6. m | ||
| #Set vertical position of inner detector, in beam coordinates | ||
| #/WCSim/nuPRISM/SetDetectorVerticalPosition 0. m | ||
| #Set diameter of inner detector | ||
| #/WCSim/nuPRISM/SetDetectorDiameter 8. m | ||
| # Set Gadolinium doping (concentration is in percent) | ||
| #/WCSim/DopingConcentration 0.1 | ||
| #/WCSim/DopedWater false | ||
| #/WCSim/Construct | ||
| #/WCSim/mPMT/PMTtype_inner PMT3inchR14374 | ||
| #/WCSim/mPMT/PMTtype_outer PMT3inchR14374 | ||
|
|
||
| #Use mPMTs settings (uncomment/delete the above) | ||
| /WCSim/WCgeom HyperK_HybridmPMT10PC | ||
| #/WCSim/mPMT/PMTtype_inner PMT3inchR14374 | ||
| #/WCSim/mPMT/PMTtype_outer PMT3inchR14374 | ||
| #/WCSim/WCgeom HyperK_mPMT | ||
| #/WCSim/WCgeom HyperK | ||
| #/WCSim/WCgeom nuPRISM_mPMT | ||
| #/WCSim/WCgeom nuPRISMShort_mPMT | ||
| # Set Gadolinium doping (concentration is in percent) | ||
| #/WCSim/DopingConcentration 0.1 | ||
| #/WCSim/DopedWater false | ||
| /WCSim/Construct | ||
| ## OR for single mPMT mode or updating mPMT parameters: | ||
| #/control/execute macros/mPMT_nuPrism1.mac ## mPMT options: mPMT_nuPrism1.mac and 2.mac | ||
|
|
||
| /WCSim/tuning/rayff 0.75 | ||
| /WCSim/tuning/bsrff 2.25 | ||
| /WCSim/tuning/abwff 1.30 | ||
| /WCSim/tuning/rgcff 0.32 | ||
|
|
||
| #/WCSim/mPMT/reflectorHeightID 7. mm | ||
| #/WCSim/mPMT/reflectorHeightID 7. mm | ||
| #/WCSim/mPMT/reflectorAngleID 48. deg | ||
|
|
||
| #Added for the PMT QE option 08/17/10 (XQ) | ||
| # 1. Stacking only mean when the photon is generated | ||
| # the QE is applied to reduce the total number of photons | ||
| # 2. Stacking and sensitivity detector | ||
| # In the stacking part, the maximum QE is applied to reduce | ||
| # the total number of photons | ||
| # On the detector side, the rest of QE are applied according to QE/QE_max | ||
| # distribution. This option is in particular important for the WLS | ||
| # 3. The last option means all the QE are applied at the detector | ||
| # Good for the low energy running. | ||
| # 4. Switch off the QE, ie. set it at 100% | ||
| /WCSim/PMTQEMethod Stacking_Only | ||
| #/WCSim/PMTQEMethod Stacking_And_SensitiveDetector | ||
| #/WCSim/PMTQEMethod SensitiveDetector_Only | ||
| #/WCSim/PMTQEMethod DoNotApplyQE | ||
|
|
||
| #turn on or off the collection efficiency | ||
| /WCSim/PMTCollEff on | ||
|
|
||
| # command to choose save or not save the pi0 info 07/03/10 (XQ) | ||
| /WCSim/SavePi0 false | ||
|
|
||
| #choose the Trigger & Digitizer type (and options) | ||
| /DAQ/Digitizer SKI | ||
| /DAQ/Trigger NDigits | ||
| /DAQ/TriggerNDigits/Threshold 0 | ||
| /DAQ/TriggerNDigits/AdjustForNoise false | ||
|
|
||
| #grab the other DAQ options (thresholds, timing windows, etc.) | ||
| /control/execute macros/daq.mac | ||
|
|
||
|
|
||
| # default dark noise frequency (and conversion factor) is PMT property (NEW), set in the code. | ||
| # Below gives possibility to overwrite nominal values, eg. to switch OFF the Dark Noise. | ||
| #/DarkRate/SetDarkRate 0 kHz #Turn dark noise off | ||
| #/DarkRate/SetDarkRate 4.2 kHz #This is the value for SKI set in SKDETSIM. | ||
| #/DarkRate/SetDarkRate 8.4 kHz #For 20 inch HPDs and Box and Line PMTs, based on High QE 20in R3600 dark rate from EGADS nov 2014 | ||
| #/DarkRate/SetDarkRate 3.0 kHz #For 12 inch HPDs and Box and Line PMTs, based on High QE 20in R3600 dark rate from EGADS nov 2014 | ||
|
|
||
| # command to multiply the dark rate. | ||
| # Convert dark noise frequency before digitization to after digitization by setting suitable factor | ||
| # Again, this is now a PMT property and can be overridden here | ||
| #/DarkRate/SetConvert 1.367 #For Normal PMT | ||
| #/DarkRate/SetConvert 1.119 #For HPDs | ||
| #/DarkRate/SetConvert 1.126 #For Box and Line PMTs | ||
|
|
||
| # Select which time window(s) to add dark noise to | ||
| #/DarkRate/SetDarkMode 0 to add dark noise to a time window starting at | ||
| #/DarkRate/SetDarkLow to /DarkRate/SetDarkHigh [time in ns] | ||
| #/DarkRate/SetDarkMode 1 adds dark noise hits to a window of | ||
| #width /DarkRate/SetDarkWindow [time in ns] around each hit | ||
| #i.e. hit time ± (/DarkRate/SetDarkWindow) / 2 | ||
| /DarkRate/SetDarkMode 1 | ||
| /DarkRate/SetDarkHigh 100000 | ||
| /DarkRate/SetDarkLow 0 | ||
| /DarkRate/SetDarkWindow 4000 | ||
|
|
||
| #Uncomment one of the lines below if you want to use the OGLSX or RayTracer visualizer | ||
| #/control/execute macros/visOGLSX.mac | ||
| #/control/execute macros/visRayTracer.mac | ||
| #/control/execute macros/visOGLQT.mac ## NEW | ||
|
|
||
| ## select the input nuance-formatted vector file | ||
| ## you can of course use your own | ||
| #/mygen/generator muline | ||
| #/mygen/vecfile inputvectorfile | ||
| #/mygen/vecfile h2o.2km.001-009x3_G4.kin | ||
| #/mygen/vecfile mu+.out | ||
|
|
||
| # Or you can use the G4 Particle Gun | ||
| # for a full list of /gun/ commands see: | ||
| # http://geant4.web.cern.ch/geant4/G4UsersDocuments/UsersGuides/ForApplicationDeveloper/html/Control/UIcommands/_gun_.html | ||
| #/mygen/generator gun | ||
| #/gun/particle gamma | ||
| #/gun/particle e- | ||
| #/gun/particle mu- | ||
| #/gun/particle pi0 | ||
| #/gun/energy 500 MeV | ||
| #/gun/direction 1 0 0 | ||
| #/gun/position 0 0 0 m | ||
| #/gun/number 100 | ||
|
|
||
| # Or you can use the G4 General Particle Source | ||
| # you can do a lot more with this than a monoenergetic, monodirectional, single-particle gun | ||
| # for a full list of /gps/ commands see: | ||
| # https://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ch02s07.html | ||
| /mygen/generator gps | ||
| #/gps/particle gamma | ||
| /gps/particle e- | ||
| /gps/energy 10 MeV | ||
| #/gps/energy 1 MeV | ||
| /gps/direction 1 0 0 | ||
| #/gps/position 0. 0. 0. m | ||
| #/gps/position 3.5 0. 0. m | ||
|
|
||
| # Position: a surface | ||
| #/gps/pos/type | ||
| #/gps/pos/shape Cylinder | ||
| #/gps/pos/halfz 4.5 m | ||
| #/gps/pos/radius 3.9 m | ||
|
|
||
| # Position: a cylinder | ||
| /gps/pos/type Volume | ||
| /gps/pos/shape Cylinder | ||
| /gps/pos/halfz 30.4 m | ||
| /gps/pos/radius 38.4 m | ||
|
|
||
| # Position: a sphere | ||
| #/gps/pos/type Volume | ||
| #/gps/pos/shape Sphere | ||
| #/gps/pos/radius 200. cm | ||
| #/gps/pos/centre 0. 0. 0. m | ||
|
|
||
| # Direction: unidirection along x | ||
| #/gps/ang/type beam1d | ||
| #/gps/ang/rot1 0 0 1 | ||
| #/gps/ang/rot2 0 1 0 | ||
|
|
||
| # Direction: a sphere | ||
| /gps/ang/type iso | ||
| #/gps/ang/mintheta 0 deg | ||
| #/gps/ang/maxtheta 180 deg | ||
| #/gps/ang/minphi 0 deg | ||
| #/gps/ang/maxphi 360 deg | ||
|
|
||
| # spectrum: uniform between 200 and 1000 MeV | ||
| #/gps/ene/type Lin | ||
| #/gps/ene/gradient 0 | ||
| #/gps/ene/intercept 1 | ||
| #/gps/ene/type Mono | ||
| #/gps/ene/mono 500 MeV | ||
| #/gps/ene/min 200 MeV | ||
| #/gps/ene/max 1000 MeV | ||
|
|
||
| #/random/setSeeds 1225 1500 | ||
|
|
||
| # Or you can use the laser option | ||
| # This is equivalent to the gps command, except that the gps particle energies are saved ignoring their mass | ||
| # for a full list of /gps/ commands see: | ||
| # https://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ch02s07.html | ||
| # It is used for laser calibration simulation | ||
| #/mygen/generator laser | ||
| #/gps/particle opticalphoton | ||
| #/gps/energy 3.5 keV | ||
| #/gps/direction 1 0 0 | ||
| #/gps/position 3.5 0 0 m | ||
| #/gps/number 1000 | ||
| #/gps/ang/type iso | ||
| #/gps/ang/mintheta 0 deg | ||
| #/gps/ang/maxtheta 0 deg | ||
| #/gps/ang/minphi 0 deg | ||
| #/gps/ang/maxphi 90 deg | ||
|
|
||
| ##### NEW | ||
| /Tracking/fractionOpticalPhotonsToDraw 0.0 | ||
|
|
||
| # Radon option | ||
| # IMPORTANT: You need to compile WCSim with cmake in order to use the radioactive decays | ||
| # Generate Bi214 decay in the water following a Model extracted from SK-IV solar data | ||
| #/mygen/generator radon | ||
| # This window should match the one in biasprofile.dat if time bias is used (see below) | ||
| #/mygen/radioactive_time_window 1.e-4 | ||
| # Needed if time bias is not used, in order to keep timing below one sec. | ||
| #/DAQ/RelativeHitTime true | ||
| # The following set which scenario is used to scale SK model to HK | ||
| #/mygen/radon_scaling A # Relative scaling with respect to full ID volume (Pessimistic) | ||
| #/mygen/radon_scaling B # Absolute scaling with respect to ID border (Optimistic) | ||
| #/mygen/radon_scaling 0 # Uniform distribution | ||
| #/mygen/radon_symmetry 1 # Divide the detector in x slices using the theta symmetry | ||
| #Clear the source and tell GPS to make multiple vertices | ||
| #/gps/source/clear | ||
|
|
||
| # Needed to prevent other decay than Bi-214 | ||
| #/grdm/nucleusLimits 214 214 83 83 | ||
| # if you need to use time bias | ||
| #/grdm/decayBiasProfile biasprofile.dat | ||
| #/grdm/analogueMC 0 | ||
| #/grdm/BRbias 0 | ||
|
|
||
| # Nickel calibration | ||
| # For the time being set the coordinates for the center position of the ball in cm. | ||
| # In future modify to select the calibration port and the Z-position of the ball. | ||
| /mygen/generator niball | ||
| /mygen/niball_x 10.0 | ||
| /mygen/niball_y -300.0 | ||
| /mygen/niball_z 1.0 | ||
| #Clear the source and tell GPS to make multiple vertices | ||
| /gps/source/clear | ||
|
|
||
|
|
||
| ## change the name of the output root file, default = wcsim.root | ||
| /WCSimIO/RootFile wcsim_output.root | ||
|
|
||
| ## Boolean to select whether to save the NEUT RooTracker vertices in the output file, provided you used | ||
| ## a NEUT vector file as input | ||
| /WCSimIO/SaveRooTracker 0 | ||
|
|
||
| /run/beamOn 10 | ||
| #exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.